From b2e1176d5862157370d7418355cf0306f66ab25e Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 20 May 2016 10:38:08 +0900 Subject: [PATCH] Imported Upstream version 2.8 Change-Id: Ib1703b258064a279859239ec142504f5d50d3114 Signed-off-by: DongHun Kwak --- ABOUT-NLS | 1101 ++ AUTHORS | 6 + COPYING | 340 + ChangeLog | 1781 +++ INSTALL | 234 + Makefile.am | 23 + Makefile.in | 900 ++ NEWS | 155 + README | 71 + THANKS | 20 + TODO | 159 + aclocal.m4 | 981 ++ build-aux/config.guess | 1516 ++ build-aux/config.rpath | 614 + build-aux/config.sub | 1626 +++ build-aux/depcomp | 589 + build-aux/install-sh | 519 + build-aux/mdate-sh | 205 + build-aux/missing | 367 + build-aux/mkinstalldirs | 161 + build-aux/texinfo.tex | 8641 +++++++++++ build-aux/ylwrap | 223 + config.h.in | 998 ++ configure | 36462 ++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 105 + doc/Makefile.am | 26 + doc/Makefile.in | 912 ++ doc/cpio.1 | 41 + doc/cpio.info | 556 + doc/cpio.texi | 602 + doc/gendocs_template | 108 + doc/mt.1 | 126 + doc/stamp-vti | 4 + doc/version.texi | 4 + headers/Makefile.am | 19 + headers/Makefile.in | 589 + headers/fnmatch.h | 67 + lib/Makefile.am | 48 + lib/Makefile.in | 1322 ++ lib/__fpending.c | 30 + lib/__fpending.h | 34 + lib/alloca.c | 489 + lib/alloca_.h | 54 + lib/allocsa.c | 137 + lib/allocsa.h | 124 + lib/allocsa.valgrind | 7 + lib/argmatch.c | 278 + lib/argmatch.h | 103 + lib/argp-ba.c | 25 + lib/argp-eexst.c | 31 + lib/argp-fmtstream.c | 435 + lib/argp-fmtstream.h | 301 + lib/argp-fs-xinl.c | 43 + lib/argp-help.c | 1954 +++ lib/argp-namefrob.h | 158 + lib/argp-parse.c | 953 ++ lib/argp-pin.c | 28 + lib/argp-pv.c | 24 + lib/argp-pvh.c | 31 + lib/argp-xinl.c | 43 + lib/argp.h | 622 + lib/asnprintf.c | 35 + lib/at-func.c | 86 + lib/basename.c | 129 + lib/canonicalize-lgpl.c | 353 + lib/canonicalize.h | 54 + lib/chdir-long.c | 265 + lib/chdir-long.h | 35 + lib/chown.c | 104 + lib/close-stream.c | 76 + lib/close-stream.h | 2 + lib/closeout.c | 86 + lib/closeout.h | 33 + lib/creat-safer.c | 32 + lib/dirent_.h | 50 + lib/dirfd.c | 29 + lib/dirfd.h | 29 + lib/dirname.c | 85 + lib/dirname.h | 70 + lib/dup-safer.c | 45 + lib/dup2.c | 58 + lib/error.c | 338 + lib/error.h | 66 + lib/exitfail.c | 26 + lib/exitfail.h | 20 + lib/fatal.c | 27 + lib/fchdir.c | 279 + lib/fchmodat.c | 50 + lib/fchown-stub.c | 16 + lib/fchownat.c | 50 + lib/fcntl--.h | 28 + lib/fcntl-safer.h | 24 + lib/fcntl_.h | 125 + lib/fd-safer.c | 57 + lib/fileblocks.c | 75 + lib/float+.h | 148 + lib/float_.h | 63 + lib/fnmatch.c | 354 + lib/fnmatch_.h | 65 + lib/fnmatch_loop.c | 1210 ++ lib/fstatat.c | 57 + lib/full-write.c | 81 + lib/full-write.h | 35 + lib/getcwd.c | 428 + lib/getdate.c | 3289 +++++ lib/getdate.h | 23 + lib/getdate.y | 1520 ++ lib/getopt.c | 1191 ++ lib/getopt1.c | 171 + lib/getopt_.h | 226 + lib/getopt_int.h | 131 + lib/gettext.h | 270 + lib/gettime.c | 49 + lib/gettimeofday.c | 142 + lib/gnulib.mk | 1244 ++ lib/hash.c | 1048 ++ lib/hash.h | 88 + lib/imaxtostr.c | 3 + lib/intprops.h | 78 + lib/inttostr.c | 51 + lib/inttostr.h | 30 + lib/inttypes_.h | 1100 ++ lib/lchown.c | 47 + lib/lchown.h | 42 + lib/lstat.c | 76 + lib/lstat.h | 24 + lib/malloc.c | 35 + lib/mempcpy.c | 29 + lib/memrchr.c | 190 + lib/mkdirat.c | 43 + lib/mktime.c | 663 + lib/obstack.c | 431 + lib/obstack.h | 513 + lib/offtostr.c | 3 + lib/open-safer.c | 50 + lib/openat-die.c | 51 + lib/openat-priv.h | 55 + lib/openat-proc.c | 95 + lib/openat.c | 270 + lib/openat.h | 127 + lib/pathmax.h | 47 + lib/paxerror.c | 365 + lib/paxexit.c | 28 + lib/paxlib.h | 115 + lib/paxnames.c | 156 + lib/pipe-safer.c | 57 + lib/printf-args.c | 139 + lib/printf-args.h | 132 + lib/printf-parse.c | 543 + lib/printf-parse.h | 74 + lib/quote.c | 41 + lib/quote.h | 22 + lib/quotearg.c | 697 + lib/quotearg.h | 140 + lib/readlink.c | 50 + lib/rmt-command.h | 4 + lib/rmt.h | 99 + lib/rtapelib.c | 740 + lib/safe-read.c | 78 + lib/safe-read.h | 35 + lib/safe-write.c | 19 + lib/safe-write.h | 25 + lib/same-inode.h | 26 + lib/save-cwd.c | 103 + lib/save-cwd.h | 34 + lib/savedir.c | 137 + lib/savedir.h | 27 + lib/setenv.c | 332 + lib/setenv.h | 54 + lib/sleep.c | 47 + lib/stdbool_.h | 118 + lib/stdint_.h | 512 + lib/stdio_.h | 320 + lib/stdlib_.h | 140 + lib/stpcpy.c | 49 + lib/strcasecmp.c | 63 + lib/strchrnul.c | 32 + lib/strdup.c | 55 + lib/strerror.c | 57 + lib/string_.h | 546 + lib/stripslash.c | 45 + lib/strncasecmp.c | 63 + lib/strndup.c | 37 + lib/strnlen.c | 31 + lib/strtol.c | 436 + lib/sys_stat_.h | 284 + lib/sys_time_.h | 52 + lib/sysexits_.h | 72 + lib/system-ioctl.h | 55 + lib/system.h | 475 + lib/time_.h | 125 + lib/time_r.c | 47 + lib/timespec.h | 37 + lib/uinttostr.c | 3 + lib/umaxtostr.c | 3 + lib/unistd--.h | 28 + lib/unistd-safer.h | 23 + lib/unistd_.h | 242 + lib/unlocked-io.h | 137 + lib/unsetenv.c | 92 + lib/utimens.c | 189 + lib/utimens.h | 3 + lib/vasnprintf.c | 3193 ++++ lib/vasnprintf.h | 81 + lib/verify.h | 141 + lib/version-etc-fsf.c | 31 + lib/version-etc.c | 173 + lib/version-etc.h | 37 + lib/vsnprintf.c | 76 + lib/wchar_.h | 50 + lib/wctype_.h | 165 + lib/xalloc-die.c | 42 + lib/xalloc.h | 271 + lib/xgetcwd.c | 41 + lib/xgetcwd.h | 18 + lib/xmalloc.c | 123 + lib/xsize.h | 108 + lib/xstrndup.c | 37 + lib/xstrndup.h | 24 + m4/absolute-header.m4 | 44 + m4/alloca.m4 | 50 + m4/allocsa.m4 | 14 + m4/argmatch.m4 | 10 + m4/argp.m4 | 65 + m4/bison.m4 | 24 + m4/canonicalize-lgpl.m4 | 35 + m4/chdir-long.m4 | 38 + m4/chown.m4 | 83 + m4/clock_time.m4 | 30 + m4/close-stream.m4 | 13 + m4/closeout.m4 | 13 + m4/d-ino.m4 | 41 + m4/dirfd.m4 | 74 + m4/dirname.m4 | 18 + m4/dos.m4 | 71 + m4/double-slash-root.m4 | 38 + m4/dup2.m4 | 15 + m4/eealloc.m4 | 32 + m4/eoverflow.m4 | 70 + m4/error.m4 | 22 + m4/exitfail.m4 | 13 + m4/extensions.m4 | 58 + m4/fchdir.m4 | 28 + m4/fcntl-safer.m4 | 11 + m4/fcntl_h.m4 | 81 + m4/fileblocks.m4 | 20 + m4/float_h.m4 | 21 + m4/fnmatch.m4 | 127 + m4/fpending.m4 | 78 + m4/getcwd-abort-bug.m4 | 106 + m4/getcwd-path-max.m4 | 190 + m4/getcwd.m4 | 64 + m4/getdate.m4 | 33 + m4/getopt.m4 | 83 + m4/gettext.m4 | 420 + m4/gettime.m4 | 15 + m4/gettimeofday.m4 | 101 + m4/gnulib-common.m4 | 22 + m4/gnulib-comp.m4 | 498 + m4/hash.m4 | 13 + m4/iconv.m4 | 180 + m4/inline.m4 | 40 + m4/intmax_t.m4 | 61 + m4/inttostr.m4 | 37 + m4/inttypes-pri.m4 | 36 + m4/inttypes.m4 | 223 + m4/inttypes_h.m4 | 26 + m4/lchown.m4 | 19 + m4/lib-ld.m4 | 110 + m4/lib-link.m4 | 709 + m4/lib-prefix.m4 | 185 + m4/longlong.m4 | 72 + m4/lstat.m4 | 17 + m4/mbrtowc.m4 | 31 + m4/mbstate_t.m4 | 30 + m4/mempcpy.m4 | 26 + m4/memrchr.m4 | 25 + m4/mktime.m4 | 227 + m4/nls.m4 | 31 + m4/onceonly_2_57.m4 | 86 + m4/openat.m4 | 90 + m4/pathmax.m4 | 11 + m4/paxutils.m4 | 7 + m4/po.m4 | 428 + m4/progtest.m4 | 92 + m4/quote.m4 | 13 + m4/quotearg.m4 | 15 + m4/readlink.m4 | 29 + m4/rmt.m4 | 74 + m4/rtapelib.m4 | 3 + m4/safe-read.m4 | 18 + m4/safe-write.m4 | 18 + m4/save-cwd.m4 | 12 + m4/savedir.m4 | 10 + m4/setenv.m4 | 82 + m4/size_max.m4 | 68 + m4/sleep.m4 | 19 + m4/ssize_t.m4 | 21 + m4/stdarg.m4 | 40 + m4/stdbool.m4 | 115 + m4/stdint.m4 | 371 + m4/stdint_h.m4 | 26 + m4/stdio_h.m4 | 79 + m4/stdlib_h.m4 | 31 + m4/stpcpy.m4 | 26 + m4/strcase.m4 | 44 + m4/strchrnul.m4 | 21 + m4/strdup.m4 | 22 + m4/strerror.m4 | 26 + m4/string_h.m4 | 78 + m4/strndup.m4 | 53 + m4/strnlen.m4 | 31 + m4/strtol.m4 | 10 + m4/sys_stat_h.m4 | 50 + m4/sys_time_h.m4 | 61 + m4/sysexits.m4 | 45 + m4/system.m4 | 29 + m4/time_h.m4 | 76 + m4/time_r.m4 | 41 + m4/timespec.m4 | 16 + m4/tm_gmtoff.m4 | 14 + m4/ulonglong.m4 | 48 + m4/unistd-safer.m4 | 13 + m4/unistd_h.m4 | 55 + m4/unlocked-io.m4 | 42 + m4/utimbuf.m4 | 39 + m4/utimens.m4 | 15 + m4/utimes.m4 | 83 + m4/vasnprintf.m4 | 181 + m4/vsnprintf.m4 | 31 + m4/wchar.m4 | 29 + m4/wchar_t.m4 | 20 + m4/wctype.m4 | 47 + m4/wint_t.m4 | 28 + m4/xalloc.m4 | 24 + m4/xgetcwd.m4 | 12 + m4/xsize.m4 | 13 + m4/xstrndup.m4 | 15 + po/LINGUAS | 19 + po/Makefile.in.in | 405 + po/Makevars | 59 + po/POTFILES.in | 16 + po/Rules-quot | 47 + po/boldquot.sed | 10 + po/cpio.pot | 911 ++ po/da.gmo | Bin 0 -> 4330 bytes po/da.po | 1154 ++ po/de.gmo | Bin 0 -> 4592 bytes po/de.po | 1162 ++ po/en@boldquot.header | 25 + po/en@quot.header | 22 + po/es.gmo | Bin 0 -> 15282 bytes po/es.po | 1255 ++ po/fr.gmo | Bin 0 -> 15578 bytes po/fr.po | 1244 ++ po/ga.gmo | Bin 0 -> 22553 bytes po/ga.po | 1019 ++ po/gl.gmo | Bin 0 -> 4708 bytes po/gl.po | 1162 ++ po/hu.gmo | Bin 0 -> 4582 bytes po/hu.po | 1165 ++ po/insert-header.sin | 23 + po/ko.gmo | Bin 0 -> 5437 bytes po/ko.po | 1202 ++ po/nl.gmo | Bin 0 -> 20939 bytes po/nl.po | 977 ++ po/pl.gmo | Bin 0 -> 21430 bytes po/pl.po | 986 ++ po/pt_BR.gmo | Bin 0 -> 4516 bytes po/pt_BR.po | 1160 ++ po/quot.sed | 6 + po/remove-potcdate.sin | 19 + po/ro.gmo | Bin 0 -> 4631 bytes po/ro.po | 1169 ++ po/ru.gmo | Bin 0 -> 14713 bytes po/ru.po | 984 ++ po/rw.gmo | Bin 0 -> 506 bytes po/rw.po | 1012 ++ po/stamp-po | 1 + po/sv.gmo | Bin 0 -> 14329 bytes po/sv.po | 1248 ++ po/tr.gmo | Bin 0 -> 21534 bytes po/tr.po | 981 ++ po/uk.gmo | Bin 0 -> 29389 bytes po/uk.po | 990 ++ po/vi.gmo | Bin 0 -> 23607 bytes po/vi.po | 978 ++ po/zh_CN.gmo | Bin 0 -> 3466 bytes po/zh_CN.po | 1122 ++ rmt/Makefile.am | 13 + rmt/Makefile.in | 713 + rmt/rmt.c | 676 + src/Makefile.am | 55 + src/Makefile.in | 781 + src/copyin.c | 1579 ++ src/copyout.c | 897 ++ src/copypass.c | 431 + src/cpio.h | 72 + src/cpiohdr.h | 106 + src/defer.c | 43 + src/defer.h | 26 + src/dstring.c | 103 + src/dstring.h | 50 + src/extern.h | 221 + src/filemode.c | 243 + src/filetypes.h | 85 + src/global.c | 201 + src/idcache.c | 207 + src/main.c | 800 + src/makepath.c | 267 + src/mt.c | 337 + src/safe-stat.h | 1 + src/tar.c | 479 + src/tar.h | 112 + src/tarhdr.h | 63 + src/userspec.c | 259 + src/util.c | 1342 ++ tests/Makefile.am | 84 + tests/Makefile.in | 718 + tests/argcv.c | 396 + tests/argcv.h | 50 + tests/atlocal.in | 6 + tests/genfile.c | 884 ++ tests/inout.at | 40 + tests/package.m4 | 6 + tests/symlink.at | 48 + tests/testsuite | 1742 +++ tests/testsuite.at | 33 + tests/version.at | 34 + 429 files changed, 144848 insertions(+) create mode 100644 ABOUT-NLS create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 THANKS create mode 100644 TODO create mode 100644 aclocal.m4 create mode 100755 build-aux/config.guess create mode 100755 build-aux/config.rpath create mode 100755 build-aux/config.sub create mode 100755 build-aux/depcomp create mode 100755 build-aux/install-sh create mode 100755 build-aux/mdate-sh create mode 100755 build-aux/missing create mode 100755 build-aux/mkinstalldirs create mode 100644 build-aux/texinfo.tex create mode 100755 build-aux/ylwrap create mode 100644 config.h.in create mode 100755 configure create mode 100644 configure.ac create mode 100644 doc/Makefile.am create mode 100644 doc/Makefile.in create mode 100644 doc/cpio.1 create mode 100644 doc/cpio.info create mode 100644 doc/cpio.texi create mode 100755 doc/gendocs_template create mode 100644 doc/mt.1 create mode 100644 doc/stamp-vti create mode 100644 doc/version.texi create mode 100644 headers/Makefile.am create mode 100644 headers/Makefile.in create mode 100644 headers/fnmatch.h create mode 100644 lib/Makefile.am create mode 100644 lib/Makefile.in create mode 100644 lib/__fpending.c create mode 100644 lib/__fpending.h create mode 100644 lib/alloca.c create mode 100644 lib/alloca_.h create mode 100644 lib/allocsa.c create mode 100644 lib/allocsa.h create mode 100644 lib/allocsa.valgrind create mode 100644 lib/argmatch.c create mode 100644 lib/argmatch.h create mode 100644 lib/argp-ba.c create mode 100644 lib/argp-eexst.c create mode 100644 lib/argp-fmtstream.c create mode 100644 lib/argp-fmtstream.h create mode 100644 lib/argp-fs-xinl.c create mode 100644 lib/argp-help.c create mode 100644 lib/argp-namefrob.h create mode 100644 lib/argp-parse.c create mode 100644 lib/argp-pin.c create mode 100644 lib/argp-pv.c create mode 100644 lib/argp-pvh.c create mode 100644 lib/argp-xinl.c create mode 100644 lib/argp.h create mode 100644 lib/asnprintf.c create mode 100644 lib/at-func.c create mode 100644 lib/basename.c create mode 100644 lib/canonicalize-lgpl.c create mode 100644 lib/canonicalize.h create mode 100644 lib/chdir-long.c create mode 100644 lib/chdir-long.h create mode 100644 lib/chown.c create mode 100644 lib/close-stream.c create mode 100644 lib/close-stream.h create mode 100644 lib/closeout.c create mode 100644 lib/closeout.h create mode 100644 lib/creat-safer.c create mode 100644 lib/dirent_.h create mode 100644 lib/dirfd.c create mode 100644 lib/dirfd.h create mode 100644 lib/dirname.c create mode 100644 lib/dirname.h create mode 100644 lib/dup-safer.c create mode 100644 lib/dup2.c create mode 100644 lib/error.c create mode 100644 lib/error.h create mode 100644 lib/exitfail.c create mode 100644 lib/exitfail.h create mode 100644 lib/fatal.c create mode 100644 lib/fchdir.c create mode 100644 lib/fchmodat.c create mode 100644 lib/fchown-stub.c create mode 100644 lib/fchownat.c create mode 100644 lib/fcntl--.h create mode 100644 lib/fcntl-safer.h create mode 100644 lib/fcntl_.h create mode 100644 lib/fd-safer.c create mode 100644 lib/fileblocks.c create mode 100644 lib/float+.h create mode 100644 lib/float_.h create mode 100644 lib/fnmatch.c create mode 100644 lib/fnmatch_.h create mode 100644 lib/fnmatch_loop.c create mode 100644 lib/fstatat.c create mode 100644 lib/full-write.c create mode 100644 lib/full-write.h create mode 100644 lib/getcwd.c create mode 100644 lib/getdate.c create mode 100644 lib/getdate.h create mode 100644 lib/getdate.y create mode 100644 lib/getopt.c create mode 100644 lib/getopt1.c create mode 100644 lib/getopt_.h create mode 100644 lib/getopt_int.h create mode 100644 lib/gettext.h create mode 100644 lib/gettime.c create mode 100644 lib/gettimeofday.c create mode 100644 lib/gnulib.mk create mode 100644 lib/hash.c create mode 100644 lib/hash.h create mode 100644 lib/imaxtostr.c create mode 100644 lib/intprops.h create mode 100644 lib/inttostr.c create mode 100644 lib/inttostr.h create mode 100644 lib/inttypes_.h create mode 100644 lib/lchown.c create mode 100644 lib/lchown.h create mode 100644 lib/lstat.c create mode 100644 lib/lstat.h create mode 100644 lib/malloc.c create mode 100644 lib/mempcpy.c create mode 100644 lib/memrchr.c create mode 100644 lib/mkdirat.c create mode 100644 lib/mktime.c create mode 100644 lib/obstack.c create mode 100644 lib/obstack.h create mode 100644 lib/offtostr.c create mode 100644 lib/open-safer.c create mode 100644 lib/openat-die.c create mode 100644 lib/openat-priv.h create mode 100644 lib/openat-proc.c create mode 100644 lib/openat.c create mode 100644 lib/openat.h create mode 100644 lib/pathmax.h create mode 100644 lib/paxerror.c create mode 100644 lib/paxexit.c create mode 100644 lib/paxlib.h create mode 100644 lib/paxnames.c create mode 100644 lib/pipe-safer.c create mode 100644 lib/printf-args.c create mode 100644 lib/printf-args.h create mode 100644 lib/printf-parse.c create mode 100644 lib/printf-parse.h create mode 100644 lib/quote.c create mode 100644 lib/quote.h create mode 100644 lib/quotearg.c create mode 100644 lib/quotearg.h create mode 100644 lib/readlink.c create mode 100644 lib/rmt-command.h create mode 100644 lib/rmt.h create mode 100644 lib/rtapelib.c create mode 100644 lib/safe-read.c create mode 100644 lib/safe-read.h create mode 100644 lib/safe-write.c create mode 100644 lib/safe-write.h create mode 100644 lib/same-inode.h create mode 100644 lib/save-cwd.c create mode 100644 lib/save-cwd.h create mode 100644 lib/savedir.c create mode 100644 lib/savedir.h create mode 100644 lib/setenv.c create mode 100644 lib/setenv.h create mode 100644 lib/sleep.c create mode 100644 lib/stdbool_.h create mode 100644 lib/stdint_.h create mode 100644 lib/stdio_.h create mode 100644 lib/stdlib_.h create mode 100644 lib/stpcpy.c create mode 100644 lib/strcasecmp.c create mode 100644 lib/strchrnul.c create mode 100644 lib/strdup.c create mode 100644 lib/strerror.c create mode 100644 lib/string_.h create mode 100644 lib/stripslash.c create mode 100644 lib/strncasecmp.c create mode 100644 lib/strndup.c create mode 100644 lib/strnlen.c create mode 100644 lib/strtol.c create mode 100644 lib/sys_stat_.h create mode 100644 lib/sys_time_.h create mode 100644 lib/sysexits_.h create mode 100644 lib/system-ioctl.h create mode 100644 lib/system.h create mode 100644 lib/time_.h create mode 100644 lib/time_r.c create mode 100644 lib/timespec.h create mode 100644 lib/uinttostr.c create mode 100644 lib/umaxtostr.c create mode 100644 lib/unistd--.h create mode 100644 lib/unistd-safer.h create mode 100644 lib/unistd_.h create mode 100644 lib/unlocked-io.h create mode 100644 lib/unsetenv.c create mode 100644 lib/utimens.c create mode 100644 lib/utimens.h create mode 100644 lib/vasnprintf.c create mode 100644 lib/vasnprintf.h create mode 100644 lib/verify.h create mode 100644 lib/version-etc-fsf.c create mode 100644 lib/version-etc.c create mode 100644 lib/version-etc.h create mode 100644 lib/vsnprintf.c create mode 100644 lib/wchar_.h create mode 100644 lib/wctype_.h create mode 100644 lib/xalloc-die.c create mode 100644 lib/xalloc.h create mode 100644 lib/xgetcwd.c create mode 100644 lib/xgetcwd.h create mode 100644 lib/xmalloc.c create mode 100644 lib/xsize.h create mode 100644 lib/xstrndup.c create mode 100644 lib/xstrndup.h create mode 100644 m4/absolute-header.m4 create mode 100644 m4/alloca.m4 create mode 100644 m4/allocsa.m4 create mode 100644 m4/argmatch.m4 create mode 100644 m4/argp.m4 create mode 100644 m4/bison.m4 create mode 100755 m4/canonicalize-lgpl.m4 create mode 100644 m4/chdir-long.m4 create mode 100644 m4/chown.m4 create mode 100644 m4/clock_time.m4 create mode 100644 m4/close-stream.m4 create mode 100644 m4/closeout.m4 create mode 100644 m4/d-ino.m4 create mode 100644 m4/dirfd.m4 create mode 100644 m4/dirname.m4 create mode 100644 m4/dos.m4 create mode 100644 m4/double-slash-root.m4 create mode 100644 m4/dup2.m4 create mode 100644 m4/eealloc.m4 create mode 100644 m4/eoverflow.m4 create mode 100644 m4/error.m4 create mode 100644 m4/exitfail.m4 create mode 100644 m4/extensions.m4 create mode 100644 m4/fchdir.m4 create mode 100644 m4/fcntl-safer.m4 create mode 100644 m4/fcntl_h.m4 create mode 100644 m4/fileblocks.m4 create mode 100644 m4/float_h.m4 create mode 100644 m4/fnmatch.m4 create mode 100644 m4/fpending.m4 create mode 100644 m4/getcwd-abort-bug.m4 create mode 100644 m4/getcwd-path-max.m4 create mode 100644 m4/getcwd.m4 create mode 100644 m4/getdate.m4 create mode 100644 m4/getopt.m4 create mode 100644 m4/gettext.m4 create mode 100644 m4/gettime.m4 create mode 100644 m4/gettimeofday.m4 create mode 100644 m4/gnulib-common.m4 create mode 100644 m4/gnulib-comp.m4 create mode 100644 m4/hash.m4 create mode 100644 m4/iconv.m4 create mode 100644 m4/inline.m4 create mode 100644 m4/intmax_t.m4 create mode 100644 m4/inttostr.m4 create mode 100644 m4/inttypes-pri.m4 create mode 100644 m4/inttypes.m4 create mode 100644 m4/inttypes_h.m4 create mode 100644 m4/lchown.m4 create mode 100644 m4/lib-ld.m4 create mode 100644 m4/lib-link.m4 create mode 100644 m4/lib-prefix.m4 create mode 100644 m4/longlong.m4 create mode 100644 m4/lstat.m4 create mode 100644 m4/mbrtowc.m4 create mode 100644 m4/mbstate_t.m4 create mode 100644 m4/mempcpy.m4 create mode 100644 m4/memrchr.m4 create mode 100644 m4/mktime.m4 create mode 100644 m4/nls.m4 create mode 100644 m4/onceonly_2_57.m4 create mode 100644 m4/openat.m4 create mode 100644 m4/pathmax.m4 create mode 100644 m4/paxutils.m4 create mode 100644 m4/po.m4 create mode 100644 m4/progtest.m4 create mode 100644 m4/quote.m4 create mode 100644 m4/quotearg.m4 create mode 100644 m4/readlink.m4 create mode 100644 m4/rmt.m4 create mode 100644 m4/rtapelib.m4 create mode 100644 m4/safe-read.m4 create mode 100644 m4/safe-write.m4 create mode 100644 m4/save-cwd.m4 create mode 100644 m4/savedir.m4 create mode 100644 m4/setenv.m4 create mode 100644 m4/size_max.m4 create mode 100644 m4/sleep.m4 create mode 100644 m4/ssize_t.m4 create mode 100644 m4/stdarg.m4 create mode 100644 m4/stdbool.m4 create mode 100644 m4/stdint.m4 create mode 100644 m4/stdint_h.m4 create mode 100644 m4/stdio_h.m4 create mode 100644 m4/stdlib_h.m4 create mode 100644 m4/stpcpy.m4 create mode 100644 m4/strcase.m4 create mode 100644 m4/strchrnul.m4 create mode 100644 m4/strdup.m4 create mode 100644 m4/strerror.m4 create mode 100644 m4/string_h.m4 create mode 100644 m4/strndup.m4 create mode 100644 m4/strnlen.m4 create mode 100644 m4/strtol.m4 create mode 100644 m4/sys_stat_h.m4 create mode 100644 m4/sys_time_h.m4 create mode 100644 m4/sysexits.m4 create mode 100644 m4/system.m4 create mode 100644 m4/time_h.m4 create mode 100644 m4/time_r.m4 create mode 100644 m4/timespec.m4 create mode 100644 m4/tm_gmtoff.m4 create mode 100644 m4/ulonglong.m4 create mode 100644 m4/unistd-safer.m4 create mode 100644 m4/unistd_h.m4 create mode 100644 m4/unlocked-io.m4 create mode 100644 m4/utimbuf.m4 create mode 100644 m4/utimens.m4 create mode 100644 m4/utimes.m4 create mode 100644 m4/vasnprintf.m4 create mode 100644 m4/vsnprintf.m4 create mode 100644 m4/wchar.m4 create mode 100644 m4/wchar_t.m4 create mode 100644 m4/wctype.m4 create mode 100644 m4/wint_t.m4 create mode 100644 m4/xalloc.m4 create mode 100644 m4/xgetcwd.m4 create mode 100644 m4/xsize.m4 create mode 100644 m4/xstrndup.m4 create mode 100644 po/LINGUAS create mode 100644 po/Makefile.in.in create mode 100644 po/Makevars create mode 100644 po/POTFILES.in create mode 100644 po/Rules-quot create mode 100644 po/boldquot.sed create mode 100644 po/cpio.pot create mode 100644 po/da.gmo create mode 100644 po/da.po create mode 100644 po/de.gmo create mode 100644 po/de.po create mode 100644 po/en@boldquot.header create mode 100644 po/en@quot.header create mode 100644 po/es.gmo create mode 100644 po/es.po create mode 100644 po/fr.gmo create mode 100644 po/fr.po create mode 100644 po/ga.gmo create mode 100644 po/ga.po create mode 100644 po/gl.gmo create mode 100644 po/gl.po create mode 100644 po/hu.gmo create mode 100644 po/hu.po create mode 100644 po/insert-header.sin create mode 100644 po/ko.gmo create mode 100644 po/ko.po create mode 100644 po/nl.gmo create mode 100644 po/nl.po create mode 100644 po/pl.gmo create mode 100644 po/pl.po create mode 100644 po/pt_BR.gmo create mode 100644 po/pt_BR.po create mode 100644 po/quot.sed create mode 100644 po/remove-potcdate.sin create mode 100644 po/ro.gmo create mode 100644 po/ro.po create mode 100644 po/ru.gmo create mode 100644 po/ru.po create mode 100644 po/rw.gmo create mode 100644 po/rw.po create mode 100644 po/stamp-po create mode 100644 po/sv.gmo create mode 100644 po/sv.po create mode 100644 po/tr.gmo create mode 100644 po/tr.po create mode 100644 po/uk.gmo create mode 100644 po/uk.po create mode 100644 po/vi.gmo create mode 100644 po/vi.po create mode 100644 po/zh_CN.gmo create mode 100644 po/zh_CN.po create mode 100644 rmt/Makefile.am create mode 100644 rmt/Makefile.in create mode 100644 rmt/rmt.c create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/copyin.c create mode 100644 src/copyout.c create mode 100644 src/copypass.c create mode 100644 src/cpio.h create mode 100644 src/cpiohdr.h create mode 100644 src/defer.c create mode 100644 src/defer.h create mode 100644 src/dstring.c create mode 100644 src/dstring.h create mode 100644 src/extern.h create mode 100644 src/filemode.c create mode 100644 src/filetypes.h create mode 100644 src/global.c create mode 100644 src/idcache.c create mode 100644 src/main.c create mode 100644 src/makepath.c create mode 100644 src/mt.c create mode 100644 src/safe-stat.h create mode 100644 src/tar.c create mode 100644 src/tar.h create mode 100644 src/tarhdr.h create mode 100644 src/userspec.c create mode 100644 src/util.c create mode 100644 tests/Makefile.am create mode 100644 tests/Makefile.in create mode 100644 tests/argcv.c create mode 100644 tests/argcv.h create mode 100644 tests/atlocal.in create mode 100644 tests/genfile.c create mode 100644 tests/inout.at create mode 100644 tests/package.m4 create mode 100644 tests/symlink.at create mode 100755 tests/testsuite create mode 100644 tests/testsuite.at create mode 100644 tests/version.at diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..ec20977 --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1,1101 @@ +1 Notes on the Free Translation Project +*************************************** + +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work on translations can contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +1.1 Quick configuration advice +============================== + +If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias, message inheritance, automatic +charset conversion or plural form handling) as the implementation here. +It is also not possible to offer this additional functionality on top +of a `catgets' implementation. Future versions of GNU `gettext' will +very likely convey even more functionality. So it might be a good idea +to change to GNU `gettext' as soon as possible. + + So you need _not_ provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +1.2 INSTALL Matters +=================== + +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. If not, the included GNU +`gettext' library will be used. This library is wholly contained +within this package, usually in the `intl/' subdirectory, so prior +installation of the GNU `gettext' package is _not_ required. +Installers may use special options at configuration time for changing +the default behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will, respectively, bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might not be desirable. You should use +the more recent version of the GNU `gettext' library. I.e. if the file +`intl/VERSION' shows that the library which comes with this package is +more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages usually have many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +1.3 Using This Package +====================== + +As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, +and `CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your language by running the +command `locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +1.4 Translating Teams +===================== + +For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" +area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skills are praised more than +programming skills, here. + +1.5 Available Packages +====================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of October +2006. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo + +----------------------------------------------------+ + GNUnet | [] | + a2ps | [] [] [] [] [] | + aegis | () | + ant-phone | () | + anubis | [] | + ap-utils | | + aspell | [] [] [] [] [] | + bash | [] [] [] | + batchelor | [] | + bfd | | + bibshelf | [] | + binutils | [] | + bison | [] [] | + bison-runtime | | + bluez-pin | [] [] [] [] [] | + cflow | [] | + clisp | [] [] | + console-tools | [] [] | + coreutils | [] [] [] | + cpio | | + cpplib | [] [] [] | + cryptonit | [] | + darkstat | [] () [] | + dialog | [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] | + doodle | [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] | + fetchmail | [] [] () [] | + fileutils | [] [] | + findutils | [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | | + gawk | [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] [] [] | + gip | [] | + gliv | [] | + glunarclock | [] | + gmult | [] [] | + gnubiff | () | + gnucash | () () [] | + gnucash-glossary | [] () | + gnuedu | | + gnulib | [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | | + gpe-edit | [] | + gpe-filemanager | | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-package | | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | | + gphoto2 | [] [] [] [] | + gprof | [] [] | + gpsdrive | () () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] | + gretl | | + gsasl | | + gss | | + gst-plugins | [] [] [] [] | + gst-plugins-base | [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] [] | + gtick | () | + gtkam | [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] | + id-utils | [] [] | + impost | | + indent | [] [] [] | + iso_3166 | [] [] | + iso_3166_2 | | + iso_4217 | [] | + iso_639 | [] [] | + jpilot | [] | + jtag | | + jwhois | | + kbd | [] [] [] [] | + keytouch | | + keytouch-editor | | + keytouch-keyboa... | | + latrine | () | + ld | [] | + leafpad | [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] | + libgpg-error | [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] | + libgsasl | | + libiconv | [] [] | + libidn | [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] | + make | [] [] | + man-db | [] () [] [] | + minicom | [] [] [] | + mysecretdiary | [] [] | + nano | [] [] [] | + nano_1_0 | [] () [] [] | + opcodes | [] | + parted | | + pilot-qof | [] | + psmisc | [] | + pwdutils | | + python | | + qof | | + radius | [] | + recode | [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] [] [] | + sharutils | [] [] [] [] [] [] | + shishi | | + silky | | + skencil | [] () | + sketch | [] () | + solfege | | + soundtracker | [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] | + texinfo | [] [] [] | + textutils | [] [] [] | + tin | () () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] | + xchat | [] [] [] [] [] [] | + xkeyboard-config | | + xpad | [] [] | + +----------------------------------------------------+ + af am ar az be bg bs ca cs cy da de el en en_GB eo + 10 0 1 2 9 22 1 42 41 2 60 95 16 1 17 16 + + es et eu fa fi fr ga gl gu he hi hr hu id is it + +--------------------------------------------------+ + GNUnet | | + a2ps | [] [] [] () | + aegis | | + ant-phone | [] | + anubis | [] | + ap-utils | [] [] | + aspell | [] [] [] | + bash | [] [] [] | + batchelor | [] [] | + bfd | [] | + bibshelf | [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] [] [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + cflow | [] | + clisp | [] [] | + console-tools | | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cpplib | [] [] | + cryptonit | [] | + darkstat | [] () [] [] [] | + dialog | [] [] [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] [] [] [] | + doodle | [] [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] [] | + findutils | [] [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | [] [] | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] | + gip | [] [] [] | + gliv | () | + glunarclock | [] [] [] | + gmult | [] [] [] | + gnubiff | () () | + gnucash | () () () | + gnucash-glossary | [] [] | + gnuedu | [] | + gnulib | [] [] [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | | + gpe-clock | [] [] [] [] | + gpe-conf | [] | + gpe-contacts | [] [] | + gpe-edit | [] [] [] [] | + gpe-filemanager | [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | () () [] () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] [] [] | + gsasl | [] [] | + gss | [] | + gst-plugins | [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] [] | + gstreamer | [] [] [] | + gtick | [] | + gtkam | [] [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] [] | + impost | [] [] | + indent | [] [] [] [] [] [] [] [] [] [] | + iso_3166 | [] [] [] | + iso_3166_2 | [] | + iso_4217 | [] [] [] [] | + iso_639 | [] [] [] [] [] | + jpilot | [] [] | + jtag | [] | + jwhois | [] [] [] [] [] | + kbd | [] [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + latrine | [] [] [] | + ld | [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] [] [] | + libgpg-error | | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] | + libgsasl | [] [] | + libiconv | [] [] | + libidn | [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] [] | + lynx | [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] | + man-db | () | + minicom | [] [] [] [] | + mysecretdiary | [] [] [] | + nano | [] [] [] [] [] [] | + nano_1_0 | [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] | + pilot-qof | | + psmisc | [] [] [] | + pwdutils | | + python | | + qof | [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] [] | + shared-mime-info | [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] [] [] | + shishi | | + silky | [] | + skencil | [] [] | + sketch | [] [] | + solfege | [] | + soundtracker | [] [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] | + tar | [] [] [] [] [] [] [] | + texinfo | [] [] | + textutils | [] [] [] [] [] | + tin | [] () | + tp-robot | [] [] [] [] | + tuxpaint | [] [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux | [] [] [] [] [] [] [] | + vorbis-tools | [] [] | + wastesedge | () | + wdiff | [] [] [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] [] | + xchat | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] | + xpad | [] [] [] | + +--------------------------------------------------+ + es et eu fa fi fr ga gl gu he hi hr hu id is it + 88 22 14 2 40 115 61 14 1 8 1 6 59 31 0 52 + + ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no + +-------------------------------------------------+ + GNUnet | | + a2ps | () [] [] () | + aegis | () | + ant-phone | [] | + anubis | [] [] [] | + ap-utils | [] | + aspell | [] [] | + bash | [] | + batchelor | [] [] | + bfd | | + bibshelf | [] | + binutils | | + bison | [] [] [] | + bison-runtime | [] [] [] | + bluez-pin | [] [] [] | + cflow | | + clisp | [] | + console-tools | | + coreutils | [] | + cpio | | + cpplib | [] | + cryptonit | [] | + darkstat | [] [] | + dialog | [] [] | + diffutils | [] [] [] | + doodle | | + e2fsprogs | [] | + enscript | [] | + error | [] | + fetchmail | [] [] | + fileutils | [] [] | + findutils | [] | + flex | [] [] | + fslint | [] [] | + gas | | + gawk | [] [] | + gbiff | [] | + gcal | | + gcc | | + gettext-examples | [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] | + gip | [] [] | + gliv | [] | + glunarclock | [] [] | + gmult | [] [] | + gnubiff | | + gnucash | () () | + gnucash-glossary | [] | + gnuedu | | + gnulib | [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] | + gpe-clock | [] [] [] | + gpe-conf | [] [] | + gpe-contacts | [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | [] | + gphoto2 | [] [] | + gprof | | + gpsdrive | () () () | + gramadoir | () | + grep | [] [] [] [] | + gretl | | + gsasl | [] | + gss | | + gst-plugins | [] | + gst-plugins-base | | + gst-plugins-good | [] | + gstreamer | [] | + gtick | | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] | + gutenprint | | + hello | [] [] [] [] [] [] | + id-utils | [] | + impost | | + indent | [] [] | + iso_3166 | [] | + iso_3166_2 | [] | + iso_4217 | [] [] [] | + iso_639 | [] [] | + jpilot | () () () | + jtag | | + jwhois | [] | + kbd | [] | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | | + latrine | [] | + ld | | + leafpad | [] [] | + libc | [] [] [] [] [] | + libexif | | + libextractor | | + libgpewidget | [] | + libgpg-error | | + libgphoto2 | [] | + libgphoto2_port | [] | + libgsasl | [] | + libiconv | | + libidn | [] [] | + lifelines | [] | + lilypond | | + lingoteach | [] | + lynx | [] [] | + m4 | [] [] | + mailutils | | + make | [] [] [] | + man-db | () | + minicom | [] | + mysecretdiary | [] | + nano | [] [] [] | + nano_1_0 | [] [] [] | + opcodes | [] | + parted | [] [] | + pilot-qof | | + psmisc | [] [] [] | + pwdutils | | + python | | + qof | | + radius | | + recode | [] | + rpm | [] [] | + screem | [] | + scrollkeeper | [] [] [] [] | + sed | [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] [] [] [] | + sharutils | [] [] | + shishi | | + silky | [] | + skencil | | + sketch | | + solfege | | + soundtracker | | + sp | () | + stardict | [] [] | + system-tools-ba... | [] [] [] [] | + tar | [] [] [] | + texinfo | [] [] [] | + textutils | [] [] [] | + tin | | + tp-robot | [] | + tuxpaint | [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] | + vorbis-tools | [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] | + xchat | [] [] [] [] | + xkeyboard-config | [] | + xpad | [] [] [] | + +-------------------------------------------------+ + ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no + 52 24 2 2 1 3 0 2 3 21 0 15 1 97 5 1 + + nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta + +------------------------------------------------------+ + GNUnet | | + a2ps | () [] [] [] [] [] [] | + aegis | () () | + ant-phone | [] [] | + anubis | [] [] [] | + ap-utils | () | + aspell | [] [] | + bash | [] [] [] | + batchelor | [] [] | + bfd | | + bibshelf | [] | + binutils | [] [] | + bison | [] [] [] [] [] | + bison-runtime | [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] [] | + cflow | [] | + clisp | [] | + console-tools | [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + cpplib | [] | + cryptonit | [] [] | + darkstat | [] [] [] [] [] [] | + dialog | [] [] [] [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] [] | + error | [] [] [] [] | + fetchmail | [] [] [] | + fileutils | [] [] [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] [] [] | + fslint | [] [] [] [] | + gas | | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] [] | + gimp-print | [] [] | + gip | [] [] [] [] | + gliv | [] [] [] [] | + glunarclock | [] [] [] [] [] [] | + gmult | [] [] [] [] | + gnubiff | () | + gnucash | () [] | + gnucash-glossary | [] [] [] | + gnuedu | | + gnulib | [] [] [] [] [] | + gnunet-gtk | [] | + gnutls | [] [] | + gpe-aerial | [] [] [] [] [] [] [] | + gpe-beam | [] [] [] [] [] [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] [] [] [] [] | + gpe-conf | [] [] [] [] [] [] [] | + gpe-contacts | [] [] [] [] [] | + gpe-edit | [] [] [] [] [] [] [] [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] [] [] [] | + gpe-login | [] [] [] [] [] [] [] [] | + gpe-ownerinfo | [] [] [] [] [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] [] [] [] [] [] | + gpe-su | [] [] [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] [] | + gpe-todo | [] [] [] [] | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] | + gretl | [] | + gsasl | [] [] [] | + gss | [] [] [] | + gst-plugins | [] [] [] [] | + gst-plugins-base | [] | + gst-plugins-good | [] [] [] [] | + gstreamer | [] [] [] | + gtick | [] | + gtkam | [] [] [] [] | + gtkorphan | [] | + gtkspell | [] [] [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + impost | [] | + indent | [] [] [] [] [] [] | + iso_3166 | [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | [] [] [] [] | + iso_639 | [] [] [] [] | + jpilot | | + jtag | [] | + jwhois | [] [] [] [] | + kbd | [] [] [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + latrine | [] [] | + ld | [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] [] | + libgpewidget | [] [] [] [] [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] | + libgphoto2_port | [] [] [] | + libgsasl | [] [] [] [] | + libiconv | [] [] | + libidn | [] [] () | + lifelines | [] [] | + lilypond | | + lingoteach | [] | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailutils | [] [] [] [] | + make | [] [] [] [] | + man-db | [] [] | + minicom | [] [] [] [] [] | + mysecretdiary | [] [] [] [] | + nano | [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] [] | + parted | [] | + pilot-qof | [] | + psmisc | [] [] | + pwdutils | [] [] | + python | | + qof | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] | + rpm | [] [] [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] | + shared-mime-info | [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] | + silky | [] | + skencil | [] [] [] | + sketch | [] [] [] | + solfege | [] | + soundtracker | [] [] | + sp | | + stardict | [] [] [] | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] | + tin | () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] | + vorbis-tools | [] [] | + wastesedge | | + wdiff | [] [] [] [] [] [] | + wget | [] [] [] [] | + xchat | [] [] [] [] [] [] [] | + xkeyboard-config | [] [] | + xpad | [] [] [] | + +------------------------------------------------------+ + nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta + 0 2 3 58 30 54 5 73 72 4 40 46 11 50 128 2 + + tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu + +---------------------------------------------------+ + GNUnet | [] | 2 + a2ps | [] [] [] | 19 + aegis | | 0 + ant-phone | [] [] | 6 + anubis | [] [] [] | 11 + ap-utils | () [] | 4 + aspell | [] [] [] | 15 + bash | [] | 11 + batchelor | [] [] | 9 + bfd | | 1 + bibshelf | [] | 7 + binutils | [] [] [] | 9 + bison | [] [] [] | 19 + bison-runtime | [] [] [] | 15 + bluez-pin | [] [] [] [] [] [] | 28 + cflow | [] [] | 5 + clisp | | 6 + console-tools | [] [] | 5 + coreutils | [] [] | 16 + cpio | [] [] [] | 9 + cpplib | [] [] [] [] | 11 + cryptonit | | 5 + darkstat | [] () () | 15 + dialog | [] [] [] [] [] | 30 + diffutils | [] [] [] [] | 28 + doodle | [] | 6 + e2fsprogs | [] [] | 10 + enscript | [] [] [] | 16 + error | [] [] [] [] | 18 + fetchmail | [] [] | 12 + fileutils | [] [] [] | 18 + findutils | [] [] [] | 17 + flex | [] [] | 15 + fslint | [] | 9 + gas | [] | 3 + gawk | [] [] | 15 + gbiff | [] | 5 + gcal | [] | 5 + gcc | [] [] [] | 6 + gettext-examples | [] [] [] [] [] [] | 27 + gettext-runtime | [] [] [] [] [] [] | 28 + gettext-tools | [] [] [] [] [] | 19 + gimp-print | [] [] | 12 + gip | [] [] | 12 + gliv | [] [] | 8 + glunarclock | [] [] [] | 15 + gmult | [] [] [] [] | 15 + gnubiff | [] | 1 + gnucash | () | 2 + gnucash-glossary | [] [] | 9 + gnuedu | [] | 2 + gnulib | [] [] [] [] [] | 28 + gnunet-gtk | | 1 + gnutls | | 2 + gpe-aerial | [] [] | 14 + gpe-beam | [] [] | 14 + gpe-calendar | [] | 3 + gpe-clock | [] [] [] [] | 21 + gpe-conf | [] [] | 14 + gpe-contacts | [] [] | 10 + gpe-edit | [] [] [] [] | 20 + gpe-filemanager | [] | 6 + gpe-go | [] [] | 15 + gpe-login | [] [] [] [] [] | 21 + gpe-ownerinfo | [] [] [] [] | 21 + gpe-package | [] | 6 + gpe-sketchbook | [] [] | 16 + gpe-su | [] [] [] | 20 + gpe-taskmanager | [] [] [] | 20 + gpe-timesheet | [] [] [] [] | 18 + gpe-today | [] [] [] [] [] | 21 + gpe-todo | [] | 7 + gphoto2 | [] [] [] [] | 20 + gprof | [] [] | 11 + gpsdrive | | 4 + gramadoir | [] | 7 + grep | [] [] [] [] | 34 + gretl | | 4 + gsasl | [] [] | 8 + gss | [] | 5 + gst-plugins | [] [] [] | 15 + gst-plugins-base | [] [] [] | 9 + gst-plugins-good | [] [] [] [] [] | 20 + gstreamer | [] [] [] | 17 + gtick | [] | 3 + gtkam | [] | 13 + gtkorphan | [] | 7 + gtkspell | [] [] [] [] [] [] | 26 + gutenprint | | 3 + hello | [] [] [] [] [] | 37 + id-utils | [] [] | 14 + impost | [] | 4 + indent | [] [] [] [] | 25 + iso_3166 | [] [] [] [] | 16 + iso_3166_2 | | 2 + iso_4217 | [] [] | 14 + iso_639 | [] | 14 + jpilot | [] [] [] [] | 7 + jtag | [] | 3 + jwhois | [] [] [] | 13 + kbd | [] [] | 12 + keytouch | [] | 4 + keytouch-editor | | 2 + keytouch-keyboa... | [] | 3 + latrine | [] [] | 8 + ld | [] [] [] [] | 8 + leafpad | [] [] [] [] | 23 + libc | [] [] [] | 23 + libexif | [] | 4 + libextractor | [] | 5 + libgpewidget | [] [] [] | 19 + libgpg-error | [] | 4 + libgphoto2 | [] | 8 + libgphoto2_port | [] [] [] | 11 + libgsasl | [] | 8 + libiconv | [] | 7 + libidn | [] [] | 10 + lifelines | | 4 + lilypond | | 2 + lingoteach | [] | 6 + lynx | [] [] [] | 15 + m4 | [] [] [] | 18 + mailutils | [] | 8 + make | [] [] [] | 20 + man-db | [] | 6 + minicom | [] | 14 + mysecretdiary | [] [] | 12 + nano | [] [] | 17 + nano_1_0 | [] [] [] | 18 + opcodes | [] [] | 10 + parted | [] [] [] | 10 + pilot-qof | [] | 3 + psmisc | [] | 10 + pwdutils | [] | 3 + python | | 0 + qof | [] | 4 + radius | [] | 6 + recode | [] [] [] | 25 + rpm | [] [] [] [] | 14 + screem | [] | 2 + scrollkeeper | [] [] [] [] | 26 + sed | [] [] [] | 22 + sh-utils | [] | 15 + shared-mime-info | [] [] [] [] | 24 + sharutils | [] [] [] | 23 + shishi | | 1 + silky | [] | 4 + skencil | [] | 7 + sketch | | 6 + solfege | | 2 + soundtracker | [] [] | 9 + sp | [] | 3 + stardict | [] [] [] [] | 11 + system-tools-ba... | [] [] [] [] [] [] [] | 37 + tar | [] [] [] [] | 20 + texinfo | [] [] [] | 15 + textutils | [] [] [] | 17 + tin | | 1 + tp-robot | [] [] [] | 10 + tuxpaint | [] [] [] | 16 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux | [] [] [] | 20 + vorbis-tools | [] [] | 11 + wastesedge | | 1 + wdiff | [] [] | 22 + wget | [] [] [] | 19 + xchat | [] [] [] [] | 29 + xkeyboard-config | [] [] [] [] | 11 + xpad | [] [] [] | 14 + +---------------------------------------------------+ + 77 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu + 170 domains 0 1 1 77 39 0 136 10 1 48 5 54 0 2028 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If October 2006 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. + +1.6 Using `gettext' in new packages +=================================== + +If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`translation@iro.umontreal.ca' to make the `.pot' files available to +the translation teams. + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..980c8f3 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,6 @@ +Authors of GNU cpio + +Phil Nelson +David MacKenzie +John Oleynick +Sergey Poznyakoff \ No newline at end of file diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..5c95a60 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 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 Library General Public License instead.) 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. + + 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. + + 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. + + 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. + + 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. + + 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. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 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". + +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. + + 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. + +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. + + 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: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + 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. + + 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.) + +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. + +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. + +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. + + 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) 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, + + 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, + + 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 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. + +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. + + 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. + + 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. + + 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 +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 +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. + +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. + +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. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest 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 +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. + + 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. + + NO WARRANTY + + 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. + + 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. + + 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 +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 +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 + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any 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 + + +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: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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. + +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: + + 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 Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..1307353 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,1781 @@ +2007-06-08 Sergey Poznyakoff + + * configure.ac, NEWS: Version number 2.8 + * bootstrap.conf: Update + +2007-06-07 Sergey Poznyakoff + + * NEWS: Update + * configure.ac: Raise version to 2.7.90 + * doc/cpio.texi: Update + * src/extern.h (set_perms, set_file_times): Take file descriptor + as the first argument. + * src/util.c (set_perms): Take file descriptor + as the first argument and use fchmod/fchown if available. Fixes + CAN-2005-1111. + * src/copyin.c, src/copyout.c, src/copypass.c: Update calls to + set_perms. + * src/makepath.c: Remove useless includes. + + * src/util.c (set_perms, stat_to_cpio): Use CPIO_UID and CPIO_GID + macros to set uid and gid + * src/main.c (process_args): Allow to use --owner in copy-out mode. + * THANKS: Add Mike Frysinger + +2007-05-18 Sergey Poznyakoff + + * bootstrap: Update from tar repository + * doc/cpio.texi: Fix typo + * src/copyin.c (from_ascii): Bugfix: allow for empty fields + * src/copyout.c (process_copy_out): Fix memory leaks on + orig_file_name. + * src/copypass.c (process_copy_pass): symlink_error takes two + arguments. + * src/extern.h: Add missing includes. + +2006-12-18 Sergey Poznyakoff + + * README-cvs: New file + * lib/Makefile.tmpl, lib/bcopy.c, lib/mkdir.c, lib/strdup.c, + lib/strerror.c, lib/.cvsignore, po/.cvsignore, + po/Makevars: Removed + * lib/Makefile.am: New file + * po/POTFILES.in: Update + * bootstrap: Synch with tar. + * configure.ac: Update + * gnulib.modules: Add lchown, strerror + * src/Makefile.am: Update + * src/main.c, src/mt.c: Include rmt-command.h instead of localedir.h + * .cvsignore, doc/.cvsignore: Sort + + * src/util.c (sparse_write): Static. Provide a forward + declaration. Define enum sparse_write_states inside the function. + + * src/copyin.c (long_format): Use PRIuMAX for printing file size + * src/copyout.c (write_out_binary_header): Fix size conversion + * src/extern.h (tape_toss_input, warn_if_file_changed): Last + argument is off_t + * src/util.c (tape_toss_input, warn_if_file_changed): Last + argument is off_t + (warn_if_file_changed): Use ngettext + +2006-11-15 Sergey Poznyakoff + + * src/copypass.c: Fix setting output file permissions + +2006-11-13 Sergey Poznyakoff + + * doc/cpio.texi: Consistently use @option{} for displaying command + line options. + Fix formatting in "Invoking `cpio'" section + * src/main.c (process_args): Fix usage error diagnostics in + copy-pass mode. + +2006-10-24 Sergey Poznyakoff + + * src/copyout.c (process_copy_out): Add terminating zero to the + link_name. + + * tests/symlink.at: New testcase + * tests/Makefile.am: New test symlink.at + * tests/inout.at: Add keywords + * tests/testsuite.at (AT_SKIP_TEST): New macro + New test symlink.at + +2006-10-21 Sergey Poznyakoff + + * configure.ac, NEWS: Version 2.7 + * gnulib.modules: Add stdint + * src/util.c: Use STRINGIFY_BIGINT to display num_bytes + +2006-09-27 Sergey Poznyakoff + + * TODO: Update + * README-alpha: Update + * bootstrap: Imported from tar + * configure.ac: Require autoconf 2.59 and gettext 1.15 + * gnulib.modules: add inttypes + * doc/cpio.texi: Minor fixes + * po/Makevars: Remove automatically generated file + * po/.cvsignore: Add Makevars + * lib/.cvsignore: Update + * src/copyin.c, src/copyout.c, src/copypass.c, src/cpio.h, + src/cpiohdr.h, src/defer.c, src/defer.h, src/extern.h, + src/global.c, src/main.c, src/makepath.c, src/tar.c, + src/util.c: Update copyright year. + +2006-07-04 Sergey Poznyakoff + + * bootstrap (update_po): Fix single translation update + * lib/Makefile.tmpl: Initialize AM_CPPFLAGS + (noinst_HEADERS): Add system-ioctl.h + + Start rewriting using a better suited internal representation for + the file meta-data. + + * src/cpiohdr.h (struct old_cpio_header): Remove unused fields + c_mtime, c_filesize and c_name. + (struct old_ascii_header): New data type + (struct new_ascii_header): New data type. Describes the header + structure, not its internal representation. + (struct cpio_file_stat): New data type. Describes internal + representation of a file metadata + + * src/copyin.c (from_ascii): New function + Use cpio_file_stat for internal header representation. + * src/copyout.c: Use cpio_file_stat for internal header + representation. Among other things this fixes bug reported by + Peter Vrabec on Mar 2, 2006 + (http://lists.gnu.org/archive/html/bug-cpio/2006-03/msg00000.html) + * src/copypass.c: Use cpio_file_stat for internal header + representation. + * src/tar.c: Likewise + * src/util.c: Likewise + * src/defer.c: Likewise + * src/defer.h: Likewise + * src/extern.h: Likewise + (from_ascii): New prototype + (LG_8,LG_16,FROM_OCTAL,FROM_HEX): New defines + * src/main.c: New command line option --HANG (hidden) + +2006-03-12 Sergey Poznyakoff + + * tests/Makefile.am (AM_CPPFLAGS): Define LOCALEDIR + +2006-02-18 Sergey Poznyakoff + + * gnulib.modules: Add stpcpy. Thanks Benigno B. Junior for + reporting. + * THANKS: Add Benigno B. Junior + * src/makepath.c: Fix indentation. + +2005-11-16 Sergey Poznyakoff + + * src/copyout.c (process_copy_out): Fix typo. + +2005-11-12 Sergey Poznyakoff + + * bootstrap: Minor fix + * src/copyout.c (write_out_header): Rewritten using separate + functions for each file format. Use to_ascii to convert numbers to + ascii representation. Check for overflows and report them if + appropriate. Return 0 if it is OK to proceed with archiving this + file, 1 otherwise. All callers updated. + * src/extern.h (write_out_header): Return int. + +2005-10-28 Sergey Poznyakoff + + * src/util.c: Include paxlib. + * bootstrap: If file `.bootstrap' exists in the cwd and is + readable, prepend its contents to the command line. + + Fix Debian bug 335580: + + * src/copyout.c (read_for_checksum,write_out_header): CRC is a + 32-bit unsigned value. Patch proposed by Jim Castleberry and + Peter Vrabec. + * src/extern.h (crc): Change declaration + * src/global.c: Likewise + * src/tar.c (tar_checksum): Return unsigned int + + * THANKS: Add Jim Castleberry + * NEWS: Updated + +2005-09-30 Sergey Poznyakoff + + * src/copyout.c (process_copy_out): Discern between original and + (eventually fixed) file name (in tar terminology, `file name' + vs. `member name'. + +2005-09-08 Sergey Poznyakoff + + * gnulib.modules: Add utimens + * src/util.c (cpio_safer_name_suffix): Preserve ./ no matter what + the value of strip_leading_dots is. + (set_file_times): New function + * src/extern.h (set_file_times): New function + * src/copyin.c: Use set_file_times() to update file atime/mtime + * src/copyout.c: Likewise. + * src/copypass.c: Likewise. + +2005-05-25 Sergey Poznyakoff + + * src/copyin.c: Use cpio_safer_name_suffix() and CPIO_TRAILER_NAME + define instead of hardcoding the trailer file name. + * src/copyout.c: Likewise. + * src/cpio.h (CPIO_TRAILER_NAME): New define + * src/extern.h (cpio_safer_name_suffix): New proto + * src/tar.c: Use CPIO_TRAILER_NAME define instead of hardcoding + the trailer file name. + * src/util.c (cpio_safer_name_suffix): New function + (add_cdf_double_slashes): Add FIXME warning. + + * lib/fatal.c: New file + * lib/Makefile.tmpl (libcpio_a_SOURCES): Add fatal.c + * src/copyout.c: Use error reporting functions from paxlib + * src/makepath.c: Likewise + * src/mt.c: Likewise + * src/main.c (fatal_exit): Moved to lib/fatal.c + +2005-05-24 Sergey Poznyakoff + + * src/copyin.c (process_copy_in): Use safer_name_suffix no matter + what the value of no_abs_paths_flag. The function knows better + what to do in any case. + * src/copyout.c (process_copy_out): Honor no_abs_paths_flag. + * src/main.c (options): Minor fixes. + +2005-05-23 Sergey Poznyakoff + + * bootstrap (copy_files): Create destination directory if it does + not exist. + Preserve longlong.m4 as longlong_gl.m4 + * src/main.c: Include paxlib.h + +2005-05-22 Sergey Poznyakoff + + * lib/.cvsignore: Updated + * gnulib.modules: Add hash + * doc/cpio.texi (Reports): New chapter + * lib/Makefile.tmpl: Add new paxutils files. + * po/POTFILES.in: Likewise + * src/copyin.c [!HAVE_LCHOWN] (lchown): Define to 0 to avoid + changing ownership of the target file. + (process_copy_in): Use safer_name_suffix() + * src/main.c (parse_opt): Handle new --absolute-filenames option. + (process_args): Updated + * src/util.c: Rewrite inode lookup/insertion functions using hash + module. + +u2005-05-20 Sergey Poznyakoff + + * configure.ac: Raised version number to 2.6.90 + * NEWS: Updated + * src/copyin.c: Use set_perms. + * src/copypass.c: Likewise. + * src/copyout.c (process_copy_out): Use stat_to_cpio() to convert + struct stat to struct new_cpio_header. + * src/defer.h: Remove legacy P_() stuff. + * src/dstring.c: Likewise + * src/extern.h: Likewise + * src/util.c (stat_to_cpio,set_perms): New functions + * doc/.cvsignore: Updated + * lib/.cvsignore: Updated + * tests/.cvsignore: Updated + * .cvsignore: Updated + * COPYING: Added to the repository + +2005-05-19 Sergey Poznyakoff + + * po/POTFILES.in: Add paxerror.c paxexit.c paxconvert.c + + * bootstrap (copy_files): Accept optional third argument: a prefix + to be appended to destination file names. + Import paxutils/paxlib files. + * lib/Makefile.tmpl (libcpio_a_SOURCES): Add paxerror.c paxexit.c + paxconvert.c + * src/copyin.c: Use paxutils error reporting functions + * src/copyout.c: Likewise + * src/copypass.c: Likewise + * src/util.c: Likewise. Add missing includes + * src/main.c (USAGE_ERROR): Removed + (CHECK_USAGE,parse_opt,process_args): Use error() instead of USAGE_ERROR + (fatal_exit): New function + * src/tar.c (is_tar_filename_too_long): Removed unused variable + + * Makefile.am, configure.ac, doc/Makefile.am, + doc/cpio.texi, doc/gendocs_template, headers/Makefile.am, + headers/fnmatch.h, lib/Makefile.tmpl, lib/mkdir.c, + lib/strdup.c, lib/strerror.c, src/Makefile.am, + src/copyin.c, src/copyout.c, src/copypass.c, src/cpio.h, + src/cpiohdr.h, src/defer.c, src/defer.h, src/dstring.c, + src/dstring.h, src/extern.h, src/filemode.c, + src/filetypes.h, src/global.c, src/idcache.c, + src/main.c, src/makepath.c, src/mt.c, src/tar.c, + src/tar.h, src/tarhdr.h, src/userspec.c, src/util.c, + tests/Makefile.am, tests/inout.at, tests/testsuite.at, + tests/version.at: Updated FSF postal mail address. + + * bootstrap: Port recent changes from tar bootstrap. + * gnulib.modules: New file + * tests/Makefile.am (genfile_SOURCES,LDADD): Updated + + * THANKS: Updated + * configure.ac: Remove check for gethostname, it is never used. + Remove check for setsockopt, it is provided by paxutils. + + Fix LFS support issues. Proposed by Peter Vrabec and Dmitry V. Levin + + * src/extern.h (copy_files_tape_to_disk, copy_files_disk_to_tape, + copy_files_disk_to_disk): Change num_bytes argument type from + long to off_t. + * src/util.c (copy_files_tape_to_disk, copy_files_disk_to_tape, + copy_files_disk_to_disk, disk_fill_input_buffer, + write_nuls_to_file): Likewise. + (write_nuls_to_file, copy_files_disk_to_tape, + copy_files_disk_to_disk): Handle `off_t num_bytes' properly. + + * src/util.c (find_inode_file): Fix typos causing function to + occasionally miss inodes and, therefore, to copy out the same + (hard-linked) file several times to archive. Proposed by Brian + Mays. + +2005-03-24 Sergey Poznyakoff + + * src/main.c (process_args): Fixed discrepancy I have been + overlooking so far: cpio still does not handle --sparse option + the same way tar is handling it. --sparse is allowed in copy-in + and copy-pass modes, just as docs say it. Thanks Dmitry Levin. + * THANKS: Updated + +2005-03-21 Sergey Poznyakoff + + * src/util.c (disk_buffered_write): Fix typo introduced + 2005-01-11. + * src/main.c (process_args): Fixed error message + +2005-01-31 Sergey Poznyakoff + + * src/main.c (main): Remove umask(0). Fixes CAN-1999-1572. + [__TURBOC__,__EMX__]: Removed + * src/copypass.c (process_copy_pass): Set umask 0 + * src/copyin.c (process_copy_in): Likewise + * src/util.c (open_archive): Use MODE_RW. + +2005-01-11 Sergey Poznyakoff + + * doc/gendocs_template: Template file for gendocs.sh. + * doc/Makefile.am: Use gendocs.sh to generate webdocs. + * doc/cpio.texi: Updated. + + * src/copyin.c: Use memset instead of bzero, memmove + (or memcpy, if appropriate), instead of bcopy, and + strchr/strrchr instead of index/rindex. + * src/copypass.c: Likewise. + * src/main.c: Likewise. + * src/makepath.c: Likewise. + * src/tar.c: Likewise. + * src/util.c: Likewise. + (write_nuls_to_file): Made extern. All callers updated + + * src/copyout.c: Likewise. Use write_nuls_to_file instead + of explicitely accessing zeros_512 + * src/userspec.c: Likewise. + Rename isnumber to isnumber_p. Proposed by + Albert Chin + * src/extern.h (zeros_512): Removed + (write_nuls_to_file): New function + * src/global.c (zeros_512): Removed + +2005-01-06 Sergey Poznyakoff + + * bootstrap: Add 'fileblocks' gnulib module + Create paxutils.m4 + * configure.ac: Call cpio_PAXUTILS + * src/main.c: Remove ifdef around setlocale + * src/mt.c: Likewise + +2004-12-21 Sergey Poznyakoff + + * configure.ac: New option --enable-mt + Check for locale.h + * doc/cpio.info: Removed + * src/mt.c (main): Use argmatch_invalid() + +2004-12-20 Sergey Poznyakoff + + Released version 2.6. Sources up to this point are tagged + release_2_6. + + * configure.ac: Raised version number to 2.6 + * NEWS: Likewise + * bootstrap (update_po): Give -r to wget. Always remove index.html + Ignore alloca-opt module (it duplicates alloca) + +2004-11-23 Sergey Poznyakoff + + * src/main.c (enum cpio_options): Bugfix: Initialize first enum + value to 256. + * bootstrap: Add unlocked-io + * headers/argp.h: Removed + * headers/getopt.h: Removed + * headers/Makefile.am: Updated + +2004-10-14 Sergey Poznyakoff + + * src/copyout.c: Add trailing slash to directory names in + ustar format. + * src/makepath.c: Removed redeclaration of error(). + * src/tar.c: Fixed deviations from POSIX.1-1988: + Properly split long file names. Fill in octal fields with zeros, + not spaces. Save only protection modes, not the whole mode. + + * NEWS: Updated + +2004-09-08 Sergey Poznyakoff + + * NEWS: Updated + * TODO: Updated + * bootstrap: Install po files by default + * po/LINGUAS: Removed. File is generated automatically + * po/.cvsignore: Updated + * src/copyin.c: Implemented --to-stdout option + * src/copyout.c: Display the annoying 'truncating inode number' + message only if the user wishes it. + * src/extern.h: Added new globals. + * src/global.c: Likewise. + + * src/main.c: Added support for --to-stdout and --warning options + * src/tar.c (read_in_tar_header): Use warn_junk_bytes() + * src/util.c (create_all_directories): Use dir_name. + + * configure.ac: Added support for the test suite + * Makefile.am: Likewise + + * tests: New directory + * tests/.cvsignore: New file + * tests/Makefile.am: New file + * tests/testsuite.at: New file + * tests/inout.at: New file + * tests/version.at: New file + * tests/atlocal.in: New file + +2004-09-07 Sergey Poznyakoff + + * src/main.c (process_args): Bugfix. Allow extra arguments + in copy_in mode. + * src/util.c (write_nuls_to_file): Use buffered I/O. All + callers changed. Thanks Matthew Braithwaite + for noticing. + Bugfix: extra_bytes was mistakenly used instead of blocks. + * THANKS: Added Matthew Braithwaite. + +2004-09-06 Sergey Poznyakoff + + Started merging with tar into paxutils. Sources before + this point are tagged alpha-2_50_90. + + * bootstrap: New file + * autogen.sh: Removed + * Makefile.am: Updated + * NEWS: Updated + * README-alpha: Updated + * configure.ac: Updated + * doc/cpio.1: Updated + * po/POTFILES.in: Updated + + * src/Makefile.am: Updated + * src/error.c: Removed + * src/dirname.c: Likewise + * src/xmalloc.c: Likewise + * src/stripslash.c: Likewise + * src/xstrdup.c + * src/gettext.h: Likewise + * src/system.h: Likewise + * src/rmt.h: Likewise + * src/getopt.c: Likewise + * src/getopt1.c: Likewise + * src/bcopy.c: Likewise + * src/fnmatch.c: Likewise + * src/mkdir.c: Likewise + * src/strdup.c: Likewise + * src/argp-ba.c: Likewise + * src/argp-eexst.c: Likewise + * src/argp-fmtstream.c: Likewise + * src/argp-fs-xinl.c: Likewise + * src/argp-help.c: Likewise + * src/argp-parse.c: Likewise + * src/argp-pv.c: Likewise + * src/argp-pvh.c: Likewise + * src/argp-xinl.c: Likewise + * src/pin.c: Likewise + * src/alloca.c: Likewise + * src/argmatch.c: Likewise + * src/rmt.c: Likewise + * src/rtapelib.c: Likewise + * src/strerror.c: Likewise + + * src/copyin.c: Switched to ANSI C (sigh) + * src/copyout.c: Likewise + * src/copypass.c: Likewise + * src/defer.c: Likewise + * src/defer.h: Likewise + * src/dstring.c: Likewise + * src/dstring.h: Likewise + * src/extern.h: Likewise + * src/filemode.c: Likewise + * src/global.c: Likewise + * src/idcache.c: Likewise + * src/main.c: Likewise + * src/makepath.c: Likewise + * src/mt.c: Likewise + * src/tar.c: Likewise + * src/userspec.c: Likewise + * src/util.c: Likewise + + * lib: New directory + * lib/Makefile.tmpl: New file + * lib/bcopy.c: Moved from ../src + * lib/mkdir.c: Likewise. + * lib/strdup.c: Likewise. + * lib/strerror.c: Likewise. + +2004-08-30 Sergey Poznyakoff + + * Makefile.am: Added headers to SUBDIRS. + * configure.ac: Check for AC_SYS_LARGEFILE. + Use AC_CONFIG_LINKS to provide for fnmatch.h and getopt.h on + the systems where these are missing + Check for argp and replace it if necessary. + * src/Makefile.am: Updated + * src/fnmatch.h: Moved to headers/ + * src/getopt.h: Likewise. + * src/main.c: Option parsing rewritten using argp. Improved + option consistency checking. + * src/rmt.c: Include getopt.h + + * src/argp-ba.c: New file + * src/argp-eexst.c: New file + * src/argp-fmtstream.c: New file + * src/argp-fs-xinl.c: New file + * src/argp-help.c: New file + * src/argp-parse.c: New file + * src/argp-pv.c: New file + * src/argp-pvh.c: New file + * src/argp-xinl.c: New file + * src/pin.c: New file + + * headers: New directory + * headers/Makefile.am: New file + * headers/getopt.h: New file + * headers/argp.h: New file + * headers/fnmatch.h: New file + * headers/.cvsignore: New file + +2004-03-02 Sergey Poznyakoff + + * src/util.c (copy_files_disk_to_disk): Bugfix. If a file + grew n bytes in copy-pass mode, these n bytes got prepended + to the contents of all subsequent files. Fix provided by + Holger Fleischmann + * THANKS: Added Holger Fleischmann. + +2004-02-27 Sergey Poznyakoff + + * src/makepath.c: Remove unneded typedefs + + * src/copyin.c: Remove __MSDOS__ conditionals + * src/copyout.c: Likewise + * src/copypass.c: Likewise + * src/main.c: Likewise + * src/tar.c: Likewise + * src/util.c: Likewise + +2004-02-27 Sergey Poznyakoff + + Changed from flat to deep package layout. Added the framework + for NLS support. + + * .cvsignore: Updated + * Makefile.am: Updated + * configure.ac: Updated + * NEWS: Updated + * README-alpha: Updated + * THANKS: Updated + + * autogen.sh: New file + + * alloca.c: Moved to src + * argmatch.c: Likewise + * bcopy.c: Likewise + * dstring.h: Likewise + * copyin.c: Likewise + * copyout.c: Likewise + * copypass.c: Likewise + * cpio.h: Likewise + * cpiohdr.h: Likewise + * defer.c: Likewise + * defer.h: Likewise + * dirname.c: Likewise + * dstring.c: Likewise + * dstring.h: Likewise + * error.c: Likewise + * extern.h: Likewise + * filemode.c: Likewise + * filetypes.h: Likewise + * fnmatch.c: Likewise + * fnmatch.h: Likewise + * getopt.c: Likewise + * getopt.h: Likewise + * getopt1.c: Likewise + * global.c: Likewise + * idcache.c: Likewise + * main.c: Likewise + * makepath.c: Likewise + * mkdir.c: Likewise + * mt.c: Likewise + * rmt.c: Likewise + * rmt.h: Likewise + * rtapelib.c: Likewise + * safe-stat.h: Likewise + * strdup.c: Likewise + * strerror.c: Likewise + * stripslash.c: Likewise + * system.h: Likewise + * tar.c: Likewise + * tar.h: Likewise + * tarhdr.h: Likewise + * userspec.c: Likewise + * util.c: Likewise + * xmalloc.c: Likewise + * xstrdup.c: Likewise + + * cpio.1: Moved to doc + * cpio.texi: Likewise + * mt.1: Likewise + + * src: New directory + * src/.cvsignore: New file + * src/Makefile.am: Likewise + * src/alloca.c: Likewise + * src/argmatch.c: Likewise + * src/bcopy.c: Likewise + * src/copyin.c: Likewise + * src/copyout.c: Likewise + * src/copypass.c: Likewise + * src/cpio.h: Likewise + * src/cpiohdr.h: Likewise + * src/defer.c: Likewise + * src/defer.h: Likewise + * src/dirname.c: Likewise + * src/dstring.c: Likewise + * src/dstring.h: Likewise + * src/error.c: Likewise + * src/extern.h: Likewise + * src/filemode.c: Likewise + * src/filetypes.h: Likewise + * src/fnmatch.c: Likewise + * src/fnmatch.h: Likewise + * src/getopt.c: Likewise + * src/getopt.h: Likewise + * src/getopt1.c: Likewise + * src/gettext.h: Likewise + * src/global.c: Likewise + * src/idcache.c: Likewise + * src/main.c: Likewise + * src/makepath.c: Likewise + * src/mkdir.c: Likewise + * src/mt.c: Likewise + * src/rmt.c: Likewise + * src/rmt.h: Likewise + * src/rtapelib.c: Likewise + * src/safe-stat.h: Likewise + * src/strdup.c: Likewise + * src/strerror.c: Likewise + * src/stripslash.c: Likewise + * src/system.h: Likewise + * src/tar.c: Likewise + * src/tar.h: Likewise + * src/tarhdr.h: Likewise + * src/userspec.c: Likewise + * src/util.c: Likewise + * src/xmalloc.c: Likewise + * src/xstrdup.c: Likewise + + * doc: New directory + * doc/.cvsignore: New file + * doc/Makefile.am: New file + * doc/cpio.1: New file + * doc/cpio.info: New file + * doc/cpio.texi: New file + * doc/mt.1: New file + + * po: New directory + * po/.cvsignore: New file + * po/LINGUAS: New file + * po/Makevars: New file + * po/POTFILES.in: New file + +2003-11-28 Sergey Poznyakoff + + * configure.ac: Added various checks + * Makefile.am (rmt_LDADD): Added. + * error.c: Updated + * rmt.c: Removed useless private_errstring + * system.h: Updated + * userspec.c: Changed the way of handling declared vs. undeclared + system calls. + * strerror.c: New file. Borrowed from GNU Radius. + + * copyin.c: Removed kludgy declaration of delayed_seek_count. + * copypass.c: Likewise + * extern.h: Declare delayed_seek_count. + * mkdir.c: Fixed handling of undeclared errno + * mt.c: Likewise + * util.c: Likewise + * rtapelib.c: Likewise + +2003-11-28 Sergey Poznyakoff + + * TODO: New file + + * README-alpha: New file + * Makefile.am: Require at least version 1.7.1 + * configure.ac: Check for locale.h + * main.c (main): Call setlocale. Thanks + Mitsuru Chinen for the patch. + * THANKS: Updated + +2003-11-21 Sergey Poznyakoff + + * configure.ac: Added to the repository + * Makefile.am: Likewise + * NEWS: Likewise + * README: Likewise + * AUTHORS: Likewise + * .cvsignore: Likewise + + * configure.in: Removed + * Makefile.in: Removed + * makefile.pc: Removed + * configure: Removed + + * alloca.c: Added to the repository + * argmatch.c: Likewise + * bcopy.c: Likewise + * cpio.h: Likewise + * cpiohdr.h: Likewise + * defer.c: Likewise + * defer.h: Likewise + * dirname.c: Likewise + * dstring.c: Likewise + * dstring.h: Likewise + * error.c: Likewise + * filemode.c: Likewise + * filetypes.h: Likewise + * fnmatch.c: Likewise + * fnmatch.h: Likewise + * getopt.c: Likewise + * getopt.h: Likewise + * getopt1.c: Likewise + * idcache.c: Likewise + * mkdir.c: Likewise + * rmt.h: Likewise + * rtapelib.c: Likewise + * safe-stat.h: Likewise + * strdup.c: Likewise + * stripslash.c: Likewise + * tar.c: Likewise + * tar.h: Likewise + * tarhdr.h: Likewise + * xmalloc.c: Likewise + * xstrdup.c: Likewise + + * makepath.c: Updated + * mt.c: Likewise. + * rmt.c: Likewise. + * util.c: Likewise. + * copyin.c: Likewise. + * copyout.c: Likewise. + * copypass.c: Likewise. + * global.c: Likewise. + * main.c: Likewise. + +Thu Jun 13 20:14:48 2002 John Oleynick (juo@gnu.org) + * copyin.c: Strip leading / on absolute filenames after + comparing to the list of files specified on the command line + (instead of before). Problem reported by Jeff Holt. + * Version 2.5 released. + +Thu Jun 13 00:20:30 2002 John Oleynick (juo@gnu.org) + * Makefile.in: Fixed problem of looking in srcdir for info files. + Bug reported by Mike Castle. + * cpio.texi: Fixed typo. Problem reported by Fabrice Bauzac. + +Sun Jan 13 18:45:02 2002 John Oleynick (juo@gnu.org) + * copyin.c: Fixed a problem skipping files with multiple links + in a newc or CRC format archive. If the file with the shared copy + of the data was skipped, but other links were not skipped, the + other links were created as empty files. Bug reported by + Hendrik-Jan Thomassen. + +Thu Dec 6 20:05:10 2001 John Oleynick (juo@gnu.org) + * mt.c, mt.1: Merged Debian --rsh-command option and -V fix. + * copyout.c, copypass.c, util.c, extern.h: Modified to warn + if a file grows or its mtime is changed while it is being + copied. + +Wed Dec 6 00:02:04 2001 John Oleynick (juo@gnu.org) + * Many files: Updated FSF's address in copyright notices. + +Wed Aug 29 23:57:05 2001 John Oleynick (juo@gnu.org) + * Many files: Numerous fixes from Debian, Red Hat and SuSE + GNU/Linux distributions. + +Tue Jan 16 19:03:05 1996 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * util.c: An I/O error reading a file would cause the last byte + of the next file to be corrupted in the archive. Thanks to a + buggy NT NFS server for pointing out this problem. + * Version 2.4.2 released. + +Tue Jan 9 23:19:37 1996 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * copyout.c: missed 1 part of last bug fix. + +Mon Jan 8 16:49:01 1996 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * copyout.c, copypass.c: Use result of readlink() as length + of link name instead of size from lstat(). On some OS's lstat() + doesn't return the true length in size. Bug reported by + Robert Joop (rj@rainbow.IN-berlin.DE). + +Wed Dec 20 10:52:56 1995 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * rmt.c: Added temporary kludge so make rmt will work on Linux. + * configure.in: Only define HAVE_UTIME_H if utime.h declares + struct utimbuf. + * Makefile.in: Change prefix, exec_prefix and bindir to get their + values from configure. Added cpio.info to DISTFILES. + * cpio.texi: Added INFO-DIR-ENTRY. + * Version 2.4.1 released. + +Wed Nov 22 19:37:05 1995 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * cpio.texi: Updated release date and FSF's address. + * NEWS: Listed major new features for 2.4. + * mt.c, mt.1: Added seek and fsfm commands. + * Version 2.4 released. + +Tue Jun 27 19:14:27 1995 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * configure.in: fixed for new autoconf. Added check to make + sure fnmatch() works. + * Makefile.in: changed realclean to maintainer-clean. Added + support to handle fnmatch separate from other LIBOBJS. + * cpio.texi: More changes for 2.4. + +Wed Dec 14 16:14:27 1994 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * copypass.h: When given the -a option, set the access time of + the copy to be the access time of the original (instead of the + modification time of the original). Reported by + karney@pppl.gov (Charles Karney). + * cpio.texi: Updated with changes for 2.4. + +Wed Nov 3 18:18:07 1994 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * safe-stat.h, Makefile.in: New file used by mkdir.c. This will go + away when we get the real safe-xstat.[ch]in for mkdir.c. + * main.c: Don't mention [--null] twice in -p's usage message. + Changed --no-absolute-paths to --no-absolute-filenames. + * cpio.1: Updated man page with new features. + * cpio.texi, texinfo.tex, Makefile.in: Added texi documentation + from Robert Carleton (rbc@gnu.ai.mit.edu). + +Mon Oct 3 00:46:30 1994 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * makefile.pc, system.h: Changes to compile with Borland C++ 4.0. + +Thu Sep 29 22:15:50 1994 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * makepath.c: Don't #define index if it is already #defined. + + * mt.c: Check for __hpux defined instead of __hpux__. Reported + by ericb@lsid.hp.com (Eric Backus). + +Thu Sep 29 11:21:31 1994 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * extern.h, util.c, copyout.c, copypass.c, main.c, global.c: + Never mind --ignore-disk-input-errors flag, we'll just always + do that, like tar. + + * global.c, extern.h, main.c, copyin.c, copyout.c, copypass.c: + Added --quiet flag to supress printing number of blocks copied. + + * global.c, extern.h: If compiled with gcc, make input_bytes + and output_bytes `long long' instead of `long'. We need more + than 32 bits to keep track of the number of bytes copied to + and from tape drives that hold more than 4Gbytes. + + * util.c, copyin.c, main.c, global.c, extern.h: Added + --only-verify-crc flag to read a CRC format archive and verify + its contents' CRCs. + + * copyout.c: Fixed problem with creating oldc format archives + on machines with 16 bit ints. Reported by mpoole@cix.compulink.co.uk + (Martin Poole). + + * mt.c: Need to open tape WR_ONLY for erase command (and probably + others?). Reported by robert@hst.e.technik.uni-kl.de (Robert + Vogelgesan). Accept `eject' as a synonym for `offline'. Accept + `-t' as a synonym for `-f' (to be compatible with HPUX mt, which + only accepts `-t'). + +Wed Sep 28 12:01:55 1994 John Oleynick (juo@wombat.gnu.ai.mit.edu) + * extern.h, global.c, main.c, util.c: only write sparse files + when given --sparse flag. + * extern.h, util.c, copyout.c, copypass.c, main.c, global.c: + Added support for --ignore-disk-input-errors flag. + +Wed Aug 24 12:55:38 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * configure.in: Replace calls to AC_REMOTE_TAPE and AC_RSH + with equivalent code, since those macros are going away. + +Sun Feb 13 00:56:48 1994 John Oleynick (juo@goldman.gnu.ai.mit.edu) + * extern.h, global.c, main.c, util.c: Added code to + tape_buffered_peek() to properly handle large, corrutped + archives, without overrunning the allocated buffer and + dumping core. Also changed the way the input and output + buffers are allocated in initialize_buffers(). + +Tue Jan 25 01:04:32 1994 John Oleynick (juo@goldman.gnu.ai.mit.edu) + * copyin.c, copyout.c, copypass.c, extern.h, main.c, tar.c, util.c: + Redid i/o buffer code. Previously, the same routines buffered input and + output for accessing the archive and the filesystem. Now there are + separate routines for buffering input and output and for buffering the + archive and the filesystem. This simplifies much of the buffer code + (e.g., only input from the archive has to check for end of tape and + allow the tape to be changed, only output to the filesystem has to + handle byte and word swapping, etc.; previously one routine had to + handle all of these special cases) This is how the routines got split + and renamed (old name -> new name): + + clear_rest_of_block -> tape_clear_rest_of_block + copy_files -> copy_files_tape_to_disk + " -> copy_files_disk_to_disk + " -> copy_files_disk_to_tape + copy_buf_out -> disk_buffered_write + " -> tape_buffered_write + copy_in_buf -> tape_buffered_read + empty_output_buffer -> tape_empty_output_buffer + " -> disk_empty_output_buffer + fill_input_buffer -> tape_fill_input_buffer + " -> disk_fill_input_buffer + pad_output -> tape_pad_output + peek_in_buf -> tape_buffered_peek + skip_padding -> tape_skip_padding + toss_input -> tape_toss_input + + * extern.h, global.c, main.c, util.c: Added support for + writing sparse files. + +Tue Dec 28 23:01:36 1993 John Oleynick (juo@goldman.gnu.ai.mit.edu) + * util.c, system.h, makepath.c, extern.h: don't define chown() + and don't typedef uid_t and gid_t if we are being compiled + by DJGPP. + + * copyin.c, extern.h, global.c, main.c: Added support for + --rename-batch-file. + + * copyin.c, copyout.c, extern.h: Cleaned up to pass gcc -Wall. + +Wed Dec 22 02:17:44 1993 John Oleynick (juo@goldman.gnu.ai.mit.edu) + + * makepath.c, copypass.c, copyin.c: If cpio was creating a + directory that contained `.' in the pathname (e.g. `foo/./bar'), + it would complain that it could not create `.', since it already + exists. From schwab@issan.informatik.uni-dortmund.de (Andreas + Schwab). + + * mt.c: Added "eject" as a synonym for "offline". + + * util.c: Slight modification to when we lseek with + BROKEN_LONG_TAPE_DRIVER (do it every 1Gb, instead + of every 2Gb). + + * copyin.c, global.c, extern.h: Added --no-absolute-paths option, + to ignore absolute paths in archives. + +Tue Dec 21 01:30:59 1993 John Oleynick (juo@goldman.gnu.ai.mit.edu) + + * util.c: Fix for copying new_media_message_after_number. From + Christian.Kuehnke@arbi.informatik.uni-oldenburg.de (Christian + Kuehnke). + +Thu Jul 29 20:35:57 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * Makefile.in (config.status): Run config.status --recheck, not + configure, to get the right args passed. + +Mon Jul 19 23:01:00 1993 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * Makefile.in (libdir): Use standard GNU value -- + $(exec_prefix)/lib, not /etc. + (.c.o): Put CFLAGS last. + +Thu Jul 8 19:43:39 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * Makefile.in: Add rules for remaking Makefile, configure, + config.status. + +Mon Jul 5 14:54:08 1993 John Oleynick (juo@spiff.gnu.ai.mit.edu) + + * cpio.1: Updated man page for 2.3. + * Makefile.in: Create distribution with .gz extension, instead of .z. + +Tue Jun 29 18:54:37 1993 John Oleynick (juo@goldman.gnu.ai.mit.edu) + + * Makefile.in: Added installdirs target (using mkinstalldirs). + * Added mkinstalldirs script. + * main.c, mt.c: Added --help option. Changed usage() to + take a stream and exit value (so --help can print on stdout + and return a 0 exit status). + * extern.h: Removed usage()'s prototype (it was out of date, + and only used in main.c). + +Thu May 6 00:22:22 1993 John Oleynick (juo@hal.gnu.ai.mit.edu) + + * cpio.1: Added hpbin and hpodc. + +Tue May 4 00:32:29 1993 John Oleynick (juo@hal.gnu.ai.mit.edu) + + * copyin.c (process_copy_in), copypass.c (process_copy_pass): When + deleting an existing file, if the file is a directory, use rmdir() + instead of unlink(). + +Thu Apr 29 14:43:56 1993 John Oleynick (juo@goldman.gnu.ai.mit.edu) + + * tar.c (read_in_tar_header): Clear non-protection bits from + mode, in case tar has left some device bits in there. + +Wed Apr 28 10:36:53 1993 John Oleynick (juo@goldman.gnu.ai.mit.edu) + + * util.c: Added code to try and work around broken tape drivers + that have problems with tapes > 2Gb. + + * copyout.c (process_copy_out): Pass file_hdr to + writeout_other_defers() and add_link_defer() by reference, + not by value. + + * copyin.c (process_copy_in): Pass file_hdr to defer_copyin() + and create_defered_links() by reference, not by value. + + * defer.c: include (to build on BSD 4.3 on HP300) + +Fri Apr 16 18:01:17 1993 John Oleynick (juo@goldman.gnu.ai.mit.edu) + + * mt.c, util.c: Include if HAVE_SYS_MTIO_H is + defined, not HAVE_MTIO_H. + +Wed Apr 14 17:37:46 1993 John Oleynick (juo@goldman.gnu.ai.mit.edu) + + * util.c: Include if HAVE_SYS_IO_TRIOCTL_H + is defined. + + * mt.c: Only include if HAVE_SYS_MTIO_H is defined. + +Fri Apr 2 13:09:11 1993 John Oleynick (juo@goldman.gnu.ai.mit.edu) + + * configure.in: Added fnmatch to AC_REPLACE_FUNCS. Added + sys/io/trioctl.h to AC_HAVE_HEADERS. + + * Makefile.in: Removed fnmatch.o from OBJS. + + * copyin.c: Only include "fnmatch.h" if FNM_PATHNAME isn't + defined yet. + + * mt.c: Include if HAVE_SYS_IO_TRIOCTL_H is + defined. + +Mon Mar 29 17:04:06 1993 John Oleynick (juo@hal.gnu.ai.mit.edu) + + * Many changes for supporting HPUX Context Dependent Files; + also some bug fixes to fix problems with multiply (hard) linked + device files; minor changes to support HPUX format archives + (slightly broken?) System V.4 posix tar archives and HPUX + posix tar archives. + + * Makefile.in: New files defer.o, defer,c and defer.h; added + -DSYMLINK_USES_UMASK and -DHPUX_CDF comments; changed dist rule + to use gzip with tar, instead of compress. + + * copyin.c: changes for new arf_hpbinary and arf_hpascii formats; + HPUX CDF's; DEBUG_CPIO; fixes to properly handle multiple + links in newc and crc format archives (new routines defer_copyin(), + create_defered_links(), create_final_defers()); move most + multiple (hard) link code to new routines link_name() and + link_to_maj_min_ino(); use new macro UMASKED_SYMLINK instead of + symlink(). + + * copyout.c: fixes to properly handle multiple links in newc + and crc format archives (new routines last_link(), + count_defered_links_to_dev_ino(), add_link_defer(), + writeout_other_defers(), writeout_final_defers(), + writeout_defered_file()); support for new arf_hpbinary and + arf_hpascii formats; support for HPUX CDF's. + + * copypass.c: move most multiple link code to new routines + link_name() and link_to_maj_min_ino(); use new macro UMASKED_SYMLINK + instead of symlink(); support for HPUX CDF's. + + * extern.h: added arf_hpascii and arf_hpbinary archive enum types; + added debug_flag. + + * global.c: added debug_flag. + + * main.c: added debug_flag; support for hpodc and hpbin formats. + + * makepath.c: split from standard makpath.c to add support + for HPUX CDF's. + + * mt.c: added !defined(__osf__) (from Andrew Marquis + ). + + * system.h: new macro UMASKED_SYMLINK + + * tar.c: minor changes to read (slightly broken?) System V.4 posix + tar archives and HPUX posix tar archives. + + * util.c: HPUX CDF support (including new routines + add_cdf_double_slashes() and islasparentcdf()); new routine + umasked_symlink(). + +Sun Mar 14 23:00:14 1993 Jim Meyering (meyering@comco.com) + + * copypass.c (process_copy_pass): Use <=, not just <, when comparing + mtimes. From Pieter Bowman . + +Fri Jan 15 14:35:37 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * copyin.c: Move include of fnmatch.h to get right FNM* macros. + +Tue Nov 24 08:45:32 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * Version 2.2. + + * copyout.c (process_copy_out): Add parens for gcc -Wall. + From Jim Meyering. + + * system.h: Use HAVE_FCNTL_H, not USG. + + * dstring.c, mt.c, system.h: Use HAVE_STRING_H, not USG. + +Fri Nov 20 22:47:18 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * copyin.c (read_in_binary): Copy the dev and ino that are + already in `file_hdr' into `short_hdr'. + From dao@abars.att.com (David A Oshinsky). + + * system.h [!_POSIX_VERSION]: Declare lseek as off_t, not long. + From Karl Berry. + +Wed Oct 14 13:53:41 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * Version 2.1. + +Tue Oct 13 22:51:34 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * main.c: Add --swap equivalent to -b. + + * mt.c: Add f_force_local variable and -V --version option. + +Fri Oct 2 18:42:27 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * main.c (long_opts, usage): Add --force-local option. + +Thu Oct 1 23:23:43 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * main.c (process_args) [__MSDOS__]: Don't call geteuid. + + * copyin.c (read_in_{old,new}_ascii): Use `l' for sscanf into longs. + * copyout.c (write_out_header): Ditto for sprintf. + * global.c, extern.h: Make input_size and output_size long. + +Thu Sep 10 23:39:30 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * global.c, extern.h: Add new var f_force_local to work with + rmt.h change from tar. + +Sun Aug 23 00:18:20 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * Version 2.0. + + * tar.c (otoa): Compute value in an unsigned long, not an int. + * copyout.c (write_out_header) [__MSDOS__]: Don't use dev_t. + + * main.c (process_args): By default, don't chown for non-root users. + +Sat Aug 22 14:17:54 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * global.c, extern.h: Use uid_t and gid_t. + + * main.c (main) [__EMX__]: Expand wildcards. + * system.h [__EMX__]: Alias some error names. From Kai Uwe Rommel. + + * extern.h [__STDC__]: Use prototypes. + + * copyin.c (process_copy_in), copyout.c (process_copy_out), + copypass.c (process_copy_pass): Open all files with O_BINARY. + Add cast to chmod call. + * util.c: Add cast to bcopy calls. Make hash_insert static. + From Kai Uwe Rommel. + +Thu Aug 20 22:03:49 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * util.c (peek_in_buf): Don't print "end of file" before + getting the next reel of medium. + + * copyin.c (read_in_old_ascii): Allocate space for NUL terminator. + Print newline for dot line when done, even if appending. + +Thu Jul 23 16:34:53 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * tar.c (write_out_tar_header, read_in_tar_header) + [__MSDOS__]: Don't try to get user and group names. + * extern.h: Don't declare the functions to do it (need uid_t). + + * main.c [__MSDOS__]: Ignore the -R option. + + * system.h: Define makedev if defining major and minor. + + * copyin.c, copyout.c [__MSDOS__]: setmode on archive_des, not + 0 and 1. + +Sat Jul 18 14:30:55 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * tar.c, stripslash.c, userspec.c, cpiohdr.h, tar.h, tarhdr.h, + system.h: New files. + * Move portability stuff from various files to system.h. + * cpio.h: Rename header structure and members, and add + new structure for SVR4 format. + * copyin.c, copyout.c: Use the new structure internally, the + old one only for I/O in the old formats. + * copyin.c (read_in_header): Recognize the new archive formats. + (read_in_new_ascii, read_pattern_file, skip_padding): New functions. + (swab_array): Do the swapping using char pointers instead of + bitwise arithmetic. + (process_copy_in): Handle byte and halfword swapping and new formats. + Ok if a directory we want to make already exists, but set its perms. + Do chmod after chown to fix any set[ug]id bits. + Use `struct utimbuf' instead of a long array. + * copyout.c (write_out_header): Handle new formats. + (process_copy_out): Use `struct utimbuf'. + Handle appending and new formats. + Remove any leading `./' from filenames. + (read_for_checksum, clear_rest_of_block, pad_output): New functions. + * copypass.c (process_copy_pass): Use `struct utimbuf'. + Ok if a directory we want to make already exists, but set its perms. + Do chmod after chown to fix any set[ug]id bits. + Don't change perms of `.'. + * extern.h, global.c: Replace the separate format flags with + one variable. Add new variables for the new options. + * main.c: Add new options -A --append, -H --format, -C --io-size, + -M --message, --no-preserve-owner, -R --owner, -E --pattern-file, + -V --dot, -s --swap-bytes, -S --swap-halfwords, -b, -I, -k, -O. + (usage): Document them. + (process_args): Recognize them. Use open_archive. + (initialize_buffers): Allow room for tar archives and double buffers. + * util.c (empty_output_buffer_swap): New function. + (empty_output_buffer): Call it if swapping current file. + Check additional end of media indicators. + (swahw_array, peek_in_buf, prepare_append, open_archive, + set_new_media_message): New functions. + (fill_input_buffer): Don't print error message if end of media. + (toss_input): Don't seek, always read. + (copy_files): Update crc if needed. + (find_inode_file, add_inode): Check major and minor numbers as + well as dev. + (get_next_reel): Prompt user if archive name is unknown. + Print fancy messages. + Close the archive and reopen it. + + Above primarily from John Oleynick . + + * util.c (find_inode_file): Use modulus when computing initial + loop index. + (add_inode): Zero out new entry. + From scott@sctc.com (Scott Hammond). + + * cpio.h, copyin.c, copyout.c: Rename `struct cpio_header' + members from h_foo to c_foo. + +Wed May 20 00:09:26 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * copyin.c: If we include a header file specifically to get + major et al., assume we have them. + +Mon Mar 9 19:29:20 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * mt.c (main): rmtclose the tape file descriptor. + + * main.c (main): rmtclose the archive, if not in copy-pass mode. + + * util.c (create_all_directories): Don't print a message when + creating a directory, for UNIX compat. + + * copyin.c (process_copy_in), copypass.c (process_copy_pass): + Skip file if it has the same timestamp as existing file, not just + if it is older than existing file, for UNIX compat. + +Tue Mar 3 12:06:58 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * main.c, mt.c (usage): Document long options as starting with + -- instead of +. + + * extern.h: Only declare lseek if not _POSIX_VERSION. + +Tue Dec 24 00:19:45 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * copyin.c: Use MAJOR_IN_MKDEV and MAJOR_IN_SYSMACROS instead + of USG and _POSIX_VERSION to find major and minor macros. + + * mt.c: Use unistd.h and stdlib.h if available. + + * copyin.c, copyout.c, copypass.c, util.c, extern.h: Change + POSIX ifdefs to HAVE_UNISTD_H and _POSIX_VERSION. + +Sun Aug 25 06:31:08 1991 David J. MacKenzie (djm at apple-gunkies) + + * Version 1.5. + + * bcopy.c: New file (moved from util.c). + + * mt.c (print_status): Not all hpux machines have mt_fileno + and mt_blkno; rather than trying to track HP's product line, + just assume none of them have them. + + * util.c (copy_buf_out, copy_in_buf): Use more efficient + copying technique for a big speedup. + +Fri Aug 2 04:06:45 1991 David J. MacKenzie (djm at apple-gunkies) + + * configure: Support +srcdir. Create config.status. + Remove it and Makefile if interrupted while creating them. + +Thu Jul 18 09:43:40 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * Many files: use __MSDOS__ instead of MSDOS. + + * util.c, configure: Use NO_MTIO instead of HAVE_MTIO, to keep + up with tar and rtapelib.c. + +Mon Jul 15 13:45:30 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * configure: Also look in sys/signal.h for signal decl. + +Thu Jul 11 01:50:32 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * Version 1.4. + + * configure: Remove /etc and /usr/etc from PATH to avoid + finding /etc/install. + +Wed Jul 10 01:40:07 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * makefile.pc: Rewrite for Turbo C 2.0. + * util.c [__TURBOC__] (utime): New function. + * alloca.c, tcexparg.c: New files. + + * extern.h [STDC_HEADERS]: Don't declare malloc and realloc. + + * main.c [MSDOS]: Make binary mode the default. + * copyin.c, copyout.c: Make stdin or stdout binary mode as + appropriate (so cpio archives don't get corrupted). + + * Many files: Use if STDC_HEADERS as well as if USG. + + * configure, Makefile.in: $(INSTALLPROG) -> $(INSTALL), + $(INSTALLTEXT) -> $(INSTALLDATA). + +Mon Jul 8 23:18:28 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * configure: For some library functions that might be missing, + conditionally add the .o files to Makefile instead of + defining func_MISSING. + * mkdir.c: Renamed from mkrmdir.c. + +Sat Jul 6 02:27:22 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * configure: echo messages to stdout, not stderr. + Use a test program to see if alloca needs -lPW. + +Thu Jun 27 16:15:15 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * copyin.c (process_copy_in), copyout.c (process_copy_out), + copypass.c (process_copy_pass): Check close return value for + delayed error notification because of NFS. + +Thu Jun 20 02:43:33 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * configure: Include $DEFS when compiling test programs. + + * util.c: Only declare getpwuid and getgrgid if not POSIX. + + * Version 1.3. + + * copyin.c: Use time_t, not long, for time values. + + * mt.c (print_status): Special cases for HP-UX and Ultrix. + + * util.c: Compile bcopy if USG or STDC_HEADERS, not BCOPY_MISSING. + +Tue Jun 11 16:40:02 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * copyin.c: Don't include sys/sysmacros.h if _POSIX_SOURCE. + + * copyin.c, copyout.c, copypass.c: Don't include sys/file.h if POSIX. + + * util.c: Include sys/types.h before, not after, pwd.h and grp.h. + + * configure: New shell script to aid configuration and create + Makefile from Makefile.in. + + * copyin.c (process_copy_in): Use POSIX.2 fnmatch instead of + glob_match. + +Mon Jun 10 22:11:19 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * global.c, extern.h: New variable, name_end. + * main.c (process_args, usage): Add -0 +null option to set it. + * copypass.c (process_copy_pass), copyout.c (process_copy_out): + Use it. + + * dstring.c (ds_fgetstr): New function made from ds_fgets. + (ds_fgets, ds_fgetname): Implement as front ends to ds_fgetstr. + +Sun Jun 2 15:45:24 1991 David J. MacKenzie (djm at wheat-chex) + + * most files: use GPL version 2. + +Sat May 18 11:39:22 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * copyin.c, copypass.c: Take out #ifdef MSDOS around chown. + * util.c [MSDOS]: Provide dummy chown. + +Fri May 17 21:29:05 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu) + + * Version 1.2. + + * makefile.pc, cpio.cs: Update for new source and object files. + +Fri Mar 15 05:48:36 1991 David J. MacKenzie (djm at geech.ai.mit.edu) + + * global.c, extern.h: New variable `archive_desc'. + * main.c (process_args): Set it. + * copyout.c (process_copy_out), copyin.c (process_copy_in): + Use it. + + * copyout.c (process_copy_out), copyin.c (process_copy_in): + Remote tapes are special and not seekable; don't fstat them. + + * main.c (main, usage): Add -F, +file option. Use rmtopen. + (main): Exit after printing version number. + * util.c (empty_output_buffer): Use rmtwrite instead of write. + (fill_input_buffer): Use rmtread instead of read. + (tape_offline): Use rmtioctl instead of ioctl. + Test HAVE_MTIO instead of MTIO_MISSING, for tar compatibility. + +Thu Mar 14 17:49:57 1991 David J. MacKenzie (djm at geech.ai.mit.edu) + + * util.c (create_all_directories): Use make_path to do the work. + +Sat Jan 12 15:32:15 1991 David J. MacKenzie (djm at geech.ai.mit.edu) + + * copyin.c, copyout.c, copypass.c, util.c: Only declare + `errno' if not MSDOS. Some Unix errno.h do, some don't . . . . + + * global.c, extern.h: Make `input_size' and `output_size' + unsigned, for 16 bit machines. + + * copyin.c (print_name_with_quoting): All non-ctrl chars are + printable on MS-DOS. + + * util.c (empty_output_buffer): Never make sparse files; + can create unrunnable executables. + * copyin.c, copyout.c, copypass.c: Callers changed. + * util.c (finish_output_file): Function removed. + +Tue Nov 6 15:47:16 1990 David J. MacKenzie (djm at apple-gunkies) + + * copyin.c, util.c, extern.h: Rename copystring to xstrdup. + +Mon Oct 29 02:24:41 1990 David J. MacKenzie (djm at apple-gunkies) + + * util.c (empty_output_buffer): Only make sparse files if + NO_SPARSE_FILES is undefined, to accomodate dumb kernels. + +Wed Jul 25 18:48:35 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * util.c (getuser, getgroup): Make uid and gid unsigned short, + not int. + +Sat Jul 21 00:44:44 1990 David J. MacKenzie (djm at apple-gunkies) + + * copyin.c, copyout.c, copypass.c, util.c, cpio.h: Add ifdefs + for MSDOS. + +Sun Jul 15 23:51:48 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * copyin.c, copyout.c, copypass.c, global.c, extern.h, util.c: + Use longs where appropriate, for 16 bit machines. + +Sun Jul 8 22:58:06 1990 David J. MacKenzie (djm at apple-gunkies) + + * main.c (process_args, usage): Change -b option to -O (old), to + allow adding byte swapping later. + +Sat Jul 7 14:48:35 1990 David J. MacKenzie (dave at edfmd) + + * Version 1.1. + + * cpio.h: Make `mtime' and `filesize' unsigned long. + * copyin.c (read_in_binary), copyout.c (write_out_header): + High short-word of `mtime' and `filesize' always comes first. + + * (read_in_ascii, read_in_binary): New functions, from code in + read_in_header. + (read_in_header): Search for valid magic number, then fill in + rest of header using read_in_ascii and read_in_binary. + * global.c, extern.h: New variable, `binary_flag'. + * main.c (process_args): Recognize new -b +binary option. + * util.c [BCOPY_MISSING] (bcopy): New function. + +Wed Jul 4 00:40:58 1990 David J. MacKenzie (djm at apple-gunkies) + + * main.c (process_args): Add local pointers to functions to + work around a pcc bug found on a Convex. + + * copyin.c (process_copy_in), util.c (toss_input, + create_all_directories, add_inode): Don't use `index' as a + variable name. + +Tue Jul 3 02:33:36 1990 David J. MacKenzie (djm at apple-gunkies) + + * version 1.0. + +Mon Jul 2 23:18:56 1990 David J. MacKenzie (djm at twiddle) + + * copyin.c (process_copy_in), copyout.c (process_copy_out), + copypass.c (process_copy_pass): Print "1 block", not "1 blocks". + + * copyin.c (process_copy_in), copypass.c (process_copy_pass): + Unlink existing dest. file unless either it is newer and + not unconditional, or it is a directory. + +Mon Jul 2 03:57:41 1990 David J. MacKenzie (dave at edfmd) + + * util.c (xrealloc): New function. + * dstring.c (ds_resize): Use xrealloc instead of free and + xmalloc. Never shrink the string. + + * copypass.c (process_copy_pass): More efficient + string handling while constructing output filename. + + * global.c, extern.h, main.c, cpio.h: Change from an enum, + `copy_command', to a pointer to a void function, `copy_function'. + + * cpio.h (struct cpio_header): Make most fields unsigned. + Rename h_filesize to h_filesizes and h_mtime to h_mtimes, and + add new `long' fields with the old names at the end of the + structure. + * copyin.c (read_in_header): Set the long fields from the + short arrays, making sure longs are aligned properly. + (process_copy_in, long_format): Use the long fields. + * copyout.c (write_out_header): Set the short arrays from the + long fields, making sure longs are aligned properly. + (process_copy_out): Use the long fields. + + * global.c, extern.h: New variable `output_is_seekable'. + * util.c (empty_output_buffer): If output_is_seekable, use + lseek to write blocks of zeros. + (finish_output_file): New function. + * copyin.c (process_copy_in), copyout.c (process_copy_out), + copypass.c (process_copy_pass): Set `output_is_seekable' + correctly and call finish_output_file. + * main.c (initialize_buffers): Allocate space for sentinel in + `output_buffer'. + + * global.c, extern.h: New variable `numeric_uid'. + * main.c (process_args): Accept -n +numeric-uid-gid option, like ls. + * copyin.c (long_format): Use numeric_uid. + + * copyin.c (process_copy_in), copyout.c (process_copy_out), + copypass.c (process_copy_pass): Don't (for verbose) print the + names of files that are not copied because of errors. Try to + create missing directories for all file types. Free temporary + buffers on error. + +Sat Jun 30 14:28:45 1990 David J. MacKenzie (djm at apple-gunkies) + + * version.c: New file. + * main.c: Add -V, +version option. + * Makefile [dist]: Extract version number from version.c. + +Sat Jun 30 12:44:47 1990 David J. MacKenzie (dave at edfmd) + + * global.c, extern.h, copyin.c, copyout.c, util.c: Rename + `{input,output}_is_regular' to `{input,output}_is_special' and + reverse the truth value. + + * global.c, extern.h: New variable `input_is_seekable' to + control whether to skip data with lseek or read. + * copyin.c (process_copy_in): Set it. + * util.c (toss_input): Use it. + + * global.c, extern.h: New variable `xstat' that selects stat + or lstat for input files. + * main.c (process_args): New option -L, +dereference to set + xstat to stat instead of lstat. + (usage): Document it. + * copyout.c (process_copy_out), copypass.c + (process_copy_pass): Use *xstat on input file. + +Sat Jun 30 01:53:12 1990 David J. MacKenzie (dave at edfmd) + + * dstring.c (ds_init): Return void because return value was + never used. + (ds_resize): Ditto, and free old value instead of new one. + + * util.c (empty_output_buffer, fill_input_buffer, + copy_out_buf, copy_in_buf, toss_input, copy_files): Return + void instead of an error value and make errors fatal + immediately instead of several levels up, to prevent printing + of multiple error messages by different levels of functions. + + * copyin.c (read_in_header): Return void, because the error + handling all happens at lower levels. + (print_name_with_quoting): New function. + (long_format): Call print_name_with_quoting. Take additional + arg for name of linked-to file, and print it if nonzero. + (process_copy_in): For verbose listing of symlinks, read in + the linkname and pass it to long_format. + + * extern.h: Declare some more functions. + +Thu Jun 28 16:07:15 1990 David J. MacKenzie (dave at edfmd) + + * copypass.c (process_copy_pass): Warn about unknown file types. + + * copyout.c (process_copy_out): Check fstat return for error. + Record filesize of 0 for special files. Warn about unknown + file types. + + * copyin.c (process_copy_in): Warn about unknown file types. + (read_in_header): Warn about byte-reversed binary headers. + +Sat Jun 23 22:50:45 1990 David J. MacKenzie (dave at edfmd) + + * main.c (main): Set umask to 0 so permissions of created + files are preserved. + + * copyin.c, copyout.c, copypass.c, util.c: Pass file + descriptors as ints, not pointers to ints. + Cast file timestamps and sizes to long *, not int *, for 16 + bit machines. + Use lstat instead of stat, if available. + Handle FIFO's, sockets, and symlinks, if supported by O.S. + + * copyin.c (process_copy_in), copyout.c (process_copy_out): + Don't consider FIFO'S, sockets, etc. to be possible tape drives. + + * util.c (create_all_directories): Fix incorrect loop + termination check. Only copy string if it contains slashes. + Don't check whether directory "" exists. + (tape_offline): Code moved from get_next_reel. + (get_next_reel): Print message before taking tape offline. + Read a line of arbitrary length. + + * copyout.c, copyin.c, copypass.c: Always use utime, not utimes. + + * copyin.c (swab_short): New macro. + (swab_array): New function. + (read_in_header): In binary mode, if a byte-swapped header is + read, swap the bytes back. + (process_copy_in, process_copy_pass): Don't stat each file to + create unless !unconditional_flag. Create device files correctly. + Don't temporarily allow files being created to be read by + other users. Don't unnecessarily chmod special files. + +Thu May 31 20:51:43 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * copyin.c (long_format): Use mode_string to format + file protections instead of doing it ourselves. + (protections): Function removed. + +Sat Apr 14 02:31:01 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * cpio.h (struct cpio_header): Make inode, mode, uid, gid + fields unsigned. + + * util.c (getgroup): New function. + * copyin.c (long_format): Print group name of files. + Print file size, etc. as unsigned integers, not signed. + + * main.c (process_args): If -t is given and neither -i, -o, or + -p is given, assume -i. + + * Add -f, +nonmatching option. + * main.c: Rename +out to +create, +in to +extract, + +modification-time to +preserve-modification-time, + +pass to +pass-through. + + * copyin.c (process_copy_in), copypass.c (process_copy_pass): + Don't complain in chown fails because the user doesn't have + permission. + +Fri Apr 13 13:53:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * Add ifdefs for USG/Xenix. + * util.c (cpio_error): Function removed. + * Use error instead of cpio_error, so system error messages + will be included. + * cpio.h: Rename 'hdr_struct' to 'struct cpio_header'. + * Move definition of xmalloc from dstring.c to util.c. + * global.c, extern.c: Add global `program_name'. + * main.c (main): Set program_name. + (process_args): Rename +reset-atime to +reset-access-time, + +table to +list. + Have +block-size take an argument. + +Thu Apr 12 13:33:32 1990 David J. MacKenzie (djm at rice-chex) + + * util.c (find_inode_file): Make inode an int, not a short. + + * Make functions that don't return a value have type void. + Add some casts to function calls. + +Wed Apr 11 14:55:28 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * main.c (process_args): -i, -o, and -p don't take arguments. + + * main.c (process_args): Get the non-option args from the + correct elements of argv. + +Tue Apr 10 00:20:26 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * Indent source code and update copyrights. + + * cpio.c (usage): Change `collection' to `archive' in message. + +Thu Dec 28 03:03:55 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * dstring.c (xmalloc): Don't return a null pointer if size is 0, + on the assumption that trying to allocate 0 bytes is a bug that + should be trapped. + +Wed Dec 20 03:24:48 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * All files: Change from GNU CPIO General Public License to + GNU General Public License. + +Mon Dec 18 13:18:36 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * Makefile: Add clean target and defines for CC and LDFLAGS. + Add dist target and SRCS, DISTFILES macros. Add tags and TAGS targets. + * dstring.c (ds_fgets): Read characters into an int, not char. + (xmalloc): New function. + (out_of_memory): Function removed. + Global: use xmalloc instead of malloc and out_of_memory. + * extern.h, global.c: Make flag variables ints instead of chars for + compatibility with getopt_long. + * extern.h: Declare more functions. + * main.c (usage): Put the whole usage message into a single string + and fix errors. + * util.c (create_all_directories): Remove unused variable. + (get_next_reel): Ditto. + * dstring.h: Declare function. + +Sat Dec 2 13:22:37 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * main.c: Change +copy-pass option to +pass, +copy-in to +in, + +copy-out to +out, and +mkdir to +make-directories, and add null + option to terminate table. + (process_args): Use the same code to handle long and short named + options. + (usage): Mention long options in message. + +Local Variables: +mode: change-log +version-control: never +End: diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..5458714 --- /dev/null +++ b/INSTALL @@ -0,0 +1,234 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006 Free Software Foundation, Inc. + +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 +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +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. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +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 +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +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. + +Installation Names +================== + +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'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +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 +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +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. + +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 +`--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: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + 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 +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +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'. +`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. +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 +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 +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..3edf5c7 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,23 @@ +# This file is part of GNU cpio +# Copyright (C) 2003, 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. + +ACLOCAL_AMFLAGS = -I m4 + +AUTOMAKE_OPTIONS = gnits 1.8 dist-bzip2 std-options + +SUBDIRS = doc headers lib rmt src po tests diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..7f08883 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,900 @@ +# Makefile.in generated by automake 1.10a from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# This file is part of GNU cpio +# Copyright (C) 2003, 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. +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@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 +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure ABOUT-NLS AUTHORS COPYING ChangeLog \ + INSTALL NEWS THANKS TODO 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/mkinstalldirs build-aux/texinfo.tex build-aux/ylwrap +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/argp.m4 \ + $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/canonicalize-lgpl.m4 \ + $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \ + $(top_srcdir)/m4/clock_time.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/d-ino.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/exitfail.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/getcwd-abort-bug.m4 \ + $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \ + $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/hash.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/inline.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/lchown.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mempcpy.m4 \ + $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mktime.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ + $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/paxutils.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \ + $(top_srcdir)/m4/rmt.m4 $(top_srcdir)/m4/rtapelib.m4 \ + $(top_srcdir)/m4/safe-read.m4 $(top_srcdir)/m4/safe-write.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sysexits.m4 \ + $(top_srcdir)/m4/system.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/ulonglong.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vsnprintf.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.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 \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_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 +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +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 +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_FLOAT_H = @ABSOLUTE_FLOAT_H@ +ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_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_SYSEXITS_H = @ABSOLUTE_SYSEXITS_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@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPIO_MT_PROG = @CPIO_MT_PROG@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_RMT_COMMAND = @DEFAULT_RMT_COMMAND@ +DEFAULT_RMT_DIR = @DEFAULT_RMT_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIRENT_H = @DIRENT_H@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXEEXT = @EXEEXT@ +FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_H = @GETOPT_H@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ +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_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_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYSEXITS_H = @HAVE_SYSEXITS_H@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE__BOOL = @HAVE__BOOL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTTYPES_H = @INTTYPES_H@ +LDFLAGS = @LDFLAGS@ +LIBCPIO_LIBDEPS = @LIBCPIO_LIBDEPS@ +LIBCPIO_LTLIBDEPS = @LIBCPIO_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_SETSOCKOPT = @LIB_SETSOCKOPT@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +PU_RMT_PROG = @PU_RMT_PROG@ +RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYSEXITS_H = @SYSEXITS_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@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I m4 +AUTOMAKE_OPTIONS = gnits 1.8 dist-bzip2 std-options +SUBDIRS = doc headers lib rmt src po tests +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnits '; \ + cd $(srcdir) && $(AUTOMAKE) --gnits \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +# 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; \ + (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; \ + (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); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (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; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + 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 || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(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 \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(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" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @case `sed 15q $(srcdir)/NEWS` in \ + *"$(VERSION)"*) : ;; \ + *) \ + echo "NEWS not updated; not releasing" 1>&2; \ + exit 1;; \ + esac + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + 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; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + 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; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -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) +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-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_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 + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + 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) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: 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-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.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-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr 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 + +# 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/NEWS b/NEWS new file mode 100644 index 0000000..857ae89 --- /dev/null +++ b/NEWS @@ -0,0 +1,155 @@ +GNU cpio NEWS -- history of user-visible changes. 2007-06-08 +Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +See the end of file for copying conditions. + +Please send cpio bug reports to . + +Version 2.8 - Sergey Poznyakoff, 2007-06-08 + +* Option --owner can be used in copy-out mode, allowing to uniformly override +ownership of the files being added to the archive. + +* Bugfixes: + +** Symlinks were handled incorrectly in copy-out mode. +** Fix handling of large files. +** Fix setting the file permissions in copy-out mode. +** Fix CAN-2005-1111 + + +Version 2.7 - Sergey Poznyakoff, 2006-10-21 + +* Improved error checking and diagnostics + +* Bugfixes +** Fixed CAN-1999-1572 +** Allow to use --sparse in both copy-in and copy-pass. +** Fix bug that eventually caused copying out the same hard-linked +file several times to archive. +** Fix several LFS-related issues. +** Fix Debian bug 335580. + + +Version 2.6 - Sergey Poznyakoff, 2004-12-20 + +* Added NLS support + +* Improved configure script + +* Improved invocation consistency checking and help output + +* Printing warning about truncation of inode numbers is suppressed by +default. See below. + +* New option --warning (-W) controls the level of output warnings: + + -Wnone Disables all warnings + -Wtruncate Enable warning about truncation of the inode number + -Wall Enables all warnings + + To disable a particular warning, prefix its name with 'no-', just + like in gcc. + +* New option --to-stdout extracts files to standard output. + +* The output of `cpio --help' is largely improved. + +* Bugfixes: +** If a file grew n bytes in copy-pass mode, these n bytes got prepended +to the contents of all subsequent files. +** Padding the archive with zero bytes upon truncation of the file being +archived was broken. + + +Major changes in version 2.5: + +* bug fixes from Debian, Red Hat, and SuSE GNU/Linux Distribution patches +* --rsh-command option + +Major changes in version 2.4: + +* new texinfo documentation +* --sparse option to write sparse files +* --only-verify-crc option to verify a CRC format archive +* --no-absolute-paths option to ignore absolute paths +* --quiet option to supress printing number of blocks copied +* handle disk input errors more gracefully + +Major changes in version 2.3: + +* in newc and crc format archives, only store 1 copy of multiply linked files +* handle multiply linked devices properly +* handle multiply linked files with cpio -pl even when the source and + destination are on different file systems +* support HPUX Context Dependent Files +* read and write HPUX cpio archives +* read System V.4 POSIX tar archives and HPUX POSIX tar archives +* use rmdir, instead of unlink, to delete existing directories + +Major changes in version 2.2: + +* handle link counts correctly when reading binary cpio archives +* configure checks for some libraries that SVR4 needs + +Major changes in version 2.1: + +* cpio can access remote non-device files as well as remote devices +* fix bugs in the MS-DOS port +* add --swap equivalent to -b option + +Version 2.0 adds the following features: + +Support for the SVR4 cpio formats, which can store inodes >65535, and +for traditional and POSIX tar archives. Also adds these options: + +-A --append append to instead of replacing the archive +-V --dot print a dot for each file processed +-H --format select archive format +-C --io-size select I/O block size in bytes +-M --message print a message at end of media volumes +--no-preserve-owner don't change files' owners when extracting +-R --owner set files' owners when extracting +-E --pattern-file list of shell filename patterns to process +-s --swap-bytes handle byte-order differences when extracting files +-S --swap-halfwords ditto +-b like -sS +-I input archive filename +-k recognize corrupted archives (we alawys do it, though) +-O output archive filename + +Some options of previous versions have been renamed in 2.0: + +--binary was replaced by --format=bin +--portability was replaced by --format=odc + +Some options have changed meaning in 2.0, for SVR4 compatibility: + +-O used to select the binary archive format, now selects the output file +-V used to print the version number, now prints a dot for each file + +Version 2.0 also fixes several bugs in the handling of files with +multiple links and of multi-volume archives on floppy disks. + +---------------------------------------------------------------------- +Copyright information: + +Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + + Permission is granted to anyone to make or distribute verbatim copies + of this document as received, in any medium, provided that the + copyright notice and this permission notice are preserved, + thus giving the recipient permission to redistribute in turn. + + Permission is granted to distribute modified versions + of this document, or of portions of it, + under the above conditions, provided also that they + carry prominent notices stating who last changed them. + +Local variables: +mode: outline +paragraph-separate: "[ ]*$" +eval: (add-hook 'write-file-hooks 'time-stamp) +time-stamp-start: "changes. " +time-stamp-format: "%:y-%02m-%02d" +time-stamp-end: "\n" +end: diff --git a/README b/README new file mode 100644 index 0000000..fafff13 --- /dev/null +++ b/README @@ -0,0 +1,71 @@ +This is GNU cpio, a program to manage archives of files. +As of version 2.0, it supports the features of the System V release 4 +cpio, including support for tar archives. + +This package also includes rmt, the remote tape server, and mt, a tape +drive control program; these two programs will only be compiled if +your system supports remote command execution, and tape drive control +operations, respectively. + +See the file INSTALL for compilation and installation instructions for Unix. + +For non-Unix systems [ Note: The non-Unix makefiles have not been tested + for this release ] + +makefile.pc is a makefile for Turbo C or C++ or Borland C++ on MS-DOS. + +makefile.os2 is a makefile for MS C and GNU C (emx/gcc) on OS/2. +cpio.def is a linker definition file for the MS C OS/2 version. + + +The main advantages of GNU cpio over Unix versions are: + +* It can access tape drives on other hosts using TCP/IP. + +* `-o' and `-p' can copy symbolic links either as symbolic links or, +with `-L', as the files they point to. + +* `-i' automatically recognizes the archive format and tries to +recover from corrupted archives. + +* The output of '-itv' looks like 'ls -l'. + +* It accepts long-named options as well as traditional +single-character options. + +A few features of other versions of cpio are missing from GNU cpio, including: + +* The `-6' option to support Sixth Edition Unix cpio archives with `-i'. + +* An option to limit volume size, like afio -s. + + +GNU cpio supports the POSIX.1 "ustar" tar format. GNU tar supports a +somewhat different, early draft of that format. That draft format has +a slightly different magic number in the tar header and doesn't +include the path prefix part of the header, which allows storing file +names that are longer than 100 characters. GNU cpio knows to +recognize the nonstandard GNU tar "ustar" archives. + +The following patch to GNU tar 1.11.1 makes GNU tar recognize standard +"ustar" archives, such as GNU cpio produces, except that it won't use +the path prefix. Without this patch, GNU tar thinks that standard +"ustar" archives are old-format tar archives and can not use the extra +information that "ustar" format contains. If you use this patch, +remember that you will lose the beginnings of paths that are longer +than 100 characters. That's why it's not an official part of GNU tar. +(Adding support for the path prefix to GNU tar is not trivial.) + +--- list.c.orig Mon Sep 14 17:04:03 1992 ++++ list.c Wed Oct 14 14:02:28 1992 +@@ -439,7 +439,7 @@ + st->st_ctime = from_oct(1+12, header->header.ctime); + } + +- if (0==strcmp(header->header.magic, TMAGIC)) { ++ if (0==strncmp(header->header.magic, TMAGIC, 5)) { + /* Unix Standard tar archive */ + *stdp = 1; + if (wantug) { + +Mail suggestions and bug reports for GNU cpio to bug-cpio@gnu.org. diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..393de05 --- /dev/null +++ b/THANKS @@ -0,0 +1,20 @@ +GNU cpio THANKS file + +GNU cpio has originally been written by Phil Nelson +and David MacKenzie . It was further modified +by John Oleynick and Sergey Poznyakoff +who currently maintains it. + +The following is a list of people who contributed to GNU cpio by +reporting problems, suggesting various improvements or submitting actual +code. Help us keep it complete and exempt of errors. + +Benigno B. Junior +Brian Mays +Dmitry V. Levin +Jim Castleberry +Holger Fleischmann +Matthew Braithwaite +Mike Frysinger +Mitsuru Chinen +Peter Vrabec diff --git a/TODO b/TODO new file mode 100644 index 0000000..ffd63d5 --- /dev/null +++ b/TODO @@ -0,0 +1,159 @@ +Following is the list of cpio-related reports to bug-gnu-utils. +Many of them appear to be fixed, but quite a number of them is +probably still waiting for being handled. The list is divided +into two parts, the messages are in somehow arbitrary order. + +* Bug reports +-------------- + +** cpio -d bug (fwd) (score: 47) + Author: Christian Smith + Date: Wed, 14 Nov 2001 02:06:46 +0000 (GMT) + This was bounced from bug-cpio@bogus.example.com I guess that + isn't set up yet. -- /"\ \ / ASCII RIBBON CAMPAIGN - AGAINST + HTML MAIL X - AGAINST MS ATTACHMENTS / \ $ cpio --version GNU + cpio version 2 + /archive/html/bug-gnu-utils/2001-11/msg00170.html (4,548 bytes) + +** bug in cpio with tapechange in copy-in-mode (score: 34) + Author: Bernd =?ISO-8859-1?Q?Sch=FCler?= + + Date: 05 Aug 2002 18:37:56 +0200 + Hello, last i made a restore from tape, and no request for next + tape happend, only an read-error occured. Here is an quick + patch, please verify the problem and the patch-code. I'm not + sure, if the pr + /archive/html/bug-gnu-utils/2002-08/msg00122.html (4,518 bytes) + +** Re: bug in cpio? (score: 40) + Author: kasal@matsrv.math.cas.cz (Stepan Kasal) + Date: Thu, 13 Jun 2002 07:44:14 +0000 (UTC) + Hallo, the following option should help: -d, --make-directories + Create leading directories where needed. Details: cpio won't + create the directory for the file. Observe: kasal$ echo + /home/kasal/tmp/db + /archive/html/bug-gnu-utils/2002-06/msg00306.html (4,862 bytes) + +** cpio 2.4.2 bug? (score: 40) + Author: "H.J. Thomassen" + Date: Thu, 10 Jan 2002 18:09:10 +0100 (CET) + Hello, We use GNU-cpio 2.4.2 and have the following problem: + Short: Assume I have a directory with two filenames, which are + hardlinks to the same i-node. I make a crc-cpio archive with + both files; th + /archive/html/bug-gnu-utils/2002-01/msg00161.html (5,624 bytes) + +** These two seem to be related: +*** cpio copy-in and multiply-linked files (score: 35) + Author: Chris Jaeger + Date: Tue, 07 Aug 2001 23:46:04 -0700 + Hi, I was wondering whether it was a bug or a feature that GNU + cpio, while in copy-in mode, will create a multiply-linked set + of files all of size 0 if the last linked file is not copied in + due to th + /archive/html/bug-gnu-utils/2001-08/msg00074.html (4,142 bytes) + +*** (no subject) (score: 2) + Author: brian@debian.org (Brian Mays) + Date: Sat, 07 Jul 2001 16:35:13 -0400 + When hard-linked files (along with many other files) are + archived to a cpio ustar format archive, the files are _not_ + all archived as hard links to each other in the archive. When + the same set of fil + /archive/html/bug-gnu-utils/2001-07/msg00080.html (5,666 bytes) + +** These too: + +*** Re: minor problems with slackware-current (score: 7) + Author: Cezary Sliwa + Date: Wed, 1 Aug 2001 10:43:37 +0200 + "cpio --sparse" corrupts data. A fix attached. C.S. Attachment: + cpio-2.4.2-sparse.diff Description: Text document + /archive/html/bug-gnu-utils/2001-08/msg00000.html (3,989 bytes) + +*** cpio --sparse (score: 34) + Author: Cezary Sliwa + Date: Mon, 26 Mar 2001 10:43:34 +0200 (CEST) + the '--sparse' option of gnu cpio causes data corruption + (blocks of zeros are lost or appended to other files). C.S. + /archive/html/bug-gnu-utils/2001-03/msg00235.html (3,671 bytes) + +** And these too +*** cpio-2.4.2: data corruption bug (score: 35) + Author: Todd Kelley + Date: Fri, 09 Feb 2001 17:00:06 -0500 + Hello, Recently at OEone we fixed a bug in GNU cpio-2.4.2: When + a file over about 0.5 megabyes grows while it is being + archived, it and all files following it in the archive are + corrupted. The crc do + /archive/html/bug-gnu-utils/2001-02/msg00062.html (4,297 bytes) + +*** cpio pass-through can corrupt files (score: 36) + Author: "Parrott, Jeff" + Date: Mon, 16 Oct 2000 13:32:57 -0400 + I have seen corrupted files as a result of using the + pass-through option in cpio. The corruption occurs when + active/in-use (and growing) files are being copied. The problem + is that the file size has + /archive/html/bug-gnu-utils/2000-10/msg00087.html (4,974 bytes) + +** cpio 2.4.2 unconditionally takes the tape drive offline (score: + 39) + Author: Scott Larson + Date: Thu, 11 Jan 2001 13:15:52 -0800 + We have been copying multiple volumes to a single tape with the + System 5 version of cpio. The gnu version of cpio doesn't + support this since it takes the tape offline (i.e. ejects the + tape) after rea + /archive/html/bug-gnu-utils/2001-01/msg00087.html (4,264 bytes) + +** cpio -t can see international filenames, find -ls also suffers + (score: 35) + Author: "Dan Jacobson" + Date: Tue, 26 Dec 2000 07:38:53 +0800 + GNU cpio version 2.4.2 with cpio -t I can see Chinese [big5] + filenames. with -tv, they become \267\247 etc Just like what + happens with find . -print vs. find . -ls -- + http://www.geocities.com/jidanni + /archive/html/bug-gnu-utils/2000-12/msg00143.html (4,084 bytes) + +* Suggestions +------------- + +** GNU cpio suggestion (score: 42) + Author: "H.J.Thomassen" + Date: Mon, 17 Dec 2001 11:27:11 +0100 + Re: suggestion for GNU-cpio extension (plus reference + implementation) We use cpio for our backup purposes. The backup + is started automatically in the middle of the night. To chase + away all users we d + /archive/html/bug-gnu-utils/2001-12/msg00244.html (7,474 bytes) + +** cpio suggestion + patch (score: 38) + Author: Taylor Gautier + Date: Fri, 20 Apr 2001 09:40:05 -0700 + I have a suggestion for cpio. The suggestion is to make it copy + files into a temporary name and then rename the file as the + last operation. Since UNIX filesystems are supposed to + gaurantee atomicity + /archive/html/bug-gnu-utils/2001-04/msg00169.html (10,674 + bytes) + +** [cpio] man page enhancement: a Example section ? (score: 5) + Author: Yannick Patois + Date: Wed, 24 Oct 2001 12:48:33 +0200 (CEST) + Hello, I seldom use cpio (as I think many people) and only had + to use it once or twice. IMHA, would be good to have a small + section with an example of most often performed actions + (creating an archiv + /archive/html/bug-gnu-utils/2001-10/msg00270.html (4,336 bytes) + +** Patch to cpio to enable verbose *skipping* of files (score: 40) + Author: Tomas Pospisek + Date: Mon, 8 Oct 2001 13:54:14 +0200 (CEST) + This patch enables cpio to be verbose about the files that it + does not copy, which is very handy for seeing cpio's progress + through a tape or simply for debuging. The patch along with a + Debian packag + /archive/html/bug-gnu-utils/2001-10/msg00083.html (4,548 bytes) + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..aa269d8 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,981 @@ +# generated automatically by aclocal 1.10a -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_if(m4_PACKAGE_VERSION, [2.60],, +[m4_fatal([this file was generated for autoconf 2.60. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + +# Copyright (C) 2002, 2003, 2005, 2006 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. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# 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.10a' +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.10a], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +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. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10a])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 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. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# 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 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# 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 + +# 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, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + 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 + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + 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} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 && + ${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 + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# 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 + +# _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 -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 +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 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 + +# 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. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# 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 +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +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_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +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([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 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. + +# AM_PROG_INSTALL_SH +# ------------------ +# 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"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 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 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 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 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +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 +# 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 +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# 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 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +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" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 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. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 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 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# 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 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# 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` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # 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". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 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. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# 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. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 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. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 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_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/absolute-header.m4]) +m4_include([m4/alloca.m4]) +m4_include([m4/allocsa.m4]) +m4_include([m4/argmatch.m4]) +m4_include([m4/argp.m4]) +m4_include([m4/bison.m4]) +m4_include([m4/canonicalize-lgpl.m4]) +m4_include([m4/chdir-long.m4]) +m4_include([m4/chown.m4]) +m4_include([m4/clock_time.m4]) +m4_include([m4/close-stream.m4]) +m4_include([m4/closeout.m4]) +m4_include([m4/d-ino.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/error.m4]) +m4_include([m4/exitfail.m4]) +m4_include([m4/extensions.m4]) +m4_include([m4/fchdir.m4]) +m4_include([m4/fcntl-safer.m4]) +m4_include([m4/fcntl_h.m4]) +m4_include([m4/fileblocks.m4]) +m4_include([m4/float_h.m4]) +m4_include([m4/fnmatch.m4]) +m4_include([m4/fpending.m4]) +m4_include([m4/getcwd-abort-bug.m4]) +m4_include([m4/getcwd-path-max.m4]) +m4_include([m4/getcwd.m4]) +m4_include([m4/getdate.m4]) +m4_include([m4/getopt.m4]) +m4_include([m4/gettext.m4]) +m4_include([m4/gettime.m4]) +m4_include([m4/gettimeofday.m4]) +m4_include([m4/gnulib-common.m4]) +m4_include([m4/gnulib-comp.m4]) +m4_include([m4/hash.m4]) +m4_include([m4/iconv.m4]) +m4_include([m4/inline.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/lchown.m4]) +m4_include([m4/lib-ld.m4]) +m4_include([m4/lib-link.m4]) +m4_include([m4/lib-prefix.m4]) +m4_include([m4/longlong.m4]) +m4_include([m4/lstat.m4]) +m4_include([m4/mbrtowc.m4]) +m4_include([m4/mbstate_t.m4]) +m4_include([m4/mempcpy.m4]) +m4_include([m4/memrchr.m4]) +m4_include([m4/mktime.m4]) +m4_include([m4/nls.m4]) +m4_include([m4/onceonly_2_57.m4]) +m4_include([m4/openat.m4]) +m4_include([m4/pathmax.m4]) +m4_include([m4/paxutils.m4]) +m4_include([m4/po.m4]) +m4_include([m4/progtest.m4]) +m4_include([m4/quote.m4]) +m4_include([m4/quotearg.m4]) +m4_include([m4/readlink.m4]) +m4_include([m4/rmt.m4]) +m4_include([m4/rtapelib.m4]) +m4_include([m4/safe-read.m4]) +m4_include([m4/safe-write.m4]) +m4_include([m4/save-cwd.m4]) +m4_include([m4/savedir.m4]) +m4_include([m4/setenv.m4]) +m4_include([m4/size_max.m4]) +m4_include([m4/sleep.m4]) +m4_include([m4/ssize_t.m4]) +m4_include([m4/stdarg.m4]) +m4_include([m4/stdbool.m4]) +m4_include([m4/stdint.m4]) +m4_include([m4/stdint_h.m4]) +m4_include([m4/stdio_h.m4]) +m4_include([m4/stdlib_h.m4]) +m4_include([m4/stpcpy.m4]) +m4_include([m4/strcase.m4]) +m4_include([m4/strchrnul.m4]) +m4_include([m4/strdup.m4]) +m4_include([m4/strerror.m4]) +m4_include([m4/string_h.m4]) +m4_include([m4/strndup.m4]) +m4_include([m4/strnlen.m4]) +m4_include([m4/strtol.m4]) +m4_include([m4/sys_stat_h.m4]) +m4_include([m4/sys_time_h.m4]) +m4_include([m4/sysexits.m4]) +m4_include([m4/system.m4]) +m4_include([m4/time_h.m4]) +m4_include([m4/time_r.m4]) +m4_include([m4/timespec.m4]) +m4_include([m4/tm_gmtoff.m4]) +m4_include([m4/ulonglong.m4]) +m4_include([m4/unistd-safer.m4]) +m4_include([m4/unistd_h.m4]) +m4_include([m4/unlocked-io.m4]) +m4_include([m4/utimbuf.m4]) +m4_include([m4/utimens.m4]) +m4_include([m4/utimes.m4]) +m4_include([m4/vasnprintf.m4]) +m4_include([m4/vsnprintf.m4]) +m4_include([m4/wchar.m4]) +m4_include([m4/wchar_t.m4]) +m4_include([m4/wctype.m4]) +m4_include([m4/wint_t.m4]) +m4_include([m4/xalloc.m4]) +m4_include([m4/xgetcwd.m4]) +m4_include([m4/xsize.m4]) +m4_include([m4/xstrndup.m4]) diff --git a/build-aux/config.guess b/build-aux/config.guess new file mode 100755 index 0000000..951383e --- /dev/null +++ b/build-aux/config.guess @@ -0,0 +1,1516 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2007-05-17' + +# This file is free software; you can redistribute 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 +# (at your option) any 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build-aux/config.rpath b/build-aux/config.rpath new file mode 100755 index 0000000..c492a93 --- /dev/null +++ b/build-aux/config.rpath @@ -0,0 +1,614 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2006 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# 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. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + darwin*) + case $cc_basename in + xlc*) + wl='-Wl,' + ;; + esac + ;; + mingw* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux*) + case $cc_basename in + icc* | ecc*) + wl='-Wl,' + ;; + pgcc | pgf77 | pgf90) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + sco3.2v5*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we cannot use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + interix3*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if test "$GCC" = yes ; then + : + else + case $cc_basename in + xlc*) + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +libname_spec='lib$name' +case "$host_os" in + aix3*) + ;; + aix4* | aix5*) + ;; + amigaos*) + ;; + beos*) + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + ;; + darwin* | rhapsody*) + shrext=.dylib + ;; + dgux*) + ;; + freebsd1*) + ;; + kfreebsd*-gnu) + ;; + freebsd* | dragonfly*) + ;; + gnu*) + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + ;; + interix3*) + ;; + irix5* | irix6* | nonstopux*) + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux*) + ;; + knetbsd*-gnu) + ;; + netbsd*) + ;; + newsos6) + ;; + nto-qnx*) + ;; + openbsd*) + ;; + os2*) + libname_spec='$name' + shrext=.dll + ;; + osf3* | osf4* | osf5*) + ;; + solaris*) + ;; + sunos4*) + ;; + sysv4 | sysv4.3*) + ;; + sysv4*MP*) + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + ;; + uts4*) + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build-aux/depcomp b/build-aux/depcomp new file mode 100755 index 0000000..e5f9736 --- /dev/null +++ b/build-aux/depcomp @@ -0,0 +1,589 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2007-03-29.01 + +# Copyright (C) 1999, 2000, 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) +# any 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/build-aux/install-sh b/build-aux/install-sh new file mode 100755 index 0000000..a5897de --- /dev/null +++ b/build-aux/install-sh @@ -0,0 +1,519 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-12-25.00 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/build-aux/mdate-sh b/build-aux/mdate-sh new file mode 100755 index 0000000..83d2700 --- /dev/null +++ b/build-aux/mdate-sh @@ -0,0 +1,205 @@ +#!/bin/sh +# Get modification time of a file or directory and pretty-print it. + +scriptversion=2007-03-30.02 + +# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software +# Foundation, Inc. +# written by Ulrich Drepper , June 1995 +# +# This program is free software; you can redistribute it and/or modify +# it under the 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No file. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: mdate-sh [--help] [--version] FILE + +Pretty-print the modification time of FILE. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "mdate-sh $scriptversion" + exit $? + ;; +esac + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +# GNU ls changes its time format in response to the TIME_STYLE +# variable. Since we cannot assume `unset' works, revert this +# variable to its documented default. +if test "${TIME_STYLE+set}" = set; then + TIME_STYLE=posix-long-iso + export TIME_STYLE +fi + +save_arg1=$1 + +# Find out how to get the extended ls output of a file or directory. +if ls -L /dev/null 1>/dev/null 2>&1; then + ls_command='ls -L -l -d' +else + ls_command='ls -l -d' +fi +# Avoid user/group names that might have spaces, when possible. +if ls -n /dev/null 1>/dev/null 2>&1; then + ls_command="$ls_command -n" +fi + +# A `ls -l' line looks as follows on OS/2. +# drwxrwx--- 0 Aug 11 2001 foo +# This differs from Unix, which adds ownership information. +# drwxrwx--- 2 root root 4096 Aug 11 2001 foo +# +# To find the date, we split the line on spaces and iterate on words +# until we find a month. This cannot work with files whose owner is a +# user named `Jan', or `Feb', etc. However, it's unlikely that `/' +# will be owned by a user whose name is a month. So we first look at +# the extended ls output of the root directory to decide how many +# words should be skipped to get the date. + +# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +set x`$ls_command /` + +# Find which argument is the month. +month= +command= +until test $month +do + shift + # Add another shift to the command. + command="$command shift;" + case $1 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; + esac +done + +# Get the extended ls output of the file or directory. +set dummy x`eval "$ls_command \"\$save_arg1\""` + +# Remove all preceding arguments +eval $command + +# Because of the dummy argument above, month is in $2. +# +# On a POSIX system, we should have +# +# $# = 5 +# $1 = file size +# $2 = month +# $3 = day +# $4 = year or time +# $5 = filename +# +# On Darwin 7.7.0 and 7.6.0, we have +# +# $# = 4 +# $1 = day +# $2 = month +# $3 = year or time +# $4 = filename + +# Get the month. +case $2 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; +esac + +case $3 in + ???*) day=$1;; + *) day=$3; shift;; +esac + +# Here we have to deal with the problem that the ls output gives either +# the time of day or the year. +case $3 in + *:*) set `date`; eval year=\$$# + case $2 in + Jan) nummonthtod=1;; + Feb) nummonthtod=2;; + Mar) nummonthtod=3;; + Apr) nummonthtod=4;; + May) nummonthtod=5;; + Jun) nummonthtod=6;; + Jul) nummonthtod=7;; + Aug) nummonthtod=8;; + Sep) nummonthtod=9;; + Oct) nummonthtod=10;; + Nov) nummonthtod=11;; + Dec) nummonthtod=12;; + esac + # For the first six month of the year the time notation can also + # be used for files modified in the last year. + if (expr $nummonth \> $nummonthtod) > /dev/null; + then + year=`expr $year - 1` + fi;; + *) year=$3;; +esac + +# The result. +echo $day $month $year + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/build-aux/missing b/build-aux/missing new file mode 100755 index 0000000..1c8ff70 --- /dev/null +++ b/build-aux/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/build-aux/mkinstalldirs b/build-aux/mkinstalldirs new file mode 100755 index 0000000..ef7e16f --- /dev/null +++ b/build-aux/mkinstalldirs @@ -0,0 +1,161 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2006-05-11.19 + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex new file mode 100644 index 0000000..0f3c750 --- /dev/null +++ b/build-aux/texinfo.tex @@ -0,0 +1,8641 @@ +% texinfo.tex -- TeX macros to handle Texinfo files. +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{2007-05-04.09} +% +% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007 Free Software Foundation, Inc. +% +% This texinfo.tex file is free software; you can redistribute it and/or +% modify it under the 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write +% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +% Boston, MA 02110-1301, USA. +% +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. (This has been our intent since Texinfo was invented.) +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or +% ftp://tug.org/tex/texinfo.tex +% (and all CTAN mirrors, see http://www.ctan.org). +% The texinfo.tex in any given distribution could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=\active \catcode`\_=\active} + + +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. +\let\ptexb=\b +\let\ptexbullet=\bullet +\let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv=\equiv +\let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ +\let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert +\let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent +\let\ptexplus=+ +\let\ptexrbrace=\} +\let\ptexslash=\/ +\let\ptexstar=\* +\let\ptext=\t + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi + +% Since the category of space is not known, we have to be careful. +\chardef\spacecat = 10 +\def\spaceisspace{\catcode`\ =\spacecat} + +% sometimes characters are active, so we need control sequences. +\chardef\colonChar = `\: +\chardef\commaChar = `\, +\chardef\dashChar = `\- +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\lquoteChar= `\` +\chardef\questChar = `\? +\chardef\rquoteChar= `\' +\chardef\semiChar = `\; +\chardef\underChar = `\_ + +% Ignore a token. +% +\def\gobble#1{} + +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\undefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 +}% + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + +% For @cropmarks command. +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in + +% Main output routine. +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingyyy.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 24pt + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \indexdummies + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1 \unvbox#1 +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\argtorun{#2}% + \begingroup + \obeylines + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. +} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + \argremovecomment #1\comment\ArgTerm% + }% +} + +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + +% Each occurence of `\^^M' or `\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., +% @end itemize @c foo +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm +} + +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \argtorun. +% (Similarily, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. +% +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as enviroments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At runtime, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp + \else + \badenverr + \fi +} + +% Evironment mismatch, #1 expected: +\def\badenverr{% + \errhelp = \EMsimple + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + out of any environment% + \else + in environment \expandafter\string#1% + \fi +} + +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv +% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi +} + +\newhelp\EMsimple{Press RETURN to continue.} + + +%% Simple single-character @ commands + +% @@ prints an @ +% Kludge this until the fonts are right (grr). +\def\@{{\tt\char64}} + +% This is turned off because it was never documented +% and you can use @w{...} around a quote to suppress ligatures. +%% Define @` and @' to be the same as ` and ' +%% but suppressing ligatures. +%\def\`{{`}} +%\def\'{{'}} + +% Used to generate quoted braces. +\def\mylbrace {{\tt\char123}} +\def\myrbrace {{\tt\char125}} +\let\{=\mylbrace +\let\}=\myrbrace +\begingroup + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux/toc files. + \catcode`\{ = \other \catcode`\} = \other + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma = , + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. +\let\, = \c +\let\dotaccent = \. +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \t +\let\ubaraccent = \b +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ptexi + \else\ifx\temp\jmacro \j + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% + \kern-.15em + \TeX +} + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\hfil\break\hbox{}\ignorespaces} + +% @/ allows a line break. +\let\/=\allowbreak + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=\endofsentencespacefactor\space} + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=\endofsentencespacefactor\space} + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=\endofsentencespacefactor\space} + +% @frenchspacing on|off says whether to put extra space after punctuation. +% +\def\onword{on} +\def\offword{off} +% +\parseargdef\frenchspacing{% + \def\temp{#1}% + \ifx\temp\onword \plainfrenchspacing + \else\ifx\temp\offword \plainnonfrenchspacing + \else + \errhelp = \EMsimple + \errmessage{Unknown @frenchspacing option `\temp', must be on/off}% + \fi\fi +} + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + \startsavinginserts + % + \setbox\groupbox = \vtop\bgroup + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +% Old definition--didn't work. +%\parseargdef\need{\par % +%% This method tries to make TeX break the page naturally +%% if the depth of the box does not fit. +%{\baselineskip=0pt% +%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak +%\prevdepth=-1000pt +%}} + +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break (and is undocumented). + +\let\br = \par + +% @page forces the start of a new page. +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} + +% This defn is used inside nofill environments such as @example. +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. +% +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @include file insert text of that file as input. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable + \def\temp{\input #1 }% + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} + +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\next\centerH + \else + \let\next\centerV + \fi + \next{\hfil \ignorespaces#1\unskip \hfil}% +} +\def\centerH#1{% + {% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break + }% +} +\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} + +% @sp n outputs n lines of vertical space + +\parseargdef\sp{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment + +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} + +\let\c=\comment + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\parseargdef\paragraphindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent = 0pt + \else + \defaultparindent = #1em + \fi + \fi + \parindent = \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\parseargdef\exampleindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} + + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode`\_ = \active + \gdef\mathunderscore{% + \catcode`\_=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a \ character. +% FYI, plain.tex uses \\ as a temporary control sequence (why?), but +% this is not advertised and we don't care. Texinfo does not +% otherwise define @\. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + } +} + +% @bullet and @minus need the same treatment as @math, just above. +\def\bullet{$\ptexbullet$} +\def\minus{$-$} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. +% +\def\dots{% + \leavevmode + \setbox0=\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 = \wd0 + \else + \dimen0 = 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=\endofsentencespacefactor +} + +% @comma{} is so commas can be inserted into text without messing up +% Texinfo's parsing. +% +\let\comma = , + +% @refill is a no-op. +\let\refill=\relax + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi % \openindices needs to do some work in any case. + \openindices + \let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + \openin 1 texinfo.cnf + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as \undefined, +% borrowed from ifpdf.sty. +\ifx\pdfoutput\undefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +% PDF uses PostScript string constants for the names of xref targets, +% for display in the outlines, and in other places. Thus, we have to +% double any backslashes. Otherwise, a name like "\node" will be +% interpreted as a newline (\n), followed by o, d, e. Not good. +% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html +% (and related messages, the final outcome is that it is up to the TeX +% user to double the backslashes and otherwise make the string valid, so +% that's what we do). + +% double active backslashes. +% +{\catcode`\@=0 \catcode`\\=\active + @gdef@activebackslashdouble{% + @catcode`@\=@active + @let\=@doublebackslash} +} + +% To handle parens, we must adopt a different approach, since parens are +% not active characters. hyperref.dtx (which has the same problem as +% us) handles it with this amazing macro to replace tokens, with minor +% changes for Texinfo. It is included here under the GPL by permission +% from the author, Heiko Oberdiek. +% +% #1 is the tokens to replace. +% #2 is the replacement. +% #3 is the control sequence with the string. +% +\def\HyPsdSubst#1#2#3{% + \def\HyPsdReplace##1#1##2\END{% + ##1% + \ifx\\##2\\% + \else + #2% + \HyReturnAfterFi{% + \HyPsdReplace##2\END + }% + \fi + }% + \xdef#3{\expandafter\HyPsdReplace#3#1\END}% +} +\long\def\HyReturnAfterFi#1\fi{\fi#1} + +% #1 is a control sequence in which to do the replacements. +\def\backslashparens#1{% + \xdef#1{#1}% redefine it as its expansion; the definition is simply + % \lastnode when called from \setref -> \pdfmkdest. + \HyPsdSubst{(}{\realbackslash(}{#1}% + \HyPsdSubst{)}{\realbackslash)}{#1}% +} + +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + +\ifpdf + \input pdfcolor + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\dopdfimage#1#2#3{% + \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .png, .jpg, .pdf (among + % others). Let's try in that order. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \openin 1 #1.pdf \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{pdf}% + \fi + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \closein 1 + \endgroup + % + % without \immediate, pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage + \fi + \ifdim \wd0 >0pt width \imagewidth \fi + \ifdim \wd2 >0pt height \imageheight \fi + \ifnum\pdftexversion<13 + #1.\pdfimgext + \else + {#1.\pdfimgext}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + % + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \turnoffactive + \activebackslashdouble + \makevalueexpandable + \def\pdfdestname{#1}% + \backslashparens\pdfdestname + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + }} + % + % used to mark target names; must be expandable. + \def\pdfmkpgn#1{#1} + % + % by default, use a color that is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. + % (Defined in pdfcolor.tex.) + \let\urlcolor = \BrickRed + \let\linkcolor = \BrickRed + \def\endlink{\Black\pdfendlink} + % + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=\expnumber{#1}\relax + \advance\tempnum by 1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + % + % #1 is the section text, which is what will be displayed in the + % outline by the pdf viewer. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node text, + % which might be empty if this toc entry had no corresponding node. + % #4 is the page number + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worth the trouble, since most documents are normally structured. + \def\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty + \def\pdfoutlinedest{#4}% + \else + % Doubled backslashes in the name. + {\activebackslashdouble \xdef\pdfoutlinedest{#3}% + \backslashparens\pdfoutlinedest}% + \fi + % + % Also double the backslashes in the display string. + {\activebackslashdouble \xdef\pdfoutlinetext{#1}% + \backslashparens\pdfoutlinetext}% + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Thanh's hack / proper braces in bookmarks + \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace + \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace + % + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \readdatafile{toc}% + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % xx to do this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Right + % now, I guess we'll just let the pdf reader have its way. + \indexnofonts + \setupdatafile + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \ifx\p\space\else\addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \fi + \nextsp} + \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + \leavevmode\urlcolor + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \linkcolor #1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\else + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\linkcolor = \relax + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput + + +\message{fonts,} + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + +% Default leading. +\newdimen\textleading \textleading = 13.2pt + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +\def\setleading#1{% + \normalbaselineskip = #1\relax + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% +% PDF CMaps. See also LaTeX's t1.cmap. +% +% \cmapOT1 +\ifpdf + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\else + \expandafter\let\csname cmapOT1\endcsname\gobble + \expandafter\let\csname cmapOT1IT\endcsname\gobble + \expandafter\let\csname cmapOT1TT\endcsname\gobble +\fi + + +% Set the font macro #1 to the font named #2, adding on the +% specified font prefix (normally `cm'). +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass +% empty to omit). +\def\setfont#1#2#3#4#5{% + \font#1=\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble + + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\undefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} %where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +% Definitions for a main text size of 11pt. This is the default in +% Texinfo. +% +\def\definetextfontsizexi{% +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\authorrm{\secrm} +\def\authortt{\sectt} + +% Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 + +% Section fonts (14.4pt). +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2}{OT1} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 + +% Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1315}{OT1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 + +% reset the current fonts +\textfonts +\rm +} % end of 11pt text font size definitions + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\authorrm{\secrm} +\def\authortt{\sectt} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=cmmi12 scaled \magstep1 +\font\chapsy=cmsy10 scaled \magstep2 + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=cmmi12 +\font\secsy=cmsy10 scaled \magstep1 + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=cmmi10 +\font\ssecsy=cmsy10 + +% Reduced fonts for @acro in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=cmmi9 +\font\reducedsy=cmsy9 + +% reduce space between paragraphs +\divide\parskip by 2 + +% reset the current fonts +\textfonts +\rm +} % end of 10pt text font size definitions + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xword{10} +\def\xiword{11} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + \wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} + \fi\fi + \endgroup +} + + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts except +% in the main text, we don't bother to reset \scriptfont and +% \scriptscriptfont (which would also require loading a lot more fonts). +% +\def\resetmathfonts{% + \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy + \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf + \textfont\ttfam=\tentt \textfont\sffam=\tensf +} + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% + \resetmathfonts \setleading{25pt}} +\def\titlefont#1{{\titlefonts\rm #1}} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% + \resetmathfonts \setleading{16pt}} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl + \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc + \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy + \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% +% I wish the USA used A4 paper. +% --karl, 24jan03. + + +% Set up the default fonts, so we can use them for creating boxes. +% +\definetextfontsizexi + +% Define these so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + +%% Add scribe-like font environments, plus @l for inline lisp (usually sans +%% serif) and @ii for TeX italic + +% \smartitalic{ARG} outputs arg in italics, followed by an italic correction +% unless the following character is such as not to need one. +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else + \ptexslash\fi\fi\fi} +\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally uses \ttsl. +% @var is set to this for defun arguments. +\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitalicx} + +\let\i=\smartitalic +\let\slanted=\smartslanted +\let\var=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic + +% @b, explicit bold. +\def\b#1{{\bf #1}} +\let\strong=\b + +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\plainfrenchspacing{% + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \def\endofsentencespacefactor{1000}% for @. and friends + } + \def\plainnonfrenchspacing{% + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends + } +\catcode`@=\other +\def\endofsentencespacefactor{3000}% default + +\def\t#1{% + {\tt \rawbackslash \plainfrenchspacing #1}% + \null +} +\def\samp#1{`\tclose{#1}'\null} +\setfont\keyrm\rmshape{8}{1000}{OT1} +\font\keysy=cmsy9 +\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% + \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% + \vbox{\hrule\kern-0.4pt + \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% + \kern-0.4pt\hrule}% + \kern-.06em\raise0.4pt\hbox{\angleright}}}} +\def\key #1{{\nohyphenation \uppercase{#1}}\null} +% The old definition, with no lozenge: +%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @file, @option are the same as @samp. +\let\file=\samp +\let\option=\samp + +% @code is a modification of @t, +% which makes spaces the same size as normal in the surrounding text. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \plainfrenchspacing + #1% + }% + \null +} + +% We *must* turn on hyphenation at `-' and `_' in @code. +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. + +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. +% -- rms. +{ + \catcode`\-=\active \catcode`\_=\active + \catcode`\'=\active \catcode`\`=\active + % + \global\def\code{\begingroup + \catcode\rquoteChar=\active \catcode\lquoteChar=\active + \let'\codequoteright \let`\codequoteleft + % + \catcode\dashChar=\active \catcode\underChar=\active + \ifallowcodebreaks + \let-\codedash + \let_\codeunder + \else + \let-\realdash + \let_\realunder + \fi + \codex + } +} + +\def\realdash{-} +\def\codedash{-\discretionary{}{}{}} +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} +\def\codex #1{\tclose{#1}\endgroup} + +% An additional complication: the above will allow breaks after, e.g., +% each of the four underscores in __typeof__. This is undesirable in +% some manuals, especially if they don't have long identifiers in +% general. @allowcodebreaks provides a way to control this. +% +\newif\ifallowcodebreaks \allowcodebreakstrue + +\def\keywordtrue{true} +\def\keywordfalse{false} + +\parseargdef\allowcodebreaks{% + \def\txiarg{#1}% + \ifx\txiarg\keywordtrue + \allowcodebreakstrue + \else\ifx\txiarg\keywordfalse + \allowcodebreaksfalse + \else + \errhelp = \EMsimple + \errmessage{Unknown @allowcodebreaks option `\txiarg'}% + \fi\fi +} + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\parseargdef\kbdinputstyle{% + \def\txiarg{#1}% + \ifx\txiarg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\txiarg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\txiarg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle option `\txiarg'}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is `distinct.' +\kbdinputstyle distinct + +\def\xkey{\key} +\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% +\ifx\one\xkey\ifx\threex\three \key{#2}% +\else{\tclose{\kbdfont\look}}\fi +\else{\tclose{\kbdfont\look}}\fi} + +% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. +\let\indicateurl=\code +\let\env=\code +\let\command=\code + +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. Perhaps eventually put in +% a hypertex \special here. +% +\def\uref#1{\douref #1,,,\finish} +\def\douref#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=\uref +\fi + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} + +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\plainfrenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% +\def\pounds{{\it\$}} + +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\undefined +\def\Orb{\mathhexbox20D} +\fi + + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + +\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \let\page = \oldpage + \page + \null + }% +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +%%% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines + \let\tt=\authortt} + +\parseargdef\title{% + \checkenv\titlepage + \leftline{\titlefonts\rm #1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\authorfont \leftline{#1}}% + \fi +} + + +%%% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make TeX use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + + +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt +} + +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\HEADINGSoff{% +\global\evenheadline={\hfil} \global\evenfootline={\hfil} +\global\oddheadline={\hfil} \global\oddfootline={\hfil}} +\HEADINGSoff +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} +\let\contentsalignmacro = \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\undefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg{\gdef\thistitle}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemindicate{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} + +% @table, @ftable, @vtable. +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\envdef\itemize{\parsearg\doitemize} + +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + \def\itemcontents{#1}% + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + \let\item=\itemizeitem +} + +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a . + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call \doitemize, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \doitemize{#1.}\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go = \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go = \setuptable + \fi% + \fi + \go +} + +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. Note that \everycr resets \everytab. +\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we encounter the problem it was intended to solve again. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + +% @multitable ... @end multitable definitions: +% +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% + \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +\fi +%% Test to see if parskip is larger than space between lines of +%% table. If not, do nothing. +%% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi} + + +\message{conditionals,} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} + +% Ignore text until a line `@end #1', keeping track of nested conditionals. +% +% A count to remember the depth of nesting. +\newcount\doignorecount + +\def\doignore#1{\begingroup + % Scan in ``verbatim'' mode: + \obeylines + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \spaceisspace + % + % Count number of #1's that we've seen. + \doignorecount = 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. + % + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% + % + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} + + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. +% +\parseargdef\set{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% +} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} + +% @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\- = \active \catcode`\_ = \active + % + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\realdash \let_\normalunderscore + } +} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next +} +\def\ifsetfail{\doignore{ifset}} + +% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment + +% @defininfoenclose. +\let\definfoenclose=\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo == \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \undefined + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname\donesynindex#2\endcsname = 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% +\def\indexdummies{% + \escapechar = `\\ % use backslash in output files. + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % + % Need these in case \tex is in effect and \{ is a \delimiter again. + % But can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. + \let\{ = \mylbrace + \let\} = \myrbrace + % + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. + % + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest + % + % The above is not enough to reproduce the bug, but it gives the flavor. + % + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput = \empty + % + % Do the redefinitions. + \commondummies +} + +% For the aux and toc files, @ is the escape character. So we want to +% redefine everything using @ as the escape character (instead of +% \realbackslash, still used for index files). When everything uses @, +% this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % Do the redefinitions. + \commondummies + \otherbackslash +} + +% Called from \indexdummies and \atdummies. +% +\def\commondummies{% + % + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control% words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter + % + \commondummiesnofonts + % + \definedummyletter\_% + % + % Non-English letters. + \definedummyword\AA + \definedummyword\AE + \definedummyword\L + \definedummyword\OE + \definedummyword\O + \definedummyword\aa + \definedummyword\ae + \definedummyword\l + \definedummyword\oe + \definedummyword\o + \definedummyword\ss + \definedummyword\exclamdown + \definedummyword\questiondown + \definedummyword\ordf + \definedummyword\ordm + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt + % + \definedummyword\LaTeX + \definedummyword\TeX + % + % Assorted special characters. + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\expansion + \definedummyword\minus + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\result + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + % + \normalturnoffactive + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable +} + +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless + % + % Texinfo font commands. + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sc + \definedummyword\t + % + % Commands that take arguments. + \definedummyword\acronym + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref +} + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% +\def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\definedummyletter##1{\let##1\empty}% + % Hopefully, all control words can become @asis. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + % how to handle braces? + \def\_{\normalunderscore}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\aa{aa}% + \def\ae{ae}% + \def\l{l}% + \def\oe{oe}% + \def\o{o}% + \def\ss{ss}% + \def\exclamdown{!}% + \def\questiondown{?}% + \def\ordf{a}% + \def\ordm{o}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\registeredsymbol{R}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\expansion{==>}% + \def\minus{-}% + \def\pounds{pounds}% + \def\point{.}% + \def\print{-|}% + \def\result{=>}% + \def\textdegree{degrees}% + % + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. + % makeinfo does not expand macros in the argument to @deffn, which ends up + % writing an index entry, and texindex isn't prepared for an index sort entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine them + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist +} + +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% Most index entries go through here, but \dosubind is the general case. +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \safewhatsit\dosubindwrite + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% + \fi + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} + +% Take care of unwanted page breaks/skips around a whatsit: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +\newskip\whatsitskip +\newcount\whatsitpenalty +% +% ..., ready, GO: +% +\def\safewhatsit#1{% +\ifhmode + #1% +\else + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \whatsitskip = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \whatsitpenalty = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\skip0 glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\whatsitskip + \fi + % + #1% + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\whatsitskip + \fi +\fi +} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\parseargdef\printindex{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \plainfrenchspacing + \everypar = {}% don't want the \kern\-parindent from indentation suppression. + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\backslashcurfont}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip +}} + +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this frozes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \setbox\boxA = \hbox{#1}% + \ifdim\wd\boxA = 0pt + \ % + \else + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi + \fi + \par + \endgroup +} + +% Like plain.tex's \dotfill, except uses up at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 + +\newbox\partialpage +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % Grab any single-column material above us. + \output = {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + }% + \eject % run that output routine to set \partialpage + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize = 2\vsize +} + +% The double-column output routine for all double-column pages except +% the last. +% +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% +} +% +% All done with double columns. +\def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % + \output = {% + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal = \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + % + \pagesofar +} +\catcode`\@ = \other + + +\message{sectioning,} +% Chapters, sections, etc. + +% \unnumberedno is an oxymoron, of course. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount\appendixno \appendixno = `\@ +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines this as the name of the chapter. +% page headings and footings can use it. @section does likewise. +% However, they are not reliable, because we don't use marks. +\def\thischapter{} +\def\thissection{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achive this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unmlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 + \else + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi + \fi + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unmlevel + \chardef\unmlevel = \absseclevel + \fi + \else + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unmlevel + \def\headtype{U}% + \else + \chardef\unmlevel = 3 + \fi + \fi + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi + \else + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi + \fi + \suppressfirstparagraphindent +} + +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + \message{\putwordChapter\space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + \def\appendixnum{\putwordAppendix\space \appendixletter}% + \message{\appendixnum}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the to achieve this: TeX expands \the only once, + % simply yielding the contents of . (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + +% Sections. +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% +} + +% Subsections. +\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% +} + +% Subsubsections. +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +% NOTE on use of \vbox for chapter headings, section headings, and such: +% 1) We use \vbox rather than the earlier \line to permit +% overlong headings to fold. +% 2) \hyphenpenalty is set to 10000 because hyphenation in a +% heading is obnoxious; this forbids it. +% 3) Likewise, headings look best if no \parindent is used, and +% if justification is not attempted. Hence \raggedright. + + +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} + +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}% + \bigskip \par\penalty 200\relax + \suppressfirstparagraphindent +} + +% @heading, @subheading, @subsubheading. +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +%%% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +%%% Define plain chapter starts, and page on/off switching for it +% Parameter controlling skip before chapter headings (if needed) + +\newskip\chapheadingskip + +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{% +\global\let\contentsalignmacro = \chapoddpage +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% + \pchapsepmacro + {% + \chapfonts \rm + % + % Have to define \thissection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\thissection{#1}% + \gdef\thischaptername{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \gdef\thischapternum{}% + \gdef\thischapter{#1}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \gdef\thischapternum{}% + \gdef\thischapter{}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + \xdef\thischapternum{\appendixletter}% + % We don't substitute the actual chapter name into \thischapter + % because we don't want its macros evaluated now. And we don't + % use \thissection because that changes with each section. + % + \xdef\thischapter{\putwordAppendix{} \appendixletter: + \noexpand\thischaptername}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \xdef\thischapternum{\the\chapno}% + \xdef\thischapter{\putwordChapter{} \the\chapno: + \noexpand\thischaptername}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent=\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} + + +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% +\def\unnchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\nobreak +} +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} +\def\centerchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt + \hfill {\rm #1}\hfill}}\bigskip \par\nobreak +} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} + + +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} + +% Subsection titles. +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} + +% Subsubsection titles. +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} + + +% Print any size, any type, section title. +% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\sectionheading#1#2#3#4{% + {% + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rm + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Only insert the space after the number if we have a section number. + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\thissection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \thissection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\thissection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\thissection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chapmacro. + \donoderef{#3}% + % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % + % Output the actual section heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% + }% + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) + \vskip-\parskip + % + % This is purely so the last item on the list is a known \penalty > + % 10000. This is so \startdefun can avoid allowing breakpoints after + % section headings. Otherwise, it would insert a valid breakpoint between: + % + % @section sec-whatever + % @deffn def-whatever + \penalty 10001 +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. +% +\newif\iftocfileopened +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + {\atdummies + \edef\temp{% + \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% + \temp + }% + \fi + \fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi +} + + +% These characters do not print properly in the Computer Modern roman +% fonts, so we must take special care. This is more or less redundant +% with the Texinfo input format setup at the end of this file. +% +\def\activecatcodes{% + \catcode`\"=\active + \catcode`\$=\active + \catcode`\<=\active + \catcode`\>=\active + \catcode`\\=\active + \catcode`\^=\active + \catcode`\_=\active + \catcode`\|=\active + \catcode`\~=\active +} + + +% Read the toc file, which is essentially Texinfo input. +\def\readtocfile{% + \setupdatafile + \activecatcodes + \input \tocreadfilename +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Prepare to read what we've written to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \def\thischapter{}% + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi +} + +% redefined for the two-volume lispref. We always output on +% \jobname.toc even if this is redefined. +% +\def\tocreadfilename{\jobname.toc} + +% Normal (long) toc. +% +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} +\let\shortcontents = \summarycontents + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% +} + +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} + +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} + +% Sections. +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} + +% Subsections. +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} + +% This parameter controls the indentation of the various levels. +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} + + +\message{environments,} +% @foo ... @end foo. + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, it should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} +% +\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @tex ... @end tex escapes into raw Tex temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain tex @ character. + +\envdef\tex{% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie + \catcode `\%=14 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other + \escapechar=`\\ + % + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\/=\ptexslash + \let\*=\ptexstar + \let\t=\ptext + \let\frenchspacing=\plainfrenchspacing + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +} +% There is no need to define \Etex. + +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip. +% +\def\aboveenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will +% also clear it, so that its embedded environments do the narrowing again. +\let\nonarrowing=\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing = t% + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of \def\group. +} +\def\Ecartouche{% + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\def\nonfillstart{% + \aboveenvbreak + \hfuzz = 12pt % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + \parindent = 0pt + \emergencystretch = 0pt % don't try to avoid overfull boxes + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \else + \let\nonarrowing = \relax + \fi + \let\exdent=\nofillexdent +} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} + +% We often define two environments, @foo and @smallfoo. +% Let's do it by one command: +\def\makedispenv #1#2{ + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} + +% Define two synonyms: +\def\maketwodispenvs #1#2#3{ + \makedispenv{#1}{#3} + \makedispenv{#2}{#3} +} + +% @lisp: indented, narrowed, typewriter font; @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvs {lisp}{example}{% + \nonfillstart + \tt\quoteexpand + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} +% @display/@smalldisplay: same as @lisp except keep current font. +% +\makedispenv {display}{% + \nonfillstart + \gobble +} + +% @format/@smallformat: same as @display except don't narrow margins. +% +\makedispenv{format}{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} + +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak + +% @flushright. +% +\envdef\flushright{% + \let\nonarrowing = t% + \nonfillstart + \advance\leftskip by 0pt plus 1fill + \gobble +} +\let\Eflushright = \afterenvbreak + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. +% +\envdef\quotation{% + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \advance\rightskip by \lispnarrowing + \exdentamount = \lispnarrowing + \else + \let\nonarrowing = \relax + \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\undefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + + +% LaTeX-like @verbatim...@end verbatim and @verb{...} +% If we want to allow any as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=\other}\dospecials} +% +% [Knuth] pp. 380,381,391 +% Disable Spanish ligatures ?` and !` of \tt font +\begingroup + \catcode`\`=\active\gdef`{\relax\lq} +\endgroup +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \catcode`\`=\active + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +\def\starttabbox{\setbox0=\hbox\bgroup} + +% Allow an option to not replace quotes with a regular directed right +% quote/apostrophe (char 0x27), but instead use the undirected quote +% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it +% the default, but it works for pasting with more pdf viewers (at least +% evince), the lilypond developers report. xpdf does work with the +% regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else + \char'15 + \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + `% + \else + \char'22 + \fi +} +% +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen0=\wd0 % the width so far, or since the previous tab + \divide\dimen0 by\tabw + \multiply\dimen0 by\tabw % compute previous multiple of \tabw + \advance\dimen0 by\tabw % advance to next multiple of \tabw + \wd0=\dimen0 \box0 \starttabbox + }% + } + \catcode`\'=\active + \gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}% + % + \catcode`\`=\active + \gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}% + % + \gdef\quoteexpand{\rquoteexpand \lquoteexpand}% +\endgroup + +% start the verbatim environment. +\def\setupverbatim{% + \let\nonarrowing = t% + \nonfillstart + % Easiest (and conventionally used) font for verbatim + \tt + \def\par{\leavevmode\egroup\box0\endgraf}% + \catcode`\`=\active + \tabexpand + \quoteexpand + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'#1'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim = \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup +} + + +\message{defuns,} +% @defun etc. + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deflastargmargin \deflastargmargin=18pt +\newcount\defunpenalty + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \defunpenalty=10003 % Will keep this @deffn together with the + % following @def command, see below. + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \printdefunline, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + % As a minor refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil + \endgraf + \nobreak\vskip -\parskip + \penalty\defunpenalty % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remainnig is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +%%% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +%%% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +%%% Type: +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % How we'll format the type name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % (plain.tex says that \dimen1 should be used only as global.) + \parshape 2 0in \dimen0 \defargsindent \dimen2 + % + % Put the type name to the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% return value type + \ifx\temp\empty\else \tclose{\temp} \fi + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. Let's try @var for that. + \let\var=\ttslanted + #1% + \sl\hyphenchar\font=45 +} + +% We want ()&[] to print specially on the defun line. +% +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active +} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} + +\newcount\parencount + +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 +} + +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} + +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +\def\badparencount{% + \errmessage{Unbalanced parentheses in @def}% + \global\parencount=0 +} +\def\badbrackcount{% + \errmessage{Unbalanced square braces in @def}% + \global\brackcount=0 +} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\undefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +\def\scanmacro#1{% + \begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % ... and \example + \spaceisspace + % + % Append \endinput to make sure that TeX does not see the ending newline. + % I've verified that it is necessary both for e-TeX and for ordinary TeX + % --kasal, 29nov03 + \scantokens{#1\endinput}% + \endgroup +} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% List of all defined macros in the form +% \definedummyword\macro1\definedummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 = \expandafter{\macrolist\definedummyword#1}% + \xdef\macrolist{\the\toks0}% +} + +% Utility routines. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% +\def\cslet#1#2{% + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=\other \catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \. + +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. + +\def\scanctxt{% + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\~=\other +} + +\def\scanargctxt{% + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% + \scanctxt + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} + +\def\macroargctxt{% + \scanctxt + \catcode`\\=\other +} + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. + +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0% + \else + \expandafter\parsemargdef \argl;% + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{Macro name \the\macname\space already defined}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% + \addtomacrolist{\the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\parseargdef\unmacro{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=0% + % Remove the macro name from \macrolist: + \begingroup + \expandafter\let\csname#1\endcsname \relax + \let\definedummyword\unmacrodo + \xdef\macrolist{\macrolist}% + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx #1\relax + % remove this + \else + \noexpand\definedummyword \noexpand#1% + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname #1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.blah for each blah +% in the params list, to be ##N where N is the position in that list. +% That gets used by \mbodybackslash (above). + +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. + +\def\parsemargdef#1;{\paramno=0\def\paramlist{}% + \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1% + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) + +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% + +% This defines the macro itself. There are six cases: recursive and +% nonrecursive macros of zero, one, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \fi + \fi} + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg) +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \macnamexxx} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Just make them active and then expand them all to nothing. +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \addtomacrolist{#1}% + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} + + +\message{cross references,} + +\newwrite\auxfile +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + +\let\nwnode=\node +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty + \fi +} + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \thissection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\thissection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout + }% + \fi +} + +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + \def\printedmanual{\ignorespaces #5}% + \def\printedrefname{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual\unskip}% + \setbox0=\hbox{\printedrefname\unskip}% + \ifdim \wd0 = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax + % Use the node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Use the actual chapter/section title appear inside + % the square brackets. Use the real section title if we have it. + \ifdim \wd1 > 0pt + % It is in another manual, so we don't have it. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % Make link in pdf output. + \ifpdf + \leavevmode + \getfilename{#4}% + {\indexnofonts + \turnoffactive + % See comments at \activebackslashdouble. + {\activebackslashdouble \xdef\pdfxrefdest{#1}% + \backslashparens\pdfxrefdest}% + % + \ifnum\filenamelength>0 + \startlink attr{/Border [0 0 0]}% + goto file{\the\filename.pdf} name{\pdfxrefdest}% + \else + \startlink attr{/Border [0 0 0]}% + goto name{\pdfmkpgn{\pdfxrefdest}}% + \fi + }% + \linkcolor + \fi + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd0 = 0pt + \refx{#1-snt}{}% + \else + \printedrefname + \fi + % + % if the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd1 > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via a macro so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi + \fi + \endlink +\endgroup} + +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. +% +\def\refx#1#2{% + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \thisrefX + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. +% +\def\xrdef#1#2{% + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% + \fi +} + +% Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readdatafile{aux}% + \global\havexrefstrue + \fi + \closein 1 +} + +\def\setupdatafile{% + \catcode`\^^@=\other + \catcode`\^^A=\other + \catcode`\^^B=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\^^K=\other + \catcode`\^^L=\other + \catcode`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + \catcode`\%=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. + {% + \count1=128 + \def\loop{% + \catcode\count1=\other + \advance\count1 by 1 + \ifnum \count1<256 \loop \fi + }% + }% + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\@=0 +} + +\def\readdatafile#1{% +\begingroup + \setupdatafile + \input\jobname.#1 +\endgroup} + + +\message{insertions,} +% including footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for info output only. +\let\footnotestyle=\comment + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \dofootnote +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\gdef\dofootnote{% + \insert\footins\bgroup + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \hsize=\pagewidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent = \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar = {\hang}% + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + \futurelet\next\fo@t +} +}%end \catcode `\@=11 + +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarily, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi +} + +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. +% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +\closein 1 +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\undefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing this stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M = 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \nobreak\bigskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \line\bgroup + \fi + % + % Output the image. + \ifpdf + \dopdfimage{#1}{#2}{#3}% + \else + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \fi + % + \ifimagevmode \egroup \bigbreak \fi % space after the image +\endgroup} + + +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \thissection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\thissection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies + % + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \thissection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + + +\message{localization,} + +% @documentlanguage is usually given very early, just after +% @setfilename. If done too late, it may not override everything +% properly. Single argument is the language abbreviation. +% It would be nice if we could set up a hyphenation file here. +% +\parseargdef\documentlanguage{% + \tex % read txi-??.tex file in plain TeX. + % Read the file if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \input txi-#1.tex + \fi + \closein 1 + \endgroup +} +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? In the current directory +should work if nowhere else does.} + +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1 + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} + +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{~} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{~} + \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}} + \gdef^^b2{\missingcharmsg{OGONEK}} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'\i} + \gdef^^ee{\^\i} + \gdef^^ef{\v d} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup + +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz = "#1\relax + \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + \endgroup} + + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=A} + \DeclareUnicodeCharacter{0101}{\=a} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=E} + \DeclareUnicodeCharacter{0113}{\=e} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=I} + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=O} + \DeclareUnicodeCharacter{014D}{\=o} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=U} + \DeclareUnicodeCharacter{016B}{\=u} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\={\AE}} + \DeclareUnicodeCharacter{01E3}{\={\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=Y} + \DeclareUnicodeCharacter{0233}{\=y} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=G} + \DeclareUnicodeCharacter{1E21}{\=g} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs + + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + + +\message{formatting,} + +\newdimen\defaultparindent \defaultparindent = 15pt + +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness = 10000 + +% Don't be so finicky about underfull hboxes, either. +\hbadness = 2000 + +% Following George Bush, just get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; +% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; +% 7) physical page height; 8) physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 2\topandbottommargin + \pageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + \fi + % + \setleading{\textleading} + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % If page is nothing but text, make it come out even. + \internalpagesizes{46\baselineskip}{6in}% + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% +}} + +% Use @smallbook to reset parameters for 7x9.25 trim size. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.5in}{5in}% + {-.2in}{0in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .5cm +}} + +% Use @smallerbook to reset parameters for 6x9 trim size. +% (Just testing, parameters still in flux.) +\def\smallerbook{{\globaldefs = 1 + \parskip = 1.5pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.4in}{4.8in}% + {-.2in}{-.4in}% + {0pt}{14pt}% + {9in}{6in}% + % + \lispnarrowing = 0.25in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .4cm +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{51\baselineskip}{160mm} + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% + % + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = 5mm +}} + +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs = 1 + \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \hfuzz = 1.2pt + \contentsrightmargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. +\def\afourlatex{{\globaldefs = 1 + \afourpaper + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + % + % Must explicitly reset to 0 because we call \afourpaper. + \globaldefs = 0 +}} + +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 + \afourpaper + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs = 0 +}} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{\textleading}% + % + \dimen0 = #1 + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other +\catcode`\~=\other +\catcode`\^=\other +\catcode`\_=\other +\catcode`\|=\other +\catcode`\<=\other +\catcode`\>=\other +\catcode`\+=\other +\catcode`\$=\other +\def\normaldoublequote{"} +\def\normaltilde{~} +\def\normalcaret{^} +\def\normalunderscore{_} +\def\normalverticalbar{|} +\def\normalless{<} +\def\normalgreater{>} +\def\normalplus{+} +\def\normaldollar{$}%$ font-lock fix + +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=\active +\def\activedoublequote{{\tt\char34}} +\let"=\activedoublequote +\catcode`\~=\active +\def~{{\tt\char126}} +\chardef\hat=`\^ +\catcode`\^=\active +\def^{{\tt \hat}} + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +\let\realunder=_ +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } + +\catcode`\|=\active +\def|{{\tt\char124}} +\chardef \less=`\< +\catcode`\<=\active +\def<{{\tt \less}} +\chardef \gtr=`\> +\catcode`\>=\active +\def>{{\tt \gtr}} +\catcode`\+=\active +\def+{{\tt \char 43}} +\catcode`\$=\active +\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +% Used sometimes to turn off (effectively) the active characters even after +% parsing them. +\def\turnoffactive{% + \normalturnoffactive + \otherbackslash +} + +\catcode`\@=0 + +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work + +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} + +% In texinfo, backslash is an active character; it prints the backslash +% in fixed width font. +\catcode`\\=\active +@def@normalbackslash{{@tt@backslashcurfont}} +% On startup, @fixbackslash assigns: +% @let \ = @normalbackslash + +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. +@gdef@rawbackslash{@let\=@backslashcurfont} +@gdef@otherbackslash{@let\=@realbackslash} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. +% +@def@normalturnoffactive{% + @let\=@normalbackslash + @let"=@normaldoublequote + @let~=@normaltilde + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let<=@normalless + @let>=@normalgreater + @let+=@normalplus + @let$=@normaldollar %$ font-lock fix + @unsepspaces +} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\' in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also turn back on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active + @catcode`@_=@active +} + +% Say @foo, not \foo, in error messages. +@escapechar = `@@ + +% These look ok in all fonts, so just make them not special. +@catcode`@& = @other +@catcode`@# = @other +@catcode`@% = @other + + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/build-aux/ylwrap b/build-aux/ylwrap new file mode 100755 index 0000000..102bd89 --- /dev/null +++ b/build-aux/ylwrap @@ -0,0 +1,223 @@ +#! /bin/sh +# ylwrap - wrapper for lex/yacc invocations. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case "$1" in + '') + echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 + exit 1 + ;; + --basedir) + basedir=$2 + shift 2 + ;; + -h|--h*) + cat <<\EOF +Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... + +Wrapper for lex/yacc invocations, renaming files as desired. + + INPUT is the input file + OUTPUT is one file PROG generates + DESIRED is the file we actually want instead of OUTPUT + PROGRAM is program to run + ARGS are passed to PROG + +Any number of OUTPUT,DESIRED pairs may be used. + +Report bugs to . +EOF + exit $? + ;; + -v|--v*) + echo "ylwrap $scriptversion" + exit $? + ;; +esac + + +# The input. +input="$1" +shift +case "$input" in + [\\/]* | ?:[\\/]*) + # Absolute path; do nothing. + ;; + *) + # Relative path. Make it absolute. + input="`pwd`/$input" + ;; +esac + +pairlist= +while test "$#" -ne 0; do + if test "$1" = "--"; then + shift + break + fi + pairlist="$pairlist $1" + shift +done + +# The program to run. +prog="$1" +shift +# Make any relative path in $prog absolute. +case "$prog" in + [\\/]* | ?:[\\/]*) ;; + *[\\/]*) prog="`pwd`/$prog" ;; +esac + +# FIXME: add hostname here for parallel makes that run commands on +# other machines. But that might take us over the 14-char limit. +dirname=ylwrap$$ +trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 +mkdir $dirname || exit 1 + +cd $dirname + +case $# in + 0) $prog "$input" ;; + *) $prog "$@" "$input" ;; +esac +ret=$? + +if test $ret -eq 0; then + set X $pairlist + shift + first=yes + # Since DOS filename conventions don't allow two dots, + # the DOS version of Bison writes out y_tab.c instead of y.tab.c + # and y_tab.h instead of y.tab.h. Test to see if this is the case. + y_tab_nodot="no" + if test -f y_tab.c || test -f y_tab.h; then + y_tab_nodot="yes" + fi + + # The directory holding the input. + input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` + # Quote $INPUT_DIR so we can use it in a regexp. + # FIXME: really we should care about more than `.' and `\'. + input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` + + while test "$#" -ne 0; do + from="$1" + # Handle y_tab.c and y_tab.h output by DOS + if test $y_tab_nodot = "yes"; then + if test $from = "y.tab.c"; then + from="y_tab.c" + else + if test $from = "y.tab.h"; then + from="y_tab.h" + fi + fi + fi + if test -f "$from"; then + # If $2 is an absolute path name, then just use that, + # otherwise prepend `../'. + case "$2" in + [\\/]* | ?:[\\/]*) target="$2";; + *) target="../$2";; + esac + + # We do not want to overwrite a header file if it hasn't + # changed. This avoid useless recompilations. However the + # parser itself (the first file) should always be updated, + # because it is the destination of the .y.c rule in the + # Makefile. Divert the output of all other files to a temporary + # file so we can compare them to existing versions. + if test $first = no; then + realtarget="$target" + target="tmp-`echo $target | sed s/.*[\\/]//g`" + fi + # Edit out `#line' or `#' directives. + # + # We don't want the resulting debug information to point at + # an absolute srcdir; it is better for it to just mention the + # .y file with no path. + # + # We want to use the real output file name, not yy.lex.c for + # instance. + # + # We want the include guards to be adjusted too. + FROM=`echo "$from" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + TARGET=`echo "$2" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + + sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ + -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? + + # Check whether header files must be updated. + if test $first = no; then + if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then + echo "$2" is unchanged + rm -f "$target" + else + echo updating "$2" + mv -f "$target" "$realtarget" + fi + fi + else + # A missing file is only an error for the first file. This + # is a blatant hack to let us support using "yacc -d". If -d + # is not specified, we don't want an error when the header + # file is "missing". + if test $first = yes; then + ret=1 + fi + fi + shift + shift + first=no + done +else + ret=$? +fi + +# Remove the directory. +cd .. +rm -rf $dirname + +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..d407ffe --- /dev/null +++ b/config.h.in @@ -0,0 +1,998 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define this to an absolute name of . */ +#undef ABSOLUTE_DIRENT_H + +/* Define this to an absolute name of . */ +#undef ABSOLUTE_FCNTL_H + +/* Define this to an absolute name of . */ +#undef ABSOLUTE_FLOAT_H + +/* Define this to an absolute name of . */ +#undef ABSOLUTE_INTTYPES_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_SYSEXITS_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 to the number of bits in type 'ptrdiff_t'. */ +#undef BITSIZEOF_PTRDIFF_T + +/* Define to the number of bits in type 'sig_atomic_t'. */ +#undef BITSIZEOF_SIG_ATOMIC_T + +/* Define to the number of bits in type 'size_t'. */ +#undef BITSIZEOF_SIZE_T + +/* Define to the number of bits in type 'wchar_t'. */ +#undef BITSIZEOF_WCHAR_T + +/* Define to the number of bits in type 'wint_t'. */ +#undef BITSIZEOF_WINT_T + +/* Define if chown is not POSIX compliant regarding IDs of -1. */ +#undef CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE + +/* Define if chown modifies symlinks. */ +#undef CHOWN_MODIFIES_SYMLINK + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define full file name of rmt program. */ +#undef DEFAULT_RMT_COMMAND + +/* the name of the file descriptor member of DIR */ +#undef DIR_FD_MEMBER_NAME + +#ifdef DIR_FD_MEMBER_NAME +# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME) +#else +# define DIR_TO_FD(Dir_p) -1 +#endif + + +/* Define to 1 if // is a file system root distinct from /. */ +#undef DOUBLE_SLASH_IS_DISTINCT_ROOT + +/* 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 + +/* Define on systems for which file names may have a so-called `drive letter' + prefix, define this to compute the length of that prefix, including the + colon. */ +#undef FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX + +/* Define if the backslash character may also serve as a file name component + separator. */ +#undef FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR + +/* Define if a drive letter prefix denotes a relative path if it is not + followed by a file name component separator. */ +#undef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE + +/* Define if gettimeofday clobbers the localtime buffer. */ +#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME + +/* Define to 1 when using the gnulib module close-stream. */ +#undef GNULIB_CLOSE_STREAM + +/* Define to 1 when using the gnulib module fcntl-safer. */ +#undef GNULIB_FCNTL_SAFER + +/* Define to 1 to add extern declaration of program_invocation_name to argp.h + */ +#undef GNULIB_PROGRAM_INVOCATION_NAME + +/* Define to 1 to add extern declaration of program_invocation_short_name to + argp.h */ +#undef GNULIB_PROGRAM_INVOCATION_SHORT_NAME + +/* Define to 1 if you have the `alarm' function. */ +#undef HAVE_ALARM + +/* Define to 1 if you have 'alloca' after including , a header that + 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. */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the `btowc' function. */ +#undef HAVE_BTOWC + +/* Define to 1 if you have the `canonicalize_file_name' function. */ +#undef HAVE_CANONICALIZE_FILE_NAME + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYCURRENT + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + +/* Define to 1 if your system has a working `chown' function. */ +#undef HAVE_CHOWN + +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 if you have the `clock_settime' function. */ +#undef HAVE_CLOCK_SETTIME + +/* Define if you have compound literals. */ +#undef HAVE_COMPOUND_LITERALS + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the declaration of `atoi', and to 0 if you don't. + */ +#undef HAVE_DECL_ATOI + +/* Define to 1 if you have the declaration of `canonicalize_file_name', and to + 0 if you don't. */ +#undef HAVE_DECL_CANONICALIZE_FILE_NAME + +/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_CLEARERR_UNLOCKED + +/* 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 `errno', and to 0 if you don't. + */ +#undef HAVE_DECL_ERRNO + +/* Define to 1 if you have the declaration of `exit', and to 0 if you don't. + */ +#undef HAVE_DECL_EXIT + +/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_FEOF_UNLOCKED + +/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FERROR_UNLOCKED + +/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FFLUSH_UNLOCKED + +/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FGETS_UNLOCKED + +/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTC_UNLOCKED + +/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTS_UNLOCKED + +/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FREAD_UNLOCKED + +/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FWRITE_UNLOCKED + +/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_GETCHAR_UNLOCKED + +/* Define to 1 if you have the declaration of `getcwd', and to 0 if you don't. + */ +#undef HAVE_DECL_GETCWD + +/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_GETC_UNLOCKED + +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#undef HAVE_DECL_GETENV + +/* Define to 1 if you have the declaration of `getgrgid', and to 0 if you + don't. */ +#undef HAVE_DECL_GETGRGID + +/* Define to 1 if you have the declaration of `getgrnam', and to 0 if you + don't. */ +#undef HAVE_DECL_GETGRNAM + +/* Define to 1 if you have the declaration of `getpwnam', and to 0 if you + don't. */ +#undef HAVE_DECL_GETPWNAM + +/* Define to 1 if you have the declaration of `imaxabs', and to 0 if you + don't. */ +#undef HAVE_DECL_IMAXABS + +/* Define to 1 if you have the declaration of `imaxdiv', and to 0 if you + don't. */ +#undef HAVE_DECL_IMAXDIV + +/* 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 `memrchr', and to 0 if you + 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 if program_invocation_name is declared */ +#undef HAVE_DECL_PROGRAM_INVOCATION_NAME + +/* Define if program_invocation_short_name is declared */ +#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + +/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_PUTCHAR_UNLOCKED + +/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_PUTC_UNLOCKED + +/* Define to 1 if you have the declaration of `strdup', and to 0 if you don't. + */ +#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 + +/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNCASECMP + +/* Define to 1 if you have the declaration of `strndup', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNDUP + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNLEN + +/* Define to 1 if you have the declaration of `strtoimax', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOIMAX + +/* Define to 1 if you have the declaration of `strtoumax', and to 0 if you + don't. */ +#undef HAVE_DECL_STRTOUMAX + +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +#undef HAVE_DECL_TZNAME + +/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_VSNPRINTF + +/* Define to 1 if you have the declaration of `__fpending', and to 0 if you + don't. */ +#undef HAVE_DECL___FPENDING + +/* Define to 1 if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the `dirfd' function. */ +#undef HAVE_DIRFD + +/* Define to 1 if you have the `dup2' function. */ +#undef HAVE_DUP2 + +/* Define if you have the declaration of environ. */ +#undef HAVE_ENVIRON_DECL + +/* Define to 1 if you have the `fchdir' function. */ +#undef HAVE_FCHDIR + +/* Define to 1 if you have the `fchmod' function. */ +#undef HAVE_FCHMOD + +/* Define to 1 if you have the `fchmodat' function. */ +#undef HAVE_FCHMODAT + +/* Define to 1 if you have the `fchown' function. */ +#undef HAVE_FCHOWN + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `fdopendir' function. */ +#undef HAVE_FDOPENDIR + +/* Define to 1 if you have the header file. */ +#undef HAVE_FEATURES_H + +/* 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 `funlockfile' function. */ +#undef HAVE_FUNLOCKFILE + +/* 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 `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long_only' function. */ +#undef HAVE_GETOPT_LONG_ONLY + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* Define to 1 if the compiler supports one of the keywords 'inline', + '__inline__', '__inline' and effectively inlines functions marked as such. + */ +#undef HAVE_INLINE + +/* Define if you have the 'intmax_t' type in or . */ +#undef HAVE_INTMAX_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if exists, doesn't clash with , and + 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 you have the `iswcntrl' function. */ +#undef HAVE_ISWCNTRL + +/* Define to 1 if you have the `iswctype' function. */ +#undef HAVE_ISWCTYPE + +/* 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 to 1 if you have the header file. */ +#undef HAVE_LIBINTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINEWRAP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* 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 + +/* Define to 1 if you have the `lstat' function. */ +#undef HAVE_LSTAT + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ +#undef HAVE_MBRTOWC + +/* Define to 1 if you have the `mbsinit' function. */ +#undef HAVE_MBSINIT + +/* Define to 1 if you have the `mbsrtowcs' function. */ +#undef HAVE_MBSRTOWCS + +/* Define to 1 if declares mbstate_t. */ +#undef HAVE_MBSTATE_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define to 1 if you have the `memrchr' function. */ +#undef HAVE_MEMRCHR + +/* Define to 1 if you have the `mkdirat' function. */ +#undef HAVE_MKDIRAT + +/* Define to 1 if you have the `mkfifo' function. */ +#undef HAVE_MKFIFO + +/* Define to 1 if you have the `nanotime' function. */ +#undef HAVE_NANOTIME + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_ERRNO_H + +/* Define to 1 if libc includes obstacks. */ +#undef HAVE_OBSTACK + +/* Define to 1 if you have the `openat' function. */ +#undef HAVE_OPENAT + +/* Define to 1 if getcwd works, except it sometimes fails when it shouldn't, + setting errno to ERANGE, ENAMETOOLONG, or ENOENT. If __GETCWD_PREFIX is not + defined, it doesn't matter whether HAVE_PARTLY_WORKING_GETCWD is defined. + */ +#undef HAVE_PARTLY_WORKING_GETCWD + +/* Define to 1 if you have the `pipe' function. */ +#undef HAVE_PIPE + +/* Define if program_invocation_name is defined */ +#undef HAVE_PROGRAM_INVOCATION_NAME + +/* Define if program_invocation_short_name is defined */ +#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME + +/* Define to 1 if the system has the type `ptrdiff_t'. */ +#undef HAVE_PTRDIFF_T + +/* Define to 1 if you have the `readlink' function. */ +#undef HAVE_READLINK + +/* Define to 1 if you have the header file. */ +#undef HAVE_SEARCH_H + +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the header file. */ +#undef HAVE_SGTTY_H + +/* Define to 1 if 'sig_atomic_t' is a signed integer type. */ +#undef HAVE_SIGNED_SIG_ATOMIC_T + +/* Define to 1 if 'wchar_t' is a signed integer type. */ +#undef HAVE_SIGNED_WCHAR_T + +/* Define to 1 if 'wint_t' is a signed integer type. */ +#undef HAVE_SIGNED_WINT_T + +/* Define to 1 if you have the `sleep' function. */ +#undef HAVE_SLEEP + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define if exists, doesn't clash with , and declares + uintmax_t. */ +#undef HAVE_STDINT_H_WITH_UINTMAX + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_EXT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `stpcpy' function. */ +#undef HAVE_STPCPY + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchrnul' function. */ +#undef HAVE_STRCHRNUL + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the `strerror_r' function. */ +#undef HAVE_STRERROR_R + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define if you have the strndup() function and it works. */ +#undef HAVE_STRNDUP + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if `st_blksize' is member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BLKSIZE + +/* Define to 1 if `st_blocks' is member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BLOCKS + +/* Define to 1 if `tm_zone' is member of `struct tm'. */ +#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 your `struct stat' has `st_blksize'. Deprecated, use + `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */ +#undef HAVE_ST_BLKSIZE + +/* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use + `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ +#undef HAVE_ST_BLOCKS + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSEXITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BITYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BUF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_DEVICE_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define if your system has sys_errlist global variable */ +#undef HAVE_SYS_ERRLIST + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_GENTAPE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IO_TRIOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MTIO_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TAPE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIMEB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TPRINTF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H + +/* Define if struct tm has the tm_gmtoff member. */ +#undef HAVE_TM_GMTOFF + +/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead. */ +#undef HAVE_TM_ZONE + +/* Define to 1 if you have the `tsearch' function. */ +#undef HAVE_TSEARCH + +/* Define to 1 if you don't have `tm_zone' but do have the external array + `tzname'. */ +#undef HAVE_TZNAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `unsetenv' function. */ +#undef HAVE_UNSETENV + +/* Define to 1 if the system has the type `unsigned long long int'. */ +#undef HAVE_UNSIGNED_LONG_LONG_INT + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTMP_H + +/* Define to 1 if you have the `vasnprintf' function. */ +#undef HAVE_VASNPRINTF + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCHAR_H + +/* Define if you have the 'wchar_t' type. */ +#undef HAVE_WCHAR_T + +/* Define to 1 if you have the `wcslen' function. */ +#undef HAVE_WCSLEN + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCTYPE_H + +/* Define if you have the 'wint_t' type. */ +#undef HAVE_WINT_T + +/* Define to 1 if you have the `wmemchr' function. */ +#undef HAVE_WMEMCHR + +/* Define to 1 if you have the `wmemcpy' function. */ +#undef HAVE_WMEMCPY + +/* Define to 1 if you have the `wmempcpy' function. */ +#undef HAVE_WMEMPCPY + +/* Define to 1 if O_NOATIME works. */ +#undef HAVE_WORKING_O_NOATIME + +/* Define to 1 if O_NOFOLLOW works. */ +#undef HAVE_WORKING_O_NOFOLLOW + +/* Define if utimes works properly. */ +#undef HAVE_WORKING_UTIMES + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if you have the `_ftime' function. */ +#undef HAVE__FTIME + +/* Define to 1 if you have the `__fpending' function. */ +#undef HAVE___FPENDING + +#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#else +# define ISSLASH(C) ((C) == '/') +#endif + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + +/* Define to 1 if `major', `minor', and `makedev' are declared in . + */ +#undef MAJOR_IN_MKDEV + +/* Define to 1 if `major', `minor', and `makedev' are declared in + . */ +#undef MAJOR_IN_SYSMACROS + +/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ +#undef MALLOC_0_IS_NONNULL + +/* Define to mt_model (v.g., for DG/UX), else to mt_type. */ +#undef MTIO_CHECK_FIELD + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* the number of pending output bytes on stream `fp' */ +#undef PENDING_OUTPUT_N_BYTES + +/* Define if exists and defines unusable PRI* macros. */ +#undef PRI_MACROS_BROKEN + +/* Define to 1 if the C compiler supports function prototypes. */ +#undef PROTOTYPES + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'ptrdiff_t'. */ +#undef PTRDIFF_T_SUFFIX + +/* Define if vasnprintf exists but is overridden by gnulib. */ +#undef REPLACE_VASNPRINTF + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + '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 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if the `S_IS*' macros in do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if strerror_r returns char *. */ +#undef STRERROR_R_CHAR_P + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, but it is not + safe for multithreaded apps. */ +#undef USE_UNLOCKED_IO + +/* 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 to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wint_t'. */ +#undef WINT_T_SUFFIX + +/* 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 +#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 + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Enable extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif + +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#undef __GETOPT_PREFIX + +/* Define to rpl_ if the openat replacement function should be used. */ +#undef __OPENAT_PREFIX + +/* Define like PROTOTYPES; this can be used by system headers. */ +#undef __PROTOTYPES + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to rpl_fchownat if the replacement function should be used. */ +#undef fchownat + +/* Define to a replacement function name for fnmatch(). */ +#undef fnmatch + +/* Define to `int' if does not define. */ +#undef gid_t + +/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b)) + +/* Define to rpl_gmtime if the replacement function should be used. */ +#undef gmtime + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to long or long long if and don't define. */ +#undef intmax_t + +/* Define to rpl_localtime if the replacement function should be used. */ +#undef localtime + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to a type if does not define. */ +#undef mbstate_t + +/* Define to rpl_mktime if the replacement function should be used. */ +#undef mktime + +/* Define to `long int' if does not define. */ +#undef off_t + +/* Define to a replacement function name for realpath(). */ +#undef realpath + +/* Define to equivalent of C99 restrict keyword, or to nothing if this is not + supported. Do not define if restrict is supported directly. */ +#undef restrict + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define as a signed type of the same size as size_t. */ +#undef ssize_t + +/* Define to rpl_strnlen if the replacement function should be used. */ +#undef strnlen + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define as a macro for copying va_list variables. */ +#undef va_copy diff --git a/configure b/configure new file mode 100755 index 0000000..67eec67 --- /dev/null +++ b/configure @@ -0,0 +1,36462 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.60 for GNU cpio 2.8. +# +# Report bugs to . +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 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. ## +## --------------------- ## + +# Be Bourne compatible +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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# 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 + +# 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 +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (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 +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 + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +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 /usr/bin/posix$PATH_SEPARATOR/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 +# Be Bourne compatible +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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(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. :-) + 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" || + { 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + 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 +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 || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +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=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='GNU cpio' +PACKAGE_TARNAME='cpio' +PACKAGE_VERSION='2.8' +PACKAGE_STRING='GNU cpio 2.8' +PACKAGE_BUGREPORT='bug-cpio@gnu.org' + +ac_unique_file="src/cpio.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif +#if HAVE_STDINT_H +# include +#endif +#if HAVE_UNISTD_H +# include +#endif" + +gl_func_list= +gl_header_list= +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 +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 +YACC +YFLAGS +GL_COND_LIBTOOL_TRUE +GL_COND_LIBTOOL_FALSE +ALLOCA +ALLOCA_H +GETOPT_H +GNULIB_CHOWN +GNULIB_DUP2 +GNULIB_FCHDIR +GNULIB_FTRUNCATE +GNULIB_GETCWD +GNULIB_GETLOGIN_R +GNULIB_LSEEK +GNULIB_READLINK +GNULIB_SLEEP +HAVE_DUP2 +HAVE_FTRUNCATE +HAVE_READLINK +HAVE_SLEEP +HAVE_DECL_GETLOGIN_R +REPLACE_CHOWN +REPLACE_FCHDIR +REPLACE_GETCWD +REPLACE_LSEEK +LIB_CLOCK_GETTIME +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +ABSOLUTE_DIRENT_H +DIRENT_H +ABSOLUTE_FCNTL_H +FCNTL_H +ABSOLUTE_FLOAT_H +FLOAT_H +FNMATCH_H +STDBOOL_H +HAVE__BOOL +LIBINTL +LTLIBINTL +ABSOLUTE_SYS_TIME_H +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +SYS_TIME_H +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 +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 +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_FPRINTF_POSIX +GNULIB_PRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_SPRINTF_POSIX +GNULIB_VFPRINTF_POSIX +GNULIB_VPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VSPRINTF_POSIX +GNULIB_VASPRINTF +GNULIB_FSEEK +GNULIB_FSEEKO +GNULIB_FTELL +GNULIB_FTELLO +GNULIB_FFLUSH +REPLACE_FPRINTF +REPLACE_VFPRINTF +REPLACE_PRINTF +REPLACE_VPRINTF +REPLACE_SNPRINTF +HAVE_DECL_SNPRINTF +REPLACE_VSNPRINTF +HAVE_DECL_VSNPRINTF +REPLACE_SPRINTF +REPLACE_VSPRINTF +HAVE_VASPRINTF +REPLACE_VASPRINTF +HAVE_FSEEKO +REPLACE_FSEEKO +REPLACE_FSEEK +HAVE_FTELLO +REPLACE_FTELLO +REPLACE_FTELL +REPLACE_FFLUSH +ABSOLUTE_STDIO_H +GNULIB_GETSUBOPT +GNULIB_MKDTEMP +GNULIB_MKSTEMP +HAVE_GETSUBOPT +HAVE_MKDTEMP +REPLACE_MKSTEMP +ABSOLUTE_STDLIB_H +ABSOLUTE_STRING_H +HAVE_LSTAT +HAVE_DECL_MKDIR +HAVE_IO_H +ABSOLUTE_SYS_STAT_H +SYS_STAT_H +HAVE_SYSEXITS_H +ABSOLUTE_SYSEXITS_H +SYSEXITS_H +REPLACE_LOCALTIME_R +REPLACE_NANOSLEEP +REPLACE_STRPTIME +REPLACE_TIMEGM +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_ISWCNTRL +HAVE_WINT_T +ABSOLUTE_WCTYPE_H +HAVE_WCTYPE_H +WCTYPE_H +LIBCPIO_LIBDEPS +LIBCPIO_LTLIBDEPS +LIB_SETSOCKOPT +PU_RMT_PROG +DEFAULT_RMT_DIR +DEFAULT_RMT_COMMAND +CPIO_MT_PROG +USE_NLS +MSGFMT +GMSGFMT +MSGFMT_015 +GMSGFMT_015 +XGETTEXT +XGETTEXT_015 +MSGMERGE +INTL_MACOSX_LIBS +LIBICONV +LTLIBICONV +INTLLIBS +POSUB +AUTOM4TE +LIBOBJS +LTLIBOBJS +gl_LIBOBJS +gl_LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP +YACC +YFLAGS +DEFAULT_RMT_DIR' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + 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 && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +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 + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +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 .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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 || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +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 cpio 2.8 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +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/cpio] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GNU cpio 2.8:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --disable-largefile omit support for large files + --enable-mt Enable building of mt program + --disable-nls do not use Native Language Support + --disable-rpath do not hardcode runtime library paths + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-rmt=FILE Use FILE as the default `rmt' program. Do not build + included copy of `rmt'. + --with-gnu-ld assume the C compiler uses GNU ld default=no + --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 + --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 + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + YACC The `Yet Another C Compiler' implementation to use. Defaults to + the first program found out of: `bison -y', `byacc', `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. + DEFAULT_RMT_DIR + Define full file name of the directory where to install `rmt'. + (default: $(libexecdir)) + +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 . +_ACEOF +ac_status=$? +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 + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`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/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GNU cpio configure 2.8 +generated by GNU Autoconf 2.60 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 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 +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 cpio $as_me 2.8, which was +generated by GNU Autoconf 2.60. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$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; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); 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 + +# 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 + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +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 + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +gl_func_list="$gl_func_list flockfile" +gl_func_list="$gl_func_list funlockfile" +gl_header_list="$gl_header_list features.h" +gl_header_list="$gl_header_list linewrap.h" +gl_func_list="$gl_func_list canonicalize_file_name" +gl_header_list="$gl_header_list sys/param.h" +gl_header_list="$gl_header_list unistd.h" +gl_func_list="$gl_func_list getcwd" +gl_func_list="$gl_func_list readlink" +gl_func_list="$gl_func_list dup2" +gl_func_list="$gl_func_list fchdir" +gl_header_list="$gl_header_list dirent.h" +gl_header_list="$gl_header_list fcntl.h" +gl_header_list="$gl_header_list float.h" +gl_func_list="$gl_func_list btowc" +gl_func_list="$gl_func_list iswctype" +gl_func_list="$gl_func_list mbsrtowcs" +gl_func_list="$gl_func_list mempcpy" +gl_func_list="$gl_func_list wmemchr" +gl_func_list="$gl_func_list wmemcpy" +gl_func_list="$gl_func_list wmempcpy" +gl_header_list="$gl_header_list wctype.h" +gl_header_list="$gl_header_list stdio_ext.h" +gl_func_list="$gl_func_list gettimeofday" +gl_func_list="$gl_func_list nanotime" +gl_header_list="$gl_header_list sys/time.h" +gl_header_list="$gl_header_list stdint.h" +gl_header_list="$gl_header_list inttypes.h" +gl_func_list="$gl_func_list alarm" +gl_func_list="$gl_func_list lchmod" +gl_func_list="$gl_func_list fdopendir" +gl_func_list="$gl_func_list mbsinit" +gl_func_list="$gl_func_list setenv" +gl_func_list="$gl_func_list sleep" +gl_header_list="$gl_header_list stdio.h" +gl_header_list="$gl_header_list stdlib.h" +gl_func_list="$gl_func_list strerror" +gl_header_list="$gl_header_list string.h" +gl_func_list="$gl_func_list lstat" +gl_header_list="$gl_header_list sys/stat.h" +gl_header_list="$gl_header_list sysexits.h" +gl_header_list="$gl_header_list time.h" +gl_func_list="$gl_func_list pipe" +gl_header_list="$gl_header_list utime.h" +gl_func_list="$gl_func_list futimes" +gl_func_list="$gl_func_list futimesat" +gl_func_list="$gl_func_list vasnprintf" +gl_header_list="$gl_header_list wchar.h" +gl_func_list="$gl_func_list iswcntrl" +gl_header_list="$gl_header_list net/errno.h" +gl_header_list="$gl_header_list sys/inet.h" +gl_header_list="$gl_header_list netdb.h" +gl_header_list="$gl_header_list memory.h" +gl_header_list="$gl_header_list sys/wait.h" +gl_header_list="$gl_header_list sys/gentape.h" +gl_header_list="$gl_header_list sys/tape.h" +gl_header_list="$gl_header_list sys/device.h" +gl_header_list="$gl_header_list sys/tprintf.h" +gl_header_list="$gl_header_list sys/mtio.h" +gl_header_list="$gl_header_list sgtty.h" +gl_header_list="$gl_header_list sys/io/trioctl.h" +gl_header_list="$gl_header_list locale.h" +gl_func_list="$gl_func_list mkfifo" +gl_func_list="$gl_func_list setlocale" +gt_needs="$gt_needs need-formatstring-macros" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +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 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +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 + + + +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 +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +am__api_version='1.10a' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# 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. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +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/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # 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 + fi + fi + done + done + ;; +esac +done +IFS=$as_save_IFS + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL 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. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# 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` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # 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". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +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; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# 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" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$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 +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='cpio' + VERSION='2.8' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + 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 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + 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 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ 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 +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. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +ac_config_headers="$ac_config_headers config.h" + + + + + +cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&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 +# 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 +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +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 +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + 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_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ 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 +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 + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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_executable_p "$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" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + 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_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ 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 +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 + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out 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. +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`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. +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_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +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 ) + ;; + [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; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&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 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +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; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out 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. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 +# `rm'. +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_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + 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 +/* end confdefs.h. */ + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 +/* end confdefs.h. */ + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_c89=$ac_arg +else + 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 +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +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 + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + 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 + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + 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} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 && + ${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 + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=c +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 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # 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 +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # 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 +/* 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # 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 +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # 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 +/* 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +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 + + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +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_executable_p "$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*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + 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` + 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" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +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 + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +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_executable_p "$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*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + 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` + 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" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +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 + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +{ echo "$as_me:$LINENO: checking for AIX" >&5 +echo $ECHO_N "checking for AIX... $ECHO_C" >&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 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +rm -f conftest* + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#include + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +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 +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +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 + : +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 +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + 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 echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +if test "${ac_cv_header_minix_config_h+set}" = set; then + { echo "$as_me:$LINENO: checking for minix/config.h" >&5 +echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for minix/config.h" >&5 +echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_minix_config_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } + +fi +if test $ac_cv_header_minix_config_h = yes; then + MINIX=yes +else + MINIX= +fi + + +if test "$MINIX" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_SOURCE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_1_SOURCE 2 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _MINIX 1 +_ACEOF + +fi + + + + + + + + + + + + { echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 __EXTENSIONS__ 1 + $ac_includes_default +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_safe_to_define___extensions__=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_safe_to_define___extensions__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF + + + +ac_ext=c +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 +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + 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_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ 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 +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 + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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_executable_p "$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" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + 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_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ 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 +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 + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + 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 +/* end confdefs.h. */ + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 +/* end confdefs.h. */ + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_c89=$ac_arg +else + 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 +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +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 + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + 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 + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + 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} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 && + ${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 + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +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 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # 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 +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # 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 +/* 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # 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 +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # 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 +/* 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + 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 + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +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 + +if test $ac_cv_c_compiler_gnu = yes; then + { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +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 +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# 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. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +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/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # 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 + fi + fi + done + done + ;; +esac +done +IFS=$as_save_IFS + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL 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. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + 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_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ 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 +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 + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_YACC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + + case $ac_cv_prog_cc_stdc in + no) ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; + *) { echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C99... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c99+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict(ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy work. +static void +test_varargs(const char *format, ...) +{ + va_list args; + va_start(args, format); + va_list args_copy; + va_copy(args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg(args_copy, const char *); + break; + case 'd': // int + number = va_arg(args_copy, int); + break; + case 'f': // float + fnumber = (float) va_arg(args_copy, double); + break; + default: + break; + } + } + va_end(args_copy); + va_end(args); +} + +int +main () +{ + + // Check bool and long long datatypes. + _Bool success = false; + long long int bignum = -1234567890LL; + unsigned long long int ubignum = 1234567890uLL; + + // Check restrict. + if (test_restrict("String literal") != 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs("s, d' f .", "string", 65, 34.234); + + // Check incomplete arrays work. + struct incomplete_array *ia = + malloc(sizeof(struct incomplete_array) + (sizeof(double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = (double) i * 1.234; + + // Check named initialisers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[43] = 543; + + // work around unused variable warnings + return bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'; + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -c99 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_c99=$ac_arg +else + 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 +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_c89=$ac_arg +else + 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 +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac +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 + { echo "$as_me:$LINENO: checking for $CC option to accept ISO Standard C" >&5 +echo $ECHO_N "checking for $CC option to accept ISO Standard C... $ECHO_C" >&6; } + if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi + + case $ac_cv_prog_cc_stdc in + no) { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + '') { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + *) { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6; } ;; +esac + + + + + + + + +{ echo "$as_me:$LINENO: checking for function prototypes" >&5 +echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6; } +if test "$ac_cv_prog_cc_c89" != no; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define PROTOTYPES 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define __PROTOTYPES 1 +_ACEOF + +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + 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 +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + ac_cv_sys_file_offset_bits=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + 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 +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_file_offset_bits=64; break +else + 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 + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +if test "$ac_cv_sys_file_offset_bits" != no; then + +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF + +fi +rm -f conftest* + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + ac_cv_sys_large_files=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + 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 +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_large_files=1; break +else + 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 + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +if test "$ac_cv_sys_large_files" != no; then + +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF + +fi +rm -f conftest* +fi + + +{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +return *(signal (0, 0)) (0) == 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_signal=int +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_signal=void +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +{ echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 +echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_sys_types_h_makedev=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_sys_types_h_makedev=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 +echo "${ECHO_T}$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 + { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_mkdev_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 +echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 +echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_mkdev_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_mkdev_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +echo "${ECHO_T}$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 + +fi + + + + if test $ac_cv_header_sys_mkdev_h = no; then + if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then + { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 +echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 +echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_sysmacros_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +echo "${ECHO_T}$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 + +fi + + + fi +fi + +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !x[0] && !zero.x; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } +if test "${ac_cv_type_uid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +cat >>confdefs.h <<\_ACEOF +#define uid_t int +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define gid_t int +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for gid_t" >&5 +echo $ECHO_N "checking for gid_t... $ECHO_C" >&6; } +if test "${ac_cv_type_gid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 gid_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_gid_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_gid_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_gid_t" >&5 +echo "${ECHO_T}$ac_cv_type_gid_t" >&6; } +if test $ac_cv_type_gid_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define gid_t int +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#include + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +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 +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +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 + : +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 +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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_hdr> + +int +main () +{ +if ((DIR *) 0) +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + 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 echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir=$ac_res +else + 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 + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir=$ac_res +else + 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 + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + + + + +for ac_func in fchmod fchown +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# gnulib modules +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } +if test "${ac_cv_working_alloca_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 *p = (char *) alloca (2 * sizeof (int)); + if (p) 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_working_alloca_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_working_alloca_h=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$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 + +fi + +{ echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_alloca_works=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_alloca_works=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# 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 + + +{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} + +int +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_stack_direction=1 +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } + +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 STDC_HEADERS || HAVE_STDLIB_H +# include +#else +char *malloc (); +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +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 +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$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 + + + + { echo "$as_me:$LINENO: checking for long long int" >&5 +echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } +if test "${ac_cv_type_long_long_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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; +} +_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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if test "$cross_compiling" = yes; then + ac_cv_type_long_long_int=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long_int=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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_ext +fi + + +else + 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$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 +echo "${ECHO_T}$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 + +{ echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6; } +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_inline=$ac_kw +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$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 + +{ echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 +echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6; } +if test "${ac_cv_c_restrict+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +typedef int * int_ptr; + 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) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_restrict=$ac_kw +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5 +echo "${ECHO_T}$ac_cv_c_restrict" >&6; } + case $ac_cv_c_restrict in + restrict) ;; + no) +cat >>confdefs.h <<\_ACEOF +#define restrict +_ACEOF + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac + + + { echo "$as_me:$LINENO: checking whether getenv is declared" >&5 +echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 getenv + char *p = (char *) getenv; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getenv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getenv=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6; } +if test $ac_cv_have_decl_getenv = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 +echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 clearerr_unlocked + char *p = (char *) clearerr_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_clearerr_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_clearerr_unlocked=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CLEARERR_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 +echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) feof_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_feof_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FEOF_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 +echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) ferror_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_ferror_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FERROR_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 +echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) fflush_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fflush_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FFLUSH_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 +echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) fgets_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fgets_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) fputc_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fputc_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTC_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) fputs_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fputs_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTS_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 +echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) fread_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fread_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREAD_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 +echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) fwrite_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fwrite_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FWRITE_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 +echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) getc_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getc_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) getchar_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getchar_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCHAR_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 +echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) putc_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_putc_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) putchar_unlocked; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_putchar_unlocked=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED 0 +_ACEOF + + +fi + + + + + + + + +for ac_func in $gl_func_list +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + + + + + + + + + + + + +for ac_header in $gl_header_list +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking whether canonicalize_file_name is declared" >&5 +echo $ECHO_N "checking whether canonicalize_file_name is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_canonicalize_file_name+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 canonicalize_file_name + char *p = (char *) canonicalize_file_name; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_canonicalize_file_name=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_canonicalize_file_name=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_canonicalize_file_name" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CANONICALIZE_FILE_NAME 0 +_ACEOF + + +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GNULIB_CHOWN=0; + GNULIB_DUP2=0; + GNULIB_FCHDIR=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETLOGIN_R=0; + GNULIB_LSEEK=0; + GNULIB_READLINK=0; + GNULIB_SLEEP=0; + HAVE_DUP2=1; + HAVE_FTRUNCATE=1; + HAVE_READLINK=1; + HAVE_SLEEP=1; + HAVE_DECL_GETLOGIN_R=1; + REPLACE_CHOWN=0; + REPLACE_FCHDIR=0; + REPLACE_GETCWD=0; + REPLACE_LSEEK=0; + + +for ac_header in unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for working chown" >&5 +echo $ECHO_N "checking for working chown... $ECHO_C" >&6; } +if test "${ac_cv_func_chown_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +/* end confdefs.h. */ +$ac_includes_default +#include + +int +main () +{ + char *f = "conftest.chown"; + struct stat before, after; + + if (creat (f, 0600) < 0) + return 1; + if (stat (f, &before) < 0) + return 1; + if (chown (f, (uid_t) -1, (gid_t) -1) == -1) + return 1; + if (stat (f, &after) < 0) + return 1; + return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); + + ; + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_chown_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +rm -f conftest.chown + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_chown_works" >&5 +echo "${ECHO_T}$ac_cv_func_chown_works" >&6; } +if test $ac_cv_func_chown_works = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CHOWN 1 +_ACEOF + +fi + + + { echo "$as_me:$LINENO: checking whether chown(2) dereferences symlinks" >&5 +echo $ECHO_N "checking whether chown(2) dereferences symlinks... $ECHO_C" >&6; } +if test "${gl_cv_func_chown_follows_symlink+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + 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 +/* end confdefs.h. */ + +#include +#include +#include + + int + main () + { + char const *dangling_symlink = "conftest.dangle"; + + unlink (dangling_symlink); + if (symlink ("conftest.no-such", dangling_symlink)) + abort (); + + /* Exit successfully on a conforming system, + i.e., where chown must fail with ENOENT. */ + exit ( ! (chown (dangling_symlink, getuid (), getgid ()) != 0 + && errno == ENOENT)); + } + +_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_chown_follows_symlink=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_chown_follows_symlink" >&5 +echo "${ECHO_T}$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 + + fi + + + { echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 +echo $ECHO_N "checking whether system is Windows or MSDOS... $ECHO_C" >&6; } +if test "${ac_cv_win_or_dos+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__ +neither MSDOS nor Windows +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_win_or_dos=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_win_or_dos=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 +echo "${ECHO_T}$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 + { echo "$as_me:$LINENO: checking whether drive letter can start relative path" >&5 +echo $ECHO_N "checking whether drive letter can start relative path... $ECHO_C" >&6; } +if test "${ac_cv_drive_letter_can_be_relative+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#if defined __CYGWIN__ +drive letters are always absolute +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_drive_letter_can_be_relative=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_drive_letter_can_be_relative=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_drive_letter_can_be_relative" >&5 +echo "${ECHO_T}$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 + else + ac_fs_drive_letter_can_be_relative=0 + fi + else + ac_fs_accepts_drive_letter_prefix=0 + ac_fs_backslash_is_file_name_separator=0 + ac_fs_drive_letter_can_be_relative=0 + fi + + +cat >>confdefs.h <<_ACEOF +#define FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix +_ACEOF + + + + + + +cat >>confdefs.h <<_ACEOF +#define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE $ac_fs_drive_letter_can_be_relative +_ACEOF + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +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` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +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 + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +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 + + + + + { echo "$as_me:$LINENO: checking whether // is distinct from /" >&5 +echo $ECHO_N "checking whether // is distinct from /... $ECHO_C" >&6; } +if test "${gl_cv_double_slash_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + 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 + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi +fi +{ echo "$as_me:$LINENO: result: $gl_cv_double_slash_root" >&5 +echo "${ECHO_T}$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 + + fi + + + + + + + +{ echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 +echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strerror_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 strerror_r + char *p = (char *) strerror_r; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strerror_r=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_strerror_r=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 +echo "${ECHO_T}$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 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R 0 +_ACEOF + + +fi + + + +for ac_func in strerror_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +{ echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 +echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6; } +if test "${ac_cv_func_strerror_r_char_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_char_p=yes +else + 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 + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # 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 + : +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 + extern char *strerror_r (); +int +main () +{ +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + return ! isalpha (x); + ; + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_char_p=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +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 + + + fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 +echo "${ECHO_T}$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 + +fi + + + + + + + + + + + + + + + + + + + + + + + + + +{ echo "$as_me:$LINENO: checking for mbstate_t" >&5 +echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6; } +if test "${ac_cv_type_mbstate_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_mbstate_t=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 +echo "${ECHO_T}$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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking whether getcwd (NULL, 0) allocates memory for result" >&5 +echo $ECHO_N "checking whether getcwd (NULL, 0) allocates memory for result... $ECHO_C" >&6; } +if test "${gl_cv_func_getcwd_null+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +/* end confdefs.h. */ + +# include +# include +# ifndef getcwd + char *getcwd (); +# endif + int + main () + { + if (chdir ("/") != 0) + exit (1); + else + { + char *f = getcwd (NULL, 0); + exit (! (f && f[0] == '/' && !f[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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_getcwd_null=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_getcwd_null" >&5 +echo "${ECHO_T}$gl_cv_func_getcwd_null" >&6; } + + + { echo "$as_me:$LINENO: checking whether getcwd is declared" >&5 +echo $ECHO_N "checking whether getcwd is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getcwd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 getcwd + char *p = (char *) getcwd; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getcwd=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getcwd=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getcwd" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getcwd" >&6; } +if test $ac_cv_have_decl_getcwd = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCWD 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCWD 0 +_ACEOF + + +fi + + + +{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + #if defined __xlc__ || defined __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a run-time + test, and that would make cross-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. We also test + this with GCC, where it should work, to detect more + quickly whether someone messes up the test in the + future. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); + #endif + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdbool_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } + { echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } +if test "${ac_cv_type__Bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type__Bool=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +if test $ac_cv_type__Bool = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + + if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + + fi + + + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + + + + + + + # getdate.y works with bison only. + : ${YACC='bison -y'} + + + { echo "$as_me:$LINENO: checking for compound literals" >&5 +echo $ECHO_N "checking for compound literals... $ECHO_C" >&6; } +if test "${gl_cv_compound_literals+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +struct s { int i, j; }; struct s s = (struct s) { 1, 2 }; +int +main () +{ +struct s t = (struct s) { 3, 4 }; + if (t.i != 0) 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_compound_literals=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_compound_literals=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_compound_literals" >&5 +echo "${ECHO_T}$gl_cv_compound_literals" >&6; } + if test $gl_cv_compound_literals = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_COMPOUND_LITERALS 1 +_ACEOF + + fi + +{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +struct tm *tp; tp->tm_sec; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_struct_tm=sys/time.h +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$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 + +fi + + + { echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5 +echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_tm_tm_gmtoff=yes +else + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_tm_tm_gmtoff=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_tm_tm_gmtoff=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 +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5 +echo "${ECHO_T}$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 + + + + if test -z "$GETOPT_H"; then + +for ac_header in getopt.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + GETOPT_H=getopt.h +fi + +done + + fi + + if test -z "$GETOPT_H"; then + +for ac_func in getopt_long_only +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + GETOPT_H=getopt.h +fi +done + + fi + + if test -z "$GETOPT_H"; then + { echo "$as_me:$LINENO: checking whether optreset is declared" >&5 +echo $ECHO_N "checking whether optreset is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_optreset+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) optreset; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_optreset=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5 +echo "${ECHO_T}$ac_cv_have_decl_optreset" >&6; } +if test $ac_cv_have_decl_optreset = yes; then + GETOPT_H=getopt.h +fi + + fi + + if test -z "$GETOPT_H"; then + { echo "$as_me:$LINENO: checking for working GNU getopt function" >&5 +echo $ECHO_N "checking for working GNU getopt function... $ECHO_C" >&6; } +if test "${gl_cv_func_gnu_getopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + { echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5 +echo $ECHO_N "checking whether getopt_clip is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getopt_clip+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) getopt_clip; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getopt_clip=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getopt_clip" >&6; } +if test $ac_cv_have_decl_getopt_clip = 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 +/* end confdefs.h. */ +#include +int +main () +{ + + char *myargv[3]; + myargv[0] = "conftest"; + myargv[1] = "-+"; + myargv[2] = 0; + return getopt (2, myargv, "+a") != '?'; + + ; + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_gnu_getopt=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5 +echo "${ECHO_T}$gl_cv_func_gnu_getopt" >&6; } + if test "$gl_cv_func_gnu_getopt" = "no"; then + GETOPT_H=getopt.h + fi + fi + + + + + + + + + + + + + + + + + + + + + + + : + + + + + + + if test $ac_cv_header_sys_time_h = yes; then + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_sys_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_sys_time_h" >&5 +echo "${ECHO_T}$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 + + + + { echo "$as_me:$LINENO: checking for struct timeval" >&5 +echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6; } +if test "${gl_cv_sys_struct_timeval+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + +int +main () +{ +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_sys_struct_timeval=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_sys_struct_timeval=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5 +echo "${ECHO_T}$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval = yes; then + HAVE_STRUCT_TIMEVAL=1 + else + HAVE_STRUCT_TIMEVAL=0 + fi + + + REPLACE_GETTIMEOFDAY=0 + + if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then + SYS_TIME_H=sys/time.h + else + SYS_TIME_H= + fi + + + + + +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_off_t=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + + + { echo "$as_me:$LINENO: checking for unsigned long long int" >&5 +echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; } +if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +unsigned long long int ull = 18446744073709551615ULL; + typedef int a[(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); + ; + 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_long_long_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_unsigned_long_long_int=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 +echo "${ECHO_T}$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 + + fi + + + + + + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* 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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_stdint_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_stdint_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_STDINT_H "$gl_cv_absolute_stdint_h" +_ACEOF + + + ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\" + 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 + { echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5 +echo $ECHO_N "checking whether stdint.h conforms to C99... $ECHO_C" >&6; } +if test "${gl_cv_header_working_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #include + #include + #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 +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; +struct s { + int check_PTRDIFF: PTRDIFF_MIN < (ptrdiff_t) 0 && (ptrdiff_t) 0 < PTRDIFF_MAX ? 1 : -1; + int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= (sig_atomic_t) 0 && (sig_atomic_t) 0 < SIG_ATOMIC_MAX ? 1 : -1; + int check_SIZE: (size_t) 0 < SIZE_MAX ? 1 : -1; + int check_WCHAR: WCHAR_MIN <= (wchar_t) 0 && (wchar_t) 0 < WCHAR_MAX ? 1 : -1; + int check_WINT: WINT_MIN <= (wint_t) 0 && (wint_t) 0 < WINT_MAX + && (WINT_MIN < (wint_t) 0 || (wint_t) -1 == (wint_t) WINT_MAX) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_working_stdint_h=yes +else + 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 +{ echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 +echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + else + HAVE_SYS_INTTYPES_H=0 + fi + + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + else + HAVE_SYS_BITYPES_H=0 + fi + + + + + + + + + + + for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do + { echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 +echo $ECHO_N "checking for bit size of $gltype... $ECHO_C" >&6; } +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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. */ + + /* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + 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` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + 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 + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + 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\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (sizeof ($gltype) * CHAR_BIT)) + return 1; + fprintf (f, "%lu\n", i); + } + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + result=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +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 echo '${'gl_cv_bitsizeof_${gltype}'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$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 + + + + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { echo "$as_me:$LINENO: checking whether $gltype is signed" >&5 +echo $ECHO_N "checking whether $gltype is signed... $ECHO_C" >&6; } +if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +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 + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + result=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 echo '${'gl_cv_type_${gltype}_signed'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SIGNED_${GLTYPE} 1 +_ACEOF + + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + + + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + + + + + + + + for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do + { echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 +echo $ECHO_N "checking for $gltype integer literal suffix... $ECHO_C" >&6; } +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >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 + + extern $gltype foo; + extern $gltype1 foo; +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval gl_cv_type_${gltype}_suffix=\$glsuf +else + 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 echo '${'gl_cv_type_${gltype}_suffix'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$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 + + + + STDINT_H=stdint.h + fi + + + + +for ac_header in inttypes.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_inttypes_h = yes; then + { echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 +echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6; } +if test "${gt_cv_inttypes_pri_broken+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 PRId32 +char *p = PRId32; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_inttypes_pri_broken=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gt_cv_inttypes_pri_broken=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 +echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +cat >>confdefs.h <<_ACEOF +#define PRI_MACROS_BROKEN 1 +_ACEOF + + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + + + + { echo "$as_me:$LINENO: checking whether imaxabs is declared" >&5 +echo $ECHO_N "checking whether imaxabs is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_imaxabs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 imaxabs + char *p = (char *) imaxabs; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_imaxabs=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_imaxabs=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_imaxabs" >&5 +echo "${ECHO_T}$ac_cv_have_decl_imaxabs" >&6; } +if test $ac_cv_have_decl_imaxabs = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_IMAXABS 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_IMAXABS 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether imaxdiv is declared" >&5 +echo $ECHO_N "checking whether imaxdiv is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_imaxdiv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) imaxdiv; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_imaxdiv=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_imaxdiv" >&5 +echo "${ECHO_T}$ac_cv_have_decl_imaxdiv" >&6; } +if test $ac_cv_have_decl_imaxdiv = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_IMAXDIV 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_IMAXDIV 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking whether strtoimax is declared" >&5 +echo $ECHO_N "checking whether strtoimax is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strtoimax+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) strtoimax; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strtoimax=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoimax" >&5 +echo "${ECHO_T}$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 + + + + + { echo "$as_me:$LINENO: checking whether strtoumax is declared" >&5 +echo $ECHO_N "checking whether strtoumax is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strtoumax+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) strtoumax; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strtoumax=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoumax" >&5 +echo "${ECHO_T}$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 + + + + + GNULIB_IMAXABS=0; + GNULIB_IMAXDIV=0; + GNULIB_STRTOIMAX=0; + GNULIB_STRTOUMAX=0; + HAVE_DECL_IMAXABS=1; + HAVE_DECL_IMAXDIV=1; + HAVE_DECL_STRTOIMAX=1; + HAVE_DECL_STRTOUMAX=1; + + + + + + + + + { echo "$as_me:$LINENO: checking whether lchown is declared" >&5 +echo $ECHO_N "checking whether lchown is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_lchown+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) lchown; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_lchown=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_lchown=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_lchown" >&5 +echo "${ECHO_T}$ac_cv_have_decl_lchown" >&6; } +if test $ac_cv_have_decl_lchown = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_LCHOWN 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_LCHOWN 0 +_ACEOF + + +fi + + + + + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_STRCASECMP=1; + HAVE_DECL_STRNCASECMP=1; + HAVE_STRCHRNUL=1; + HAVE_DECL_STRDUP=1; + HAVE_STRNDUP=1; + HAVE_DECL_STRNDUP=1; + HAVE_DECL_STRNLEN=1; + HAVE_STRPBRK=1; + HAVE_STRSEP=1; + HAVE_STRCASESTR=1; + HAVE_DECL_STRTOK_R=1; + + + { echo "$as_me:$LINENO: checking whether memrchr is declared" >&5 +echo $ECHO_N "checking whether memrchr is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_memrchr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) memrchr; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_memrchr=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_memrchr" >&5 +echo "${ECHO_T}$ac_cv_have_decl_memrchr" >&6; } +if test $ac_cv_have_decl_memrchr = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MEMRCHR 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MEMRCHR 0 +_ACEOF + + +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +if test "${gt_cv_ssize_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_ssize_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gt_cv_ssize_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 +echo "${ECHO_T}$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +cat >>confdefs.h <<\_ACEOF +#define ssize_t int +_ACEOF + + fi + + + + + + + + + + + + + + + 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; + GNULIB_VASPRINTF=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FFLUSH=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_VASPRINTF=1; + REPLACE_VASPRINTF=0; + HAVE_FSEEKO=1; + REPLACE_FSEEKO=0; + REPLACE_FSEEK=0; + HAVE_FTELLO=1; + REPLACE_FTELLO=0; + REPLACE_FTELL=0; + REPLACE_FFLUSH=0; + + + + + + + + + GNULIB_GETSUBOPT=0; + GNULIB_MKDTEMP=0; + GNULIB_MKSTEMP=0; + HAVE_GETSUBOPT=1; + HAVE_MKDTEMP=1; + REPLACE_MKSTEMP=0; + + + + + + + + + { echo "$as_me:$LINENO: checking whether strdup is declared" >&5 +echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strdup+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) strdup; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strdup=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 +echo "${ECHO_T}$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 + + + + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#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;}'` + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_string_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_string_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_STRING_H "$gl_cv_absolute_string_h" +_ACEOF + + + ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\" + + + + { echo "$as_me:$LINENO: checking whether strndup is declared" >&5 +echo $ECHO_N "checking whether strndup is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strndup+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 strndup + char *p = (char *) strndup; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strndup=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_strndup=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strndup" >&5 +echo "${ECHO_T}$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 + + + + + { echo "$as_me:$LINENO: checking whether strnlen is declared" >&5 +echo $ECHO_N "checking whether strnlen is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strnlen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 strnlen + char *p = (char *) strnlen; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strnlen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_strnlen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strnlen" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strnlen" >&6; } +if test $ac_cv_have_decl_strnlen = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNLEN 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNLEN 0 +_ACEOF + + +fi + + + + + + + + + +{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 +echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; } +if test "${ac_cv_header_stat_broken+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + +#if defined S_ISBLK && defined S_IFDIR +# if S_ISBLK (S_IFDIR) +You lose. +# endif +#endif + +#if defined S_ISBLK && defined S_IFCHR +# if S_ISBLK (S_IFCHR) +You lose. +# endif +#endif + +#if defined S_ISLNK && defined S_IFREG +# if S_ISLNK (S_IFREG) +You lose. +# endif +#endif + +#if defined S_ISSOCK && defined S_IFREG +# if S_ISSOCK (S_IFREG) +You lose. +# endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "You lose" >/dev/null 2>&1; then + ac_cv_header_stat_broken=yes +else + ac_cv_header_stat_broken=no +fi +rm -f conftest* + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 +echo "${ECHO_T}$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 + +fi + + + + + + + + + + + + + + + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRPTIME=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; + + + + + + + + + + : + + + + + + { echo "$as_me:$LINENO: checking for struct timespec in " >&5 +echo $ECHO_N "checking for struct timespec in ... $ECHO_C" >&6; } +if test "${gl_cv_sys_struct_timespec_in_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_sys_struct_timespec_in_time_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_sys_struct_timespec_in_time_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +echo "${ECHO_T}$gl_cv_sys_struct_timespec_in_time_h" >&6; } + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { echo "$as_me:$LINENO: checking for struct timespec in " >&5 +echo $ECHO_N "checking for struct timespec in ... $ECHO_C" >&6; } +if test "${gl_cv_sys_struct_timespec_in_sys_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_sys_struct_timespec_in_sys_time_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_sys_struct_timespec_in_sys_time_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +echo "${ECHO_T}$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + + + + + + + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* 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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_time_h" >&5 +echo "${ECHO_T}$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\" + + + + + + + + + + + { echo "$as_me:$LINENO: checking determine whether the utimes function works" >&5 +echo $ECHO_N "checking determine whether the utimes function works... $ECHO_C" >&6; } +if test "${gl_cv_func_working_utimes+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + 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 +/* end confdefs.h. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main () +{ + static struct timeval timeval[2] = {{9, 10}, {999999, 999999}}; + struct stat sbuf; + char const *file = "conftest.utimes"; + FILE *f; + time_t now; + int fd; + + int ok = ((f = fopen (file, "w")) + && fclose (f) == 0 + && utimes (file, timeval) == 0 + && lstat (file, &sbuf) == 0 + && sbuf.st_atime == timeval[0].tv_sec + && sbuf.st_mtime == timeval[1].tv_sec); + unlink (file); + if (!ok) + exit (1); + + ok = + ((f = fopen (file, "w")) + && fclose (f) == 0 + && time (&now) != (time_t)-1 + && utimes (file, NULL) == 0 + && lstat (file, &sbuf) == 0 + && now - sbuf.st_atime <= 2 + && now - sbuf.st_mtime <= 2); + unlink (file); + if (!ok) + exit (1); + + ok = (0 <= (fd = open (file, O_WRONLY|O_CREAT, 0444)) + && close (fd) == 0 + && utimes (file, NULL) == 0); + unlink (file); + + exit (!ok); +} + +_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_working_utimes=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_working_utimes" >&5 +echo "${ECHO_T}$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 + + fi + + + + + + + + + + : + + + + + + + + + { echo "$as_me:$LINENO: checking for struct utimbuf" >&5 +echo $ECHO_N "checking for struct utimbuf... $ECHO_C" >&6; } +if test "${gl_cv_sys_struct_utimbuf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_sys_struct_utimbuf=yes +else + 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 +{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_utimbuf" >&5 +echo "${ECHO_T}$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 + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 +echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6; } +if test "${ac_cv_decl_EOVERFLOW+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 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 + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + 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` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + 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 + 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. */ + +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + 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\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (EOVERFLOW)) + return 1; + fprintf (f, "%lu\n", i); + } + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_decl_EOVERFLOW=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +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 +{ echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5 +echo "${ECHO_T}$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" + + fi + + + + + + + + + { echo "$as_me:$LINENO: checking for wchar_t" >&5 +echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } +if test "${gt_cv_c_wchar_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + wchar_t foo = (wchar_t)'\0'; +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_c_wchar_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gt_cv_c_wchar_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 +echo "${ECHO_T}$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 + + fi + + + { echo "$as_me:$LINENO: checking for wint_t" >&5 +echo $ECHO_N "checking for wint_t... $ECHO_C" >&6; } +if test "${gt_cv_c_wint_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_c_wint_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gt_cv_c_wint_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 +echo "${ECHO_T}$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 + + fi + +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + + { echo "$as_me:$LINENO: checking for inttypes.h" >&5 +echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } +if test "${gl_cv_header_inttypes_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_inttypes_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_header_inttypes_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 +echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + { echo "$as_me:$LINENO: checking for stdint.h" >&5 +echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } +if test "${gl_cv_header_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_stdint_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_header_stdint_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 +echo "${ECHO_T}$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + + 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 + + + + + { echo "$as_me:$LINENO: checking for intmax_t" >&5 +echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } +if test "${gt_cv_c_intmax_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif + +int +main () +{ +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_c_intmax_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gt_cv_c_intmax_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 +echo "${ECHO_T}$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 + + else + + test $ac_cv_type_long_long = yes \ + && ac_type='long long' \ + || ac_type='long' + +cat >>confdefs.h <<_ACEOF +#define intmax_t $ac_type +_ACEOF + + fi + + + { echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 +echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_vsnprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 vsnprintf + char *p = (char *) vsnprintf; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_vsnprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_vsnprintf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6; } +if test $ac_cv_have_decl_vsnprintf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 0 +_ACEOF + + +fi + + + + + + + + + + + + + + + + + +for ac_header in stdint.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + { echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 +echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6; } + if test "${gl_cv_size_max+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + gl_cv_size_max= + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 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. */ +#include +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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. */ +#include +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + 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` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + 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 int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) < 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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. */ +#include +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + 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 + 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. */ +#include +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + 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 +?*) size_t_bits_minus_1=$ac_lo;; +'') size_t_bits_minus_1= ;; +esac +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 +static long int longval () { return sizeof (size_t) * CHAR_BIT - 1; } +static unsigned long int ulongval () { return sizeof (size_t) * CHAR_BIT - 1; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((sizeof (size_t) * CHAR_BIT - 1) < 0) + { + long int i = longval (); + if (i != (sizeof (size_t) * CHAR_BIT - 1)) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (sizeof (size_t) * CHAR_BIT - 1)) + return 1; + fprintf (f, "%lu\n", i); + } + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + size_t_bits_minus_1=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +size_t_bits_minus_1= +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 + 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. */ +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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. */ +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + 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` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + 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 int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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. */ +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + 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 + 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. */ +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + 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 +?*) fits_in_uint=$ac_lo;; +'') fits_in_uint= ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +static long int longval () { return sizeof (size_t) <= sizeof (unsigned int); } +static unsigned long int ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) + { + long int i = longval (); + if (i != (sizeof (size_t) <= sizeof (unsigned int))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (sizeof (size_t) <= sizeof (unsigned int))) + return 1; + fprintf (f, "%lu\n", i); + } + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + fits_in_uint=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +fits_in_uint= +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 + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + extern size_t foo; + extern unsigned long foo; + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + fits_in_uint=0 +else + 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 + 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 + + { echo "$as_me:$LINENO: result: $gl_cv_size_max" >&5 +echo "${ECHO_T}$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 + + + + + + if false; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' +else + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= +fi + + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_source_base='.#bootmp/lib' + + + + + + if test $ac_cv_func_alloca_works = no; then + : + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + { echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5 +echo $ECHO_N "checking for alloca as a compiler built-in... $ECHO_C" >&6; } +if test "${gl_cv_rpl_alloca+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Need own alloca" >/dev/null 2>&1; then + gl_cv_rpl_alloca=yes +else + gl_cv_rpl_alloca=no +fi +rm -f conftest* + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5 +echo "${ECHO_T}$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF + + ALLOCA_H=alloca.h + else + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA_H 1 +_ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS argmatch.$ac_objext" + + + + + + + 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 + + + + + + : + + + + + + + + + { echo "$as_me:$LINENO: checking whether program_invocation_name is declared" >&5 +echo $ECHO_N "checking whether program_invocation_name is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_program_invocation_name+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 program_invocation_name + char *p = (char *) program_invocation_name; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_program_invocation_name=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_program_invocation_name=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_program_invocation_name" >&5 +echo "${ECHO_T}$ac_cv_have_decl_program_invocation_name" >&6; } +if test $ac_cv_have_decl_program_invocation_name = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DECL_PROGRAM_INVOCATION_NAME 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +#define GNULIB_PROGRAM_INVOCATION_NAME 1 +_ACEOF + +fi + + { echo "$as_me:$LINENO: checking whether program_invocation_short_name is declared" >&5 +echo $ECHO_N "checking whether program_invocation_short_name is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_program_invocation_short_name+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 program_invocation_short_name + char *p = (char *) program_invocation_short_name; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_program_invocation_short_name=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_program_invocation_short_name=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_program_invocation_short_name" >&5 +echo "${ECHO_T}$ac_cv_have_decl_program_invocation_short_name" >&6; } +if test $ac_cv_have_decl_program_invocation_short_name = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +#define GNULIB_PROGRAM_INVOCATION_SHORT_NAME 1 +_ACEOF + +fi + + + # Check if program_invocation_name and program_invocation_short_name + # are defined elsewhere. It is improbable that only one of them will + # be defined and other not, I prefer to stay on the safe side and to + # test each one separately. + { echo "$as_me:$LINENO: checking whether program_invocation_name is defined" >&5 +echo $ECHO_N "checking whether program_invocation_name is defined... $ECHO_C" >&6; } + 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 () +{ + program_invocation_name = "test"; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PROGRAM_INVOCATION_NAME 1 +_ACEOF + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + { echo "$as_me:$LINENO: checking whether program_invocation_short_name is defined" >&5 +echo $ECHO_N "checking whether program_invocation_short_name is defined... $ECHO_C" >&6; } + 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 () +{ + program_invocation_short_name = "test"; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PROGRAM_INVOCATION_SHORT_NAME 1 +_ACEOF + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + + + + : + + + + + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_canonicalize_file_name = no; then + gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext" + +cat >>confdefs.h <<\_ACEOF +#define realpath rpl_realpath +_ACEOF + + + + : + + + + + + + + + + : + + + + + + + + + + fi + + + { echo "$as_me:$LINENO: checking whether this system has an arbitrary file name length limit" >&5 +echo $ECHO_N "checking whether this system has an arbitrary file name length limit... $ECHO_C" >&6; } +if test "${gl_cv_have_arbitrary_file_name_length_limit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#if defined PATH_MAX || defined MAXPATHLEN +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 + gl_cv_have_arbitrary_file_name_length_limit=yes +else + gl_cv_have_arbitrary_file_name_length_limit=no +fi +rm -f conftest* + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5 +echo "${ECHO_T}$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" + + : + + fi + + + + + + + + if test $ac_cv_func_chown_works = no; then + +cat >>confdefs.h <<\_ACEOF +#define CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE 1 +_ACEOF + + fi + + # If chown has either of the above problems, then we need the wrapper. + if test $ac_cv_func_chown_works$gl_cv_func_chown_follows_symlink = yesyes; then + : # no wrapper needed + else + REPLACE_CHOWN=1 + gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext" + + { echo "$as_me:$LINENO: checking for fchown" >&5 +echo $ECHO_N "checking for fchown... $ECHO_C" >&6; } +if test "${ac_cv_func_fchown+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fchown=yes +else + 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$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_fchown" >&5 +echo "${ECHO_T}$ac_cv_func_fchown" >&6; } +if test $ac_cv_func_fchown = yes; then + : +else + gl_LIBOBJS="$gl_LIBOBJS fchown-stub.$ac_objext" +fi + + + fi + + + + GNULIB_CHOWN=1 + + + + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + gl_saved_libs=$LIBS + { echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5 +echo $ECHO_N "checking for library containing clock_gettime... $ECHO_C" >&6; } +if test "${ac_cv_search_clock_gettime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4; 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_clock_gettime=$ac_res +else + 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 + if test "${ac_cv_search_clock_gettime+set}" = set; then + break +fi +done +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 +{ echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5 +echo "${ECHO_T}$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +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=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + LIBS=$gl_saved_libs + + + gl_LIBOBJS="$gl_LIBOBJS close-stream.$ac_objext" + + : + + + +cat >>confdefs.h <<\_ACEOF +#define GNULIB_CLOSE_STREAM 1 +_ACEOF + + + + gl_LIBOBJS="$gl_LIBOBJS closeout.$ac_objext" + + : + + { echo "$as_me:$LINENO: checking for d_ino member in directory struct" >&5 +echo $ECHO_N "checking for d_ino member in directory struct... $ECHO_C" >&6; } +if test "${gl_cv_struct_dirent_d_ino+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + gl_cv_struct_dirent_d_ino=no +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 + #include + +int +main () +{ +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_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_struct_dirent_d_ino=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_struct_dirent_d_ino" >&5 +echo "${ECHO_T}$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 + + fi + + + + + + +for ac_func in dirfd +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + { echo "$as_me:$LINENO: checking whether dirfd is declared" >&5 +echo $ECHO_N "checking whether dirfd is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_dirfd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +#ifndef dirfd + char *p = (char *) dirfd; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_dirfd=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_dirfd=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_dirfd" >&5 +echo "${ECHO_T}$ac_cv_have_decl_dirfd" >&6; } +if test $ac_cv_have_decl_dirfd = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_DIRFD 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_DIRFD 0 +_ACEOF + + +fi + + + + { echo "$as_me:$LINENO: checking whether dirfd is a macro" >&5 +echo $ECHO_N "checking whether dirfd is a macro... $ECHO_C" >&6; } +if test "${gl_cv_func_dirfd_macro+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#ifdef dirfd + dirent_header_defines_dirfd +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then + gl_cv_func_dirfd_macro=yes +else + gl_cv_func_dirfd_macro=no +fi +rm -f conftest* + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_dirfd_macro" >&5 +echo "${ECHO_T}$gl_cv_func_dirfd_macro" >&6; } + + # Use the replacement only if we have no function, macro, + # or declaration with that name. + 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=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + { echo "$as_me:$LINENO: checking how to get the file descriptor associated with an open DIR*" >&5 +echo $ECHO_N "checking how to get the file descriptor associated with an open DIR*... $ECHO_C" >&6; } +if test "${gl_cv_sys_dir_fd_member_name+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + dirfd_save_CFLAGS=$CFLAGS + 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 +/* end confdefs.h. */ +#include + #include +int +main () +{ +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + dir_fd_found=yes + +else + 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 + done + test "$dir_fd_found" = yes || ac_expr=no_such_member + + gl_cv_sys_dir_fd_member_name=$ac_expr + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_sys_dir_fd_member_name" >&5 +echo "${ECHO_T}$gl_cv_sys_dir_fd_member_name" >&6; } + if test $gl_cv_sys_dir_fd_member_name != no_such_member; then + +cat >>confdefs.h <<_ACEOF +#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name +_ACEOF + + fi + + + fi + + + gl_LIBOBJS="$gl_LIBOBJS basename.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS dirname.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS stripslash.$ac_objext" + + + + + + + + { echo "$as_me:$LINENO: checking whether // is distinct from /" >&5 +echo $ECHO_N "checking whether // is distinct from /... $ECHO_C" >&6; } +if test "${gl_cv_double_slash_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + 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 + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi +fi +{ echo "$as_me:$LINENO: result: $gl_cv_double_slash_root" >&5 +echo "${ECHO_T}$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 + + fi + + + + + : + + + + + + if test $ac_cv_func_dup2 = no; then + HAVE_DUP2=0 + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + fi + + + + GNULIB_DUP2=1 + + + { echo "$as_me:$LINENO: checking for error_at_line" >&5 +echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6; } +if test "${ac_cv_lib_error_at_line+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +error_at_line (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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_error_at_line=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_error_at_line=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 +echo "${ECHO_T}$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 + + + + : + + + + 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" + : + +cat >>confdefs.h <<\_ACEOF +#define FCHDIR_REPLACEMENT 1 +_ACEOF + + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_dirent_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + : + + + + + 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 +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_dirent_h" >&5 +echo "${ECHO_T}$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= + fi + + + + + + GNULIB_FCHDIR=1 + + + { echo "$as_me:$LINENO: checking for working fcntl.h" >&5 +echo $ECHO_N "checking for working fcntl.h... $ECHO_C" >&6; } +if test "${gl_cv_header_working_fcntl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +/* end confdefs.h. */ +#include + #include + #include + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + +int +main () +{ + + int status = !constants; + { + static char const sym[] = "conftest.sym"; + if (symlink (".", sym) != 0 + || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) + status |= 32; + } + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + char c; + struct stat st0, st1; + if (fd < 0 + || fstat (fd, &st0) != 0 + || sleep (1) != 0 + || read (fd, &c, 1) != 1 + || close (fd) != 0 + || stat (file, &st1) != 0 + || st0.st_atime != st1.st_atime) + status |= 64; + } + return status; + ; + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_working_fcntl_h=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_working_fcntl_h" >&5 +echo "${ECHO_T}$gl_cv_header_working_fcntl_h" >&6; } + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_O_NOATIME $ac_val +_ACEOF + + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_O_NOFOLLOW $ac_val +_ACEOF + + + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_fcntl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* 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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_fcntl_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_fcntl_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_FCNTL_H "$gl_cv_absolute_fcntl_h" +_ACEOF + + + 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 +_ACEOF + + + + { echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 +echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_blocks=yes +else + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_blocks=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6; } +if test $ac_cv_member_struct_stat_st_blocks = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ST_BLOCKS 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS fileblocks.$ac_objext" +fi + + + if test $ac_cv_member_struct_stat_st_blocks = no; then + + + : + + + + + + : + + fi + + + + + FLOAT_H= + case "$host_os" in + beos*) + FLOAT_H=float.h + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_float_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + : + + + + + if test $ac_cv_header_float_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_float_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | +sed -n '\#/float.h#{s#.*"\(.*/float.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_float_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_float_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_FLOAT_H "$gl_cv_absolute_float_h" +_ACEOF + + + ABSOLUTE_FLOAT_H=\"$gl_cv_absolute_float_h\" + + ;; + esac + + + # No macro. You should also use one of fnmatch-posix or fnmatch-gnu. + + + + FNMATCH_H= + { echo "$as_me:$LINENO: checking for working GNU fnmatch" >&5 +echo $ECHO_N "checking for working GNU fnmatch... $ECHO_C" >&6; } +if test "${ac_cv_func_fnmatch_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_fnmatch_gnu=cross +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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; + } + +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fnmatch_gnu=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +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 +{ echo "$as_me:$LINENO: result: $ac_cv_func_fnmatch_gnu" >&5 +echo "${ECHO_T}$ac_cv_func_fnmatch_gnu" >&6; } +if test $ac_cv_func_fnmatch_gnu = yes; then + rm -f lib/fnmatch.h +else + { echo "$as_me:$LINENO: checking whether isblank is declared" >&5 +echo $ECHO_N "checking whether isblank is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isblank+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) isblank; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_isblank=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isblank" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isblank" >&6; } +if test $ac_cv_have_decl_isblank = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISBLANK 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISBLANK 0 +_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 + + + + + : + + + + + + +for ac_func in __fpending +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `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 +' + { echo "$as_me:$LINENO: checking whether __fpending is declared" >&5 +echo $ECHO_N "checking whether __fpending is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl___fpending+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +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 + char *p = (char *) __fpending; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl___fpending=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl___fpending=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl___fpending" >&5 +echo "${ECHO_T}$ac_cv_have_decl___fpending" >&6; } +if test $ac_cv_have_decl___fpending = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL___FPENDING 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL___FPENDING 0 +_ACEOF + + +fi + + + if test $ac_cv_func___fpending = no; then + { echo "$as_me:$LINENO: checking how to determine the number of pending output bytes on a stream" >&5 +echo $ECHO_N "checking how to determine the number of pending output bytes on a stream... $ECHO_C" >&6; } +if test "${ac_cv_sys_pending_output_n_bytes+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 \ + ; 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 +/* end confdefs.h. */ +#include + +int +main () +{ +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + fp_done=yes + +else + 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 + + ac_cv_sys_pending_output_n_bytes=$ac_expr + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_pending_output_n_bytes" >&5 +echo "${ECHO_T}$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 + + fi + + + + + + gl_abort_bug=no + case $gl_cv_func_getcwd_null in + yes) + + + : + + + + + + + { echo "$as_me:$LINENO: checking whether getcwd handles long file names properly" >&5 +echo $ECHO_N "checking whether getcwd handles long file names properly... $ECHO_C" >&6; } +if test "${gl_cv_func_getcwd_path_max+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + 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 +/* end confdefs.h. */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef AT_FDCWD +# define AT_FDCWD 0 +#endif +#ifdef ENAMETOOLONG +# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG) +#else +# define is_ENAMETOOLONG(x) 0 +#endif + +/* Don't get link errors because mkdir is redefined to rpl_mkdir. */ +#undef mkdir + +#ifndef S_IRWXU +# define S_IRWXU 0700 +#endif + +/* The length of this name must be 8. */ +#define DIR_NAME "confdir3" +#define DIR_NAME_LEN 8 +#define DIR_NAME_SIZE (DIR_NAME_LEN + 1) + +/* The length of "../". */ +#define DOTDOTSLASH_LEN 3 + +/* Leftover bytes in the buffer, to work around library or OS bugs. */ +#define BUF_SLOP 20 + +int +main () +{ +#ifndef PATH_MAX + /* The Hurd doesn't define this, so getcwd can't exhibit the bug -- + at least not on a local file system. And if we were to start worrying + about remote file systems, we'd have to enable the wrapper function + all of the time, just to be safe. That's not worth the cost. */ + exit (0); +#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \ + - DIR_NAME_SIZE - BUF_SLOP) \ + <= PATH_MAX) + /* FIXME: Assuming there's a system for which this is true, + this should be done in a compile test. */ + exit (0); +#else + char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) + + DIR_NAME_SIZE + BUF_SLOP]; + char *cwd = getcwd (buf, PATH_MAX); + size_t initial_cwd_len; + size_t cwd_len; + int fail = 0; + size_t n_chdirs = 0; + + if (cwd == NULL) + exit (1); + + cwd_len = initial_cwd_len = strlen (cwd); + + while (1) + { + size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN); + char *c = NULL; + + cwd_len += DIR_NAME_SIZE; + /* If mkdir or chdir fails, it could be that this system cannot create + any file with an absolute name longer than PATH_MAX, such as cygwin. + If so, leave fail as 0, because the current working directory can't + be too long for getcwd if it can't even be created. For other + errors, be pessimistic and consider that as a failure, too. */ + if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0) + { + if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) + fail = 2; + break; + } + + if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE) + { + c = getcwd (buf, PATH_MAX); + if (!c && errno == ENOENT) + { + fail = 1; + break; + } + if (c || ! (errno == ERANGE || is_ENAMETOOLONG (errno))) + { + fail = 2; + break; + } + } + + if (dotdot_max <= cwd_len - initial_cwd_len) + { + if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len) + break; + c = getcwd (buf, cwd_len + 1); + if (!c) + { + if (! (errno == ERANGE || errno == ENOENT + || is_ENAMETOOLONG (errno))) + { + fail = 2; + break; + } + if (AT_FDCWD || errno == ERANGE || errno == ENOENT) + { + fail = 1; + break; + } + } + } + + if (c && strlen (c) != cwd_len) + { + fail = 2; + break; + } + ++n_chdirs; + } + + /* Leaving behind such a deep directory is not polite. + So clean up here, right away, even though the driving + shell script would also clean up. */ + { + size_t i; + + /* Try rmdir first, in case the chdir failed. */ + rmdir (DIR_NAME); + for (i = 0; i <= n_chdirs; i++) + { + if (chdir ("..") < 0) + break; + if (rmdir (DIR_NAME) != 0) + break; + } + } + + exit (fail); +#endif +} + +_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_getcwd_path_max=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_getcwd_path_max" >&5 +echo "${ECHO_T}$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 +;; + esac + + + + : + + + + + + +for ac_func in getpagesize +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + { echo "$as_me:$LINENO: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5 +echo $ECHO_N "checking whether getcwd aborts when 4k < cwd_length < 16k... $ECHO_C" >&6; } +if test "${gl_cv_func_getcwd_abort_bug+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + 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 +/* end confdefs.h. */ + +#include +#include +#include +#include +#include + +/* Don't get link errors because mkdir is redefined to rpl_mkdir. */ +#undef mkdir + +#ifndef S_IRWXU +# define S_IRWXU 0700 +#endif + +/* FIXME: skip the run-test altogether on systems without getpagesize. */ +#if ! HAVE_GETPAGESIZE +# define getpagesize() 0 +#endif + +/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than + the 16kB pagesize on ia64 linux. Those conditions make the code below + trigger a bug in glibc's getcwd implementation before 2.4.90-10. */ +#define TARGET_LEN (5 * 1024) + +int +main () +{ + char const *dir_name = "confdir-14B---"; + char *cwd; + size_t initial_cwd_len; + int fail = 0; + size_t desired_depth; + size_t d; + + /* The bug is triggered when PATH_MAX < getpagesize (), so skip + this relative expensive and invasive test if that's not true. */ + if (getpagesize () <= PATH_MAX) + return 0; + + cwd = getcwd (NULL, 0); + if (cwd == NULL) + return 0; + + initial_cwd_len = strlen (cwd); + free (cwd); + desired_depth = ((TARGET_LEN - 1 - initial_cwd_len) + / (1 + strlen (dir_name))); + for (d = 0; d < desired_depth; d++) + { + if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0) + { + fail = 3; /* Unable to construct deep hierarchy. */ + break; + } + } + + /* If libc has the bug in question, this invocation of getcwd + results in a failed assertion. */ + cwd = getcwd (NULL, 0); + if (cwd == NULL) + fail = 4; /* getcwd failed. This is ok, and expected. */ + free (cwd); + + /* Call rmdir first, in case the above chdir failed. */ + rmdir (dir_name); + while (0 < d--) + { + if (chdir ("..") < 0) + break; + rmdir (dir_name); + } + + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_getcwd_abort_bug=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_getcwd_abort_bug" >&5 +echo "${ECHO_T}$gl_cv_func_getcwd_abort_bug" >&6; } + if test $gl_cv_func_getcwd_abort_bug = yes; then + gl_abort_bug=yes +fi + +;; + esac + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in + yes,yes,no) ;; + *) + REPLACE_GETCWD=1 + gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext" + + + + : +;; + esac + + + + GNULIB_GETCWD=1 + + + + + + + + { echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_tm_tm_zone=yes +else + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_tm_tm_zone=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } +if test $ac_cv_member_struct_tm_tm_zone = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TM_TM_ZONE 1 +_ACEOF + + +fi + +if test "$ac_cv_member_struct_tm_tm_zone" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_TM_ZONE 1 +_ACEOF + +else + { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_tzname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 tzname + char *p = (char *) tzname; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_tzname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_tzname=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } +if test $ac_cv_have_decl_tzname = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TZNAME 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TZNAME 0 +_ACEOF + + +fi + + + { echo "$as_me:$LINENO: checking for tzname" >&5 +echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } +if test "${ac_cv_var_tzname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#if !HAVE_DECL_TZNAME +extern char *tzname[]; +#endif + +int +main () +{ +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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_var_tzname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_var_tzname=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +echo "${ECHO_T}$ac_cv_var_tzname" >&6; } + if test $ac_cv_var_tzname = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_TZNAME 1 +_ACEOF + + fi +fi + + + + + + + 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 + + + + + + : + + + + + + + +fi + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettime.$ac_objext" + + + + + : + + + + + + + + + + + + + + : + + + + + + + { echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5 +echo $ECHO_N "checking for gettimeofday with POSIX signature... $ECHO_C" >&6; } +if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + struct timeval c; + +int +main () +{ + + int (*f) (struct timeval *restrict, void *restrict) = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_gettimeofday_posix_signature=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_func_gettimeofday_posix_signature=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +echo "${ECHO_T}$gl_cv_func_gettimeofday_posix_signature" >&6; } + + + + + { echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5 +echo $ECHO_N "checking whether gettimeofday clobbers localtime buffer... $ECHO_C" >&6; } +if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main () +{ + + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_gettimeofday_clobber=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5 +echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in _ftime +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +cat >>confdefs.h <<\_ACEOF +#define gmtime rpl_gmtime +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define localtime rpl_localtime +_ACEOF + + + +cat >>confdefs.h <<\_ACEOF +#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1 +_ACEOF + + fi + + + if test $gl_cv_func_gettimeofday_posix_signature != yes; then + 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in _ftime +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + fi + fi + + + gl_LIBOBJS="$gl_LIBOBJS hash.$ac_objext" + + + + + + { echo "$as_me:$LINENO: checking whether the compiler generally respects inline" >&5 +echo $ECHO_N "checking whether the compiler generally respects inline... $ECHO_C" >&6; } +if test "${gl_cv_c_inline_effective+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ + +int +main () +{ +#ifdef __NO_INLINE__ + #error "inline is not effective" + #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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_c_inline_effective=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_c_inline_effective=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_c_inline_effective" >&5 +echo "${ECHO_T}$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_INLINE 1 +_ACEOF + + 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" + + + + : + + : + : + : + : + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + { echo "$as_me:$LINENO: checking whether inttypes.h conforms to C99" >&5 +echo $ECHO_N "checking whether inttypes.h conforms to C99... $ECHO_C" >&6; } +if test "${gl_cv_header_working_inttypes_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gl_cv_header_working_inttypes_h=no + if test "$gl_cv_header_working_stdint_h" = yes \ + && test $ac_cv_header_inttypes_h = yes \ + && test "$ac_cv_have_decl_imaxabs" = yes \ + && 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 +/* 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 + +/* No need to duplicate the tests of stdint.m4; they are subsumed by + $gl_cv_header_working_stdint_h = yes. */ + +/* Tests for macros supposed to be defined in inttypes.h. */ + +const char *k = /* implicit string concatenation */ +#ifdef INT8_MAX + PRId8 PRIi8 +#endif +#ifdef UINT8_MAX + PRIo8 PRIu8 PRIx8 PRIX8 +#endif +#ifdef INT16_MAX + PRId16 PRIi16 +#endif +#ifdef UINT16_MAX + PRIo16 PRIu16 PRIx16 PRIX16 +#endif +#ifdef INT32_MAX + PRId32 PRIi32 +#endif +#ifdef UINT32_MAX + PRIo32 PRIu32 PRIx32 PRIX32 +#endif +#ifdef INT64_MAX + PRId64 PRIi64 +#endif +#ifdef UINT64_MAX + PRIo64 PRIu64 PRIx64 PRIX64 +#endif + PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8 + PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16 + PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32 + PRIdLEAST64 PRIiLEAST64 + PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64 + PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8 + PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16 + PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32 + PRIdFAST64 PRIiFAST64 + PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64 + PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX +#ifdef INTPTR_MAX + PRIdPTR PRIiPTR +#endif +#ifdef UINTPTR_MAX + PRIoPTR PRIuPTR PRIxPTR PRIXPTR +#endif + ; +const char *l = /* implicit string concatenation */ +#ifdef INT8_MAX + SCNd8 SCNi8 +#endif +#ifdef UINT8_MAX + SCNo8 SCNu8 SCNx8 +#endif +#ifdef INT16_MAX + SCNd16 SCNi16 +#endif +#ifdef UINT16_MAX + SCNo16 SCNu16 SCNx16 +#endif +#ifdef INT32_MAX + SCNd32 SCNi32 +#endif +#ifdef UINT32_MAX + SCNo32 SCNu32 SCNx32 +#endif +#ifdef INT64_MAX + SCNd64 SCNi64 +#endif +#ifdef UINT64_MAX + SCNo64 SCNu64 SCNx64 +#endif + SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8 + SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16 + SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32 + SCNdLEAST64 SCNiLEAST64 + SCNoLEAST64 SCNuLEAST64 SCNxLEAST64 + SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8 + SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16 + SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32 + SCNdFAST64 SCNiFAST64 + SCNoFAST64 SCNuFAST64 SCNxFAST64 + SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX +#ifdef INTPTR_MAX + SCNdPTR SCNiPTR +#endif +#ifdef UINTPTR_MAX + SCNoPTR SCNuPTR SCNxPTR +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_working_inttypes_h=yes +else + 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 +{ echo "$as_me:$LINENO: result: $gl_cv_header_working_inttypes_h" >&5 +echo "${ECHO_T}$gl_cv_header_working_inttypes_h" >&6; } + + if false && test $gl_cv_header_working_inttypes_h = yes; then + INTTYPES_H='' + else + + + if test $ac_cv_header_inttypes_h = yes; then + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_inttypes_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* 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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_inttypes_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_inttypes_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_INTTYPES_H "$gl_cv_absolute_inttypes_h" +_ACEOF + + + ABSOLUTE_INTTYPES_H=\"$gl_cv_absolute_inttypes_h\" + else + ABSOLUTE_INTTYPES_H=\"no/such/file/inttypes.h\" + fi + + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + PRIPTR_PREFIX='"l"' + else + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + 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 +/* end confdefs.h. */ +#include + extern intptr_t foo; + extern $gltype1 foo; +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + PRIPTR_PREFIX='"'$glpfx'"' +else + 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 + fi + + + if test "$ac_cv_have_decl_imaxabs" = yes; then + HAVE_DECL_IMAXABS=1 + else + HAVE_DECL_IMAXABS=0 + fi + + if test "$ac_cv_have_decl_imaxdiv" = yes; then + HAVE_DECL_IMAXDIV=1 + else + HAVE_DECL_IMAXDIV=0 + fi + + if test "$ac_cv_have_decl_strtoimax" = yes; then + HAVE_DECL_STRTOIMAX=1 + else + HAVE_DECL_STRTOIMAX=0 + fi + + if test "$ac_cv_have_decl_strtoumax" = yes; then + HAVE_DECL_STRTOUMAX=1 + else + HAVE_DECL_STRTOUMAX=0 + fi + + INTTYPES_H='inttypes.h' + fi + + + + + + + : + + + + + + +for ac_func in lchown +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + + + { echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 +echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; } +if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >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 () +{ +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 +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +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 +{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +echo "${ECHO_T}$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 + + : + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 STDC_HEADERS || HAVE_STDLIB_H +# include +#else +char *malloc (); +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +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 +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 0 +_ACEOF + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + +cat >>confdefs.h <<\_ACEOF +#define malloc rpl_malloc +_ACEOF + +fi + + + + + + + + + + +for ac_func in mempcpy +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + if test $ac_cv_func_mempcpy = no; then + HAVE_MEMPCPY=0 + + : + + fi + + + + GNULIB_MEMPCPY=1 + + + + + + + : + + + + + + if test $ac_cv_have_decl_memrchr = no; then + HAVE_DECL_MEMRCHR=0 + fi + + +for ac_func in memrchr +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + if test $ac_cv_func_memrchr = no; then + : + fi + + + + GNULIB_MEMRCHR=1 + + + + : + + + + + + + : + + + + + +{ echo "$as_me:$LINENO: checking for working mktime" >&5 +echo $ECHO_N "checking for working mktime... $ECHO_C" >&6; } +if test "${ac_cv_func_working_mktime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef HAVE_ALARM +# define alarm(X) /* empty */ +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static char *tz_strings[] = { + (char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (now) + time_t now; +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (now) + time_t now; +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (j) + int j; +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + time_t t, delta; + int i, j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + alarm (60); + + for (;;) + { + t = (time_t_max << 1) + 1; + if (t <= time_t_max) + break; + time_t_max = t; + } + time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) + if (! mktime_test (t)) + return 1; + if (! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + return 1; + + for (j = 1; ; j <<= 1) + if (! bigtime_test (j)) + return 1; + else if (INT_MAX / 2 < j) + break; + if (! bigtime_test (INT_MAX)) + return 1; + } + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_working_mktime=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5 +echo "${ECHO_T}$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 + + + + + fi + + { echo "$as_me:$LINENO: checking for obstacks" >&5 +echo $ECHO_N "checking for obstacks... $ECHO_C" >&6; } +if test "${ac_cv_func_obstack+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "obstack.h" +int +main () +{ +struct obstack *mem; obstack_free(mem,(char *) 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_obstack=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_obstack=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_obstack" >&5 +echo "${ECHO_T}$ac_cv_func_obstack" >&6; } +if test $ac_cv_func_obstack = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_OBSTACK 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS obstack.$ac_objext" +fi + + + gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext" + + + : + + + + + + + : + + + + + + + + +for ac_func in fchmodat mkdirat openat +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + 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";; + *) + +cat >>confdefs.h <<\_ACEOF +#define __OPENAT_PREFIX rpl_ +_ACEOF + + + : +;; + esac + + # Assume we'll use the replacement function. + # The only case in which we won't is when we have fchownat, and it works. + use_replacement_fchownat=yes + + { echo "$as_me:$LINENO: checking for fchownat" >&5 +echo $ECHO_N "checking for fchownat... $ECHO_C" >&6; } +if test "${ac_cv_func_fchownat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fchownat=yes +else + 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$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_fchownat" >&5 +echo "${ECHO_T}$ac_cv_func_fchownat" >&6; } +if test $ac_cv_func_fchownat = yes; then + have_fchownat=yes +else + have_fchownat=no +fi + + if test $have_fchownat = yes; then + + { echo "$as_me:$LINENO: checking whether fchownat works with AT_SYMLINK_NOFOLLOW" >&5 +echo $ECHO_N "checking whether fchownat works with AT_SYMLINK_NOFOLLOW... $ECHO_C" >&6; } +if test "${gl_cv_func_fchownat_nofollow_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + gl_dangle=conftest.dangle + # Remove any remnants of a previous test. + rm -f $gl_dangle + # Arrange for deletion of the temporary file this test creates. + ac_clean_files="$ac_clean_files $gl_dangle" + 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 +/* end confdefs.h. */ + +#include +#include +#include +#include +#include +int +main () +{ + return (fchownat (AT_FDCWD, "$gl_dangle", -1, getgid (), + AT_SYMLINK_NOFOLLOW) != 0 + && errno == ENOENT); +} + +_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_fchownat_nofollow_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_fchownat_nofollow_works" >&5 +echo "${ECHO_T}$gl_cv_func_fchownat_nofollow_works" >&6; } + if test $gl_cv_func_fchownat_nofollow_works = no; then + : +else + 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 + + fi + + + + + : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS quote.$ac_objext" + + + + gl_LIBOBJS="$gl_LIBOBJS quotearg.$ac_objext" + + + : + + + + + + { echo "$as_me:$LINENO: checking for mbstate_t" >&5 +echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6; } +if test "${ac_cv_type_mbstate_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_mbstate_t=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 +echo "${ECHO_T}$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 + + { echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 +echo $ECHO_N "checking whether mbrtowc and mbstate_t are properly declared... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc=yes +else + 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$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc" >&5 +echo "${ECHO_T}$gl_cv_func_mbrtowc" >&6; } + if test $gl_cv_func_mbrtowc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MBRTOWC 1 +_ACEOF + + fi + + + + + + : + + + + + + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + : + + fi + + + + GNULIB_READLINK=1 + + + gl_LIBOBJS="$gl_LIBOBJS safe-read.$ac_objext" + + + + + + + gl_LIBOBJS="$gl_LIBOBJS safe-write.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS save-cwd.$ac_objext" + + : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS savedir.$ac_objext" + + + + : + + + + + + if test $ac_cv_func_setenv = no; then + gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" + + + + : + + + + + + +for ac_header in search.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in tsearch +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + { echo "$as_me:$LINENO: checking if environ is properly declared" >&5 +echo $ECHO_N "checking if environ is properly declared... $ECHO_C" >&6; } + if test "${gt_cv_var_environ_declaration+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_var_environ_declaration=no +else + 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 + + { echo "$as_me:$LINENO: result: $gt_cv_var_environ_declaration" >&5 +echo "${ECHO_T}$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=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `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" + + + : + + + + + + + + { echo "$as_me:$LINENO: checking if environ is properly declared" >&5 +echo $ECHO_N "checking if environ is properly declared... $ECHO_C" >&6; } + if test "${gt_cv_var_environ_declaration+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_var_environ_declaration=no +else + 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 + + { echo "$as_me:$LINENO: result: $gt_cv_var_environ_declaration" >&5 +echo "${ECHO_T}$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 + { echo "$as_me:$LINENO: checking for unsetenv() return type" >&5 +echo $ECHO_N "checking for unsetenv() return type... $ECHO_C" >&6; } +if test "${gt_cv_func_unsetenv_ret+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_func_unsetenv_ret='int' +else + 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 +{ echo "$as_me:$LINENO: result: $gt_cv_func_unsetenv_ret" >&5 +echo "${ECHO_T}$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 + + + + + : + + + + + + if test $ac_cv_func_sleep = no; then + HAVE_SLEEP=0 + gl_LIBOBJS="$gl_LIBOBJS sleep.$ac_objext" + : + fi + + + + GNULIB_SLEEP=1 + + + { echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +if test "${gt_cv_ssize_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_ssize_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gt_cv_ssize_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 +echo "${ECHO_T}$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +cat >>confdefs.h <<\_ACEOF +#define ssize_t int +_ACEOF + + fi + + + { echo "$as_me:$LINENO: checking for va_copy" >&5 +echo $ECHO_N "checking for va_copy... $ECHO_C" >&6; } + if test "${gl_cv_func_va_copy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 va_copy +void (*func) (va_list, va_list) = va_copy; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_va_copy=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_func_va_copy=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { echo "$as_me:$LINENO: result: $gl_cv_func_va_copy" >&5 +echo "${ECHO_T}$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 + echo $ECHO_N "(cached) $ECHO_C" >&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 __va_copy +error, bail out +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func___va_copy=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 + +cat >>confdefs.h <<\_ACEOF +#define va_copy __va_copy +_ACEOF + + else + + + +cat >>confdefs.h <<\_ACEOF +#define va_copy gl_va_copy +_ACEOF + + fi + fi + + + + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + + + + + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + + + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + + + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + + + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + + + if test $ac_cv_header_stdint_h = yes; then + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* 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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_stdint_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_stdint_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_STDINT_H "$gl_cv_absolute_stdint_h" +_ACEOF + + + ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\" + 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 + { echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5 +echo $ECHO_N "checking whether stdint.h conforms to C99... $ECHO_C" >&6; } +if test "${gl_cv_header_working_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #include + #include + #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 +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; +struct s { + int check_PTRDIFF: PTRDIFF_MIN < (ptrdiff_t) 0 && (ptrdiff_t) 0 < PTRDIFF_MAX ? 1 : -1; + int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= (sig_atomic_t) 0 && (sig_atomic_t) 0 < SIG_ATOMIC_MAX ? 1 : -1; + int check_SIZE: (size_t) 0 < SIZE_MAX ? 1 : -1; + int check_WCHAR: WCHAR_MIN <= (wchar_t) 0 && (wchar_t) 0 < WCHAR_MAX ? 1 : -1; + int check_WINT: WINT_MIN <= (wint_t) 0 && (wint_t) 0 < WINT_MAX + && (WINT_MIN < (wint_t) 0 || (wint_t) -1 == (wint_t) WINT_MAX) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_working_stdint_h=yes +else + 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 +{ echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 +echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + else + HAVE_SYS_INTTYPES_H=0 + fi + + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + else + HAVE_SYS_BITYPES_H=0 + fi + + + + + + + + + + + for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do + { echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 +echo $ECHO_N "checking for bit size of $gltype... $ECHO_C" >&6; } +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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. */ + + /* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + 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` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + 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 + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + 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\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (sizeof ($gltype) * CHAR_BIT)) + return 1; + fprintf (f, "%lu\n", i); + } + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + result=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +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 echo '${'gl_cv_bitsizeof_${gltype}'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$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 + + + + + + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { echo "$as_me:$LINENO: checking whether $gltype is signed" >&5 +echo $ECHO_N "checking whether $gltype is signed... $ECHO_C" >&6; } +if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +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 + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + result=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 echo '${'gl_cv_type_${gltype}_signed'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SIGNED_${GLTYPE} 1 +_ACEOF + + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + + + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + + + + + + + + for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do + { echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 +echo $ECHO_N "checking for $gltype integer literal suffix... $ECHO_C" >&6; } +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >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 + + extern $gltype foo; + extern $gltype1 foo; +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval gl_cv_type_${gltype}_suffix=\$glsuf +else + 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 echo '${'gl_cv_type_${gltype}_suffix'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$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 + + + + STDINT_H=stdint.h + fi + + + + + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_stdio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* 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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_stdio_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_stdio_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_STDIO_H "$gl_cv_absolute_stdio_h" +_ACEOF + + + ABSOLUTE_STDIO_H=\"$gl_cv_absolute_stdio_h\" + + + + + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* 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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_stdlib_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_stdlib_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_STDLIB_H "$gl_cv_absolute_stdlib_h" +_ACEOF + + + ABSOLUTE_STDLIB_H=\"$gl_cv_absolute_stdlib_h\" + + + + + + + + + +for ac_func in stpcpy +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + if test $ac_cv_func_stpcpy = no; then + HAVE_STPCPY=0 + + : + + fi + + + + GNULIB_STPCPY=1 + + + + + +for ac_func in strcasecmp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + + : + + fi + + + + +for ac_func in strncasecmp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + if test $ac_cv_func_strncasecmp = no; then + + : + + fi + { echo "$as_me:$LINENO: checking whether strncasecmp is declared" >&5 +echo $ECHO_N "checking whether strncasecmp is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strncasecmp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 strncasecmp + char *p = (char *) strncasecmp; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strncasecmp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_strncasecmp=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strncasecmp" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strncasecmp" >&6; } +if test $ac_cv_have_decl_strncasecmp = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNCASECMP 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNCASECMP 0 +_ACEOF + + +fi + + + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi + + + + + + + +for ac_func in strchrnul +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + if test $ac_cv_func_strchrnul = no; then + HAVE_STRCHRNUL=0 + : + fi + + + + GNULIB_STRCHRNUL=1 + + + + +for ac_func in strdup +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + + : + + + + + + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi + : + + + + GNULIB_STRDUP=1 + + + + : + + + + + + if test $ac_cv_func_strerror = no; then + gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" + + : + + fi + + + + + + + + + + : + + + + + + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + { echo "$as_me:$LINENO: checking for working strndup" >&5 +echo $ECHO_N "checking for working strndup... $ECHO_C" >&6; } +if test "${gl_cv_func_strndup+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + { echo "$as_me:$LINENO: checking for strndup" >&5 +echo $ECHO_N "checking for strndup... $ECHO_C" >&6; } +if test "${ac_cv_func_strndup+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strndup=yes +else + 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$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_strndup" >&5 +echo "${ECHO_T}$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 +/* end confdefs.h. */ + +#ifdef _AIX + too risky +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "too risky" >/dev/null 2>&1; then + gl_cv_func_strndup=no +else + gl_cv_func_strndup=yes +fi +rm -f conftest* + +else + gl_cv_func_strndup=no +fi + +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 () +{ + +#ifndef HAVE_DECL_STRNDUP + extern char *strndup (const char *, size_t); +#endif + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + return s[13] != '\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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_strndup=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_strndup" >&5 +echo "${ECHO_T}$gl_cv_func_strndup" >&6; } + if test $gl_cv_func_strndup = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRNDUP 1 +_ACEOF + + else + HAVE_STRNDUP=0 + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + : + fi + + + + GNULIB_STRNDUP=1 + + + + + + + : + + + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + fi + + { echo "$as_me:$LINENO: checking for working strnlen" >&5 +echo $ECHO_N "checking for working strnlen... $ECHO_C" >&6; } +if test "${ac_cv_func_strnlen_working+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + +#define S "foobar" +#define S_LEN (sizeof S - 1) + + /* At least one implementation is buggy: that of AIX 4.3 would + give strnlen (S, 1) == 3. */ + + int i; + for (i = 0; i < S_LEN + 1; ++i) + { + int expected = i <= S_LEN ? i : S_LEN; + if (strnlen (S, i) != expected) + return 1; + } + return 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strnlen_working=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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 +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_strnlen_working" >&5 +echo "${ECHO_T}$ac_cv_func_strnlen_working" >&6; } +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 + # that the above use of AC_FUNC_STRNLEN means we may have to use + # lib/strnlen.c. + #AC_LIBOBJ(strnlen) + +cat >>confdefs.h <<\_ACEOF +#define strnlen rpl_strnlen +_ACEOF + + : + fi + + + + GNULIB_STRNLEN=1 + + + +for ac_func in strtol +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + + + + : + + + + + + if test $ac_cv_func_lstat = yes; then + HAVE_LSTAT=1 + else + HAVE_LSTAT=0 + fi + + + { echo "$as_me:$LINENO: checking whether mkdir is declared" >&5 +echo $ECHO_N "checking whether mkdir is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + char *p = (char *) mkdir; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_mkdir=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_mkdir" >&5 +echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +fi + + + if test $ac_cv_have_decl_mkdir = yes; then + HAVE_DECL_MKDIR=1 + else + HAVE_DECL_MKDIR=0 + fi + + if test "$ac_cv_header_io_h" = yes; then + HAVE_IO_H=1 + else + HAVE_IO_H=0 + fi + + + + + + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_sys_stat_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* 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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_sys_stat_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_sys_stat_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_SYS_STAT_H "$gl_cv_absolute_sys_stat_h" +_ACEOF + + + ABSOLUTE_SYS_STAT_H=\"$gl_cv_absolute_sys_stat_h\" + + SYS_STAT_H='sys/stat.h' + + + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$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 +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + + + + + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$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 +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + + + + : + + + + + + if test $ac_cv_header_sysexits_h = yes; then + HAVE_SYSEXITS_H=1 + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_sysexits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + : + + + + + if test $ac_cv_header_sysexits_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_sysexits_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | +sed -n '\#/sysexits.h#{s#.*"\(.*/sysexits.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_sysexits_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_sysexits_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_SYSEXITS_H "$gl_cv_absolute_sysexits_h" +_ACEOF + + + ABSOLUTE_SYSEXITS_H=\"$gl_cv_absolute_sysexits_h\" + 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 () +{ +switch (0) + { + case EX_OK: + case EX_USAGE: + case EX_DATAERR: + case EX_NOINPUT: + case EX_NOUSER: + case EX_NOHOST: + case EX_UNAVAILABLE: + case EX_SOFTWARE: + case EX_OSERR: + case EX_OSFILE: + case EX_CANTCREAT: + case EX_IOERR: + case EX_TEMPFAIL: + case EX_PROTOCOL: + case EX_NOPERM: + case EX_CONFIG: + break; + } + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + SYSEXITS_H= +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + SYSEXITS_H=sysexits.h +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + HAVE_SYSEXITS_H=0 + SYSEXITS_H=sysexits.h + fi + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking whether localtime_r is compatible with its POSIX signature" >&5 +echo $ECHO_N "checking whether localtime_r is compatible with its POSIX signature... $ECHO_C" >&6; } +if test "${gl_cv_time_r_posix+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 () +{ +/* We don't need to append 'restrict's to the argument types, + even though the POSIX signature has the 'restrict's, + since C99 says they can't affect type compatibility. */ + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_time_r_posix=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_time_r_posix=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_time_r_posix" >&5 +echo "${ECHO_T}$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" + + : + + fi + + + + + + + + + : + + + + + + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_unistd_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* 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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_unistd_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_unistd_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_UNISTD_H "$gl_cv_absolute_unistd_h" +_ACEOF + + + ABSOLUTE_UNISTD_H=\"$gl_cv_absolute_unistd_h\" + else + HAVE_UNISTD_H=0 + fi + + + + + + : + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup-safer.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS fd-safer.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS pipe-safer.$ac_objext" + + + +cat >>confdefs.h <<\_ACEOF +#define USE_UNLOCKED_IO 1 +_ACEOF + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS utimens.$ac_objext" + + + + + + : + + + + + + + + + + + + + : + + + + + + if test $ac_cv_func_vasnprintf = no; then + + + : + + + + + + 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 + + fi + + + + + + + + + + + { echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 +echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6; } +if test "${ac_cv_type_ptrdiff_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_ptrdiff_t=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 +echo "${ECHO_T}$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 + + +fi + + + + + + + + + + +for ac_func in snprintf wcslen +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + fi + + + + +for ac_func in vsnprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + 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$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + if test $ac_cv_func_vsnprintf = no; then + + + gl_LIBOBJS="$gl_LIBOBJS vsnprintf.$ac_objext" + if test $ac_cv_func_vsnprintf = yes; then + REPLACE_VSNPRINTF=1 + fi + : + + fi + + : + + + + + + if test $ac_cv_have_decl_vsnprintf = no; then + HAVE_DECL_VSNPRINTF=0 + fi + + + + GNULIB_VSNPRINTF=1 + + + { echo "$as_me:$LINENO: checking whether is standalone" >&5 +echo $ECHO_N "checking whether is standalone... $ECHO_C" >&6; } +if test "${gl_cv_header_wchar_h_standalone+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_wchar_h_standalone=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_header_wchar_h_standalone=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5 +echo "${ECHO_T}$gl_cv_header_wchar_h_standalone" >&6; } + if test $gl_cv_header_wchar_h_standalone = yes; then + WCHAR_H= + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_wchar_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + : + + + + + 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 +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_wchar_h" >&5 +echo "${ECHO_T}$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\" + WCHAR_H=wchar.h + fi + + + + + + : + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + : + + + + + + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + WCTYPE_H=wctype.h + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + WCTYPE_H= + fi + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_wctype_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +_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 + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_wctype_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_wctype_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_WCTYPE_H "$gl_cv_absolute_wctype_h" +_ACEOF + + + 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 + + + + + + gl_LIBOBJS="$gl_LIBOBJS xmalloc.$ac_objext" + + + + : + + + : + + + + gl_LIBOBJS="$gl_LIBOBJS xgetcwd.$ac_objext" + + + + + + + +for ac_header in stdint.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + : + + + LIBCPIO_LIBDEPS="$gl_libdeps" + + LIBCPIO_LTLIBDEPS="$gl_ltlibdeps" + + + + + + +# paxutils modules + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include + +int +main () +{ +if ((struct tm *) 0) +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_time=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 +echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_blksize) +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_blksize=yes +else + 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_blksize) +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_blksize=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_stat_st_blksize=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 +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; } +if test $ac_cv_member_struct_stat_st_blksize = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ST_BLKSIZE 1 +_ACEOF + +fi + + + + + + + + + + + + + + + + + # Set LIB_SETSOCKOPT to -lnsl -lsocket if necessary. + pu_save_LIBS=$LIBS + LIB_SETSOCKOPT= + { echo "$as_me:$LINENO: checking for library containing setsockopt" >&5 +echo $ECHO_N "checking for library containing setsockopt... $ECHO_C" >&6; } +if test "${ac_cv_search_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 setsockopt (); +int +main () +{ +return setsockopt (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket; 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_setsockopt=$ac_res +else + 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 + if test "${ac_cv_search_setsockopt+set}" = set; then + break +fi +done +if test "${ac_cv_search_setsockopt+set}" = set; then + : +else + ac_cv_search_setsockopt=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_search_setsockopt" >&6; } +ac_res=$ac_cv_search_setsockopt +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else + { echo "$as_me:$LINENO: checking for library containing setsockopt" >&5 +echo $ECHO_N "checking for library containing setsockopt... $ECHO_C" >&6; } +if test "${ac_cv_search_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 setsockopt (); +int +main () +{ +return setsockopt (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib -lnsl $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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_setsockopt=$ac_res +else + 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 + if test "${ac_cv_search_setsockopt+set}" = set; then + break +fi +done +if test "${ac_cv_search_setsockopt+set}" = set; then + : +else + ac_cv_search_setsockopt=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_search_setsockopt" >&6; } +ac_res=$ac_cv_search_setsockopt +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + + { echo "$as_me:$LINENO: checking for library containing setsockopt" >&5 +echo $ECHO_N "checking for library containing setsockopt... $ECHO_C" >&6; } +if test "${ac_cv_search_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 setsockopt (); +int +main () +{ +return setsockopt (); + ; + return 0; +} +_ACEOF +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 + 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_setsockopt=$ac_res +else + 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 + if test "${ac_cv_search_setsockopt+set}" = set; then + break +fi +done +if test "${ac_cv_search_setsockopt+set}" = set; then + : +else + ac_cv_search_setsockopt=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_search_setsockopt" >&6; } +ac_res=$ac_cv_search_setsockopt +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + + case "$ac_cv_search_setsockopt" in + -l*) LIB_SETSOCKOPT=$ac_cv_search_setsockopt + esac + + LIBS=$pu_save_LIBS + + + : + + + + + + enable_rmt() { + if test $ac_cv_header_sys_mtio_h = yes; then + { echo "$as_me:$LINENO: checking for remote tape header files" >&5 +echo $ECHO_N "checking for remote tape header files... $ECHO_C" >&6; } +if test "${pu_cv_header_rmt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_SGTTY_H +# include +#endif +#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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + pu_cv_header_rmt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + pu_cv_header_rmt=no +fi + +rm -f conftest.err conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $pu_cv_header_rmt" >&5 +echo "${ECHO_T}$pu_cv_header_rmt" >&6; } + test $pu_cv_header_rmt = yes && PU_RMT_PROG='rmt$(EXEEXT)' + + fi + } + + +for ac_header in sys/mtio.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + { echo "$as_me:$LINENO: checking which ioctl field to test for reversed bytes" >&5 +echo $ECHO_N "checking which ioctl field to test for reversed bytes... $ECHO_C" >&6; } +if test "${pu_cv_header_mtio_check_field+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "mt_model" >/dev/null 2>&1; then + pu_cv_header_mtio_check_field=mt_model +else + pu_cv_header_mtio_check_field=mt_type +fi +rm -f conftest* + +fi +{ echo "$as_me:$LINENO: result: $pu_cv_header_mtio_check_field" >&5 +echo "${ECHO_T}$pu_cv_header_mtio_check_field" >&6; } + +cat >>confdefs.h <<_ACEOF +#define MTIO_CHECK_FIELD $pu_cv_header_mtio_check_field +_ACEOF + + + + + if test "x$DEFAULT_RMT_DIR" != x; then + DEFAULT_RMT_COMMAND=$DEFAULT_RMT_DIR/rmt + else + DEFAULT_RMT_DIR='$(libexecdir)' + fi + + { echo "$as_me:$LINENO: checking whether to build rmt" >&5 +echo $ECHO_N "checking whether to build rmt... $ECHO_C" >&6; } + +# Check whether --with-rmt was given. +if test "${with_rmt+set}" = set; then + withval=$with_rmt; case $withval in + yes|no) { { echo "$as_me:$LINENO: error: Invalid argument to --with-rmt" >&5 +echo "$as_me: error: Invalid argument to --with-rmt" >&2;} + { (exit 1); exit 1; }; };; + /*) DEFAULT_RMT_COMMAND=$withval + { echo "$as_me:$LINENO: result: no, use $withval instead" >&5 +echo "${ECHO_T}no, use $withval instead" >&6; };; + *) { { echo "$as_me:$LINENO: error: Argument to --with-rmt must be an absolute file name" >&5 +echo "$as_me: error: Argument to --with-rmt must be an absolute file name" >&2;} + { (exit 1); exit 1; }; };; + esac +else + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + enable_rmt + if test "$PU_RMT_PROG" = ""; then + { echo "$as_me:$LINENO: WARNING: not building rmt, required header files are missing" >&5 +echo "$as_me: WARNING: not building rmt, required header files are missing" >&2;} + fi +fi + + + + if test "x$DEFAULT_RMT_COMMAND" != x; then + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_RMT_COMMAND "$DEFAULT_RMT_COMMAND" +_ACEOF + + fi + + + + : + + + + + + + + + + + + + + + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_header in sys/buf.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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_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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + 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 echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + { echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 +echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_blksize) +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_blksize=yes +else + 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_blksize) +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_blksize=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_stat_st_blksize=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 +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; } +if test $ac_cv_member_struct_stat_st_blksize = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +_ACEOF + + +fi + + + + + : + + + + + + + + + + + + + + + + + + +# Check whether --enable-mt was given. +if test "${enable_mt+set}" = set; then + enableval=$enable_mt; case $enableval in + yes) CPIO_MT_PROG='mt$(EXEEXT)';; + no) ;; + esac +fi + + + + + + + + + + + + + + +for ac_header in unistd.h stdlib.h string.h fcntl.h sys/io/trioctl.h utmp.h getopt.h locale.h libintl.h sys/wait.h utime.h locale.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-cpio@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ echo "$as_me:$LINENO: checking for sys_errlist and sys_nerr" >&5 +echo $ECHO_N "checking for sys_errlist and sys_nerr... $ECHO_C" >&6; } +if test "$cross_compiling" = yes; then + { echo "$as_me:$LINENO: result: don't know" >&5 +echo "${ECHO_T}don't know" >&6; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +extern char *sys_errlist[]; +extern int sys_nerr; +main() { char *s = sys_errlist[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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SYS_ERRLIST 1 +_ACEOF + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + +{ echo "$as_me:$LINENO: checking whether errno is declared" >&5 +echo $ECHO_N "checking whether errno is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_errno+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include + +int +main () +{ +#ifndef errno + char *p = (char *) errno; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_errno=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_errno=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_errno" >&5 +echo "${ECHO_T}$ac_cv_have_decl_errno" >&6; } +if test $ac_cv_have_decl_errno = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ERRNO 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ERRNO 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether getpwnam is declared" >&5 +echo $ECHO_N "checking whether getpwnam is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getpwnam+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include + +int +main () +{ +#ifndef getpwnam + char *p = (char *) getpwnam; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getpwnam=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getpwnam=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getpwnam" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getpwnam" >&6; } +if test $ac_cv_have_decl_getpwnam = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETPWNAM 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETPWNAM 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether getgrnam is declared" >&5 +echo $ECHO_N "checking whether getgrnam is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getgrnam+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include + +int +main () +{ +#ifndef getgrnam + char *p = (char *) getgrnam; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getgrnam=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getgrnam=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getgrnam" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getgrnam" >&6; } +if test $ac_cv_have_decl_getgrnam = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETGRNAM 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETGRNAM 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether getgrgid is declared" >&5 +echo $ECHO_N "checking whether getgrgid is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getgrgid+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include + +int +main () +{ +#ifndef getgrgid + char *p = (char *) getgrgid; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getgrgid=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getgrgid=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getgrgid" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getgrgid" >&6; } +if test $ac_cv_have_decl_getgrgid = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETGRGID 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETGRGID 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether strdup is declared" >&5 +echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strdup+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include + +int +main () +{ +#ifndef strdup + char *p = (char *) strdup; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strdup=yes +else + 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 +echo "${ECHO_T}$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 +{ echo "$as_me:$LINENO: checking whether strerror is declared" >&5 +echo $ECHO_N "checking whether strerror is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include + +int +main () +{ +#ifndef strerror + char *p = (char *) strerror; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strerror=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_strerror=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6; } +if test $ac_cv_have_decl_strerror = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether getenv is declared" >&5 +echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include + +int +main () +{ +#ifndef getenv + char *p = (char *) getenv; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getenv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getenv=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6; } +if test $ac_cv_have_decl_getenv = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether atoi is declared" >&5 +echo $ECHO_N "checking whether atoi is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_atoi+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include + +int +main () +{ +#ifndef atoi + char *p = (char *) atoi; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_atoi=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_atoi=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_atoi" >&5 +echo "${ECHO_T}$ac_cv_have_decl_atoi" >&6; } +if test $ac_cv_have_decl_atoi = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ATOI 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ATOI 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether exit is declared" >&5 +echo $ECHO_N "checking whether exit is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_exit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include + +int +main () +{ +#ifndef exit + char *p = (char *) exit; + return !p; +#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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_exit=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_exit=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_exit" >&5 +echo "${ECHO_T}$ac_cv_have_decl_exit" >&6; } +if test $ac_cv_have_decl_exit = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_EXIT 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_EXIT 0 +_ACEOF + + +fi + + + +# Gettext. + + { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6; } + + + + + + +# Prepare PATH_SEPARATOR. +# 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 + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# 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 + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# 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 + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MSGMERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$localedir" || localedir='${datadir}/locale' + + + ac_config_commands="$ac_config_commands po-directories" + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# 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 +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${acl_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${acl_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } +if test "${acl_cv_rpath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + 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 + enableval=$enable_rpath; : +else + enable_rpath=yes +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 ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + 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 + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBICONV_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + + + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 +echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6; } +if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +int +main () +{ +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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_func_CFPreferencesCopyAppValue=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gt_cv_func_CFPreferencesCopyAppValue=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CFPREFERENCESCOPYAPPVALUE 1 +_ACEOF + + fi + { echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 +echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6; } +if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +int +main () +{ +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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_func_CFLocaleCopyCurrent=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gt_cv_func_CFLocaleCopyCurrent=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CFLOCALECOPYCURRENT 1 +_ACEOF + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 +echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } +if { as_var=$gt_func_gnugettext_libc; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; +int +main () +{ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ; + 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$gt_func_gnugettext_libc=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$gt_func_gnugettext_libc=no" +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$gt_func_gnugettext_libc'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } +if test "${am_cv_func_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_func_iconv=yes +else + 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 + 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 +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + 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 + +fi +{ echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { echo "$as_me:$LINENO: checking for working iconv" >&5 +echo $ECHO_N "checking for working iconv... $ECHO_C" >&6; } +if test "${am_cv_func_iconv_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + 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 >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 () +{ + /* 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 +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_func_iconv_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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_ext +fi + + + LIBS="$am_save_LIBS" + +fi +{ echo "$as_me:$LINENO: result: $am_cv_func_iconv_works" >&5 +echo "${ECHO_T}$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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICONV 1 +_ACEOF + + fi + if test "$am_cv_lib_iconv" = yes; then + { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix was given. +if test "${with_libintl_prefix+set}" = set; then + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + 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 + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBINTL_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 +echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } +if { as_var=$gt_func_gnugettext_libintl; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +/* end confdefs.h. */ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); +int +main () +{ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ; + 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$gt_func_gnugettext_libintl=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$gt_func_gnugettext_libintl=no" +fi + +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 +/* end confdefs.h. */ +#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); +int +main () +{ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ; + 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 "echo \"\$as_me:$LINENO: $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 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +else + 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 + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +ac_res=`eval echo '${'$gt_func_gnugettext_libintl'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_NLS 1 +_ACEOF + + else + USE_NLS=no + fi + fi + + { echo "$as_me:$LINENO: checking whether to use NLS" >&5 +echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 +echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { echo "$as_me:$LINENO: result: $gt_source" >&5 +echo "${ECHO_T}$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { echo "$as_me:$LINENO: checking how to link with libintl" >&5 +echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $LIBINTL" >&5 +echo "${ECHO_T}$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETTEXT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DCGETTEXT 1 +_ACEOF + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + + +# Initialize the test suite. +ac_config_commands="$ac_config_commands tests/atconfig" + + +ac_config_files="$ac_config_files tests/Makefile tests/atlocal" + # FIXME: tests/preset? + +AUTOM4TE=${AUTOM4TE-"${am_missing_run}autom4te"} + + +ac_config_files="$ac_config_files Makefile doc/Makefile headers/Makefile lib/Makefile rmt/Makefile src/Makefile po/Makefile.in" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (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 \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`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' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"GL_COND_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +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; }; } +fi + + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + gl_LIBOBJS=$gl_libobjs + + gl_LTLIBOBJS=$gl_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# 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 + +# 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 +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (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 +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 + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + 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" || + { 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + 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 +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 || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +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=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&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 cpio $as_me 2.8, which was +generated by GNU Autoconf 2.60. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet 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 + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +GNU cpio config.status 2.8 +configured by $0, generated by GNU Autoconf 2.60, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +_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. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +# 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. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "tests/atconfig") CONFIG_COMMANDS="$CONFIG_COMMANDS tests/atconfig" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/atlocal") CONFIG_FILES="$CONFIG_FILES tests/atlocal" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "headers/Makefile") CONFIG_FILES="$CONFIG_FILES headers/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "rmt/Makefile") CONFIG_FILES="$CONFIG_FILES rmt/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +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_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + 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 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +RANLIB!$RANLIB$ac_delim +YACC!$YACC$ac_delim +YFLAGS!$YFLAGS$ac_delim +GL_COND_LIBTOOL_TRUE!$GL_COND_LIBTOOL_TRUE$ac_delim +GL_COND_LIBTOOL_FALSE!$GL_COND_LIBTOOL_FALSE$ac_delim +ALLOCA!$ALLOCA$ac_delim +ALLOCA_H!$ALLOCA_H$ac_delim +GETOPT_H!$GETOPT_H$ac_delim +GNULIB_CHOWN!$GNULIB_CHOWN$ac_delim +GNULIB_DUP2!$GNULIB_DUP2$ac_delim +GNULIB_FCHDIR!$GNULIB_FCHDIR$ac_delim +GNULIB_FTRUNCATE!$GNULIB_FTRUNCATE$ac_delim +GNULIB_GETCWD!$GNULIB_GETCWD$ac_delim +GNULIB_GETLOGIN_R!$GNULIB_GETLOGIN_R$ac_delim +GNULIB_LSEEK!$GNULIB_LSEEK$ac_delim +GNULIB_READLINK!$GNULIB_READLINK$ac_delim +GNULIB_SLEEP!$GNULIB_SLEEP$ac_delim +HAVE_DUP2!$HAVE_DUP2$ac_delim +HAVE_FTRUNCATE!$HAVE_FTRUNCATE$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +HAVE_READLINK!$HAVE_READLINK$ac_delim +HAVE_SLEEP!$HAVE_SLEEP$ac_delim +HAVE_DECL_GETLOGIN_R!$HAVE_DECL_GETLOGIN_R$ac_delim +REPLACE_CHOWN!$REPLACE_CHOWN$ac_delim +REPLACE_FCHDIR!$REPLACE_FCHDIR$ac_delim +REPLACE_GETCWD!$REPLACE_GETCWD$ac_delim +REPLACE_LSEEK!$REPLACE_LSEEK$ac_delim +LIB_CLOCK_GETTIME!$LIB_CLOCK_GETTIME$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +ABSOLUTE_DIRENT_H!$ABSOLUTE_DIRENT_H$ac_delim +DIRENT_H!$DIRENT_H$ac_delim +ABSOLUTE_FCNTL_H!$ABSOLUTE_FCNTL_H$ac_delim +FCNTL_H!$FCNTL_H$ac_delim +ABSOLUTE_FLOAT_H!$ABSOLUTE_FLOAT_H$ac_delim +FLOAT_H!$FLOAT_H$ac_delim +FNMATCH_H!$FNMATCH_H$ac_delim +STDBOOL_H!$STDBOOL_H$ac_delim +HAVE__BOOL!$HAVE__BOOL$ac_delim +LIBINTL!$LIBINTL$ac_delim +LTLIBINTL!$LTLIBINTL$ac_delim +ABSOLUTE_SYS_TIME_H!$ABSOLUTE_SYS_TIME_H$ac_delim +HAVE_SYS_TIME_H!$HAVE_SYS_TIME_H$ac_delim +HAVE_STRUCT_TIMEVAL!$HAVE_STRUCT_TIMEVAL$ac_delim +REPLACE_GETTIMEOFDAY!$REPLACE_GETTIMEOFDAY$ac_delim +SYS_TIME_H!$SYS_TIME_H$ac_delim +HAVE_LONG_LONG_INT!$HAVE_LONG_LONG_INT$ac_delim +HAVE_UNSIGNED_LONG_LONG_INT!$HAVE_UNSIGNED_LONG_LONG_INT$ac_delim +HAVE_INTTYPES_H!$HAVE_INTTYPES_H$ac_delim +HAVE_SYS_TYPES_H!$HAVE_SYS_TYPES_H$ac_delim +ABSOLUTE_STDINT_H!$ABSOLUTE_STDINT_H$ac_delim +HAVE_STDINT_H!$HAVE_STDINT_H$ac_delim +HAVE_SYS_INTTYPES_H!$HAVE_SYS_INTTYPES_H$ac_delim +HAVE_SYS_BITYPES_H!$HAVE_SYS_BITYPES_H$ac_delim +BITSIZEOF_PTRDIFF_T!$BITSIZEOF_PTRDIFF_T$ac_delim +BITSIZEOF_SIG_ATOMIC_T!$BITSIZEOF_SIG_ATOMIC_T$ac_delim +BITSIZEOF_SIZE_T!$BITSIZEOF_SIZE_T$ac_delim +BITSIZEOF_WCHAR_T!$BITSIZEOF_WCHAR_T$ac_delim +BITSIZEOF_WINT_T!$BITSIZEOF_WINT_T$ac_delim +HAVE_SIGNED_SIG_ATOMIC_T!$HAVE_SIGNED_SIG_ATOMIC_T$ac_delim +HAVE_SIGNED_WCHAR_T!$HAVE_SIGNED_WCHAR_T$ac_delim +HAVE_SIGNED_WINT_T!$HAVE_SIGNED_WINT_T$ac_delim +PTRDIFF_T_SUFFIX!$PTRDIFF_T_SUFFIX$ac_delim +SIG_ATOMIC_T_SUFFIX!$SIG_ATOMIC_T_SUFFIX$ac_delim +SIZE_T_SUFFIX!$SIZE_T_SUFFIX$ac_delim +WCHAR_T_SUFFIX!$WCHAR_T_SUFFIX$ac_delim +WINT_T_SUFFIX!$WINT_T_SUFFIX$ac_delim +STDINT_H!$STDINT_H$ac_delim +PRI_MACROS_BROKEN!$PRI_MACROS_BROKEN$ac_delim +GNULIB_IMAXABS!$GNULIB_IMAXABS$ac_delim +GNULIB_IMAXDIV!$GNULIB_IMAXDIV$ac_delim +GNULIB_STRTOIMAX!$GNULIB_STRTOIMAX$ac_delim +GNULIB_STRTOUMAX!$GNULIB_STRTOUMAX$ac_delim +HAVE_DECL_IMAXABS!$HAVE_DECL_IMAXABS$ac_delim +HAVE_DECL_IMAXDIV!$HAVE_DECL_IMAXDIV$ac_delim +HAVE_DECL_STRTOIMAX!$HAVE_DECL_STRTOIMAX$ac_delim +HAVE_DECL_STRTOUMAX!$HAVE_DECL_STRTOUMAX$ac_delim +ABSOLUTE_INTTYPES_H!$ABSOLUTE_INTTYPES_H$ac_delim +PRIPTR_PREFIX!$PRIPTR_PREFIX$ac_delim +INTTYPES_H!$INTTYPES_H$ac_delim +GNULIB_MEMMEM!$GNULIB_MEMMEM$ac_delim +GNULIB_MEMPCPY!$GNULIB_MEMPCPY$ac_delim +GNULIB_MEMRCHR!$GNULIB_MEMRCHR$ac_delim +GNULIB_STPCPY!$GNULIB_STPCPY$ac_delim +GNULIB_STPNCPY!$GNULIB_STPNCPY$ac_delim +GNULIB_STRCHRNUL!$GNULIB_STRCHRNUL$ac_delim +GNULIB_STRDUP!$GNULIB_STRDUP$ac_delim +GNULIB_STRNDUP!$GNULIB_STRNDUP$ac_delim +GNULIB_STRNLEN!$GNULIB_STRNLEN$ac_delim +GNULIB_STRPBRK!$GNULIB_STRPBRK$ac_delim +GNULIB_STRSEP!$GNULIB_STRSEP$ac_delim +GNULIB_STRCASESTR!$GNULIB_STRCASESTR$ac_delim +GNULIB_STRTOK_R!$GNULIB_STRTOK_R$ac_delim +GNULIB_MBSLEN!$GNULIB_MBSLEN$ac_delim +GNULIB_MBSCHR!$GNULIB_MBSCHR$ac_delim +GNULIB_MBSRCHR!$GNULIB_MBSRCHR$ac_delim +GNULIB_MBSSTR!$GNULIB_MBSSTR$ac_delim +GNULIB_MBSCASECMP!$GNULIB_MBSCASECMP$ac_delim +GNULIB_MBSNCASECMP!$GNULIB_MBSNCASECMP$ac_delim +GNULIB_MBSPCASECMP!$GNULIB_MBSPCASECMP$ac_delim +GNULIB_MBSCASESTR!$GNULIB_MBSCASESTR$ac_delim +GNULIB_MBSCSPN!$GNULIB_MBSCSPN$ac_delim +GNULIB_MBSPBRK!$GNULIB_MBSPBRK$ac_delim +GNULIB_MBSSPN!$GNULIB_MBSSPN$ac_delim +GNULIB_MBSSEP!$GNULIB_MBSSEP$ac_delim +GNULIB_MBSTOK_R!$GNULIB_MBSTOK_R$ac_delim +HAVE_DECL_MEMMEM!$HAVE_DECL_MEMMEM$ac_delim +HAVE_MEMPCPY!$HAVE_MEMPCPY$ac_delim +HAVE_DECL_MEMRCHR!$HAVE_DECL_MEMRCHR$ac_delim +HAVE_STPCPY!$HAVE_STPCPY$ac_delim +HAVE_STPNCPY!$HAVE_STPNCPY$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +HAVE_STRCASECMP!$HAVE_STRCASECMP$ac_delim +HAVE_DECL_STRNCASECMP!$HAVE_DECL_STRNCASECMP$ac_delim +HAVE_STRCHRNUL!$HAVE_STRCHRNUL$ac_delim +HAVE_DECL_STRDUP!$HAVE_DECL_STRDUP$ac_delim +HAVE_STRNDUP!$HAVE_STRNDUP$ac_delim +HAVE_DECL_STRNDUP!$HAVE_DECL_STRNDUP$ac_delim +HAVE_DECL_STRNLEN!$HAVE_DECL_STRNLEN$ac_delim +HAVE_STRPBRK!$HAVE_STRPBRK$ac_delim +HAVE_STRSEP!$HAVE_STRSEP$ac_delim +HAVE_STRCASESTR!$HAVE_STRCASESTR$ac_delim +HAVE_DECL_STRTOK_R!$HAVE_DECL_STRTOK_R$ac_delim +GNULIB_FPRINTF_POSIX!$GNULIB_FPRINTF_POSIX$ac_delim +GNULIB_PRINTF_POSIX!$GNULIB_PRINTF_POSIX$ac_delim +GNULIB_SNPRINTF!$GNULIB_SNPRINTF$ac_delim +GNULIB_SPRINTF_POSIX!$GNULIB_SPRINTF_POSIX$ac_delim +GNULIB_VFPRINTF_POSIX!$GNULIB_VFPRINTF_POSIX$ac_delim +GNULIB_VPRINTF_POSIX!$GNULIB_VPRINTF_POSIX$ac_delim +GNULIB_VSNPRINTF!$GNULIB_VSNPRINTF$ac_delim +GNULIB_VSPRINTF_POSIX!$GNULIB_VSPRINTF_POSIX$ac_delim +GNULIB_VASPRINTF!$GNULIB_VASPRINTF$ac_delim +GNULIB_FSEEK!$GNULIB_FSEEK$ac_delim +GNULIB_FSEEKO!$GNULIB_FSEEKO$ac_delim +GNULIB_FTELL!$GNULIB_FTELL$ac_delim +GNULIB_FTELLO!$GNULIB_FTELLO$ac_delim +GNULIB_FFLUSH!$GNULIB_FFLUSH$ac_delim +REPLACE_FPRINTF!$REPLACE_FPRINTF$ac_delim +REPLACE_VFPRINTF!$REPLACE_VFPRINTF$ac_delim +REPLACE_PRINTF!$REPLACE_PRINTF$ac_delim +REPLACE_VPRINTF!$REPLACE_VPRINTF$ac_delim +REPLACE_SNPRINTF!$REPLACE_SNPRINTF$ac_delim +HAVE_DECL_SNPRINTF!$HAVE_DECL_SNPRINTF$ac_delim +REPLACE_VSNPRINTF!$REPLACE_VSNPRINTF$ac_delim +HAVE_DECL_VSNPRINTF!$HAVE_DECL_VSNPRINTF$ac_delim +REPLACE_SPRINTF!$REPLACE_SPRINTF$ac_delim +REPLACE_VSPRINTF!$REPLACE_VSPRINTF$ac_delim +HAVE_VASPRINTF!$HAVE_VASPRINTF$ac_delim +REPLACE_VASPRINTF!$REPLACE_VASPRINTF$ac_delim +HAVE_FSEEKO!$HAVE_FSEEKO$ac_delim +REPLACE_FSEEKO!$REPLACE_FSEEKO$ac_delim +REPLACE_FSEEK!$REPLACE_FSEEK$ac_delim +HAVE_FTELLO!$HAVE_FTELLO$ac_delim +REPLACE_FTELLO!$REPLACE_FTELLO$ac_delim +REPLACE_FTELL!$REPLACE_FTELL$ac_delim +REPLACE_FFLUSH!$REPLACE_FFLUSH$ac_delim +ABSOLUTE_STDIO_H!$ABSOLUTE_STDIO_H$ac_delim +GNULIB_GETSUBOPT!$GNULIB_GETSUBOPT$ac_delim +GNULIB_MKDTEMP!$GNULIB_MKDTEMP$ac_delim +GNULIB_MKSTEMP!$GNULIB_MKSTEMP$ac_delim +HAVE_GETSUBOPT!$HAVE_GETSUBOPT$ac_delim +HAVE_MKDTEMP!$HAVE_MKDTEMP$ac_delim +REPLACE_MKSTEMP!$REPLACE_MKSTEMP$ac_delim +ABSOLUTE_STDLIB_H!$ABSOLUTE_STDLIB_H$ac_delim +ABSOLUTE_STRING_H!$ABSOLUTE_STRING_H$ac_delim +HAVE_LSTAT!$HAVE_LSTAT$ac_delim +HAVE_DECL_MKDIR!$HAVE_DECL_MKDIR$ac_delim +HAVE_IO_H!$HAVE_IO_H$ac_delim +ABSOLUTE_SYS_STAT_H!$ABSOLUTE_SYS_STAT_H$ac_delim +SYS_STAT_H!$SYS_STAT_H$ac_delim +HAVE_SYSEXITS_H!$HAVE_SYSEXITS_H$ac_delim +ABSOLUTE_SYSEXITS_H!$ABSOLUTE_SYSEXITS_H$ac_delim +SYSEXITS_H!$SYSEXITS_H$ac_delim +REPLACE_LOCALTIME_R!$REPLACE_LOCALTIME_R$ac_delim +REPLACE_NANOSLEEP!$REPLACE_NANOSLEEP$ac_delim +REPLACE_STRPTIME!$REPLACE_STRPTIME$ac_delim +REPLACE_TIMEGM!$REPLACE_TIMEGM$ac_delim +ABSOLUTE_TIME_H!$ABSOLUTE_TIME_H$ac_delim +TIME_H_DEFINES_STRUCT_TIMESPEC!$TIME_H_DEFINES_STRUCT_TIMESPEC$ac_delim +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC!$SYS_TIME_H_DEFINES_STRUCT_TIMESPEC$ac_delim +HAVE_UNISTD_H!$HAVE_UNISTD_H$ac_delim +ABSOLUTE_UNISTD_H!$ABSOLUTE_UNISTD_H$ac_delim +EOVERFLOW!$EOVERFLOW$ac_delim +ABSOLUTE_WCHAR_H!$ABSOLUTE_WCHAR_H$ac_delim +WCHAR_H!$WCHAR_H$ac_delim +HAVE_ISWCNTRL!$HAVE_ISWCNTRL$ac_delim +HAVE_WINT_T!$HAVE_WINT_T$ac_delim +ABSOLUTE_WCTYPE_H!$ABSOLUTE_WCTYPE_H$ac_delim +HAVE_WCTYPE_H!$HAVE_WCTYPE_H$ac_delim +WCTYPE_H!$WCTYPE_H$ac_delim +LIBCPIO_LIBDEPS!$LIBCPIO_LIBDEPS$ac_delim +LIBCPIO_LTLIBDEPS!$LIBCPIO_LTLIBDEPS$ac_delim +LIB_SETSOCKOPT!$LIB_SETSOCKOPT$ac_delim +PU_RMT_PROG!$PU_RMT_PROG$ac_delim +DEFAULT_RMT_DIR!$DEFAULT_RMT_DIR$ac_delim +DEFAULT_RMT_COMMAND!$DEFAULT_RMT_COMMAND$ac_delim +CPIO_MT_PROG!$CPIO_MT_PROG$ac_delim +USE_NLS!$USE_NLS$ac_delim +MSGFMT!$MSGFMT$ac_delim +GMSGFMT!$GMSGFMT$ac_delim +MSGFMT_015!$MSGFMT_015$ac_delim +GMSGFMT_015!$GMSGFMT_015$ac_delim +XGETTEXT!$XGETTEXT$ac_delim +XGETTEXT_015!$XGETTEXT_015$ac_delim +MSGMERGE!$MSGMERGE$ac_delim +INTL_MACOSX_LIBS!$INTL_MACOSX_LIBS$ac_delim +LIBICONV!$LIBICONV$ac_delim +LTLIBICONV!$LTLIBICONV$ac_delim +INTLLIBS!$INTLLIBS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +POSUB!$POSUB$ac_delim +AUTOM4TE!$AUTOM4TE$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +gl_LIBOBJS!$gl_LIBOBJS$ac_delim +gl_LTLIBOBJS!$gl_LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-4.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$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 || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + 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=`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 || +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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`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/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# 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/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + 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' ;; +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 +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +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 | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" | sed -f "$tmp/subs-4.sed" >$tmp/out + +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"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +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 + ;; + :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 + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + 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 || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +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 -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\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + 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" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + 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=`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 || +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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +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 + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + "tests/atconfig":C) cat >tests/atconfig </dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + 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; } +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..cc24932 --- /dev/null +++ b/configure.ac @@ -0,0 +1,105 @@ +dnl Process this file with autoconf to produce a configure script. +dnl This file is part of GNU cpio +dnl Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software Foundation, +dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +AC_INIT([GNU cpio], [2.8], [bug-cpio@gnu.org]) +AC_CONFIG_SRCDIR(src/cpio.h) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE +AC_CONFIG_HEADERS([config.h]) + +AC_PREREQ([2.59]) + +dnl Check for programs +gl_USE_SYSTEM_EXTENSIONS +AC_PROG_CC +AC_PROG_CPP +AC_PROG_GCC_TRADITIONAL +AC_PROG_INSTALL +AC_PROG_RANLIB +AC_PROG_YACC +gl_EARLY +AC_C_PROTOTYPES + +AC_SYS_LARGEFILE + +AC_TYPE_SIGNAL +AC_HEADER_MAJOR +AC_C_CONST +AC_TYPE_UID_T +AC_CHECK_TYPE(gid_t, int) +AC_HEADER_STDC +AC_HEADER_DIRENT + +AC_CHECK_FUNCS([fchmod fchown]) + +# gnulib modules +gl_INIT +# paxutils modules +cpio_PAXUTILS + +AC_SUBST(CPIO_MT_PROG) + +AC_ARG_ENABLE(mt, + AC_HELP_STRING([--enable-mt], [Enable building of mt program]), + [case $enableval in + yes) CPIO_MT_PROG='mt$(EXEEXT)';; + no) ;; + esac]) + +AC_CHECK_HEADERS(unistd.h stdlib.h string.h fcntl.h sys/io/trioctl.h utmp.h getopt.h locale.h libintl.h sys/wait.h utime.h locale.h) + +AC_MSG_CHECKING(for sys_errlist and sys_nerr) +AC_TRY_RUN( +extern char *sys_errlist[[]]; +extern int sys_nerr; +main() { char *s = sys_errlist[[0]]; return 0; }, + AC_DEFINE(HAVE_SYS_ERRLIST,1, + [Define if your system has sys_errlist global variable]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no), + AC_MSG_RESULT(don't know)) + +AC_CHECK_DECLS([errno, getpwnam, getgrnam, getgrgid, strdup, strerror, getenv, atoi, exit], , , [ +#include +#include +#include +#ifdef HAVE_STRING_H +# include +#else +# include +#endif +#include +#include ]) + +# Gettext. +AM_GNU_GETTEXT([external], [need-formatstring-macros]) +AM_GNU_GETTEXT_VERSION(0.16) + +# Initialize the test suite. +AC_CONFIG_TESTDIR(tests) +AC_CONFIG_FILES([tests/Makefile tests/atlocal]) # FIXME: tests/preset? +AM_MISSING_PROG([AUTOM4TE], [autom4te]) + +AC_CONFIG_FILES([Makefile + doc/Makefile + headers/Makefile + lib/Makefile + rmt/Makefile + src/Makefile + po/Makefile.in]) +AC_OUTPUT diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..e0bfee8 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,26 @@ +# This file is part of GNU cpio +# 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. + +info_TEXINFOS = cpio.texi +man_MANS = cpio.1 mt.1 +EXTRA_DIST = $(man_MANS) gendocs_template + +# Make sure you set TEXINPUT +manual: + TEXINPUTS=$(srcdir):$(top_srcdir)/scripts:$$TEXINPUTS \ + gendocs.sh cpio 'GNU cpio manual' diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..1b9ff35 --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,912 @@ +# Makefile.in generated by automake 1.10a from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# This file is part of GNU cpio +# 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. +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@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 +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/stamp-vti $(srcdir)/version.texi +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/argp.m4 \ + $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/canonicalize-lgpl.m4 \ + $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \ + $(top_srcdir)/m4/clock_time.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/d-ino.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/exitfail.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/getcwd-abort-bug.m4 \ + $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \ + $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/hash.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/inline.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/lchown.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mempcpy.m4 \ + $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mktime.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ + $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/paxutils.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \ + $(top_srcdir)/m4/rmt.m4 $(top_srcdir)/m4/rtapelib.m4 \ + $(top_srcdir)/m4/safe-read.m4 $(top_srcdir)/m4/safe-write.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sysexits.m4 \ + $(top_srcdir)/m4/system.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/ulonglong.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vsnprintf.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +INFO_DEPS = $(srcdir)/cpio.info +TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux +DVIS = cpio.dvi +PDFS = cpio.pdf +PSS = cpio.ps +HTMLS = cpio.html +TEXINFOS = cpio.texi +TEXI2DVI = texi2dvi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" +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 = `echo $$p | sed -e 's|^.*/||'`; +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ +ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ +ABSOLUTE_FLOAT_H = @ABSOLUTE_FLOAT_H@ +ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_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_SYSEXITS_H = @ABSOLUTE_SYSEXITS_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@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPIO_MT_PROG = @CPIO_MT_PROG@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_RMT_COMMAND = @DEFAULT_RMT_COMMAND@ +DEFAULT_RMT_DIR = @DEFAULT_RMT_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIRENT_H = @DIRENT_H@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXEEXT = @EXEEXT@ +FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_H = @GETOPT_H@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ +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_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_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYSEXITS_H = @HAVE_SYSEXITS_H@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE__BOOL = @HAVE__BOOL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTTYPES_H = @INTTYPES_H@ +LDFLAGS = @LDFLAGS@ +LIBCPIO_LIBDEPS = @LIBCPIO_LIBDEPS@ +LIBCPIO_LTLIBDEPS = @LIBCPIO_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_SETSOCKOPT = @LIB_SETSOCKOPT@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +PU_RMT_PROG = @PU_RMT_PROG@ +RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYSEXITS_H = @SYSEXITS_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@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +info_TEXINFOS = cpio.texi +man_MANS = cpio.1 mt.1 +EXTRA_DIST = $(man_MANS) gendocs_template +all: all-am + +.SUFFIXES: +.SUFFIXES: .dvi .html .info .pdf .ps .texi +$(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; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(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 + +.texi.info: + restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && 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 \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + else :; fi && \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $<; \ + then \ + rc=0; \ + cd $(srcdir); \ + else \ + rc=$$?; \ + cd $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +.texi.dvi: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $< + +.texi.pdf: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) $< + +.texi.html: + rm -rf $(@:.html=.htp) + if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) $<; \ + then \ + rm -rf $@; \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + else \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ + exit 1; \ + fi +$(srcdir)/cpio.info: cpio.texi $(srcdir)/version.texi +cpio.dvi: cpio.texi $(srcdir)/version.texi +cpio.pdf: cpio.texi $(srcdir)/version.texi +cpio.html: cpio.texi $(srcdir)/version.texi +$(srcdir)/version.texi: $(srcdir)/stamp-vti +$(srcdir)/stamp-vti: cpio.texi $(top_srcdir)/configure + @(dir=.; test -f ./cpio.texi || dir=$(srcdir); \ + set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/cpio.texi`; \ + echo "@set UPDATED $$1 $$2 $$3"; \ + echo "@set UPDATED-MONTH $$2 $$3"; \ + echo "@set EDITION $(VERSION)"; \ + echo "@set VERSION $(VERSION)") > vti.tmp + @cmp -s vti.tmp $(srcdir)/version.texi \ + || (echo "Updating $(srcdir)/version.texi"; \ + cp vti.tmp $(srcdir)/version.texi) + -@rm -f vti.tmp + @cp $(srcdir)/version.texi $@ + +mostlyclean-vti: + -rm -f vti.tmp + +maintainer-clean-vti: + -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi +.dvi.ps: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + $(DVIPS) -o $@ $< + +uninstall-dvi-am: + @$(NORMAL_UNINSTALL) + @list='$(DVIS)'; for p in $$list; do \ + f=$(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) \ + echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ + rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ + done + +uninstall-info-am: + @$(PRE_UNINSTALL) + @if test -d '$(DESTDIR)$(infodir)' && \ + (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + 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"; \ + done; \ + else :; fi + @$(NORMAL_UNINSTALL) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ + done + +uninstall-pdf-am: + @$(NORMAL_UNINSTALL) + @list='$(PDFS)'; for p in $$list; do \ + f=$(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) \ + echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ + rm -f "$(DESTDIR)$(psdir)/$$f"; \ + done + +dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$base; then d=.; else d=$(srcdir); fi; \ + base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ + 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; \ + else :; fi; \ + done; \ + done + +mostlyclean-aminfo: + -rm -rf cpio.aux cpio.cp cpio.cps cpio.fn cpio.fns cpio.ky cpio.kys cpio.log \ + cpio.pg cpio.pgs cpio.tmp cpio.toc cpio.tp cpio.tps cpio.vr \ + cpio.vrs cpio.dvi cpio.pdf cpio.ps cpio.html + +maintainer-clean-aminfo: + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ + done +install-man1: $(man1_MANS) $(man_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; \ + 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 +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 +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + 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; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-info +check-am: all-am +check: check-am +all-am: Makefile $(INFO_DEPS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: $(DVIS) + +html: html-am + +html-am: $(HTMLS) + +info: info-am + +info-am: $(INFO_DEPS) + +install-data-am: install-info-am install-man + +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 \ + 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"; \ + done +install-exec-am: + +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 \ + if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(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"; \ + else \ + echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ + fi; \ + 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)'; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + 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 \ + if test -f $$ifile; then \ + relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ + echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ + $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ + else : ; fi; \ + done; \ + 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)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: install-man1 + +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 \ + 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 +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 \ + 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 +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti + +pdf: pdf-am + +pdf-am: $(PDFS) + +ps: ps-am + +ps-am: $(PSS) + +uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-man uninstall-pdf-am uninstall-ps-am + +uninstall-man: uninstall-man1 + +.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-man1 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-man \ + uninstall-man1 uninstall-pdf-am uninstall-ps-am + + +# Make sure you set TEXINPUT +manual: + TEXINPUTS=$(srcdir):$(top_srcdir)/scripts:$$TEXINPUTS \ + gendocs.sh cpio 'GNU cpio manual' +# 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/doc/cpio.1 b/doc/cpio.1 new file mode 100644 index 0000000..dc3eb80 --- /dev/null +++ b/doc/cpio.1 @@ -0,0 +1,41 @@ +.TH CPIO 1L \" -*- nroff -*- +.SH NAME +cpio \- copy files to and from archives +.SH SYNOPSIS +.B cpio +{\-o|\-\-create} [\-0acvABLV] [\-C bytes] [\-H format] [\-M message] +[\-O [[user@]host:]archive] [\-F [[user@]host:]archive] +[\-\-file=[[user@]host:]archive] [\-\-format=format] [\-\-message=message] +[\-\-null] [\-\-reset-access-time] [\-\-verbose] [\-\-dot] [\-\-append] +[\-\-block-size=blocks] [\-\-dereference] [\-\-io-size=bytes] [\-\-quiet] +[\-\-force\-local] [\-\-rsh-command=command] [\-\-help] [\-\-version] +< name-list [> archive] + +.B cpio +{\-i|\-\-extract} [\-bcdfmnrtsuvBSV] [\-C bytes] [\-E file] [\-H format] +[\-M message] [\-R [user][:.][group]] [\-I [[user@]host:]archive] +[\-F [[user@]host:]archive] [\-\-file=[[user@]host:]archive] +[\-\-make-directories] [\-\-nonmatching] [\-\-preserve-modification-time] +[\-\-numeric-uid-gid] [\-\-rename] [\-t|\-\-list] [\-\-swap-bytes] [\-\-swap] [\-\-dot] +[\-\-unconditional] [\-\-verbose] [\-\-block-size=blocks] [\-\-swap-halfwords] +[\-\-io-size=bytes] [\-\-pattern-file=file] [\-\-format=format] +[\-\-owner=[user][:.][group]] [\-\-no-preserve-owner] [\-\-message=message] +[\-\-force\-local] [\-\-no\-absolute\-filenames] [\-\-sparse] +[\-\-only\-verify\-crc] [\-\-quiet] [\-\-rsh-command=command] [\-\-help] +[\-\-version] [pattern...] [< archive] + +.B cpio +{\-p|\-\-pass-through} [\-0adlmuvLV] [\-R [user][:.][group]] +[\-\-null] [\-\-reset-access-time] [\-\-make-directories] [\-\-link] [\-\-quiet] +[\-\-preserve-modification-time] [\-\-unconditional] [\-\-verbose] [\-\-dot] +[\-\-dereference] [\-\-owner=[user][:.][group]] [\-\-no-preserve-owner] +[\-\-sparse] [\-\-help] [\-\-version] destination-directory < name-list +.SH DESCRIPTION +GNU cpio is fully documented in the texinfo documentation. To access the +help from your command line, type +.PP +\fBinfo cpio +.PP +The online copy of the documentation is available at the following address: +.PP +http://www.gnu.org/software/cpio/manual diff --git a/doc/cpio.info b/doc/cpio.info new file mode 100644 index 0000000..bce396a --- /dev/null +++ b/doc/cpio.info @@ -0,0 +1,556 @@ +This is cpio.info, produced by makeinfo version 4.8 from cpio.texi. + +INFO-DIR-SECTION Archiving +START-INFO-DIR-ENTRY +* Cpio: (cpio). Copy-in-copy-out archiver to tape or disk. +END-INFO-DIR-ENTRY + + This manual documents GNU cpio (version 2.8, 7 June 2007). + + Copyright (C) 1995, 2001, 2002, 2004 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 + Foundation; with no Invariant Sections, with the Front-Cover texts + being "A GNU Manual", and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + "GNU Free Documentation License". + + (a) The FSF's Back-Cover Text is: "You have freedom to copy and + modify this GNU Manual, like GNU software. Copies published by + the Free Software Foundation raise funds for GNU development." + + +File: cpio.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) + +cpio +**** + +GNU cpio is a tool for creating and extracting archives, or copying +files from one place to another. It handles a number of cpio formats as +well as reading and writing tar files. This is the first edition of the +GNU cpio documentation and is consistent with 2.8. + +* Menu: + +* Introduction:: +* Tutorial:: Getting started. +* Invoking cpio:: How to invoke `cpio'. +* Media:: Using tapes and other archive media. +* Reports:: Reporting bugs or suggestions +* Concept Index:: Concept index. + + --- The Detailed Node Listing --- + +Invoking cpio + +* Copy-out mode:: +* Copy-in mode:: +* Copy-pass mode:: +* Options:: + + +File: cpio.info, Node: Introduction, Next: Tutorial, Prev: Top, Up: Top + +1 Introduction +************** + +GNU cpio copies files into or out of a cpio or tar archive, The archive +can be another file on the disk, a magnetic tape, or a pipe. + + GNU cpio supports the following archive formats: binary, old ASCII, +new ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1 tar. +The tar format is provided for compatibility with the tar program. By +default, cpio creates binary format archives, for compatibility with +older cpio programs. When extracting from archives, cpio automatically +recognizes which kind of archive it is reading and can read archives +created on machines with a different byte-order. + + +File: cpio.info, Node: Tutorial, Next: Invoking cpio, Prev: Introduction, Up: Top + +2 Tutorial +********** + +GNU cpio performs three primary functions. Copying files to an +archive, Extracting files from an archive, and passing files to another +directory tree. An archive can be a file on disk, one or more floppy +disks, or one or more tapes. + + When creating an archive, cpio takes the list of files to be +processed from the standard input, and then sends the archive to the +standard output, or to the device defined by the `-F' option. *Note +Copy-out mode::. Usually find or ls is used to provide this list to +the standard input. In the following example you can see the +possibilities for archiving the contents of a single directory. + + % ls | cpio -ov > directory.cpio + + The `-o' option creates the archive, and the `-v' option prints the +names of the files archived as they are added. Notice that the options +can be put together after a single `-' or can be placed separately on +the command line. The `>' redirects the cpio output to the file +`directory.cpio'. + + If you wanted to archive an entire directory tree, the find command +can provide the file list to cpio: + + % find . -print -depth | cpio -ov > tree.cpio + + This will take all the files in the current directory, the +directories below and place them in the archive tree.cpio. Again the +`-o' creates an archive, and the `-v' option shows you the name of the +files as they are archived. *Note Copy-out mode::. Using the `.' in +the find statement will give you more flexibility when doing restores, +as it will save file names with a relative path vice a hard wired, +absolute path. The `-depth' option forces `find' to print of the +entries in a directory before printing the directory itself. This +limits the effects of restrictive directory permissions by printing the +directory entries in a directory before the directory name itself. + + Extracting an archive requires a bit more thought because cpio will +not create directories by default. Another characteristic, is it will +not overwrite existing files unless you tell it to. + + % cpio -iv < directory.cpio + + This will retrieve the files archived in the file directory.cpio and +place them in the present directory. The `-i' option extracts the +archive and the `-v' shows the file names as they are extracted. If +you are dealing with an archived directory tree, you need to use the +`-d' option to create directories as necessary, something like: + + % cpio -idv < tree.cpio + + This will take the contents of the archive tree.cpio and extract it +to the current directory. If you try to extract the files on top of +files of the same name that already exist (and have the same or later +modification time) cpio will not extract the file unless told to do so +by the -u option. *Note Copy-in mode::. + + In copy-pass mode, cpio copies files from one directory tree to +another, combining the copy-out and copy-in steps without actually +using an archive. It reads the list of files to copy from the standard +input; the directory into which it will copy them is given as a +non-option argument. *Note Copy-pass mode::. + + % find . -depth -print0 | cpio --null -pvd new-dir + + The example shows copying the files of the present directory, and +sub-directories to a new directory called new-dir. Some new options are +the `-print0' available with GNU find, combined with the `--null' +option of cpio. These two options act together to send file names +between find and cpio, even if special characters are embedded in the +file names. Another is `-p', which tells cpio to pass the files it +finds to the directory `new-dir'. + + +File: cpio.info, Node: Invoking cpio, Next: Media, Prev: Tutorial, Up: Top + +3 Invoking cpio +*************** + +* Menu: + +* Copy-out mode:: +* Copy-in mode:: +* Copy-pass mode:: +* Options:: + + +File: cpio.info, Node: Copy-out mode, Next: Copy-in mode, Prev: Invoking cpio, Up: Invoking cpio + +3.1 Copy-out mode +================= + +In copy-out mode, cpio copies files into an archive. It reads a list +of filenames, one per line, on the standard input, and writes the +archive onto the standard output. A typical way to generate the list +of filenames is with the find command; you should give find the -depth +option to minimize problems with permissions on directories that are +unreadable. *Note Options::. + + cpio {-o|--create} [-0acvABLV] [-C bytes] [-H format] + [-M message] [-O [[user@]host:]archive] [-F [[user@]host:]archive] + [--file=[[user@]host:]archive] [--format=format] + [--message=message][--null] [--reset-access-time] [--verbose] + [--dot] [--append] [--block-size=blocks] [--dereference] + [--io-size=bytes] [--rsh-command=command] [--help] [--version] + < name-list [> archive] + + +File: cpio.info, Node: Copy-in mode, Next: Copy-pass mode, Prev: Copy-out mode, Up: Invoking cpio + +3.2 Copy-in mode +================ + +In copy-in mode, cpio copies files out of an archive or lists the +archive contents. It reads the archive from the standard input. Any +non-option command line arguments are shell globbing patterns; only +files in the archive whose names match one or more of those patterns are +copied from the archive. Unlike in the shell, an initial `.' in a +filename does match a wildcard at the start of a pattern, and a `/' in a +filename can match wildcards. If no patterns are given, all files are +extracted. *Note Options::. + + cpio {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] + [-H format] [-M message] [-R [user][:.][group]] + [-I [[user@]host:]archive] [-F [[user@]host:]archive] + [--file=[[user@]host:]archive] [--make-directories] + [--nonmatching] [--preserve-modification-time] + [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] + [--dot] [--unconditional] [--verbose] [--block-size=blocks] + [--swap-halfwords] [--io-size=bytes] [--pattern-file=file] + [--format=format] [--owner=[user][:.][group]] + [--no-preserve-owner] [--message=message] [--help] [--version] + [--no-absolute-filenames] [--sparse] [-only-verify-crc] [-quiet] + [--rsh-command=command] [pattern...] [< archive] + + +File: cpio.info, Node: Copy-pass mode, Next: Options, Prev: Copy-in mode, Up: Invoking cpio + +3.3 Copy-pass mode +================== + +In copy-pass mode, cpio copies files from one directory tree to +another, combining the copy-out and copy-in steps without actually +using an archive. It reads the list of files to copy from the standard +input; the directory into which it will copy them is given as a +non-option argument. *Note Options::. + + cpio {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]] + [--null] [--reset-access-time] [--make-directories] [--link] + [--preserve-modification-time] [--unconditional] [--verbose] + [--dot] [--dereference] [--owner=[user][:.][group]] [--sparse] + [--no-preserve-owner] [--help] [--version] destination-directory + < name-list + + +File: cpio.info, Node: Options, Prev: Copy-pass mode, Up: Invoking cpio + +3.4 Options +=========== + +`-0' +`--null' + Read a list of filenames terminated by a null character, instead + of a newline, so that files whose names contain newlines can be + archived. GNU find is one way to produce a list of + null-terminated filenames. This option may be used in copy-out + and copy-pass modes. + +`-a' +`--reset-access-time' + Reset the access times of files after reading them, so that it + does not look like they have just been read. + +`-A' +`--append' + Append to an existing archive. Only works in copy-out mode. The + archive must be a disk file specified with the `-O' or `-F' + (`--file') option. + +`-b' +`--swap' + Swap both halfwords of words and bytes of halfwords in the data. + Equivalent to -sS. This option may be used in copy-in mode. Use + this option to convert 32-bit integers between big-endian and + little-endian machines. + +`-B' + Set the I/O block size to 5120 bytes. Initially the block size is + 512 bytes. + +`--block-size=BLOCK-SIZE' + Set the I/O block size to BLOCK-SIZE * 512 bytes. + +`-c' + Use the old portable (ASCII) archive format. + +`-C IO-SIZE' +`--io-size=IO-SIZE' + Set the I/O block size to IO-SIZE bytes. + +`-d' +`--make-directories' + Create leading directories where needed. + +`-E FILE' +`--pattern-file=FILE' + Read additional patterns specifying filenames to extract or list + from FILE. The lines of FILE are treated as if they had been + non-option arguments to cpio. This option is used in copy-in mode, + +`-f' +`--nonmatching' + Only copy files that do not match any of the given patterns. + +`-F ARCHIVE' +`--file=ARCHIVE' + Archive filename to use instead of standard input or output. To + use a tape drive on another machine as the archive, use a filename + that starts with `HOSTNAME:', where HOSTNAME is the name or IP + address of the machine. The hostname can be preceded by a + username and an `@' to access the remote tape drive as that user, + if you have permission to do so (typically an entry in that user's + `~/.rhosts' file). + +`--force-local' + With `-F', `-I', or `-O', take the archive file name to be a local + file even if it contains a colon, which would ordinarily indicate + a remote host name. + +`-H FORMAT' +`--format=FORMAT' + Use archive format FORMAT. The valid formats are listed below; + the same names are also recognized in all-caps. The default in + copy-in mode is to automatically detect the archive format, and in + copy-out mode is `bin'. + + `bin' + The obsolete binary format. + + `odc' + The old (POSIX.1) portable format. + + `newc' + The new (SVR4) portable format, which supports file systems + having more than 65536 i-nodes. + + `crc' + The new (SVR4) portable format with a checksum added. + + `tar' + The old tar format. + + `ustar' + The POSIX.1 tar format. Also recognizes GNU tar archives, + which are similar but not identical. + + `hpbin' + The obsolete binary format used by HPUX's cpio (which stores + device files differently). + + `hpodc' + The portable format used by HPUX's cpio (which stores device + files differently). + +`-i' +`--extract' + Run in copy-in mode. *Note Copy-in mode::. + +`-I ARCHIVE' + Archive filename to use instead of standard input. To use a tape + drive on another machine as the archive, use a filename that + starts with `HOSTNAME:', where HOSTNAME is the name or IP address + of the remote host. The hostname can be preceded by a username + and an `@' to access the remote tape drive as that user, if you + have permission to do so (typically an entry in that user's + `~/.rhosts' file). + +`-k' + Ignored; for compatibility with other versions of cpio. + +`-l' +`--link' + Link files instead of copying them, when possible. + +`-L' +`--dereference' + Copy the file that a symbolic link points to, rather than the + symbolic link itself. + +`-m' +`--preserve-modification-time' + Retain previous file modification times when creating files. + +`-M MESSAGE' +`--message=MESSAGE' + Print MESSAGE when the end of a volume of the backup media (such + as a tape or a floppy disk) is reached, to prompt the user to + insert a new volume. If MESSAGE contains the string `%d', it is + replaced by the current volume number (starting at 1). + +`-n' +`--numeric-uid-gid' + Show numeric UID and GID instead of translating them into names + when using the `--verbose' option. + +`--no-absolute-filenames' + Create all files relative to the current directory in copy-in + mode, even if they have an absolute file name in the archive. + +`--no-preserve-owner' + Do not change the ownership of the files; leave them owned by the + user extracting them. This is the default for non-root users, so + that users on System V don't inadvertantly give away files. This + option can be used in copy-in mode and copy-pass mode + +`-o' +`--create' + Run in copy-out mode. *Note Copy-out mode::. + +`-O ARCHIVE' + Archive filename to use instead of standard output. To use a tape + drive on another machine as the archive, use a filename that + starts with `HOSTNAME:', where HOSTNAME is the name or IP address + of the machine. The hostname can be preceded by a username and an + `@' to access the remote tape drive as that user, if you have + permission to do so (typically an entry in that user's `~/.rhosts' + file). + +`--only-verify-crc' + Verify the CRC's of each file in the archive, when reading a CRC + format archive. Don't actually extract the files. + +`-p' +`--pass-through' + Run in copy-pass mode. *Note Copy-pass mode::. + +`--quiet' + Do not print the number of blocks copied. + +`-r' +`--rename' + Interactively rename files. + +`-R OWNER' +`--owner OWNER' + In copy-in and copy-pass mode, set the ownership of all files + created to the specified OWNER (this operation is allowed only for + the super-user). In copy-out mode, store the supplied owner + information in the archive. + + The argument can be either the user name or the user name and + group name, separated by a dot or a colon, or the group name, + preceeded by a dot or a colon, as shown in the examples below: + + cpio --owner smith + cpio --owner smith: + cpio --owner smith:users + cpio --owner :users + + If the group is omitted but the `:' or `.' separator is given, as + in the second example. the given user's login group will be used. + +`--rsh-command=COMMAND' + Notifies cpio that is should use COMMAND to communicate with remote + devices. + +`-s' +`--swap-bytes' + Swap the bytes of each halfword (pair of bytes) in the files. This + option can be used in copy-in mode. + +`-S' +`--swap-halfwords' + Swap the halfwords of each word (4 bytes) in the files. This + option may be used in copy-in mode. + +`--sparse' + Write files with large blocks of zeros as sparse files. This + option is used in copy-in and copy-pass modes. + +`-t' +`--list' + Print a table of contents of the input. + +`-u' +`--unconditional' + Replace all files, without asking whether to replace existing + newer files with older files. + +`-v' +`--verbose' + List the files processed, or with `-t', give an `ls -l' style + table of contents listing. In a verbose table of contents of a + ustar archive, user and group names in the archive that do not + exist on the local system are replaced by the names that + correspond locally to the numeric UID and GID stored in the + archive. + +`-V' +`--dot' + Print a `.' for each file processed. + +`--version' + Print the cpio program version number and exit. + + +File: cpio.info, Node: Media, Next: Reports, Prev: Invoking cpio, Up: Top + +4 Magnetic Media +**************** + +Archives are usually written on removable media-tape cartridges, mag +tapes, or floppy disks. + + The amount of data a tape or disk holds depends not only on its size, +but also on how it is formatted. A 2400 foot long reel of mag tape +holds 40 megabytes of data when formated at 1600 bits per inch. The +physically smaller EXABYTE tape cartridge holds 2.3 gigabytes. + + Magnetic media are re-usable-once the archive on a tape is no longer +needed, the archive can be erased and the tape or disk used over. Media +quality does deteriorate with use, however. Most tapes or disks should +be disgarded when they begin to produce data errors. + + Magnetic media are written and erased using magnetic fields, and +should be protected from such fields to avoid damage to stored data. +Sticking a floppy disk to a filing cabinet using a magnet is probably +not a good idea. + + +File: cpio.info, Node: Reports, Next: Concept Index, Prev: Media, Up: Top + +5 Reporting bugs or suggestions +******************************* + +It is possible you will encounter a bug in `cpio'. If this happens, we +would like to hear about it. As the purpose of bug reporting is to +improve software, please be sure to include maximum information when +reporting a bug. The information needed is: + + * Version of the package you are using. + + * Compilation options used when configuring the package. + + * Conditions under which the bug appears. + + Send your report to . Allow us a couple of days to +answer. + + +File: cpio.info, Node: Concept Index, Prev: Reports, Up: Top + +Concept Index +************* + +[index] +* Menu: + +* command line options: Invoking cpio. (line 6) +* copying directory structures: Tutorial. (line 6) +* creating a cpio archive: Tutorial. (line 6) +* extracting a cpio archive: Tutorial. (line 6) +* invoking cpio: Invoking cpio. (line 6) +* magnetic media: Media. (line 6) +* passing directory structures: Tutorial. (line 6) + + + +Tag Table: +Node: Top1008 +Node: Introduction1789 +Node: Tutorial2505 +Node: Invoking cpio6176 +Node: Copy-out mode6367 +Node: Copy-in mode7297 +Node: Copy-pass mode8682 +Node: Options9481 +Node: Media17343 +Node: Reports18322 +Node: Concept Index18953 + +End Tag Table diff --git a/doc/cpio.texi b/doc/cpio.texi new file mode 100644 index 0000000..a821269 --- /dev/null +++ b/doc/cpio.texi @@ -0,0 +1,602 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename cpio.info +@settitle cpio +@setchapternewpage off +@c %**end of header + +@dircategory Archiving +@direntry +* Cpio: (cpio). Copy-in-copy-out archiver to tape or disk. +@end direntry + +@include version.texi + +@copying +This manual documents GNU cpio (version @value{VERSION}, @value{UPDATED}). + +Copyright @copyright{} 1995, 2001, 2002, 2004 Free Software Foundation, Inc. +@sp 1 +@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 +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover texts being ``A GNU Manual'', +and with the Back-Cover Texts as in (a) below. A copy of the license +is included in the section entitled ``GNU Free Documentation License''. + +(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify +this GNU Manual, like GNU software. Copies published by the Free +Software Foundation raise funds for GNU development.'' +@end quotation +@end copying + +@titlepage +@title GNU CPIO +@subtitle @value{VERSION} @value{UPDATED} +@author by Robert Carleton +@c copyright page +@page +@vskip 0pt plus 1filll +@insertcopying +@sp 2 +Published by the Free Software Foundation @* +51 Franklin Street, Fifth Floor, @* +Boston, MA 02110-1301, USA @* +@end titlepage + +@node Top, Introduction, (dir), (dir) +@comment node-name, next, previous, up + +@ifinfo +@top + +GNU cpio is a tool for creating and extracting archives, or copying +files from one place to another. It handles a number of cpio formats as +well as reading and writing tar files. This is the first edition of the +GNU cpio documentation and is consistent with @value{VERSION}. + +@end ifinfo + +@menu +* Introduction:: +* Tutorial:: Getting started. +* Invoking cpio:: How to invoke @command{cpio}. +* Media:: Using tapes and other archive media. +* Reports:: Reporting bugs or suggestions +* Concept Index:: Concept index. + +@detailmenu + --- The Detailed Node Listing --- + +Invoking cpio + +* Copy-out mode:: +* Copy-in mode:: +* Copy-pass mode:: +* Options:: + +@end detailmenu +@end menu + +@node Introduction, Tutorial, Top, Top +@comment node-name, next, previous, up +@chapter Introduction + +GNU cpio copies files into or out of a cpio or tar archive, The archive +can be another file on the disk, a magnetic tape, or a pipe. + +GNU cpio supports the following archive formats: binary, old ASCII, new +ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1 tar. The +tar format is provided for compatibility with the tar program. By +default, cpio creates binary format archives, for compatibility with +older cpio programs. When extracting from archives, cpio automatically +recognizes which kind of archive it is reading and can read archives +created on machines with a different byte-order. + +@node Tutorial, Invoking cpio, Introduction, Top +@comment node-name, next, previous, up +@chapter Tutorial +@cindex creating a cpio archive +@cindex extracting a cpio archive +@cindex copying directory structures +@cindex passing directory structures + + +GNU cpio performs three primary functions. Copying files to an +archive, Extracting files from an archive, and passing files to another +directory tree. An archive can be a file on disk, one or more floppy +disks, or one or more tapes. + +When creating an archive, cpio takes the list of files to be processed +from the standard input, and then sends the archive to the standard +output, or to the device defined by the @option{-F} option. +@xref{Copy-out mode}. Usually find or ls is used to provide this list +to the standard input. In the following example you can see the +possibilities for archiving the contents of a single directory. + + +@example +@cartouche +% ls | cpio -ov > directory.cpio +@end cartouche +@end example + +The @option{-o} option creates the archive, and the @option{-v} option +prints the names of the files archived as they are added. Notice that +the options can be put together after a single @option{-} or can be placed +separately on the command line. The @samp{>} redirects the cpio output +to the file @samp{directory.cpio}. + + +If you wanted to archive an entire directory tree, the find command can +provide the file list to cpio: + + +@example +@cartouche +% find . -print -depth | cpio -ov > tree.cpio +@end cartouche +@end example + + +This will take all the files in the current directory, the directories +below and place them in the archive tree.cpio. Again the @option{-o} +creates an archive, and the @option{-v} option shows you the name of the +files as they are archived. @xref{Copy-out mode}. Using the @samp{.} in the +find statement will give you more flexibility when doing restores, as it +will save file names with a relative path vice a hard wired, absolute +path. The @option{-depth} option forces @samp{find} to print of the +entries in a directory before printing the directory itself. This +limits the effects of restrictive directory permissions by printing the +directory entries in a directory before the directory name itself. + + + + +Extracting an archive requires a bit more thought because cpio will not +create directories by default. Another characteristic, is it will not +overwrite existing files unless you tell it to. + + +@example +@cartouche +% cpio -iv < directory.cpio +@end cartouche +@end example + +This will retrieve the files archived in the file directory.cpio and +place them in the present directory. The @option{-i} option extracts the +archive and the @option{-v} shows the file names as they are extracted. +If you are dealing with an archived directory tree, you need to use the +@option{-d} option to create directories as necessary, something like: + +@example +@cartouche +% cpio -idv < tree.cpio +@end cartouche +@end example + +This will take the contents of the archive tree.cpio and extract it to +the current directory. If you try to extract the files on top of files +of the same name that already exist (and have the same or later +modification time) cpio will not extract the file unless told to do so +by the -u option. @xref{Copy-in mode}. + + +In copy-pass mode, cpio copies files from one directory tree to another, +combining the copy-out and copy-in steps without actually using an +archive. It reads the list of files to copy from the standard input; +the directory into which it will copy them is given as a non-option +argument. @xref{Copy-pass mode}. + +@example +@cartouche +% find . -depth -print0 | cpio --null -pvd new-dir +@end cartouche +@end example + + +The example shows copying the files of the present directory, and +sub-directories to a new directory called new-dir. Some new options are +the @option{-print0} available with GNU find, combined with the +@option{--null} option of cpio. These two options act together to send +file names between find and cpio, even if special characters are +embedded in the file names. Another is @option{-p}, which tells cpio to +pass the files it finds to the directory @samp{new-dir}. + +@node Invoking cpio, Media, Tutorial, Top +@comment node-name, next, previous, up +@chapter Invoking cpio +@cindex invoking cpio +@cindex command line options + +@menu +* Copy-out mode:: +* Copy-in mode:: +* Copy-pass mode:: +* Options:: +@end menu + +@node Copy-out mode, Copy-in mode, Invoking cpio, Invoking cpio +@comment node-name, next, previous, up +@section Copy-out mode + +In copy-out mode, cpio copies files into an archive. It reads a list +of filenames, one per line, on the standard input, and writes the +archive onto the standard output. A typical way to generate the list +of filenames is with the find command; you should give find the -depth +option to minimize problems with permissions on directories that are +unreadable. +@xref{Options}. + +@example +cpio @{-o|--create@} [-0acvABLV] [-C bytes] [-H format] +[-M message] [-O [[user@@]host:]archive] [-F [[user@@]host:]archive] +[--file=[[user@@]host:]archive] [--format=format] +[--message=message][--null] [--reset-access-time] [--verbose] +[--dot] [--append] [--block-size=blocks] [--dereference] +[--io-size=bytes] [--rsh-command=command] [--help] [--version] +< name-list [> archive] +@end example + +@node Copy-in mode, Copy-pass mode, Copy-out mode, Invoking cpio +@comment node-name, next, previous, up +@section Copy-in mode + +In copy-in mode, cpio copies files out of an archive or lists the +archive contents. It reads the archive from the standard input. Any +non-option command line arguments are shell globbing patterns; only +files in the archive whose names match one or more of those patterns are +copied from the archive. Unlike in the shell, an initial @samp{.} in a +filename does match a wildcard at the start of a pattern, and a @samp{/} in a +filename can match wildcards. If no patterns are given, all files are +extracted. @xref{Options}. + +@example +cpio @{-i|--extract@} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] +[-H format] [-M message] [-R [user][:.][group]] +[-I [[user@@]host:]archive] [-F [[user@@]host:]archive] +[--file=[[user@@]host:]archive] [--make-directories] +[--nonmatching] [--preserve-modification-time] +[--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] +[--dot] [--unconditional] [--verbose] [--block-size=blocks] +[--swap-halfwords] [--io-size=bytes] [--pattern-file=file] +[--format=format] [--owner=[user][:.][group]] +[--no-preserve-owner] [--message=message] [--help] [--version] +[--no-absolute-filenames] [--sparse] [-only-verify-crc] [-quiet] +[--rsh-command=command] [pattern...] [< archive] +@end example + +@node Copy-pass mode, Options, Copy-in mode, Invoking cpio +@comment node-name, next, previous, up +@section Copy-pass mode + +In copy-pass mode, cpio copies files from one directory tree to +another, combining the copy-out and copy-in steps without actually +using an archive. It reads the list of files to copy from the +standard input; the directory into which it will copy them is given as +a non-option argument. +@xref{Options}. + +@example +cpio @{-p|--pass-through@} [-0adlmuvLV] [-R [user][:.][group]] +[--null] [--reset-access-time] [--make-directories] [--link] +[--preserve-modification-time] [--unconditional] [--verbose] +[--dot] [--dereference] [--owner=[user][:.][group]] [--sparse] +[--no-preserve-owner] [--help] [--version] destination-directory +< name-list +@end example + + + +@node Options, , Copy-pass mode, Invoking cpio +@comment node-name, next, previous, up +@section Options + + +@table @code + + +@item -0 +@itemx --null +Read a list of filenames terminated by a null character, instead of a +newline, so that files whose names contain newlines can be archived. +GNU find is one way to produce a list of null-terminated filenames. +This option may be used in copy-out and copy-pass modes. + +@item -a +@itemx --reset-access-time +Reset the access times of files after reading them, so +that it does not look like they have just been read. + +@item -A +@itemx --append +Append to an existing archive. Only works in copy-out +mode. The archive must be a disk file specified with +the @option{-O} or @option{-F} (@option{--file}) option. + +@item -b +@itemx --swap +Swap both halfwords of words and bytes of halfwords in the data. +Equivalent to -sS. This option may be used in copy-in mode. Use this +option to convert 32-bit integers between big-endian and little-endian +machines. + +@item -B +Set the I/O block size to 5120 bytes. Initially the +block size is 512 bytes. + +@item --block-size=@var{block-size} +Set the I/O block size to @var{block-size} * 512 bytes. + +@item -c +Use the old portable (ASCII) archive format. + +@item -C @var{io-size} +@itemx --io-size=@var{io-size} +Set the I/O block size to @var{io-size} bytes. + +@item -d +@itemx --make-directories +Create leading directories where needed. + +@item -E @var{file} +@itemx --pattern-file=@var{file} +Read additional patterns specifying filenames to extract or list from +@var{file}. The lines of @var{file} are treated as if they had been non-option +arguments to cpio. This option is used in copy-in mode, + +@item -f +@itemx --nonmatching +Only copy files that do not match any of the given +patterns. + +@item -F @var{archive} +@itemx --file=@var{archive} +Archive filename to use instead of standard input or output. To use a +tape drive on another machine as the archive, use a filename that starts +with @samp{@var{hostname}:}, where @var{hostname} is the name or IP +address of the machine. The hostname can be preceded by a username and an +@samp{@@} to access the remote tape drive as that user, if you have +permission to do so (typically an entry in that user's @file{~/.rhosts} +file). + +@item --force-local +With @option{-F}, @option{-I}, or @option{-O}, take the archive file name to be a +local file even if it contains a colon, which would +ordinarily indicate a remote host name. + +@item -H @var{format} +@itemx --format=@var{format} +Use archive format @var{format}. The valid formats are listed below; the same +names are also recognized in all-caps. The default in copy-in mode is +to automatically detect the archive format, and in copy-out mode is +@samp{bin}. + +@table @samp +@item bin +The obsolete binary format. + +@item odc +The old (POSIX.1) portable format. + +@item newc +The new (SVR4) portable format, which supports file systems having more +than 65536 i-nodes. + +@item crc +The new (SVR4) portable format with a checksum added. + +@item tar +The old tar format. + +@item ustar +The POSIX.1 tar format. Also recognizes GNU tar archives, which are +similar but not identical. + +@item hpbin +The obsolete binary format used by HPUX's cpio (which stores device +files differently). + +@item hpodc +The portable format used by HPUX's cpio (which stores device files +differently). +@end table + +@item -i +@itemx --extract +Run in copy-in mode. +@xref{Copy-in mode}. + +@item -I @var{archive} +Archive filename to use instead of standard input. To use a tape drive +on another machine as the archive, use a filename that starts with +@samp{@var{hostname}:}, where @var{hostname} is the name or IP address +of the remote host. The hostname can be preceded by a username and an @samp{@@} to +access the remote tape drive as that user, if you have permission to do +so (typically an entry in that user's @file{~/.rhosts} file). + +@item -k +Ignored; for compatibility with other versions of cpio. + +@item -l +@itemx --link +Link files instead of copying them, when possible. + +@item -L +@itemx --dereference +Copy the file that a symbolic link points to, rather than the symbolic +link itself. + +@item -m +@itemx --preserve-modification-time +Retain previous file modification times when creating files. + +@item -M @var{message} +@itemx --message=@var{message} +Print @var{message} when the end of a volume of the backup media (such as a +tape or a floppy disk) is reached, to prompt the user to insert a new +volume. If @var{message} contains the string @samp{%d}, it is replaced by the +current volume number (starting at 1). + +@item -n +@itemx --numeric-uid-gid +Show numeric UID and GID instead of translating them into names when using the +@option{--verbose} option. + +@item --no-absolute-filenames +Create all files relative to the current directory in copy-in mode, even +if they have an absolute file name in the archive. + +@item --no-preserve-owner +Do not change the ownership of the files; leave them owned by the user +extracting them. This is the default for non-root users, so that users +on System V don't inadvertantly give away files. This option can be +used in copy-in mode and copy-pass mode + +@item -o +@itemx --create +Run in copy-out mode. +@xref{Copy-out mode}. + +@item -O @var{archive} +Archive filename to use instead of standard output. To use a tape drive +on another machine as the archive, use a filename that starts with +@samp{@var{hostname}:}, where @var{hostname} is the name or IP address +of the machine. The hostname can be preceded by a username and an @samp{@@} to +access the remote tape drive as that user, if you have permission to do +so (typically an entry in that user's @file{~/.rhosts} file). + +@item --only-verify-crc +Verify the CRC's of each file in the archive, when reading a CRC format +archive. Don't actually extract the files. + +@item -p +@itemx --pass-through +Run in copy-pass mode. +@xref{Copy-pass mode}. + +@item --quiet +Do not print the number of blocks copied. + +@item -r +@itemx --rename +Interactively rename files. + +@item -R @var{owner} +@itemx --owner @var{owner} + +In copy-in and copy-pass mode, set the ownership of all files created +to the specified @var{owner} (this operation is allowed only for the +super-user). In copy-out mode, store the supplied owner information in +the archive. + +The argument can be either the user name or the user name +and group name, separated by a dot or a colon, or the group name, +preceeded by a dot or a colon, as shown in the examples below: + +@smallexample +@group +cpio --owner smith +cpio --owner smith: +cpio --owner smith:users +cpio --owner :users +@end group +@end smallexample + +@noindent +If the group is omitted but the @samp{:} or @samp{.} separator is +given, as in the second example. the given user's login group will be +used. + +@item --rsh-command=@var{command} +Notifies cpio that is should use @var{command} to communicate with remote +devices. + +@item -s +@itemx --swap-bytes +Swap the bytes of each halfword (pair of bytes) in the files. This option +can be used in copy-in mode. + +@item -S +@itemx --swap-halfwords +Swap the halfwords of each word (4 bytes) in the files. This option may +be used in copy-in mode. + +@item --sparse +Write files with large blocks of zeros as sparse files. This option is +used in copy-in and copy-pass modes. + +@item -t +@itemx --list +Print a table of contents of the input. + +@item -u +@itemx --unconditional +Replace all files, without asking whether to replace +existing newer files with older files. + +@item -v +@itemx --verbose +List the files processed, or with @option{-t}, give an @samp{ls -l} style +table of contents listing. In a verbose table of contents of a ustar +archive, user and group names in the archive that do not exist on the +local system are replaced by the names that correspond locally to the +numeric UID and GID stored in the archive. + +@item -V +@itemx --dot +Print a @samp{.} for each file processed. + +@item --version +Print the cpio program version number and exit. +@end table + + +@node Media, Reports, Invoking cpio, Top +@comment node-name, next, previous, up +@chapter Magnetic Media +@cindex magnetic media + +Archives are usually written on removable media--tape cartridges, mag +tapes, or floppy disks. + +The amount of data a tape or disk holds depends not only on its size, +but also on how it is formatted. A 2400 foot long reel of mag tape +holds 40 megabytes of data when formated at 1600 bits per inch. The +physically smaller EXABYTE tape cartridge holds 2.3 gigabytes. + +Magnetic media are re-usable--once the archive on a tape is no longer +needed, the archive can be erased and the tape or disk used over. Media +quality does deteriorate with use, however. Most tapes or disks should +be disgarded when they begin to produce data errors. + +Magnetic media are written and erased using magnetic fields, and should +be protected from such fields to avoid damage to stored data. Sticking +a floppy disk to a filing cabinet using a magnet is probably not a good +idea. + +@node Reports, Concept Index, Media, Top +@chapter Reporting bugs or suggestions + +It is possible you will encounter a bug in @command{cpio}. +If this happens, we would like to hear about it. As the purpose of bug +reporting is to improve software, please be sure to include maximum +information when reporting a bug. The information needed is: + +@itemize @bullet +@item Version of the package you are using. +@item Compilation options used when configuring the package. +@item Conditions under which the bug appears. +@end itemize + +Send your report to . Allow us a couple of +days to answer. + +@node Concept Index, , Reports, Top +@comment node-name, next, previous, up +@unnumbered Concept Index +@printindex cp +@contents +@bye diff --git a/doc/gendocs_template b/doc/gendocs_template new file mode 100755 index 0000000..74dcf43 --- /dev/null +++ b/doc/gendocs_template @@ -0,0 +1,108 @@ + + + + + + +%%TITLE%% - GNU Project - Free Software Foundation (FSF) + + + + + + + + + + + + + + +

%%TITLE%%

+ +
Free Software Foundation
+
last updated %%DATE%%
+

+ +  [image of the head of a GNU] + +(no gifs due to patent problems) +

+
+ +The manual for %%PACKAGE%% is available in the following formats:

+ + + +

(This page generated by the %%SCRIPTNAME%% script.) +

+ +

+Valid XHTML 1.0! +

+ + + + + diff --git a/doc/mt.1 b/doc/mt.1 new file mode 100644 index 0000000..ee10add --- /dev/null +++ b/doc/mt.1 @@ -0,0 +1,126 @@ +.TH MT 1L \" -*- nroff -*- +.SH NAME +mt \- control magnetic tape drive operation +.SH SYNOPSIS +.B mt +[\-V] [\-f device] [\-\-file=device] [\-\-rsh-command=command] [\-\-version] +operation [count] +.SH DESCRIPTION +This manual page +documents the GNU version of +.BR mt . +.B mt +performs the given +.IR operation , +which must be one of the tape operations listed below, on a tape +drive. +.PP +The default tape device to operate on is taken from the file +.I /usr/include/sys/mtio.h +when +.B mt +is compiled. It can be overridden by giving a device file name in +the environment variable +.BR TAPE +or by a command line option (see below), which also overrides the +environment variable. +.PP +The device must be either a character special file or a +remote tape drive. To use a tape drive on another machine as the +archive, use a filename that starts with `HOSTNAME:'. The +hostname can be preceded by a username and an `@' to access the remote +tape drive as that user, if you have permission to do so (typically an +entry in that user's `~/.rhosts' file). +.PP +The available operations are listed below. Unique abbreviations are +accepted. Not all operations are available on all systems, or work on +all types of tape drives. +Some operations optionally take a repeat count, which can be given +after the operation name and defaults to 1. +.IP "eof, weof" +Write +.I count +EOF marks at current position. +.IP fsf +Forward space +.I count +files. +The tape is positioned on the first block of the next file. +.IP bsf +Backward space +.I count +files. +The tape is positioned on the first block of the next file. +.IP fsr +Forward space +.I count +records. +.IP bsr +Backward space +.I count +records. +.IP bsfm +Backward space +.I count +file marks. +The tape is positioned on the beginning-of-the-tape side of +the file mark. +.IP fsfm +Forward space +.I count +file marks. +The tape is positioned on the beginning-of-the-tape side of +the file mark. +.IP asf +Absolute space to file number +.IR count . +Equivalent to rewind followed by fsf +.IR count . +.IP seek +Seek to block number +.IR count . +.IP eom +Space to the end of the recorded media on the tape +(for appending files onto tapes). +.IP rewind +Rewind the tape. +.IP "offline, rewoffl" +Rewind the tape and, if applicable, unload the tape. +.IP status +Print status information about the tape unit. +.IP retension +Rewind the tape, then wind it to the end of the reel, +then rewind it again. +.IP erase +Erase the tape. +.PP +.B mt +exits with a status of 0 if the operation succeeded, 1 if the +operation or device name given was invalid, or 2 if the operation +failed. +.SS OPTIONS +.TP +.I "\-f, \-\-file=device" +Use +.I device +as the file name of the tape drive to operate on. +To use a +tape drive on another machine, use a filename that +starts with `HOSTNAME:'. The hostname can be preceded by a +username and an `@' to access the remote tape drive as that user, if +you have permission to do so (typically an entry in that user's +`~/.rhosts' file). +.TP +.I "\-\-rsh-command=command" +Notifies +.B mt +that it should use +.I command +to communicate with remote devices instead of +.I /usr/bin/ssh +or +.IR /usr/bin/rsh . +.TP +.I "\-V, \-\-version" +Print the version number of +.BR mt . diff --git a/doc/stamp-vti b/doc/stamp-vti new file mode 100644 index 0000000..c20cd8c --- /dev/null +++ b/doc/stamp-vti @@ -0,0 +1,4 @@ +@set UPDATED 7 June 2007 +@set UPDATED-MONTH June 2007 +@set EDITION 2.8 +@set VERSION 2.8 diff --git a/doc/version.texi b/doc/version.texi new file mode 100644 index 0000000..c20cd8c --- /dev/null +++ b/doc/version.texi @@ -0,0 +1,4 @@ +@set UPDATED 7 June 2007 +@set UPDATED-MONTH June 2007 +@set EDITION 2.8 +@set VERSION 2.8 diff --git a/headers/Makefile.am b/headers/Makefile.am new file mode 100644 index 0000000..5ff1df1 --- /dev/null +++ b/headers/Makefile.am @@ -0,0 +1,19 @@ +# This file is part of GNU cpio +# 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. + +EXTRA_DIST=fnmatch.h diff --git a/headers/Makefile.in b/headers/Makefile.in new file mode 100644 index 0000000..9dc4086 --- /dev/null +++ b/headers/Makefile.in @@ -0,0 +1,589 @@ +# Makefile.in generated by automake 1.10a from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# This file is part of GNU cpio +# 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. +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@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 +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = headers +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/argp.m4 \ + $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/canonicalize-lgpl.m4 \ + $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \ + $(top_srcdir)/m4/clock_time.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/d-ino.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/exitfail.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/getcwd-abort-bug.m4 \ + $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \ + $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/hash.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/inline.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/lchown.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mempcpy.m4 \ + $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mktime.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ + $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/paxutils.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \ + $(top_srcdir)/m4/rmt.m4 $(top_srcdir)/m4/rtapelib.m4 \ + $(top_srcdir)/m4/safe-read.m4 $(top_srcdir)/m4/safe-write.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sysexits.m4 \ + $(top_srcdir)/m4/system.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/ulonglong.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vsnprintf.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ +ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ +ABSOLUTE_FLOAT_H = @ABSOLUTE_FLOAT_H@ +ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_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_SYSEXITS_H = @ABSOLUTE_SYSEXITS_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@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPIO_MT_PROG = @CPIO_MT_PROG@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_RMT_COMMAND = @DEFAULT_RMT_COMMAND@ +DEFAULT_RMT_DIR = @DEFAULT_RMT_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIRENT_H = @DIRENT_H@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXEEXT = @EXEEXT@ +FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_H = @GETOPT_H@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ +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_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_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYSEXITS_H = @HAVE_SYSEXITS_H@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE__BOOL = @HAVE__BOOL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTTYPES_H = @INTTYPES_H@ +LDFLAGS = @LDFLAGS@ +LIBCPIO_LIBDEPS = @LIBCPIO_LIBDEPS@ +LIBCPIO_LTLIBDEPS = @LIBCPIO_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_SETSOCKOPT = @LIB_SETSOCKOPT@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +PU_RMT_PROG = @PU_RMT_PROG@ +RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYSEXITS_H = @SYSEXITS_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@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = fnmatch.h +all: all-am + +.SUFFIXES: +$(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; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits headers/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits headers/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(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 +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + 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; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +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 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.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-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 + +# 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/headers/fnmatch.h b/headers/fnmatch.h new file mode 100644 index 0000000..f20da8f --- /dev/null +++ b/headers/fnmatch.h @@ -0,0 +1,67 @@ +/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +This library 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General +Public License along with this library; see the file COPYING.LIB. +If not, write to the Free Software Foundation, Inc., 51 Franklin +Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + +#ifndef _FNMATCH_H + +#define _FNMATCH_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) +#undef __P +#define __P(protos) protos +#else /* Not C++ or ANSI C. */ +#undef __P +#define __P(protos) () +/* We can get away without defining `const' here only because in this file + it is used only inside the prototype for `fnmatch', which is elided in + non-ANSI C where `const' is problematical. */ +#endif /* C++ or ANSI C. */ + + +/* We #undef these before defining them because some losing systems + (HP-UX A.08.07 for example) define these in . */ +#undef FNM_PATHNAME +#undef FNM_NOESCAPE +#undef FNM_PERIOD + +/* Bits set in the FLAGS argument to `fnmatch'. */ +#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ +#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ +#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ + +#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) +#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ +#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ +#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ +#endif + +/* Value returned by `fnmatch' if STRING does not match PATTERN. */ +#define FNM_NOMATCH 1 + +/* Match STRING against the filename pattern PATTERN, + returning zero if it matches, FNM_NOMATCH if not. */ +extern int fnmatch __P ((const char *__pattern, const char *__string, + int __flags)); + +#ifdef __cplusplus +} +#endif + +#endif /* fnmatch.h */ diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..7a56237 --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,48 @@ +# Makefile for GNU cpio library. + +# Copyright (C) 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. + +include gnulib.mk + +noinst_HEADERS += \ + paxlib.h\ + rmt.h\ + rmt-command.h\ + system-ioctl.h\ + system.h + +libcpio_a_SOURCES += \ + fatal.c\ + paxerror.c\ + paxexit.c\ + paxlib.h\ + paxnames.c\ + rtapelib.c + +DISTCLEANFILES += rmt-command.h +rmt-command.h: Makefile + echo '#define LOCALEDIR "$(localedir)"' >$@ + echo "#ifndef DEFAULT_RMT_COMMAND" >> $@ + echo "# define DEFAULT_RMT_COMMAND \"$(DEFAULT_RMT_DIR)/`echo \"rmt\" | sed 's,^.*/,,;$(transform)'`$(EXEEXT)\"" >> $@ + echo "#endif" >> $@ + +BUILT_SOURCES += rmt-command.h +CLEANFILES += rmt-command.h + +libcpio_a_LIBADD += $(LIBOBJS) +libcpio_a_DEPENDENCIES += $(LIBOBJS) diff --git a/lib/Makefile.in b/lib/Makefile.in new file mode 100644 index 0000000..be86cc7 --- /dev/null +++ b/lib/Makefile.in @@ -0,0 +1,1322 @@ +# Makefile.in generated by automake 1.10a from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile for GNU cpio library. + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. + +# Copyright (C) 2004-2007 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 +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libcpio --source-base=.#bootmp/lib --m4-base=.#bootmp/m4 --doc-base=.#bootmp/doc --aux-dir=.#bootmp/build-aux --avoid=lock --avoid=size_max --no-libtool --macro-prefix=gl alloca argmatch argp closeout configmake dirname error fileblocks fnmatch-gnu full-write getdate getopt gettext hash inttostr inttypes lchown obstack quote quotearg safe-read savedir stdbool stdint stpcpy strerror strtol unlocked-io utimens version-etc-fsf xalloc xalloc-die + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@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 +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/gnulib.mk alloca.c getdate.c +subdir = lib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/argp.m4 \ + $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/canonicalize-lgpl.m4 \ + $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \ + $(top_srcdir)/m4/clock_time.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/d-ino.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/exitfail.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/getcwd-abort-bug.m4 \ + $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \ + $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/hash.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/inline.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/lchown.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mempcpy.m4 \ + $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mktime.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ + $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/paxutils.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \ + $(top_srcdir)/m4/rmt.m4 $(top_srcdir)/m4/rtapelib.m4 \ + $(top_srcdir)/m4/safe-read.m4 $(top_srcdir)/m4/safe-write.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sysexits.m4 \ + $(top_srcdir)/m4/system.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/ulonglong.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vsnprintf.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +libcpio_a_AR = $(AR) $(ARFLAGS) +am__DEPENDENCIES_1 = +am_libcpio_a_OBJECTS = allocsa.$(OBJEXT) argp-ba.$(OBJEXT) \ + argp-eexst.$(OBJEXT) argp-fmtstream.$(OBJEXT) \ + argp-fs-xinl.$(OBJEXT) argp-help.$(OBJEXT) \ + argp-parse.$(OBJEXT) argp-pin.$(OBJEXT) argp-pv.$(OBJEXT) \ + argp-pvh.$(OBJEXT) argp-xinl.$(OBJEXT) full-write.$(OBJEXT) \ + getdate.$(OBJEXT) openat-die.$(OBJEXT) version-etc.$(OBJEXT) \ + version-etc-fsf.$(OBJEXT) xalloc-die.$(OBJEXT) \ + xstrndup.$(OBJEXT) fatal.$(OBJEXT) paxerror.$(OBJEXT) \ + paxexit.$(OBJEXT) paxnames.$(OBJEXT) rtapelib.$(OBJEXT) +libcpio_a_OBJECTS = $(am_libcpio_a_OBJECTS) +LTLIBRARIES = $(noinst_LTLIBRARIES) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) +YLWRAP = $(top_srcdir)/build-aux/ylwrap +SOURCES = $(libcpio_a_SOURCES) $(EXTRA_libcpio_a_SOURCES) +DIST_SOURCES = $(libcpio_a_SOURCES) $(EXTRA_libcpio_a_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ +ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ +ABSOLUTE_FLOAT_H = @ABSOLUTE_FLOAT_H@ +ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_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_SYSEXITS_H = @ABSOLUTE_SYSEXITS_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@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPIO_MT_PROG = @CPIO_MT_PROG@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_RMT_COMMAND = @DEFAULT_RMT_COMMAND@ +DEFAULT_RMT_DIR = @DEFAULT_RMT_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIRENT_H = @DIRENT_H@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXEEXT = @EXEEXT@ +FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_H = @GETOPT_H@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ +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_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_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYSEXITS_H = @HAVE_SYSEXITS_H@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE__BOOL = @HAVE__BOOL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTTYPES_H = @INTTYPES_H@ +LDFLAGS = @LDFLAGS@ +LIBCPIO_LIBDEPS = @LIBCPIO_LIBDEPS@ +LIBCPIO_LTLIBDEPS = @LIBCPIO_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_SETSOCKOPT = @LIB_SETSOCKOPT@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +PU_RMT_PROG = @PU_RMT_PROG@ +RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYSEXITS_H = @SYSEXITS_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@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.5 gnits +noinst_HEADERS = paxlib.h rmt.h rmt-command.h system-ioctl.h system.h +noinst_LIBRARIES = libcpio.a +noinst_LTLIBRARIES = +EXTRA_DIST = alloca.c alloca_.h allocsa.valgrind argmatch.c argmatch.h \ + canonicalize-lgpl.c canonicalize.h chdir-long.c chdir-long.h \ + chown.c fchown-stub.c close-stream.c close-stream.h closeout.c \ + closeout.h dirfd.c dirfd.h basename.c dirname.c dirname.h \ + stripslash.c dup2.c error.c error.h exitfail.c exitfail.h \ + dirent_.h fchdir.c fcntl_.h creat-safer.c fcntl--.h \ + fcntl-safer.h open-safer.c fileblocks.c float_.h fnmatch.c \ + fnmatch_.h fnmatch_loop.c __fpending.c __fpending.h getcwd.c \ + getdate.c getdate.h getopt.c getopt1.c getopt_.h getopt_int.h \ + gettime.c gettimeofday.c hash.c hash.h intprops.h imaxtostr.c \ + inttostr.c inttostr.h offtostr.c uinttostr.c umaxtostr.c \ + inttypes_.h lchown.c lchown.h lstat.c lstat.h malloc.c \ + mempcpy.c memrchr.c mktime.c obstack.c obstack.h at-func.c \ + fchmodat.c fchownat.c fstatat.c mkdirat.c openat-priv.h \ + openat-proc.c openat.c openat.h pathmax.h quote.c quote.h \ + quotearg.c quotearg.h readlink.c safe-read.c safe-read.h \ + safe-write.c safe-write.h same-inode.h save-cwd.c save-cwd.h \ + savedir.c savedir.h setenv.c setenv.h unsetenv.c sleep.c \ + stdbool_.h stdint_.h stdio_.h stdlib_.h stpcpy.c strcasecmp.c \ + strncasecmp.c strchrnul.c strdup.c strerror.c string_.h \ + strndup.c strnlen.c strtol.c sys_stat_.h sys_time_.h \ + sysexits_.h time_.h time_r.c timespec.h unistd_.h dup-safer.c \ + fd-safer.c pipe-safer.c unistd--.h unistd-safer.h \ + unlocked-io.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 vsnprintf.c wchar_.h wctype_.h \ + xalloc.h xmalloc.c xgetcwd.c xgetcwd.h +BUILT_SOURCES = $(ALLOCA_H) configmake.h $(DIRENT_H) $(FCNTL_H) \ + $(FLOAT_H) $(FNMATCH_H) getdate.c $(GETOPT_H) $(INTTYPES_H) \ + $(STDBOOL_H) $(STDINT_H) stdio.h stdlib.h string.h \ + $(SYS_STAT_H) $(SYS_TIME_H) $(SYSEXITS_H) time.h unistd.h \ + $(WCHAR_H) $(WCTYPE_H) rmt-command.h +SUFFIXES = +MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \ + dirent.h-t fcntl.h fcntl.h-t float.h float.h-t fnmatch.h \ + fnmatch.h-t getopt.h getopt.h-t inttypes.h inttypes.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/stat.h \ + sys/stat.h-t sys/time.h sys/time.h-t sysexits.h sysexits.h-t \ + time.h time.h-t unistd.h unistd.h-t wchar.h wchar.h-t wctype.h \ + wctype.h-t +MOSTLYCLEANDIRS = sys +CLEANFILES = configmake.h configmake.h-t rmt-command.h +DISTCLEANFILES = rmt-command.h +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 +# -I$(top_builddir)/intl, so that can be found in this directory. +# For the Makefile.ams in other directories it is the maintainer's +# responsibility; for the one from gnulib we do it here. +# This option has no effect when the user disables NLS (because then the intl +# directory contains no libintl.h file) or when the project does not use +# "gettextize --intl". +#AM_CPPFLAGS += -I$(top_builddir)/intl +libcpio_a_SOURCES = allocsa.h allocsa.c argp.h argp-ba.c argp-eexst.c \ + argp-fmtstream.c argp-fmtstream.h argp-fs-xinl.c argp-help.c \ + argp-namefrob.h argp-parse.c argp-pin.c argp-pv.c argp-pvh.c \ + argp-xinl.c full-write.h full-write.c getdate.y gettext.h \ + openat-die.c verify.h version-etc.h version-etc.c \ + version-etc-fsf.c xalloc-die.c xsize.h xstrndup.h xstrndup.c \ + fatal.c paxerror.c paxexit.c paxlib.h paxnames.c rtapelib.c +libcpio_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@ $(LIBOBJS) +libcpio_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@ $(LIBOBJS) +EXTRA_libcpio_a_SOURCES = alloca.c argmatch.c canonicalize-lgpl.c \ + chdir-long.c chown.c fchown-stub.c close-stream.c closeout.c \ + dirfd.c basename.c dirname.c stripslash.c dup2.c error.c \ + exitfail.c fchdir.c creat-safer.c open-safer.c fileblocks.c \ + fnmatch.c fnmatch_loop.c __fpending.c getcwd.c getopt.c \ + getopt1.c gettime.c gettimeofday.c hash.c imaxtostr.c \ + inttostr.c offtostr.c uinttostr.c umaxtostr.c lchown.c lstat.c \ + malloc.c mempcpy.c memrchr.c mktime.c obstack.c at-func.c \ + fchmodat.c fchownat.c fstatat.c mkdirat.c openat-proc.c \ + openat.c quote.c quotearg.c readlink.c safe-read.c \ + safe-write.c save-cwd.c savedir.c setenv.c unsetenv.c sleep.c \ + stpcpy.c strcasecmp.c strncasecmp.c strchrnul.c strdup.c \ + strerror.c strndup.c strnlen.c strtol.c time_r.c dup-safer.c \ + fd-safer.c pipe-safer.c utimens.c asnprintf.c printf-args.c \ + printf-parse.c vasnprintf.c vsnprintf.c xmalloc.c xgetcwd.c + +# Use this preprocessor expression to decide whether #include_next works. +# Do not rely on a 'configure'-time test for this, since the expression +# might appear in an installed header, which is used by some other compiler. +HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) +LINK_WARNING_H = $(top_srcdir)/build-aux/link-warning.h +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj .y +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/gnulib.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits lib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(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 + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libcpio.a: $(libcpio_a_OBJECTS) $(libcpio_a_DEPENDENCIES) + -rm -f libcpio.a + $(libcpio_a_AR) libcpio.a $(libcpio_a_OBJECTS) $(libcpio_a_LIBADD) + $(RANLIB) libcpio.a + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/__fpending.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)/argmatch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-ba.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-eexst.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-fmtstream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-fs-xinl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-help.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-parse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-pin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-pv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-pvh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-xinl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/at-func.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canonicalize-lgpl.Po@am__quote@ +@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)/close-stream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closeout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirfd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fatal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ +@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)/fd-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileblocks.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)/fstatat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full-write.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdate.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)/gettime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imaxtostr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inttostr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.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)/mempcpy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memrchr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ +@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)/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@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paxerror.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paxexit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paxnames.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.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)/readlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtapelib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safe-read.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safe-write.Po@am__quote@ +@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)/setenv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stpcpy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strchrnul.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)/stripslash.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strncasecmp.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@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_r.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)/unsetenv.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)/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)/vsnprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xgetcwd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup.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 +@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 +@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) '$<'` + +.y.c: + $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) + +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; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + 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" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + 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; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + 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 $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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." + -rm -f getdate.c + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +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 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-local + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-noinstLIBRARIES clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic 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-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 + + +# 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 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/alloca_.h; \ + } > $@-t + mv -f $@-t $@ + +# Retrieve values of the variables through 'configure' followed by +# 'make', not directly through 'configure', so that a user who +# sets some of these variables consistently on the 'make' command +# line gets correct results. +# +# One advantage of this approach, compared to the classical +# approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS, +# is that it protects against the use of undefined variables. +# If, say, $(libdir) is not set in the Makefile, LIBDIR is not +# defined by this module, and code using LIBDIR gives a +# compilation error. +# +# Another advantage is that 'make' output is shorter. +# +# Listed in the same order as the GNU makefile conventions. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +configmake.h: Makefile + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t + mv $@-t $@ + +# 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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ + < $(srcdir)/dirent_.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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''ABSOLUTE_FCNTL_H''@|$(ABSOLUTE_FCNTL_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + < $(srcdir)/fcntl_.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_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_FLOAT_H''@|$(ABSOLUTE_FLOAT_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + < $(srcdir)/float_.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 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/fnmatch_.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 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/getopt_.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. +inttypes.h: inttypes_.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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/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' \ + -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ + -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ + -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ + -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ + -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ + -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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/inttypes_.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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.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 + 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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/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/@''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' \ + -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ + -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ + -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ + -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ + -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ + -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; \ + } > $@-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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_STDIO_H''@|$(ABSOLUTE_STDIO_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|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_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|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_VASPRINTF''@|$(GNULIB_VASPRINTF)|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|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \ + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \ + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \ + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ + -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_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/stdio_.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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_STDLIB_H''@|$(ABSOLUTE_STDLIB_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ + -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ + -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/stdlib_.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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_STRING_H''@|$(ABSOLUTE_STRING_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \ + -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \ + -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \ + -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \ + -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \ + -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \ + -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \ + -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \ + -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \ + -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \ + -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \ + -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \ + -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \ + -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \ + -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \ + -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \ + -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \ + -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \ + -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \ + -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \ + -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \ + -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \ + -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \ + -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \ + -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \ + -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|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_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' \ + -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ + -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ + -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ + -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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/string_.h; \ + } > $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# has one that is incomplete. +sys/stat.h: sys_stat_.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' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''HAVE_IO_H''@|$(HAVE_IO_H)|g' \ + -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''HAVE_DECL_MKDIR''@|$(HAVE_DECL_MKDIR)|g' \ + < $(srcdir)/sys_stat_.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 + @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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + < $(srcdir)/sys_time_.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. +sysexits.h: sysexits_.h + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SYSEXITS_H''@|$(HAVE_SYSEXITS_H)|g' \ + -e 's|@''ABSOLUTE_SYSEXITS_H''@|$(ABSOLUTE_SYSEXITS_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + < $(srcdir)/sysexits_.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. +time.h: time_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@ABSOLUTE_TIME_H''@|$(ABSOLUTE_TIME_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/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; \ + } > $@-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 + 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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ + -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ + -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ + -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ + -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ + -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ + -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + < $(srcdir)/unistd_.h; \ + } > $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# version does not work standalone. +wchar.h: wchar_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''ABSOLUTE_WCHAR_H''@|$(ABSOLUTE_WCHAR_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + < $(srcdir)/wchar_.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 + 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_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + < $(srcdir)/wctype_.h; \ + } > $@-t + mv $@-t $@ + +mostlyclean-local: mostlyclean-generic + @for dir in '' $(MOSTLYCLEANDIRS); do \ + if test -n "$$dir" && test -d $$dir; then \ + echo "rmdir $$dir"; rmdir $$dir; \ + fi; \ + done +rmt-command.h: Makefile + echo '#define LOCALEDIR "$(localedir)"' >$@ + echo "#ifndef DEFAULT_RMT_COMMAND" >> $@ + echo "# define DEFAULT_RMT_COMMAND \"$(DEFAULT_RMT_DIR)/`echo \"rmt\" | sed 's,^.*/,,;$(transform)'`$(EXEEXT)\"" >> $@ + echo "#endif" >> $@ +# 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/lib/__fpending.c b/lib/__fpending.c new file mode 100644 index 0000000..221aee6 --- /dev/null +++ b/lib/__fpending.c @@ -0,0 +1,30 @@ +/* __fpending.c -- return the number of pending output bytes on a stream + Copyright (C) 2000, 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. */ + +/* Written by Jim Meyering. */ + +#include + +#include "__fpending.h" + +/* Return the number of pending (aka buffered, unflushed) + bytes on the stream, FP, that is open for writing. */ +size_t +__fpending (FILE *fp) +{ + return PENDING_OUTPUT_N_BYTES; +} diff --git a/lib/__fpending.h b/lib/__fpending.h new file mode 100644 index 0000000..8a8aabc --- /dev/null +++ b/lib/__fpending.h @@ -0,0 +1,34 @@ +/* Declare __fpending. + + Copyright (C) 2000, 2003, 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) + any 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___FPENDING +"this configure-time declaration test was not run" +#endif + +#if HAVE_DECL___FPENDING +# if HAVE_STDIO_EXT_H +# include +# endif +#else +size_t __fpending (FILE *); +#endif diff --git a/lib/alloca.c b/lib/alloca.c new file mode 100644 index 0000000..3a1f4e2 --- /dev/null +++ b/lib/alloca.c @@ -0,0 +1,489 @@ +/* alloca.c -- allocate automatically reclaimed memory + (Mostly) portable public-domain implementation -- D A Gwyn + + This implementation of the PWB library alloca function, + which is used to allocate space off the run-time stack so + that it is automatically reclaimed upon procedure exit, + was inspired by discussions with J. Q. Johnson of Cornell. + J.Otto Tennant contributed the Cray support. + + There are some preprocessor constants that can + be defined when compiling for your specific system, for + improved efficiency; however, the defaults should be okay. + + The general concept of this implementation is to keep + track of all alloca-allocated blocks, and reclaim any + that are found to be deeper in the stack than the current + invocation. This heuristic does not reclaim storage as + soon as it becomes invalid, but it will do so eventually. + + As a special case, alloca(0) reclaims storage without + allocating any. It is a good idea to use alloca(0) in + your main control loop, etc. to force garbage collection. */ + +#include + +#include + +#include +#include + +#ifdef emacs +# include "lisp.h" +# include "blockinput.h" +# ifdef EMACS_FREE +# undef free +# define free EMACS_FREE +# endif +#else +# define memory_full() abort () +#endif + +/* If compiling with GCC 2, this file's not needed. */ +#if !defined (__GNUC__) || __GNUC__ < 2 + +/* If someone has defined alloca as a macro, + there must be some other way alloca is supposed to work. */ +# ifndef alloca + +# ifdef emacs +# ifdef static +/* actually, only want this if static is defined as "" + -- this is for usg, in which emacs must undefine static + in order to make unexec workable + */ +# ifndef STACK_DIRECTION +you +lose +-- must know STACK_DIRECTION at compile-time +/* Using #error here is not wise since this file should work for + old and obscure compilers. */ +# endif /* STACK_DIRECTION undefined */ +# endif /* static */ +# endif /* emacs */ + +/* If your stack is a linked list of frames, you have to + provide an "address metric" ADDRESS_FUNCTION macro. */ + +# if defined (CRAY) && defined (CRAY_STACKSEG_END) +long i00afunc (); +# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) +# else +# define ADDRESS_FUNCTION(arg) &(arg) +# endif + +/* Define STACK_DIRECTION if you know the direction of stack + growth for your system; otherwise it will be automatically + deduced at run-time. + + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ + +# ifndef STACK_DIRECTION +# define STACK_DIRECTION 0 /* Direction unknown. */ +# endif + +# if STACK_DIRECTION != 0 + +# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ + +# else /* STACK_DIRECTION == 0; need run-time code. */ + +static int stack_dir; /* 1 or -1 once known. */ +# define STACK_DIR stack_dir + +static void +find_stack_direction (void) +{ + static char *addr = NULL; /* Address of first `dummy', once known. */ + auto char dummy; /* To get stack address. */ + + if (addr == NULL) + { /* Initial entry. */ + addr = ADDRESS_FUNCTION (dummy); + + find_stack_direction (); /* Recurse once. */ + } + else + { + /* Second entry. */ + if (ADDRESS_FUNCTION (dummy) > addr) + stack_dir = 1; /* Stack grew upward. */ + else + stack_dir = -1; /* Stack grew downward. */ + } +} + +# endif /* STACK_DIRECTION == 0 */ + +/* An "alloca header" is used to: + (a) chain together all alloca'ed blocks; + (b) keep track of stack depth. + + It is very important that sizeof(header) agree with malloc + alignment chunk size. The following default should work okay. */ + +# ifndef ALIGN_SIZE +# define ALIGN_SIZE sizeof(double) +# endif + +typedef union hdr +{ + char align[ALIGN_SIZE]; /* To force sizeof(header). */ + struct + { + union hdr *next; /* For chaining headers. */ + char *deep; /* For stack depth measure. */ + } h; +} header; + +static header *last_alloca_header = NULL; /* -> last alloca header. */ + +/* Return a pointer to at least SIZE bytes of storage, + which will be automatically reclaimed upon exit from + the procedure that called alloca. Originally, this space + was supposed to be taken from the current stack frame of the + caller, but that method cannot be made to work for some + implementations of C, for example under Gould's UTX/32. */ + +void * +alloca (size_t size) +{ + auto char probe; /* Probes stack depth: */ + register char *depth = ADDRESS_FUNCTION (probe); + +# if STACK_DIRECTION == 0 + if (STACK_DIR == 0) /* Unknown growth direction. */ + find_stack_direction (); +# endif + + /* Reclaim garbage, defined as all alloca'd storage that + was allocated from deeper in the stack than currently. */ + + { + register header *hp; /* Traverses linked list. */ + +# ifdef emacs + BLOCK_INPUT; +# endif + + for (hp = last_alloca_header; hp != NULL;) + if ((STACK_DIR > 0 && hp->h.deep > depth) + || (STACK_DIR < 0 && hp->h.deep < depth)) + { + register header *np = hp->h.next; + + free (hp); /* Collect garbage. */ + + hp = np; /* -> next header. */ + } + else + break; /* Rest are not deeper. */ + + last_alloca_header = hp; /* -> last valid storage. */ + +# ifdef emacs + UNBLOCK_INPUT; +# endif + } + + if (size == 0) + return NULL; /* No allocation required. */ + + /* Allocate combined header + user data storage. */ + + { + /* Address of header. */ + register header *new; + + size_t combined_size = sizeof (header) + size; + if (combined_size < sizeof (header)) + memory_full (); + + new = malloc (combined_size); + + if (! new) + memory_full (); + + new->h.next = last_alloca_header; + new->h.deep = depth; + + last_alloca_header = new; + + /* User storage begins just after header. */ + + return (void *) (new + 1); + } +} + +# if defined (CRAY) && defined (CRAY_STACKSEG_END) + +# ifdef DEBUG_I00AFUNC +# include +# endif + +# ifndef CRAY_STACK +# define CRAY_STACK +# ifndef CRAY2 +/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ +struct stack_control_header + { + long shgrow:32; /* Number of times stack has grown. */ + long shaseg:32; /* Size of increments to stack. */ + long shhwm:32; /* High water mark of stack. */ + long shsize:32; /* Current size of stack (all segments). */ + }; + +/* The stack segment linkage control information occurs at + the high-address end of a stack segment. (The stack + grows from low addresses to high addresses.) The initial + part of the stack segment linkage control information is + 0200 (octal) words. This provides for register storage + for the routine which overflows the stack. */ + +struct stack_segment_linkage + { + long ss[0200]; /* 0200 overflow words. */ + long sssize:32; /* Number of words in this segment. */ + long ssbase:32; /* Offset to stack base. */ + long:32; + long sspseg:32; /* Offset to linkage control of previous + segment of stack. */ + long:32; + long sstcpt:32; /* Pointer to task common address block. */ + long sscsnm; /* Private control structure number for + microtasking. */ + long ssusr1; /* Reserved for user. */ + long ssusr2; /* Reserved for user. */ + long sstpid; /* Process ID for pid based multi-tasking. */ + long ssgvup; /* Pointer to multitasking thread giveup. */ + long sscray[7]; /* Reserved for Cray Research. */ + long ssa0; + long ssa1; + long ssa2; + long ssa3; + long ssa4; + long ssa5; + long ssa6; + long ssa7; + long sss0; + long sss1; + long sss2; + long sss3; + long sss4; + long sss5; + long sss6; + long sss7; + }; + +# else /* CRAY2 */ +/* The following structure defines the vector of words + returned by the STKSTAT library routine. */ +struct stk_stat + { + long now; /* Current total stack size. */ + long maxc; /* Amount of contiguous space which would + be required to satisfy the maximum + stack demand to date. */ + long high_water; /* Stack high-water mark. */ + long overflows; /* Number of stack overflow ($STKOFEN) calls. */ + long hits; /* Number of internal buffer hits. */ + long extends; /* Number of block extensions. */ + long stko_mallocs; /* Block allocations by $STKOFEN. */ + long underflows; /* Number of stack underflow calls ($STKRETN). */ + long stko_free; /* Number of deallocations by $STKRETN. */ + long stkm_free; /* Number of deallocations by $STKMRET. */ + long segments; /* Current number of stack segments. */ + long maxs; /* Maximum number of stack segments so far. */ + long pad_size; /* Stack pad size. */ + long current_address; /* Current stack segment address. */ + long current_size; /* Current stack segment size. This + number is actually corrupted by STKSTAT to + include the fifteen word trailer area. */ + long initial_address; /* Address of initial segment. */ + long initial_size; /* Size of initial segment. */ + }; + +/* The following structure describes the data structure which trails + any stack segment. I think that the description in 'asdef' is + out of date. I only describe the parts that I am sure about. */ + +struct stk_trailer + { + long this_address; /* Address of this block. */ + long this_size; /* Size of this block (does not include + this trailer). */ + long unknown2; + long unknown3; + long link; /* Address of trailer block of previous + segment. */ + long unknown5; + long unknown6; + long unknown7; + long unknown8; + long unknown9; + long unknown10; + long unknown11; + long unknown12; + long unknown13; + long unknown14; + }; + +# endif /* CRAY2 */ +# endif /* not CRAY_STACK */ + +# ifdef CRAY2 +/* Determine a "stack measure" for an arbitrary ADDRESS. + I doubt that "lint" will like this much. */ + +static long +i00afunc (long *address) +{ + struct stk_stat status; + struct stk_trailer *trailer; + long *block, size; + long result = 0; + + /* We want to iterate through all of the segments. The first + step is to get the stack status structure. We could do this + more quickly and more directly, perhaps, by referencing the + $LM00 common block, but I know that this works. */ + + STKSTAT (&status); + + /* Set up the iteration. */ + + trailer = (struct stk_trailer *) (status.current_address + + status.current_size + - 15); + + /* There must be at least one stack segment. Therefore it is + a fatal error if "trailer" is null. */ + + if (trailer == 0) + abort (); + + /* Discard segments that do not contain our argument address. */ + + while (trailer != 0) + { + block = (long *) trailer->this_address; + size = trailer->this_size; + if (block == 0 || size == 0) + abort (); + trailer = (struct stk_trailer *) trailer->link; + if ((block <= address) && (address < (block + size))) + break; + } + + /* Set the result to the offset in this segment and add the sizes + of all predecessor segments. */ + + result = address - block; + + if (trailer == 0) + { + return result; + } + + do + { + if (trailer->this_size <= 0) + abort (); + result += trailer->this_size; + trailer = (struct stk_trailer *) trailer->link; + } + while (trailer != 0); + + /* We are done. Note that if you present a bogus address (one + not in any segment), you will get a different number back, formed + from subtracting the address of the first block. This is probably + not what you want. */ + + return (result); +} + +# else /* not CRAY2 */ +/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. + Determine the number of the cell within the stack, + given the address of the cell. The purpose of this + routine is to linearize, in some sense, stack addresses + for alloca. */ + +static long +i00afunc (long address) +{ + long stkl = 0; + + long size, pseg, this_segment, stack; + long result = 0; + + struct stack_segment_linkage *ssptr; + + /* Register B67 contains the address of the end of the + current stack segment. If you (as a subprogram) store + your registers on the stack and find that you are past + the contents of B67, you have overflowed the segment. + + B67 also points to the stack segment linkage control + area, which is what we are really interested in. */ + + stkl = CRAY_STACKSEG_END (); + ssptr = (struct stack_segment_linkage *) stkl; + + /* If one subtracts 'size' from the end of the segment, + one has the address of the first word of the segment. + + If this is not the first segment, 'pseg' will be + nonzero. */ + + pseg = ssptr->sspseg; + size = ssptr->sssize; + + this_segment = stkl - size; + + /* It is possible that calling this routine itself caused + a stack overflow. Discard stack segments which do not + contain the target address. */ + + while (!(this_segment <= address && address <= stkl)) + { +# ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); +# endif + if (pseg == 0) + break; + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + this_segment = stkl - size; + } + + result = address - this_segment; + + /* If you subtract pseg from the current end of the stack, + you get the address of the previous stack segment's end. + This seems a little convoluted to me, but I'll bet you save + a cycle somewhere. */ + + while (pseg != 0) + { +# ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o\n", pseg, size); +# endif + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + result += size; + } + return (result); +} + +# endif /* not CRAY2 */ +# endif /* CRAY */ + +# endif /* no alloca */ +#endif /* not GCC version 2 */ diff --git a/lib/alloca_.h b/lib/alloca_.h new file mode 100644 index 0000000..af274b9 --- /dev/null +++ b/lib/alloca_.h @@ -0,0 +1,54 @@ +/* Memory allocation on the stack. + + Copyright (C) 1995, 1999, 2001-2004, 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. */ + +/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H + means there is a real alloca function. */ +#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. + Use of alloca should be avoided: + - inside arguments of function calls - undefined behaviour, + - in inline functions - the allocation may actually last until the + calling function returns, + - for huge N (say, N >= 65536) - you never know how large (or small) + the stack is, and when the stack cannot fulfill the memory allocation + request, the program just crashes. + */ + +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _AIX +# define alloca __alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# else +# include +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +#endif /* _GL_ALLOCA_H */ diff --git a/lib/allocsa.c b/lib/allocsa.c new file mode 100644 index 0000000..97652e6 --- /dev/null +++ b/lib/allocsa.c @@ -0,0 +1,137 @@ +/* Safe automatic memory allocation. + Copyright (C) 2003, 2006 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) + any 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 "allocsa.h" + +/* The speed critical point in this file is freesa() 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 + 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. + + 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: + - 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. */ + +#define MAGIC_NUMBER 0x1415fb4a +#define MAGIC_SIZE sizeof (int) +/* This is how the header info would look like without any alignment + considerations. */ +struct preliminary_header { void *next; char room[MAGIC_SIZE]; }; +/* But the header's size must be a multiple of sa_alignment_max. */ +#define HEADER_SIZE \ + (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max) +struct header { void *next; char room[HEADER_SIZE - sizeof (struct preliminary_header) + MAGIC_SIZE]; }; +/* Verify that HEADER_SIZE == sizeof (struct header). */ +typedef int verify1[2 * (HEADER_SIZE == sizeof (struct header)) - 1]; +/* We make the hash table quite big, so that during lookups the probability + of empty hash buckets is quite high. There is no need to make the hash + 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]; + +#endif + +void * +mallocsa (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. */ + size_t nplus = n + HEADER_SIZE; + + if (nplus >= n) + { + char *p = (char *) malloc (nplus); + + if (p != NULL) + { + size_t slot; + + p += HEADER_SIZE; + + /* Put a magic number into the indicator word. */ + ((int *) p)[-1] = MAGIC_NUMBER; + + /* 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; + + return p; + } + } + /* Out of memory. */ + return NULL; +#else +# if !MALLOC_0_IS_NONNULL + if (n == 0) + n = 1; +# endif + return malloc (n); +#endif +} + +#if HAVE_ALLOCA +void +freesa (void *p) +{ + /* mallocsa() may have returned NULL. */ + if (p != NULL) + { + /* Attempt to quickly distinguish the mallocsa() 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, + perform a lookup in the hash table. */ + size_t slot = (unsigned long) p % HASH_TABLE_SIZE; + void **chain = &mallocsa_results[slot]; + for (; *chain != NULL;) + { + if (*chain == p) + { + /* Found it. Remove it from the hash table and free it. */ + char *p_begin = (char *) p - HEADER_SIZE; + *chain = ((struct header *) p_begin)->next; + free (p_begin); + return; + } + chain = &((struct header *) ((char *) *chain - HEADER_SIZE))->next; + } + } + /* At this point, we know it was not a mallocsa() result. */ + } +} +#endif diff --git a/lib/allocsa.h b/lib/allocsa.h new file mode 100644 index 0000000..ffee917 --- /dev/null +++ b/lib/allocsa.h @@ -0,0 +1,124 @@ +/* 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) + any 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 _ALLOCSA_H +#define _ALLOCSA_H + +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* safe_alloca(N) is equivalent to alloca(N) when it is safe to call + alloca(N); otherwise it returns NULL. It either returns N bytes of + memory allocated on the stack, that lasts until the function returns, + or NULL. + Use of safe_alloca should be avoided: + - inside arguments of function calls - undefined behaviour, + - in inline functions - the allocation may actually last until the + calling function returns. +*/ +#if HAVE_ALLOCA +/* The OS usually guarantees only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + allocate anything larger than 4096 bytes. Also care for the possibility + of a few compiler-allocated temporary stack slots. + This must be a macro, not an inline function. */ +# define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL) +#else +# 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 + the function returns. Upon failure, it returns NULL. */ +#if HAVE_ALLOCA +# define allocsa(N) \ + ((N) < 4032 - sa_increment \ + ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \ + : mallocsa (N)) +#else +# define allocsa(N) \ + mallocsa (N) +#endif +extern void * mallocsa (size_t n); + +/* Free a block of memory allocated through allocsa(). */ +#if HAVE_ALLOCA +extern void freesa (void *p); +#else +# define freesa 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. */ + + +#ifdef __cplusplus +} +#endif + + +/* ------------------- Auxiliary, non-public definitions ------------------- */ + +/* Determine the alignment of a type at compile time. */ +#if defined __GNUC__ +# define sa_alignof __alignof__ +#elif defined __cplusplus + template struct sa_alignof_helper { char __slot1; type __slot2; }; +# define sa_alignof(type) offsetof (sa_alignof_helper, __slot2) +#elif defined __hpux + /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof + values. */ +# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) +#elif defined _AIX + /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof + values. */ +# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) +#else +# define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) +#endif + +enum +{ +/* The desired alignment of memory allocations is the maximum alignment + among all elementary types. */ + sa_alignment_long = sa_alignof (long), + sa_alignment_double = sa_alignof (double), +#if HAVE_LONG_LONG_INT + sa_alignment_longlong = sa_alignof (long long), +#endif + sa_alignment_longdouble = sa_alignof (long double), + sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1) +#if HAVE_LONG_LONG_INT + | (sa_alignment_longlong - 1) +#endif + | (sa_alignment_longdouble - 1) + ) + 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 */ diff --git a/lib/allocsa.valgrind b/lib/allocsa.valgrind new file mode 100644 index 0000000..f4c77d6 --- /dev/null +++ b/lib/allocsa.valgrind @@ -0,0 +1,7 @@ +# Suppress a valgrind message about use of uninitialized memory in freesa(). +# This use is OK because it provides only a speedup. +{ + freesa + Memcheck:Cond + fun:freesa +} diff --git a/lib/argmatch.c b/lib/argmatch.c new file mode 100644 index 0000000..72d9248 --- /dev/null +++ b/lib/argmatch.c @@ -0,0 +1,278 @@ +/* argmatch.c -- find a match for a string in an array + + 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 + it under the 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 + Modified by Akim Demaille */ + +#include + +/* Specification. */ +#include "argmatch.h" + +#include +#include +#include +#include + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +#include "error.h" +#include "quotearg.h" +#include "quote.h" + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +/* When reporting an invalid argument, show nonprinting characters + by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use + literal_quoting_style. */ +#ifndef ARGMATCH_QUOTING_STYLE +# define ARGMATCH_QUOTING_STYLE locale_quoting_style +#endif + +/* Non failing version of argmatch call this function after failing. */ +#ifndef ARGMATCH_DIE +# include "exitfail.h" +# define ARGMATCH_DIE exit (exit_failure) +#endif + +#ifdef ARGMATCH_DIE_DECL +ARGMATCH_DIE_DECL; +#endif + +static void +__argmatch_die (void) +{ + ARGMATCH_DIE; +} + +/* Used by XARGMATCH and XARGCASEMATCH. See description in argmatch.h. + Default to __argmatch_die, but allow caller to change this at run-time. */ +argmatch_exit_fn argmatch_die = __argmatch_die; + + +/* If ARG is an unambiguous match for an element of the + NULL-terminated array ARGLIST, return the index in ARGLIST + of the matched element, else -1 if it does not match any element + or -2 if it is ambiguous (is a prefix of more than one element). + + If VALLIST is none null, use it to resolve ambiguities limited to + synonyms, i.e., for + "yes", "yop" -> 0 + "no", "nope" -> 1 + "y" is a valid argument, for `0', and "n" for `1'. */ + +ptrdiff_t +argmatch (const char *arg, const char *const *arglist, + const char *vallist, size_t valsize) +{ + size_t i; /* Temporary index in ARGLIST. */ + size_t arglen; /* Length of ARG. */ + ptrdiff_t matchind = -1; /* Index of first nonexact match. */ + bool ambiguous = false; /* If true, multiple nonexact match(es). */ + + arglen = strlen (arg); + + /* Test all elements for either exact match or abbreviated matches. */ + for (i = 0; arglist[i]; i++) + { + if (!strncmp (arglist[i], arg, arglen)) + { + if (strlen (arglist[i]) == arglen) + /* Exact match found. */ + return i; + else if (matchind == -1) + /* First nonexact match found. */ + matchind = i; + else + { + /* Second nonexact match found. */ + if (vallist == NULL + || memcmp (vallist + valsize * matchind, + vallist + valsize * i, valsize)) + { + /* There is a real ambiguity, or we could not + disambiguate. */ + ambiguous = true; + } + } + } + } + if (ambiguous) + return -2; + else + return matchind; +} + +/* Error reporting for argmatch. + CONTEXT is a description of the type of entity that was being matched. + VALUE is the invalid value that was given. + PROBLEM is the return value from argmatch. */ + +void +argmatch_invalid (const char *context, const char *value, ptrdiff_t problem) +{ + char const *format = (problem == -1 + ? _("invalid argument %s for %s") + : _("ambiguous argument %s for %s")); + + error (0, 0, format, quotearg_n_style (0, ARGMATCH_QUOTING_STYLE, value), + quote_n (1, context)); +} + +/* List the valid arguments for argmatch. + ARGLIST is the same as in argmatch. + VALLIST is a pointer to an array of values. + VALSIZE is the size of the elements of VALLIST */ +void +argmatch_valid (const char *const *arglist, + const char *vallist, size_t valsize) +{ + size_t i; + const char *last_val = NULL; + + /* We try to put synonyms on the same line. The assumption is that + synonyms follow each other */ + fprintf (stderr, _("Valid arguments are:")); + for (i = 0; arglist[i]; i++) + if ((i == 0) + || memcmp (last_val, vallist + valsize * i, valsize)) + { + fprintf (stderr, "\n - `%s'", arglist[i]); + last_val = vallist + valsize * i; + } + else + { + fprintf (stderr, ", `%s'", arglist[i]); + } + putc ('\n', stderr); +} + +/* Never failing versions of the previous functions. + + CONTEXT is the context for which argmatch is called (e.g., + "--version-control", or "$VERSION_CONTROL" etc.). Upon failure, + calls the (supposed never to return) function EXIT_FN. */ + +ptrdiff_t +__xargmatch_internal (const char *context, + const char *arg, const char *const *arglist, + const char *vallist, size_t valsize, + argmatch_exit_fn exit_fn) +{ + ptrdiff_t res = argmatch (arg, arglist, vallist, valsize); + if (res >= 0) + /* Success. */ + return res; + + /* We failed. Explain why. */ + argmatch_invalid (context, arg, res); + argmatch_valid (arglist, vallist, valsize); + (*exit_fn) (); + + return -1; /* To please the compilers. */ +} + +/* Look for VALUE in VALLIST, an array of objects of size VALSIZE and + return the first corresponding argument in ARGLIST */ +const char * +argmatch_to_argument (const char *value, + const char *const *arglist, + const char *vallist, size_t valsize) +{ + size_t i; + + for (i = 0; arglist[i]; i++) + if (!memcmp (value, vallist + valsize * i, valsize)) + return arglist[i]; + return NULL; +} + +#ifdef TEST +/* + * Based on "getversion.c" by David MacKenzie + */ +char *program_name; + +/* When to make backup files. */ +enum backup_type +{ + /* Never make backups. */ + no_backups, + + /* Make simple backups of every file. */ + simple_backups, + + /* Make numbered backups of files that already have numbered backups, + and simple backups of the others. */ + numbered_existing_backups, + + /* Make numbered backups of every file. */ + numbered_backups +}; + +/* Two tables describing arguments (keys) and their corresponding + values */ +static const char *const backup_args[] = +{ + "no", "none", "off", + "simple", "never", + "existing", "nil", + "numbered", "t", + 0 +}; + +static const enum backup_type backup_vals[] = +{ + no_backups, no_backups, no_backups, + simple_backups, simple_backups, + numbered_existing_backups, numbered_existing_backups, + numbered_backups, numbered_backups +}; + +int +main (int argc, const char *const *argv) +{ + const char *cp; + enum backup_type backup_type = no_backups; + + program_name = (char *) argv[0]; + + if (argc > 2) + { + fprintf (stderr, "Usage: %s [VERSION_CONTROL]\n", program_name); + exit (1); + } + + if ((cp = getenv ("VERSION_CONTROL"))) + backup_type = XARGMATCH ("$VERSION_CONTROL", cp, + backup_args, backup_vals); + + if (argc == 2) + backup_type = XARGMATCH (program_name, argv[1], + backup_args, backup_vals); + + printf ("The version control is `%s'\n", + ARGMATCH_TO_ARGUMENT (backup_type, backup_args, backup_vals)); + + return 0; +} +#endif diff --git a/lib/argmatch.h b/lib/argmatch.h new file mode 100644 index 0000000..f2dfe59 --- /dev/null +++ b/lib/argmatch.h @@ -0,0 +1,103 @@ +/* argmatch.h -- definitions and prototypes for argmatch.c + + 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 + it under the 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 + Modified by Akim Demaille */ + +#ifndef ARGMATCH_H_ +# define ARGMATCH_H_ 1 + +# include + +# include "verify.h" + +# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) + +/* Assert there are as many real arguments as there are values + (argument list ends with a NULL guard). */ + +# define ARGMATCH_VERIFY(Arglist, Vallist) \ + verify (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1) + +/* Return the index of the element of ARGLIST (NULL terminated) that + matches with ARG. If VALLIST is not NULL, then use it to resolve + false ambiguities (i.e., different matches of ARG but corresponding + to the same values in VALLIST). */ + +ptrdiff_t argmatch (char const *arg, char const *const *arglist, + char const *vallist, size_t valsize); + +# define ARGMATCH(Arg, Arglist, Vallist) \ + argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist)) + +/* xargmatch calls this function when it fails. This function should not + return. By default, this is a function that calls ARGMATCH_DIE which + in turn defaults to `exit (exit_failure)'. */ +typedef void (*argmatch_exit_fn) (void); +extern argmatch_exit_fn argmatch_die; + +/* Report on stderr why argmatch failed. Report correct values. */ + +void argmatch_invalid (char const *context, char const *value, + ptrdiff_t problem); + +/* Left for compatibility with the old name invalid_arg */ + +# define invalid_arg(Context, Value, Problem) \ + argmatch_invalid (Context, Value, Problem) + + + +/* Report on stderr the list of possible arguments. */ + +void argmatch_valid (char const *const *arglist, + char const *vallist, size_t valsize); + +# define ARGMATCH_VALID(Arglist, Vallist) \ + argmatch_valid (Arglist, (char const *) (Vallist), sizeof *(Vallist)) + + + +/* Same as argmatch, but upon failure, reports a explanation on the + failure, and exits using the function EXIT_FN. */ + +ptrdiff_t __xargmatch_internal (char const *context, + char const *arg, char const *const *arglist, + char const *vallist, size_t valsize, + argmatch_exit_fn exit_fn); + +/* Programmer friendly interface to __xargmatch_internal. */ + +# define XARGMATCH(Context, Arg, Arglist, Vallist) \ + ((Vallist) [__xargmatch_internal (Context, Arg, Arglist, \ + (char const *) (Vallist), \ + sizeof *(Vallist), \ + argmatch_die)]) + +/* Convert a value into a corresponding argument. */ + +char const *argmatch_to_argument (char const *value, + char const *const *arglist, + char const *vallist, size_t valsize); + +# define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \ + argmatch_to_argument (Value, Arglist, \ + (char const *) (Vallist), sizeof *(Vallist)) + +#endif /* ARGMATCH_H_ */ diff --git a/lib/argp-ba.c b/lib/argp-ba.c new file mode 100644 index 0000000..8bb7309 --- /dev/null +++ b/lib/argp-ba.c @@ -0,0 +1,25 @@ +/* Default definition for ARGP_PROGRAM_BUG_ADDRESS. + Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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 set by the user program, it should point to string that is the + bug-reporting address for the program. It will be printed by argp_help if + the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help + messages), embedded in a sentence that says something like `Report bugs to + ADDR.'. */ +const char *argp_program_bug_address; diff --git a/lib/argp-eexst.c b/lib/argp-eexst.c new file mode 100644 index 0000000..bcab1c0 --- /dev/null +++ b/lib/argp-eexst.c @@ -0,0 +1,31 @@ +/* Default definition for ARGP_ERR_EXIT_STATUS + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "argp.h" + +/* The exit status that argp will use when exiting due to a parsing error. + If not defined or set by the user program, this defaults to EX_USAGE from + . */ +error_t argp_err_exit_status = EX_USAGE; diff --git a/lib/argp-fmtstream.c b/lib/argp-fmtstream.c new file mode 100644 index 0000000..0dd9256 --- /dev/null +++ b/lib/argp-fmtstream.c @@ -0,0 +1,435 @@ +/* Word-wrapping and line-truncating streams + Copyright (C) 1997-1999,2001,2002,2003,2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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 package emulates glibc `line_wrap_stream' semantics for systems that + don't have that. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include + +#include "argp-fmtstream.h" +#include "argp-namefrob.h" + +#ifndef ARGP_FMTSTREAM_USE_LINEWRAP + +#ifndef isblank +#define isblank(ch) ((ch)==' ' || (ch)=='\t') +#endif + +#if defined _LIBC && defined USE_IN_LIBIO +# include +# include +# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a) +#endif + +#define INIT_BUF_SIZE 200 +#define PRINTF_SIZE_GUESS 150 + +/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines + written on it with LMARGIN spaces and limits them to RMARGIN columns + total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by + replacing the whitespace before them with a newline and WMARGIN spaces. + Otherwise, chars beyond RMARGIN are simply dropped until a newline. + Returns NULL if there was an error. */ +argp_fmtstream_t +__argp_make_fmtstream (FILE *stream, + size_t lmargin, size_t rmargin, ssize_t wmargin) +{ + argp_fmtstream_t fs; + + fs = (struct argp_fmtstream *) malloc (sizeof (struct argp_fmtstream)); + if (fs != NULL) + { + fs->stream = stream; + + fs->lmargin = lmargin; + fs->rmargin = rmargin; + fs->wmargin = wmargin; + fs->point_col = 0; + fs->point_offs = 0; + + fs->buf = (char *) malloc (INIT_BUF_SIZE); + if (! fs->buf) + { + free (fs); + fs = 0; + } + else + { + fs->p = fs->buf; + fs->end = fs->buf + INIT_BUF_SIZE; + } + } + + return fs; +} +#if 0 +/* Not exported. */ +#ifdef weak_alias +weak_alias (__argp_make_fmtstream, argp_make_fmtstream) +#endif +#endif + +/* Flush FS to its stream, and free it (but don't close the stream). */ +void +__argp_fmtstream_free (argp_fmtstream_t fs) +{ + __argp_fmtstream_update (fs); + if (fs->p > fs->buf) + { +#ifdef USE_IN_LIBIO + __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); +#else + fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); +#endif + } + free (fs->buf); + free (fs); +} +#if 0 +/* Not exported. */ +#ifdef weak_alias +weak_alias (__argp_fmtstream_free, argp_fmtstream_free) +#endif +#endif + +/* Process FS's buffer so that line wrapping is done from POINT_OFFS to the + end of its buffer. This code is mostly from glibc stdio/linewrap.c. */ +void +__argp_fmtstream_update (argp_fmtstream_t fs) +{ + char *buf, *nl; + size_t len; + + /* Scan the buffer for newlines. */ + buf = fs->buf + fs->point_offs; + while (buf < fs->p) + { + size_t r; + + if (fs->point_col == 0 && fs->lmargin != 0) + { + /* We are starting a new line. Print spaces to the left margin. */ + const size_t pad = fs->lmargin; + if (fs->p + pad < fs->end) + { + /* We can fit in them in the buffer by moving the + buffer text up and filling in the beginning. */ + memmove (buf + pad, buf, fs->p - buf); + fs->p += pad; /* Compensate for bigger buffer. */ + memset (buf, ' ', pad); /* Fill in the spaces. */ + buf += pad; /* Don't bother searching them. */ + } + else + { + /* No buffer space for spaces. Must flush. */ + size_t i; + for (i = 0; i < pad; i++) + { +#ifdef USE_IN_LIBIO + if (_IO_fwide (fs->stream, 0) > 0) + putwc_unlocked (L' ', fs->stream); + else +#endif + putc_unlocked (' ', fs->stream); + } + } + fs->point_col = pad; + } + + len = fs->p - buf; + nl = memchr (buf, '\n', len); + + if (fs->point_col < 0) + fs->point_col = 0; + + if (!nl) + { + /* The buffer ends in a partial line. */ + + if (fs->point_col + len < fs->rmargin) + { + /* The remaining buffer text is a partial line and fits + within the maximum line width. Advance point for the + characters to be written and stop scanning. */ + fs->point_col += len; + break; + } + else + /* Set the end-of-line pointer for the code below to + the end of the buffer. */ + nl = fs->p; + } + else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin) + { + /* The buffer contains a full line that fits within the maximum + line width. Reset point and scan the next line. */ + fs->point_col = 0; + buf = nl + 1; + continue; + } + + /* This line is too long. */ + r = fs->rmargin - 1; + + if (fs->wmargin < 0) + { + /* Truncate the line by overwriting the excess with the + newline and anything after it in the buffer. */ + if (nl < fs->p) + { + memmove (buf + (r - fs->point_col), nl, fs->p - nl); + fs->p -= buf + (r - fs->point_col) - nl; + /* Reset point for the next line and start scanning it. */ + fs->point_col = 0; + buf += r + 1; /* Skip full line plus \n. */ + } + else + { + /* The buffer ends with a partial line that is beyond the + maximum line width. Advance point for the characters + written, and discard those past the max from the buffer. */ + fs->point_col += len; + fs->p -= fs->point_col - r; + break; + } + } + else + { + /* Do word wrap. Go to the column just past the maximum line + width and scan back for the beginning of the word there. + Then insert a line break. */ + + char *p, *nextline; + int i; + + p = buf + (r + 1 - fs->point_col); + while (p >= buf && !isblank (*p)) + --p; + nextline = p + 1; /* This will begin the next line. */ + + if (nextline > buf) + { + /* Swallow separating blanks. */ + if (p >= buf) + do + --p; + while (p >= buf && isblank (*p)); + nl = p + 1; /* The newline will replace the first blank. */ + } + else + { + /* A single word that is greater than the maximum line width. + Oh well. Put it on an overlong line by itself. */ + p = buf + (r + 1 - fs->point_col); + /* Find the end of the long word. */ + if (p < nl) + do + ++p; + while (p < nl && !isblank (*p)); + if (p == nl) + { + /* It already ends a line. No fussing required. */ + fs->point_col = 0; + buf = nl + 1; + continue; + } + /* We will move the newline to replace the first blank. */ + nl = p; + /* Swallow separating blanks. */ + do + ++p; + while (isblank (*p)); + /* The next line will start here. */ + nextline = p; + } + + /* Note: There are a bunch of tests below for + NEXTLINE == BUF + LEN + 1; this case is where NL happens to fall + at the end of the buffer, and NEXTLINE is in fact empty (and so + we need not be careful to maintain its contents). */ + + if ((nextline == buf + len + 1 + ? fs->end - nl < fs->wmargin + 1 + : nextline - (nl + 1) < fs->wmargin) + && fs->p > nextline) + { + /* The margin needs more blanks than we removed. */ + if (fs->end - fs->p > fs->wmargin + 1) + /* Make some space for them. */ + { + size_t mv = fs->p - nextline; + memmove (nl + 1 + fs->wmargin, nextline, mv); + nextline = nl + 1 + fs->wmargin; + len = nextline + mv - buf; + *nl++ = '\n'; + } + else + /* Output the first line so we can use the space. */ + { +#ifdef _LIBC + __fxprintf (fs->stream, "%.*s\n", + (int) (nl - fs->buf), fs->buf); +#else + if (nl > fs->buf) + fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream); + putc_unlocked ('\n', fs->stream); +#endif + + len += buf - fs->buf; + nl = buf = fs->buf; + } + } + else + /* We can fit the newline and blanks in before + the next word. */ + *nl++ = '\n'; + + if (nextline - nl >= fs->wmargin + || (nextline == buf + len + 1 && fs->end - nextline >= fs->wmargin)) + /* Add blanks up to the wrap margin column. */ + for (i = 0; i < fs->wmargin; ++i) + *nl++ = ' '; + else + for (i = 0; i < fs->wmargin; ++i) +#ifdef USE_IN_LIBIO + if (_IO_fwide (fs->stream, 0) > 0) + putwc_unlocked (L' ', fs->stream); + else +#endif + putc_unlocked (' ', fs->stream); + + /* Copy the tail of the original buffer into the current buffer + position. */ + if (nl < nextline) + memmove (nl, nextline, buf + len - nextline); + len -= nextline - buf; + + /* Continue the scan on the remaining lines in the buffer. */ + buf = nl; + + /* Restore bufp to include all the remaining text. */ + fs->p = nl + len; + + /* Reset the counter of what has been output this line. If wmargin + is 0, we want to avoid the lmargin getting added, so we set + point_col to a magic value of -1 in that case. */ + fs->point_col = fs->wmargin ? fs->wmargin : -1; + } + } + + /* Remember that we've scanned as far as the end of the buffer. */ + fs->point_offs = fs->p - fs->buf; +} + +/* Ensure that FS has space for AMOUNT more bytes in its buffer, either by + growing the buffer, or by flushing it. True is returned iff we succeed. */ +int +__argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount) +{ + if ((size_t) (fs->end - fs->p) < amount) + { + ssize_t wrote; + + /* Flush FS's buffer. */ + __argp_fmtstream_update (fs); + +#ifdef _LIBC + __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); + wrote = fs->p - fs->buf; +#else + wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); +#endif + if (wrote == fs->p - fs->buf) + { + fs->p = fs->buf; + fs->point_offs = 0; + } + else + { + fs->p -= wrote; + fs->point_offs -= wrote; + memmove (fs->buf, fs->buf + wrote, fs->p - fs->buf); + return 0; + } + + if ((size_t) (fs->end - fs->buf) < amount) + /* Gotta grow the buffer. */ + { + size_t old_size = fs->end - fs->buf; + size_t new_size = old_size + amount; + char *new_buf; + + if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size))) + { + __set_errno (ENOMEM); + return 0; + } + + fs->buf = new_buf; + fs->end = new_buf + new_size; + fs->p = fs->buf; + } + } + + return 1; +} + +ssize_t +__argp_fmtstream_printf (struct argp_fmtstream *fs, const char *fmt, ...) +{ + int out; + size_t avail; + size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to reserve. */ + + do + { + va_list args; + + if (! __argp_fmtstream_ensure (fs, size_guess)) + return -1; + + va_start (args, fmt); + avail = fs->end - fs->p; + out = __vsnprintf (fs->p, avail, fmt, args); + va_end (args); + if ((size_t) out >= avail) + size_guess = out + 1; + } + while ((size_t) out >= avail); + + fs->p += out; + + return out; +} +#if 0 +/* Not exported. */ +#ifdef weak_alias +weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf) +#endif +#endif + +#endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */ diff --git a/lib/argp-fmtstream.h b/lib/argp-fmtstream.h new file mode 100644 index 0000000..e045a72 --- /dev/null +++ b/lib/argp-fmtstream.h @@ -0,0 +1,301 @@ +/* Word-wrapping and line-truncating streams. + Copyright (C) 1997, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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 package emulates glibc `line_wrap_stream' semantics for systems that + don't have that. If the system does have it, it is just a wrapper for + that. This header file is only used internally while compiling argp, and + shouldn't be installed. */ + +#ifndef _ARGP_FMTSTREAM_H +#define _ARGP_FMTSTREAM_H + +#include +#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) || __STRICT_ANSI__ +# define __format__ format +# define __printf__ printf +# endif +#endif + +#if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \ + || (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)) +/* line_wrap_stream is available, so use that. */ +#define ARGP_FMTSTREAM_USE_LINEWRAP +#endif + +#ifdef ARGP_FMTSTREAM_USE_LINEWRAP +/* Just be a simple wrapper for line_wrap_stream; the semantics are + *slightly* different, as line_wrap_stream doesn't actually make a new + object, it just modifies the given stream (reversibly) to do + line-wrapping. Since we control who uses this code, it doesn't matter. */ + +#include + +typedef FILE *argp_fmtstream_t; + +#define argp_make_fmtstream line_wrap_stream +#define __argp_make_fmtstream line_wrap_stream +#define argp_fmtstream_free line_unwrap_stream +#define __argp_fmtstream_free line_unwrap_stream + +#define __argp_fmtstream_putc(fs,ch) putc(ch,fs) +#define argp_fmtstream_putc(fs,ch) putc(ch,fs) +#define __argp_fmtstream_puts(fs,str) fputs(str,fs) +#define argp_fmtstream_puts(fs,str) fputs(str,fs) +#define __argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs) +#define argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs) +#define __argp_fmtstream_printf fprintf +#define argp_fmtstream_printf fprintf + +#define __argp_fmtstream_lmargin line_wrap_lmargin +#define argp_fmtstream_lmargin line_wrap_lmargin +#define __argp_fmtstream_set_lmargin line_wrap_set_lmargin +#define argp_fmtstream_set_lmargin line_wrap_set_lmargin +#define __argp_fmtstream_rmargin line_wrap_rmargin +#define argp_fmtstream_rmargin line_wrap_rmargin +#define __argp_fmtstream_set_rmargin line_wrap_set_rmargin +#define argp_fmtstream_set_rmargin line_wrap_set_rmargin +#define __argp_fmtstream_wmargin line_wrap_wmargin +#define argp_fmtstream_wmargin line_wrap_wmargin +#define __argp_fmtstream_set_wmargin line_wrap_set_wmargin +#define argp_fmtstream_set_wmargin line_wrap_set_wmargin +#define __argp_fmtstream_point line_wrap_point +#define argp_fmtstream_point line_wrap_point + +#else /* !ARGP_FMTSTREAM_USE_LINEWRAP */ +/* Guess we have to define our own version. */ + +struct argp_fmtstream +{ + FILE *stream; /* The stream we're outputting to. */ + + size_t lmargin, rmargin; /* Left and right margins. */ + ssize_t wmargin; /* Margin to wrap to, or -1 to truncate. */ + + /* Point in buffer to which we've processed for wrapping, but not output. */ + size_t point_offs; + /* Output column at POINT_OFFS, or -1 meaning 0 but don't add lmargin. */ + ssize_t point_col; + + char *buf; /* Output buffer. */ + char *p; /* Current end of text in BUF. */ + char *end; /* Absolute end of BUF. */ +}; + +typedef struct argp_fmtstream *argp_fmtstream_t; + +/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines + written on it with LMARGIN spaces and limits them to RMARGIN columns + total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by + replacing the whitespace before them with a newline and WMARGIN spaces. + Otherwise, chars beyond RMARGIN are simply dropped until a newline. + Returns NULL if there was an error. */ +extern argp_fmtstream_t __argp_make_fmtstream (FILE *__stream, + size_t __lmargin, + size_t __rmargin, + ssize_t __wmargin); +extern argp_fmtstream_t argp_make_fmtstream (FILE *__stream, + size_t __lmargin, + size_t __rmargin, + ssize_t __wmargin); + +/* Flush __FS to its stream, and free it (but don't close the stream). */ +extern void __argp_fmtstream_free (argp_fmtstream_t __fs); +extern void argp_fmtstream_free (argp_fmtstream_t __fs); + +extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs, + const char *__fmt, ...) + __attribute__ ((__format__ (printf, 2, 3))); +extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs, + const char *__fmt, ...) + __attribute__ ((__format__ (printf, 2, 3))); + +extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); +extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); + +extern int __argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str); +extern int argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str); + +extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs, + const char *__str, size_t __len); +extern size_t argp_fmtstream_write (argp_fmtstream_t __fs, + const char *__str, size_t __len); + +/* Access macros for various bits of state. */ +#define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin) +#define argp_fmtstream_rmargin(__fs) ((__fs)->rmargin) +#define argp_fmtstream_wmargin(__fs) ((__fs)->wmargin) +#define __argp_fmtstream_lmargin argp_fmtstream_lmargin +#define __argp_fmtstream_rmargin argp_fmtstream_rmargin +#define __argp_fmtstream_wmargin argp_fmtstream_wmargin + +/* Set __FS's left margin to LMARGIN and return the old value. */ +extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, + size_t __lmargin); +extern size_t __argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, + size_t __lmargin); + +/* Set __FS's right margin to __RMARGIN and return the old value. */ +extern size_t argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, + size_t __rmargin); +extern size_t __argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, + size_t __rmargin); + +/* Set __FS's wrap margin to __WMARGIN and return the old value. */ +extern size_t argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, + size_t __wmargin); +extern size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, + size_t __wmargin); + +/* Return the column number of the current output point in __FS. */ +extern size_t argp_fmtstream_point (argp_fmtstream_t __fs); +extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs); + +/* Internal routines. */ +extern void _argp_fmtstream_update (argp_fmtstream_t __fs); +extern void __argp_fmtstream_update (argp_fmtstream_t __fs); +extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); +extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); + +#ifdef __OPTIMIZE__ +/* Inline versions of above routines. */ + +#if !_LIBC +#define __argp_fmtstream_putc argp_fmtstream_putc +#define __argp_fmtstream_puts argp_fmtstream_puts +#define __argp_fmtstream_write argp_fmtstream_write +#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin +#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin +#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin +#define __argp_fmtstream_point argp_fmtstream_point +#define __argp_fmtstream_update _argp_fmtstream_update +#define __argp_fmtstream_ensure _argp_fmtstream_ensure +#endif + +#ifndef ARGP_FS_EI +#define ARGP_FS_EI extern inline +#endif + +ARGP_FS_EI size_t +__argp_fmtstream_write (argp_fmtstream_t __fs, + const char *__str, size_t __len) +{ + if (__fs->p + __len <= __fs->end || __argp_fmtstream_ensure (__fs, __len)) + { + memcpy (__fs->p, __str, __len); + __fs->p += __len; + return __len; + } + else + return 0; +} + +ARGP_FS_EI int +__argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str) +{ + size_t __len = strlen (__str); + if (__len) + { + size_t __wrote = __argp_fmtstream_write (__fs, __str, __len); + return __wrote == __len ? 0 : -1; + } + else + return 0; +} + +ARGP_FS_EI int +__argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch) +{ + if (__fs->p < __fs->end || __argp_fmtstream_ensure (__fs, 1)) + return *__fs->p++ = __ch; + else + return EOF; +} + +/* Set __FS's left margin to __LMARGIN and return the old value. */ +ARGP_FS_EI size_t +__argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin) +{ + size_t __old; + if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) + __argp_fmtstream_update (__fs); + __old = __fs->lmargin; + __fs->lmargin = __lmargin; + return __old; +} + +/* Set __FS's right margin to __RMARGIN and return the old value. */ +ARGP_FS_EI size_t +__argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin) +{ + size_t __old; + if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) + __argp_fmtstream_update (__fs); + __old = __fs->rmargin; + __fs->rmargin = __rmargin; + return __old; +} + +/* Set FS's wrap margin to __WMARGIN and return the old value. */ +ARGP_FS_EI size_t +__argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin) +{ + size_t __old; + if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) + __argp_fmtstream_update (__fs); + __old = __fs->wmargin; + __fs->wmargin = __wmargin; + return __old; +} + +/* Return the column number of the current output point in __FS. */ +ARGP_FS_EI size_t +__argp_fmtstream_point (argp_fmtstream_t __fs) +{ + if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) + __argp_fmtstream_update (__fs); + return __fs->point_col >= 0 ? __fs->point_col : 0; +} + +#if !_LIBC +#undef __argp_fmtstream_putc +#undef __argp_fmtstream_puts +#undef __argp_fmtstream_write +#undef __argp_fmtstream_set_lmargin +#undef __argp_fmtstream_set_rmargin +#undef __argp_fmtstream_set_wmargin +#undef __argp_fmtstream_point +#undef __argp_fmtstream_update +#undef __argp_fmtstream_ensure +#endif + +#endif /* __OPTIMIZE__ */ + +#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */ + +#endif /* argp-fmtstream.h */ diff --git a/lib/argp-fs-xinl.c b/lib/argp-fs-xinl.c new file mode 100644 index 0000000..3b4c917 --- /dev/null +++ b/lib/argp-fs-xinl.c @@ -0,0 +1,43 @@ +/* Real definitions for extern inline functions in argp-fmtstream.h + Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#define ARGP_FS_EI +#undef __OPTIMIZE__ +#define __OPTIMIZE__ 1 +#include "argp-fmtstream.h" + +#if 0 +/* Not exported. */ +/* Add weak aliases. */ +#if _LIBC - 0 && !defined (ARGP_FMTSTREAM_USE_LINEWRAP) && defined (weak_alias) + +weak_alias (__argp_fmtstream_putc, argp_fmtstream_putc) +weak_alias (__argp_fmtstream_puts, argp_fmtstream_puts) +weak_alias (__argp_fmtstream_write, argp_fmtstream_write) +weak_alias (__argp_fmtstream_set_lmargin, argp_fmtstream_set_lmargin) +weak_alias (__argp_fmtstream_set_rmargin, argp_fmtstream_set_rmargin) +weak_alias (__argp_fmtstream_set_wmargin, argp_fmtstream_set_wmargin) +weak_alias (__argp_fmtstream_point, argp_fmtstream_point) + +#endif +#endif diff --git a/lib/argp-help.c b/lib/argp-help.c new file mode 100644 index 0000000..396e733 --- /dev/null +++ b/lib/argp-help.c @@ -0,0 +1,1954 @@ +/* Hierarchial argument parsing help output + Copyright (C) 1995-2005, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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 _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef USE_IN_LIBIO +# include +#endif + +#ifdef _LIBC +# include +# undef dgettext +# define dgettext(domain, msgid) \ + INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES) +#else +# include "gettext.h" +#endif + +#include "argp.h" +#include "argp-fmtstream.h" +#include "argp-namefrob.h" + +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + +/* User-selectable (using an environment variable) formatting parameters. + + These may be specified in an environment variable called `ARGP_HELP_FMT', + with a contents like: VAR1=VAL1,VAR2=VAL2,BOOLVAR2,no-BOOLVAR2 + Where VALn must be a positive integer. The list of variables is in the + UPARAM_NAMES vector, below. */ + +/* Default parameters. */ +#define DUP_ARGS 0 /* True if option argument can be duplicated. */ +#define DUP_ARGS_NOTE 1 /* True to print a note about duplicate args. */ +#define SHORT_OPT_COL 2 /* column in which short options start */ +#define LONG_OPT_COL 6 /* column in which long options start */ +#define DOC_OPT_COL 2 /* column in which doc options start */ +#define OPT_DOC_COL 29 /* column in which option text starts */ +#define HEADER_COL 1 /* column in which group headers are printed */ +#define USAGE_INDENT 12 /* indentation of wrapped usage lines */ +#define RMARGIN 79 /* right margin used for wrapping */ + +/* User-selectable (using an environment variable) formatting parameters. + They must all be of type `int' for the parsing code to work. */ +struct uparams +{ + /* If true, arguments for an option are shown with both short and long + options, even when a given option has both, e.g. `-x ARG, --longx=ARG'. + If false, then if an option has both, the argument is only shown with + the long one, e.g., `-x, --longx=ARG', and a message indicating that + this really means both is printed below the options. */ + int dup_args; + + /* This is true if when DUP_ARGS is false, and some duplicate arguments have + been suppressed, an explanatory message should be printed. */ + int dup_args_note; + + /* Various output columns. */ + int short_opt_col; /* column in which short options start */ + int long_opt_col; /* column in which long options start */ + int doc_opt_col; /* column in which doc options start */ + int opt_doc_col; /* column in which option text starts */ + int header_col; /* column in which group headers are printed */ + int usage_indent; /* indentation of wrapped usage lines */ + int rmargin; /* right margin used for wrapping */ + + int valid; /* True when the values in here are valid. */ +}; + +/* This is a global variable, as user options are only ever read once. */ +static struct uparams uparams = { + DUP_ARGS, DUP_ARGS_NOTE, + SHORT_OPT_COL, LONG_OPT_COL, DOC_OPT_COL, OPT_DOC_COL, HEADER_COL, + USAGE_INDENT, RMARGIN, + 0 +}; + +/* A particular uparam, and what the user name is. */ +struct uparam_name +{ + const char *name; /* User name. */ + int is_bool; /* Whether it's `boolean'. */ + size_t uparams_offs; /* Location of the (int) field in UPARAMS. */ +}; + +/* The name-field mappings we know about. */ +static const struct uparam_name uparam_names[] = +{ + { "dup-args", 1, offsetof (struct uparams, dup_args) }, + { "dup-args-note", 1, offsetof (struct uparams, dup_args_note) }, + { "short-opt-col", 0, offsetof (struct uparams, short_opt_col) }, + { "long-opt-col", 0, offsetof (struct uparams, long_opt_col) }, + { "doc-opt-col", 0, offsetof (struct uparams, doc_opt_col) }, + { "opt-doc-col", 0, offsetof (struct uparams, opt_doc_col) }, + { "header-col", 0, offsetof (struct uparams, header_col) }, + { "usage-indent", 0, offsetof (struct uparams, usage_indent) }, + { "rmargin", 0, offsetof (struct uparams, rmargin) }, + { 0 } +}; + +static void +validate_uparams (const struct argp_state *state, struct uparams *upptr) +{ + const struct uparam_name *up; + + for (up = uparam_names; up->name; up++) + { + if (up->is_bool + || up->uparams_offs == offsetof (struct uparams, rmargin)) + continue; + if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin) + { + __argp_failure (state, 0, 0, + dgettext (state->root_argp->argp_domain, + "\ +ARGP_HELP_FMT: %s value is less than or equal to %s"), + "rmargin", up->name); + return; + } + } + uparams = *upptr; + uparams.valid = 1; +} + +/* Read user options from the environment, and fill in UPARAMS appropiately. */ +static void +fill_in_uparams (const struct argp_state *state) +{ + const char *var = getenv ("ARGP_HELP_FMT"); + struct uparams new_params = uparams; + +#define SKIPWS(p) do { while (isspace ((unsigned char) *p)) p++; } while (0); + + if (var) + { + /* Parse var. */ + while (*var) + { + SKIPWS (var); + + if (isalpha ((unsigned char) *var)) + { + size_t var_len; + const struct uparam_name *un; + int unspec = 0, val = 0; + const char *arg = var; + + while (isalnum ((unsigned char) *arg) || *arg == '-' || *arg == '_') + arg++; + var_len = arg - var; + + SKIPWS (arg); + + if (*arg == '\0' || *arg == ',') + unspec = 1; + else if (*arg == '=') + { + arg++; + SKIPWS (arg); + } + + if (unspec) + { + if (var[0] == 'n' && var[1] == 'o' && var[2] == '-') + { + val = 0; + var += 3; + var_len -= 3; + } + else + val = 1; + } + else if (isdigit ((unsigned char) *arg)) + { + val = atoi (arg); + while (isdigit ((unsigned char) *arg)) + arg++; + SKIPWS (arg); + } + + for (un = uparam_names; un->name; un++) + if (strlen (un->name) == var_len + && strncmp (var, un->name, var_len) == 0) + { + if (unspec && !un->is_bool) + __argp_failure (state, 0, 0, + dgettext (state->root_argp->argp_domain, + "\ +%.*s: ARGP_HELP_FMT parameter requires a value"), + (int) var_len, var); + else if (val < 0) + __argp_failure (state, 0, 0, + dgettext (state->root_argp->argp_domain, + "\ +%.*s: ARGP_HELP_FMT parameter must be positive"), + (int) var_len, var); + else + *(int *)((char *)&new_params + un->uparams_offs) = val; + break; + } + if (! un->name) + __argp_failure (state, 0, 0, + dgettext (state->root_argp->argp_domain, "\ +%.*s: Unknown ARGP_HELP_FMT parameter"), + (int) var_len, var); + + var = arg; + if (*var == ',') + var++; + } + else if (*var) + { + __argp_failure (state, 0, 0, + dgettext (state->root_argp->argp_domain, + "Garbage in ARGP_HELP_FMT: %s"), var); + break; + } + } + validate_uparams (state, &new_params); + } +} + +/* Returns true if OPT hasn't been marked invisible. Visibility only affects + whether OPT is displayed or used in sorting, not option shadowing. */ +#define ovisible(opt) (! ((opt)->flags & OPTION_HIDDEN)) + +/* Returns true if OPT is an alias for an earlier option. */ +#define oalias(opt) ((opt)->flags & OPTION_ALIAS) + +/* Returns true if OPT is an documentation-only entry. */ +#define odoc(opt) ((opt)->flags & OPTION_DOC) + +/* Returns true if OPT should not be translated */ +#define onotrans(opt) ((opt)->flags & OPTION_NO_TRANS) + +/* Returns true if OPT is the end-of-list marker for a list of options. */ +#define oend(opt) __option_is_end (opt) + +/* Returns true if OPT has a short option. */ +#define oshort(opt) __option_is_short (opt) + +/* + The help format for a particular option is like: + + -xARG, -yARG, --long1=ARG, --long2=ARG Documentation... + + Where ARG will be omitted if there's no argument, for this option, or + will be surrounded by "[" and "]" appropiately if the argument is + optional. The documentation string is word-wrapped appropiately, and if + the list of options is long enough, it will be started on a separate line. + If there are no short options for a given option, the first long option is + indented slighly in a way that's supposed to make most long options appear + to be in a separate column. + + For example, the following output (from ps): + + -p PID, --pid=PID List the process PID + --pgrp=PGRP List processes in the process group PGRP + -P, -x, --no-parent Include processes without parents + -Q, --all-fields Don't elide unusable fields (normally if there's + some reason ps can't print a field for any + process, it's removed from the output entirely) + -r, --reverse, --gratuitously-long-reverse-option + Reverse the order of any sort + --session[=SID] Add the processes from the session SID (which + defaults to the sid of the current process) + + Here are some more options: + -f ZOT, --foonly=ZOT Glork a foonly + -z, --zaza Snit a zar + + -?, --help Give this help list + --usage Give a short usage message + -V, --version Print program version + + The struct argp_option array for the above could look like: + + { + {"pid", 'p', "PID", 0, "List the process PID"}, + {"pgrp", OPT_PGRP, "PGRP", 0, "List processes in the process group PGRP"}, + {"no-parent", 'P', 0, 0, "Include processes without parents"}, + {0, 'x', 0, OPTION_ALIAS}, + {"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally" + " if there's some reason ps can't" + " print a field for any process, it's" + " removed from the output entirely)" }, + {"reverse", 'r', 0, 0, "Reverse the order of any sort"}, + {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS}, + {"session", OPT_SESS, "SID", OPTION_ARG_OPTIONAL, + "Add the processes from the session" + " SID (which defaults to the sid of" + " the current process)" }, + + {0,0,0,0, "Here are some more options:"}, + {"foonly", 'f', "ZOT", 0, "Glork a foonly"}, + {"zaza", 'z', 0, 0, "Snit a zar"}, + + {0} + } + + Note that the last three options are automatically supplied by argp_parse, + unless you tell it not to with ARGP_NO_HELP. + +*/ + +/* Returns true if CH occurs between BEG and END. */ +static int +find_char (char ch, char *beg, char *end) +{ + while (beg < end) + if (*beg == ch) + return 1; + else + beg++; + return 0; +} + +struct hol_cluster; /* fwd decl */ + +struct hol_entry +{ + /* First option. */ + const struct argp_option *opt; + /* Number of options (including aliases). */ + unsigned num; + + /* A pointers into the HOL's short_options field, to the first short option + letter for this entry. The order of the characters following this point + corresponds to the order of options pointed to by OPT, and there are at + most NUM. A short option recorded in a option following OPT is only + valid if it occurs in the right place in SHORT_OPTIONS (otherwise it's + probably been shadowed by some other entry). */ + char *short_options; + + /* Entries are sorted by their group first, in the order: + 1, 2, ..., n, 0, -m, ..., -2, -1 + and then alphabetically within each group. The default is 0. */ + int group; + + /* The cluster of options this entry belongs to, or 0 if none. */ + struct hol_cluster *cluster; + + /* The argp from which this option came. */ + const struct argp *argp; + + /* Position in the array */ + unsigned ord; +}; + +/* A cluster of entries to reflect the argp tree structure. */ +struct hol_cluster +{ + /* A descriptive header printed before options in this cluster. */ + const char *header; + + /* Used to order clusters within the same group with the same parent, + according to the order in which they occurred in the parent argp's child + list. */ + int index; + + /* How to sort this cluster with respect to options and other clusters at the + same depth (clusters always follow options in the same group). */ + int group; + + /* The cluster to which this cluster belongs, or 0 if it's at the base + level. */ + struct hol_cluster *parent; + + /* The argp from which this cluster is (eventually) derived. */ + const struct argp *argp; + + /* The distance this cluster is from the root. */ + int depth; + + /* Clusters in a given hol are kept in a linked list, to make freeing them + possible. */ + struct hol_cluster *next; +}; + +/* A list of options for help. */ +struct hol +{ + /* An array of hol_entry's. */ + struct hol_entry *entries; + /* The number of entries in this hol. If this field is zero, the others + are undefined. */ + unsigned num_entries; + + /* A string containing all short options in this HOL. Each entry contains + pointers into this string, so the order can't be messed with blindly. */ + char *short_options; + + /* Clusters of entries in this hol. */ + struct hol_cluster *clusters; +}; + +/* Create a struct hol from the options in ARGP. CLUSTER is the + hol_cluster in which these entries occur, or 0, if at the root. */ +static struct hol * +make_hol (const struct argp *argp, struct hol_cluster *cluster) +{ + char *so; + const struct argp_option *o; + const struct argp_option *opts = argp->options; + struct hol_entry *entry; + unsigned num_short_options = 0; + struct hol *hol = malloc (sizeof (struct hol)); + + assert (hol); + + hol->num_entries = 0; + hol->clusters = 0; + + if (opts) + { + int cur_group = 0; + + /* The first option must not be an alias. */ + assert (! oalias (opts)); + + /* Calculate the space needed. */ + for (o = opts; ! oend (o); o++) + { + if (! oalias (o)) + hol->num_entries++; + if (oshort (o)) + num_short_options++; /* This is an upper bound. */ + } + + hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries); + hol->short_options = malloc (num_short_options + 1); + + assert (hol->entries && hol->short_options); + if (SIZE_MAX <= UINT_MAX) + assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry)); + + /* Fill in the entries. */ + so = hol->short_options; + for (o = opts, entry = hol->entries; ! oend (o); entry++) + { + entry->opt = o; + entry->num = 0; + entry->short_options = so; + entry->group = cur_group = + o->group + ? o->group + : ((!o->name && !o->key) + ? cur_group + 1 + : cur_group); + entry->cluster = cluster; + entry->argp = argp; + + do + { + entry->num++; + if (oshort (o) && ! find_char (o->key, hol->short_options, so)) + /* O has a valid short option which hasn't already been used.*/ + *so++ = o->key; + o++; + } + while (! oend (o) && oalias (o)); + } + *so = '\0'; /* null terminated so we can find the length */ + } + + return hol; +} + +/* Add a new cluster to HOL, with the given GROUP and HEADER (taken from the + associated argp child list entry), INDEX, and PARENT, and return a pointer + to it. ARGP is the argp that this cluster results from. */ +static struct hol_cluster * +hol_add_cluster (struct hol *hol, int group, const char *header, int index, + struct hol_cluster *parent, const struct argp *argp) +{ + struct hol_cluster *cl = malloc (sizeof (struct hol_cluster)); + if (cl) + { + cl->group = group; + cl->header = header; + + cl->index = index; + cl->parent = parent; + cl->argp = argp; + cl->depth = parent ? parent->depth + 1 : 0; + + cl->next = hol->clusters; + hol->clusters = cl; + } + return cl; +} + +/* Free HOL and any resources it uses. */ +static void +hol_free (struct hol *hol) +{ + struct hol_cluster *cl = hol->clusters; + + while (cl) + { + struct hol_cluster *next = cl->next; + free (cl); + cl = next; + } + + if (hol->num_entries > 0) + { + free (hol->entries); + free (hol->short_options); + } + + free (hol); +} + +static int +hol_entry_short_iterate (const struct hol_entry *entry, + int (*func)(const struct argp_option *opt, + const struct argp_option *real, + const char *domain, void *cookie), + const char *domain, void *cookie) +{ + unsigned nopts; + int val = 0; + const struct argp_option *opt, *real = entry->opt; + char *so = entry->short_options; + + for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--) + if (oshort (opt) && *so == opt->key) + { + if (!oalias (opt)) + real = opt; + if (ovisible (opt)) + val = (*func)(opt, real, domain, cookie); + so++; + } + + return val; +} + +static inline int +__attribute__ ((always_inline)) +hol_entry_long_iterate (const struct hol_entry *entry, + int (*func)(const struct argp_option *opt, + const struct argp_option *real, + const char *domain, void *cookie), + const char *domain, void *cookie) +{ + unsigned nopts; + int val = 0; + const struct argp_option *opt, *real = entry->opt; + + for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--) + if (opt->name) + { + if (!oalias (opt)) + real = opt; + if (ovisible (opt)) + val = (*func)(opt, real, domain, cookie); + } + + return val; +} + +/* Iterator that returns true for the first short option. */ +static inline int +until_short (const struct argp_option *opt, const struct argp_option *real, + const char *domain, void *cookie) +{ + return oshort (opt) ? opt->key : 0; +} + +/* Returns the first valid short option in ENTRY, or 0 if there is none. */ +static char +hol_entry_first_short (const struct hol_entry *entry) +{ + return hol_entry_short_iterate (entry, until_short, + entry->argp->argp_domain, 0); +} + +/* Returns the first valid long option in ENTRY, or 0 if there is none. */ +static const char * +hol_entry_first_long (const struct hol_entry *entry) +{ + const struct argp_option *opt; + unsigned num; + for (opt = entry->opt, num = entry->num; num > 0; opt++, num--) + if (opt->name && ovisible (opt)) + return opt->name; + return 0; +} + +/* Returns the entry in HOL with the long option name NAME, or 0 if there is + none. */ +static struct hol_entry * +hol_find_entry (struct hol *hol, const char *name) +{ + struct hol_entry *entry = hol->entries; + unsigned num_entries = hol->num_entries; + + while (num_entries-- > 0) + { + const struct argp_option *opt = entry->opt; + unsigned num_opts = entry->num; + + while (num_opts-- > 0) + if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0) + return entry; + else + opt++; + + entry++; + } + + return 0; +} + +/* If an entry with the long option NAME occurs in HOL, set it's special + sort position to GROUP. */ +static void +hol_set_group (struct hol *hol, const char *name, int group) +{ + struct hol_entry *entry = hol_find_entry (hol, name); + if (entry) + entry->group = group; +} + +/* Order by group: 0, 1, 2, ..., n, -m, ..., -2, -1. + EQ is what to return if GROUP1 and GROUP2 are the same. */ +static int +group_cmp (int group1, int group2, int eq) +{ + if (group1 == group2) + return eq; + else if ((group1 < 0 && group2 < 0) || (group1 >= 0 && group2 >= 0)) + return group1 - group2; + else + return group2 - group1; +} + +/* Compare clusters CL1 & CL2 by the order that they should appear in + output. */ +static int +hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2) +{ + /* If one cluster is deeper than the other, use its ancestor at the same + level, so that finding the common ancestor is straightforward. + + clN->depth > 0 means that clN->parent != NULL (see hol_add_cluster) */ + while (cl1->depth > cl2->depth) + cl1 = cl1->parent; + while (cl2->depth > cl1->depth) + cl2 = cl2->parent; + + /* Now reduce both clusters to their ancestors at the point where both have + a common parent; these can be directly compared. */ + while (cl1->parent != cl2->parent) + cl1 = cl1->parent, cl2 = cl2->parent; + + return group_cmp (cl1->group, cl2->group, cl2->index - cl1->index); +} + +/* Return the ancestor of CL that's just below the root (i.e., has a parent + of 0). */ +static struct hol_cluster * +hol_cluster_base (struct hol_cluster *cl) +{ + while (cl->parent) + cl = cl->parent; + return cl; +} + +/* Return true if CL1 is a child of CL2. */ +static int +hol_cluster_is_child (const struct hol_cluster *cl1, + const struct hol_cluster *cl2) +{ + while (cl1 && cl1 != cl2) + cl1 = cl1->parent; + return cl1 == cl2; +} + +/* Given the name of a OPTION_DOC option, modifies NAME to start at the tail + that should be used for comparisons, and returns true iff it should be + treated as a non-option. */ +static int +canon_doc_option (const char **name) +{ + int non_opt; + + if (!*name) + non_opt = 1; + else + { + /* Skip initial whitespace. */ + while (isspace ((unsigned char) **name)) + (*name)++; + /* Decide whether this looks like an option (leading `-') or not. */ + non_opt = (**name != '-'); + /* Skip until part of name used for sorting. */ + while (**name && !isalnum ((unsigned char) **name)) + (*name)++; + } + return non_opt; +} + +#define HOL_ENTRY_PTRCMP(a,b) ((a)->ord < (b)->ord ? -1 : 1) + +/* Order ENTRY1 & ENTRY2 by the order which they should appear in a help + listing. */ +static int +hol_entry_cmp (const struct hol_entry *entry1, + const struct hol_entry *entry2) +{ + /* The group numbers by which the entries should be ordered; if either is + in a cluster, then this is just the group within the cluster. */ + int group1 = entry1->group, group2 = entry2->group; + int rc; + + if (entry1->cluster != entry2->cluster) + { + /* The entries are not within the same cluster, so we can't compare them + directly, we have to use the appropiate clustering level too. */ + if (! entry1->cluster) + /* ENTRY1 is at the `base level', not in a cluster, so we have to + compare it's group number with that of the base cluster in which + ENTRY2 resides. Note that if they're in the same group, the + clustered option always comes laster. */ + return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1); + else if (! entry2->cluster) + /* Likewise, but ENTRY2's not in a cluster. */ + return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1); + else + /* Both entries are in clusters, we can just compare the clusters. */ + return (rc = hol_cluster_cmp (entry1->cluster, entry2->cluster)) ? + rc : HOL_ENTRY_PTRCMP(entry1, entry2); + } + else if (group1 == group2) + /* The entries are both in the same cluster and group, so compare them + alphabetically. */ + { + int short1 = hol_entry_first_short (entry1); + int short2 = hol_entry_first_short (entry2); + int doc1 = odoc (entry1->opt); + int doc2 = odoc (entry2->opt); + const char *long1 = hol_entry_first_long (entry1); + const char *long2 = hol_entry_first_long (entry2); + + if (doc1) + doc1 = canon_doc_option (&long1); + if (doc2) + doc2 = canon_doc_option (&long2); + + if (doc1 != doc2) + /* `documentation' options always follow normal options (or + documentation options that *look* like normal options). */ + return doc1 - doc2; + else if (!short1 && !short2 && long1 && long2) + /* Only long options. */ + return (rc = __strcasecmp (long1, long2)) ? + rc : HOL_ENTRY_PTRCMP(entry1, entry2); + else + /* Compare short/short, long/short, short/long, using the first + character of long options. Entries without *any* valid + options (such as options with OPTION_HIDDEN set) will be put + first, but as they're not displayed, it doesn't matter where + they are. */ + { + char first1 = short1 ? short1 : long1 ? *long1 : 0; + char first2 = short2 ? short2 : long2 ? *long2 : 0; +#ifdef _tolower + int lower_cmp = _tolower (first1) - _tolower (first2); +#else + int lower_cmp = tolower (first1) - tolower (first2); +#endif + /* Compare ignoring case, except when the options are both the + same letter, in which case lower-case always comes first. */ + return lower_cmp ? lower_cmp : + (rc = first2 - first1) ? + rc : HOL_ENTRY_PTRCMP(entry1, entry2); + } + } + else + /* Within the same cluster, but not the same group, so just compare + groups. */ + return group_cmp (group1, group2, HOL_ENTRY_PTRCMP(entry1, entry2)); +} + +/* Version of hol_entry_cmp with correct signature for qsort. */ +static int +hol_entry_qcmp (const void *entry1_v, const void *entry2_v) +{ + return hol_entry_cmp (entry1_v, entry2_v); +} + +/* Sort HOL by group and alphabetically by option name (with short options + taking precedence over long). Since the sorting is for display purposes + only, the shadowing of options isn't effected. */ +static void +hol_sort (struct hol *hol) +{ + if (hol->num_entries > 0) + { + unsigned i; + struct hol_entry *e; + for (i = 0, e = hol->entries; i < hol->num_entries; i++, e++) + e->ord = i; + qsort (hol->entries, hol->num_entries, sizeof (struct hol_entry), + hol_entry_qcmp); + } +} + +/* Append MORE to HOL, destroying MORE in the process. Options in HOL shadow + any in MORE with the same name. */ +static void +hol_append (struct hol *hol, struct hol *more) +{ + struct hol_cluster **cl_end = &hol->clusters; + + /* Steal MORE's cluster list, and add it to the end of HOL's. */ + while (*cl_end) + cl_end = &(*cl_end)->next; + *cl_end = more->clusters; + more->clusters = 0; + + /* Merge entries. */ + if (more->num_entries > 0) + { + if (hol->num_entries == 0) + { + hol->num_entries = more->num_entries; + hol->entries = more->entries; + hol->short_options = more->short_options; + more->num_entries = 0; /* Mark MORE's fields as invalid. */ + } + else + /* Append the entries in MORE to those in HOL, taking care to only add + non-shadowed SHORT_OPTIONS values. */ + { + unsigned left; + char *so, *more_so; + struct hol_entry *e; + unsigned num_entries = hol->num_entries + more->num_entries; + struct hol_entry *entries = + malloc (num_entries * sizeof (struct hol_entry)); + unsigned hol_so_len = strlen (hol->short_options); + char *short_options = + malloc (hol_so_len + strlen (more->short_options) + 1); + + assert (entries && short_options); + if (SIZE_MAX <= UINT_MAX) + assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry)); + + __mempcpy (__mempcpy (entries, hol->entries, + hol->num_entries * sizeof (struct hol_entry)), + more->entries, + more->num_entries * sizeof (struct hol_entry)); + + __mempcpy (short_options, hol->short_options, hol_so_len); + + /* Fix up the short options pointers from HOL. */ + for (e = entries, left = hol->num_entries; left > 0; e++, left--) + e->short_options += (short_options - hol->short_options); + + /* Now add the short options from MORE, fixing up its entries + too. */ + so = short_options + hol_so_len; + more_so = more->short_options; + for (left = more->num_entries; left > 0; e++, left--) + { + int opts_left; + const struct argp_option *opt; + + e->short_options = so; + + for (opts_left = e->num, opt = e->opt; opts_left; opt++, opts_left--) + { + int ch = *more_so; + if (oshort (opt) && ch == opt->key) + /* The next short option in MORE_SO, CH, is from OPT. */ + { + if (! find_char (ch, short_options, + short_options + hol_so_len)) + /* The short option CH isn't shadowed by HOL's options, + so add it to the sum. */ + *so++ = ch; + more_so++; + } + } + } + + *so = '\0'; + + free (hol->entries); + free (hol->short_options); + + hol->entries = entries; + hol->num_entries = num_entries; + hol->short_options = short_options; + } + } + + hol_free (more); +} + +/* Inserts enough spaces to make sure STREAM is at column COL. */ +static void +indent_to (argp_fmtstream_t stream, unsigned col) +{ + int needed = col - __argp_fmtstream_point (stream); + while (needed-- > 0) + __argp_fmtstream_putc (stream, ' '); +} + +/* Output to STREAM either a space, or a newline if there isn't room for at + least ENSURE characters before the right margin. */ +static void +space (argp_fmtstream_t stream, size_t ensure) +{ + if (__argp_fmtstream_point (stream) + ensure + >= __argp_fmtstream_rmargin (stream)) + __argp_fmtstream_putc (stream, '\n'); + else + __argp_fmtstream_putc (stream, ' '); +} + +/* If the option REAL has an argument, we print it in using the printf + format REQ_FMT or OPT_FMT depending on whether it's a required or + optional argument. */ +static void +arg (const struct argp_option *real, const char *req_fmt, const char *opt_fmt, + const char *domain, argp_fmtstream_t stream) +{ + if (real->arg) + { + if (real->flags & OPTION_ARG_OPTIONAL) + __argp_fmtstream_printf (stream, opt_fmt, + dgettext (domain, real->arg)); + else + __argp_fmtstream_printf (stream, req_fmt, + dgettext (domain, real->arg)); + } +} + +/* Helper functions for hol_entry_help. */ + +/* State used during the execution of hol_help. */ +struct hol_help_state +{ + /* PREV_ENTRY should contain the previous entry printed, or 0. */ + struct hol_entry *prev_entry; + + /* If an entry is in a different group from the previous one, and SEP_GROUPS + is true, then a blank line will be printed before any output. */ + int sep_groups; + + /* True if a duplicate option argument was suppressed (only ever set if + UPARAMS.dup_args is false). */ + int suppressed_dup_arg; +}; + +/* Some state used while printing a help entry (used to communicate with + helper functions). See the doc for hol_entry_help for more info, as most + of the fields are copied from its arguments. */ +struct pentry_state +{ + const struct hol_entry *entry; + argp_fmtstream_t stream; + struct hol_help_state *hhstate; + + /* True if nothing's been printed so far. */ + int first; + + /* If non-zero, the state that was used to print this help. */ + const struct argp_state *state; +}; + +/* If a user doc filter should be applied to DOC, do so. */ +static const char * +filter_doc (const char *doc, int key, const struct argp *argp, + const struct argp_state *state) +{ + if (argp->help_filter) + /* We must apply a user filter to this output. */ + { + void *input = __argp_input (argp, state); + return (*argp->help_filter) (key, doc, input); + } + else + /* No filter. */ + return doc; +} + +/* Prints STR as a header line, with the margin lines set appropiately, and + notes the fact that groups should be separated with a blank line. ARGP is + the argp that should dictate any user doc filtering to take place. Note + that the previous wrap margin isn't restored, but the left margin is reset + to 0. */ +static void +print_header (const char *str, const struct argp *argp, + struct pentry_state *pest) +{ + const char *tstr = dgettext (argp->argp_domain, str); + const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_HEADER, argp, pest->state); + + if (fstr) + { + if (*fstr) + { + if (pest->hhstate->prev_entry) + /* Precede with a blank line. */ + __argp_fmtstream_putc (pest->stream, '\n'); + indent_to (pest->stream, uparams.header_col); + __argp_fmtstream_set_lmargin (pest->stream, uparams.header_col); + __argp_fmtstream_set_wmargin (pest->stream, uparams.header_col); + __argp_fmtstream_puts (pest->stream, fstr); + __argp_fmtstream_set_lmargin (pest->stream, 0); + __argp_fmtstream_putc (pest->stream, '\n'); + } + + pest->hhstate->sep_groups = 1; /* Separate subsequent groups. */ + } + + if (fstr != tstr) + free ((char *) fstr); +} + +/* Inserts a comma if this isn't the first item on the line, and then makes + sure we're at least to column COL. If this *is* the first item on a line, + prints any pending whitespace/headers that should precede this line. Also + clears FIRST. */ +static void +comma (unsigned col, struct pentry_state *pest) +{ + if (pest->first) + { + const struct hol_entry *pe = pest->hhstate->prev_entry; + const struct hol_cluster *cl = pest->entry->cluster; + + if (pest->hhstate->sep_groups && pe && pest->entry->group != pe->group) + __argp_fmtstream_putc (pest->stream, '\n'); + + if (cl && cl->header && *cl->header + && (!pe + || (pe->cluster != cl + && !hol_cluster_is_child (pe->cluster, cl)))) + /* If we're changing clusters, then this must be the start of the + ENTRY's cluster unless that is an ancestor of the previous one + (in which case we had just popped into a sub-cluster for a bit). + If so, then print the cluster's header line. */ + { + int old_wm = __argp_fmtstream_wmargin (pest->stream); + print_header (cl->header, cl->argp, pest); + __argp_fmtstream_set_wmargin (pest->stream, old_wm); + } + + pest->first = 0; + } + else + __argp_fmtstream_puts (pest->stream, ", "); + + indent_to (pest->stream, col); +} + +/* Print help for ENTRY to STREAM. */ +static void +hol_entry_help (struct hol_entry *entry, const struct argp_state *state, + argp_fmtstream_t stream, struct hol_help_state *hhstate) +{ + unsigned num; + const struct argp_option *real = entry->opt, *opt; + char *so = entry->short_options; + int have_long_opt = 0; /* We have any long options. */ + /* Saved margins. */ + int old_lm = __argp_fmtstream_set_lmargin (stream, 0); + int old_wm = __argp_fmtstream_wmargin (stream); + /* PEST is a state block holding some of our variables that we'd like to + share with helper functions. */ + struct pentry_state pest; + + pest.entry = entry; + pest.stream = stream; + pest.hhstate = hhstate; + pest.first = 1; + pest.state = state; + + if (! odoc (real)) + for (opt = real, num = entry->num; num > 0; opt++, num--) + if (opt->name && ovisible (opt)) + { + have_long_opt = 1; + break; + } + + /* First emit short options. */ + __argp_fmtstream_set_wmargin (stream, uparams.short_opt_col); /* For truly bizarre cases. */ + for (opt = real, num = entry->num; num > 0; opt++, num--) + if (oshort (opt) && opt->key == *so) + /* OPT has a valid (non shadowed) short option. */ + { + if (ovisible (opt)) + { + comma (uparams.short_opt_col, &pest); + __argp_fmtstream_putc (stream, '-'); + __argp_fmtstream_putc (stream, *so); + if (!have_long_opt || uparams.dup_args) + arg (real, " %s", "[%s]", state->root_argp->argp_domain, stream); + else if (real->arg) + hhstate->suppressed_dup_arg = 1; + } + so++; + } + + /* Now, long options. */ + if (odoc (real)) + /* A `documentation' option. */ + { + __argp_fmtstream_set_wmargin (stream, uparams.doc_opt_col); + for (opt = real, num = entry->num; num > 0; opt++, num--) + if (opt->name && *opt->name && ovisible (opt)) + { + comma (uparams.doc_opt_col, &pest); + /* Calling dgettext here isn't quite right, since sorting will + have been done on the original; but documentation options + should be pretty rare anyway... */ + __argp_fmtstream_puts (stream, + onotrans (opt) ? + opt->name : + dgettext (state->root_argp->argp_domain, + opt->name)); + } + } + else + /* A real long option. */ + { + int first_long_opt = 1; + + __argp_fmtstream_set_wmargin (stream, uparams.long_opt_col); + for (opt = real, num = entry->num; num > 0; opt++, num--) + if (opt->name && ovisible (opt)) + { + comma (uparams.long_opt_col, &pest); + __argp_fmtstream_printf (stream, "--%s", opt->name); + if (first_long_opt || uparams.dup_args) + arg (real, "=%s", "[=%s]", state->root_argp->argp_domain, + stream); + else if (real->arg) + hhstate->suppressed_dup_arg = 1; + } + } + + /* Next, documentation strings. */ + __argp_fmtstream_set_lmargin (stream, 0); + + if (pest.first) + { + /* Didn't print any switches, what's up? */ + if (!oshort (real) && !real->name) + /* This is a group header, print it nicely. */ + print_header (real->doc, entry->argp, &pest); + else + /* Just a totally shadowed option or null header; print nothing. */ + goto cleanup; /* Just return, after cleaning up. */ + } + else + { + const char *tstr = real->doc ? dgettext (state->root_argp->argp_domain, + real->doc) : 0; + const char *fstr = filter_doc (tstr, real->key, entry->argp, state); + if (fstr && *fstr) + { + unsigned int col = __argp_fmtstream_point (stream); + + __argp_fmtstream_set_lmargin (stream, uparams.opt_doc_col); + __argp_fmtstream_set_wmargin (stream, uparams.opt_doc_col); + + if (col > (unsigned int) (uparams.opt_doc_col + 3)) + __argp_fmtstream_putc (stream, '\n'); + else if (col >= (unsigned int) uparams.opt_doc_col) + __argp_fmtstream_puts (stream, " "); + else + indent_to (stream, uparams.opt_doc_col); + + __argp_fmtstream_puts (stream, fstr); + } + if (fstr && fstr != tstr) + free ((char *) fstr); + + /* Reset the left margin. */ + __argp_fmtstream_set_lmargin (stream, 0); + __argp_fmtstream_putc (stream, '\n'); + } + + hhstate->prev_entry = entry; + +cleanup: + __argp_fmtstream_set_lmargin (stream, old_lm); + __argp_fmtstream_set_wmargin (stream, old_wm); +} + +/* Output a long help message about the options in HOL to STREAM. */ +static void +hol_help (struct hol *hol, const struct argp_state *state, + argp_fmtstream_t stream) +{ + unsigned num; + struct hol_entry *entry; + struct hol_help_state hhstate = { 0, 0, 0 }; + + for (entry = hol->entries, num = hol->num_entries; num > 0; entry++, num--) + hol_entry_help (entry, state, stream, &hhstate); + + if (hhstate.suppressed_dup_arg && uparams.dup_args_note) + { + const char *tstr = dgettext (state->root_argp->argp_domain, "\ +Mandatory or optional arguments to long options are also mandatory or \ +optional for any corresponding short options."); + const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE, + state ? state->root_argp : 0, state); + if (fstr && *fstr) + { + __argp_fmtstream_putc (stream, '\n'); + __argp_fmtstream_puts (stream, fstr); + __argp_fmtstream_putc (stream, '\n'); + } + if (fstr && fstr != tstr) + free ((char *) fstr); + } +} + +/* Helper functions for hol_usage. */ + +/* If OPT is a short option without an arg, append its key to the string + pointer pointer to by COOKIE, and advance the pointer. */ +static int +add_argless_short_opt (const struct argp_option *opt, + const struct argp_option *real, + const char *domain, void *cookie) +{ + char **snao_end = cookie; + if (!(opt->arg || real->arg) + && !((opt->flags | real->flags) & OPTION_NO_USAGE)) + *(*snao_end)++ = opt->key; + return 0; +} + +/* If OPT is a short option with an arg, output a usage entry for it to the + stream pointed at by COOKIE. */ +static int +usage_argful_short_opt (const struct argp_option *opt, + const struct argp_option *real, + const char *domain, void *cookie) +{ + argp_fmtstream_t stream = cookie; + const char *arg = opt->arg; + int flags = opt->flags | real->flags; + + if (! arg) + arg = real->arg; + + if (arg && !(flags & OPTION_NO_USAGE)) + { + arg = dgettext (domain, arg); + + if (flags & OPTION_ARG_OPTIONAL) + __argp_fmtstream_printf (stream, " [-%c[%s]]", opt->key, arg); + else + { + /* Manually do line wrapping so that it (probably) won't + get wrapped at the embedded space. */ + space (stream, 6 + strlen (arg)); + __argp_fmtstream_printf (stream, "[-%c %s]", opt->key, arg); + } + } + + return 0; +} + +/* Output a usage entry for the long option opt to the stream pointed at by + COOKIE. */ +static int +usage_long_opt (const struct argp_option *opt, + const struct argp_option *real, + const char *domain, void *cookie) +{ + argp_fmtstream_t stream = cookie; + const char *arg = opt->arg; + int flags = opt->flags | real->flags; + + if (! arg) + arg = real->arg; + + if (! (flags & OPTION_NO_USAGE) && !odoc (opt)) + { + if (arg) + { + arg = dgettext (domain, arg); + if (flags & OPTION_ARG_OPTIONAL) + __argp_fmtstream_printf (stream, " [--%s[=%s]]", opt->name, arg); + else + __argp_fmtstream_printf (stream, " [--%s=%s]", opt->name, arg); + } + else + __argp_fmtstream_printf (stream, " [--%s]", opt->name); + } + + return 0; +} + +/* Print a short usage description for the arguments in HOL to STREAM. */ +static void +hol_usage (struct hol *hol, argp_fmtstream_t stream) +{ + if (hol->num_entries > 0) + { + unsigned nentries; + struct hol_entry *entry; + char *short_no_arg_opts = alloca (strlen (hol->short_options) + 1); + char *snao_end = short_no_arg_opts; + + /* First we put a list of short options without arguments. */ + for (entry = hol->entries, nentries = hol->num_entries + ; nentries > 0 + ; entry++, nentries--) + hol_entry_short_iterate (entry, add_argless_short_opt, + entry->argp->argp_domain, &snao_end); + if (snao_end > short_no_arg_opts) + { + *snao_end++ = 0; + __argp_fmtstream_printf (stream, " [-%s]", short_no_arg_opts); + } + + /* Now a list of short options *with* arguments. */ + for (entry = hol->entries, nentries = hol->num_entries + ; nentries > 0 + ; entry++, nentries--) + hol_entry_short_iterate (entry, usage_argful_short_opt, + entry->argp->argp_domain, stream); + + /* Finally, a list of long options (whew!). */ + for (entry = hol->entries, nentries = hol->num_entries + ; nentries > 0 + ; entry++, nentries--) + hol_entry_long_iterate (entry, usage_long_opt, + entry->argp->argp_domain, stream); + } +} + +/* Make a HOL containing all levels of options in ARGP. CLUSTER is the + cluster in which ARGP's entries should be clustered, or 0. */ +static struct hol * +argp_hol (const struct argp *argp, struct hol_cluster *cluster) +{ + const struct argp_child *child = argp->children; + struct hol *hol = make_hol (argp, cluster); + if (child) + while (child->argp) + { + struct hol_cluster *child_cluster = + ((child->group || child->header) + /* Put CHILD->argp within its own cluster. */ + ? hol_add_cluster (hol, child->group, child->header, + child - argp->children, cluster, argp) + /* Just merge it into the parent's cluster. */ + : cluster); + hol_append (hol, argp_hol (child->argp, child_cluster)) ; + child++; + } + return hol; +} + +/* Calculate how many different levels with alternative args strings exist in + ARGP. */ +static size_t +argp_args_levels (const struct argp *argp) +{ + size_t levels = 0; + const struct argp_child *child = argp->children; + + if (argp->args_doc && strchr (argp->args_doc, '\n')) + levels++; + + if (child) + while (child->argp) + levels += argp_args_levels ((child++)->argp); + + return levels; +} + +/* Print all the non-option args documented in ARGP to STREAM. Any output is + preceded by a space. LEVELS is a pointer to a byte vector the length + returned by argp_args_levels; it should be initialized to zero, and + updated by this routine for the next call if ADVANCE is true. True is + returned as long as there are more patterns to output. */ +static int +argp_args_usage (const struct argp *argp, const struct argp_state *state, + char **levels, int advance, argp_fmtstream_t stream) +{ + char *our_level = *levels; + int multiple = 0; + const struct argp_child *child = argp->children; + const char *tdoc = dgettext (argp->argp_domain, argp->args_doc), *nl = 0; + const char *fdoc = filter_doc (tdoc, ARGP_KEY_HELP_ARGS_DOC, argp, state); + + if (fdoc) + { + const char *cp = fdoc; + nl = __strchrnul (cp, '\n'); + if (*nl != '\0') + /* This is a `multi-level' args doc; advance to the correct position + as determined by our state in LEVELS, and update LEVELS. */ + { + int i; + multiple = 1; + for (i = 0; i < *our_level; i++) + cp = nl + 1, nl = __strchrnul (cp, '\n'); + (*levels)++; + } + + /* Manually do line wrapping so that it (probably) won't get wrapped at + any embedded spaces. */ + space (stream, 1 + nl - cp); + + __argp_fmtstream_write (stream, cp, nl - cp); + } + if (fdoc && fdoc != tdoc) + free ((char *)fdoc); /* Free user's modified doc string. */ + + if (child) + while (child->argp) + advance = !argp_args_usage ((child++)->argp, state, levels, advance, stream); + + if (advance && multiple) + { + /* Need to increment our level. */ + if (*nl) + /* There's more we can do here. */ + { + (*our_level)++; + advance = 0; /* Our parent shouldn't advance also. */ + } + else if (*our_level > 0) + /* We had multiple levels, but used them up; reset to zero. */ + *our_level = 0; + } + + return !advance; +} + +/* Print the documentation for ARGP to STREAM; if POST is false, then + everything preceeding a `\v' character in the documentation strings (or + the whole string, for those with none) is printed, otherwise, everything + following the `\v' character (nothing for strings without). Each separate + bit of documentation is separated a blank line, and if PRE_BLANK is true, + then the first is as well. If FIRST_ONLY is true, only the first + occurrence is output. Returns true if anything was output. */ +static int +argp_doc (const struct argp *argp, const struct argp_state *state, + int post, int pre_blank, int first_only, + argp_fmtstream_t stream) +{ + const char *text; + const char *inp_text; + size_t inp_text_len = 0; + const char *trans_text; + void *input = 0; + int anything = 0; + const struct argp_child *child = argp->children; + + if (argp->doc) + { + char *vt = strchr (argp->doc, '\v'); + if (vt) + { + if (post) + inp_text = vt + 1; + else + { + inp_text_len = vt - argp->doc; + inp_text = __strndup (argp->doc, inp_text_len); + } + } + else + inp_text = post ? 0 : argp->doc; + trans_text = inp_text ? dgettext (argp->argp_domain, inp_text) : NULL; + } + else + trans_text = inp_text = 0; + + if (argp->help_filter) + /* We have to filter the doc strings. */ + { + input = __argp_input (argp, state); + text = + (*argp->help_filter) (post + ? ARGP_KEY_HELP_POST_DOC + : ARGP_KEY_HELP_PRE_DOC, + trans_text, input); + } + else + text = (const char *) trans_text; + + if (text) + { + if (pre_blank) + __argp_fmtstream_putc (stream, '\n'); + + __argp_fmtstream_puts (stream, text); + + if (__argp_fmtstream_point (stream) > __argp_fmtstream_lmargin (stream)) + __argp_fmtstream_putc (stream, '\n'); + + anything = 1; + } + + if (text && text != trans_text) + free ((char *) text); /* Free TEXT returned from the help filter. */ + + if (inp_text && inp_text_len) + free ((char *) inp_text); /* We copied INP_TEXT, so free it now. */ + + if (post && argp->help_filter) + /* Now see if we have to output a ARGP_KEY_HELP_EXTRA text. */ + { + text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input); + if (text) + { + if (anything || pre_blank) + __argp_fmtstream_putc (stream, '\n'); + __argp_fmtstream_puts (stream, text); + free ((char *) text); + if (__argp_fmtstream_point (stream) + > __argp_fmtstream_lmargin (stream)) + __argp_fmtstream_putc (stream, '\n'); + anything = 1; + } + } + + if (child) + while (child->argp && !(first_only && anything)) + anything |= + argp_doc ((child++)->argp, state, + post, anything || pre_blank, first_only, + stream); + + return anything; +} + +/* Output a usage message for ARGP to STREAM. If called from + argp_state_help, STATE is the relevent parsing state. FLAGS are from the + set ARGP_HELP_*. NAME is what to use wherever a `program name' is + needed. */ +static void +_help (const struct argp *argp, const struct argp_state *state, FILE *stream, + unsigned flags, char *name) +{ + int anything = 0; /* Whether we've output anything. */ + struct hol *hol = 0; + argp_fmtstream_t fs; + + if (! stream) + return; + +#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) + __flockfile (stream); +#endif + + if (! uparams.valid) + fill_in_uparams (state); + + fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0); + if (! fs) + { +#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) + __funlockfile (stream); +#endif + return; + } + + if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG)) + { + hol = argp_hol (argp, 0); + + /* If present, these options always come last. */ + hol_set_group (hol, "help", -1); + hol_set_group (hol, "version", -1); + + hol_sort (hol); + } + + if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE)) + /* Print a short `Usage:' message. */ + { + int first_pattern = 1, more_patterns; + size_t num_pattern_levels = argp_args_levels (argp); + char *pattern_levels = alloca (num_pattern_levels); + + memset (pattern_levels, 0, num_pattern_levels); + + do + { + int old_lm; + int old_wm = __argp_fmtstream_set_wmargin (fs, uparams.usage_indent); + char *levels = pattern_levels; + + if (first_pattern) + __argp_fmtstream_printf (fs, "%s %s", + dgettext (argp->argp_domain, "Usage:"), + name); + else + __argp_fmtstream_printf (fs, "%s %s", + dgettext (argp->argp_domain, " or: "), + name); + + /* We set the lmargin as well as the wmargin, because hol_usage + manually wraps options with newline to avoid annoying breaks. */ + old_lm = __argp_fmtstream_set_lmargin (fs, uparams.usage_indent); + + if (flags & ARGP_HELP_SHORT_USAGE) + /* Just show where the options go. */ + { + if (hol->num_entries > 0) + __argp_fmtstream_puts (fs, dgettext (argp->argp_domain, + " [OPTION...]")); + } + else + /* Actually print the options. */ + { + hol_usage (hol, fs); + flags |= ARGP_HELP_SHORT_USAGE; /* But only do so once. */ + } + + more_patterns = argp_args_usage (argp, state, &levels, 1, fs); + + __argp_fmtstream_set_wmargin (fs, old_wm); + __argp_fmtstream_set_lmargin (fs, old_lm); + + __argp_fmtstream_putc (fs, '\n'); + anything = 1; + + first_pattern = 0; + } + while (more_patterns); + } + + if (flags & ARGP_HELP_PRE_DOC) + anything |= argp_doc (argp, state, 0, 0, 1, fs); + + if (flags & ARGP_HELP_SEE) + { + __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, "\ +Try `%s --help' or `%s --usage' for more information.\n"), + name, name); + anything = 1; + } + + if (flags & ARGP_HELP_LONG) + /* Print a long, detailed help message. */ + { + /* Print info about all the options. */ + if (hol->num_entries > 0) + { + if (anything) + __argp_fmtstream_putc (fs, '\n'); + hol_help (hol, state, fs); + anything = 1; + } + } + + if (flags & ARGP_HELP_POST_DOC) + /* Print any documentation strings at the end. */ + anything |= argp_doc (argp, state, 1, anything, 0, fs); + + if ((flags & ARGP_HELP_BUG_ADDR) && argp_program_bug_address) + { + if (anything) + __argp_fmtstream_putc (fs, '\n'); + __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, + "Report bugs to %s.\n"), + argp_program_bug_address); + anything = 1; + } + +#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) + __funlockfile (stream); +#endif + + if (hol) + hol_free (hol); + + __argp_fmtstream_free (fs); +} + +/* Output a usage message for ARGP to STREAM. FLAGS are from the set + ARGP_HELP_*. NAME is what to use wherever a `program name' is needed. */ +void __argp_help (const struct argp *argp, FILE *stream, + unsigned flags, char *name) +{ + struct argp_state state; + memset (&state, 0, sizeof state); + state.root_argp = argp; + _help (argp, &state, stream, flags, name); +} +#ifdef weak_alias +weak_alias (__argp_help, argp_help) +#endif + +#if ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME) +char * +__argp_short_program_name (void) +{ +# if HAVE_DECL_PROGRAM_INVOCATION_NAME + return __argp_base_name (program_invocation_name); +# else + /* FIXME: What now? Miles suggests that it is better to use NULL, + but currently the value is passed on directly to fputs_unlocked, + so that requires more changes. */ +# if __GNUC__ +# warning No reasonable value to return +# endif /* __GNUC__ */ + return ""; +# endif +} +#endif + +/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are + from the set ARGP_HELP_*. */ +void +__argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags) +{ + if ((!state || ! (state->flags & ARGP_NO_ERRS)) && stream) + { + if (state && (state->flags & ARGP_LONG_ONLY)) + flags |= ARGP_HELP_LONG_ONLY; + + _help (state ? state->root_argp : 0, state, stream, flags, + state ? state->name : __argp_short_program_name ()); + + if (!state || ! (state->flags & ARGP_NO_EXIT)) + { + if (flags & ARGP_HELP_EXIT_ERR) + exit (argp_err_exit_status); + if (flags & ARGP_HELP_EXIT_OK) + exit (0); + } + } +} +#ifdef weak_alias +weak_alias (__argp_state_help, argp_state_help) +#endif + +/* If appropriate, print the printf string FMT and following args, preceded + by the program name and `:', to stderr, and followed by a `Try ... --help' + message, then exit (1). */ +void +__argp_error (const struct argp_state *state, const char *fmt, ...) +{ + if (!state || !(state->flags & ARGP_NO_ERRS)) + { + FILE *stream = state ? state->err_stream : stderr; + + if (stream) + { + va_list ap; + +#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) + __flockfile (stream); +#endif + + va_start (ap, fmt); + +#ifdef USE_IN_LIBIO + if (_IO_fwide (stream, 0) > 0) + { + char *buf; + + if (__asprintf (&buf, fmt, ap) < 0) + buf = NULL; + + __fwprintf (stream, L"%s: %s\n", + state ? state->name : __argp_short_program_name (), + buf); + + free (buf); + } + else +#endif + { + fputs_unlocked (state + ? state->name : __argp_short_program_name (), + stream); + putc_unlocked (':', stream); + putc_unlocked (' ', stream); + + vfprintf (stream, fmt, ap); + + putc_unlocked ('\n', stream); + } + + __argp_state_help (state, stream, ARGP_HELP_STD_ERR); + + va_end (ap); + +#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) + __funlockfile (stream); +#endif + } + } +} +#ifdef weak_alias +weak_alias (__argp_error, argp_error) +#endif + +/* Similar to the standard gnu error-reporting function error(), but will + respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print + to STATE->err_stream. This is useful for argument parsing code that is + shared between program startup (when exiting is desired) and runtime + option parsing (when typically an error code is returned instead). The + difference between this function and argp_error is that the latter is for + *parsing errors*, and the former is for other problems that occur during + parsing but don't reflect a (syntactic) problem with the input. */ +void +__argp_failure (const struct argp_state *state, int status, int errnum, + const char *fmt, ...) +{ + if (!state || !(state->flags & ARGP_NO_ERRS)) + { + FILE *stream = state ? state->err_stream : stderr; + + if (stream) + { +#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) + __flockfile (stream); +#endif + +#ifdef USE_IN_LIBIO + if (_IO_fwide (stream, 0) > 0) + __fwprintf (stream, L"%s", + state ? state->name : __argp_short_program_name ()); + else +#endif + fputs_unlocked (state + ? state->name : __argp_short_program_name (), + stream); + + if (fmt) + { + va_list ap; + + va_start (ap, fmt); +#ifdef USE_IN_LIBIO + if (_IO_fwide (stream, 0) > 0) + { + char *buf; + + if (__asprintf (&buf, fmt, ap) < 0) + buf = NULL; + + __fwprintf (stream, L": %s", buf); + + free (buf); + } + else +#endif + { + putc_unlocked (':', stream); + putc_unlocked (' ', stream); + + vfprintf (stream, fmt, ap); + } + + va_end (ap); + } + + if (errnum) + { + char buf[200]; + +#ifdef USE_IN_LIBIO + if (_IO_fwide (stream, 0) > 0) + __fwprintf (stream, L": %s", + __strerror_r (errnum, buf, sizeof (buf))); + else +#endif + { + char const *s = NULL; + putc_unlocked (':', stream); + putc_unlocked (' ', stream); +#if _LIBC || (HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P) + s = __strerror_r (errnum, buf, sizeof buf); +#elif HAVE_DECL_STRERROR_R + if (__strerror_r (errnum, buf, sizeof buf) == 0) + s = buf; +#endif +#if !_LIBC + if (! s && ! (s = strerror (errnum))) + s = dgettext (state->root_argp->argp_domain, + "Unknown system error"); +#endif + fputs (s, stream); + } + } + +#ifdef USE_IN_LIBIO + if (_IO_fwide (stream, 0) > 0) + putwc_unlocked (L'\n', stream); + else +#endif + putc_unlocked ('\n', stream); + +#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) + __funlockfile (stream); +#endif + + if (status && (!state || !(state->flags & ARGP_NO_EXIT))) + exit (status); + } + } +} +#ifdef weak_alias +weak_alias (__argp_failure, argp_failure) +#endif diff --git a/lib/argp-namefrob.h b/lib/argp-namefrob.h new file mode 100644 index 0000000..6fe99cd --- /dev/null +++ b/lib/argp-namefrob.h @@ -0,0 +1,158 @@ +/* Name frobnication for compiling argp outside of glibc + Copyright (C) 1997, 2003, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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 !_LIBC +/* This code is written for inclusion in gnu-libc, and uses names in the + namespace reserved for libc. If we're not compiling in libc, define those + names to be the normal ones instead. */ + +/* argp-parse functions */ +#undef __argp_parse +#define __argp_parse argp_parse +#undef __option_is_end +#define __option_is_end _option_is_end +#undef __option_is_short +#define __option_is_short _option_is_short +#undef __argp_input +#define __argp_input _argp_input + +/* argp-help functions */ +#undef __argp_help +#define __argp_help argp_help +#undef __argp_error +#define __argp_error argp_error +#undef __argp_failure +#define __argp_failure argp_failure +#undef __argp_state_help +#define __argp_state_help argp_state_help +#undef __argp_usage +#define __argp_usage argp_usage + +/* argp-fmtstream functions */ +#undef __argp_make_fmtstream +#define __argp_make_fmtstream argp_make_fmtstream +#undef __argp_fmtstream_free +#define __argp_fmtstream_free argp_fmtstream_free +#undef __argp_fmtstream_putc +#define __argp_fmtstream_putc argp_fmtstream_putc +#undef __argp_fmtstream_puts +#define __argp_fmtstream_puts argp_fmtstream_puts +#undef __argp_fmtstream_write +#define __argp_fmtstream_write argp_fmtstream_write +#undef __argp_fmtstream_printf +#define __argp_fmtstream_printf argp_fmtstream_printf +#undef __argp_fmtstream_set_lmargin +#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin +#undef __argp_fmtstream_set_rmargin +#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin +#undef __argp_fmtstream_set_wmargin +#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin +#undef __argp_fmtstream_point +#define __argp_fmtstream_point argp_fmtstream_point +#undef __argp_fmtstream_update +#define __argp_fmtstream_update _argp_fmtstream_update +#undef __argp_fmtstream_ensure +#define __argp_fmtstream_ensure _argp_fmtstream_ensure +#undef __argp_fmtstream_lmargin +#define __argp_fmtstream_lmargin argp_fmtstream_lmargin +#undef __argp_fmtstream_rmargin +#define __argp_fmtstream_rmargin argp_fmtstream_rmargin +#undef __argp_fmtstream_wmargin +#define __argp_fmtstream_wmargin argp_fmtstream_wmargin + +/* normal libc functions we call */ +#undef __flockfile +#define __flockfile flockfile +#undef __funlockfile +#define __funlockfile funlockfile +#undef __mempcpy +#define __mempcpy mempcpy +#undef __sleep +#define __sleep sleep +#undef __strcasecmp +#define __strcasecmp strcasecmp +#undef __strchrnul +#define __strchrnul strchrnul +#undef __strerror_r +#define __strerror_r strerror_r +#undef __strndup +#define __strndup strndup +#undef __vsnprintf +#define __vsnprintf vsnprintf + +#if defined(HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED +# define clearerr_unlocked(x) clearerr (x) +#endif +#if defined(HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED +# define feof_unlocked(x) feof (x) +# endif +#if defined(HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED +# define ferror_unlocked(x) ferror (x) +# endif +#if defined(HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED +# define fflush_unlocked(x) fflush (x) +# endif +#if defined(HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED +# define fgets_unlocked(x,y,z) fgets (x,y,z) +# endif +#if defined(HAVE_DECL_FPUTC_UNLOCKED) && !HAVE_DECL_FPUTC_UNLOCKED +# define fputc_unlocked(x,y) fputc (x,y) +# endif +#if defined(HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED +# define fputs_unlocked(x,y) fputs (x,y) +# endif +#if defined(HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED +# define fread_unlocked(w,x,y,z) fread (w,x,y,z) +# endif +#if defined(HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED +# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z) +# endif +#if defined(HAVE_DECL_GETC_UNLOCKED) && !HAVE_DECL_GETC_UNLOCKED +# define getc_unlocked(x) getc (x) +# endif +#if defined(HAVE_DECL_GETCHAR_UNLOCKED) && !HAVE_DECL_GETCHAR_UNLOCKED +# define getchar_unlocked() getchar () +# endif +#if defined(HAVE_DECL_PUTC_UNLOCKED) && !HAVE_DECL_PUTC_UNLOCKED +# define putc_unlocked(x,y) putc (x,y) +# endif +#if defined(HAVE_DECL_PUTCHAR_UNLOCKED) && !HAVE_DECL_PUTCHAR_UNLOCKED +# define putchar_unlocked(x) putchar (x) +# endif + +#endif /* !_LIBC */ + +#ifndef __set_errno +#define __set_errno(e) (errno = (e)) +#endif + +#if defined GNULIB_ARGP_DISABLE_DIRNAME +# define __argp_base_name(arg) arg +#elif defined GNULIB_ARGP_EXTERN_BASENAME +extern char *__argp_base_name(const char *arg); +#else +# include "dirname.h" +# define __argp_base_name base_name +#endif + +#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME +# define __argp_short_program_name() (program_invocation_short_name) +#else +extern char *__argp_short_program_name (void); +#endif diff --git a/lib/argp-parse.c b/lib/argp-parse.c new file mode 100644 index 0000000..a7de729 --- /dev/null +++ b/lib/argp-parse.c @@ -0,0 +1,953 @@ +/* Hierarchial argument parsing, layered over getopt + Copyright (C) 1995-2000, 2002, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _LIBC +# include +# undef dgettext +# define dgettext(domain, msgid) \ + INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES) +#else +# include "gettext.h" +#endif +#define N_(msgid) msgid + +#include "argp.h" +#include "argp-namefrob.h" + +#define alignof(type) offsetof (struct { char c; type x; }, x) +#define alignto(n, d) ((((n) + (d) - 1) / (d)) * (d)) + +/* Getopt return values. */ +#define KEY_END (-1) /* The end of the options. */ +#define KEY_ARG 1 /* A non-option argument. */ +#define KEY_ERR '?' /* An error parsing the options. */ + +/* The meta-argument used to prevent any further arguments being interpreted + as options. */ +#define QUOTE "--" + +/* The number of bits we steal in a long-option value for our own use. */ +#define GROUP_BITS CHAR_BIT + +/* The number of bits available for the user value. */ +#define USER_BITS ((sizeof ((struct option *)0)->val * CHAR_BIT) - GROUP_BITS) +#define USER_MASK ((1 << USER_BITS) - 1) + +/* EZ alias for ARGP_ERR_UNKNOWN. */ +#define EBADKEY ARGP_ERR_UNKNOWN + +/* Default options. */ + +/* When argp is given the --HANG switch, _ARGP_HANG is set and argp will sleep + for one second intervals, decrementing _ARGP_HANG until it's zero. Thus + you can force the program to continue by attaching a debugger and setting + it to 0 yourself. */ +static volatile int _argp_hang; + +#define OPT_PROGNAME -2 +#define OPT_USAGE -3 +#define OPT_HANG -4 + +static const struct argp_option argp_default_options[] = +{ + {"help", '?', 0, 0, N_("give this help list"), -1}, + {"usage", OPT_USAGE, 0, 0, N_("give a short usage message"), 0}, + {"program-name",OPT_PROGNAME,N_("NAME"), OPTION_HIDDEN, N_("set the program name"), 0}, + {"HANG", OPT_HANG, N_("SECS"), OPTION_ARG_OPTIONAL | OPTION_HIDDEN, + N_("hang for SECS seconds (default 3600)"), 0}, + {NULL, 0, 0, 0, NULL, 0} +}; + +static error_t +argp_default_parser (int key, char *arg, struct argp_state *state) +{ + switch (key) + { + case '?': + __argp_state_help (state, state->out_stream, ARGP_HELP_STD_HELP); + break; + case OPT_USAGE: + __argp_state_help (state, state->out_stream, + ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK); + break; + + case OPT_PROGNAME: /* Set the program name. */ +#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_NAME + program_invocation_name = arg; +#endif + /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka + __PROGNAME), in which case, PROGRAM_INVOCATION_NAME is just defined + to be that, so we have to be a bit careful here.] */ + + /* Update what we use for messages. */ + state->name = __argp_base_name (arg); + +#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + program_invocation_short_name = state->name; +#endif + + if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS)) + == ARGP_PARSE_ARGV0) + /* Update what getopt uses too. */ + state->argv[0] = arg; + + break; + + case OPT_HANG: + _argp_hang = atoi (arg ? arg : "3600"); + while (_argp_hang-- > 0) + __sleep (1); + break; + + default: + return EBADKEY; + } + return 0; +} + +static const struct argp argp_default_argp = + {argp_default_options, &argp_default_parser, NULL, NULL, NULL, NULL, "libc"}; + + +static const struct argp_option argp_version_options[] = +{ + {"version", 'V', 0, 0, N_("print program version"), -1}, + {NULL, 0, 0, 0, NULL, 0} +}; + +static error_t +argp_version_parser (int key, char *arg, struct argp_state *state) +{ + switch (key) + { + case 'V': + if (argp_program_version_hook) + (*argp_program_version_hook) (state->out_stream, state); + else if (argp_program_version) + fprintf (state->out_stream, "%s\n", argp_program_version); + else + __argp_error (state, dgettext (state->root_argp->argp_domain, + "(PROGRAM ERROR) No version known!?")); + if (! (state->flags & ARGP_NO_EXIT)) + exit (0); + break; + default: + return EBADKEY; + } + return 0; +} + +static const struct argp argp_version_argp = + {argp_version_options, &argp_version_parser, NULL, NULL, NULL, NULL, "libc"}; + +/* Returns the offset into the getopt long options array LONG_OPTIONS of a + long option with called NAME, or -1 if none is found. Passing NULL as + NAME will return the number of options. */ +static int +find_long_option (struct option *long_options, const char *name) +{ + struct option *l = long_options; + while (l->name != NULL) + if (name != NULL && strcmp (l->name, name) == 0) + return l - long_options; + else + l++; + if (name == NULL) + return l - long_options; + else + return -1; +} + + +/* The state of a `group' during parsing. Each group corresponds to a + particular argp structure from the tree of such descending from the top + level argp passed to argp_parse. */ +struct group +{ + /* This group's parsing function. */ + argp_parser_t parser; + + /* Which argp this group is from. */ + const struct argp *argp; + + /* Points to the point in SHORT_OPTS corresponding to the end of the short + options for this group. We use it to determine from which group a + particular short options is from. */ + char *short_end; + + /* The number of non-option args sucessfully handled by this parser. */ + unsigned args_processed; + + /* This group's parser's parent's group. */ + struct group *parent; + unsigned parent_index; /* And the our position in the parent. */ + + /* These fields are swapped into and out of the state structure when + calling this group's parser. */ + void *input, **child_inputs; + void *hook; +}; + +/* Call GROUP's parser with KEY and ARG, swapping any group-specific info + from STATE before calling, and back into state afterwards. If GROUP has + no parser, EBADKEY is returned. */ +static error_t +group_parse (struct group *group, struct argp_state *state, int key, char *arg) +{ + if (group->parser) + { + error_t err; + state->hook = group->hook; + state->input = group->input; + state->child_inputs = group->child_inputs; + state->arg_num = group->args_processed; + err = (*group->parser)(key, arg, state); + group->hook = state->hook; + return err; + } + else + return EBADKEY; +} + +struct parser +{ + const struct argp *argp; + + /* SHORT_OPTS is the getopt short options string for the union of all the + groups of options. */ + char *short_opts; + /* LONG_OPTS is the array of getop long option structures for the union of + all the groups of options. */ + struct option *long_opts; + /* OPT_DATA is the getopt data used for the re-entrant getopt. */ + struct _getopt_data opt_data; + + /* States of the various parsing groups. */ + struct group *groups; + /* The end of the GROUPS array. */ + struct group *egroup; + /* An vector containing storage for the CHILD_INPUTS field in all groups. */ + void **child_inputs; + + /* True if we think using getopt is still useful; if false, then + remaining arguments are just passed verbatim with ARGP_KEY_ARG. This is + cleared whenever getopt returns KEY_END, but may be set again if the user + moves the next argument pointer backwards. */ + int try_getopt; + + /* State block supplied to parsing routines. */ + struct argp_state state; + + /* Memory used by this parser. */ + void *storage; +}; + +/* The next usable entries in the various parser tables being filled in by + convert_options. */ +struct parser_convert_state +{ + struct parser *parser; + char *short_end; + struct option *long_end; + void **child_inputs_end; +}; + +/* Converts all options in ARGP (which is put in GROUP) and ancestors + into getopt options stored in SHORT_OPTS and LONG_OPTS; SHORT_END and + CVT->LONG_END are the points at which new options are added. Returns the + next unused group entry. CVT holds state used during the conversion. */ +static struct group * +convert_options (const struct argp *argp, + struct group *parent, unsigned parent_index, + struct group *group, struct parser_convert_state *cvt) +{ + /* REAL is the most recent non-alias value of OPT. */ + const struct argp_option *real = argp->options; + const struct argp_child *children = argp->children; + + if (real || argp->parser) + { + const struct argp_option *opt; + + if (real) + for (opt = real; !__option_is_end (opt); opt++) + { + if (! (opt->flags & OPTION_ALIAS)) + /* OPT isn't an alias, so we can use values from it. */ + real = opt; + + if (! (real->flags & OPTION_DOC)) + /* A real option (not just documentation). */ + { + if (__option_is_short (opt)) + /* OPT can be used as a short option. */ + { + *cvt->short_end++ = opt->key; + if (real->arg) + { + *cvt->short_end++ = ':'; + if (real->flags & OPTION_ARG_OPTIONAL) + *cvt->short_end++ = ':'; + } + *cvt->short_end = '\0'; /* keep 0 terminated */ + } + + if (opt->name + && find_long_option (cvt->parser->long_opts, opt->name) < 0) + /* OPT can be used as a long option. */ + { + cvt->long_end->name = opt->name; + cvt->long_end->has_arg = + (real->arg + ? (real->flags & OPTION_ARG_OPTIONAL + ? optional_argument + : required_argument) + : no_argument); + cvt->long_end->flag = 0; + /* we add a disambiguating code to all the user's + values (which is removed before we actually call + the function to parse the value); this means that + the user loses use of the high 8 bits in all his + values (the sign of the lower bits is preserved + however)... */ + cvt->long_end->val = + ((opt->key | real->key) & USER_MASK) + + (((group - cvt->parser->groups) + 1) << USER_BITS); + + /* Keep the LONG_OPTS list terminated. */ + (++cvt->long_end)->name = NULL; + } + } + } + + group->parser = argp->parser; + group->argp = argp; + group->short_end = cvt->short_end; + group->args_processed = 0; + group->parent = parent; + group->parent_index = parent_index; + group->input = 0; + group->hook = 0; + group->child_inputs = 0; + + if (children) + /* Assign GROUP's CHILD_INPUTS field some space from + CVT->child_inputs_end.*/ + { + unsigned num_children = 0; + while (children[num_children].argp) + num_children++; + group->child_inputs = cvt->child_inputs_end; + cvt->child_inputs_end += num_children; + } + + parent = group++; + } + else + parent = 0; + + if (children) + { + unsigned index = 0; + while (children->argp) + group = + convert_options (children++->argp, parent, index++, group, cvt); + } + + return group; +} + +/* Find the merged set of getopt options, with keys appropiately prefixed. */ +static void +parser_convert (struct parser *parser, const struct argp *argp, int flags) +{ + struct parser_convert_state cvt; + + cvt.parser = parser; + cvt.short_end = parser->short_opts; + cvt.long_end = parser->long_opts; + cvt.child_inputs_end = parser->child_inputs; + + if (flags & ARGP_IN_ORDER) + *cvt.short_end++ = '-'; + else if (flags & ARGP_NO_ARGS) + *cvt.short_end++ = '+'; + *cvt.short_end = '\0'; + + cvt.long_end->name = NULL; + + parser->argp = argp; + + if (argp) + parser->egroup = convert_options (argp, 0, 0, parser->groups, &cvt); + else + parser->egroup = parser->groups; /* No parsers at all! */ +} + +/* Lengths of various parser fields which we will allocated. */ +struct parser_sizes +{ + size_t short_len; /* Getopt short options string. */ + size_t long_len; /* Getopt long options vector. */ + size_t num_groups; /* Group structures we allocate. */ + size_t num_child_inputs; /* Child input slots. */ +}; + +/* For ARGP, increments the NUM_GROUPS field in SZS by the total number of + argp structures descended from it, and the SHORT_LEN & LONG_LEN fields by + the maximum lengths of the resulting merged getopt short options string and + long-options array, respectively. */ +static void +calc_sizes (const struct argp *argp, struct parser_sizes *szs) +{ + const struct argp_child *child = argp->children; + const struct argp_option *opt = argp->options; + + if (opt || argp->parser) + { + szs->num_groups++; + if (opt) + { + int num_opts = 0; + while (!__option_is_end (opt++)) + num_opts++; + szs->short_len += num_opts * 3; /* opt + up to 2 `:'s */ + szs->long_len += num_opts; + } + } + + if (child) + while (child->argp) + { + calc_sizes ((child++)->argp, szs); + szs->num_child_inputs++; + } +} + +/* Initializes PARSER to parse ARGP in a manner described by FLAGS. */ +static error_t +parser_init (struct parser *parser, const struct argp *argp, + int argc, char **argv, int flags, void *input) +{ + error_t err = 0; + struct group *group; + struct parser_sizes szs; + struct _getopt_data opt_data = _GETOPT_DATA_INITIALIZER; + char *storage; + size_t glen, gsum; + size_t clen, csum; + size_t llen, lsum; + size_t slen, ssum; + + szs.short_len = (flags & ARGP_NO_ARGS) ? 0 : 1; + szs.long_len = 0; + szs.num_groups = 0; + szs.num_child_inputs = 0; + + if (argp) + calc_sizes (argp, &szs); + + /* Lengths of the various bits of storage used by PARSER. */ + glen = (szs.num_groups + 1) * sizeof (struct group); + clen = szs.num_child_inputs * sizeof (void *); + llen = (szs.long_len + 1) * sizeof (struct option); + slen = szs.short_len + 1; + + /* Sums of previous lengths, properly aligned. There's no need to + align gsum, since struct group is aligned at least as strictly as + void * (since it contains a void * member). And there's no need + to align lsum, since struct option is aligned at least as + strictly as char. */ + gsum = glen; + csum = alignto (gsum + clen, alignof (struct option)); + lsum = csum + llen; + ssum = lsum + slen; + + parser->storage = malloc (ssum); + if (! parser->storage) + return ENOMEM; + + storage = parser->storage; + parser->groups = parser->storage; + parser->child_inputs = (void **) (storage + gsum); + parser->long_opts = (struct option *) (storage + csum); + parser->short_opts = storage + lsum; + parser->opt_data = opt_data; + + memset (parser->child_inputs, 0, clen); + parser_convert (parser, argp, flags); + + memset (&parser->state, 0, sizeof (struct argp_state)); + parser->state.root_argp = parser->argp; + parser->state.argc = argc; + parser->state.argv = argv; + parser->state.flags = flags; + parser->state.err_stream = stderr; + parser->state.out_stream = stdout; + parser->state.next = 0; /* Tell getopt to initialize. */ + parser->state.pstate = parser; + + parser->try_getopt = 1; + + /* Call each parser for the first time, giving it a chance to propagate + values to child parsers. */ + if (parser->groups < parser->egroup) + parser->groups->input = input; + for (group = parser->groups; + group < parser->egroup && (!err || err == EBADKEY); + group++) + { + if (group->parent) + /* If a child parser, get the initial input value from the parent. */ + group->input = group->parent->child_inputs[group->parent_index]; + + if (!group->parser + && group->argp->children && group->argp->children->argp) + /* For the special case where no parsing function is supplied for an + argp, propagate its input to its first child, if any (this just + makes very simple wrapper argps more convenient). */ + group->child_inputs[0] = group->input; + + err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0); + } + if (err == EBADKEY) + err = 0; /* Some parser didn't understand. */ + + if (err) + return err; + + if (parser->state.flags & ARGP_NO_ERRS) + { + parser->opt_data.opterr = 0; + if (parser->state.flags & ARGP_PARSE_ARGV0) + /* getopt always skips ARGV[0], so we have to fake it out. As long + as OPTERR is 0, then it shouldn't actually try to access it. */ + parser->state.argv--, parser->state.argc++; + } + else + parser->opt_data.opterr = 1; /* Print error messages. */ + + if (parser->state.argv == argv && argv[0]) + /* There's an argv[0]; use it for messages. */ + parser->state.name = __argp_base_name (argv[0]); + else + parser->state.name = __argp_short_program_name (); + + return 0; +} + +/* Free any storage consumed by PARSER (but not PARSER itself). */ +static error_t +parser_finalize (struct parser *parser, + error_t err, int arg_ebadkey, int *end_index) +{ + struct group *group; + + if (err == EBADKEY && arg_ebadkey) + /* Suppress errors generated by unparsed arguments. */ + err = 0; + + if (! err) + { + if (parser->state.next == parser->state.argc) + /* We successfully parsed all arguments! Call all the parsers again, + just a few more times... */ + { + for (group = parser->groups; + group < parser->egroup && (!err || err==EBADKEY); + group++) + if (group->args_processed == 0) + err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, 0); + for (group = parser->egroup - 1; + group >= parser->groups && (!err || err==EBADKEY); + group--) + err = group_parse (group, &parser->state, ARGP_KEY_END, 0); + + if (err == EBADKEY) + err = 0; /* Some parser didn't understand. */ + + /* Tell the user that all arguments are parsed. */ + if (end_index) + *end_index = parser->state.next; + } + else if (end_index) + /* Return any remaining arguments to the user. */ + *end_index = parser->state.next; + else + /* No way to return the remaining arguments, they must be bogus. */ + { + if (!(parser->state.flags & ARGP_NO_ERRS) + && parser->state.err_stream) + fprintf (parser->state.err_stream, + dgettext (parser->argp->argp_domain, + "%s: Too many arguments\n"), + parser->state.name); + err = EBADKEY; + } + } + + /* Okay, we're all done, with either an error or success; call the parsers + to indicate which one. */ + + if (err) + { + /* Maybe print an error message. */ + if (err == EBADKEY) + /* An appropriate message describing what the error was should have + been printed earlier. */ + __argp_state_help (&parser->state, parser->state.err_stream, + ARGP_HELP_STD_ERR); + + /* Since we didn't exit, give each parser an error indication. */ + for (group = parser->groups; group < parser->egroup; group++) + group_parse (group, &parser->state, ARGP_KEY_ERROR, 0); + } + else + /* Notify parsers of success, and propagate back values from parsers. */ + { + /* We pass over the groups in reverse order so that child groups are + given a chance to do there processing before passing back a value to + the parent. */ + for (group = parser->egroup - 1 + ; group >= parser->groups && (!err || err == EBADKEY) + ; group--) + err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, 0); + if (err == EBADKEY) + err = 0; /* Some parser didn't understand. */ + } + + /* Call parsers once more, to do any final cleanup. Errors are ignored. */ + for (group = parser->egroup - 1; group >= parser->groups; group--) + group_parse (group, &parser->state, ARGP_KEY_FINI, 0); + + if (err == EBADKEY) + err = EINVAL; + + free (parser->storage); + + return err; +} + +/* Call the user parsers to parse the non-option argument VAL, at the current + position, returning any error. The state NEXT pointer is assumed to have + been adjusted (by getopt) to point after this argument; this function will + adjust it correctly to reflect however many args actually end up being + consumed. */ +static error_t +parser_parse_arg (struct parser *parser, char *val) +{ + /* Save the starting value of NEXT, first adjusting it so that the arg + we're parsing is again the front of the arg vector. */ + int index = --parser->state.next; + error_t err = EBADKEY; + struct group *group; + int key = 0; /* Which of ARGP_KEY_ARG[S] we used. */ + + /* Try to parse the argument in each parser. */ + for (group = parser->groups + ; group < parser->egroup && err == EBADKEY + ; group++) + { + parser->state.next++; /* For ARGP_KEY_ARG, consume the arg. */ + key = ARGP_KEY_ARG; + err = group_parse (group, &parser->state, key, val); + + if (err == EBADKEY) + /* This parser doesn't like ARGP_KEY_ARG; try ARGP_KEY_ARGS instead. */ + { + parser->state.next--; /* For ARGP_KEY_ARGS, put back the arg. */ + key = ARGP_KEY_ARGS; + err = group_parse (group, &parser->state, key, 0); + } + } + + if (! err) + { + if (key == ARGP_KEY_ARGS) + /* The default for ARGP_KEY_ARGS is to assume that if NEXT isn't + changed by the user, *all* arguments should be considered + consumed. */ + parser->state.next = parser->state.argc; + + if (parser->state.next > index) + /* Remember that we successfully processed a non-option + argument -- but only if the user hasn't gotten tricky and set + the clock back. */ + (--group)->args_processed += (parser->state.next - index); + else + /* The user wants to reparse some args, give getopt another try. */ + parser->try_getopt = 1; + } + + return err; +} + +/* Call the user parsers to parse the option OPT, with argument VAL, at the + current position, returning any error. */ +static error_t +parser_parse_opt (struct parser *parser, int opt, char *val) +{ + /* The group key encoded in the high bits; 0 for short opts or + group_number + 1 for long opts. */ + int group_key = opt >> USER_BITS; + error_t err = EBADKEY; + + if (group_key == 0) + /* A short option. By comparing OPT's position in SHORT_OPTS to the + various starting positions in each group's SHORT_END field, we can + determine which group OPT came from. */ + { + struct group *group; + char *short_index = strchr (parser->short_opts, opt); + + if (short_index) + for (group = parser->groups; group < parser->egroup; group++) + if (group->short_end > short_index) + { + err = group_parse (group, &parser->state, opt, + parser->opt_data.optarg); + break; + } + } + else + /* A long option. We use shifts instead of masking for extracting + the user value in order to preserve the sign. */ + err = + group_parse (&parser->groups[group_key - 1], &parser->state, + (opt << GROUP_BITS) >> GROUP_BITS, + parser->opt_data.optarg); + + if (err == EBADKEY) + /* At least currently, an option not recognized is an error in the + parser, because we pre-compute which parser is supposed to deal + with each option. */ + { + static const char bad_key_err[] = + N_("(PROGRAM ERROR) Option should have been recognized!?"); + if (group_key == 0) + __argp_error (&parser->state, "-%c: %s", opt, + dgettext (parser->argp->argp_domain, bad_key_err)); + else + { + struct option *long_opt = parser->long_opts; + while (long_opt->val != opt && long_opt->name) + long_opt++; + __argp_error (&parser->state, "--%s: %s", + long_opt->name ? long_opt->name : "???", + dgettext (parser->argp->argp_domain, bad_key_err)); + } + } + + return err; +} + +/* Parse the next argument in PARSER (as indicated by PARSER->state.next). + Any error from the parsers is returned, and *ARGP_EBADKEY indicates + whether a value of EBADKEY is due to an unrecognized argument (which is + generally not fatal). */ +static error_t +parser_parse_next (struct parser *parser, int *arg_ebadkey) +{ + int opt; + error_t err = 0; + + if (parser->state.quoted && parser->state.next < parser->state.quoted) + /* The next argument pointer has been moved to before the quoted + region, so pretend we never saw the quoting `--', and give getopt + another chance. If the user hasn't removed it, getopt will just + process it again. */ + parser->state.quoted = 0; + + if (parser->try_getopt && !parser->state.quoted) + /* Give getopt a chance to parse this. */ + { + /* Put it back in OPTIND for getopt. */ + parser->opt_data.optind = parser->state.next; + /* Distinguish KEY_ERR from a real option. */ + parser->opt_data.optopt = KEY_END; + if (parser->state.flags & ARGP_LONG_ONLY) + opt = _getopt_long_only_r (parser->state.argc, parser->state.argv, + parser->short_opts, parser->long_opts, 0, + &parser->opt_data); + else + opt = _getopt_long_r (parser->state.argc, parser->state.argv, + parser->short_opts, parser->long_opts, 0, + &parser->opt_data); + /* And see what getopt did. */ + parser->state.next = parser->opt_data.optind; + + if (opt == KEY_END) + /* Getopt says there are no more options, so stop using + getopt; we'll continue if necessary on our own. */ + { + parser->try_getopt = 0; + if (parser->state.next > 1 + && strcmp (parser->state.argv[parser->state.next - 1], QUOTE) + == 0) + /* Not only is this the end of the options, but it's a + `quoted' region, which may have args that *look* like + options, so we definitely shouldn't try to use getopt past + here, whatever happens. */ + parser->state.quoted = parser->state.next; + } + else if (opt == KEY_ERR && parser->opt_data.optopt != KEY_END) + /* KEY_ERR can have the same value as a valid user short + option, but in the case of a real error, getopt sets OPTOPT + to the offending character, which can never be KEY_END. */ + { + *arg_ebadkey = 0; + return EBADKEY; + } + } + else + opt = KEY_END; + + if (opt == KEY_END) + { + /* We're past what getopt considers the options. */ + if (parser->state.next >= parser->state.argc + || (parser->state.flags & ARGP_NO_ARGS)) + /* Indicate that we're done. */ + { + *arg_ebadkey = 1; + return EBADKEY; + } + else + /* A non-option arg; simulate what getopt might have done. */ + { + opt = KEY_ARG; + parser->opt_data.optarg = parser->state.argv[parser->state.next++]; + } + } + + if (opt == KEY_ARG) + /* A non-option argument; try each parser in turn. */ + err = parser_parse_arg (parser, parser->opt_data.optarg); + else + err = parser_parse_opt (parser, opt, parser->opt_data.optarg); + + if (err == EBADKEY) + *arg_ebadkey = (opt == KEY_END || opt == KEY_ARG); + + return err; +} + +/* Parse the options strings in ARGC & ARGV according to the argp in ARGP. + FLAGS is one of the ARGP_ flags above. If END_INDEX is non-NULL, the + index in ARGV of the first unparsed option is returned in it. If an + unknown option is present, EINVAL is returned; if some parser routine + returned a non-zero value, it is returned; otherwise 0 is returned. */ +error_t +__argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags, + int *end_index, void *input) +{ + error_t err; + struct parser parser; + + /* If true, then err == EBADKEY is a result of a non-option argument failing + to be parsed (which in some cases isn't actually an error). */ + int arg_ebadkey = 0; + +#ifndef _LIBC + if (!(flags & ARGP_PARSE_ARGV0)) + { +#ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME + if (!program_invocation_name) + program_invocation_name = argv[0]; +#endif +#ifdef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + if (!program_invocation_short_name) + program_invocation_short_name = __argp_base_name (argv[0]); +#endif + } +#endif + + if (! (flags & ARGP_NO_HELP)) + /* Add our own options. */ + { + struct argp_child *child = alloca (4 * sizeof (struct argp_child)); + struct argp *top_argp = alloca (sizeof (struct argp)); + + /* TOP_ARGP has no options, it just serves to group the user & default + argps. */ + memset (top_argp, 0, sizeof (*top_argp)); + top_argp->children = child; + + memset (child, 0, 4 * sizeof (struct argp_child)); + + if (argp) + (child++)->argp = argp; + (child++)->argp = &argp_default_argp; + if (argp_program_version || argp_program_version_hook) + (child++)->argp = &argp_version_argp; + child->argp = 0; + + argp = top_argp; + } + + /* Construct a parser for these arguments. */ + err = parser_init (&parser, argp, argc, argv, flags, input); + + if (! err) + /* Parse! */ + { + while (! err) + err = parser_parse_next (&parser, &arg_ebadkey); + err = parser_finalize (&parser, err, arg_ebadkey, end_index); + } + + return err; +} +#ifdef weak_alias +weak_alias (__argp_parse, argp_parse) +#endif + +/* Return the input field for ARGP in the parser corresponding to STATE; used + by the help routines. */ +void * +__argp_input (const struct argp *argp, const struct argp_state *state) +{ + if (state) + { + struct group *group; + struct parser *parser = state->pstate; + + for (group = parser->groups; group < parser->egroup; group++) + if (group->argp == argp) + return group->input; + } + + return 0; +} +#ifdef weak_alias +weak_alias (__argp_input, _argp_input) +#endif diff --git a/lib/argp-pin.c b/lib/argp-pin.c new file mode 100644 index 0000000..852c6d6 --- /dev/null +++ b/lib/argp-pin.c @@ -0,0 +1,28 @@ +/* Full and short program names for argp module + 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. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME +char *program_invocation_short_name = 0; +#endif +#ifndef HAVE_PROGRAM_INVOCATION_NAME +char *program_invocation_name = 0; +#endif + diff --git a/lib/argp-pv.c b/lib/argp-pv.c new file mode 100644 index 0000000..a11298b --- /dev/null +++ b/lib/argp-pv.c @@ -0,0 +1,24 @@ +/* Default definition for ARGP_PROGRAM_VERSION. + Copyright (C) 1996, 1997, 1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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 set by the user program to a non-zero value, then a default option + --version is added (unless the ARGP_NO_HELP flag is used), which will + print this string followed by a newline and exit (unless the + ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */ +const char *argp_program_version; diff --git a/lib/argp-pvh.c b/lib/argp-pvh.c new file mode 100644 index 0000000..6bf7c49 --- /dev/null +++ b/lib/argp-pvh.c @@ -0,0 +1,31 @@ +/* Default definition for ARGP_PROGRAM_VERSION_HOOK. + Copyright (C) 1996, 1997, 1999, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "argp.h" + +/* If set by the user program to a non-zero value, then a default option + --version is added (unless the ARGP_NO_HELP flag is used), which calls + this function with a stream to print the version to and a pointer to the + current parsing state, and then exits (unless the ARGP_NO_EXIT flag is + used). This variable takes precedent over ARGP_PROGRAM_VERSION. */ +void (*argp_program_version_hook) (FILE *stream, struct argp_state *state) = NULL; diff --git a/lib/argp-xinl.c b/lib/argp-xinl.c new file mode 100644 index 0000000..a6afb1f --- /dev/null +++ b/lib/argp-xinl.c @@ -0,0 +1,43 @@ +/* Real definitions for extern inline functions in argp.h + Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined _LIBC || defined HAVE_FEATURES_H +# include +#endif + +#ifndef __USE_EXTERN_INLINES +# define __USE_EXTERN_INLINES 1 +#endif +#define ARGP_EI +#undef __OPTIMIZE__ +#define __OPTIMIZE__ 1 +#include "argp.h" + +/* Add weak aliases. */ +#if _LIBC - 0 && defined (weak_alias) + +weak_alias (__argp_usage, argp_usage) +weak_alias (__option_is_short, _option_is_short) +weak_alias (__option_is_end, _option_is_end) + +#endif diff --git a/lib/argp.h b/lib/argp.h new file mode 100644 index 0000000..1c4e06f --- /dev/null +++ b/lib/argp.h @@ -0,0 +1,622 @@ +/* Hierarchial argument parsing, layered over getopt. + Copyright (C) 1995-1999,2003-2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Miles Bader . + + This program is free software; you can redistribute it and/or modify + it under the 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 _ARGP_H +#define _ARGP_H + +#include +#include +#include +#include + +#define __need_error_t +#include + +#ifndef __THROW +# define __THROW +#endif +#ifndef __NTH +# define __NTH(fct) fct __THROW +#endif + +#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) || __STRICT_ANSI__ +# define __format__ format +# define __printf__ printf +# endif +#endif + +/* GCC 2.95 and later have "__restrict"; C99 compilers have + "restrict", and "configure" may have defined "restrict". + Other compilers use __restrict, __restrict__, and _Restrict, and + 'configure' might #define 'restrict' to those words. */ +#ifndef __restrict +# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)) +# if 199901L <= __STDC_VERSION__ +# define __restrict restrict +# else +# define __restrict +# endif +# endif +#endif + +#ifndef __error_t_defined +typedef int error_t; +# define __error_t_defined +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* A description of a particular option. A pointer to an array of + these is passed in the OPTIONS field of an argp structure. Each option + entry can correspond to one long option and/or one short option; more + names for the same option can be added by following an entry in an option + array with options having the OPTION_ALIAS flag set. */ +struct argp_option +{ + /* The long option name. For more than one name for the same option, you + can use following options with the OPTION_ALIAS flag set. */ + const char *name; + + /* What key is returned for this option. If > 0 and printable, then it's + also accepted as a short option. */ + int key; + + /* If non-NULL, this is the name of the argument associated with this + option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */ + const char *arg; + + /* OPTION_ flags. */ + int flags; + + /* The doc string for this option. If both NAME and KEY are 0, This string + will be printed outdented from the normal option column, making it + useful as a group header (it will be the first thing printed in its + group); in this usage, it's conventional to end the string with a `:'. + + Write the initial value as N_("TEXT") if you want xgettext to collect + it into a POT file. */ + const char *doc; + + /* The group this option is in. In a long help message, options are sorted + alphabetically within each group, and the groups presented in the order + 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with + if this field 0 will inherit the group number of the previous entry, or + zero if it's the first one, unless its a group header (NAME and KEY both + 0), in which case, the previous entry + 1 is the default. Automagic + options such as --help are put into group -1. */ + int group; +}; + +/* The argument associated with this option is optional. */ +#define OPTION_ARG_OPTIONAL 0x1 + +/* This option isn't displayed in any help messages. */ +#define OPTION_HIDDEN 0x2 + +/* This option is an alias for the closest previous non-alias option. This + means that it will be displayed in the same help entry, and will inherit + fields other than NAME and KEY from the aliased option. */ +#define OPTION_ALIAS 0x4 + +/* This option isn't actually an option (and so should be ignored by the + actual option parser), but rather an arbitrary piece of documentation that + should be displayed in much the same manner as the options. If this flag + is set, then the option NAME field is displayed unmodified (e.g., no `--' + prefix is added) at the left-margin (where a *short* option would normally + be displayed), and the documentation string in the normal place. The NAME + field will be translated using gettext, unless OPTION_NO_TRANS is set (see + below). For purposes of sorting, any leading whitespace and punctuation is + ignored, except that if the first non-whitespace character is not `-', this + entry is displayed after all options (and OPTION_DOC entries with a leading + `-') in the same group. */ +#define OPTION_DOC 0x8 + +/* This option shouldn't be included in `long' usage messages (but is still + included in help messages). This is mainly intended for options that are + completely documented in an argp's ARGS_DOC field, in which case including + the option in the generic usage list would be redundant. For instance, + if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to + distinguish these two cases, -x should probably be marked + OPTION_NO_USAGE. */ +#define OPTION_NO_USAGE 0x10 + +/* Valid only in conjunction with OPTION_DOC. This option disables translation + of option name. */ +#define OPTION_NO_TRANS 0x20 + + +struct argp; /* fwd declare this type */ +struct argp_state; /* " */ +struct argp_child; /* " */ + +/* The type of a pointer to an argp parsing function. */ +typedef error_t (*argp_parser_t) (int key, char *arg, + struct argp_state *state); + +/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such + returns will simply be ignored. For user keys, this error will be turned + into EINVAL (if the call to argp_parse is such that errors are propagated + back to the user instead of exiting); returning EINVAL itself would result + in an immediate stop to parsing in *all* cases. */ +#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */ + +/* Special values for the KEY argument to an argument parsing function. + ARGP_ERR_UNKNOWN should be returned if they aren't understood. + + The sequence of keys to a parsing function is either (where each + uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key): + + INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all + or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed + or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized + + The third case is where every parser returned ARGP_KEY_UNKNOWN for an + argument, in which case parsing stops at that argument (returning the + unparsed arguments to the caller of argp_parse if requested, or stopping + with an error message if not). + + If an error occurs (either detected by argp, or because the parsing + function returned an error value), then the parser is called with + ARGP_KEY_ERROR, and no further calls are made. */ + +/* This is not an option at all, but rather a command line argument. If a + parser receiving this key returns success, the fact is recorded, and the + ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the + argument, a parser function decrements the NEXT field of the state it's + passed, the option won't be considered processed; this is to allow you to + actually modify the argument (perhaps into an option), and have it + processed again. */ +#define ARGP_KEY_ARG 0 +/* There are remaining arguments not parsed by any parser, which may be found + starting at (STATE->argv + STATE->next). If success is returned, but + STATE->next left untouched, it's assumed that all arguments were consume, + otherwise, the parser should adjust STATE->next to reflect any arguments + consumed. */ +#define ARGP_KEY_ARGS 0x1000006 +/* There are no more command line arguments at all. */ +#define ARGP_KEY_END 0x1000001 +/* Because it's common to want to do some special processing if there aren't + any non-option args, user parsers are called with this key if they didn't + successfully process any non-option arguments. Called just before + ARGP_KEY_END (where more general validity checks on previously parsed + arguments can take place). */ +#define ARGP_KEY_NO_ARGS 0x1000002 +/* Passed in before any parsing is done. Afterwards, the values of each + element of the CHILD_INPUT field, if any, in the state structure is + copied to each child's state to be the initial value of the INPUT field. */ +#define ARGP_KEY_INIT 0x1000003 +/* Use after all other keys, including SUCCESS & END. */ +#define ARGP_KEY_FINI 0x1000007 +/* Passed in when parsing has successfully been completed (even if there are + still arguments remaining). */ +#define ARGP_KEY_SUCCESS 0x1000004 +/* Passed in if an error occurs. */ +#define ARGP_KEY_ERROR 0x1000005 + +/* An argp structure contains a set of options declarations, a function to + deal with parsing one, documentation string, a possible vector of child + argp's, and perhaps a function to filter help output. When actually + parsing options, getopt is called with the union of all the argp + structures chained together through their CHILD pointers, with conflicts + being resolved in favor of the first occurrence in the chain. */ +struct argp +{ + /* An array of argp_option structures, terminated by an entry with both + NAME and KEY having a value of 0. */ + const struct argp_option *options; + + /* What to do with an option from this structure. KEY is the key + associated with the option, and ARG is any associated argument (NULL if + none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be + returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then + parsing is stopped immediately, and that value is returned from + argp_parse(). For special (non-user-supplied) values of KEY, see the + ARGP_KEY_ definitions below. */ + argp_parser_t parser; + + /* A string describing what other arguments are wanted by this program. It + is only used by argp_usage to print the `Usage:' message. If it + contains newlines, the strings separated by them are considered + alternative usage patterns, and printed on separate lines (lines after + the first are prefix by ` or: ' instead of `Usage:'). */ + const char *args_doc; + + /* If non-NULL, a string containing extra text to be printed before and + after the options in a long help message (separated by a vertical tab + `\v' character). + Write the initial value as N_("BEFORE-TEXT") "\v" N_("AFTER-TEXT") if + you want xgettext to collect the two pieces of text into a POT file. */ + const char *doc; + + /* A vector of argp_children structures, terminated by a member with a 0 + argp field, pointing to child argps should be parsed with this one. Any + conflicts are resolved in favor of this argp, or early argps in the + CHILDREN list. This field is useful if you use libraries that supply + their own argp structure, which you want to use in conjunction with your + own. */ + const struct argp_child *children; + + /* If non-zero, this should be a function to filter the output of help + messages. KEY is either a key from an option, in which case TEXT is + that option's help text, or a special key from the ARGP_KEY_HELP_ + defines, below, describing which other help text TEXT is. The function + should return either TEXT, if it should be used as-is, a replacement + string, which should be malloced, and will be freed by argp, or NULL, + meaning `print nothing'. The value for TEXT is *after* any translation + has been done, so if any of the replacement text also needs translation, + that should be done by the filter function. INPUT is either the input + supplied to argp_parse, or NULL, if argp_help was called directly. */ + char *(*help_filter) (int __key, const char *__text, void *__input); + + /* If non-zero the strings used in the argp library are translated using + the domain described by this string. Otherwise the currently installed + default domain is used. */ + const char *argp_domain; +}; + +/* Possible KEY arguments to a help filter function. */ +#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */ +#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */ +#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */ +#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation; + TEXT is NULL for this key. */ +/* Explanatory note emitted when duplicate option arguments have been + suppressed. */ +#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005 +#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */ + +/* When an argp has a non-zero CHILDREN field, it should point to a vector of + argp_child structures, each of which describes a subsidiary argp. */ +struct argp_child +{ + /* The child parser. */ + const struct argp *argp; + + /* Flags for this child. */ + int flags; + + /* If non-zero, an optional header to be printed in help output before the + child options. As a side-effect, a non-zero value forces the child + options to be grouped together; to achieve this effect without actually + printing a header string, use a value of "". */ + const char *header; + + /* Where to group the child options relative to the other (`consolidated') + options in the parent argp; the values are the same as the GROUP field + in argp_option structs, but all child-groupings follow parent options at + a particular group level. If both this field and HEADER are zero, then + they aren't grouped at all, but rather merged with the parent options + (merging the child's grouping levels with the parents). */ + int group; +}; + +/* Parsing state. This is provided to parsing functions called by argp, + which may examine and, as noted, modify fields. */ +struct argp_state +{ + /* The top level ARGP being parsed. */ + const struct argp *root_argp; + + /* The argument vector being parsed. May be modified. */ + int argc; + char **argv; + + /* The index in ARGV of the next arg that to be parsed. May be modified. */ + int next; + + /* The flags supplied to argp_parse. May be modified. */ + unsigned flags; + + /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the + number of the current arg, starting at zero, and incremented after each + such call returns. At all other times, this is the number of such + arguments that have been processed. */ + unsigned arg_num; + + /* If non-zero, the index in ARGV of the first argument following a special + `--' argument (which prevents anything following being interpreted as an + option). Only set once argument parsing has proceeded past this point. */ + int quoted; + + /* An arbitrary pointer passed in from the user. */ + void *input; + /* Values to pass to child parsers. This vector will be the same length as + the number of children for the current parser. */ + void **child_inputs; + + /* For the parser's use. Initialized to 0. */ + void *hook; + + /* The name used when printing messages. This is initialized to ARGV[0], + or PROGRAM_INVOCATION_NAME if that is unavailable. */ + char *name; + + /* Streams used when argp prints something. */ + FILE *err_stream; /* For errors; initialized to stderr. */ + FILE *out_stream; /* For information; initialized to stdout. */ + + void *pstate; /* Private, for use by argp. */ +}; + +/* Flags for argp_parse (note that the defaults are those that are + convenient for program command line parsing): */ + +/* Don't ignore the first element of ARGV. Normally (and always unless + ARGP_NO_ERRS is set) the first element of the argument vector is + skipped for option parsing purposes, as it corresponds to the program name + in a command line. */ +#define ARGP_PARSE_ARGV0 0x01 + +/* Don't print error messages for unknown options to stderr; unless this flag + is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program + name in the error messages. This flag implies ARGP_NO_EXIT (on the + assumption that silent exiting upon errors is bad behaviour). */ +#define ARGP_NO_ERRS 0x02 + +/* Don't parse any non-option args. Normally non-option args are parsed by + calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg + as the value. Since it's impossible to know which parse function wants to + handle it, each one is called in turn, until one returns 0 or an error + other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the + argp_parse returns prematurely (but with a return value of 0). If all + args have been parsed without error, all parsing functions are called one + last time with a key of ARGP_KEY_END. This flag needn't normally be set, + as the normal behavior is to stop parsing as soon as some argument can't + be handled. */ +#define ARGP_NO_ARGS 0x04 + +/* Parse options and arguments in the same order they occur on the command + line -- normally they're rearranged so that all options come first. */ +#define ARGP_IN_ORDER 0x08 + +/* Don't provide the standard long option --help, which causes usage and + option help information to be output to stdout, and exit (0) called. */ +#define ARGP_NO_HELP 0x10 + +/* Don't exit on errors (they may still result in error messages). */ +#define ARGP_NO_EXIT 0x20 + +/* Use the gnu getopt `long-only' rules for parsing arguments. */ +#define ARGP_LONG_ONLY 0x40 + +/* Turns off any message-printing/exiting options. */ +#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP) + +/* Parse the options strings in ARGC & ARGV according to the options in ARGP. + FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the + index in ARGV of the first unparsed option is returned in it. If an + unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser + routine returned a non-zero value, it is returned; otherwise 0 is + returned. This function may also call exit unless the ARGP_NO_HELP flag + is set. INPUT is a pointer to a value to be passed in to the parser. */ +extern error_t argp_parse (const struct argp *__restrict __argp, + int /*argc*/, char **__restrict /*argv*/, + unsigned __flags, int *__restrict __arg_index, + void *__restrict __input); +extern error_t __argp_parse (const struct argp *__restrict __argp, + int /*argc*/, char **__restrict /*argv*/, + unsigned __flags, int *__restrict __arg_index, + void *__restrict __input); + +/* Global variables. */ + +/* GNULIB makes sure both program_invocation_name and + program_invocation_short_name are available */ +#ifdef GNULIB_PROGRAM_INVOCATION_NAME +extern char *program_invocation_name; +# undef HAVE_DECL_PROGRAM_INVOCATION_NAME +# define HAVE_DECL_PROGRAM_INVOCATION_NAME 1 +#endif + +#ifdef GNULIB_PROGRAM_INVOCATION_SHORT_NAME +extern char *program_invocation_short_name; +# undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME +# define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1 +#endif + +/* If defined or set by the user program to a non-zero value, then a default + option --version is added (unless the ARGP_NO_HELP flag is used), which + will print this string followed by a newline and exit (unless the + ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */ +extern const char *argp_program_version; + +/* If defined or set by the user program to a non-zero value, then a default + option --version is added (unless the ARGP_NO_HELP flag is used), which + calls this function with a stream to print the version to and a pointer to + the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is + used). This variable takes precedent over ARGP_PROGRAM_VERSION. */ +extern void (*argp_program_version_hook) (FILE *__restrict __stream, + struct argp_state *__restrict + __state); + +/* If defined or set by the user program, it should point to string that is + the bug-reporting address for the program. It will be printed by + argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various + standard help messages), embedded in a sentence that says something like + `Report bugs to ADDR.'. */ +extern const char *argp_program_bug_address; + +/* The exit status that argp will use when exiting due to a parsing error. + If not defined or set by the user program, this defaults to EX_USAGE from + . */ +extern error_t argp_err_exit_status; + +/* Flags for argp_help. */ +#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */ +#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */ +#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */ +#define ARGP_HELP_LONG 0x08 /* a long help message. */ +#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */ +#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */ +#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC) +#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */ +#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to + reflect ARGP_LONG_ONLY mode. */ + +/* These ARGP_HELP flags are only understood by argp_state_help. */ +#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */ +#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */ + +/* The standard thing to do after a program command line parsing error, if an + error message has already been printed. */ +#define ARGP_HELP_STD_ERR \ + (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR) +/* The standard thing to do after a program command line parsing error, if no + more specific error message has been printed. */ +#define ARGP_HELP_STD_USAGE \ + (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR) +/* The standard thing to do in response to a --help option. */ +#define ARGP_HELP_STD_HELP \ + (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \ + | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR) + +/* Output a usage message for ARGP to STREAM. FLAGS are from the set + ARGP_HELP_*. */ +extern void argp_help (const struct argp *__restrict __argp, + FILE *__restrict __stream, + unsigned __flags, char *__restrict __name); +extern void __argp_help (const struct argp *__restrict __argp, + FILE *__restrict __stream, unsigned __flags, + char *__name); + +/* The following routines are intended to be called from within an argp + parsing routine (thus taking an argp_state structure as the first + argument). They may or may not print an error message and exit, depending + on the flags in STATE -- in any case, the caller should be prepared for + them *not* to exit, and should return an appropiate error after calling + them. [argp_usage & argp_error should probably be called argp_state_..., + but they're used often enough that they should be short] */ + +/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are + from the set ARGP_HELP_*. */ +extern void argp_state_help (const struct argp_state *__restrict __state, + FILE *__restrict __stream, + unsigned int __flags); +extern void __argp_state_help (const struct argp_state *__restrict __state, + FILE *__restrict __stream, + unsigned int __flags); + +/* Possibly output the standard usage message for ARGP to stderr and exit. */ +extern void argp_usage (const struct argp_state *__state); +extern void __argp_usage (const struct argp_state *__state); + +/* If appropriate, print the printf string FMT and following args, preceded + by the program name and `:', to stderr, and followed by a `Try ... --help' + message, then exit (1). */ +extern void argp_error (const struct argp_state *__restrict __state, + const char *__restrict __fmt, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +extern void __argp_error (const struct argp_state *__restrict __state, + const char *__restrict __fmt, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); + +/* Similar to the standard gnu error-reporting function error(), but will + respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print + to STATE->err_stream. This is useful for argument parsing code that is + shared between program startup (when exiting is desired) and runtime + option parsing (when typically an error code is returned instead). The + difference between this function and argp_error is that the latter is for + *parsing errors*, and the former is for other problems that occur during + parsing but don't reflect a (syntactic) problem with the input. */ +extern void argp_failure (const struct argp_state *__restrict __state, + int __status, int __errnum, + const char *__restrict __fmt, ...) + __attribute__ ((__format__ (__printf__, 4, 5))); +extern void __argp_failure (const struct argp_state *__restrict __state, + int __status, int __errnum, + const char *__restrict __fmt, ...) + __attribute__ ((__format__ (__printf__, 4, 5))); + +/* Returns true if the option OPT is a valid short option. */ +extern int _option_is_short (const struct argp_option *__opt) __THROW; +extern int __option_is_short (const struct argp_option *__opt) __THROW; + +/* Returns true if the option OPT is in fact the last (unused) entry in an + options array. */ +extern int _option_is_end (const struct argp_option *__opt) __THROW; +extern int __option_is_end (const struct argp_option *__opt) __THROW; + +/* Return the input field for ARGP in the parser corresponding to STATE; used + by the help routines. */ +extern void *_argp_input (const struct argp *__restrict __argp, + const struct argp_state *__restrict __state) + __THROW; +extern void *__argp_input (const struct argp *__restrict __argp, + const struct argp_state *__restrict __state) + __THROW; + +#ifdef __USE_EXTERN_INLINES + +# if !_LIBC +# define __argp_usage argp_usage +# define __argp_state_help argp_state_help +# define __option_is_short _option_is_short +# define __option_is_end _option_is_end +# endif + +# ifndef ARGP_EI +# define ARGP_EI extern __inline__ +# endif + +ARGP_EI void +__argp_usage (const struct argp_state *__state) +{ + __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE); +} + +ARGP_EI int +__NTH (__option_is_short (const struct argp_option *__opt)) +{ + if (__opt->flags & OPTION_DOC) + return 0; + else + { + int __key = __opt->key; + return __key > 0 && __key <= UCHAR_MAX && isprint (__key); + } +} + +ARGP_EI int +__NTH (__option_is_end (const struct argp_option *__opt)) +{ + return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; +} + +# if !_LIBC +# undef __argp_usage +# undef __argp_state_help +# undef __option_is_short +# undef __option_is_end +# endif +#endif /* Use extern inlines. */ + +#ifdef __cplusplus +} +#endif + +#endif /* argp.h */ diff --git a/lib/asnprintf.c b/lib/asnprintf.c new file mode 100644 index 0000000..26c3988 --- /dev/null +++ b/lib/asnprintf.c @@ -0,0 +1,35 @@ +/* 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) + any 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 "vasnprintf.h" + +#include + +char * +asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) +{ + va_list args; + char *result; + + va_start (args, format); + result = vasnprintf (resultbuf, lengthp, format, args); + va_end (args); + return result; +} diff --git a/lib/at-func.c b/lib/at-func.c new file mode 100644 index 0000000..f98c207 --- /dev/null +++ b/lib/at-func.c @@ -0,0 +1,86 @@ +/* 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 + it under the 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 */ + +#define CALL_FUNC(F) \ + (AT_FUNC_USE_F1_COND \ + ? AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS) \ + : AT_FUNC_F2 (F AT_FUNC_POST_FILE_ARGS)) + +/* Call AT_FUNC_F1 or AT_FUNC_F2 (testing AT_FUNC_USE_F1_COND to + determine which) to operate on FILE, which is in the directory + open on descriptor FD. If possible, do it without changing the + working directory. Otherwise, resort to using save_cwd/fchdir, + then AT_FUNC_F?/restore_cwd. If either the save_cwd or the restore_cwd + fails, then give a diagnostic and exit nonzero. */ +int +AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS) +{ + struct saved_cwd saved_cwd; + int saved_errno; + int err; + + if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file)) + return CALL_FUNC (file); + + { + char buf[OPENAT_BUFFER_SIZE]; + char *proc_file = openat_proc_name (buf, fd, file); + if (proc_file) + { + int proc_result = CALL_FUNC (proc_file); + int proc_errno = errno; + if (proc_file != buf) + free (proc_file); + /* If the syscall succeeds, or if it fails with an unexpected + errno value, then return right away. Otherwise, fall through + and resort to using save_cwd/restore_cwd. */ + if (0 <= proc_result) + return proc_result; + if (! EXPECTED_ERRNO (proc_errno)) + { + errno = proc_errno; + return proc_result; + } + } + } + + if (save_cwd (&saved_cwd) != 0) + openat_save_fail (errno); + + if (fchdir (fd) != 0) + { + saved_errno = errno; + free_cwd (&saved_cwd); + errno = saved_errno; + return -1; + } + + err = CALL_FUNC (file); + saved_errno = (err < 0 ? errno : 0); + + if (restore_cwd (&saved_cwd) != 0) + openat_restore_fail (errno); + + free_cwd (&saved_cwd); + + if (saved_errno) + errno = saved_errno; + return err; +} +#undef CALL_FUNC diff --git a/lib/basename.c b/lib/basename.c new file mode 100644 index 0000000..fbe17ff --- /dev/null +++ b/lib/basename.c @@ -0,0 +1,129 @@ +/* basename.c -- return the last element in a file name + + 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 + it under the 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 + +#include "dirname.h" + +#include +#include "xalloc.h" +#include "xstrndup.h" + +/* Return the address of the last file name component of NAME. If + NAME has no relative file name components because it is a file + system root, return the empty string. */ + +char * +last_component (char const *name) +{ + char const *base = name + FILE_SYSTEM_PREFIX_LEN (name); + char const *p; + bool saw_slash = false; + + while (ISSLASH (*base)) + base++; + + for (p = base; *p; p++) + { + if (ISSLASH (*p)) + saw_slash = true; + else if (saw_slash) + { + base = p; + saw_slash = false; + } + } + + return (char *) base; +} + + +/* In general, we can't use the builtin `basename' function if available, + since it has different meanings in different environments. + In some environments the builtin `basename' modifies its argument. + + Return the last file name component of NAME, allocated with + xmalloc. On systems with drive letters, a leading "./" + distinguishes relative names that would otherwise look like a drive + letter. Unlike POSIX basename(), NAME cannot be NULL, + base_name("") returns "", and the first trailing slash is not + stripped. + + If lstat (NAME) would succeed, then { chdir (dir_name (NAME)); + lstat (base_name (NAME)); } will access the same file. Likewise, + if the sequence { chdir (dir_name (NAME)); + rename (base_name (NAME), "foo"); } succeeds, you have renamed NAME + to "foo" in the same directory NAME was in. */ + +char * +base_name (char const *name) +{ + char const *base = last_component (name); + size_t length; + + /* If there is no last component, then name is a file system root or the + empty string. */ + if (! *base) + return xstrndup (name, base_len (name)); + + /* Collapse a sequence of trailing slashes into one. */ + length = base_len (base); + if (ISSLASH (base[length])) + length++; + + /* On systems with drive letters, `a/b:c' must return `./b:c' rather + than `b:c' to avoid confusion with a drive letter. On systems + with pure POSIX semantics, this is not an issue. */ + if (FILE_SYSTEM_PREFIX_LEN (base)) + { + char *p = xmalloc (length + 3); + p[0] = '.'; + p[1] = '/'; + memcpy (p + 2, base, length); + p[length + 2] = '\0'; + return p; + } + + /* Finally, copy the basename. */ + return xstrndup (base, length); +} + +/* Return the length of the basename NAME. Typically NAME is the + value returned by base_name or last_component. Act like strlen + (NAME), except omit all trailing slashes. */ + +size_t +base_len (char const *name) +{ + size_t len; + size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name); + + for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--) + continue; + + if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1 + && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2]) + return 2; + + if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len + && len == prefix_len && ISSLASH (name[prefix_len])) + return prefix_len + 1; + + return len; +} diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c new file mode 100644 index 0000000..05ced11 --- /dev/null +++ b/lib/canonicalize-lgpl.c @@ -0,0 +1,353 @@ +/* Return the canonical absolute name of a given file. + Copyright (C) 1996-2003, 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) + any 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 + +/* Avoid a clash of our rpl_realpath() function with the prototype in + on Solaris 2.5.1. */ +#undef realpath + +#if !HAVE_CANONICALIZE_FILE_NAME || defined _LIBC + +#include + +/* Specification. */ +#include "canonicalize.h" + +#include +#include +#include + +#if HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#include + +#if HAVE_SYS_PARAM_H || defined _LIBC +# include +#endif +#ifndef MAXSYMLINKS +# define MAXSYMLINKS 20 +#endif + +#include + +#include +#ifndef _LIBC +# define __set_errno(e) errno = (e) +# ifndef ENAMETOOLONG +# define ENAMETOOLONG EINVAL +# endif +#endif + +#ifdef _LIBC +# include +#else +# define SHLIB_COMPAT(lib, introduced, obsoleted) 0 +# define versioned_symbol(lib, local, symbol, version) +# define compat_symbol(lib, local, symbol, version) +# define weak_alias(local, symbol) +# define __canonicalize_file_name canonicalize_file_name +# define __realpath rpl_realpath +# include "pathmax.h" +# include "allocsa.h" +# if HAVE_GETCWD +# ifdef VMS + /* We want the directory in Unix syntax, not in VMS syntax. */ +# define __getcwd(buf, max) getcwd (buf, max, 0) +# else +# define __getcwd getcwd +# endif +# else +# define __getcwd(buf, max) getwd (buf) +# endif +# define __readlink readlink + /* On systems without symbolic links, call stat() instead of lstat(). */ +# if !defined S_ISNLK && !HAVE_READLINK +# define lstat stat +# endif +#endif + +/* Return the canonical absolute name of file NAME. A canonical name + does not contain any `.', `..' components nor any repeated path + separators ('/') or symlinks. All path components must exist. If + RESOLVED is null, the result is malloc'd; otherwise, if the + canonical name is PATH_MAX chars or more, returns null with `errno' + set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, + returns the name in RESOLVED. If the name cannot be resolved and + RESOLVED is non-NULL, it contains the path of the first component + that cannot be resolved. If the path can be resolved, RESOLVED + holds the same value as the value returned. */ + +char * +__realpath (const char *name, char *resolved) +{ + char *rpath, *dest, *extra_buf = NULL; + const char *start, *end, *rpath_limit; + long int path_max; +#if HAVE_READLINK + int num_links = 0; +#endif + + if (name == NULL) + { + /* As per Single Unix Specification V2 we must return an error if + either parameter is a null pointer. We extend this to allow + the RESOLVED parameter to be NULL in case the we are expected to + allocate the room for the return value. */ + __set_errno (EINVAL); + return NULL; + } + + if (name[0] == '\0') + { + /* As per Single Unix Specification V2 we must return an error if + the name argument points to an empty string. */ + __set_errno (ENOENT); + return NULL; + } + +#ifdef PATH_MAX + path_max = PATH_MAX; +#else + path_max = pathconf (name, _PC_PATH_MAX); + if (path_max <= 0) + path_max = 1024; +#endif + + if (resolved == NULL) + { + rpath = malloc (path_max); + if (rpath == NULL) + return NULL; + } + else + rpath = resolved; + rpath_limit = rpath + path_max; + + if (name[0] != '/') + { + if (!__getcwd (rpath, path_max)) + { + rpath[0] = '\0'; + goto error; + } + dest = strchr (rpath, '\0'); + } + else + { + rpath[0] = '/'; + dest = rpath + 1; + } + + for (start = end = name; *start; start = end) + { +#ifdef _LIBC + struct stat64 st; +#else + struct stat st; +#endif + + /* Skip sequence of multiple path-separators. */ + while (*start == '/') + ++start; + + /* Find end of path component. */ + for (end = start; *end && *end != '/'; ++end) + /* Nothing. */; + + if (end - start == 0) + break; + else if (end - start == 1 && start[0] == '.') + /* nothing */; + else if (end - start == 2 && start[0] == '.' && start[1] == '.') + { + /* Back up to previous component, ignore if at root already. */ + if (dest > rpath + 1) + while ((--dest)[-1] != '/'); + } + else + { + size_t new_size; + + if (dest[-1] != '/') + *dest++ = '/'; + + if (dest + (end - start) >= rpath_limit) + { + ptrdiff_t dest_offset = dest - rpath; + char *new_rpath; + + if (resolved) + { + __set_errno (ENAMETOOLONG); + if (dest > rpath + 1) + dest--; + *dest = '\0'; + goto error; + } + new_size = rpath_limit - rpath; + if (end - start + 1 > path_max) + new_size += end - start + 1; + else + new_size += path_max; + new_rpath = (char *) realloc (rpath, new_size); + if (new_rpath == NULL) + goto error; + rpath = new_rpath; + rpath_limit = rpath + new_size; + + dest = rpath + dest_offset; + } + +#ifdef _LIBC + dest = __mempcpy (dest, start, end - start); +#else + memcpy (dest, start, end - start); + dest += end - start; +#endif + *dest = '\0'; + +#ifdef _LIBC + if (__lxstat64 (_STAT_VER, rpath, &st) < 0) +#else + if (lstat (rpath, &st) < 0) +#endif + goto error; + +#if HAVE_READLINK + if (S_ISLNK (st.st_mode)) + { + char *buf; + size_t len; + int n; + + if (++num_links > MAXSYMLINKS) + { + __set_errno (ELOOP); + goto error; + } + + buf = allocsa (path_max); + if (!buf) + { + errno = ENOMEM; + goto error; + } + + n = __readlink (rpath, buf, path_max); + if (n < 0) + { + int saved_errno = errno; + freesa (buf); + errno = saved_errno; + goto error; + } + buf[n] = '\0'; + + if (!extra_buf) + { + extra_buf = allocsa (path_max); + if (!extra_buf) + { + freesa (buf); + errno = ENOMEM; + goto error; + } + } + + len = strlen (end); + if ((long int) (n + len) >= path_max) + { + freesa (buf); + __set_errno (ENAMETOOLONG); + goto error; + } + + /* Careful here, end may be a pointer into extra_buf... */ + memmove (&extra_buf[n], end, len + 1); + name = end = memcpy (extra_buf, buf, n); + + if (buf[0] == '/') + dest = rpath + 1; /* It's an absolute symlink */ + else + /* Back up to previous component, ignore if at root already: */ + if (dest > rpath + 1) + while ((--dest)[-1] != '/'); + } +#endif + } + } + if (dest > rpath + 1 && dest[-1] == '/') + --dest; + *dest = '\0'; + + if (extra_buf) + freesa (extra_buf); + + return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath; + +error: + { + int saved_errno = errno; + if (extra_buf) + freesa (extra_buf); + if (resolved) + strcpy (resolved, rpath); + else + free (rpath); + errno = saved_errno; + } + return NULL; +} +#ifdef _LIBC +versioned_symbol (libc, __realpath, realpath, GLIBC_2_3); +#endif + + +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3) +char * +__old_realpath (const char *name, char *resolved) +{ + if (resolved == NULL) + { + __set_errno (EINVAL); + return NULL; + } + + return __realpath (name, resolved); +} +compat_symbol (libc, __old_realpath, realpath, GLIBC_2_0); +#endif + + +char * +__canonicalize_file_name (const char *name) +{ + return __realpath (name, NULL); +} +weak_alias (__canonicalize_file_name, canonicalize_file_name) + +#else + +/* This declaration is solely to ensure that after preprocessing + this file is never empty. */ +typedef int dummy; + +#endif diff --git a/lib/canonicalize.h b/lib/canonicalize.h new file mode 100644 index 0000000..5c4d3f1 --- /dev/null +++ b/lib/canonicalize.h @@ -0,0 +1,54 @@ +/* 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 + it under the 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. */ + +#ifndef CANONICALIZE_H_ +# define CANONICALIZE_H_ + +# if GNULIB_CANONICALIZE +enum canonicalize_mode_t + { + /* All components must exist. */ + CAN_EXISTING = 0, + + /* All components excluding last one must exist. */ + CAN_ALL_BUT_LAST = 1, + + /* No requirements on components existence. */ + CAN_MISSING = 2 + }; +typedef enum canonicalize_mode_t canonicalize_mode_t; + +/* Return a malloc'd string containing the canonical absolute name of + the named file. This acts like canonicalize_file_name, except that + whether components must exist depends on the canonicalize_mode_t + argument. */ +char *canonicalize_filename_mode (const char *, canonicalize_mode_t); +# endif + +# if HAVE_DECL_CANONICALIZE_FILE_NAME +# include +# else +/* Return a malloc'd string containing the canonical absolute name of + the named file. If any file name component does not exist or is a + symlink to a nonexistent file, return NULL. A canonical name does + not contain any `.', `..' components nor any repeated file name + separators ('/') or symlinks. */ +char *canonicalize_file_name (const char *); +# endif + +#endif /* !CANONICALIZE_H_ */ diff --git a/lib/chdir-long.c b/lib/chdir-long.c new file mode 100644 index 0000000..3fc7ef2 --- /dev/null +++ b/lib/chdir-long.c @@ -0,0 +1,265 @@ +/* provide a chdir function that tries not to fail due to ENAMETOOLONG + Copyright (C) 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) + any 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 "chdir-long.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "openat.h" + +#ifndef PATH_MAX +# error "compile this file only if your system defines PATH_MAX" +#endif + +struct cd_buf +{ + int fd; +}; + +static inline void +cdb_init (struct cd_buf *cdb) +{ + cdb->fd = AT_FDCWD; +} + +static inline int +cdb_fchdir (struct cd_buf const *cdb) +{ + return fchdir (cdb->fd); +} + +static inline void +cdb_free (struct cd_buf const *cdb) +{ + if (0 <= cdb->fd) + { + bool close_fail = close (cdb->fd); + assert (! close_fail); + } +} + +/* Given a file descriptor of an open directory (or AT_FDCWD), CDB->fd, + try to open the CDB->fd-relative directory, DIR. If the open succeeds, + update CDB->fd with the resulting descriptor, close the incoming file + descriptor, and return zero. Upon failure, return -1 and set errno. */ +static int +cdb_advance_fd (struct cd_buf *cdb, char const *dir) +{ + int new_fd = openat (cdb->fd, dir, + O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK); + if (new_fd < 0) + return -1; + + cdb_free (cdb); + cdb->fd = new_fd; + + return 0; +} + +/* Return a pointer to the first non-slash in S. */ +static inline char * +find_non_slash (char const *s) +{ + size_t n_slash = strspn (s, "/"); + return (char *) s + n_slash; +} + +/* This is a function much like chdir, but without the PATH_MAX limitation + on the length of the directory name. A significant difference is that + it must be able to modify (albeit only temporarily) the directory + name. It handles an arbitrarily long directory name by operating + on manageable portions of the name. On systems without the openat + syscall, this means changing the working directory to more and more + `distant' points along the long directory name and then restoring + the working directory. If any of those attempts to save or restore + the working directory fails, this function exits nonzero. + + Note that this function may still fail with errno == ENAMETOOLONG, but + only if the specified directory name contains a component that is long + enough to provoke such a failure all by itself (e.g. if the component + has length PATH_MAX or greater on systems that define PATH_MAX). */ + +int +chdir_long (char *dir) +{ + int e = chdir (dir); + if (e == 0 || errno != ENAMETOOLONG) + return e; + + { + size_t len = strlen (dir); + char *dir_end = dir + len; + struct cd_buf cdb; + size_t n_leading_slash; + + cdb_init (&cdb); + + /* If DIR is the empty string, then the chdir above + must have failed and set errno to ENOENT. */ + assert (0 < len); + assert (PATH_MAX <= len); + + /* Count leading slashes. */ + n_leading_slash = strspn (dir, "/"); + + /* Handle any leading slashes as well as any name that matches + the regular expression, m!^//hostname[/]*! . Handling this + prefix separately usually results in a single additional + cdb_advance_fd call, but it's worthwhile, since it makes the + code in the following loop cleaner. */ + if (n_leading_slash == 2) + { + int err; + /* Find next slash. + We already know that dir[2] is neither a slash nor '\0'. */ + char *slash = memchr (dir + 3, '/', dir_end - (dir + 3)); + if (slash == NULL) + { + errno = ENAMETOOLONG; + return -1; + } + *slash = '\0'; + err = cdb_advance_fd (&cdb, dir); + *slash = '/'; + if (err != 0) + goto Fail; + dir = find_non_slash (slash + 1); + } + else if (n_leading_slash) + { + if (cdb_advance_fd (&cdb, "/") != 0) + goto Fail; + dir += n_leading_slash; + } + + assert (*dir != '/'); + assert (dir <= dir_end); + + while (PATH_MAX <= dir_end - dir) + { + int err; + /* Find a slash that is PATH_MAX or fewer bytes away from dir. + I.e. see if there is a slash that will give us a name of + length PATH_MAX-1 or less. */ + char *slash = memrchr (dir, '/', PATH_MAX); + if (slash == NULL) + { + errno = ENAMETOOLONG; + return -1; + } + + *slash = '\0'; + assert (slash - dir < PATH_MAX); + err = cdb_advance_fd (&cdb, dir); + *slash = '/'; + if (err != 0) + goto Fail; + + dir = find_non_slash (slash + 1); + } + + if (dir < dir_end) + { + if (cdb_advance_fd (&cdb, dir) != 0) + goto Fail; + } + + if (cdb_fchdir (&cdb) != 0) + goto Fail; + + cdb_free (&cdb); + return 0; + + Fail: + { + int saved_errno = errno; + cdb_free (&cdb); + errno = saved_errno; + return -1; + } + } +} + +#if TEST_CHDIR + +# include +# include "closeout.h" +# include "error.h" + +char *program_name; + +int +main (int argc, char *argv[]) +{ + char *line = NULL; + size_t n = 0; + int len; + + program_name = argv[0]; + atexit (close_stdout); + + len = getline (&line, &n, stdin); + if (len < 0) + { + int saved_errno = errno; + if (feof (stdin)) + exit (0); + + error (EXIT_FAILURE, saved_errno, + "reading standard input"); + } + else if (len == 0) + exit (0); + + if (line[len-1] == '\n') + line[len-1] = '\0'; + + if (chdir_long (line) != 0) + error (EXIT_FAILURE, errno, + "chdir_long failed: %s", line); + + if (argc <= 1) + { + /* Using `pwd' here makes sense only if it is a robust implementation, + like the one in coreutils after the 2004-04-19 changes. */ + char const *cmd = "pwd"; + execlp (cmd, (char *) NULL); + error (EXIT_FAILURE, errno, "%s", cmd); + } + + fclose (stdin); + fclose (stderr); + + exit (EXIT_SUCCESS); +} +#endif + +/* +Local Variables: +compile-command: "gcc -DTEST_CHDIR=1 -g -O -W -Wall chdir-long.c libcoreutils.a" +End: +*/ diff --git a/lib/chdir-long.h b/lib/chdir-long.h new file mode 100644 index 0000000..4852b40 --- /dev/null +++ b/lib/chdir-long.h @@ -0,0 +1,35 @@ +/* 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 + it under the 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 PATH_MAX +# ifdef MAXPATHLEN +# define PATH_MAX MAXPATHLEN +# endif +#endif + +/* On systems without PATH_MAX, presume that chdir accepts + arbitrarily long directory names. */ +#ifndef PATH_MAX +# define chdir_long(Dir) chdir (Dir) +#else +int chdir_long (char *dir); +#endif diff --git a/lib/chown.c b/lib/chown.c new file mode 100644 index 0000000..b7786f6 --- /dev/null +++ b/lib/chown.c @@ -0,0 +1,104 @@ +/* provide consistent interface to chown for systems that don't interpret + an ID of -1 as meaning `don't change the corresponding ID'. + + Copyright (C) 1997, 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) + any 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 + +/* Specification. */ +#include + +#include +#include +#include +#include +#include + +/* Below we refer to the system's chown(). */ +#undef chown + +/* The results of open() in this file are not used with fchdir, + therefore save some unnecessary work in fchdir.c. */ +#undef open +#undef close + +/* Provide a more-closely POSIX-conforming version of chown on + systems with one or both of the following problems: + - chown doesn't treat an ID of -1 as meaning + `don't change the corresponding ID'. + - chown doesn't dereference symlinks. */ + +int +rpl_chown (const char *file, uid_t uid, gid_t gid) +{ +#if CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE + if (gid == (gid_t) -1 || uid == (uid_t) -1) + { + struct stat file_stats; + + /* Stat file to get id(s) that should remain unchanged. */ + if (stat (file, &file_stats)) + return -1; + + if (gid == (gid_t) -1) + gid = file_stats.st_gid; + + if (uid == (uid_t) -1) + uid = file_stats.st_uid; + } +#endif + +#if CHOWN_MODIFIES_SYMLINK + { + /* Handle the case in which the system-supplied chown function + does *not* follow symlinks. Instead, it changes permissions + on the symlink itself. To work around that, we open the + file (but this can fail due to lack of read or write permission) and + use fchown on the resulting descriptor. */ + int open_flags = O_NONBLOCK | O_NOCTTY; + int fd = open (file, O_RDONLY | open_flags); + if (0 <= fd + || (errno == EACCES + && 0 <= (fd = open (file, O_WRONLY | open_flags)))) + { + int result = fchown (fd, uid, gid); + int saved_errno = errno; + + /* POSIX says fchown can fail with errno == EINVAL on sockets, + so fall back on chown in that case. */ + struct stat sb; + bool fchown_socket_failure = + (result != 0 && saved_errno == EINVAL + && fstat (fd, &sb) == 0 && S_ISFIFO (sb.st_mode)); + + close (fd); + + if (! fchown_socket_failure) + { + errno = saved_errno; + return result; + } + } + else if (errno != EACCES) + return -1; + } +#endif + + return chown (file, uid, gid); +} diff --git a/lib/close-stream.c b/lib/close-stream.c new file mode 100644 index 0000000..72d0d68 --- /dev/null +++ b/lib/close-stream.c @@ -0,0 +1,76 @@ +/* Close a stream, with nicer error checking than fclose's. + + Copyright (C) 1998, 1999, 2000, 2001, 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 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 + +#include "close-stream.h" + +#include +#include + +#include "__fpending.h" + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +/* Close STREAM. Return 0 if successful, EOF (setting errno) + otherwise. A failure might set errno to 0 if the error number + cannot be determined. + + 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 + of every function that does an explicit write to STREAM. The last + printf can succeed in writing to the internal stream buffer, and yet + the fclose(STREAM) could still fail (due e.g., to a disk full error) + when it tries to write out that buffered data. Thus, you would be + left with an incomplete output file and the offending program would + exit successfully. Even calling fflush is not always sufficient, + since some file systems (NFS and CODA) buffer written/flushed data + until an actual close call. + + Besides, it's wasteful to check the return value from every call + that writes to STREAM -- just let the internal stream state record + the failure. That's what the ferror test is checking below. */ + +int +close_stream (FILE *stream) +{ + bool some_pending = (__fpending (stream) != 0); + bool prev_fail = (ferror (stream) != 0); + bool fclose_fail = (fclose (stream) != 0); + + /* Return an error indication if there was a previous failure or if + fclose failed, with one exception: ignore an fclose failure if + there was no previous error, no data remains to be flushed, and + fclose failed with EBADF. That can happen when a program like cp + is invoked like this `cp a b >&-' (i.e., with standard output + closed) and doesn't generate any output (hence no previous error + and nothing to be flushed). */ + + if (prev_fail || (fclose_fail && (some_pending || errno != EBADF))) + { + if (! fclose_fail) + errno = 0; + return EOF; + } + + return 0; +} diff --git a/lib/close-stream.h b/lib/close-stream.h new file mode 100644 index 0000000..be3d419 --- /dev/null +++ b/lib/close-stream.h @@ -0,0 +1,2 @@ +#include +int close_stream (FILE *stream); diff --git a/lib/closeout.c b/lib/closeout.c new file mode 100644 index 0000000..830f16f --- /dev/null +++ b/lib/closeout.c @@ -0,0 +1,86 @@ +/* Close standard output and standard error, exiting with a diagnostic on error. + + Copyright (C) 1998, 1999, 2000, 2001, 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 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 + +#include "closeout.h" + +#include +#include +#include + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +#include "close-stream.h" +#include "error.h" +#include "exitfail.h" +#include "quotearg.h" + +static const char *file_name; + +/* Set the file name to be reported in the event an error is detected + by close_stdout. */ +void +close_stdout_set_file_name (const char *file) +{ + file_name = file; +} + +/* Close standard output. On error, issue a diagnostic and _exit + with status 'exit_failure'. + + Also close standard error. On error, _exit with status 'exit_failure'. + + Since close_stdout 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_stdout + 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 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_stdout (void) +{ + if (close_stream (stdout) != 0) + { + char const *write_error = _("write error"); + if (file_name) + error (0, errno, "%s: %s", quotearg_colon (file_name), + write_error); + else + error (0, errno, "%s", write_error); + + _exit (exit_failure); + } + + if (close_stream (stderr) != 0) + _exit (exit_failure); +} diff --git a/lib/closeout.h b/lib/closeout.h new file mode 100644 index 0000000..8bed23b --- /dev/null +++ b/lib/closeout.h @@ -0,0 +1,33 @@ +/* Close standard output and standard error. + + Copyright (C) 1998, 2000, 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. */ + +#ifndef CLOSEOUT_H +# define CLOSEOUT_H 1 + +# ifdef __cplusplus +extern "C" { +# endif + +void close_stdout_set_file_name (const char *file); +void close_stdout (void); + +# ifdef __cplusplus +} +# endif + +#endif diff --git a/lib/creat-safer.c b/lib/creat-safer.c new file mode 100644 index 0000000..f4a2e59 --- /dev/null +++ b/lib/creat-safer.c @@ -0,0 +1,32 @@ +/* Invoke creat, but avoid some glitches. + + Copyright (C) 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) + any 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 "fcntl-safer.h" + +#include +#include "unistd-safer.h" + +int +creat_safer (char const *file, mode_t mode) +{ + return fd_safer (creat (file, mode)); +} diff --git a/lib/dirent_.h b/lib/dirent_.h new file mode 100644 index 0000000..94e44fc --- /dev/null +++ b/lib/dirent_.h @@ -0,0 +1,50 @@ +/* Wrapper around . + 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_DIRENT_H + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_DIRENT_H@ +#endif + +#ifndef _GL_DIRENT_H +#define _GL_DIRENT_H + + +/* Declare overridden functions. */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if @REPLACE_FCHDIR@ +# define opendir rpl_opendir +extern DIR * opendir (const char *); +# define closedir rpl_closedir +extern int closedir (DIR *); +#endif + +#ifdef __cplusplus +} +#endif + + +#endif /* _GL_DIRENT_H */ +#endif /* _GL_DIRENT_H */ diff --git a/lib/dirfd.c b/lib/dirfd.c new file mode 100644 index 0000000..06cb3c4 --- /dev/null +++ b/lib/dirfd.c @@ -0,0 +1,29 @@ +/* dirfd.c -- return the file descriptor associated with an open DIR* + + Copyright (C) 2001, 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 "dirfd.h" + +int +dirfd (DIR const *dir_p) +{ + return DIR_TO_FD (dir_p); +} diff --git a/lib/dirfd.h b/lib/dirfd.h new file mode 100644 index 0000000..05b7777 --- /dev/null +++ b/lib/dirfd.h @@ -0,0 +1,29 @@ +/* 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/lib/dirname.c b/lib/dirname.c new file mode 100644 index 0000000..16552c6 --- /dev/null +++ b/lib/dirname.c @@ -0,0 +1,85 @@ +/* dirname.c -- return all but the last element in a file name + + 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 + it under the 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 + +#include "dirname.h" + +#include +#include "xalloc.h" + +/* Return the length of the prefix of FILE that will be used by + dir_name. If FILE is in the working directory, this returns zero + even though `dir_name (FILE)' will return ".". Works properly even + if there are trailing slashes (by effectively ignoring them). */ + +size_t +dir_len (char const *file) +{ + size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file); + size_t length; + + /* Advance prefix_length beyond important leading slashes. */ + prefix_length += (prefix_length != 0 + ? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE + && ISSLASH (file[prefix_length])) + : (ISSLASH (file[0]) + ? ((DOUBLE_SLASH_IS_DISTINCT_ROOT + && ISSLASH (file[1]) && ! ISSLASH (file[2]) + ? 2 : 1)) + : 0)); + + /* Strip the basename and any redundant slashes before it. */ + for (length = last_component (file) - file; + prefix_length < length; length--) + if (! ISSLASH (file[length - 1])) + break; + return length; +} + + +/* In general, we can't use the builtin `dirname' function if available, + since it has different meanings in different environments. + In some environments the builtin `dirname' modifies its argument. + + Return the leading directories part of FILE, allocated with xmalloc. + Works properly even if there are trailing slashes (by effectively + ignoring them). Unlike POSIX dirname(), FILE cannot be NULL. + + If lstat (FILE) would succeed, then { chdir (dir_name (FILE)); + lstat (base_name (FILE)); } will access the same file. Likewise, + if the sequence { chdir (dir_name (FILE)); + rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE + to "foo" in the same directory FILE was in. */ + +char * +dir_name (char const *file) +{ + size_t length = dir_len (file); + bool append_dot = (length == 0 + || (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE + && length == FILE_SYSTEM_PREFIX_LEN (file) + && file[2] != '\0' && ! ISSLASH (file[2]))); + char *dir = xmalloc (length + append_dot + 1); + memcpy (dir, file, length); + if (append_dot) + dir[length++] = '.'; + dir[length] = '\0'; + return dir; +} diff --git a/lib/dirname.h b/lib/dirname.h new file mode 100644 index 0000000..91e7ed3 --- /dev/null +++ b/lib/dirname.h @@ -0,0 +1,70 @@ +/* Take file names apart into directory and base names. + + Copyright (C) 1998, 2001, 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. */ + +#ifndef DIRNAME_H_ +# define DIRNAME_H_ 1 + +# include +# include + +# ifndef DIRECTORY_SEPARATOR +# define DIRECTORY_SEPARATOR '/' +# endif + +# ifndef ISSLASH +# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) +# endif + +# ifndef FILE_SYSTEM_PREFIX_LEN +# if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX + /* This internal macro assumes ASCII, but all hosts that support drive + letters use ASCII. */ +# define _IS_DRIVE_LETTER(c) (((unsigned int) (c) | ('a' - 'A')) - 'a' \ + <= 'z' - 'a') +# define FILE_SYSTEM_PREFIX_LEN(Filename) \ + (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0) +# else +# define FILE_SYSTEM_PREFIX_LEN(Filename) 0 +# endif +# endif + +# ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 +# endif + +# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT +# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0 +# endif + +# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE +# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)]) +# else +# define IS_ABSOLUTE_FILE_NAME(F) \ + (ISSLASH ((F)[0]) || 0 < FILE_SYSTEM_PREFIX_LEN (F)) +# endif +# define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F)) + +char *base_name (char const *file); +char *dir_name (char const *file); +size_t base_len (char const *file); +size_t dir_len (char const *file); +char *last_component (char const *file); + +bool strip_trailing_slashes (char *file); + +#endif /* not DIRNAME_H_ */ diff --git a/lib/dup-safer.c b/lib/dup-safer.c new file mode 100644 index 0000000..7b12b61 --- /dev/null +++ b/lib/dup-safer.c @@ -0,0 +1,45 @@ +/* Invoke dup, but avoid some glitches. + + Copyright (C) 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) + any 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 "unistd-safer.h" + +#include + +#include +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + +/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or + STDERR_FILENO. */ + +int +dup_safer (int fd) +{ +#if defined F_DUPFD && !defined FCHDIR_REPLACEMENT + return fcntl (fd, F_DUPFD, STDERR_FILENO + 1); +#else + /* fd_safer calls us back, but eventually the recursion unwinds and + does the right thing. */ + return fd_safer (dup (fd)); +#endif +} diff --git a/lib/dup2.c b/lib/dup2.c new file mode 100644 index 0000000..8894481 --- /dev/null +++ b/lib/dup2.c @@ -0,0 +1,58 @@ +/* Duplicate an open file descriptor to a specified file descriptor. + + Copyright (C) 1999, 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) + any 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 + +/* Specification. */ +#include + +#include +#include + +#ifndef F_DUPFD +static int +dupfd (int fd, int desired_fd) +{ + int duplicated_fd = dup (fd); + if (duplicated_fd < 0 || duplicated_fd == desired_fd) + return duplicated_fd; + else + { + int r = dupfd (fd, desired_fd); + int e = errno; + close (duplicated_fd); + errno = e; + return r; + } +} +#endif + +int +dup2 (int fd, int desired_fd) +{ + if (fd == desired_fd) + return fd; + close (desired_fd); +#ifdef F_DUPFD + return fcntl (fd, F_DUPFD, desired_fd); +#else + return dupfd (fd, desired_fd); +#endif +} diff --git a/lib/error.c b/lib/error.c new file mode 100644 index 0000000..cf86343 --- /dev/null +++ b/lib/error.c @@ -0,0 +1,338 @@ +/* Error handler for noninteractive utilities + Copyright (C) 1990-1998, 2000-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) + any 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 . */ + +#if !_LIBC +# include +#endif + +#include "error.h" + +#include +#include +#include +#include + +#if !_LIBC && ENABLE_NLS +# include "gettext.h" +#endif + +#ifdef _LIBC +# include +# include +# include +# include +# define mbsrtowcs __mbsrtowcs +#endif + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +#ifndef _ +# define _(String) String +#endif + +/* If NULL, error will flush stdout, then print on stderr the program + name, a colon and a space. Otherwise, error will call this + function without parameters instead. */ +void (*error_print_progname) (void); + +/* This variable is incremented each time `error' is called. */ +unsigned int error_message_count; + +#ifdef _LIBC +/* In the GNU C library, there is a predefined variable for this. */ + +# define program_name program_invocation_name +# include +# include +# include + +/* In GNU libc we want do not want to use the common name `error' directly. + Instead make it a weak alias. */ +extern void __error (int status, int errnum, const char *message, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); +extern void __error_at_line (int status, int errnum, const char *file_name, + unsigned int line_number, const char *message, + ...) + __attribute__ ((__format__ (__printf__, 5, 6)));; +# define error __error +# define error_at_line __error_at_line + +# include +# define fflush(s) INTUSE(_IO_fflush) (s) +# undef putc +# define putc(c, fp) INTUSE(_IO_putc) (c, fp) + +# include + +#else /* not _LIBC */ + +# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P +# ifndef HAVE_DECL_STRERROR_R +"this configure-time declaration test was not run" +# endif +char *strerror_r (); +# endif + +/* The calling program should define program_name and set it to the + name of the executing program. */ +extern char *program_name; + +# if HAVE_STRERROR_R || defined strerror_r +# define __strerror_r strerror_r +# endif /* HAVE_STRERROR_R || defined strerror_r */ +#endif /* not _LIBC */ + +static void +print_errno_message (int errnum) +{ + char const *s; + +#if defined HAVE_STRERROR_R || _LIBC + char errbuf[1024]; +# if STRERROR_R_CHAR_P || _LIBC + s = __strerror_r (errnum, errbuf, sizeof errbuf); +# else + if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) + s = errbuf; + else + s = 0; +# endif +#else + s = strerror (errnum); +#endif + +#if !_LIBC + if (! s) + s = _("Unknown system error"); +#endif + +#if _LIBC + __fxprintf (NULL, ": %s", s); +#else + fprintf (stderr, ": %s", s); +#endif +} + +static void +error_tail (int status, int errnum, const char *message, va_list args) +{ +#if _LIBC + if (_IO_fwide (stderr, 0) > 0) + { +# define ALLOCA_LIMIT 2000 + size_t len = strlen (message) + 1; + wchar_t *wmessage = NULL; + mbstate_t st; + size_t res; + const char *tmp; + bool use_malloc = false; + + while (1) + { + if (__libc_use_alloca (len * sizeof (wchar_t))) + wmessage = (wchar_t *) alloca (len * sizeof (wchar_t)); + else + { + if (!use_malloc) + wmessage = NULL; + + wchar_t *p = (wchar_t *) realloc (wmessage, + len * sizeof (wchar_t)); + if (p == NULL) + { + free (wmessage); + fputws_unlocked (L"out of memory\n", stderr); + return; + } + wmessage = p; + use_malloc = true; + } + + memset (&st, '\0', sizeof (st)); + tmp = message; + + res = mbsrtowcs (wmessage, &tmp, len, &st); + if (res != len) + break; + + if (__builtin_expect (len >= SIZE_MAX / 2, 0)) + { + /* This really should not happen if everything is fine. */ + res = (size_t) -1; + break; + } + + len *= 2; + } + + if (res == (size_t) -1) + { + /* The string cannot be converted. */ + if (use_malloc) + { + free (wmessage); + use_malloc = false; + } + wmessage = (wchar_t *) L"???"; + } + + __vfwprintf (stderr, wmessage, args); + + if (use_malloc) + free (wmessage); + } + else +#endif + vfprintf (stderr, message, args); + va_end (args); + + ++error_message_count; + if (errnum) + print_errno_message (errnum); +#if _LIBC + __fxprintf (NULL, "\n"); +#else + putc ('\n', stderr); +#endif + fflush (stderr); + if (status) + exit (status); +} + + +/* Print the program name and error message MESSAGE, which is a printf-style + format string with optional args. + If ERRNUM is nonzero, print its corresponding system error message. + Exit with status STATUS if it is nonzero. */ +void +error (int status, int errnum, const char *message, ...) +{ + va_list args; + +#if defined _LIBC && defined __libc_ptf_call + /* We do not want this call to be cut short by a thread + cancellation. Therefore disable cancellation for now. */ + int state = PTHREAD_CANCEL_ENABLE; + __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), + 0); +#endif + + fflush (stdout); +#ifdef _LIBC + _IO_flockfile (stderr); +#endif + if (error_print_progname) + (*error_print_progname) (); + else + { +#if _LIBC + __fxprintf (NULL, "%s: ", program_name); +#else + fprintf (stderr, "%s: ", program_name); +#endif + } + + va_start (args, message); + error_tail (status, errnum, message, args); + +#ifdef _LIBC + _IO_funlockfile (stderr); +# ifdef __libc_ptf_call + __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); +# endif +#endif +} + +/* Sometimes we want to have at most one error per line. This + variable controls whether this mode is selected or not. */ +int error_one_per_line; + +void +error_at_line (int status, int errnum, const char *file_name, + unsigned int line_number, const char *message, ...) +{ + va_list args; + + if (error_one_per_line) + { + static const char *old_file_name; + static unsigned int old_line_number; + + if (old_line_number == line_number + && (file_name == old_file_name + || strcmp (old_file_name, file_name) == 0)) + /* Simply return and print nothing. */ + return; + + old_file_name = file_name; + old_line_number = line_number; + } + +#if defined _LIBC && defined __libc_ptf_call + /* We do not want this call to be cut short by a thread + cancellation. Therefore disable cancellation for now. */ + int state = PTHREAD_CANCEL_ENABLE; + __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), + 0); +#endif + + fflush (stdout); +#ifdef _LIBC + _IO_flockfile (stderr); +#endif + if (error_print_progname) + (*error_print_progname) (); + else + { +#if _LIBC + __fxprintf (NULL, "%s:", program_name); +#else + fprintf (stderr, "%s:", program_name); +#endif + } + +#if _LIBC + __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ", + file_name, line_number); +#else + fprintf (stderr, file_name != NULL ? "%s:%d: " : " ", + file_name, line_number); +#endif + + va_start (args, message); + error_tail (status, errnum, message, args); + +#ifdef _LIBC + _IO_funlockfile (stderr); +# ifdef __libc_ptf_call + __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); +# endif +#endif +} + +#ifdef _LIBC +/* Make the weak alias. */ +# undef error +# undef error_at_line +weak_alias (__error, error) +weak_alias (__error_at_line, error_at_line) +#endif diff --git a/lib/error.h b/lib/error.h new file mode 100644 index 0000000..5a5f247 --- /dev/null +++ b/lib/error.h @@ -0,0 +1,66 @@ +/* Declaration for error-reporting function + Copyright (C) 1995, 1996, 1997, 2003, 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) + any 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 _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__ +# 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 + +/* Print a message with `fprintf (stderr, FORMAT, ...)'; + if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). + If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ + +extern void error (int __status, int __errnum, const char *__format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); + +extern void error_at_line (int __status, int __errnum, const char *__fname, + unsigned int __lineno, const char *__format, ...) + __attribute__ ((__format__ (__printf__, 5, 6))); + +/* If NULL, error will flush stdout, then print on stderr the program + name, a colon and a space. Otherwise, error will call this + function without parameters instead. */ +extern void (*error_print_progname) (void); + +/* This variable is incremented each time `error' is called. */ +extern unsigned int error_message_count; + +/* Sometimes we want to have at most one error per line. This + variable controls whether this mode is selected or not. */ +extern int error_one_per_line; + +#ifdef __cplusplus +} +#endif + +#endif /* error.h */ diff --git a/lib/exitfail.c b/lib/exitfail.c new file mode 100644 index 0000000..373d325 --- /dev/null +++ b/lib/exitfail.c @@ -0,0 +1,26 @@ +/* Failure exit status + + 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; see the file COPYING. + If not, write to the Free Software Foundation, + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include + +#include "exitfail.h" + +#include + +int volatile exit_failure = EXIT_FAILURE; diff --git a/lib/exitfail.h b/lib/exitfail.h new file mode 100644 index 0000000..e46cf9c --- /dev/null +++ b/lib/exitfail.h @@ -0,0 +1,20 @@ +/* Failure exit status + + Copyright (C) 2002 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. */ + +extern int volatile exit_failure; diff --git a/lib/fatal.c b/lib/fatal.c new file mode 100644 index 0000000..bcce42c --- /dev/null +++ b/lib/fatal.c @@ -0,0 +1,27 @@ +/* This file is part of GNU cpio. + 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 +#include + +void +fatal_exit () +{ + exit (PAXEXIT_FAILURE); +} + diff --git a/lib/fchdir.c b/lib/fchdir.c new file mode 100644 index 0000000..e3ec2fc --- /dev/null +++ b/lib/fchdir.c @@ -0,0 +1,279 @@ +/* fchdir replacement. + 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. */ + +#include + +/* Specification. */ +#include + +#include +#include +#include +#include +#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. */ + +/* Array of file descriptors opened. If it points to a directory, it stores + info about this directory; otherwise it stores an errno value of ENOTDIR. */ +typedef struct +{ + char *name; /* Absolute name of the directory, or NULL. */ + int saved_errno; /* If name == NULL: The error code describing the failure + reason. */ +} dir_info_t; +static dir_info_t *dirs; +static size_t dirs_allocated; + +/* Try to ensure dirs has enough room for a slot at index fd. */ +static void +ensure_dirs_slot (size_t fd) +{ + if (fd >= dirs_allocated) + { + size_t new_allocated; + dir_info_t *new_dirs; + size_t i; + + new_allocated = 2 * dirs_allocated + 1; + if (new_allocated <= fd) + new_allocated = fd + 1; + new_dirs = + (dirs != NULL + ? (dir_info_t *) realloc (dirs, new_allocated * sizeof (dir_info_t)) + : (dir_info_t *) malloc (new_allocated * sizeof (dir_info_t))); + if (new_dirs != NULL) + { + for (i = dirs_allocated; i < new_allocated; i++) + { + new_dirs[i].name = NULL; + new_dirs[i].saved_errno = ENOTDIR; + } + dirs = new_dirs; + dirs_allocated = new_allocated; + } + } +} + +/* Override open() and close(), to keep track of the open file descriptors. */ + +int +close (int fd) +#undef close +{ + int retval = close (fd); + + 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; + } + return retval; +} + +int +open (const char *filename, int flags, ...) +#undef open +{ + mode_t mode; + int fd; + struct stat statbuf; + + 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); + } + 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) +#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; + } + return retval; +} + +DIR * +opendir (const char *filename) +#undef opendir +{ + DIR *dp; + + dp = opendir (filename); + if (dp != NULL) + { + 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; + } + } + } + return dp; +} + +/* Override dup() and dup2(), to keep track of open file descriptors. */ + +int +dup (int oldfd) +#undef dup +{ + int newfd = dup (oldfd); + + if (oldfd >= 0 && newfd >= 0) + { + ensure_dirs_slot (newfd); + if (newfd < dirs_allocated) + { + if (oldfd < dirs_allocated) + { + if (dirs[oldfd].name != NULL) + { + dirs[newfd].name = strdup (dirs[oldfd].name); + if (dirs[newfd].name == NULL) + dirs[newfd].saved_errno = ENOMEM; + } + else + { + dirs[newfd].name = NULL; + dirs[newfd].saved_errno = dirs[oldfd].saved_errno; + } + } + else + { + dirs[newfd].name = NULL; + dirs[newfd].saved_errno = ENOMEM; + } + } + } + return newfd; +} + +int +dup2 (int oldfd, int newfd) +#undef dup2 +{ + int retval = dup2 (oldfd, newfd); + + if (retval >= 0 && oldfd >= 0 && newfd >= 0 && newfd != oldfd) + { + ensure_dirs_slot (newfd); + if (newfd < dirs_allocated) + { + if (oldfd < dirs_allocated) + { + if (dirs[oldfd].name != NULL) + { + dirs[newfd].name = strdup (dirs[oldfd].name); + if (dirs[newfd].name == NULL) + dirs[newfd].saved_errno = ENOMEM; + } + else + { + dirs[newfd].name = NULL; + dirs[newfd].saved_errno = dirs[oldfd].saved_errno; + } + } + else + { + dirs[newfd].name = NULL; + dirs[newfd].saved_errno = ENOMEM; + } + } + } + return retval; +} + +/* Implement fchdir() in terms of chdir(). */ + +int +fchdir (int fd) +{ + if (fd >= 0) + { + if (fd < dirs_allocated) + { + if (dirs[fd].name != NULL) + return chdir (dirs[fd].name); + else + { + errno = dirs[fd].saved_errno; + return -1; + } + } + else + { + errno = ENOMEM; + return -1; + } + } + else + { + errno = EBADF; + return -1; + } +} diff --git a/lib/fchmodat.c b/lib/fchmodat.c new file mode 100644 index 0000000..2598b70 --- /dev/null +++ b/lib/fchmodat.c @@ -0,0 +1,50 @@ +/* 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 + it under the 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 "openat.h" +#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ +#include "save-cwd.h" +#include "openat-priv.h" + +#ifndef HAVE_LCHMOD +/* Use a different name, to avoid conflicting with any + system-supplied declaration. */ +# undef lchmod +# define lchmod lchmod_rpl +static int lchmod (char const *f, mode_t m) { errno = ENOSYS; return -1; } +#endif + +/* Solaris 10 has no function like this. + Invoke chmod or lchmod on file, FILE, using mode MODE, in the directory + open on descriptor FD. If possible, do it without changing the + working directory. Otherwise, resort to using save_cwd/fchdir, + then mkdir/restore_cwd. If either the save_cwd or the restore_cwd + fails, then give a diagnostic and exit nonzero. + Note that an attempt to use a FLAG value of AT_SYMLINK_NOFOLLOW + on a system without lchmod support causes this function to fail. */ + +#define AT_FUNC_NAME fchmodat +#define AT_FUNC_F1 lchmod +#define AT_FUNC_F2 chmod +#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW +#define AT_FUNC_POST_FILE_PARAM_DECLS , mode_t mode, int flag +#define AT_FUNC_POST_FILE_ARGS , mode +#include "at-func.c" diff --git a/lib/fchown-stub.c b/lib/fchown-stub.c new file mode 100644 index 0000000..6be750b --- /dev/null +++ b/lib/fchown-stub.c @@ -0,0 +1,16 @@ +#include + +#include +#include + +/* A trivial substitute for `fchown'. + + DJGPP 2.03 and earlier (and perhaps later) don't have `fchown', + so we pretend no-one has permission for this operation. */ + +int +fchown (int fd, uid_t uid, gid_t gid) +{ + errno = EPERM; + return -1; +} diff --git a/lib/fchownat.c b/lib/fchownat.c new file mode 100644 index 0000000..801c92a --- /dev/null +++ b/lib/fchownat.c @@ -0,0 +1,50 @@ +/* This function serves as replacement for a missing fchownat function, + as well as a work around for the fchownat bug in glibc-2.4: + + when the buggy fchownat-with-AT_SYMLINK_NOFOLLOW operates on a symlink, it + mistakenly affects the symlink referent, rather than the symlink itself. + + 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. */ + +/* written by Jim Meyering */ + +#include + +#include "openat.h" + +#include + +#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ +#include "lchown.h" +#include "save-cwd.h" +#include "openat-priv.h" + +/* Replacement for Solaris' function by the same name. + Invoke chown or lchown on file, FILE, using OWNER and GROUP, in the + directory open on descriptor FD. If FLAG is AT_SYMLINK_NOFOLLOW, then + use lchown, otherwise, use chown. If possible, do it without changing + the working directory. Otherwise, resort to using save_cwd/fchdir, + then mkdir/restore_cwd. If either the save_cwd or the restore_cwd + fails, then give a diagnostic and exit nonzero. */ + +#define AT_FUNC_NAME fchownat +#define AT_FUNC_F1 lchown +#define AT_FUNC_F2 chown +#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW +#define AT_FUNC_POST_FILE_PARAM_DECLS , uid_t owner, gid_t group, int flag +#define AT_FUNC_POST_FILE_ARGS , owner, group +#include "at-func.c" diff --git a/lib/fcntl--.h b/lib/fcntl--.h new file mode 100644 index 0000000..51b869e --- /dev/null +++ b/lib/fcntl--.h @@ -0,0 +1,28 @@ +/* Like fcntl.h, but redefine some names to avoid glitches. + + 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 "fcntl-safer.h" + +#undef open +#define open open_safer + +#undef creat +#define creat creat_safer diff --git a/lib/fcntl-safer.h b/lib/fcntl-safer.h new file mode 100644 index 0000000..cab6aab --- /dev/null +++ b/lib/fcntl-safer.h @@ -0,0 +1,24 @@ +/* Invoke fcntl-like functions, but avoid some glitches. + + 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 + +int open_safer (char const *, int, ...); +int creat_safer (char const *, mode_t); diff --git a/lib/fcntl_.h b/lib/fcntl_.h new file mode 100644 index 0000000..1330cde --- /dev/null +++ b/lib/fcntl_.h @@ -0,0 +1,125 @@ +/* Like , but with non-working flags defined to 0. + + 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. */ + +/* written by Paul Eggert */ + +#ifndef _GL_FCNTL_H + +#include +#include +#include +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_FCNTL_H@ +#endif + +#ifndef _GL_FCNTL_H +#define _GL_FCNTL_H + + +/* Declare overridden functions. */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef FCHDIR_REPLACEMENT +# define open rpl_open +extern int open (const char *, int, ...); +#endif + +#ifdef __cplusplus +} +#endif + + +/* Fix up the O_* macros. */ + +#if !defined O_DIRECT && defined O_DIRECTIO +/* Tru64 spells it `O_DIRECTIO'. */ +# define O_DIRECT O_DIRECTIO +#endif + +#ifndef O_DIRECT +# define O_DIRECT 0 +#endif + +#ifndef O_DIRECTORY +# define O_DIRECTORY 0 +#endif + +#ifndef O_DSYNC +# define O_DSYNC 0 +#endif + +#ifndef O_NDELAY +# define O_NDELAY 0 +#endif + +#ifndef O_NOATIME +# define O_NOATIME 0 +#endif + +#ifndef O_NONBLOCK +# define O_NONBLOCK O_NDELAY +#endif + +#ifndef O_NOCTTY +# define O_NOCTTY 0 +#endif + +#ifndef O_NOFOLLOW +# define O_NOFOLLOW 0 +#endif + +#ifndef O_NOLINKS +# define O_NOLINKS 0 +#endif + +#ifndef O_RSYNC +# define O_RSYNC 0 +#endif + +#ifndef O_SYNC +# define O_SYNC 0 +#endif + +/* For systems that distinguish between text and binary I/O. + O_BINARY is usually declared in fcntl.h */ +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +# define O_TEXT _O_TEXT +#endif + +#ifdef __BEOS__ + /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +# undef O_TEXT +#endif + +#ifndef O_BINARY +# define O_BINARY 0 +# define O_TEXT 0 +#endif + + +#endif /* _GL_FCNTL_H */ +#endif /* _GL_FCNTL_H */ diff --git a/lib/fd-safer.c b/lib/fd-safer.c new file mode 100644 index 0000000..256bfa4 --- /dev/null +++ b/lib/fd-safer.c @@ -0,0 +1,57 @@ +/* Return a safer copy of a file descriptor. + + Copyright (C) 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) + any 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 "unistd-safer.h" + +#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 + failure to duplicate, close FD, set errno, and return -1. Preserve + errno if FD is negative, so that the caller can always inspect + errno when the returned value is negative. + + This function is usefully wrapped around functions that return file + descriptors, e.g., fd_safer (open ("file", O_RDONLY)). */ + +int +fd_safer (int fd) +{ + if (STDIN_FILENO <= fd && fd <= STDERR_FILENO) + { + int f = dup_safer (fd); + int e = errno; + close (fd); + errno = e; + fd = f; + } + + return fd; +} diff --git a/lib/fileblocks.c b/lib/fileblocks.c new file mode 100644 index 0000000..4024d1e --- /dev/null +++ b/lib/fileblocks.c @@ -0,0 +1,75 @@ +/* Convert file size to number of blocks on System V-like machines. + + 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 + it under the 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 Brian L. Matthews, blm@6sceng.UUCP. */ + +#include + +#include + +#if HAVE_SYS_PARAM_H +# include +#endif + +#if !HAVE_STRUCT_STAT_ST_BLOCKS && !defined _POSIX_SOURCE && defined BSIZE + +# include + +# ifndef NINDIR + +# if defined __DJGPP__ +typedef long daddr_t; /* for disk address */ +# endif + +/* Some SysV's, like Irix, seem to lack this. Hope it's correct. */ +/* Number of inode pointers per indirect block. */ +# define NINDIR (BSIZE / sizeof (daddr_t)) +# endif /* !NINDIR */ + +/* Number of direct block addresses in an inode. */ +# define NDIR 10 + +/* Return the number of 512-byte blocks in a file of SIZE bytes. */ + +off_t +st_blocks (off_t size) +{ + off_t datablks = size / 512 + (size % 512 != 0); + off_t indrblks = 0; + + if (datablks > NDIR) + { + indrblks = (datablks - NDIR - 1) / NINDIR + 1; + + if (datablks > NDIR + NINDIR) + { + indrblks += (datablks - NDIR - NINDIR - 1) / (NINDIR * NINDIR) + 1; + + if (datablks > NDIR + NINDIR + NINDIR * NINDIR) + indrblks++; + } + } + + return datablks + indrblks; +} +#else +/* This declaration is solely to ensure that after preprocessing + this file is never empty. */ +typedef int textutils_fileblocks_unused; +#endif diff --git a/lib/float+.h b/lib/float+.h new file mode 100644 index 0000000..4de25a9 --- /dev/null +++ b/lib/float+.h @@ -0,0 +1,148 @@ +/* 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 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 _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/lib/float_.h b/lib/float_.h new file mode 100644 index 0000000..d898d85 --- /dev/null +++ b/lib/float_.h @@ -0,0 +1,63 @@ +/* A correct . + + 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. */ + +#ifndef _GL_FLOAT_H + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_FLOAT_H@ +#endif + +#ifndef _GL_FLOAT_H +#define _GL_FLOAT_H + +/* 'long double' properties. */ +#if defined __i386__ && defined __BEOS__ +/* 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/lib/fnmatch.c b/lib/fnmatch.c new file mode 100644 index 0000000..02dd365 --- /dev/null +++ b/lib/fnmatch.c @@ -0,0 +1,354 @@ +/* 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) + any 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 _LIBC +# include +#endif + +/* Enable GNU extensions in fnmatch.h. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#if ! defined __builtin_expect && __GNUC__ < 3 +# define __builtin_expect(expr, expected) (expr) +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#define WIDE_CHAR_SUPPORT \ + (HAVE_WCTYPE_H && HAVE_BTOWC && HAVE_ISWCTYPE \ + && HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY)) + +/* For platform which support the ISO C amendement 1 functionality we + support user defined character classes. */ +#if defined _LIBC || WIDE_CHAR_SUPPORT +# include +# include +#endif + +/* We need some of the locale data (the collation sequence information) + but there is no interface to get this information in general. Therefore + we support a correct implementation only in glibc. */ +#ifdef _LIBC +# include "../locale/localeinfo.h" +# include "../locale/elem-hash.h" +# include "../locale/coll-lookup.h" +# include + +# define CONCAT(a,b) __CONCAT(a,b) +# define mbsrtowcs __mbsrtowcs +# define fnmatch __fnmatch +extern int fnmatch (const char *pattern, const char *string, int flags); +#endif + +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + +/* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set. */ +#define NO_LEADING_PERIOD(flags) \ + ((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD)) + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself, and have not detected a bug + in the library. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU + + +# if ! (defined isblank || HAVE_DECL_ISBLANK) +# define isblank(c) ((c) == ' ' || (c) == '\t') +# endif + +# define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) + +# if defined _LIBC || WIDE_CHAR_SUPPORT +/* The GNU C library provides support for user-defined character classes + and the functions from ISO C amendement 1. */ +# ifdef CHARCLASS_NAME_MAX +# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX +# else +/* This shouldn't happen but some implementation might still have this + problem. Use a reasonable default value. */ +# define CHAR_CLASS_MAX_LENGTH 256 +# endif + +# ifdef _LIBC +# define IS_CHAR_CLASS(string) __wctype (string) +# else +# define IS_CHAR_CLASS(string) wctype (string) +# endif + +# ifdef _LIBC +# define ISWCTYPE(WC, WT) __iswctype (WC, WT) +# else +# define ISWCTYPE(WC, WT) iswctype (WC, WT) +# endif + +# if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC +/* In this case we are implementing the multibyte character handling. */ +# define HANDLE_MULTIBYTE 1 +# endif + +# else +# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ + +# define IS_CHAR_CLASS(string) \ + (STREQ (string, "alpha") || STREQ (string, "upper") \ + || STREQ (string, "lower") || STREQ (string, "digit") \ + || STREQ (string, "alnum") || STREQ (string, "xdigit") \ + || STREQ (string, "space") || STREQ (string, "print") \ + || STREQ (string, "punct") || STREQ (string, "graph") \ + || STREQ (string, "cntrl") || STREQ (string, "blank")) +# endif + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +/* Global variable. */ +static int posixly_correct; + +# ifndef internal_function +/* Inside GNU libc we mark some function in a special way. In other + environments simply ignore the marking. */ +# define internal_function +# endif + +/* Note that this evaluates C many times. */ +# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c)) +# define CHAR char +# define UCHAR unsigned char +# define INT int +# define FCT internal_fnmatch +# define EXT ext_match +# define END end_pattern +# define L_(CS) CS +# ifdef _LIBC +# define BTOWC(C) __btowc (C) +# else +# define BTOWC(C) btowc (C) +# endif +# define STRLEN(S) strlen (S) +# define STRCAT(D, S) strcat (D, S) +# ifdef _LIBC +# define MEMPCPY(D, S, N) __mempcpy (D, S, N) +# else +# if HAVE_MEMPCPY +# define MEMPCPY(D, S, N) mempcpy (D, S, N) +# else +# define MEMPCPY(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) +# endif +# endif +# define MEMCHR(S, C, N) memchr (S, C, N) +# define STRCOLL(S1, S2) strcoll (S1, S2) +# include "fnmatch_loop.c" + + +# if HANDLE_MULTIBYTE +# define FOLD(c) ((flags & FNM_CASEFOLD) ? towlower (c) : (c)) +# define CHAR wchar_t +# define UCHAR wint_t +# define INT wint_t +# define FCT internal_fnwmatch +# define EXT ext_wmatch +# define END end_wpattern +# define L_(CS) L##CS +# define BTOWC(C) (C) +# ifdef _LIBC +# define STRLEN(S) __wcslen (S) +# define STRCAT(D, S) __wcscat (D, S) +# define MEMPCPY(D, S, N) __wmempcpy (D, S, N) +# else +# define STRLEN(S) wcslen (S) +# define STRCAT(D, S) wcscat (D, S) +# if HAVE_WMEMPCPY +# define MEMPCPY(D, S, N) wmempcpy (D, S, N) +# else +# define MEMPCPY(D, S, N) (wmemcpy (D, S, N) + (N)) +# endif +# endif +# define MEMCHR(S, C, N) wmemchr (S, C, N) +# define STRCOLL(S1, S2) wcscoll (S1, S2) +# define WIDE_CHAR_VERSION 1 + +# undef IS_CHAR_CLASS +/* We have to convert the wide character string in a multibyte string. But + we know that the character class names consist of alphanumeric characters + from the portable character set, and since the wide character encoding + for a member of the portable character set is the same code point as + its single-byte encoding, we can use a simplified method to convert the + string to a multibyte character string. */ +static wctype_t +is_char_class (const wchar_t *wcs) +{ + char s[CHAR_CLASS_MAX_LENGTH + 1]; + char *cp = s; + + do + { + /* Test for a printable character from the portable character set. */ +# ifdef _LIBC + if (*wcs < 0x20 || *wcs > 0x7e + || *wcs == 0x24 || *wcs == 0x40 || *wcs == 0x60) + return (wctype_t) 0; +# else + switch (*wcs) + { + case L' ': case L'!': case L'"': case L'#': case L'%': + case L'&': case L'\'': case L'(': case L')': case L'*': + case L'+': case L',': case L'-': case L'.': case L'/': + case L'0': case L'1': case L'2': case L'3': case L'4': + case L'5': case L'6': case L'7': case L'8': case L'9': + case L':': case L';': case L'<': case L'=': case L'>': + case L'?': + case L'A': case L'B': case L'C': case L'D': case L'E': + case L'F': case L'G': case L'H': case L'I': case L'J': + case L'K': case L'L': case L'M': case L'N': case L'O': + case L'P': case L'Q': case L'R': case L'S': case L'T': + case L'U': case L'V': case L'W': case L'X': case L'Y': + case L'Z': + case L'[': case L'\\': case L']': case L'^': case L'_': + case L'a': case L'b': case L'c': case L'd': case L'e': + case L'f': case L'g': case L'h': case L'i': case L'j': + case L'k': case L'l': case L'm': case L'n': case L'o': + case L'p': case L'q': case L'r': case L's': case L't': + case L'u': case L'v': case L'w': case L'x': case L'y': + case L'z': case L'{': case L'|': case L'}': case L'~': + break; + default: + return (wctype_t) 0; + } +# endif + + /* Avoid overrunning the buffer. */ + if (cp == s + CHAR_CLASS_MAX_LENGTH) + return (wctype_t) 0; + + *cp++ = (char) *wcs++; + } + while (*wcs != L'\0'); + + *cp = '\0'; + +# ifdef _LIBC + return __wctype (s); +# else + return wctype (s); +# endif +} +# define IS_CHAR_CLASS(string) is_char_class (string) + +# include "fnmatch_loop.c" +# endif + + +int +fnmatch (const char *pattern, const char *string, int flags) +{ +# if HANDLE_MULTIBYTE +# define ALLOCA_LIMIT 2000 + if (__builtin_expect (MB_CUR_MAX, 1) != 1) + { + mbstate_t ps; + size_t patsize; + size_t strsize; + size_t totsize; + wchar_t *wpattern; + wchar_t *wstring; + int res; + + /* Calculate the size needed to convert the strings to + wide characters. */ + memset (&ps, '\0', sizeof (ps)); + patsize = mbsrtowcs (NULL, &pattern, 0, &ps) + 1; + if (__builtin_expect (patsize != 0, 1)) + { + assert (mbsinit (&ps)); + strsize = mbsrtowcs (NULL, &string, 0, &ps) + 1; + if (__builtin_expect (strsize != 0, 1)) + { + assert (mbsinit (&ps)); + totsize = patsize + strsize; + if (__builtin_expect (! (patsize <= totsize + && totsize <= SIZE_MAX / sizeof (wchar_t)), + 0)) + { + errno = ENOMEM; + return -1; + } + + /* Allocate room for the wide characters. */ + if (__builtin_expect (totsize < ALLOCA_LIMIT, 1)) + wpattern = (wchar_t *) alloca (totsize * sizeof (wchar_t)); + else + { + wpattern = malloc (totsize * sizeof (wchar_t)); + if (__builtin_expect (! wpattern, 0)) + { + errno = ENOMEM; + return -1; + } + } + wstring = wpattern + patsize; + + /* Convert the strings into wide characters. */ + mbsrtowcs (wpattern, &pattern, patsize, &ps); + assert (mbsinit (&ps)); + mbsrtowcs (wstring, &string, strsize, &ps); + + res = internal_fnwmatch (wpattern, wstring, wstring + strsize - 1, + flags & FNM_PERIOD, flags); + + if (__builtin_expect (! (totsize < ALLOCA_LIMIT), 0)) + free (wpattern); + return res; + } + } + } + +# endif /* HANDLE_MULTIBYTE */ + + return internal_fnmatch (pattern, string, string + strlen (string), + flags & FNM_PERIOD, flags); +} + +# ifdef _LIBC +# undef fnmatch +versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3); +# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_3) +strong_alias (__fnmatch, __fnmatch_old) +compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0); +# endif +libc_hidden_ver (__fnmatch, fnmatch) +# endif + +#endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/lib/fnmatch_.h b/lib/fnmatch_.h new file mode 100644 index 0000000..b086b45 --- /dev/null +++ b/lib/fnmatch_.h @@ -0,0 +1,65 @@ +/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003, + 2005, 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) + any 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 _FNMATCH_H +#define _FNMATCH_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* We #undef these before defining them because some losing systems + (HP-UX A.08.07 for example) define these in . */ +#undef FNM_PATHNAME +#undef FNM_NOESCAPE +#undef FNM_PERIOD + +/* Bits set in the FLAGS argument to `fnmatch'. */ +#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ +#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ +#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ + +#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE +# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ +# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ +# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ +# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ +#endif + +/* Value returned by `fnmatch' if STRING does not match PATTERN. */ +#define FNM_NOMATCH 1 + +/* This value is returned if the implementation does not support + `fnmatch'. Since this is not the case here it will never be + returned but the conformance test suites still require the symbol + to be defined. */ +#ifdef _XOPEN_SOURCE +# define FNM_NOSYS (-1) +#endif + +/* Match NAME against the file name pattern PATTERN, + returning zero if it matches, FNM_NOMATCH if not. */ +extern int fnmatch (const char *__pattern, const char *__name, + int __flags); + +#ifdef __cplusplus +} +#endif + +#endif /* fnmatch.h */ diff --git a/lib/fnmatch_loop.c b/lib/fnmatch_loop.c new file mode 100644 index 0000000..d1008c2 --- /dev/null +++ b/lib/fnmatch_loop.c @@ -0,0 +1,1210 @@ +/* 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) + any 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. */ + +/* Match STRING against the file name pattern PATTERN, returning zero if + it matches, nonzero if not. */ +static int EXT (INT opt, const CHAR *pattern, const CHAR *string, + const CHAR *string_end, bool no_leading_period, int flags) + internal_function; +static const CHAR *END (const CHAR *patternp) internal_function; + +static int +internal_function +FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, + bool no_leading_period, int flags) +{ + register const CHAR *p = pattern, *n = string; + register UCHAR c; +#ifdef _LIBC +# if WIDE_CHAR_VERSION + const char *collseq = (const char *) + _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC); +# else + const UCHAR *collseq = (const UCHAR *) + _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQMB); +# endif +#endif + + while ((c = *p++) != L_('\0')) + { + bool new_no_leading_period = false; + c = FOLD (c); + + switch (c) + { + case L_('?'): + if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(') + { + int res; + + res = EXT (c, p, n, string_end, no_leading_period, + flags); + if (res != -1) + return res; + } + + if (n == string_end) + return FNM_NOMATCH; + else if (*n == L_('/') && (flags & FNM_FILE_NAME)) + return FNM_NOMATCH; + else if (*n == L_('.') && no_leading_period) + return FNM_NOMATCH; + break; + + case L_('\\'): + if (!(flags & FNM_NOESCAPE)) + { + c = *p++; + if (c == L_('\0')) + /* Trailing \ loses. */ + return FNM_NOMATCH; + c = FOLD (c); + } + if (n == string_end || FOLD ((UCHAR) *n) != c) + return FNM_NOMATCH; + break; + + case L_('*'): + if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(') + { + int res; + + res = EXT (c, p, n, string_end, no_leading_period, + flags); + if (res != -1) + return res; + } + + if (n != string_end && *n == L_('.') && no_leading_period) + return FNM_NOMATCH; + + for (c = *p++; c == L_('?') || c == L_('*'); c = *p++) + { + if (*p == L_('(') && (flags & FNM_EXTMATCH) != 0) + { + const CHAR *endp = END (p); + if (endp != p) + { + /* This is a pattern. Skip over it. */ + p = endp; + continue; + } + } + + if (c == L_('?')) + { + /* A ? needs to match one character. */ + if (n == string_end) + /* There isn't another character; no match. */ + return FNM_NOMATCH; + else if (*n == L_('/') + && __builtin_expect (flags & FNM_FILE_NAME, 0)) + /* A slash does not match a wildcard under + FNM_FILE_NAME. */ + return FNM_NOMATCH; + else + /* One character of the string is consumed in matching + this ? wildcard, so *??? won't match if there are + less than three characters. */ + ++n; + } + } + + if (c == L_('\0')) + /* The wildcard(s) is/are the last element of the pattern. + If the name is a file name and contains another slash + this means it cannot match, unless the FNM_LEADING_DIR + flag is set. */ + { + int result = (flags & FNM_FILE_NAME) == 0 ? 0 : FNM_NOMATCH; + + if (flags & FNM_FILE_NAME) + { + if (flags & FNM_LEADING_DIR) + result = 0; + else + { + if (MEMCHR (n, L_('/'), string_end - n) == NULL) + result = 0; + } + } + + return result; + } + else + { + const CHAR *endp; + + endp = MEMCHR (n, (flags & FNM_FILE_NAME) ? L_('/') : L_('\0'), + string_end - n); + if (endp == NULL) + endp = string_end; + + if (c == L_('[') + || (__builtin_expect (flags & FNM_EXTMATCH, 0) != 0 + && (c == L_('@') || c == L_('+') || c == L_('!')) + && *p == L_('('))) + { + int flags2 = ((flags & FNM_FILE_NAME) + ? flags : (flags & ~FNM_PERIOD)); + bool no_leading_period2 = no_leading_period; + + for (--p; n < endp; ++n, no_leading_period2 = false) + if (FCT (p, n, string_end, no_leading_period2, flags2) + == 0) + return 0; + } + else if (c == L_('/') && (flags & FNM_FILE_NAME)) + { + while (n < string_end && *n != L_('/')) + ++n; + if (n < string_end && *n == L_('/') + && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags) + == 0)) + return 0; + } + else + { + int flags2 = ((flags & FNM_FILE_NAME) + ? flags : (flags & ~FNM_PERIOD)); + int no_leading_period2 = no_leading_period; + + if (c == L_('\\') && !(flags & FNM_NOESCAPE)) + c = *p; + c = FOLD (c); + for (--p; n < endp; ++n, no_leading_period2 = false) + if (FOLD ((UCHAR) *n) == c + && (FCT (p, n, string_end, no_leading_period2, flags2) + == 0)) + return 0; + } + } + + /* If we come here no match is possible with the wildcard. */ + return FNM_NOMATCH; + + case L_('['): + { + /* Nonzero if the sense of the character class is inverted. */ + register bool not; + CHAR cold; + UCHAR fn; + + if (posixly_correct == 0) + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; + + if (n == string_end) + return FNM_NOMATCH; + + if (*n == L_('.') && no_leading_period) + return FNM_NOMATCH; + + if (*n == L_('/') && (flags & FNM_FILE_NAME)) + /* `/' cannot be matched. */ + return FNM_NOMATCH; + + not = (*p == L_('!') || (posixly_correct < 0 && *p == L_('^'))); + if (not) + ++p; + + fn = FOLD ((UCHAR) *n); + + c = *p++; + for (;;) + { + if (!(flags & FNM_NOESCAPE) && c == L_('\\')) + { + if (*p == L_('\0')) + return FNM_NOMATCH; + c = FOLD ((UCHAR) *p); + ++p; + + goto normal_bracket; + } + else if (c == L_('[') && *p == L_(':')) + { + /* Leave room for the null. */ + CHAR str[CHAR_CLASS_MAX_LENGTH + 1]; + size_t c1 = 0; +#if defined _LIBC || WIDE_CHAR_SUPPORT + wctype_t wt; +#endif + const CHAR *startp = p; + + for (;;) + { + if (c1 == CHAR_CLASS_MAX_LENGTH) + /* The name is too long and therefore the pattern + is ill-formed. */ + return FNM_NOMATCH; + + c = *++p; + if (c == L_(':') && p[1] == L_(']')) + { + p += 2; + break; + } + if (c < L_('a') || c >= L_('z')) + { + /* This cannot possibly be a character class name. + Match it as a normal range. */ + p = startp; + c = L_('['); + goto normal_bracket; + } + str[c1++] = c; + } + str[c1] = L_('\0'); + +#if defined _LIBC || WIDE_CHAR_SUPPORT + wt = IS_CHAR_CLASS (str); + if (wt == 0) + /* Invalid character class name. */ + return FNM_NOMATCH; + +# if defined _LIBC && ! WIDE_CHAR_VERSION + /* The following code is glibc specific but does + there a good job in speeding up the code since + we can avoid the btowc() call. */ + if (_ISCTYPE ((UCHAR) *n, wt)) + goto matched; +# else + if (ISWCTYPE (BTOWC ((UCHAR) *n), wt)) + goto matched; +# endif +#else + if ((STREQ (str, L_("alnum")) && isalnum ((UCHAR) *n)) + || (STREQ (str, L_("alpha")) && isalpha ((UCHAR) *n)) + || (STREQ (str, L_("blank")) && isblank ((UCHAR) *n)) + || (STREQ (str, L_("cntrl")) && iscntrl ((UCHAR) *n)) + || (STREQ (str, L_("digit")) && isdigit ((UCHAR) *n)) + || (STREQ (str, L_("graph")) && isgraph ((UCHAR) *n)) + || (STREQ (str, L_("lower")) && islower ((UCHAR) *n)) + || (STREQ (str, L_("print")) && isprint ((UCHAR) *n)) + || (STREQ (str, L_("punct")) && ispunct ((UCHAR) *n)) + || (STREQ (str, L_("space")) && isspace ((UCHAR) *n)) + || (STREQ (str, L_("upper")) && isupper ((UCHAR) *n)) + || (STREQ (str, L_("xdigit")) && isxdigit ((UCHAR) *n))) + goto matched; +#endif + c = *p++; + } +#ifdef _LIBC + else if (c == L_('[') && *p == L_('=')) + { + UCHAR str[1]; + uint32_t nrules = + _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + const CHAR *startp = p; + + c = *++p; + if (c == L_('\0')) + { + p = startp; + c = L_('['); + goto normal_bracket; + } + str[0] = c; + + c = *++p; + if (c != L_('=') || p[1] != L_(']')) + { + p = startp; + c = L_('['); + goto normal_bracket; + } + p += 2; + + if (nrules == 0) + { + if ((UCHAR) *n == str[0]) + goto matched; + } + else + { + const int32_t *table; +# if WIDE_CHAR_VERSION + const int32_t *weights; + const int32_t *extra; +# else + const unsigned char *weights; + const unsigned char *extra; +# endif + const int32_t *indirect; + int32_t idx; + const UCHAR *cp = (const UCHAR *) str; + + /* This #include defines a local function! */ +# if WIDE_CHAR_VERSION +# include +# else +# include +# endif + +# if WIDE_CHAR_VERSION + table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC); + weights = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC); + extra = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC); + indirect = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC); +# else + table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); + weights = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); + indirect = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); +# endif + + idx = findidx (&cp); + if (idx != 0) + { + /* We found a table entry. Now see whether the + character we are currently at has the same + equivalance class value. */ + int len = weights[idx]; + int32_t idx2; + const UCHAR *np = (const UCHAR *) n; + + idx2 = findidx (&np); + if (idx2 != 0 && len == weights[idx2]) + { + int cnt = 0; + + while (cnt < len + && (weights[idx + 1 + cnt] + == weights[idx2 + 1 + cnt])) + ++cnt; + + if (cnt == len) + goto matched; + } + } + } + + c = *p++; + } +#endif + else if (c == L_('\0')) + /* [ (unterminated) loses. */ + return FNM_NOMATCH; + else + { + bool is_range = false; + +#ifdef _LIBC + bool is_seqval = false; + + if (c == L_('[') && *p == L_('.')) + { + uint32_t nrules = + _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + const CHAR *startp = p; + size_t c1 = 0; + + while (1) + { + c = *++p; + if (c == L_('.') && p[1] == L_(']')) + { + p += 2; + break; + } + if (c == '\0') + return FNM_NOMATCH; + ++c1; + } + + /* We have to handling the symbols differently in + ranges since then the collation sequence is + important. */ + is_range = *p == L_('-') && p[1] != L_('\0'); + + if (nrules == 0) + { + /* There are no names defined in the collation + data. Therefore we only accept the trivial + names consisting of the character itself. */ + if (c1 != 1) + return FNM_NOMATCH; + + if (!is_range && *n == startp[1]) + goto matched; + + cold = startp[1]; + c = *p++; + } + else + { + int32_t table_size; + const int32_t *symb_table; +# ifdef WIDE_CHAR_VERSION + char str[c1]; + size_t strcnt; +# else +# define str (startp + 1) +# endif + const unsigned char *extra; + int32_t idx; + int32_t elem; + int32_t second; + int32_t hash; + +# ifdef WIDE_CHAR_VERSION + /* We have to convert the name to a single-byte + string. This is possible since the names + consist of ASCII characters and the internal + representation is UCS4. */ + for (strcnt = 0; strcnt < c1; ++strcnt) + str[strcnt] = startp[1 + strcnt]; +# endif + + table_size = + _NL_CURRENT_WORD (LC_COLLATE, + _NL_COLLATE_SYMB_HASH_SIZEMB); + symb_table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_TABLEMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_EXTRAMB); + + /* Locate the character in the hashing table. */ + hash = elem_hash (str, c1); + + idx = 0; + elem = hash % table_size; + if (symb_table[2 * elem] != 0) + { + second = hash % (table_size - 2) + 1; + + do + { + /* First compare the hashing value. */ + if (symb_table[2 * elem] == hash + && (c1 + == extra[symb_table[2 * elem + 1]]) + && memcmp (str, + &extra[symb_table[2 * elem + + 1] + + 1], c1) == 0) + { + /* Yep, this is the entry. */ + idx = symb_table[2 * elem + 1]; + idx += 1 + extra[idx]; + break; + } + + /* Next entry. */ + elem += second; + } + while (symb_table[2 * elem] != 0); + } + + if (symb_table[2 * elem] != 0) + { + /* Compare the byte sequence but only if + this is not part of a range. */ +# ifdef WIDE_CHAR_VERSION + int32_t *wextra; + + idx += 1 + extra[idx]; + /* Adjust for the alignment. */ + idx = (idx + 3) & ~3; + + wextra = (int32_t *) &extra[idx + 4]; +# endif + + if (! is_range) + { +# ifdef WIDE_CHAR_VERSION + for (c1 = 0; + (int32_t) c1 < wextra[idx]; + ++c1) + if (n[c1] != wextra[1 + c1]) + break; + + if ((int32_t) c1 == wextra[idx]) + goto matched; +# else + for (c1 = 0; c1 < extra[idx]; ++c1) + if (n[c1] != extra[1 + c1]) + break; + + if (c1 == extra[idx]) + goto matched; +# endif + } + + /* Get the collation sequence value. */ + is_seqval = true; +# ifdef WIDE_CHAR_VERSION + cold = wextra[1 + wextra[idx]]; +# else + /* Adjust for the alignment. */ + idx += 1 + extra[idx]; + idx = (idx + 3) & ~4; + cold = *((int32_t *) &extra[idx]); +# endif + + c = *p++; + } + else if (c1 == 1) + { + /* No valid character. Match it as a + single byte. */ + if (!is_range && *n == str[0]) + goto matched; + + cold = str[0]; + c = *p++; + } + else + return FNM_NOMATCH; + } + } + else +# undef str +#endif + { + c = FOLD (c); + normal_bracket: + + /* We have to handling the symbols differently in + ranges since then the collation sequence is + important. */ + is_range = (*p == L_('-') && p[1] != L_('\0') + && p[1] != L_(']')); + + if (!is_range && c == fn) + goto matched; + +#if _LIBC + /* This is needed if we goto normal_bracket; from + outside of is_seqval's scope. */ + is_seqval = false; +#endif + + cold = c; + c = *p++; + } + + if (c == L_('-') && *p != L_(']')) + { +#if _LIBC + /* We have to find the collation sequence + value for C. Collation sequence is nothing + we can regularly access. The sequence + value is defined by the order in which the + definitions of the collation values for the + various characters appear in the source + file. A strange concept, nowhere + documented. */ + uint32_t fcollseq; + uint32_t lcollseq; + UCHAR cend = *p++; + +# ifdef WIDE_CHAR_VERSION + /* Search in the `names' array for the characters. */ + fcollseq = __collseq_table_lookup (collseq, fn); + if (fcollseq == ~((uint32_t) 0)) + /* XXX We don't know anything about the character + we are supposed to match. This means we are + failing. */ + goto range_not_matched; + + if (is_seqval) + lcollseq = cold; + else + lcollseq = __collseq_table_lookup (collseq, cold); +# else + fcollseq = collseq[fn]; + lcollseq = is_seqval ? cold : collseq[(UCHAR) cold]; +# endif + + is_seqval = false; + if (cend == L_('[') && *p == L_('.')) + { + uint32_t nrules = + _NL_CURRENT_WORD (LC_COLLATE, + _NL_COLLATE_NRULES); + const CHAR *startp = p; + size_t c1 = 0; + + while (1) + { + c = *++p; + if (c == L_('.') && p[1] == L_(']')) + { + p += 2; + break; + } + if (c == '\0') + return FNM_NOMATCH; + ++c1; + } + + if (nrules == 0) + { + /* There are no names defined in the + collation data. Therefore we only + accept the trivial names consisting + of the character itself. */ + if (c1 != 1) + return FNM_NOMATCH; + + cend = startp[1]; + } + else + { + int32_t table_size; + const int32_t *symb_table; +# ifdef WIDE_CHAR_VERSION + char str[c1]; + size_t strcnt; +# else +# define str (startp + 1) +# endif + const unsigned char *extra; + int32_t idx; + int32_t elem; + int32_t second; + int32_t hash; + +# ifdef WIDE_CHAR_VERSION + /* We have to convert the name to a single-byte + string. This is possible since the names + consist of ASCII characters and the internal + representation is UCS4. */ + for (strcnt = 0; strcnt < c1; ++strcnt) + str[strcnt] = startp[1 + strcnt]; +# endif + + table_size = + _NL_CURRENT_WORD (LC_COLLATE, + _NL_COLLATE_SYMB_HASH_SIZEMB); + symb_table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_TABLEMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_EXTRAMB); + + /* Locate the character in the hashing + table. */ + hash = elem_hash (str, c1); + + idx = 0; + elem = hash % table_size; + if (symb_table[2 * elem] != 0) + { + second = hash % (table_size - 2) + 1; + + do + { + /* First compare the hashing value. */ + if (symb_table[2 * elem] == hash + && (c1 + == extra[symb_table[2 * elem + 1]]) + && memcmp (str, + &extra[symb_table[2 * elem + 1] + + 1], c1) == 0) + { + /* Yep, this is the entry. */ + idx = symb_table[2 * elem + 1]; + idx += 1 + extra[idx]; + break; + } + + /* Next entry. */ + elem += second; + } + while (symb_table[2 * elem] != 0); + } + + if (symb_table[2 * elem] != 0) + { + /* Compare the byte sequence but only if + this is not part of a range. */ +# ifdef WIDE_CHAR_VERSION + int32_t *wextra; + + idx += 1 + extra[idx]; + /* Adjust for the alignment. */ + idx = (idx + 3) & ~4; + + wextra = (int32_t *) &extra[idx + 4]; +# endif + /* Get the collation sequence value. */ + is_seqval = true; +# ifdef WIDE_CHAR_VERSION + cend = wextra[1 + wextra[idx]]; +# else + /* Adjust for the alignment. */ + idx += 1 + extra[idx]; + idx = (idx + 3) & ~4; + cend = *((int32_t *) &extra[idx]); +# endif + } + else if (symb_table[2 * elem] != 0 && c1 == 1) + { + cend = str[0]; + c = *p++; + } + else + return FNM_NOMATCH; + } +# undef str + } + else + { + if (!(flags & FNM_NOESCAPE) && cend == L_('\\')) + cend = *p++; + if (cend == L_('\0')) + return FNM_NOMATCH; + cend = FOLD (cend); + } + + /* XXX It is not entirely clear to me how to handle + characters which are not mentioned in the + collation specification. */ + if ( +# ifdef WIDE_CHAR_VERSION + lcollseq == 0xffffffff || +# endif + lcollseq <= fcollseq) + { + /* We have to look at the upper bound. */ + uint32_t hcollseq; + + if (is_seqval) + hcollseq = cend; + else + { +# ifdef WIDE_CHAR_VERSION + hcollseq = + __collseq_table_lookup (collseq, cend); + if (hcollseq == ~((uint32_t) 0)) + { + /* Hum, no information about the upper + bound. The matching succeeds if the + lower bound is matched exactly. */ + if (lcollseq != fcollseq) + goto range_not_matched; + + goto matched; + } +# else + hcollseq = collseq[cend]; +# endif + } + + if (lcollseq <= hcollseq && fcollseq <= hcollseq) + goto matched; + } +# ifdef WIDE_CHAR_VERSION + range_not_matched: +# endif +#else + /* We use a boring value comparison of the character + values. This is better than comparing using + `strcoll' since the latter would have surprising + and sometimes fatal consequences. */ + UCHAR cend = *p++; + + if (!(flags & FNM_NOESCAPE) && cend == L_('\\')) + cend = *p++; + if (cend == L_('\0')) + return FNM_NOMATCH; + + /* It is a range. */ + if (cold <= fn && fn <= cend) + goto matched; +#endif + + c = *p++; + } + } + + if (c == L_(']')) + break; + } + + if (!not) + return FNM_NOMATCH; + break; + + matched: + /* Skip the rest of the [...] that already matched. */ + do + { + ignore_next: + c = *p++; + + if (c == L_('\0')) + /* [... (unterminated) loses. */ + return FNM_NOMATCH; + + if (!(flags & FNM_NOESCAPE) && c == L_('\\')) + { + if (*p == L_('\0')) + return FNM_NOMATCH; + /* XXX 1003.2d11 is unclear if this is right. */ + ++p; + } + else if (c == L_('[') && *p == L_(':')) + { + int c1 = 0; + const CHAR *startp = p; + + while (1) + { + c = *++p; + if (++c1 == CHAR_CLASS_MAX_LENGTH) + return FNM_NOMATCH; + + if (*p == L_(':') && p[1] == L_(']')) + break; + + if (c < L_('a') || c >= L_('z')) + { + p = startp; + goto ignore_next; + } + } + p += 2; + c = *p++; + } + else if (c == L_('[') && *p == L_('=')) + { + c = *++p; + if (c == L_('\0')) + return FNM_NOMATCH; + c = *++p; + if (c != L_('=') || p[1] != L_(']')) + return FNM_NOMATCH; + p += 2; + c = *p++; + } + else if (c == L_('[') && *p == L_('.')) + { + ++p; + while (1) + { + c = *++p; + if (c == '\0') + return FNM_NOMATCH; + + if (*p == L_('.') && p[1] == L_(']')) + break; + } + p += 2; + c = *p++; + } + } + while (c != L_(']')); + if (not) + return FNM_NOMATCH; + } + break; + + case L_('+'): + case L_('@'): + case L_('!'): + if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(') + { + int res; + + res = EXT (c, p, n, string_end, no_leading_period, flags); + if (res != -1) + return res; + } + goto normal_match; + + case L_('/'): + if (NO_LEADING_PERIOD (flags)) + { + if (n == string_end || c != (UCHAR) *n) + return FNM_NOMATCH; + + new_no_leading_period = true; + break; + } + /* FALLTHROUGH */ + default: + normal_match: + if (n == string_end || c != FOLD ((UCHAR) *n)) + return FNM_NOMATCH; + } + + no_leading_period = new_no_leading_period; + ++n; + } + + if (n == string_end) + return 0; + + if ((flags & FNM_LEADING_DIR) && n != string_end && *n == L_('/')) + /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ + return 0; + + return FNM_NOMATCH; +} + + +static const CHAR * +internal_function +END (const CHAR *pattern) +{ + const CHAR *p = pattern; + + while (1) + if (*++p == L_('\0')) + /* This is an invalid pattern. */ + return pattern; + else if (*p == L_('[')) + { + /* Handle brackets special. */ + if (posixly_correct == 0) + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; + + /* Skip the not sign. We have to recognize it because of a possibly + following ']'. */ + if (*++p == L_('!') || (posixly_correct < 0 && *p == L_('^'))) + ++p; + /* A leading ']' is recognized as such. */ + if (*p == L_(']')) + ++p; + /* Skip over all characters of the list. */ + while (*p != L_(']')) + if (*p++ == L_('\0')) + /* This is no valid pattern. */ + return pattern; + } + else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@') + || *p == L_('!')) && p[1] == L_('(')) + p = END (p + 1); + else if (*p == L_(')')) + break; + + return p + 1; +} + + +static int +internal_function +EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, + bool no_leading_period, int flags) +{ + const CHAR *startp; + size_t level; + struct patternlist + { + struct patternlist *next; + CHAR str[1]; + } *list = NULL; + struct patternlist **lastp = &list; + size_t pattern_len = STRLEN (pattern); + const CHAR *p; + const CHAR *rs; + enum { ALLOCA_LIMIT = 8000 }; + + /* Parse the pattern. Store the individual parts in the list. */ + level = 0; + for (startp = p = pattern + 1; ; ++p) + if (*p == L_('\0')) + /* This is an invalid pattern. */ + return -1; + else if (*p == L_('[')) + { + /* Handle brackets special. */ + if (posixly_correct == 0) + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; + + /* Skip the not sign. We have to recognize it because of a possibly + following ']'. */ + if (*++p == L_('!') || (posixly_correct < 0 && *p == L_('^'))) + ++p; + /* A leading ']' is recognized as such. */ + if (*p == L_(']')) + ++p; + /* Skip over all characters of the list. */ + while (*p != L_(']')) + if (*p++ == L_('\0')) + /* This is no valid pattern. */ + return -1; + } + else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@') + || *p == L_('!')) && p[1] == L_('(')) + /* Remember the nesting level. */ + ++level; + else if (*p == L_(')')) + { + if (level-- == 0) + { + /* This means we found the end of the pattern. */ +#define NEW_PATTERN \ + struct patternlist *newp; \ + size_t plen; \ + size_t plensize; \ + size_t newpsize; \ + \ + plen = (opt == L_('?') || opt == L_('@') \ + ? pattern_len \ + : p - startp + 1); \ + plensize = plen * sizeof (CHAR); \ + newpsize = offsetof (struct patternlist, str) + plensize; \ + if ((size_t) -1 / sizeof (CHAR) < plen \ + || newpsize < offsetof (struct patternlist, str) \ + || ALLOCA_LIMIT <= newpsize) \ + return -1; \ + newp = (struct patternlist *) alloca (newpsize); \ + *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L_('\0'); \ + newp->next = NULL; \ + *lastp = newp; \ + lastp = &newp->next + NEW_PATTERN; + break; + } + } + else if (*p == L_('|')) + { + if (level == 0) + { + NEW_PATTERN; + startp = p + 1; + } + } + assert (list != NULL); + assert (p[-1] == L_(')')); +#undef NEW_PATTERN + + switch (opt) + { + case L_('*'): + if (FCT (p, string, string_end, no_leading_period, flags) == 0) + return 0; + /* FALLTHROUGH */ + + case L_('+'): + do + { + for (rs = string; rs <= string_end; ++rs) + /* First match the prefix with the current pattern with the + current pattern. */ + if (FCT (list->str, string, rs, no_leading_period, + flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0 + /* This was successful. Now match the rest with the rest + of the pattern. */ + && (FCT (p, rs, string_end, + rs == string + ? no_leading_period + : rs[-1] == '/' && NO_LEADING_PERIOD (flags), + flags & FNM_FILE_NAME + ? flags : flags & ~FNM_PERIOD) == 0 + /* This didn't work. Try the whole pattern. */ + || (rs != string + && FCT (pattern - 1, rs, string_end, + rs == string + ? no_leading_period + : rs[-1] == '/' && NO_LEADING_PERIOD (flags), + flags & FNM_FILE_NAME + ? flags : flags & ~FNM_PERIOD) == 0))) + /* It worked. Signal success. */ + return 0; + } + while ((list = list->next) != NULL); + + /* None of the patterns lead to a match. */ + return FNM_NOMATCH; + + case L_('?'): + if (FCT (p, string, string_end, no_leading_period, flags) == 0) + return 0; + /* FALLTHROUGH */ + + case L_('@'): + do + /* I cannot believe it but `strcat' is actually acceptable + here. Match the entire string with the prefix from the + pattern list and the rest of the pattern following the + pattern list. */ + if (FCT (STRCAT (list->str, p), string, string_end, + no_leading_period, + flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0) + /* It worked. Signal success. */ + return 0; + while ((list = list->next) != NULL); + + /* None of the patterns lead to a match. */ + return FNM_NOMATCH; + + case L_('!'): + for (rs = string; rs <= string_end; ++rs) + { + struct patternlist *runp; + + for (runp = list; runp != NULL; runp = runp->next) + if (FCT (runp->str, string, rs, no_leading_period, + flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0) + break; + + /* If none of the patterns matched see whether the rest does. */ + if (runp == NULL + && (FCT (p, rs, string_end, + rs == string + ? no_leading_period + : rs[-1] == '/' && NO_LEADING_PERIOD (flags), + flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) + == 0)) + /* This is successful. */ + return 0; + } + + /* None of the patterns together with the rest of the pattern + lead to a match. */ + return FNM_NOMATCH; + + default: + assert (! "Invalid extended matching operator"); + break; + } + + return -1; +} + + +#undef FOLD +#undef CHAR +#undef UCHAR +#undef INT +#undef FCT +#undef EXT +#undef END +#undef MEMPCPY +#undef MEMCHR +#undef STRCOLL +#undef STRLEN +#undef STRCAT +#undef L_ +#undef BTOWC diff --git a/lib/fstatat.c b/lib/fstatat.c new file mode 100644 index 0000000..92a5164 --- /dev/null +++ b/lib/fstatat.c @@ -0,0 +1,57 @@ +/* Work around an fstatat bug on Solaris 9. + + 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 Paul Eggert and Jim Meyering. */ + +#include + +#define COMPILING_FSTATAT 1 +#include "openat.h" + +#include +#include + +/* fstatat should always follow symbolic links that end in /, but on + Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified. This is + the same problem that lstat.c addresses, so solve it in a similar + way. */ + +int +rpl_fstatat (int fd, char const *file, struct stat *st, int flag) +{ + int result = fstatat (fd, file, st, flag); + + if (result == 0 && (flag & AT_SYMLINK_NOFOLLOW) && S_ISLNK (st->st_mode) + && file[strlen (file) - 1] == '/') + { + /* FILE refers to a symbolic link and the name ends with a slash. + Get info about the link's referent. */ + result = fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW); + if (result == 0 && ! S_ISDIR (st->st_mode)) + { + /* fstatat succeeded and FILE references a non-directory. + But it was specified via a name including a trailing + slash. Fail with errno set to ENOTDIR to indicate the + contradiction. */ + errno = ENOTDIR; + return -1; + } + } + + return result; +} diff --git a/lib/full-write.c b/lib/full-write.c new file mode 100644 index 0000000..cc16872 --- /dev/null +++ b/lib/full-write.c @@ -0,0 +1,81 @@ +/* An interface to read and write that retries (if necessary) until complete. + + 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 + it under the 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 + +/* Specification. */ +#ifdef FULL_READ +# include "full-read.h" +#else +# include "full-write.h" +#endif + +#include + +#ifdef FULL_READ +# include "safe-read.h" +# define safe_rw safe_read +# define full_rw full_read +# undef const +# define const /* empty */ +#else +# include "safe-write.h" +# define safe_rw safe_write +# define full_rw full_write +#endif + +#ifdef FULL_READ +/* Set errno to zero upon EOF. */ +# define ZERO_BYTE_TRANSFER_ERRNO 0 +#else +/* Some buggy drivers return 0 when one tries to write beyond + a device's end. (Example: Linux 1.2.13 on /dev/fd0.) + Set errno to ENOSPC so they get a sensible diagnostic. */ +# define ZERO_BYTE_TRANSFER_ERRNO ENOSPC +#endif + +/* Write(read) COUNT bytes at BUF to(from) descriptor FD, retrying if + interrupted or if a partial write(read) occurs. Return the number + of bytes transferred. + When writing, set errno if fewer than COUNT bytes are written. + When reading, if fewer than COUNT bytes are read, you must examine + errno to distinguish failure from EOF (errno == 0). */ +size_t +full_rw (int fd, const void *buf, size_t count) +{ + size_t total = 0; + const char *ptr = (const char *) buf; + + while (count > 0) + { + size_t n_rw = safe_rw (fd, ptr, count); + if (n_rw == (size_t) -1) + break; + if (n_rw == 0) + { + errno = ZERO_BYTE_TRANSFER_ERRNO; + break; + } + total += n_rw; + ptr += n_rw; + count -= n_rw; + } + + return total; +} diff --git a/lib/full-write.h b/lib/full-write.h new file mode 100644 index 0000000..d20d2fe --- /dev/null +++ b/lib/full-write.h @@ -0,0 +1,35 @@ +/* An interface to write() that writes all it is asked to write. + + Copyright (C) 2002-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. */ + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Write COUNT bytes at BUF to descriptor FD, retrying if interrupted + or if partial writes occur. Return the number of bytes successfully + written, setting errno if that is less than COUNT. */ +extern size_t full_write (int fd, const void *buf, size_t count); + + +#ifdef __cplusplus +} +#endif diff --git a/lib/getcwd.c b/lib/getcwd.c new file mode 100644 index 0000000..23b35de --- /dev/null +++ b/lib/getcwd.c @@ -0,0 +1,428 @@ +/* Copyright (C) 1991,92,93,94,95,96,97,98,99,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) + any 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 !_LIBC +# include +# include +# include "dirfd.h" +#endif + +#include +#include +#include +#include +#include + +#include /* For AT_FDCWD on Solaris 9. */ + +#ifndef __set_errno +# define __set_errno(val) (errno = (val)) +#endif + +#include +#ifndef _D_EXACT_NAMLEN +# define _D_EXACT_NAMLEN(d) strlen ((d)->d_name) +#endif +#ifndef _D_ALLOC_NAMLEN +# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1) +#endif + +#include +#include +#include + +#if _LIBC +# ifndef mempcpy +# define mempcpy __mempcpy +# endif +#endif + +#include + +/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its + value exceeds INT_MAX, so its use as an int doesn't conform to the + C standard, and GCC and Sun C complain in some cases. */ +#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553 +# undef AT_FDCWD +# define AT_FDCWD (-3041965) +#endif + +#ifdef ENAMETOOLONG +# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG) +#else +# define is_ENAMETOOLONG(x) 0 +#endif + +#ifndef MAX +# define MAX(a, b) ((a) < (b) ? (b) : (a)) +#endif +#ifndef MIN +# define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef PATH_MAX +# ifdef MAXPATHLEN +# define PATH_MAX MAXPATHLEN +# else +# define PATH_MAX 1024 +# endif +#endif + +#if D_INO_IN_DIRENT +# define MATCHING_INO(dp, ino) ((dp)->d_ino == (ino)) +#else +# define MATCHING_INO(dp, ino) true +#endif + +#if !_LIBC +# define __getcwd getcwd +# define __lstat lstat +# define __closedir closedir +# define __opendir opendir +# define __readdir readdir +#endif + +/* The results of opendir() in this file are not used with dirfd and fchdir, + therefore save some unnecessary recursion in fchdir.c. */ +#undef opendir +#undef closedir + +/* Get the name of the current working directory, and put it in SIZE + bytes of BUF. Returns NULL if the directory couldn't be determined or + SIZE was too small. If successful, returns BUF. In GNU, 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. */ + +char * +__getcwd (char *buf, size_t size) +{ + /* Lengths of big file name components and entire file names, and a + deep level of file name nesting. These numbers are not upper + bounds; they are merely large values suitable for initial + allocations, designed to be large enough for most real-world + uses. */ + enum + { + BIG_FILE_NAME_COMPONENT_LENGTH = 255, + BIG_FILE_NAME_LENGTH = MIN (4095, PATH_MAX - 1), + DEEP_NESTING = 100 + }; + +#ifdef AT_FDCWD + int fd = AT_FDCWD; + bool fd_needs_closing = false; +#else + char dots[DEEP_NESTING * sizeof ".." + BIG_FILE_NAME_COMPONENT_LENGTH + 1]; + char *dotlist = dots; + size_t dotsize = sizeof dots; + size_t dotlen = 0; +#endif + DIR *dirstream = NULL; + dev_t rootdev, thisdev; + ino_t rootino, thisino; + char *dir; + register char *dirp; + struct stat st; + size_t allocated = size; + size_t used; + +#if HAVE_PARTLY_WORKING_GETCWD + /* The system getcwd works, except it sometimes fails when it + shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT. If + AT_FDCWD is not defined, the algorithm below is O(N**2) and this + is much slower than the system getcwd (at least on GNU/Linux). + So trust the system getcwd's results unless they look + suspicious. + + Use the system getcwd even if we have openat support, since the + system getcwd works even when a parent is unreadable, while the + openat-based approach does not. */ + +# undef getcwd + dir = getcwd (buf, size); + if (dir || (errno != ERANGE && !is_ENAMETOOLONG (errno) && errno != ENOENT)) + return dir; +#endif + + if (size == 0) + { + if (buf != NULL) + { + __set_errno (EINVAL); + return NULL; + } + + allocated = BIG_FILE_NAME_LENGTH + 1; + } + + if (buf == NULL) + { + dir = malloc (allocated); + if (dir == NULL) + return NULL; + } + else + dir = buf; + + dirp = dir + allocated; + *--dirp = '\0'; + + if (__lstat (".", &st) < 0) + goto lose; + thisdev = st.st_dev; + thisino = st.st_ino; + + if (__lstat ("/", &st) < 0) + goto lose; + rootdev = st.st_dev; + rootino = st.st_ino; + + while (!(thisdev == rootdev && thisino == rootino)) + { + struct dirent *d; + dev_t dotdev; + ino_t dotino; + bool mount_point; + int parent_status; + size_t dirroom; + size_t namlen; + bool use_d_ino = true; + + /* Look at the parent directory. */ +#ifdef AT_FDCWD + fd = openat (fd, "..", O_RDONLY); + if (fd < 0) + goto lose; + fd_needs_closing = true; + parent_status = fstat (fd, &st); +#else + dotlist[dotlen++] = '.'; + dotlist[dotlen++] = '.'; + dotlist[dotlen] = '\0'; + parent_status = __lstat (dotlist, &st); +#endif + if (parent_status != 0) + goto lose; + + if (dirstream && __closedir (dirstream) != 0) + { + dirstream = NULL; + goto lose; + } + + /* Figure out if this directory is a mount point. */ + dotdev = st.st_dev; + dotino = st.st_ino; + mount_point = dotdev != thisdev; + + /* Search for the last directory. */ +#ifdef AT_FDCWD + dirstream = fdopendir (fd); + if (dirstream == NULL) + goto lose; + /* Reset fd. It may have been closed by fdopendir. */ + fd = dirfd (dirstream); + fd_needs_closing = false; +#else + dirstream = __opendir (dotlist); + if (dirstream == NULL) + goto lose; + dotlist[dotlen++] = '/'; +#endif + for (;;) + { + /* Clear errno to distinguish EOF from error if readdir returns + NULL. */ + __set_errno (0); + d = __readdir (dirstream); + + /* When we've iterated through all directory entries without finding + one with a matching d_ino, rewind the stream and consider each + name again, but this time, using lstat. This is necessary in a + chroot on at least one system (glibc-2.3.6 + linux 2.6.12), where + .., ../.., ../../.., etc. all had the same device number, yet the + d_ino values for entries in / did not match those obtained + via lstat. */ + if (d == NULL && errno == 0 && use_d_ino) + { + use_d_ino = false; + rewinddir (dirstream); + d = __readdir (dirstream); + } + + if (d == NULL) + { + if (errno == 0) + /* EOF on dirstream, which can mean e.g., that the current + directory has been removed. */ + __set_errno (ENOENT); + goto lose; + } + if (d->d_name[0] == '.' && + (d->d_name[1] == '\0' || + (d->d_name[1] == '.' && d->d_name[2] == '\0'))) + continue; + + if (use_d_ino) + { + bool match = (MATCHING_INO (d, thisino) || mount_point); + if (! match) + continue; + } + + { + int entry_status; +#ifdef AT_FDCWD + entry_status = fstatat (fd, d->d_name, &st, AT_SYMLINK_NOFOLLOW); +#else + /* Compute size needed for this file name, or for the file + name ".." in the same directory, whichever is larger. + Room for ".." might be needed the next time through + the outer loop. */ + size_t name_alloc = _D_ALLOC_NAMLEN (d); + size_t filesize = dotlen + MAX (sizeof "..", name_alloc); + + if (filesize < dotlen) + goto memory_exhausted; + + if (dotsize < filesize) + { + /* My, what a deep directory tree you have, Grandma. */ + size_t newsize = MAX (filesize, dotsize * 2); + size_t i; + if (newsize < dotsize) + goto memory_exhausted; + if (dotlist != dots) + free (dotlist); + dotlist = malloc (newsize); + if (dotlist == NULL) + goto lose; + dotsize = newsize; + + i = 0; + do + { + dotlist[i++] = '.'; + dotlist[i++] = '.'; + dotlist[i++] = '/'; + } + while (i < dotlen); + } + + memcpy (dotlist + dotlen, d->d_name, _D_ALLOC_NAMLEN (d)); + entry_status = __lstat (dotlist, &st); +#endif + /* We don't fail here if we cannot stat() a directory entry. + This can happen when (network) file systems fail. If this + entry is in fact the one we are looking for we will find + out soon as we reach the end of the directory without + having found anything. */ + if (entry_status == 0 && S_ISDIR (st.st_mode) + && st.st_dev == thisdev && st.st_ino == thisino) + break; + } + } + + dirroom = dirp - dir; + namlen = _D_EXACT_NAMLEN (d); + + if (dirroom <= namlen) + { + if (size != 0) + { + __set_errno (ERANGE); + goto lose; + } + else + { + char *tmp; + size_t oldsize = allocated; + + allocated += MAX (allocated, namlen); + if (allocated < oldsize + || ! (tmp = realloc (dir, allocated))) + goto memory_exhausted; + + /* Move current contents up to the end of the buffer. + This is guaranteed to be non-overlapping. */ + dirp = memcpy (tmp + allocated - (oldsize - dirroom), + tmp + dirroom, + oldsize - dirroom); + dir = tmp; + } + } + dirp -= namlen; + memcpy (dirp, d->d_name, namlen); + *--dirp = '/'; + + thisdev = dotdev; + thisino = dotino; + } + + if (dirstream && __closedir (dirstream) != 0) + { + dirstream = NULL; + goto lose; + } + + if (dirp == &dir[allocated - 1]) + *--dirp = '/'; + +#ifndef AT_FDCWD + if (dotlist != dots) + free (dotlist); +#endif + + used = dir + allocated - dirp; + memmove (dir, dirp, used); + + if (size == 0) + /* Ensure that the buffer is only as large as necessary. */ + buf = realloc (dir, used); + + if (buf == NULL) + /* Either buf was NULL all along, or `realloc' failed but + we still have the original string. */ + buf = dir; + + return buf; + + memory_exhausted: + __set_errno (ENOMEM); + lose: + { + int save = errno; + if (dirstream) + __closedir (dirstream); +#ifdef AT_FDCWD + if (fd_needs_closing) + close (fd); +#else + if (dotlist != dots) + free (dotlist); +#endif + if (buf == NULL) + free (dir); + __set_errno (save); + } + return NULL; +} + +#ifdef weak_alias +weak_alias (__getcwd, getcwd) +#endif diff --git a/lib/getdate.c b/lib/getdate.c new file mode 100644 index 0000000..2f59183 --- /dev/null +++ b/lib/getdate.c @@ -0,0 +1,3289 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + 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 + it under the 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. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + 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. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + tAGO = 258, + tDST = 259, + tYEAR_UNIT = 260, + tMONTH_UNIT = 261, + tHOUR_UNIT = 262, + 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 + }; +#endif +/* Tokens. */ +#define tAGO 258 +#define tDST 259 +#define tYEAR_UNIT 260 +#define tMONTH_UNIT 261 +#define tHOUR_UNIT 262 +#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 + + + + +/* Copy the first part of user declarations. */ +#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. + + This program is free software; you can redistribute it and/or modify + it under the 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. */ + +/* Originally written by Steven M. Bellovin while + at the University of North Carolina at Chapel Hill. Later tweaked by + a couple of people on Usenet. Completely overhauled by Rich $alz + and Jim Berets in August, 1990. + + Modified by Paul Eggert in August 1999 to do + the right thing about local DST. Also modified by Paul Eggert + in February 2004 to support + nanosecond-resolution time stamps, and in October 2004 to support + TZ strings in dates. */ + +/* FIXME: Check for arithmetic overflow in all cases, not just + some of them. */ + +#include + +#include "getdate.h" +#include "timespec.h" + +/* There's no need to extend the stack, so there's no need to involve + alloca. */ +#define YYSTACK_USE_ALLOCA 0 + +/* Tell Bison how much stack space is needed. 20 should be plenty for + this grammar, which is not right recursive. Beware setting it too + high, since that might cause problems on machines whose + implementations have lame stack-overflow checking. */ +#define YYMAXDEPTH 20 +#define YYINITDEPTH YYMAXDEPTH + +/* Since the code of getdate.y is not included in the Emacs executable + itself, there is no need to #define static in this file. Even if + the code were included in the Emacs executable, it probably + wouldn't do any harm to #undef it here; this will only cause + problems if we try to write to a static variable, which I don't + think this code needs to do. */ +#ifdef emacs +# undef static +#endif + +#include +#include +#include +#include +#include + +#include "setenv.h" +#include "xalloc.h" + + +/* ISDIGIT differs from isdigit, as follows: + - Its arg may be any int or unsigned int; it need not be an unsigned char + or EOF. + - It's typically faster. + POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to + isdigit unless it's important to use the locale's definition + of `digit' even when the host does not conform to POSIX. */ +#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) + +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# define __attribute__(x) +# endif +#endif + +#ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + +/* Shift A right by B bits portably, by dividing A by 2**B and + truncating towards minus infinity. A and B should be free of side + effects, and B should be in the range 0 <= B <= INT_BITS - 2, where + INT_BITS is the number of useful bits in an int. GNU code can + assume that INT_BITS is at least 32. + + ISO C99 says that A >> B is implementation-defined if A < 0. Some + implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift + right in the usual way when A < 0, so SHR falls back on division if + ordinary A >> B doesn't seem to be the usual signed shift. */ +#define SHR(a, b) \ + (-1 >> 1 == -1 \ + ? (a) >> (b) \ + : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0)) + +#define EPOCH_YEAR 1970 +#define TM_YEAR_BASE 1900 + +#define HOUR(x) ((x) * 60) + +/* An integer value, and the number of digits in its textual + representation. */ +typedef struct +{ + bool negative; + long int value; + size_t digits; +} textint; + +/* An entry in the lexical lookup table. */ +typedef struct +{ + char const *name; + int type; + int value; +} table; + +/* Meridian: am, pm, or 24-hour style. */ +enum { MERam, MERpm, MER24 }; + +enum { BILLION = 1000000000, LOG10_BILLION = 9 }; + +/* Relative times. */ +typedef struct +{ + /* Relative year, month, day, hour, minutes, seconds, and nanoseconds. */ + long int year; + long int month; + long int day; + long int hour; + long int minutes; + long int seconds; + long int ns; +} relative_time; + +#if HAVE_COMPOUND_LITERALS +# define RELATIVE_TIME_0 ((relative_time) { 0, 0, 0, 0, 0, 0, 0 }) +#else +static relative_time const RELATIVE_TIME_0; +#endif + +/* Information passed to and from the parser. */ +typedef struct +{ + /* The input string remaining to be parsed. */ + const char *input; + + /* N, if this is the Nth Tuesday. */ + long int day_ordinal; + + /* Day of week; Sunday is 0. */ + int day_number; + + /* tm_isdst flag for the local zone. */ + int local_isdst; + + /* Time zone, in minutes east of UTC. */ + long int time_zone; + + /* Style used for time. */ + int meridian; + + /* Gregorian year, month, day, hour, minutes, seconds, and nanoseconds. */ + textint year; + long int month; + long int day; + long int hour; + long int minutes; + struct timespec seconds; /* includes nanoseconds */ + + /* Relative year, month, day, hour, minutes, seconds, and nanoseconds. */ + relative_time rel; + + /* Presence or counts of nonterminals of various flavors parsed so far. */ + bool timespec_seen; + bool rels_seen; + size_t dates_seen; + size_t days_seen; + size_t local_zones_seen; + size_t dsts_seen; + size_t times_seen; + size_t zones_seen; + + /* Table of local time zone abbrevations, terminated by a null entry. */ + table local_time_zone_table[3]; +} parser_control; + +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); + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 214 "getdate.y" +{ + long int intval; + textint textintval; + struct timespec timespec; + relative_time rel; +} +/* Line 193 of yacc.c. */ +#line 348 "getdate.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 216 of yacc.c. */ +#line 361 "getdate.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + 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) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 12 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 91 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 26 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 19 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 78 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 96 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 276 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 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, 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, 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, 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, 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, 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, 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, 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 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +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 +}; + +/* 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 +}; + +/* 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 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +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 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +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 +}; +# 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 +}; + +/* 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 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + 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 +}; + +/* 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 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -79 +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 +}; + +/* 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 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#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 +}; + +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 +}; + +/* 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 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (pc, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, YYLEX_PARAM) +#else +# define YYLEX yylex (&yylval, pc) +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, pc); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_control *pc) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep, pc) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + parser_control *pc; +#endif +{ + if (!yyvaluep) + return; + YYUSE (pc); +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_control *pc) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep, pc) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + parser_control *pc; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep, pc); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule, parser_control *pc) +#else +static void +yy_reduce_print (yyvsp, yyrule, pc) + YYSTYPE *yyvsp; + int yyrule; + parser_control *pc; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , pc); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule, pc); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_control *pc) +#else +static void +yydestruct (yymsg, yytype, yyvaluep, pc) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; + parser_control *pc; +#endif +{ + YYUSE (yyvaluep); + YYUSE (pc); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (parser_control *pc); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (parser_control *pc) +#else +int +yyparse (pc) + parser_control *pc; +#endif +#endif +{ + /* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + 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; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + 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; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + 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 + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 4: +#line 246 "getdate.y" + { + pc->seconds = (yyvsp[(2) - (2)].timespec); + pc->timespec_seen = true; + } + break; + + case 7: +#line 259 "getdate.y" + { pc->times_seen++; } + break; + + case 8: +#line 261 "getdate.y" + { pc->local_zones_seen++; } + break; + + case 9: +#line 263 "getdate.y" + { pc->zones_seen++; } + break; + + case 10: +#line 265 "getdate.y" + { pc->dates_seen++; } + break; + + case 11: +#line 267 "getdate.y" + { pc->days_seen++; } + break; + + case 12: +#line 269 "getdate.y" + { pc->rels_seen = true; } + break; + + case 14: +#line 275 "getdate.y" + { + pc->hour = (yyvsp[(1) - (2)].textintval).value; + pc->minutes = 0; + pc->seconds.tv_sec = 0; + pc->seconds.tv_nsec = 0; + pc->meridian = (yyvsp[(2) - (2)].intval); + } + break; + + case 15: +#line 283 "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; + pc->meridian = (yyvsp[(4) - (4)].intval); + } + break; + + case 16: +#line 291 "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; + pc->meridian = MER24; + pc->zones_seen++; + pc->time_zone = time_zone_hhmm ((yyvsp[(4) - (5)].textintval), (yyvsp[(5) - (5)].intval)); + } + break; + + case 17: +#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); + } + break; + + case 18: +#line 308 "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)); + } + break; + + case 19: +#line 320 "getdate.y" + { + pc->local_isdst = (yyvsp[(1) - (1)].intval); + pc->dsts_seen += (0 < (yyvsp[(1) - (1)].intval)); + } + break; + + case 20: +#line 325 "getdate.y" + { + pc->local_isdst = 1; + pc->dsts_seen += (0 < (yyvsp[(1) - (2)].intval)) + 1; + } + break; + + case 21: +#line 333 "getdate.y" + { pc->time_zone = (yyvsp[(1) - (1)].intval); } + break; + + case 22: +#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 345 "getdate.y" + { pc->time_zone = (yyvsp[(1) - (3)].intval) + time_zone_hhmm ((yyvsp[(2) - (3)].textintval), (yyvsp[(3) - (3)].intval)); } + break; + + case 24: +#line 347 "getdate.y" + { pc->time_zone = (yyvsp[(1) - (1)].intval) + 60; } + break; + + case 25: +#line 349 "getdate.y" + { pc->time_zone = (yyvsp[(1) - (2)].intval) + 60; } + break; + + case 26: +#line 354 "getdate.y" + { + pc->day_ordinal = 1; + pc->day_number = (yyvsp[(1) - (1)].intval); + } + break; + + case 27: +#line 359 "getdate.y" + { + pc->day_ordinal = 1; + pc->day_number = (yyvsp[(1) - (2)].intval); + } + break; + + case 28: +#line 364 "getdate.y" + { + pc->day_ordinal = (yyvsp[(1) - (2)].intval); + pc->day_number = (yyvsp[(2) - (2)].intval); + } + break; + + case 29: +#line 369 "getdate.y" + { + pc->day_ordinal = (yyvsp[(1) - (2)].textintval).value; + pc->day_number = (yyvsp[(2) - (2)].intval); + } + break; + + case 30: +#line 377 "getdate.y" + { + pc->month = (yyvsp[(1) - (3)].textintval).value; + pc->day = (yyvsp[(3) - (3)].textintval).value; + } + break; + + case 31: +#line 382 "getdate.y" + { + /* Interpret as YYYY/MM/DD if the first value has 4 or more digits, + otherwise as MM/DD/YY. + The goal in recognizing YYYY/MM/DD is solely to support legacy + machine-generated dates like those in an RCS log listing. If + you want portability, use the ISO 8601 format. */ + if (4 <= (yyvsp[(1) - (5)].textintval).digits) + { + pc->year = (yyvsp[(1) - (5)].textintval); + pc->month = (yyvsp[(3) - (5)].textintval).value; + pc->day = (yyvsp[(5) - (5)].textintval).value; + } + else + { + pc->month = (yyvsp[(1) - (5)].textintval).value; + pc->day = (yyvsp[(3) - (5)].textintval).value; + pc->year = (yyvsp[(5) - (5)].textintval); + } + } + break; + + case 32: +#line 402 "getdate.y" + { + /* ISO 8601 format. YYYY-MM-DD. */ + pc->year = (yyvsp[(1) - (3)].textintval); + pc->month = -(yyvsp[(2) - (3)].textintval).value; + pc->day = -(yyvsp[(3) - (3)].textintval).value; + } + break; + + case 33: +#line 409 "getdate.y" + { + /* e.g. 17-JUN-1992. */ + pc->day = (yyvsp[(1) - (3)].textintval).value; + pc->month = (yyvsp[(2) - (3)].intval); + pc->year.value = -(yyvsp[(3) - (3)].textintval).value; + pc->year.digits = (yyvsp[(3) - (3)].textintval).digits; + } + break; + + case 34: +#line 417 "getdate.y" + { + /* e.g. JUN-17-1992. */ + pc->month = (yyvsp[(1) - (3)].intval); + pc->day = -(yyvsp[(2) - (3)].textintval).value; + pc->year.value = -(yyvsp[(3) - (3)].textintval).value; + pc->year.digits = (yyvsp[(3) - (3)].textintval).digits; + } + break; + + case 35: +#line 425 "getdate.y" + { + pc->month = (yyvsp[(1) - (2)].intval); + pc->day = (yyvsp[(2) - (2)].textintval).value; + } + break; + + case 36: +#line 430 "getdate.y" + { + pc->month = (yyvsp[(1) - (4)].intval); + pc->day = (yyvsp[(2) - (4)].textintval).value; + pc->year = (yyvsp[(4) - (4)].textintval); + } + break; + + case 37: +#line 436 "getdate.y" + { + pc->day = (yyvsp[(1) - (2)].textintval).value; + pc->month = (yyvsp[(2) - (2)].intval); + } + break; + + case 38: +#line 441 "getdate.y" + { + pc->day = (yyvsp[(1) - (3)].textintval).value; + pc->month = (yyvsp[(2) - (3)].intval); + pc->year = (yyvsp[(3) - (3)].textintval); + } + break; + + case 39: +#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 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; + } + break; + + case 41: +#line 473 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].intval); } + break; + + case 42: +#line 475 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 43: +#line 477 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = 1; } + break; + + case 44: +#line 479 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].intval); } + break; + + case 45: +#line 481 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 46: +#line 483 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = 1; } + break; + + case 47: +#line 485 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].intval) * (yyvsp[(2) - (2)].intval); } + break; + + case 48: +#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 489 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (1)].intval); } + break; + + case 50: +#line 491 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].intval); } + break; + + case 51: +#line 493 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 52: +#line 495 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = 1; } + break; + + case 53: +#line 497 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].intval); } + break; + + case 54: +#line 499 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 55: +#line 501 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = 1; } + break; + + case 56: +#line 503 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].intval); } + break; + + case 57: +#line 505 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 58: +#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 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 511 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = 1; } + break; + + case 62: +#line 517 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 63: +#line 519 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 64: +#line 521 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); } + break; + + case 65: +#line 523 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 66: +#line 525 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 67: +#line 527 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 71: +#line 535 "getdate.y" + { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; } + break; + + case 73: +#line 541 "getdate.y" + { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; } + break; + + case 74: +#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 583 "getdate.y" + { (yyval.intval) = -1; } + break; + + case 76: +#line 585 "getdate.y" + { (yyval.intval) = (yyvsp[(2) - (2)].textintval).value; } + break; + + case 77: +#line 590 "getdate.y" + { (yyval.intval) = MER24; } + break; + + case 78: +#line 592 "getdate.y" + { (yyval.intval) = (yyvsp[(1) - (1)].intval); } + break; + + +/* Line 1267 of yacc.c. */ +#line 2149 "getdate.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++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. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (pc, YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (pc, yymsg); + } + else + { + yyerror (pc, YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, pc); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp, pc); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (pc, YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, pc); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp, pc); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +#line 595 "getdate.y" + + +static table const meridian_table[] = +{ + { "AM", tMERIDIAN, MERam }, + { "A.M.", tMERIDIAN, MERam }, + { "PM", tMERIDIAN, MERpm }, + { "P.M.", tMERIDIAN, MERpm }, + { NULL, 0, 0 } +}; + +static table const dst_table[] = +{ + { "DST", tDST, 0 } +}; + +static table const month_and_day_table[] = +{ + { "JANUARY", tMONTH, 1 }, + { "FEBRUARY", tMONTH, 2 }, + { "MARCH", tMONTH, 3 }, + { "APRIL", tMONTH, 4 }, + { "MAY", tMONTH, 5 }, + { "JUNE", tMONTH, 6 }, + { "JULY", tMONTH, 7 }, + { "AUGUST", tMONTH, 8 }, + { "SEPTEMBER",tMONTH, 9 }, + { "SEPT", tMONTH, 9 }, + { "OCTOBER", tMONTH, 10 }, + { "NOVEMBER", tMONTH, 11 }, + { "DECEMBER", tMONTH, 12 }, + { "SUNDAY", tDAY, 0 }, + { "MONDAY", tDAY, 1 }, + { "TUESDAY", tDAY, 2 }, + { "TUES", tDAY, 2 }, + { "WEDNESDAY",tDAY, 3 }, + { "WEDNES", tDAY, 3 }, + { "THURSDAY", tDAY, 4 }, + { "THUR", tDAY, 4 }, + { "THURS", tDAY, 4 }, + { "FRIDAY", tDAY, 5 }, + { "SATURDAY", tDAY, 6 }, + { NULL, 0, 0 } +}; + +static table const time_units_table[] = +{ + { "YEAR", tYEAR_UNIT, 1 }, + { "MONTH", tMONTH_UNIT, 1 }, + { "FORTNIGHT",tDAY_UNIT, 14 }, + { "WEEK", tDAY_UNIT, 7 }, + { "DAY", tDAY_UNIT, 1 }, + { "HOUR", tHOUR_UNIT, 1 }, + { "MINUTE", tMINUTE_UNIT, 1 }, + { "MIN", tMINUTE_UNIT, 1 }, + { "SECOND", tSEC_UNIT, 1 }, + { "SEC", tSEC_UNIT, 1 }, + { NULL, 0, 0 } +}; + +/* 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 }, + { "LAST", tORDINAL, -1 }, + { "THIS", tORDINAL, 0 }, + { "NEXT", tORDINAL, 1 }, + { "FIRST", tORDINAL, 1 }, +/*{ "SECOND", tORDINAL, 2 }, */ + { "THIRD", tORDINAL, 3 }, + { "FOURTH", tORDINAL, 4 }, + { "FIFTH", tORDINAL, 5 }, + { "SIXTH", tORDINAL, 6 }, + { "SEVENTH", tORDINAL, 7 }, + { "EIGHTH", tORDINAL, 8 }, + { "NINTH", tORDINAL, 9 }, + { "TENTH", tORDINAL, 10 }, + { "ELEVENTH", tORDINAL, 11 }, + { "TWELFTH", tORDINAL, 12 }, + { "AGO", tAGO, 1 }, + { NULL, 0, 0 } +}; + +/* The universal time zone table. These labels can be used even for + time stamps that would not otherwise be valid, e.g., GMT time + stamps in London during summer. */ +static table const universal_time_zone_table[] = +{ + { "GMT", tZONE, HOUR ( 0) }, /* Greenwich Mean */ + { "UT", tZONE, HOUR ( 0) }, /* Universal (Coordinated) */ + { "UTC", tZONE, HOUR ( 0) }, + { NULL, 0, 0 } +}; + +/* The time zone table. This table is necessarily incomplete, as time + zone abbreviations are ambiguous; e.g. Australians interpret "EST" + as Eastern time in Australia, not as US Eastern Standard Time. + You cannot rely on getdate to handle arbitrary time zone + abbreviations; use numeric abbreviations like `-0500' instead. */ +static table const time_zone_table[] = +{ + { "WET", tZONE, HOUR ( 0) }, /* Western European */ + { "WEST", tDAYZONE, HOUR ( 0) }, /* Western European Summer */ + { "BST", tDAYZONE, HOUR ( 0) }, /* British Summer */ + { "ART", tZONE, -HOUR ( 3) }, /* Argentina */ + { "BRT", tZONE, -HOUR ( 3) }, /* Brazil */ + { "BRST", tDAYZONE, -HOUR ( 3) }, /* Brazil Summer */ + { "NST", tZONE, -(HOUR ( 3) + 30) }, /* Newfoundland Standard */ + { "NDT", tDAYZONE,-(HOUR ( 3) + 30) }, /* Newfoundland Daylight */ + { "AST", tZONE, -HOUR ( 4) }, /* Atlantic Standard */ + { "ADT", tDAYZONE, -HOUR ( 4) }, /* Atlantic Daylight */ + { "CLT", tZONE, -HOUR ( 4) }, /* Chile */ + { "CLST", tDAYZONE, -HOUR ( 4) }, /* Chile Summer */ + { "EST", tZONE, -HOUR ( 5) }, /* Eastern Standard */ + { "EDT", tDAYZONE, -HOUR ( 5) }, /* Eastern Daylight */ + { "CST", tZONE, -HOUR ( 6) }, /* Central Standard */ + { "CDT", tDAYZONE, -HOUR ( 6) }, /* Central Daylight */ + { "MST", tZONE, -HOUR ( 7) }, /* Mountain Standard */ + { "MDT", tDAYZONE, -HOUR ( 7) }, /* Mountain Daylight */ + { "PST", tZONE, -HOUR ( 8) }, /* Pacific Standard */ + { "PDT", tDAYZONE, -HOUR ( 8) }, /* Pacific Daylight */ + { "AKST", tZONE, -HOUR ( 9) }, /* Alaska Standard */ + { "AKDT", tDAYZONE, -HOUR ( 9) }, /* Alaska Daylight */ + { "HST", tZONE, -HOUR (10) }, /* Hawaii Standard */ + { "HAST", tZONE, -HOUR (10) }, /* Hawaii-Aleutian Standard */ + { "HADT", tDAYZONE, -HOUR (10) }, /* Hawaii-Aleutian Daylight */ + { "SST", tZONE, -HOUR (12) }, /* Samoa Standard */ + { "WAT", tZONE, HOUR ( 1) }, /* West Africa */ + { "CET", tZONE, HOUR ( 1) }, /* Central European */ + { "CEST", tDAYZONE, HOUR ( 1) }, /* Central European Summer */ + { "MET", tZONE, HOUR ( 1) }, /* Middle European */ + { "MEZ", tZONE, HOUR ( 1) }, /* Middle European */ + { "MEST", tDAYZONE, HOUR ( 1) }, /* Middle European Summer */ + { "MESZ", tDAYZONE, HOUR ( 1) }, /* Middle European Summer */ + { "EET", tZONE, HOUR ( 2) }, /* Eastern European */ + { "EEST", tDAYZONE, HOUR ( 2) }, /* Eastern European Summer */ + { "CAT", tZONE, HOUR ( 2) }, /* Central Africa */ + { "SAST", tZONE, HOUR ( 2) }, /* South Africa Standard */ + { "EAT", tZONE, HOUR ( 3) }, /* East Africa */ + { "MSK", tZONE, HOUR ( 3) }, /* Moscow */ + { "MSD", tDAYZONE, HOUR ( 3) }, /* Moscow Daylight */ + { "IST", tZONE, (HOUR ( 5) + 30) }, /* India Standard */ + { "SGT", tZONE, HOUR ( 8) }, /* Singapore */ + { "KST", tZONE, HOUR ( 9) }, /* Korea Standard */ + { "JST", tZONE, HOUR ( 9) }, /* Japan Standard */ + { "GST", tZONE, HOUR (10) }, /* Guam Standard */ + { "NZST", tZONE, HOUR (12) }, /* New Zealand Standard */ + { "NZDT", tDAYZONE, HOUR (12) }, /* New Zealand Daylight */ + { NULL, 0, 0 } +}; + +/* Military time zone table. */ +static table const military_table[] = +{ + { "A", tZONE, -HOUR ( 1) }, + { "B", tZONE, -HOUR ( 2) }, + { "C", tZONE, -HOUR ( 3) }, + { "D", tZONE, -HOUR ( 4) }, + { "E", tZONE, -HOUR ( 5) }, + { "F", tZONE, -HOUR ( 6) }, + { "G", tZONE, -HOUR ( 7) }, + { "H", tZONE, -HOUR ( 8) }, + { "I", tZONE, -HOUR ( 9) }, + { "K", tZONE, -HOUR (10) }, + { "L", tZONE, -HOUR (11) }, + { "M", tZONE, -HOUR (12) }, + { "N", tZONE, HOUR ( 1) }, + { "O", tZONE, HOUR ( 2) }, + { "P", tZONE, HOUR ( 3) }, + { "Q", tZONE, HOUR ( 4) }, + { "R", tZONE, HOUR ( 5) }, + { "S", tZONE, HOUR ( 6) }, + { "T", tZONE, HOUR ( 7) }, + { "U", tZONE, HOUR ( 8) }, + { "V", tZONE, HOUR ( 9) }, + { "W", tZONE, HOUR (10) }, + { "X", tZONE, HOUR (11) }, + { "Y", tZONE, HOUR (12) }, + { "Z", tZONE, HOUR ( 0) }, + { NULL, 0, 0 } +}; + + + +/* 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. */ + +static long int +time_zone_hhmm (textint s, long int mm) +{ + if (mm < 0) + return (s.value / 100) * 60 + s.value % 100; + else + return s.value * 60 + (s.negative ? -mm : mm); +} + +static int +to_hour (long int hours, int meridian) +{ + switch (meridian) + { + default: /* Pacify GCC. */ + case MER24: + return 0 <= hours && hours < 24 ? hours : -1; + case MERam: + return 0 < hours && hours < 12 ? hours : hours == 12 ? 0 : -1; + case MERpm: + return 0 < hours && hours < 12 ? hours + 12 : hours == 12 ? 12 : -1; + } +} + +static long int +to_year (textint textyear) +{ + long int year = textyear.value; + + if (year < 0) + year = -year; + + /* XPG4 suggests that years 00-68 map to 2000-2068, and + years 69-99 map to 1969-1999. */ + else if (textyear.digits == 2) + year += year < 69 ? 2000 : 1900; + + return year; +} + +static table const * +lookup_zone (parser_control const *pc, char const *name) +{ + table const *tp; + + for (tp = universal_time_zone_table; tp->name; tp++) + if (strcmp (name, tp->name) == 0) + return tp; + + /* Try local zone abbreviations before those in time_zone_table, as + the local ones are more likely to be right. */ + for (tp = pc->local_time_zone_table; tp->name; tp++) + if (strcmp (name, tp->name) == 0) + return tp; + + for (tp = time_zone_table; tp->name; tp++) + if (strcmp (name, tp->name) == 0) + return tp; + + return NULL; +} + +#if ! HAVE_TM_GMTOFF +/* Yield the difference between *A and *B, + measured in seconds, ignoring leap seconds. + The body of this function is taken directly from the GNU C Library; + see src/strftime.c. */ +static long int +tm_diff (struct tm const *a, struct tm const *b) +{ + /* Compute intervening leap days correctly even if year is negative. + Take care to avoid int overflow in leap day calculations. */ + int a4 = SHR (a->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (a->tm_year & 3); + int b4 = SHR (b->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (b->tm_year & 3); + int a100 = a4 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 0); + int a400 = SHR (a100, 2); + int b400 = SHR (b100, 2); + int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); + long int ayear = a->tm_year; + long int years = ayear - b->tm_year; + long int days = (365 * years + intervening_leap_days + + (a->tm_yday - b->tm_yday)); + return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + + (a->tm_min - b->tm_min)) + + (a->tm_sec - b->tm_sec)); +} +#endif /* ! HAVE_TM_GMTOFF */ + +static table const * +lookup_word (parser_control const *pc, char *word) +{ + char *p; + char *q; + size_t wordlen; + table const *tp; + bool period_found; + bool abbrev; + + /* Make it uppercase. */ + for (p = word; *p; p++) + { + unsigned char ch = *p; + *p = toupper (ch); + } + + for (tp = meridian_table; tp->name; tp++) + if (strcmp (word, tp->name) == 0) + return tp; + + /* See if we have an abbreviation for a month. */ + wordlen = strlen (word); + abbrev = wordlen == 3 || (wordlen == 4 && word[3] == '.'); + + for (tp = month_and_day_table; tp->name; tp++) + if ((abbrev ? strncmp (word, tp->name, 3) : strcmp (word, tp->name)) == 0) + return tp; + + if ((tp = lookup_zone (pc, word))) + return tp; + + if (strcmp (word, dst_table[0].name) == 0) + return dst_table; + + for (tp = time_units_table; tp->name; tp++) + if (strcmp (word, tp->name) == 0) + return tp; + + /* Strip off any plural and try the units table again. */ + if (word[wordlen - 1] == 'S') + { + word[wordlen - 1] = '\0'; + for (tp = time_units_table; tp->name; tp++) + if (strcmp (word, tp->name) == 0) + return tp; + word[wordlen - 1] = 'S'; /* For "this" in relative_time_table. */ + } + + for (tp = relative_time_table; tp->name; tp++) + if (strcmp (word, tp->name) == 0) + return tp; + + /* Military time zones. */ + if (wordlen == 1) + for (tp = military_table; tp->name; tp++) + if (word[0] == tp->name[0]) + return tp; + + /* Drop out any periods and try the time zone table again. */ + for (period_found = false, p = q = word; (*p = *q); q++) + if (*q == '.') + period_found = true; + else + p++; + if (period_found && (tp = lookup_zone (pc, word))) + return tp; + + return NULL; +} + +static int +yylex (YYSTYPE *lvalp, parser_control *pc) +{ + unsigned char c; + size_t count; + + for (;;) + { + while (c = *pc->input, isspace (c)) + pc->input++; + + if (ISDIGIT (c) || c == '-' || c == '+') + { + char const *p; + int sign; + unsigned long int value; + if (c == '-' || c == '+') + { + sign = c == '-' ? -1 : 1; + while (c = *++pc->input, isspace (c)) + continue; + if (! ISDIGIT (c)) + /* skip the '-' sign */ + continue; + } + else + sign = 0; + p = pc->input; + for (value = 0; ; value *= 10) + { + unsigned long int value1 = value + (c - '0'); + if (value1 < value) + return '?'; + value = value1; + c = *++p; + if (! ISDIGIT (c)) + break; + if (ULONG_MAX / 10 < value) + return '?'; + } + if ((c == '.' || c == ',') && ISDIGIT (p[1])) + { + time_t s; + int ns; + int digits; + unsigned long int value1; + + /* Check for overflow when converting value to time_t. */ + if (sign < 0) + { + s = - value; + if (0 < s) + return '?'; + value1 = -s; + } + else + { + s = value; + if (s < 0) + return '?'; + value1 = s; + } + if (value != value1) + return '?'; + + /* Accumulate fraction, to ns precision. */ + p++; + ns = *p++ - '0'; + for (digits = 2; digits <= LOG10_BILLION; digits++) + { + ns *= 10; + if (ISDIGIT (*p)) + ns += *p++ - '0'; + } + + /* Skip excess digits, truncating toward -Infinity. */ + if (sign < 0) + for (; ISDIGIT (*p); p++) + if (*p != '0') + { + ns++; + break; + } + while (ISDIGIT (*p)) + p++; + + /* Adjust to the timespec convention, which is that + tv_nsec is always a positive offset even if tv_sec is + negative. */ + if (sign < 0 && ns) + { + s--; + if (! (s < 0)) + return '?'; + ns = BILLION - ns; + } + + lvalp->timespec.tv_sec = s; + lvalp->timespec.tv_nsec = ns; + pc->input = p; + return sign ? tSDECIMAL_NUMBER : tUDECIMAL_NUMBER; + } + else + { + lvalp->textintval.negative = sign < 0; + if (sign < 0) + { + lvalp->textintval.value = - value; + if (0 < lvalp->textintval.value) + return '?'; + } + else + { + lvalp->textintval.value = value; + if (lvalp->textintval.value < 0) + return '?'; + } + lvalp->textintval.digits = p - pc->input; + pc->input = p; + return sign ? tSNUMBER : tUNUMBER; + } + } + + if (isalpha (c)) + { + char buff[20]; + char *p = buff; + table const *tp; + + do + { + if (p < buff + sizeof buff - 1) + *p++ = c; + c = *++pc->input; + } + while (isalpha (c) || c == '.'); + + *p = '\0'; + tp = lookup_word (pc, buff); + if (! tp) + return '?'; + lvalp->intval = tp->value; + return tp->type; + } + + if (c != '(') + return *pc->input++; + count = 0; + do + { + c = *pc->input++; + if (c == '\0') + return c; + if (c == '(') + count++; + else if (c == ')') + count--; + } + while (count != 0); + } +} + +/* Do nothing if the parser reports an error. */ +static int +yyerror (parser_control const *pc ATTRIBUTE_UNUSED, + char const *s ATTRIBUTE_UNUSED) +{ + return 0; +} + +/* If *TM0 is the old and *TM1 is the new value of a struct tm after + passing it to mktime, return true if it's OK that mktime returned T. + It's not OK if *TM0 has out-of-range members. */ + +static bool +mktime_ok (struct tm const *tm0, struct tm const *tm1, time_t t) +{ + if (t == (time_t) -1) + { + /* Guard against falsely reporting an error when parsing a time + stamp that happens to equal (time_t) -1, on a host that + supports such a time stamp. */ + tm1 = localtime (&t); + if (!tm1) + return false; + } + + return ! ((tm0->tm_sec ^ tm1->tm_sec) + | (tm0->tm_min ^ tm1->tm_min) + | (tm0->tm_hour ^ tm1->tm_hour) + | (tm0->tm_mday ^ tm1->tm_mday) + | (tm0->tm_mon ^ tm1->tm_mon) + | (tm0->tm_year ^ tm1->tm_year)); +} + +/* A reasonable upper bound for the size of ordinary TZ strings. + Use heap allocation if TZ's length exceeds this. */ +enum { TZBUFSIZE = 100 }; + +/* Return a copy of TZ, stored in TZBUF if it fits, and heap-allocated + otherwise. */ +static char * +get_tz (char tzbuf[TZBUFSIZE]) +{ + char *tz = getenv ("TZ"); + if (tz) + { + size_t tzsize = strlen (tz) + 1; + tz = (tzsize <= TZBUFSIZE + ? memcpy (tzbuf, tz, tzsize) + : xmemdup (tz, tzsize)); + } + return tz; +} + +/* Parse a date/time string, storing the resulting time value into *RESULT. + The string itself is pointed to by P. Return true if successful. + P can be an incomplete or relative time specification; if so, use + *NOW as the basis for the returned time. */ +bool +get_date (struct timespec *result, char const *p, struct timespec const *now) +{ + time_t Start; + long int Start_ns; + struct tm const *tmp; + struct tm tm; + struct tm tm0; + parser_control pc; + struct timespec gettime_buffer; + unsigned char c; + bool tz_was_altered = false; + char *tz0 = NULL; + char tz0buf[TZBUFSIZE]; + bool ok = true; + + if (! now) + { + gettime (&gettime_buffer); + now = &gettime_buffer; + } + + Start = now->tv_sec; + Start_ns = now->tv_nsec; + + tmp = localtime (&now->tv_sec); + if (! tmp) + return false; + + while (c = *p, isspace (c)) + p++; + + if (strncmp (p, "TZ=\"", 4) == 0) + { + char const *tzbase = p + 4; + size_t tzsize = 1; + char const *s; + + for (s = tzbase; *s; s++, tzsize++) + if (*s == '\\') + { + s++; + if (! (*s == '\\' || *s == '"')) + break; + } + else if (*s == '"') + { + char *z; + char *tz1; + char tz1buf[TZBUFSIZE]; + bool large_tz = TZBUFSIZE < tzsize; + bool setenv_ok; + tz0 = get_tz (tz0buf); + z = tz1 = large_tz ? xmalloc (tzsize) : tz1buf; + for (s = tzbase; *s != '"'; s++) + *z++ = *(s += *s == '\\'); + *z = '\0'; + setenv_ok = setenv ("TZ", tz1, 1) == 0; + if (large_tz) + free (tz1); + if (!setenv_ok) + goto fail; + tz_was_altered = true; + p = s + 1; + } + } + + pc.input = p; + pc.year.value = tmp->tm_year; + pc.year.value += TM_YEAR_BASE; + pc.year.digits = 0; + pc.month = tmp->tm_mon + 1; + pc.day = tmp->tm_mday; + pc.hour = tmp->tm_hour; + pc.minutes = tmp->tm_min; + pc.seconds.tv_sec = tmp->tm_sec; + pc.seconds.tv_nsec = Start_ns; + tm.tm_isdst = tmp->tm_isdst; + + pc.meridian = MER24; + pc.rel = RELATIVE_TIME_0; + pc.timespec_seen = false; + pc.rels_seen = false; + pc.dates_seen = 0; + pc.days_seen = 0; + pc.times_seen = 0; + pc.local_zones_seen = 0; + pc.dsts_seen = 0; + pc.zones_seen = 0; + +#if HAVE_STRUCT_TM_TM_ZONE + pc.local_time_zone_table[0].name = tmp->tm_zone; + pc.local_time_zone_table[0].type = tLOCAL_ZONE; + pc.local_time_zone_table[0].value = tmp->tm_isdst; + pc.local_time_zone_table[1].name = NULL; + + /* Probe the names used in the next three calendar quarters, looking + for a tm_isdst different from the one we already have. */ + { + int quarter; + for (quarter = 1; quarter <= 3; quarter++) + { + time_t probe = Start + quarter * (90 * 24 * 60 * 60); + struct tm const *probe_tm = localtime (&probe); + if (probe_tm && probe_tm->tm_zone + && probe_tm->tm_isdst != pc.local_time_zone_table[0].value) + { + { + pc.local_time_zone_table[1].name = probe_tm->tm_zone; + pc.local_time_zone_table[1].type = tLOCAL_ZONE; + pc.local_time_zone_table[1].value = probe_tm->tm_isdst; + pc.local_time_zone_table[2].name = NULL; + } + break; + } + } + } +#else +#if HAVE_TZNAME + { +# ifndef tzname + extern char *tzname[]; +# endif + int i; + for (i = 0; i < 2; i++) + { + pc.local_time_zone_table[i].name = tzname[i]; + pc.local_time_zone_table[i].type = tLOCAL_ZONE; + pc.local_time_zone_table[i].value = i; + } + pc.local_time_zone_table[i].name = NULL; + } +#else + pc.local_time_zone_table[0].name = NULL; +#endif +#endif + + if (pc.local_time_zone_table[0].name && pc.local_time_zone_table[1].name + && ! strcmp (pc.local_time_zone_table[0].name, + pc.local_time_zone_table[1].name)) + { + /* This locale uses the same abbrevation for standard and + daylight times. So if we see that abbreviation, we don't + know whether it's daylight time. */ + pc.local_time_zone_table[0].value = -1; + pc.local_time_zone_table[1].name = NULL; + } + + if (yyparse (&pc) != 0) + goto fail; + + if (pc.timespec_seen) + *result = pc.seconds; + else + { + if (1 < (pc.times_seen | pc.dates_seen | pc.days_seen | pc.dsts_seen + | (pc.local_zones_seen + pc.zones_seen))) + goto fail; + + tm.tm_year = to_year (pc.year) - TM_YEAR_BASE; + tm.tm_mon = pc.month - 1; + tm.tm_mday = pc.day; + if (pc.times_seen || (pc.rels_seen && ! pc.dates_seen && ! pc.days_seen)) + { + tm.tm_hour = to_hour (pc.hour, pc.meridian); + if (tm.tm_hour < 0) + goto fail; + tm.tm_min = pc.minutes; + tm.tm_sec = pc.seconds.tv_sec; + } + else + { + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + pc.seconds.tv_nsec = 0; + } + + /* Let mktime deduce tm_isdst if we have an absolute time stamp. */ + if (pc.dates_seen | pc.days_seen | pc.times_seen) + tm.tm_isdst = -1; + + /* But if the input explicitly specifies local time with or without + DST, give mktime that information. */ + if (pc.local_zones_seen) + tm.tm_isdst = pc.local_isdst; + + tm0 = tm; + + Start = mktime (&tm); + + if (! mktime_ok (&tm0, &tm, Start)) + { + if (! pc.zones_seen) + goto fail; + else + { + /* Guard against falsely reporting errors near the time_t + boundaries when parsing times in other time zones. For + example, suppose the input string "1969-12-31 23:00:00 -0100", + the current time zone is 8 hours ahead of UTC, and the min + time_t value is 1970-01-01 00:00:00 UTC. Then the min + localtime value is 1970-01-01 08:00:00, and mktime will + therefore fail on 1969-12-31 23:00:00. To work around the + problem, set the time zone to 1 hour behind UTC temporarily + by setting TZ="XXX1:00" and try mktime again. */ + + long int time_zone = pc.time_zone; + long int abs_time_zone = time_zone < 0 ? - time_zone : time_zone; + long int abs_time_zone_hour = abs_time_zone / 60; + int abs_time_zone_min = abs_time_zone % 60; + char tz1buf[sizeof "XXX+0:00" + + sizeof pc.time_zone * CHAR_BIT / 3]; + if (!tz_was_altered) + tz0 = get_tz (tz0buf); + sprintf (tz1buf, "XXX%s%ld:%02d", "-" + (time_zone < 0), + abs_time_zone_hour, abs_time_zone_min); + if (setenv ("TZ", tz1buf, 1) != 0) + goto fail; + tz_was_altered = true; + tm = tm0; + Start = mktime (&tm); + if (! mktime_ok (&tm0, &tm, Start)) + goto fail; + } + } + + 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))); + 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) + { + int year = tm.tm_year + pc.rel.year; + int month = tm.tm_mon + pc.rel.month; + int day = tm.tm_mday + pc.rel.day; + if (((year < tm.tm_year) ^ (pc.rel.year < 0)) + | ((month < tm.tm_mon) ^ (pc.rel.month < 0)) + | ((day < tm.tm_mday) ^ (pc.rel.day < 0))) + goto fail; + tm.tm_year = year; + tm.tm_mon = month; + tm.tm_mday = day; + tm.tm_hour = tm0.tm_hour; + tm.tm_min = tm0.tm_min; + tm.tm_sec = tm0.tm_sec; + tm.tm_isdst = tm0.tm_isdst; + Start = mktime (&tm); + if (Start == (time_t) -1) + goto fail; + } + + /* 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 + leap second. Typically this is not what the user wants, but it's + too hard to do it the other way, because the time zone indicator + must be applied before relative times, and if mktime is applied + again the time zone will be lost. */ + { + long int sum_ns = pc.seconds.tv_nsec + pc.rel.ns; + long int normalized_ns = (sum_ns % BILLION + BILLION) % BILLION; + time_t t0 = Start; + long int d1 = 60 * 60 * pc.rel.hour; + time_t t1 = t0 + d1; + long int d2 = 60 * pc.rel.minutes; + time_t t2 = t1 + d2; + long int d3 = pc.rel.seconds; + time_t t3 = t2 + d3; + long int d4 = (sum_ns - normalized_ns) / BILLION; + time_t t4 = t3 + d4; + + if ((d1 / (60 * 60) ^ pc.rel.hour) + | (d2 / 60 ^ pc.rel.minutes) + | ((t1 < t0) ^ (d1 < 0)) + | ((t2 < t1) ^ (d2 < 0)) + | ((t3 < t2) ^ (d3 < 0)) + | ((t4 < t3) ^ (d4 < 0))) + goto fail; + + result->tv_sec = t4; + result->tv_nsec = normalized_ns; + } + } + + goto done; + + fail: + ok = false; + done: + if (tz_was_altered) + ok &= (tz0 ? setenv ("TZ", tz0, 1) : unsetenv ("TZ")) == 0; + if (tz0 != tz0buf) + free (tz0); + return ok; +} + +#if TEST + +int +main (int ac, char **av) +{ + char buff[BUFSIZ]; + + printf ("Enter date, or blank line to exit.\n\t> "); + fflush (stdout); + + buff[BUFSIZ - 1] = '\0'; + while (fgets (buff, BUFSIZ - 1, stdin) && buff[0]) + { + struct timespec d; + struct tm const *tm; + if (! get_date (&d, buff, NULL)) + printf ("Bad format - couldn't convert.\n"); + else if (! (tm = localtime (&d.tv_sec))) + { + long int sec = d.tv_sec; + printf ("localtime (%ld) failed\n", sec); + } + else + { + int ns = d.tv_nsec; + printf ("%04ld-%02d-%02d %02d:%02d:%02d.%09d\n", + tm->tm_year + 1900L, tm->tm_mon + 1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, ns); + } + printf ("\t> "); + fflush (stdout); + } + return 0; +} +#endif /* TEST */ + diff --git a/lib/getdate.h b/lib/getdate.h new file mode 100644 index 0000000..142231e --- /dev/null +++ b/lib/getdate.h @@ -0,0 +1,23 @@ +/* Parse a string into an internal time stamp. + + Copyright (C) 1995, 1997, 1998, 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; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include +#include + +bool get_date (struct timespec *, char const *, struct timespec const *); diff --git a/lib/getdate.y b/lib/getdate.y new file mode 100644 index 0000000..cbf3ca1 --- /dev/null +++ b/lib/getdate.y @@ -0,0 +1,1520 @@ +%{ +/* Parse a string into an internal time stamp. + + Copyright (C) 1999, 2000, 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) + any 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. */ + +/* Originally written by Steven M. Bellovin while + at the University of North Carolina at Chapel Hill. Later tweaked by + a couple of people on Usenet. Completely overhauled by Rich $alz + and Jim Berets in August, 1990. + + Modified by Paul Eggert in August 1999 to do + the right thing about local DST. Also modified by Paul Eggert + in February 2004 to support + nanosecond-resolution time stamps, and in October 2004 to support + TZ strings in dates. */ + +/* FIXME: Check for arithmetic overflow in all cases, not just + some of them. */ + +#include + +#include "getdate.h" +#include "timespec.h" + +/* There's no need to extend the stack, so there's no need to involve + alloca. */ +#define YYSTACK_USE_ALLOCA 0 + +/* Tell Bison how much stack space is needed. 20 should be plenty for + this grammar, which is not right recursive. Beware setting it too + high, since that might cause problems on machines whose + implementations have lame stack-overflow checking. */ +#define YYMAXDEPTH 20 +#define YYINITDEPTH YYMAXDEPTH + +/* Since the code of getdate.y is not included in the Emacs executable + itself, there is no need to #define static in this file. Even if + the code were included in the Emacs executable, it probably + wouldn't do any harm to #undef it here; this will only cause + problems if we try to write to a static variable, which I don't + think this code needs to do. */ +#ifdef emacs +# undef static +#endif + +#include +#include +#include +#include +#include + +#include "setenv.h" +#include "xalloc.h" + + +/* ISDIGIT differs from isdigit, as follows: + - Its arg may be any int or unsigned int; it need not be an unsigned char + or EOF. + - It's typically faster. + POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to + isdigit unless it's important to use the locale's definition + of `digit' even when the host does not conform to POSIX. */ +#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) + +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# define __attribute__(x) +# endif +#endif + +#ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + +/* Shift A right by B bits portably, by dividing A by 2**B and + truncating towards minus infinity. A and B should be free of side + effects, and B should be in the range 0 <= B <= INT_BITS - 2, where + INT_BITS is the number of useful bits in an int. GNU code can + assume that INT_BITS is at least 32. + + ISO C99 says that A >> B is implementation-defined if A < 0. Some + implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift + right in the usual way when A < 0, so SHR falls back on division if + ordinary A >> B doesn't seem to be the usual signed shift. */ +#define SHR(a, b) \ + (-1 >> 1 == -1 \ + ? (a) >> (b) \ + : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0)) + +#define EPOCH_YEAR 1970 +#define TM_YEAR_BASE 1900 + +#define HOUR(x) ((x) * 60) + +/* An integer value, and the number of digits in its textual + representation. */ +typedef struct +{ + bool negative; + long int value; + size_t digits; +} textint; + +/* An entry in the lexical lookup table. */ +typedef struct +{ + char const *name; + int type; + int value; +} table; + +/* Meridian: am, pm, or 24-hour style. */ +enum { MERam, MERpm, MER24 }; + +enum { BILLION = 1000000000, LOG10_BILLION = 9 }; + +/* Relative times. */ +typedef struct +{ + /* Relative year, month, day, hour, minutes, seconds, and nanoseconds. */ + long int year; + long int month; + long int day; + long int hour; + long int minutes; + long int seconds; + long int ns; +} relative_time; + +#if HAVE_COMPOUND_LITERALS +# define RELATIVE_TIME_0 ((relative_time) { 0, 0, 0, 0, 0, 0, 0 }) +#else +static relative_time const RELATIVE_TIME_0; +#endif + +/* Information passed to and from the parser. */ +typedef struct +{ + /* The input string remaining to be parsed. */ + const char *input; + + /* N, if this is the Nth Tuesday. */ + long int day_ordinal; + + /* Day of week; Sunday is 0. */ + int day_number; + + /* tm_isdst flag for the local zone. */ + int local_isdst; + + /* Time zone, in minutes east of UTC. */ + long int time_zone; + + /* Style used for time. */ + int meridian; + + /* Gregorian year, month, day, hour, minutes, seconds, and nanoseconds. */ + textint year; + long int month; + long int day; + long int hour; + long int minutes; + struct timespec seconds; /* includes nanoseconds */ + + /* Relative year, month, day, hour, minutes, seconds, and nanoseconds. */ + relative_time rel; + + /* Presence or counts of nonterminals of various flavors parsed so far. */ + bool timespec_seen; + bool rels_seen; + size_t dates_seen; + size_t days_seen; + size_t local_zones_seen; + size_t dsts_seen; + size_t times_seen; + size_t zones_seen; + + /* Table of local time zone abbrevations, terminated by a null entry. */ + table local_time_zone_table[3]; +} parser_control; + +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); + +%} + +/* We want a reentrant parser, even if the TZ manipulation and the calls to + localtime and gmtime are not reentrant. */ +%pure-parser +%parse-param { parser_control *pc } +%lex-param { parser_control *pc } + +/* This grammar has 20 shift/reduce conflicts. */ +%expect 20 + +%union +{ + long int intval; + textint textintval; + struct timespec timespec; + relative_time rel; +} + +%token tAGO tDST + +%token tYEAR_UNIT tMONTH_UNIT tHOUR_UNIT tMINUTE_UNIT tSEC_UNIT +%token tDAY_UNIT + +%token tDAY tDAYZONE tLOCAL_ZONE tMERIDIAN +%token tMONTH tORDINAL tZONE + +%token tSNUMBER tUNUMBER +%token tSDECIMAL_NUMBER tUDECIMAL_NUMBER + +%type o_colon_minutes o_merid +%type seconds signed_seconds unsigned_seconds + +%type relunit relunit_snumber + +%% + +spec: + timespec + | items + ; + +timespec: + '@' seconds + { + pc->seconds = $2; + pc->timespec_seen = true; + } + ; + +items: + /* empty */ + | items item + ; + +item: + time + { pc->times_seen++; } + | local_zone + { pc->local_zones_seen++; } + | zone + { pc->zones_seen++; } + | date + { pc->dates_seen++; } + | day + { pc->days_seen++; } + | rel + { pc->rels_seen = true; } + | number + ; + +time: + tUNUMBER tMERIDIAN + { + pc->hour = $1.value; + pc->minutes = 0; + pc->seconds.tv_sec = 0; + pc->seconds.tv_nsec = 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; + 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; + pc->meridian = MER24; + pc->zones_seen++; + pc->time_zone = time_zone_hhmm ($4, $5); + } + | tUNUMBER ':' tUNUMBER ':' unsigned_seconds o_merid + { + pc->hour = $1.value; + pc->minutes = $3.value; + pc->seconds = $5; + pc->meridian = $6; + } + | tUNUMBER ':' tUNUMBER ':' unsigned_seconds tSNUMBER o_colon_minutes + { + pc->hour = $1.value; + pc->minutes = $3.value; + pc->seconds = $5; + pc->meridian = MER24; + pc->zones_seen++; + pc->time_zone = time_zone_hhmm ($6, $7); + } + ; + +local_zone: + tLOCAL_ZONE + { + pc->local_isdst = $1; + pc->dsts_seen += (0 < $1); + } + | tLOCAL_ZONE tDST + { + pc->local_isdst = 1; + pc->dsts_seen += (0 < $1) + 1; + } + ; + +zone: + tZONE + { 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; } + | tZONE tSNUMBER o_colon_minutes + { pc->time_zone = $1 + time_zone_hhmm ($2, $3); } + | tDAYZONE + { pc->time_zone = $1 + 60; } + | tZONE tDST + { pc->time_zone = $1 + 60; } + ; + +day: + tDAY + { + pc->day_ordinal = 1; + pc->day_number = $1; + } + | tDAY ',' + { + pc->day_ordinal = 1; + pc->day_number = $1; + } + | tORDINAL tDAY + { + pc->day_ordinal = $1; + pc->day_number = $2; + } + | tUNUMBER tDAY + { + pc->day_ordinal = $1.value; + pc->day_number = $2; + } + ; + +date: + tUNUMBER '/' tUNUMBER + { + pc->month = $1.value; + pc->day = $3.value; + } + | tUNUMBER '/' tUNUMBER '/' tUNUMBER + { + /* Interpret as YYYY/MM/DD if the first value has 4 or more digits, + otherwise as MM/DD/YY. + The goal in recognizing YYYY/MM/DD is solely to support legacy + machine-generated dates like those in an RCS log listing. If + you want portability, use the ISO 8601 format. */ + if (4 <= $1.digits) + { + pc->year = $1; + pc->month = $3.value; + pc->day = $5.value; + } + else + { + pc->month = $1.value; + pc->day = $3.value; + pc->year = $5; + } + } + | tUNUMBER tSNUMBER tSNUMBER + { + /* ISO 8601 format. YYYY-MM-DD. */ + pc->year = $1; + pc->month = -$2.value; + pc->day = -$3.value; + } + | tUNUMBER tMONTH tSNUMBER + { + /* e.g. 17-JUN-1992. */ + pc->day = $1.value; + pc->month = $2; + pc->year.value = -$3.value; + pc->year.digits = $3.digits; + } + | tMONTH tSNUMBER tSNUMBER + { + /* e.g. JUN-17-1992. */ + pc->month = $1; + pc->day = -$2.value; + pc->year.value = -$3.value; + pc->year.digits = $3.digits; + } + | tMONTH tUNUMBER + { + pc->month = $1; + pc->day = $2.value; + } + | tMONTH tUNUMBER ',' tUNUMBER + { + pc->month = $1; + pc->day = $2.value; + pc->year = $4; + } + | tUNUMBER tMONTH + { + pc->day = $1.value; + pc->month = $2; + } + | tUNUMBER tMONTH tUNUMBER + { + pc->day = $1.value; + pc->month = $2; + pc->year = $3; + } + ; + +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; + } + | 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; + } + ; + +relunit: + tORDINAL tYEAR_UNIT + { $$ = RELATIVE_TIME_0; $$.year = $1; } + | tUNUMBER tYEAR_UNIT + { $$ = RELATIVE_TIME_0; $$.year = $1.value; } + | tYEAR_UNIT + { $$ = RELATIVE_TIME_0; $$.year = 1; } + | tORDINAL tMONTH_UNIT + { $$ = RELATIVE_TIME_0; $$.month = $1; } + | tUNUMBER tMONTH_UNIT + { $$ = RELATIVE_TIME_0; $$.month = $1.value; } + | tMONTH_UNIT + { $$ = RELATIVE_TIME_0; $$.month = 1; } + | tORDINAL tDAY_UNIT + { $$ = RELATIVE_TIME_0; $$.day = $1 * $2; } + | tUNUMBER tDAY_UNIT + { $$ = RELATIVE_TIME_0; $$.day = $1.value * $2; } + | tDAY_UNIT + { $$ = RELATIVE_TIME_0; $$.day = $1; } + | tORDINAL tHOUR_UNIT + { $$ = RELATIVE_TIME_0; $$.hour = $1; } + | tUNUMBER tHOUR_UNIT + { $$ = RELATIVE_TIME_0; $$.hour = $1.value; } + | tHOUR_UNIT + { $$ = RELATIVE_TIME_0; $$.hour = 1; } + | tORDINAL tMINUTE_UNIT + { $$ = RELATIVE_TIME_0; $$.minutes = $1; } + | tUNUMBER tMINUTE_UNIT + { $$ = RELATIVE_TIME_0; $$.minutes = $1.value; } + | tMINUTE_UNIT + { $$ = RELATIVE_TIME_0; $$.minutes = 1; } + | tORDINAL tSEC_UNIT + { $$ = RELATIVE_TIME_0; $$.seconds = $1; } + | tUNUMBER tSEC_UNIT + { $$ = RELATIVE_TIME_0; $$.seconds = $1.value; } + | tSDECIMAL_NUMBER tSEC_UNIT + { $$ = RELATIVE_TIME_0; $$.seconds = $1.tv_sec; $$.ns = $1.tv_nsec; } + | tUDECIMAL_NUMBER tSEC_UNIT + { $$ = RELATIVE_TIME_0; $$.seconds = $1.tv_sec; $$.ns = $1.tv_nsec; } + | tSEC_UNIT + { $$ = RELATIVE_TIME_0; $$.seconds = 1; } + | relunit_snumber + ; + +relunit_snumber: + tSNUMBER tYEAR_UNIT + { $$ = RELATIVE_TIME_0; $$.year = $1.value; } + | tSNUMBER tMONTH_UNIT + { $$ = RELATIVE_TIME_0; $$.month = $1.value; } + | tSNUMBER tDAY_UNIT + { $$ = RELATIVE_TIME_0; $$.day = $1.value * $2; } + | tSNUMBER tHOUR_UNIT + { $$ = RELATIVE_TIME_0; $$.hour = $1.value; } + | tSNUMBER tMINUTE_UNIT + { $$ = RELATIVE_TIME_0; $$.minutes = $1.value; } + | tSNUMBER tSEC_UNIT + { $$ = RELATIVE_TIME_0; $$.seconds = $1.value; } + ; + +seconds: signed_seconds | unsigned_seconds; + +signed_seconds: + tSDECIMAL_NUMBER + | tSNUMBER + { $$.tv_sec = $1.value; $$.tv_nsec = 0; } + ; + +unsigned_seconds: + tUDECIMAL_NUMBER + | tUNUMBER + { $$.tv_sec = $1.value; $$.tv_nsec = 0; } + ; + +number: + tUNUMBER + { + 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; + } + } + } + ; + +o_colon_minutes: + /* empty */ + { $$ = -1; } + | ':' tUNUMBER + { $$ = $2.value; } + ; + +o_merid: + /* empty */ + { $$ = MER24; } + | tMERIDIAN + { $$ = $1; } + ; + +%% + +static table const meridian_table[] = +{ + { "AM", tMERIDIAN, MERam }, + { "A.M.", tMERIDIAN, MERam }, + { "PM", tMERIDIAN, MERpm }, + { "P.M.", tMERIDIAN, MERpm }, + { NULL, 0, 0 } +}; + +static table const dst_table[] = +{ + { "DST", tDST, 0 } +}; + +static table const month_and_day_table[] = +{ + { "JANUARY", tMONTH, 1 }, + { "FEBRUARY", tMONTH, 2 }, + { "MARCH", tMONTH, 3 }, + { "APRIL", tMONTH, 4 }, + { "MAY", tMONTH, 5 }, + { "JUNE", tMONTH, 6 }, + { "JULY", tMONTH, 7 }, + { "AUGUST", tMONTH, 8 }, + { "SEPTEMBER",tMONTH, 9 }, + { "SEPT", tMONTH, 9 }, + { "OCTOBER", tMONTH, 10 }, + { "NOVEMBER", tMONTH, 11 }, + { "DECEMBER", tMONTH, 12 }, + { "SUNDAY", tDAY, 0 }, + { "MONDAY", tDAY, 1 }, + { "TUESDAY", tDAY, 2 }, + { "TUES", tDAY, 2 }, + { "WEDNESDAY",tDAY, 3 }, + { "WEDNES", tDAY, 3 }, + { "THURSDAY", tDAY, 4 }, + { "THUR", tDAY, 4 }, + { "THURS", tDAY, 4 }, + { "FRIDAY", tDAY, 5 }, + { "SATURDAY", tDAY, 6 }, + { NULL, 0, 0 } +}; + +static table const time_units_table[] = +{ + { "YEAR", tYEAR_UNIT, 1 }, + { "MONTH", tMONTH_UNIT, 1 }, + { "FORTNIGHT",tDAY_UNIT, 14 }, + { "WEEK", tDAY_UNIT, 7 }, + { "DAY", tDAY_UNIT, 1 }, + { "HOUR", tHOUR_UNIT, 1 }, + { "MINUTE", tMINUTE_UNIT, 1 }, + { "MIN", tMINUTE_UNIT, 1 }, + { "SECOND", tSEC_UNIT, 1 }, + { "SEC", tSEC_UNIT, 1 }, + { NULL, 0, 0 } +}; + +/* 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 }, + { "LAST", tORDINAL, -1 }, + { "THIS", tORDINAL, 0 }, + { "NEXT", tORDINAL, 1 }, + { "FIRST", tORDINAL, 1 }, +/*{ "SECOND", tORDINAL, 2 }, */ + { "THIRD", tORDINAL, 3 }, + { "FOURTH", tORDINAL, 4 }, + { "FIFTH", tORDINAL, 5 }, + { "SIXTH", tORDINAL, 6 }, + { "SEVENTH", tORDINAL, 7 }, + { "EIGHTH", tORDINAL, 8 }, + { "NINTH", tORDINAL, 9 }, + { "TENTH", tORDINAL, 10 }, + { "ELEVENTH", tORDINAL, 11 }, + { "TWELFTH", tORDINAL, 12 }, + { "AGO", tAGO, 1 }, + { NULL, 0, 0 } +}; + +/* The universal time zone table. These labels can be used even for + time stamps that would not otherwise be valid, e.g., GMT time + stamps in London during summer. */ +static table const universal_time_zone_table[] = +{ + { "GMT", tZONE, HOUR ( 0) }, /* Greenwich Mean */ + { "UT", tZONE, HOUR ( 0) }, /* Universal (Coordinated) */ + { "UTC", tZONE, HOUR ( 0) }, + { NULL, 0, 0 } +}; + +/* The time zone table. This table is necessarily incomplete, as time + zone abbreviations are ambiguous; e.g. Australians interpret "EST" + as Eastern time in Australia, not as US Eastern Standard Time. + You cannot rely on getdate to handle arbitrary time zone + abbreviations; use numeric abbreviations like `-0500' instead. */ +static table const time_zone_table[] = +{ + { "WET", tZONE, HOUR ( 0) }, /* Western European */ + { "WEST", tDAYZONE, HOUR ( 0) }, /* Western European Summer */ + { "BST", tDAYZONE, HOUR ( 0) }, /* British Summer */ + { "ART", tZONE, -HOUR ( 3) }, /* Argentina */ + { "BRT", tZONE, -HOUR ( 3) }, /* Brazil */ + { "BRST", tDAYZONE, -HOUR ( 3) }, /* Brazil Summer */ + { "NST", tZONE, -(HOUR ( 3) + 30) }, /* Newfoundland Standard */ + { "NDT", tDAYZONE,-(HOUR ( 3) + 30) }, /* Newfoundland Daylight */ + { "AST", tZONE, -HOUR ( 4) }, /* Atlantic Standard */ + { "ADT", tDAYZONE, -HOUR ( 4) }, /* Atlantic Daylight */ + { "CLT", tZONE, -HOUR ( 4) }, /* Chile */ + { "CLST", tDAYZONE, -HOUR ( 4) }, /* Chile Summer */ + { "EST", tZONE, -HOUR ( 5) }, /* Eastern Standard */ + { "EDT", tDAYZONE, -HOUR ( 5) }, /* Eastern Daylight */ + { "CST", tZONE, -HOUR ( 6) }, /* Central Standard */ + { "CDT", tDAYZONE, -HOUR ( 6) }, /* Central Daylight */ + { "MST", tZONE, -HOUR ( 7) }, /* Mountain Standard */ + { "MDT", tDAYZONE, -HOUR ( 7) }, /* Mountain Daylight */ + { "PST", tZONE, -HOUR ( 8) }, /* Pacific Standard */ + { "PDT", tDAYZONE, -HOUR ( 8) }, /* Pacific Daylight */ + { "AKST", tZONE, -HOUR ( 9) }, /* Alaska Standard */ + { "AKDT", tDAYZONE, -HOUR ( 9) }, /* Alaska Daylight */ + { "HST", tZONE, -HOUR (10) }, /* Hawaii Standard */ + { "HAST", tZONE, -HOUR (10) }, /* Hawaii-Aleutian Standard */ + { "HADT", tDAYZONE, -HOUR (10) }, /* Hawaii-Aleutian Daylight */ + { "SST", tZONE, -HOUR (12) }, /* Samoa Standard */ + { "WAT", tZONE, HOUR ( 1) }, /* West Africa */ + { "CET", tZONE, HOUR ( 1) }, /* Central European */ + { "CEST", tDAYZONE, HOUR ( 1) }, /* Central European Summer */ + { "MET", tZONE, HOUR ( 1) }, /* Middle European */ + { "MEZ", tZONE, HOUR ( 1) }, /* Middle European */ + { "MEST", tDAYZONE, HOUR ( 1) }, /* Middle European Summer */ + { "MESZ", tDAYZONE, HOUR ( 1) }, /* Middle European Summer */ + { "EET", tZONE, HOUR ( 2) }, /* Eastern European */ + { "EEST", tDAYZONE, HOUR ( 2) }, /* Eastern European Summer */ + { "CAT", tZONE, HOUR ( 2) }, /* Central Africa */ + { "SAST", tZONE, HOUR ( 2) }, /* South Africa Standard */ + { "EAT", tZONE, HOUR ( 3) }, /* East Africa */ + { "MSK", tZONE, HOUR ( 3) }, /* Moscow */ + { "MSD", tDAYZONE, HOUR ( 3) }, /* Moscow Daylight */ + { "IST", tZONE, (HOUR ( 5) + 30) }, /* India Standard */ + { "SGT", tZONE, HOUR ( 8) }, /* Singapore */ + { "KST", tZONE, HOUR ( 9) }, /* Korea Standard */ + { "JST", tZONE, HOUR ( 9) }, /* Japan Standard */ + { "GST", tZONE, HOUR (10) }, /* Guam Standard */ + { "NZST", tZONE, HOUR (12) }, /* New Zealand Standard */ + { "NZDT", tDAYZONE, HOUR (12) }, /* New Zealand Daylight */ + { NULL, 0, 0 } +}; + +/* Military time zone table. */ +static table const military_table[] = +{ + { "A", tZONE, -HOUR ( 1) }, + { "B", tZONE, -HOUR ( 2) }, + { "C", tZONE, -HOUR ( 3) }, + { "D", tZONE, -HOUR ( 4) }, + { "E", tZONE, -HOUR ( 5) }, + { "F", tZONE, -HOUR ( 6) }, + { "G", tZONE, -HOUR ( 7) }, + { "H", tZONE, -HOUR ( 8) }, + { "I", tZONE, -HOUR ( 9) }, + { "K", tZONE, -HOUR (10) }, + { "L", tZONE, -HOUR (11) }, + { "M", tZONE, -HOUR (12) }, + { "N", tZONE, HOUR ( 1) }, + { "O", tZONE, HOUR ( 2) }, + { "P", tZONE, HOUR ( 3) }, + { "Q", tZONE, HOUR ( 4) }, + { "R", tZONE, HOUR ( 5) }, + { "S", tZONE, HOUR ( 6) }, + { "T", tZONE, HOUR ( 7) }, + { "U", tZONE, HOUR ( 8) }, + { "V", tZONE, HOUR ( 9) }, + { "W", tZONE, HOUR (10) }, + { "X", tZONE, HOUR (11) }, + { "Y", tZONE, HOUR (12) }, + { "Z", tZONE, HOUR ( 0) }, + { NULL, 0, 0 } +}; + + + +/* 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. */ + +static long int +time_zone_hhmm (textint s, long int mm) +{ + if (mm < 0) + return (s.value / 100) * 60 + s.value % 100; + else + return s.value * 60 + (s.negative ? -mm : mm); +} + +static int +to_hour (long int hours, int meridian) +{ + switch (meridian) + { + default: /* Pacify GCC. */ + case MER24: + return 0 <= hours && hours < 24 ? hours : -1; + case MERam: + return 0 < hours && hours < 12 ? hours : hours == 12 ? 0 : -1; + case MERpm: + return 0 < hours && hours < 12 ? hours + 12 : hours == 12 ? 12 : -1; + } +} + +static long int +to_year (textint textyear) +{ + long int year = textyear.value; + + if (year < 0) + year = -year; + + /* XPG4 suggests that years 00-68 map to 2000-2068, and + years 69-99 map to 1969-1999. */ + else if (textyear.digits == 2) + year += year < 69 ? 2000 : 1900; + + return year; +} + +static table const * +lookup_zone (parser_control const *pc, char const *name) +{ + table const *tp; + + for (tp = universal_time_zone_table; tp->name; tp++) + if (strcmp (name, tp->name) == 0) + return tp; + + /* Try local zone abbreviations before those in time_zone_table, as + the local ones are more likely to be right. */ + for (tp = pc->local_time_zone_table; tp->name; tp++) + if (strcmp (name, tp->name) == 0) + return tp; + + for (tp = time_zone_table; tp->name; tp++) + if (strcmp (name, tp->name) == 0) + return tp; + + return NULL; +} + +#if ! HAVE_TM_GMTOFF +/* Yield the difference between *A and *B, + measured in seconds, ignoring leap seconds. + The body of this function is taken directly from the GNU C Library; + see src/strftime.c. */ +static long int +tm_diff (struct tm const *a, struct tm const *b) +{ + /* Compute intervening leap days correctly even if year is negative. + Take care to avoid int overflow in leap day calculations. */ + int a4 = SHR (a->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (a->tm_year & 3); + int b4 = SHR (b->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (b->tm_year & 3); + int a100 = a4 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 0); + int a400 = SHR (a100, 2); + int b400 = SHR (b100, 2); + int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); + long int ayear = a->tm_year; + long int years = ayear - b->tm_year; + long int days = (365 * years + intervening_leap_days + + (a->tm_yday - b->tm_yday)); + return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + + (a->tm_min - b->tm_min)) + + (a->tm_sec - b->tm_sec)); +} +#endif /* ! HAVE_TM_GMTOFF */ + +static table const * +lookup_word (parser_control const *pc, char *word) +{ + char *p; + char *q; + size_t wordlen; + table const *tp; + bool period_found; + bool abbrev; + + /* Make it uppercase. */ + for (p = word; *p; p++) + { + unsigned char ch = *p; + *p = toupper (ch); + } + + for (tp = meridian_table; tp->name; tp++) + if (strcmp (word, tp->name) == 0) + return tp; + + /* See if we have an abbreviation for a month. */ + wordlen = strlen (word); + abbrev = wordlen == 3 || (wordlen == 4 && word[3] == '.'); + + for (tp = month_and_day_table; tp->name; tp++) + if ((abbrev ? strncmp (word, tp->name, 3) : strcmp (word, tp->name)) == 0) + return tp; + + if ((tp = lookup_zone (pc, word))) + return tp; + + if (strcmp (word, dst_table[0].name) == 0) + return dst_table; + + for (tp = time_units_table; tp->name; tp++) + if (strcmp (word, tp->name) == 0) + return tp; + + /* Strip off any plural and try the units table again. */ + if (word[wordlen - 1] == 'S') + { + word[wordlen - 1] = '\0'; + for (tp = time_units_table; tp->name; tp++) + if (strcmp (word, tp->name) == 0) + return tp; + word[wordlen - 1] = 'S'; /* For "this" in relative_time_table. */ + } + + for (tp = relative_time_table; tp->name; tp++) + if (strcmp (word, tp->name) == 0) + return tp; + + /* Military time zones. */ + if (wordlen == 1) + for (tp = military_table; tp->name; tp++) + if (word[0] == tp->name[0]) + return tp; + + /* Drop out any periods and try the time zone table again. */ + for (period_found = false, p = q = word; (*p = *q); q++) + if (*q == '.') + period_found = true; + else + p++; + if (period_found && (tp = lookup_zone (pc, word))) + return tp; + + return NULL; +} + +static int +yylex (YYSTYPE *lvalp, parser_control *pc) +{ + unsigned char c; + size_t count; + + for (;;) + { + while (c = *pc->input, isspace (c)) + pc->input++; + + if (ISDIGIT (c) || c == '-' || c == '+') + { + char const *p; + int sign; + unsigned long int value; + if (c == '-' || c == '+') + { + sign = c == '-' ? -1 : 1; + while (c = *++pc->input, isspace (c)) + continue; + if (! ISDIGIT (c)) + /* skip the '-' sign */ + continue; + } + else + sign = 0; + p = pc->input; + for (value = 0; ; value *= 10) + { + unsigned long int value1 = value + (c - '0'); + if (value1 < value) + return '?'; + value = value1; + c = *++p; + if (! ISDIGIT (c)) + break; + if (ULONG_MAX / 10 < value) + return '?'; + } + if ((c == '.' || c == ',') && ISDIGIT (p[1])) + { + time_t s; + int ns; + int digits; + unsigned long int value1; + + /* Check for overflow when converting value to time_t. */ + if (sign < 0) + { + s = - value; + if (0 < s) + return '?'; + value1 = -s; + } + else + { + s = value; + if (s < 0) + return '?'; + value1 = s; + } + if (value != value1) + return '?'; + + /* Accumulate fraction, to ns precision. */ + p++; + ns = *p++ - '0'; + for (digits = 2; digits <= LOG10_BILLION; digits++) + { + ns *= 10; + if (ISDIGIT (*p)) + ns += *p++ - '0'; + } + + /* Skip excess digits, truncating toward -Infinity. */ + if (sign < 0) + for (; ISDIGIT (*p); p++) + if (*p != '0') + { + ns++; + break; + } + while (ISDIGIT (*p)) + p++; + + /* Adjust to the timespec convention, which is that + tv_nsec is always a positive offset even if tv_sec is + negative. */ + if (sign < 0 && ns) + { + s--; + if (! (s < 0)) + return '?'; + ns = BILLION - ns; + } + + lvalp->timespec.tv_sec = s; + lvalp->timespec.tv_nsec = ns; + pc->input = p; + return sign ? tSDECIMAL_NUMBER : tUDECIMAL_NUMBER; + } + else + { + lvalp->textintval.negative = sign < 0; + if (sign < 0) + { + lvalp->textintval.value = - value; + if (0 < lvalp->textintval.value) + return '?'; + } + else + { + lvalp->textintval.value = value; + if (lvalp->textintval.value < 0) + return '?'; + } + lvalp->textintval.digits = p - pc->input; + pc->input = p; + return sign ? tSNUMBER : tUNUMBER; + } + } + + if (isalpha (c)) + { + char buff[20]; + char *p = buff; + table const *tp; + + do + { + if (p < buff + sizeof buff - 1) + *p++ = c; + c = *++pc->input; + } + while (isalpha (c) || c == '.'); + + *p = '\0'; + tp = lookup_word (pc, buff); + if (! tp) + return '?'; + lvalp->intval = tp->value; + return tp->type; + } + + if (c != '(') + return *pc->input++; + count = 0; + do + { + c = *pc->input++; + if (c == '\0') + return c; + if (c == '(') + count++; + else if (c == ')') + count--; + } + while (count != 0); + } +} + +/* Do nothing if the parser reports an error. */ +static int +yyerror (parser_control const *pc ATTRIBUTE_UNUSED, + char const *s ATTRIBUTE_UNUSED) +{ + return 0; +} + +/* If *TM0 is the old and *TM1 is the new value of a struct tm after + passing it to mktime, return true if it's OK that mktime returned T. + It's not OK if *TM0 has out-of-range members. */ + +static bool +mktime_ok (struct tm const *tm0, struct tm const *tm1, time_t t) +{ + if (t == (time_t) -1) + { + /* Guard against falsely reporting an error when parsing a time + stamp that happens to equal (time_t) -1, on a host that + supports such a time stamp. */ + tm1 = localtime (&t); + if (!tm1) + return false; + } + + return ! ((tm0->tm_sec ^ tm1->tm_sec) + | (tm0->tm_min ^ tm1->tm_min) + | (tm0->tm_hour ^ tm1->tm_hour) + | (tm0->tm_mday ^ tm1->tm_mday) + | (tm0->tm_mon ^ tm1->tm_mon) + | (tm0->tm_year ^ tm1->tm_year)); +} + +/* A reasonable upper bound for the size of ordinary TZ strings. + Use heap allocation if TZ's length exceeds this. */ +enum { TZBUFSIZE = 100 }; + +/* Return a copy of TZ, stored in TZBUF if it fits, and heap-allocated + otherwise. */ +static char * +get_tz (char tzbuf[TZBUFSIZE]) +{ + char *tz = getenv ("TZ"); + if (tz) + { + size_t tzsize = strlen (tz) + 1; + tz = (tzsize <= TZBUFSIZE + ? memcpy (tzbuf, tz, tzsize) + : xmemdup (tz, tzsize)); + } + return tz; +} + +/* Parse a date/time string, storing the resulting time value into *RESULT. + The string itself is pointed to by P. Return true if successful. + P can be an incomplete or relative time specification; if so, use + *NOW as the basis for the returned time. */ +bool +get_date (struct timespec *result, char const *p, struct timespec const *now) +{ + time_t Start; + long int Start_ns; + struct tm const *tmp; + struct tm tm; + struct tm tm0; + parser_control pc; + struct timespec gettime_buffer; + unsigned char c; + bool tz_was_altered = false; + char *tz0 = NULL; + char tz0buf[TZBUFSIZE]; + bool ok = true; + + if (! now) + { + gettime (&gettime_buffer); + now = &gettime_buffer; + } + + Start = now->tv_sec; + Start_ns = now->tv_nsec; + + tmp = localtime (&now->tv_sec); + if (! tmp) + return false; + + while (c = *p, isspace (c)) + p++; + + if (strncmp (p, "TZ=\"", 4) == 0) + { + char const *tzbase = p + 4; + size_t tzsize = 1; + char const *s; + + for (s = tzbase; *s; s++, tzsize++) + if (*s == '\\') + { + s++; + if (! (*s == '\\' || *s == '"')) + break; + } + else if (*s == '"') + { + char *z; + char *tz1; + char tz1buf[TZBUFSIZE]; + bool large_tz = TZBUFSIZE < tzsize; + bool setenv_ok; + tz0 = get_tz (tz0buf); + z = tz1 = large_tz ? xmalloc (tzsize) : tz1buf; + for (s = tzbase; *s != '"'; s++) + *z++ = *(s += *s == '\\'); + *z = '\0'; + setenv_ok = setenv ("TZ", tz1, 1) == 0; + if (large_tz) + free (tz1); + if (!setenv_ok) + goto fail; + tz_was_altered = true; + p = s + 1; + } + } + + pc.input = p; + pc.year.value = tmp->tm_year; + pc.year.value += TM_YEAR_BASE; + pc.year.digits = 0; + pc.month = tmp->tm_mon + 1; + pc.day = tmp->tm_mday; + pc.hour = tmp->tm_hour; + pc.minutes = tmp->tm_min; + pc.seconds.tv_sec = tmp->tm_sec; + pc.seconds.tv_nsec = Start_ns; + tm.tm_isdst = tmp->tm_isdst; + + pc.meridian = MER24; + pc.rel = RELATIVE_TIME_0; + pc.timespec_seen = false; + pc.rels_seen = false; + pc.dates_seen = 0; + pc.days_seen = 0; + pc.times_seen = 0; + pc.local_zones_seen = 0; + pc.dsts_seen = 0; + pc.zones_seen = 0; + +#if HAVE_STRUCT_TM_TM_ZONE + pc.local_time_zone_table[0].name = tmp->tm_zone; + pc.local_time_zone_table[0].type = tLOCAL_ZONE; + pc.local_time_zone_table[0].value = tmp->tm_isdst; + pc.local_time_zone_table[1].name = NULL; + + /* Probe the names used in the next three calendar quarters, looking + for a tm_isdst different from the one we already have. */ + { + int quarter; + for (quarter = 1; quarter <= 3; quarter++) + { + time_t probe = Start + quarter * (90 * 24 * 60 * 60); + struct tm const *probe_tm = localtime (&probe); + if (probe_tm && probe_tm->tm_zone + && probe_tm->tm_isdst != pc.local_time_zone_table[0].value) + { + { + pc.local_time_zone_table[1].name = probe_tm->tm_zone; + pc.local_time_zone_table[1].type = tLOCAL_ZONE; + pc.local_time_zone_table[1].value = probe_tm->tm_isdst; + pc.local_time_zone_table[2].name = NULL; + } + break; + } + } + } +#else +#if HAVE_TZNAME + { +# ifndef tzname + extern char *tzname[]; +# endif + int i; + for (i = 0; i < 2; i++) + { + pc.local_time_zone_table[i].name = tzname[i]; + pc.local_time_zone_table[i].type = tLOCAL_ZONE; + pc.local_time_zone_table[i].value = i; + } + pc.local_time_zone_table[i].name = NULL; + } +#else + pc.local_time_zone_table[0].name = NULL; +#endif +#endif + + if (pc.local_time_zone_table[0].name && pc.local_time_zone_table[1].name + && ! strcmp (pc.local_time_zone_table[0].name, + pc.local_time_zone_table[1].name)) + { + /* This locale uses the same abbrevation for standard and + daylight times. So if we see that abbreviation, we don't + know whether it's daylight time. */ + pc.local_time_zone_table[0].value = -1; + pc.local_time_zone_table[1].name = NULL; + } + + if (yyparse (&pc) != 0) + goto fail; + + if (pc.timespec_seen) + *result = pc.seconds; + else + { + if (1 < (pc.times_seen | pc.dates_seen | pc.days_seen | pc.dsts_seen + | (pc.local_zones_seen + pc.zones_seen))) + goto fail; + + tm.tm_year = to_year (pc.year) - TM_YEAR_BASE; + tm.tm_mon = pc.month - 1; + tm.tm_mday = pc.day; + if (pc.times_seen || (pc.rels_seen && ! pc.dates_seen && ! pc.days_seen)) + { + tm.tm_hour = to_hour (pc.hour, pc.meridian); + if (tm.tm_hour < 0) + goto fail; + tm.tm_min = pc.minutes; + tm.tm_sec = pc.seconds.tv_sec; + } + else + { + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + pc.seconds.tv_nsec = 0; + } + + /* Let mktime deduce tm_isdst if we have an absolute time stamp. */ + if (pc.dates_seen | pc.days_seen | pc.times_seen) + tm.tm_isdst = -1; + + /* But if the input explicitly specifies local time with or without + DST, give mktime that information. */ + if (pc.local_zones_seen) + tm.tm_isdst = pc.local_isdst; + + tm0 = tm; + + Start = mktime (&tm); + + if (! mktime_ok (&tm0, &tm, Start)) + { + if (! pc.zones_seen) + goto fail; + else + { + /* Guard against falsely reporting errors near the time_t + boundaries when parsing times in other time zones. For + example, suppose the input string "1969-12-31 23:00:00 -0100", + the current time zone is 8 hours ahead of UTC, and the min + time_t value is 1970-01-01 00:00:00 UTC. Then the min + localtime value is 1970-01-01 08:00:00, and mktime will + therefore fail on 1969-12-31 23:00:00. To work around the + problem, set the time zone to 1 hour behind UTC temporarily + by setting TZ="XXX1:00" and try mktime again. */ + + long int time_zone = pc.time_zone; + long int abs_time_zone = time_zone < 0 ? - time_zone : time_zone; + long int abs_time_zone_hour = abs_time_zone / 60; + int abs_time_zone_min = abs_time_zone % 60; + char tz1buf[sizeof "XXX+0:00" + + sizeof pc.time_zone * CHAR_BIT / 3]; + if (!tz_was_altered) + tz0 = get_tz (tz0buf); + sprintf (tz1buf, "XXX%s%ld:%02d", "-" + (time_zone < 0), + abs_time_zone_hour, abs_time_zone_min); + if (setenv ("TZ", tz1buf, 1) != 0) + goto fail; + tz_was_altered = true; + tm = tm0; + Start = mktime (&tm); + if (! mktime_ok (&tm0, &tm, Start)) + goto fail; + } + } + + 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))); + 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) + { + int year = tm.tm_year + pc.rel.year; + int month = tm.tm_mon + pc.rel.month; + int day = tm.tm_mday + pc.rel.day; + if (((year < tm.tm_year) ^ (pc.rel.year < 0)) + | ((month < tm.tm_mon) ^ (pc.rel.month < 0)) + | ((day < tm.tm_mday) ^ (pc.rel.day < 0))) + goto fail; + tm.tm_year = year; + tm.tm_mon = month; + tm.tm_mday = day; + tm.tm_hour = tm0.tm_hour; + tm.tm_min = tm0.tm_min; + tm.tm_sec = tm0.tm_sec; + tm.tm_isdst = tm0.tm_isdst; + Start = mktime (&tm); + if (Start == (time_t) -1) + goto fail; + } + + /* 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 + leap second. Typically this is not what the user wants, but it's + too hard to do it the other way, because the time zone indicator + must be applied before relative times, and if mktime is applied + again the time zone will be lost. */ + { + long int sum_ns = pc.seconds.tv_nsec + pc.rel.ns; + long int normalized_ns = (sum_ns % BILLION + BILLION) % BILLION; + time_t t0 = Start; + long int d1 = 60 * 60 * pc.rel.hour; + time_t t1 = t0 + d1; + long int d2 = 60 * pc.rel.minutes; + time_t t2 = t1 + d2; + long int d3 = pc.rel.seconds; + time_t t3 = t2 + d3; + long int d4 = (sum_ns - normalized_ns) / BILLION; + time_t t4 = t3 + d4; + + if ((d1 / (60 * 60) ^ pc.rel.hour) + | (d2 / 60 ^ pc.rel.minutes) + | ((t1 < t0) ^ (d1 < 0)) + | ((t2 < t1) ^ (d2 < 0)) + | ((t3 < t2) ^ (d3 < 0)) + | ((t4 < t3) ^ (d4 < 0))) + goto fail; + + result->tv_sec = t4; + result->tv_nsec = normalized_ns; + } + } + + goto done; + + fail: + ok = false; + done: + if (tz_was_altered) + ok &= (tz0 ? setenv ("TZ", tz0, 1) : unsetenv ("TZ")) == 0; + if (tz0 != tz0buf) + free (tz0); + return ok; +} + +#if TEST + +int +main (int ac, char **av) +{ + char buff[BUFSIZ]; + + printf ("Enter date, or blank line to exit.\n\t> "); + fflush (stdout); + + buff[BUFSIZ - 1] = '\0'; + while (fgets (buff, BUFSIZ - 1, stdin) && buff[0]) + { + struct timespec d; + struct tm const *tm; + if (! get_date (&d, buff, NULL)) + printf ("Bad format - couldn't convert.\n"); + else if (! (tm = localtime (&d.tv_sec))) + { + long int sec = d.tv_sec; + printf ("localtime (%ld) failed\n", sec); + } + else + { + int ns = d.tv_nsec; + printf ("%04ld-%02d-%02d %02d:%02d:%02d.%09d\n", + tm->tm_year + 1900L, tm->tm_mon + 1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, ns); + } + printf ("\t> "); + fflush (stdout); + } + return 0; +} +#endif /* TEST */ diff --git a/lib/getopt.c b/lib/getopt.c new file mode 100644 index 0000000..3580ad8 --- /dev/null +++ b/lib/getopt.c @@ -0,0 +1,1191 @@ +/* Getopt for GNU. + 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 + 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 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 _LIBC +# include +#endif + +#include "getopt.h" + +#include +#include +#include +#include + +#ifdef __VMS +# include +#endif + +#ifdef _LIBC +# include +#else +# include "gettext.h" +# define _(msgid) gettext (msgid) +#endif + +#if defined _LIBC && defined USE_IN_LIBIO +# include +#endif + +#ifndef attribute_hidden +# define attribute_hidden +#endif + +/* Unlike standard Unix `getopt', functions like `getopt_long' + let the user intersperse the options with the other arguments. + + As `getopt_long' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Using `getopt' or setting the environment variable POSIXLY_CORRECT + disables permutation. + Then the application's behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt_int.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Keep a global copy of all internal members of getopt_data. */ + +static struct _getopt_data getopt_data; + + +#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV +extern char *getenv (); +#endif + +#ifdef _LIBC +/* Stored original parameters. + XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ +extern int __libc_argc; +extern char **__libc_argv; + +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +# ifdef USE_NONOPTION_FLAGS +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; +# endif + +# ifdef USE_NONOPTION_FLAGS +# define SWAP_FLAGS(ch1, ch2) \ + if (d->__nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +# else +# define SWAP_FLAGS(ch1, ch2) +# endif +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +static void +exchange (char **argv, struct _getopt_data *d) +{ + int bottom = d->__first_nonopt; + int middle = d->__last_nonopt; + int top = d->optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + d->__nonoption_flags_max_len), + '\0', top + 1 - d->__nonoption_flags_max_len); + d->__nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + d->__first_nonopt += (d->optind - d->__last_nonopt); + d->__last_nonopt = d->optind; +} + +/* Initialize the internal data when the first call is made. */ + +static const char * +_getopt_initialize (int argc, char **argv, const char *optstring, + int posixly_correct, struct _getopt_data *d) +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + d->__first_nonopt = d->__last_nonopt = d->optind; + + d->__nextchar = NULL; + + d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + d->__ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + d->__ordering = REQUIRE_ORDER; + ++optstring; + } + else if (d->__posixly_correct) + d->__ordering = REQUIRE_ORDER; + else + d->__ordering = PERMUTE; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + if (!d->__posixly_correct + && argc == __libc_argc && argv == __libc_argv) + { + if (d->__nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + d->__nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = d->__nonoption_flags_max_len = strlen (orig_str); + if (d->__nonoption_flags_max_len < argc) + d->__nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (d->__nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + d->__nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', d->__nonoption_flags_max_len - len); + } + } + d->__nonoption_flags_len = d->__nonoption_flags_max_len; + } + else + d->__nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. + + If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT + environment variable were set. */ + +int +_getopt_internal_r (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct, struct _getopt_data *d) +{ + int print_errors = d->opterr; + if (optstring[0] == ':') + print_errors = 0; + + if (argc < 1) + return -1; + + d->optarg = NULL; + + if (d->optind == 0 || !d->__initialized) + { + if (d->optind == 0) + d->optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring, + posixly_correct, d); + d->__initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#if defined _LIBC && defined USE_NONOPTION_FLAGS +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ + || (d->optind < d->__nonoption_flags_len \ + && __getopt_nonoption_flags[d->optind] == '1')) +#else +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') +#endif + + if (d->__nextchar == NULL || *d->__nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (d->__last_nonopt > d->optind) + d->__last_nonopt = d->optind; + if (d->__first_nonopt > d->optind) + d->__first_nonopt = d->optind; + + if (d->__ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__last_nonopt != d->optind) + d->__first_nonopt = d->optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (d->optind < argc && NONOPTION_P) + d->optind++; + d->__last_nonopt = d->optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (d->optind != argc && !strcmp (argv[d->optind], "--")) + { + d->optind++; + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__first_nonopt == d->__last_nonopt) + d->__first_nonopt = d->optind; + d->__last_nonopt = argc; + + d->optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (d->optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (d->__first_nonopt != d->__last_nonopt) + d->optind = d->__first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (d->__ordering == REQUIRE_ORDER) + return -1; + d->optarg = argv[d->optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + d->__nextchar = (argv[d->optind] + 1 + + (longopts != NULL && argv[d->optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[d->optind][1] == '-' + || (long_only && (argv[d->optind][2] + || !strchr (optstring, argv[d->optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) + { + if ((unsigned int) (nameend - d->__nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else if (long_only + || pfound->has_arg != p->has_arg + || pfound->flag != p->flag + || pfound->val != p->val) + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[d->optind]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[d->optind]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optind++; + d->optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + d->optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + d->optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[d->optind - 1][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("\ +%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); +#else + fprintf (stderr, _("\ +%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("\ +%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[d->optind - 1][0], + pfound->name); +#else + fprintf (stderr, _("\ +%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[d->optind - 1][0], + pfound->name); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + + d->__nextchar += strlen (d->__nextchar); + + d->optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (d->optind < argc) + d->optarg = argv[d->optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + d->__nextchar += strlen (d->__nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[d->optind][1] == '-' + || strchr (optstring, *d->__nextchar) == NULL) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[d->optind][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), + argv[0], d->__nextchar); +#else + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], d->__nextchar); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[d->optind][0], d->__nextchar); +#else + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[d->optind][0], d->__nextchar); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + d->__nextchar = (char *) ""; + d->optind++; + d->optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *d->__nextchar++; + char *temp = strchr (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*d->__nextchar == '\0') + ++d->optind; + + if (temp == NULL || c == ':') + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (d->__posixly_correct) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: illegal option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); +#endif + } + else + { +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: invalid option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + d->optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + d->optind++; + } + else if (d->optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, + _("%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); +#endif + } + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `d->optind' once; + increment it again when taking next ARGV-elt as argument. */ + d->optarg = argv[d->optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; + nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) + { + if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[d->optind]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[d->optind]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + d->optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); +#endif + } + + d->__nextchar += strlen (d->__nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (d->optind < argc) + d->optarg = argv[d->optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + d->__nextchar += strlen (d->__nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + d->__nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + d->optind++; + } + else + d->optarg = NULL; + d->__nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + d->optind++; + } + else if (d->optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); +#endif + } + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + d->optarg = argv[d->optind++]; + d->__nextchar = NULL; + } + } + return c; + } +} + +int +_getopt_internal (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct) +{ + int result; + + getopt_data.optind = optind; + getopt_data.opterr = opterr; + + result = _getopt_internal_r (argc, argv, optstring, longopts, longind, + long_only, posixly_correct, &getopt_data); + + optind = getopt_data.optind; + optarg = getopt_data.optarg; + optopt = getopt_data.optopt; + + return result; +} + +/* glibc gets a LSB-compliant getopt. + Standalone applications get a POSIX-compliant getopt. */ +#if _LIBC +enum { POSIXLY_CORRECT = 0 }; +#else +enum { POSIXLY_CORRECT = 1 }; +#endif + +int +getopt (int argc, char *const *argv, const char *optstring) +{ + return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, + POSIXLY_CORRECT); +} + + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/lib/getopt1.c b/lib/getopt1.c new file mode 100644 index 0000000..cc0746e --- /dev/null +++ b/lib/getopt1.c @@ -0,0 +1,171 @@ +/* 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 + 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 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. */ + +#ifdef _LIBC +# include +#else +# include +# include "getopt.h" +#endif +#include "getopt_int.h" + +#include + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, + const struct option *long_options, int *opt_index) +{ + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 0, 0); +} + +int +_getopt_long_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 0, 0, d); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (int argc, char *__getopt_argv_const *argv, + const char *options, + const struct option *long_options, int *opt_index) +{ + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 1, 0); +} + +int +_getopt_long_only_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 1, 0, d); +} + + +#ifdef TEST + +#include + +int +main (int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/lib/getopt_.h b/lib/getopt_.h new file mode 100644 index 0000000..615ef9a --- /dev/null +++ b/lib/getopt_.h @@ -0,0 +1,226 @@ +/* Declarations for getopt. + Copyright (C) 1989-1994,1996-1999,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) + any 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 _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +/* Standalone applications should #define __GETOPT_PREFIX to an + identifier that prefixes the external functions and variables + defined in this header. When this happens, include the + headers that might declare getopt so that they will not cause + confusion if included after this file. Then systematically rename + identifiers so that they do not collide with the system functions + and variables. Renaming avoids problems with some compilers and + linkers. */ +#if defined __GETOPT_PREFIX && !defined __need_getopt +# include +# include +# include +# undef __need_getopt +# undef getopt +# undef getopt_long +# undef getopt_long_only +# undef optarg +# undef opterr +# undef optind +# undef optopt +# define __GETOPT_CONCAT(x, y) x ## y +# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) +# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) +# define getopt __GETOPT_ID (getopt) +# define getopt_long __GETOPT_ID (getopt_long) +# define getopt_long_only __GETOPT_ID (getopt_long_only) +# define optarg __GETOPT_ID (optarg) +# define opterr __GETOPT_ID (opterr) +# define optind __GETOPT_ID (optind) +# define optopt __GETOPT_ID (optopt) +#endif + +/* Standalone applications get correct prototypes for getopt_long and + getopt_long_only; they declare "char **argv". libc uses prototypes + with "char *const *argv" that are incorrect because getopt_long and + getopt_long_only can permute argv; this is required for backward + compatibility (e.g., for LSB 2.0.1). + + This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt', + but it caused redefinition warnings if both unistd.h and getopt.h were + included, since unistd.h includes getopt.h having previously defined + __need_getopt. + + The only place where __getopt_argv_const is used is in definitions + of getopt_long and getopt_long_only below, but these are visible + only if __need_getopt is not defined, so it is quite safe to rewrite + the conditional as follows: +*/ +#if !defined __need_getopt +# if defined __GETOPT_PREFIX +# define __getopt_argv_const /* empty */ +# else +# define __getopt_argv_const const +# endif +#endif + +/* If __GNU_LIBRARY__ is not already defined, either we are being used + standalone, or this is the first header included in the source file. + If we are being used with glibc, we need to include , but + that does not exist if we are standalone. So: if __GNU_LIBRARY__ is + not defined, include , which will pull in for us + if it's from glibc. (Why ctype.h? It's guaranteed to exist and it + doesn't flood the namespace with stuff the way some other headers do.) */ +#if !defined __GNU_LIBRARY__ +# include +#endif + +#ifndef __THROW +# ifndef __GNUC_PREREQ +# define __GNUC_PREREQ(maj, min) (0) +# endif +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# else +# define __THROW +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ + const char *name; + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `-', then non-option arguments are treated as + arguments to the option '\1'. This behavior is specific to the GNU + `getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in + the environment, then do not permute arguments. */ + +extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) + __THROW; + +#ifndef __need_getopt +extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW; +extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW; + +#endif + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/lib/getopt_int.h b/lib/getopt_int.h new file mode 100644 index 0000000..401579f --- /dev/null +++ b/lib/getopt_int.h @@ -0,0 +1,131 @@ +/* Internal declarations for getopt. + Copyright (C) 1989-1994,1996-1999,2001,2003,2004 + 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 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 _GETOPT_INT_H +#define _GETOPT_INT_H 1 + +extern int _getopt_internal (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, int __posixly_correct); + + +/* Reentrant versions which can handle parsing multiple argument + vectors at the same time. */ + +/* Data type for reentrant functions. */ +struct _getopt_data +{ + /* These have exactly the same meaning as the corresponding global + variables, except that they are used for the reentrant + versions of getopt. */ + int optind; + int opterr; + int optopt; + char *optarg; + + /* Internal members. */ + + /* True if the internal members have been initialized. */ + int __initialized; + + /* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + char *__nextchar; + + /* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters, or by calling getopt. + + PERMUTE is the default. We permute the contents of ARGV as we + scan, so that eventually all the non-options are at the end. + This allows options to be given in any order, even with programs + that were not written to expect this. + + RETURN_IN_ORDER is an option available to programs that were + written to expect options and other ARGV-elements in any order + and that care about the ordering of the two. We describe each + non-option ARGV-element as if it were the argument of an option + with character code 1. Using `-' as the first character of the + list of option characters selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + + enum + { + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER + } __ordering; + + /* If the POSIXLY_CORRECT environment variable is set + or getopt was called. */ + int __posixly_correct; + + + /* Handle permutation of arguments. */ + + /* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first + of them; `last_nonopt' is the index after the last of them. */ + + int __first_nonopt; + int __last_nonopt; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + int __nonoption_flags_max_len; + int __nonoption_flags_len; +# endif +}; + +/* The initializer is necessary to set OPTIND and OPTERR to their + default values and to clear the initialization flag. */ +#define _GETOPT_DATA_INITIALIZER { 1, 1 } + +extern int _getopt_internal_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, int __posixly_correct, + struct _getopt_data *__data); + +extern int _getopt_long_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + struct _getopt_data *__data); + +extern int _getopt_long_only_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, + int *__longind, + struct _getopt_data *__data); + +#endif /* getopt_int.h */ diff --git a/lib/gettext.h b/lib/gettext.h new file mode 100644 index 0000000..9d76ec9 --- /dev/null +++ b/lib/gettext.h @@ -0,0 +1,270 @@ +/* Convenience header for conditional use of GNU . + Copyright (C) 1995-1998, 2000-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 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 _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + +/* NLS can be disabled through the configure --disable-nls option. */ +#if ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include + +/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by + the gettext() and ngettext() macros. This is an alternative to calling + textdomain(), and is useful for libraries. */ +# ifdef DEFAULT_TEXT_DOMAIN +# undef gettext +# define gettext(Msgid) \ + dgettext (DEFAULT_TEXT_DOMAIN, Msgid) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) +# endif + +#else + +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which + chokes if dcgettext is defined as a macro. So include it now, to make + later inclusions of a NOP. We don't include + as well because people using "gettext.h" will not include , + and also including would fail on SunOS 4, whereas + is OK. */ +#if defined(__sun) +# include +#endif + +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include + , which chokes if dcgettext is defined as a macro. So include + it now, to make later inclusions of a NOP. */ +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) +# include +# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H +# include +# endif +#endif + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + 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". */ +# define gettext(Msgid) ((const char *) (Msgid)) +# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) +# define dcgettext(Domainname, Msgid, Category) \ + ((void) (Category), dgettext (Domainname, Msgid)) +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 \ + ? ((void) (Msgid2), (const char *) (Msgid1)) \ + : ((void) (Msgid1), (const char *) (Msgid2))) +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) +# define textdomain(Domainname) ((const char *) (Domainname)) +# define bindtextdomain(Domainname, Dirname) \ + ((void) (Domainname), (const char *) (Dirname)) +# define bind_textdomain_codeset(Domainname, Codeset) \ + ((void) (Domainname), (const char *) (Codeset)) + +#endif + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + +/* The separator between msgctxt and msgid in a .mo file. */ +#define GETTEXT_CONTEXT_GLUE "\004" + +/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a + MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be + short and rarely need to change. + The letter 'p' stands for 'particular' or 'special'. */ +#ifdef DEFAULT_TEXT_DOMAIN +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#else +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#endif +#define dpgettext(Domainname, Msgctxt, Msgid) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) +#ifdef DEFAULT_TEXT_DOMAIN +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#else +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#endif +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +pgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + int category) +{ + const char *translation = dcgettext (domain, msg_ctxt_id, category); + if (translation == msg_ctxt_id) + return msgid; + else + return translation; +} + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +npgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + const char *translation = + dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + if (translation == msg_ctxt_id || translation == msgid_plural) + return (n == 1 ? msgid : msgid_plural); + else + return translation; +} + +/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID + can be arbitrary expressions. But for string literals these macros are + less efficient than those above. */ + +#include + +#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ + (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ + /* || __STDC_VERSION__ >= 199901L */ ) + +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS +#include +#endif + +#define pgettext_expr(Msgctxt, Msgid) \ + dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ + dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcgettext (domain, msg_ctxt_id, category); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (translation != msg_ctxt_id) + return translation; + } + return msgid; +} + +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcnpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (!(translation == msg_ctxt_id || translation == msgid_plural)) + return translation; + } + return (n == 1 ? msgid : msgid_plural); +} + +#endif /* _LIBGETTEXT_H */ diff --git a/lib/gettime.c b/lib/gettime.c new file mode 100644 index 0000000..86bd325 --- /dev/null +++ b/lib/gettime.c @@ -0,0 +1,49 @@ +/* gettime -- get the system clock + + Copyright (C) 2002, 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) + any 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 "timespec.h" + +#include + +/* Get the system time into *TS. */ + +void +gettime (struct timespec *ts) +{ +#if HAVE_NANOTIME + nanotime (ts); +#else + +# if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME + if (clock_gettime (CLOCK_REALTIME, ts) == 0) + return; +# endif + + { + struct timeval tv; + gettimeofday (&tv, NULL); + ts->tv_sec = tv.tv_sec; + ts->tv_nsec = tv.tv_usec * 1000; + } + +#endif +} diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c new file mode 100644 index 0000000..bd5576c --- /dev/null +++ b/lib/gettimeofday.c @@ -0,0 +1,142 @@ +/* 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 + 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 + +/* Specification. */ +#include + +#include + +#if HAVE_SYS_TIMEB_H +# include +#endif + +#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME + +/* Work around the bug in some systems whereby gettimeofday clobbers + the static buffer that localtime uses for its return value. The + gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has + this problem. The tzset replacement is necessary for at least + Solaris 2.5, 2.5.1, and 2.6. */ + +static struct tm tm_zero_buffer; +static struct tm *localtime_buffer_addr = &tm_zero_buffer; + +/* This is a wrapper for localtime. It is used only on systems for which + gettimeofday clobbers the static buffer used for localtime's result. + + On the first call, record the address of the static buffer that + localtime uses for its result. */ + +struct tm * +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) + localtime_buffer_addr = tm; + + return tm; +} + +/* Same as above, since gmtime and localtime use the same buffer. */ +struct tm * +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) + localtime_buffer_addr = tm; + + return tm; +} + +#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */ + +#if TZSET_CLOBBERS_LOCALTIME +/* This is a wrapper for tzset, for systems on which tzset may clobber + the static buffer used for localtime's result. */ +void +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; + tzset (); + *localtime_buffer_addr = save; +} +#endif + +/* This is a wrapper for gettimeofday. It is used only on systems + that lack this function, or whose implementation of this function + causes problems. */ + +int +rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz) +{ +#undef gettimeofday +#if HAVE_GETTIMEOFDAY +# if GETTIMEOFDAY_CLOBBERS_LOCALTIME + /* Save and restore the contents of the buffer used for localtime's + result around the call to gettimeofday. */ + struct tm save = *localtime_buffer_addr; +# endif + + int result = gettimeofday (tv, tz); + +# if GETTIMEOFDAY_CLOBBERS_LOCALTIME + *localtime_buffer_addr = save; +# endif + + return result; + +#else + +# if HAVE__FTIME + + struct _timeb timebuf; + _ftime (&timebuf); + tv->tv_sec = timebuf.time; + tv->tv_usec = timebuf.millitm * 1000; + +# else + +# if !defined OK_TO_USE_1S_CLOCK +# error "Only 1-second nominal clock resolution found. Is that intended?" \ + "If so, compile with the -DOK_TO_USE_1S_CLOCK option." +# endif + tv->tv_sec = time (NULL); + tv->tv_usec = 0; + +# endif + + return 0; + +#endif +} diff --git a/lib/gnulib.mk b/lib/gnulib.mk new file mode 100644 index 0000000..b69f608 --- /dev/null +++ b/lib/gnulib.mk @@ -0,0 +1,1244 @@ +## DO NOT EDIT! GENERATED AUTOMATICALLY! +## Process this file with automake to produce Makefile.in. +# Copyright (C) 2004-2007 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 +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libcpio --source-base=.#bootmp/lib --m4-base=.#bootmp/m4 --doc-base=.#bootmp/doc --aux-dir=.#bootmp/build-aux --avoid=lock --avoid=size_max --no-libtool --macro-prefix=gl alloca argmatch argp closeout configmake dirname error fileblocks fnmatch-gnu full-write getdate getopt gettext hash inttostr inttypes lchown obstack quote quotearg safe-read savedir stdbool stdint stpcpy strerror strtol unlocked-io utimens version-etc-fsf xalloc xalloc-die + +AUTOMAKE_OPTIONS = 1.5 gnits + +noinst_HEADERS = +noinst_LIBRARIES = +noinst_LTLIBRARIES = +EXTRA_DIST = +BUILT_SOURCES = +SUFFIXES = +MOSTLYCLEANFILES = core *.stackdump +MOSTLYCLEANDIRS = +CLEANFILES = +DISTCLEANFILES = +MAINTAINERCLEANFILES = + +AM_CPPFLAGS = + +noinst_LIBRARIES += libcpio.a + +libcpio_a_SOURCES = +libcpio_a_LIBADD = $(gl_LIBOBJS) +libcpio_a_DEPENDENCIES = $(gl_LIBOBJS) +EXTRA_libcpio_a_SOURCES = + +## begin gnulib module absolute-header + +# Use this preprocessor expression to decide whether #include_next works. +# Do not rely on a 'configure'-time test for this, since the expression +# might appear in an installed header, which is used by some other compiler. +HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) + +## end gnulib module absolute-header + +## begin gnulib module alloca + + +EXTRA_DIST += alloca.c + +EXTRA_libcpio_a_SOURCES += alloca.c + +libcpio_a_LIBADD += @ALLOCA@ +libcpio_a_DEPENDENCIES += @ALLOCA@ +## end gnulib module alloca + +## begin gnulib module alloca-opt + +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 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/alloca_.h; \ + } > $@-t + mv -f $@-t $@ +MOSTLYCLEANFILES += alloca.h alloca.h-t + +EXTRA_DIST += alloca_.h + +## end gnulib module alloca-opt + +## begin gnulib module allocsa + +libcpio_a_SOURCES += allocsa.h allocsa.c + +EXTRA_DIST += allocsa.valgrind + +## end gnulib module allocsa + +## begin gnulib module argmatch + + +EXTRA_DIST += argmatch.c argmatch.h + +EXTRA_libcpio_a_SOURCES += argmatch.c + +## end gnulib module argmatch + +## begin gnulib module argp + +libcpio_a_SOURCES += argp.h argp-ba.c argp-eexst.c \ + argp-fmtstream.c argp-fmtstream.h argp-fs-xinl.c argp-help.c \ + argp-namefrob.h argp-parse.c argp-pin.c argp-pv.c argp-pvh.c \ + argp-xinl.c + +## end gnulib module argp + +## begin gnulib module canonicalize-lgpl + + +EXTRA_DIST += canonicalize-lgpl.c canonicalize.h + +EXTRA_libcpio_a_SOURCES += canonicalize-lgpl.c + +## end gnulib module canonicalize-lgpl + +## begin gnulib module chdir-long + + +EXTRA_DIST += chdir-long.c chdir-long.h + +EXTRA_libcpio_a_SOURCES += chdir-long.c + +## end gnulib module chdir-long + +## begin gnulib module chown + + +EXTRA_DIST += chown.c fchown-stub.c + +EXTRA_libcpio_a_SOURCES += chown.c fchown-stub.c + +## end gnulib module chown + +## begin gnulib module close-stream + + +EXTRA_DIST += close-stream.c close-stream.h + +EXTRA_libcpio_a_SOURCES += close-stream.c + +## end gnulib module close-stream + +## begin gnulib module closeout + + +EXTRA_DIST += closeout.c closeout.h + +EXTRA_libcpio_a_SOURCES += closeout.c + +## end gnulib module closeout + +## begin gnulib module configmake + +# Retrieve values of the variables through 'configure' followed by +# 'make', not directly through 'configure', so that a user who +# sets some of these variables consistently on the 'make' command +# line gets correct results. +# +# One advantage of this approach, compared to the classical +# approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS, +# is that it protects against the use of undefined variables. +# If, say, $(libdir) is not set in the Makefile, LIBDIR is not +# defined by this module, and code using LIBDIR gives a +# compilation error. +# +# Another advantage is that 'make' output is shorter. +# +# Listed in the same order as the GNU makefile conventions. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +configmake.h: Makefile + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t + mv $@-t $@ +BUILT_SOURCES += configmake.h +CLEANFILES += configmake.h configmake.h-t + +## end gnulib module configmake + +## begin gnulib module dirfd + + +EXTRA_DIST += dirfd.c dirfd.h + +EXTRA_libcpio_a_SOURCES += dirfd.c + +## end gnulib module dirfd + +## begin gnulib module dirname + + +EXTRA_DIST += basename.c dirname.c dirname.h stripslash.c + +EXTRA_libcpio_a_SOURCES += basename.c dirname.c stripslash.c + +## end gnulib module dirname + +## begin gnulib module dup2 + + +EXTRA_DIST += dup2.c + +EXTRA_libcpio_a_SOURCES += dup2.c + +## end gnulib module dup2 + +## begin gnulib module error + + +EXTRA_DIST += error.c error.h + +EXTRA_libcpio_a_SOURCES += error.c + +## end gnulib module error + +## begin gnulib module exitfail + + +EXTRA_DIST += exitfail.c exitfail.h + +EXTRA_libcpio_a_SOURCES += exitfail.c + +## end gnulib module exitfail + +## 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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/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_libcpio_a_SOURCES += fchdir.c + +## end gnulib module fchdir + +## 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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''ABSOLUTE_FCNTL_H''@|$(ABSOLUTE_FCNTL_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + < $(srcdir)/fcntl_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += fcntl.h fcntl.h-t + +EXTRA_DIST += fcntl_.h + +## end gnulib module fcntl + +## begin gnulib module fcntl-safer + + +EXTRA_DIST += creat-safer.c fcntl--.h fcntl-safer.h open-safer.c + +EXTRA_libcpio_a_SOURCES += creat-safer.c open-safer.c + +## end gnulib module fcntl-safer + +## begin gnulib module fileblocks + + +EXTRA_DIST += fileblocks.c + +EXTRA_libcpio_a_SOURCES += fileblocks.c + +## end gnulib module fileblocks + +## 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_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_FLOAT_H''@|$(ABSOLUTE_FLOAT_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + < $(srcdir)/float_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += float.h float.h-t + +EXTRA_DIST += float_.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 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/fnmatch_.h; \ + } > $@-t + mv -f $@-t $@ +MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t + +EXTRA_DIST += fnmatch.c fnmatch_.h fnmatch_loop.c + +EXTRA_libcpio_a_SOURCES += fnmatch.c fnmatch_loop.c + +## end gnulib module fnmatch + +## begin gnulib module fpending + + +EXTRA_DIST += __fpending.c __fpending.h + +EXTRA_libcpio_a_SOURCES += __fpending.c + +## end gnulib module fpending + +## begin gnulib module full-write + +libcpio_a_SOURCES += full-write.h full-write.c + +## end gnulib module full-write + +## begin gnulib module getcwd + + +EXTRA_DIST += getcwd.c + +EXTRA_libcpio_a_SOURCES += getcwd.c + +## end gnulib module getcwd + +## begin gnulib module getdate + +libcpio_a_SOURCES += getdate.y +BUILT_SOURCES += getdate.c +MAINTAINERCLEANFILES += getdate.c +EXTRA_DIST += getdate.c + +EXTRA_DIST += getdate.h + +## end gnulib module getdate + +## begin gnulib module getopt + +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 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/getopt_.h; \ + } > $@-t + mv -f $@-t $@ +MOSTLYCLEANFILES += getopt.h getopt.h-t + +EXTRA_DIST += getopt.c getopt1.c getopt_.h getopt_int.h + +EXTRA_libcpio_a_SOURCES += getopt.c getopt1.c + +## end gnulib module getopt + +## begin gnulib module gettext + +# 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 +# -I$(top_builddir)/intl, so that can be found in this directory. +# For the Makefile.ams in other directories it is the maintainer's +# responsibility; for the one from gnulib we do it here. +# This option has no effect when the user disables NLS (because then the intl +# directory contains no libintl.h file) or when the project does not use +# "gettextize --intl". +#AM_CPPFLAGS += -I$(top_builddir)/intl + +## end gnulib module gettext + +## begin gnulib module gettext-h + +libcpio_a_SOURCES += gettext.h + +## end gnulib module gettext-h + +## begin gnulib module gettime + + +EXTRA_DIST += gettime.c + +EXTRA_libcpio_a_SOURCES += gettime.c + +## end gnulib module gettime + +## begin gnulib module gettimeofday + + +EXTRA_DIST += gettimeofday.c + +EXTRA_libcpio_a_SOURCES += gettimeofday.c + +## end gnulib module gettimeofday + +## begin gnulib module hash + + +EXTRA_DIST += hash.c hash.h + +EXTRA_libcpio_a_SOURCES += hash.c + +## end gnulib module hash + +## begin gnulib module intprops + + +EXTRA_DIST += intprops.h + +## end gnulib module intprops + +## begin gnulib module inttostr + + +EXTRA_DIST += imaxtostr.c inttostr.c inttostr.h offtostr.c uinttostr.c umaxtostr.c + +EXTRA_libcpio_a_SOURCES += imaxtostr.c inttostr.c offtostr.c uinttostr.c umaxtostr.c + +## end gnulib module inttostr + +## begin gnulib module inttypes + +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 + 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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/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' \ + -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ + -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ + -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ + -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ + -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ + -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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/inttypes_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += inttypes.h inttypes.h-t + +EXTRA_DIST += inttypes_.h + +## end gnulib module inttypes + +## begin gnulib module lchown + + +EXTRA_DIST += lchown.c lchown.h + +EXTRA_libcpio_a_SOURCES += lchown.c + +## end gnulib module lchown + +## begin gnulib module link-warning + +LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h + +## end gnulib module link-warning + +## begin gnulib module lstat + + +EXTRA_DIST += lstat.c lstat.h + +EXTRA_libcpio_a_SOURCES += lstat.c + +## end gnulib module lstat + +## begin gnulib module malloc + + +EXTRA_DIST += malloc.c + +EXTRA_libcpio_a_SOURCES += malloc.c + +## end gnulib module malloc + +## begin gnulib module mempcpy + + +EXTRA_DIST += mempcpy.c + +EXTRA_libcpio_a_SOURCES += mempcpy.c + +## end gnulib module mempcpy + +## begin gnulib module memrchr + + +EXTRA_DIST += memrchr.c + +EXTRA_libcpio_a_SOURCES += memrchr.c + +## end gnulib module memrchr + +## begin gnulib module mktime + + +EXTRA_DIST += mktime.c + +EXTRA_libcpio_a_SOURCES += mktime.c + +## end gnulib module mktime + +## begin gnulib module obstack + + +EXTRA_DIST += obstack.c obstack.h + +EXTRA_libcpio_a_SOURCES += obstack.c + +## end gnulib module obstack + +## begin gnulib module openat + + +EXTRA_DIST += at-func.c fchmodat.c fchownat.c fstatat.c mkdirat.c openat-priv.h openat-proc.c openat.c openat.h + +EXTRA_libcpio_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 + +libcpio_a_SOURCES += openat-die.c + +## end gnulib module openat-die + +## begin gnulib module pathmax + + +EXTRA_DIST += pathmax.h + +## end gnulib module pathmax + +## begin gnulib module quote + + +EXTRA_DIST += quote.c quote.h + +EXTRA_libcpio_a_SOURCES += quote.c + +## end gnulib module quote + +## begin gnulib module quotearg + + +EXTRA_DIST += quotearg.c quotearg.h + +EXTRA_libcpio_a_SOURCES += quotearg.c + +## end gnulib module quotearg + +## begin gnulib module readlink + + +EXTRA_DIST += readlink.c + +EXTRA_libcpio_a_SOURCES += readlink.c + +## end gnulib module readlink + +## begin gnulib module safe-read + + +EXTRA_DIST += safe-read.c safe-read.h + +EXTRA_libcpio_a_SOURCES += safe-read.c + +## end gnulib module safe-read + +## begin gnulib module safe-write + + +EXTRA_DIST += safe-write.c safe-write.h + +EXTRA_libcpio_a_SOURCES += safe-write.c + +## end gnulib module safe-write + +## begin gnulib module same-inode + + +EXTRA_DIST += same-inode.h + +## end gnulib module same-inode + +## begin gnulib module save-cwd + + +EXTRA_DIST += save-cwd.c save-cwd.h + +EXTRA_libcpio_a_SOURCES += save-cwd.c + +## end gnulib module save-cwd + +## begin gnulib module savedir + + +EXTRA_DIST += savedir.c savedir.h + +EXTRA_libcpio_a_SOURCES += savedir.c + +## end gnulib module savedir + +## begin gnulib module setenv + + +EXTRA_DIST += setenv.c setenv.h unsetenv.c + +EXTRA_libcpio_a_SOURCES += setenv.c unsetenv.c + +## end gnulib module setenv + +## begin gnulib module sleep + + +EXTRA_DIST += sleep.c + +EXTRA_libcpio_a_SOURCES += sleep.c + +## end gnulib module sleep + +## 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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += stdbool.h stdbool.h-t + +EXTRA_DIST += stdbool_.h + +## end gnulib module stdbool + +## begin gnulib module stdint + +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 + 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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/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/@''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' \ + -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ + -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ + -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ + -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ + -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ + -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; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += stdint.h stdint.h-t + +EXTRA_DIST += stdint_.h + +## end gnulib module stdint + +## begin gnulib module stdio + +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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_STDIO_H''@|$(ABSOLUTE_STDIO_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|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_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|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_VASPRINTF''@|$(GNULIB_VASPRINTF)|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|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \ + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \ + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \ + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ + -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_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/stdio_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += stdio.h stdio.h-t + +EXTRA_DIST += stdio_.h + +## end gnulib module stdio + +## begin gnulib module stdlib + +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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_STDLIB_H''@|$(ABSOLUTE_STDLIB_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ + -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ + -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/stdlib_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += stdlib.h stdlib.h-t + +EXTRA_DIST += stdlib_.h + +## end gnulib module stdlib + +## begin gnulib module stpcpy + + +EXTRA_DIST += stpcpy.c + +EXTRA_libcpio_a_SOURCES += stpcpy.c + +## end gnulib module stpcpy + +## begin gnulib module strcase + + +EXTRA_DIST += strcasecmp.c strncasecmp.c + +EXTRA_libcpio_a_SOURCES += strcasecmp.c strncasecmp.c + +## end gnulib module strcase + +## begin gnulib module strchrnul + + +EXTRA_DIST += strchrnul.c + +EXTRA_libcpio_a_SOURCES += strchrnul.c + +## end gnulib module strchrnul + +## begin gnulib module strdup + + +EXTRA_DIST += strdup.c + +EXTRA_libcpio_a_SOURCES += strdup.c + +## end gnulib module strdup + +## begin gnulib module strerror + + +EXTRA_DIST += strerror.c + +EXTRA_libcpio_a_SOURCES += strerror.c + +## end gnulib module strerror + +## 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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_STRING_H''@|$(ABSOLUTE_STRING_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \ + -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \ + -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \ + -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \ + -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \ + -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \ + -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \ + -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \ + -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \ + -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \ + -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \ + -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \ + -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \ + -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \ + -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \ + -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \ + -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \ + -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \ + -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \ + -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \ + -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \ + -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \ + -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \ + -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \ + -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \ + -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|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_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' \ + -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ + -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ + -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ + -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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/string_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += string.h string.h-t + +EXTRA_DIST += string_.h + +## end gnulib module string + +## begin gnulib module strndup + + +EXTRA_DIST += strndup.c + +EXTRA_libcpio_a_SOURCES += strndup.c + +## end gnulib module strndup + +## begin gnulib module strnlen + + +EXTRA_DIST += strnlen.c + +EXTRA_libcpio_a_SOURCES += strnlen.c + +## end gnulib module strnlen + +## begin gnulib module strtol + + +EXTRA_DIST += strtol.c + +EXTRA_libcpio_a_SOURCES += strtol.c + +## end gnulib module strtol + +## begin gnulib module sys_stat + +BUILT_SOURCES += $(SYS_STAT_H) + +# We need the following in order to create when the system +# has one that is incomplete. +sys/stat.h: sys_stat_.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' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''HAVE_IO_H''@|$(HAVE_IO_H)|g' \ + -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''HAVE_DECL_MKDIR''@|$(HAVE_DECL_MKDIR)|g' \ + < $(srcdir)/sys_stat_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_stat_.h + +## end gnulib module sys_stat + +## begin gnulib module sys_time + +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 + @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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + < $(srcdir)/sys_time_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += sys/time.h sys/time.h-t + +EXTRA_DIST += sys_time_.h + +## end gnulib module sys_time + +## begin gnulib module sysexits + +BUILT_SOURCES += $(SYSEXITS_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sysexits.h: sysexits_.h + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SYSEXITS_H''@|$(HAVE_SYSEXITS_H)|g' \ + -e 's|@''ABSOLUTE_SYSEXITS_H''@|$(ABSOLUTE_SYSEXITS_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + < $(srcdir)/sysexits_.h; \ + } > $@-t + mv -f $@-t $@ +MOSTLYCLEANFILES += sysexits.h sysexits.h-t + +EXTRA_DIST += sysexits_.h + +## end gnulib module sysexits + +## begin gnulib module time + +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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@ABSOLUTE_TIME_H''@|$(ABSOLUTE_TIME_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/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; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += time.h time.h-t + +EXTRA_DIST += time_.h + +## end gnulib module time + +## begin gnulib module time_r + + +EXTRA_DIST += time_r.c + +EXTRA_libcpio_a_SOURCES += time_r.c + +## end gnulib module time_r + +## begin gnulib module timespec + + +EXTRA_DIST += timespec.h + +## end gnulib module timespec + +## begin gnulib module unistd + +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 + 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/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ + -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ + -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ + -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ + -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ + -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ + -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + < $(srcdir)/unistd_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += unistd.h unistd.h-t + +EXTRA_DIST += unistd_.h + +## end gnulib module unistd + +## begin gnulib module unistd-safer + + +EXTRA_DIST += dup-safer.c fd-safer.c pipe-safer.c unistd--.h unistd-safer.h + +EXTRA_libcpio_a_SOURCES += dup-safer.c fd-safer.c pipe-safer.c + +## end gnulib module unistd-safer + +## begin gnulib module unlocked-io + + +EXTRA_DIST += unlocked-io.h + +## end gnulib module unlocked-io + +## begin gnulib module utimens + + +EXTRA_DIST += utimens.c utimens.h + +EXTRA_libcpio_a_SOURCES += utimens.c + +## end gnulib module utimens + +## begin gnulib module vasnprintf + + +EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h + +EXTRA_libcpio_a_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c + +## end gnulib module vasnprintf + +## begin gnulib module verify + +libcpio_a_SOURCES += verify.h + +## end gnulib module verify + +## begin gnulib module version-etc + +libcpio_a_SOURCES += version-etc.h version-etc.c + +## end gnulib module version-etc + +## begin gnulib module version-etc-fsf + +libcpio_a_SOURCES += version-etc-fsf.c + +## end gnulib module version-etc-fsf + +## begin gnulib module vsnprintf + + +EXTRA_DIST += vsnprintf.c + +EXTRA_libcpio_a_SOURCES += vsnprintf.c + +## end gnulib module vsnprintf + +## 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 + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''ABSOLUTE_WCHAR_H''@|$(ABSOLUTE_WCHAR_H)|g' \ + -e 's/@''HAVE_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + < $(srcdir)/wchar_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += wchar.h wchar.h-t + +EXTRA_DIST += wchar_.h + +## end gnulib module wchar + +## 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 + 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_INCLUDE_NEXT''@/$(HAVE_INCLUDE_NEXT)/g' \ + -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + < $(srcdir)/wctype_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += wctype.h wctype.h-t + +EXTRA_DIST += wctype_.h + +## end gnulib module wctype + +## begin gnulib module xalloc + + +EXTRA_DIST += xalloc.h xmalloc.c + +EXTRA_libcpio_a_SOURCES += xmalloc.c + +## end gnulib module xalloc + +## begin gnulib module xalloc-die + +libcpio_a_SOURCES += xalloc-die.c + +## end gnulib module xalloc-die + +## begin gnulib module xgetcwd + + +EXTRA_DIST += xgetcwd.c xgetcwd.h + +EXTRA_libcpio_a_SOURCES += xgetcwd.c + +## end gnulib module xgetcwd + +## begin gnulib module xsize + +libcpio_a_SOURCES += xsize.h + +## end gnulib module xsize + +## begin gnulib module xstrndup + +libcpio_a_SOURCES += xstrndup.h xstrndup.c + +## end gnulib module xstrndup + + +mostlyclean-local: mostlyclean-generic + @for dir in '' $(MOSTLYCLEANDIRS); do \ + if test -n "$$dir" && test -d $$dir; then \ + echo "rmdir $$dir"; rmdir $$dir; \ + fi; \ + done diff --git a/lib/hash.c b/lib/hash.c new file mode 100644 index 0000000..f4ab12f --- /dev/null +++ b/lib/hash.c @@ -0,0 +1,1048 @@ +/* hash - hashing table processing. + + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free + Software Foundation, Inc. + + Written by Jim Meyering, 1992. + + This program is free software; you can redistribute it and/or modify + it under the 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. */ + +/* A generic hash table package. */ + +/* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead + of malloc. If you change USE_OBSTACK, you have to recompile! */ + +#include + +#include "hash.h" +#include "xalloc.h" + +#include +#include +#include + +#if USE_OBSTACK +# include "obstack.h" +# ifndef obstack_chunk_alloc +# define obstack_chunk_alloc malloc +# endif +# ifndef obstack_chunk_free +# define obstack_chunk_free free +# endif +#endif + +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + +struct hash_table + { + /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1, + for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets + are not empty, there are N_ENTRIES active entries in the table. */ + struct hash_entry *bucket; + struct hash_entry const *bucket_limit; + size_t n_buckets; + size_t n_buckets_used; + size_t n_entries; + + /* Tuning arguments, kept in a physicaly separate structure. */ + const Hash_tuning *tuning; + + /* Three functions are given to `hash_initialize', see the documentation + block for this function. In a word, HASHER randomizes a user entry + into a number up from 0 up to some maximum minus 1; COMPARATOR returns + true if two user entries compare equally; and DATA_FREER is the cleanup + function for a user entry. */ + Hash_hasher hasher; + Hash_comparator comparator; + Hash_data_freer data_freer; + + /* A linked list of freed struct hash_entry structs. */ + struct hash_entry *free_entry_list; + +#if USE_OBSTACK + /* Whenever obstacks are used, it is possible to allocate all overflowed + entries into a single stack, so they all can be freed in a single + operation. It is not clear if the speedup is worth the trouble. */ + struct obstack entry_stack; +#endif + }; + +/* A hash table contains many internal entries, each holding a pointer to + some user provided data (also called a user entry). An entry indistinctly + refers to both the internal entry and its associated user entry. A user + entry contents may be hashed by a randomization function (the hashing + function, or just `hasher' for short) into a number (or `slot') between 0 + and the current table size. At each slot position in the hash table, + starts a linked chain of entries for which the user data all hash to this + slot. A bucket is the collection of all entries hashing to the same slot. + + A good `hasher' function will distribute entries rather evenly in buckets. + In the ideal case, the length of each bucket is roughly the number of + entries divided by the table size. Finding the slot for a data is usually + done in constant time by the `hasher', and the later finding of a precise + entry is linear in time with the size of the bucket. Consequently, a + larger hash table size (that is, a larger number of buckets) is prone to + yielding shorter chains, *given* the `hasher' function behaves properly. + + Long buckets slow down the lookup algorithm. One might use big hash table + sizes in hope to reduce the average length of buckets, but this might + become inordinate, as unused slots in the hash table take some space. The + best bet is to make sure you are using a good `hasher' function (beware + that those are not that easy to write! :-), and to use a table size + larger than the actual number of entries. */ + +/* If an insertion makes the ratio of nonempty buckets to table size larger + than the growth threshold (a number between 0.0 and 1.0), then increase + the table size by multiplying by the growth factor (a number greater than + 1.0). The growth threshold defaults to 0.8, and the growth factor + defaults to 1.414, meaning that the table will have doubled its size + every second time 80% of the buckets get used. */ +#define DEFAULT_GROWTH_THRESHOLD 0.8 +#define DEFAULT_GROWTH_FACTOR 1.414 + +/* If a deletion empties a bucket and causes the ratio of used buckets to + table size to become smaller than the shrink threshold (a number between + 0.0 and 1.0), then shrink the table by multiplying by the shrink factor (a + number greater than the shrink threshold but smaller than 1.0). The shrink + threshold and factor default to 0.0 and 1.0, meaning that the table never + shrinks. */ +#define DEFAULT_SHRINK_THRESHOLD 0.0 +#define DEFAULT_SHRINK_FACTOR 1.0 + +/* Use this to initialize or reset a TUNING structure to + some sensible values. */ +static const Hash_tuning default_tuning = + { + DEFAULT_SHRINK_THRESHOLD, + DEFAULT_SHRINK_FACTOR, + DEFAULT_GROWTH_THRESHOLD, + DEFAULT_GROWTH_FACTOR, + false + }; + +/* Information and lookup. */ + +/* The following few functions provide information about the overall hash + table organization: the number of entries, number of buckets and maximum + length of buckets. */ + +/* Return the number of buckets in the hash table. The table size, the total + number of buckets (used plus unused), or the maximum number of slots, are + the same quantity. */ + +size_t +hash_get_n_buckets (const Hash_table *table) +{ + return table->n_buckets; +} + +/* Return the number of slots in use (non-empty buckets). */ + +size_t +hash_get_n_buckets_used (const Hash_table *table) +{ + return table->n_buckets_used; +} + +/* Return the number of active entries. */ + +size_t +hash_get_n_entries (const Hash_table *table) +{ + return table->n_entries; +} + +/* Return the length of the longest chain (bucket). */ + +size_t +hash_get_max_bucket_length (const Hash_table *table) +{ + struct hash_entry const *bucket; + size_t max_bucket_length = 0; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + struct hash_entry const *cursor = bucket; + size_t bucket_length = 1; + + while (cursor = cursor->next, cursor) + bucket_length++; + + if (bucket_length > max_bucket_length) + max_bucket_length = bucket_length; + } + } + + return max_bucket_length; +} + +/* Do a mild validation of a hash table, by traversing it and checking two + statistics. */ + +bool +hash_table_ok (const Hash_table *table) +{ + struct hash_entry const *bucket; + size_t n_buckets_used = 0; + size_t n_entries = 0; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + struct hash_entry const *cursor = bucket; + + /* Count bucket head. */ + n_buckets_used++; + n_entries++; + + /* Count bucket overflow. */ + while (cursor = cursor->next, cursor) + n_entries++; + } + } + + if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries) + return true; + + return false; +} + +void +hash_print_statistics (const Hash_table *table, FILE *stream) +{ + size_t n_entries = hash_get_n_entries (table); + size_t n_buckets = hash_get_n_buckets (table); + size_t n_buckets_used = hash_get_n_buckets_used (table); + size_t max_bucket_length = hash_get_max_bucket_length (table); + + fprintf (stream, "# entries: %lu\n", (unsigned long int) n_entries); + fprintf (stream, "# buckets: %lu\n", (unsigned long int) n_buckets); + fprintf (stream, "# buckets used: %lu (%.2f%%)\n", + (unsigned long int) n_buckets_used, + (100.0 * n_buckets_used) / n_buckets); + fprintf (stream, "max bucket length: %lu\n", + (unsigned long int) max_bucket_length); +} + +/* If ENTRY matches an entry already in the hash table, return the + entry from the table. Otherwise, return NULL. */ + +void * +hash_lookup (const Hash_table *table, const void *entry) +{ + struct hash_entry const *bucket + = table->bucket + table->hasher (entry, table->n_buckets); + struct hash_entry const *cursor; + + if (! (bucket < table->bucket_limit)) + abort (); + + if (bucket->data == NULL) + return NULL; + + for (cursor = bucket; cursor; cursor = cursor->next) + if (table->comparator (entry, cursor->data)) + return cursor->data; + + return NULL; +} + +/* Walking. */ + +/* The functions in this page traverse the hash table and process the + contained entries. For the traversal to work properly, the hash table + should not be resized nor modified while any particular entry is being + processed. In particular, entries should not be added or removed. */ + +/* Return the first data in the table, or NULL if the table is empty. */ + +void * +hash_get_first (const Hash_table *table) +{ + struct hash_entry const *bucket; + + if (table->n_entries == 0) + return NULL; + + for (bucket = table->bucket; ; bucket++) + if (! (bucket < table->bucket_limit)) + abort (); + else if (bucket->data) + return bucket->data; +} + +/* Return the user data for the entry following ENTRY, where ENTRY has been + returned by a previous call to either `hash_get_first' or `hash_get_next'. + Return NULL if there are no more entries. */ + +void * +hash_get_next (const Hash_table *table, const void *entry) +{ + struct hash_entry const *bucket + = table->bucket + table->hasher (entry, table->n_buckets); + struct hash_entry const *cursor; + + if (! (bucket < table->bucket_limit)) + abort (); + + /* Find next entry in the same bucket. */ + for (cursor = bucket; cursor; cursor = cursor->next) + if (cursor->data == entry && cursor->next) + return cursor->next->data; + + /* Find first entry in any subsequent bucket. */ + while (++bucket < table->bucket_limit) + if (bucket->data) + return bucket->data; + + /* None found. */ + return NULL; +} + +/* Fill BUFFER with pointers to active user entries in the hash table, then + return the number of pointers copied. Do not copy more than BUFFER_SIZE + pointers. */ + +size_t +hash_get_entries (const Hash_table *table, void **buffer, + size_t buffer_size) +{ + size_t counter = 0; + struct hash_entry const *bucket; + struct hash_entry const *cursor; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + for (cursor = bucket; cursor; cursor = cursor->next) + { + if (counter >= buffer_size) + return counter; + buffer[counter++] = cursor->data; + } + } + } + + return counter; +} + +/* Call a PROCESSOR function for each entry of a hash table, and return the + number of entries for which the processor function returned success. A + pointer to some PROCESSOR_DATA which will be made available to each call to + the processor function. The PROCESSOR accepts two arguments: the first is + the user entry being walked into, the second is the value of PROCESSOR_DATA + as received. The walking continue for as long as the PROCESSOR function + returns nonzero. When it returns zero, the walking is interrupted. */ + +size_t +hash_do_for_each (const Hash_table *table, Hash_processor processor, + void *processor_data) +{ + size_t counter = 0; + struct hash_entry const *bucket; + struct hash_entry const *cursor; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + for (cursor = bucket; cursor; cursor = cursor->next) + { + if (!(*processor) (cursor->data, processor_data)) + return counter; + counter++; + } + } + } + + return counter; +} + +/* Allocation and clean-up. */ + +/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1. + This is a convenience routine for constructing other hashing functions. */ + +#if USE_DIFF_HASH + +/* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see + B. J. McKenzie, R. Harries & T. Bell, Selecting a hashing algorithm, + Software--practice & experience 20, 2 (Feb 1990), 209-224. Good hash + algorithms tend to be domain-specific, so what's good for [diffutils'] io.c + may not be good for your application." */ + +size_t +hash_string (const char *string, size_t n_buckets) +{ +# define ROTATE_LEFT(Value, Shift) \ + ((Value) << (Shift) | (Value) >> ((sizeof (size_t) * CHAR_BIT) - (Shift))) +# define HASH_ONE_CHAR(Value, Byte) \ + ((Byte) + ROTATE_LEFT (Value, 7)) + + size_t value = 0; + unsigned char ch; + + for (; (ch = *string); string++) + value = HASH_ONE_CHAR (value, ch); + return value % n_buckets; + +# undef ROTATE_LEFT +# undef HASH_ONE_CHAR +} + +#else /* not USE_DIFF_HASH */ + +/* This one comes from `recode', and performs a bit better than the above as + per a few experiments. It is inspired from a hashing routine found in the + very old Cyber `snoop', itself written in typical Greg Mansfield style. + (By the way, what happened to this excellent man? Is he still alive?) */ + +size_t +hash_string (const char *string, size_t n_buckets) +{ + size_t value = 0; + unsigned char ch; + + for (; (ch = *string); string++) + value = (value * 31 + ch) % n_buckets; + return value; +} + +#endif /* not USE_DIFF_HASH */ + +/* Return true if CANDIDATE is a prime number. CANDIDATE should be an odd + number at least equal to 11. */ + +static bool +is_prime (size_t candidate) +{ + size_t divisor = 3; + size_t square = divisor * divisor; + + while (square < candidate && (candidate % divisor)) + { + divisor++; + square += 4 * divisor; + divisor++; + } + + return (candidate % divisor ? true : false); +} + +/* Round a given CANDIDATE number up to the nearest prime, and return that + prime. Primes lower than 10 are merely skipped. */ + +static size_t +next_prime (size_t candidate) +{ + /* Skip small primes. */ + if (candidate < 10) + candidate = 10; + + /* Make it definitely odd. */ + candidate |= 1; + + while (!is_prime (candidate)) + candidate += 2; + + return candidate; +} + +void +hash_reset_tuning (Hash_tuning *tuning) +{ + *tuning = default_tuning; +} + +/* For the given hash TABLE, check the user supplied tuning structure for + reasonable values, and return true if there is no gross error with it. + Otherwise, definitively reset the TUNING field to some acceptable default + in the hash table (that is, the user loses the right of further modifying + tuning arguments), and return false. */ + +static bool +check_tuning (Hash_table *table) +{ + const Hash_tuning *tuning = table->tuning; + + /* Be a bit stricter than mathematics would require, so that + rounding errors in size calculations do not cause allocations to + fail to grow or shrink as they should. The smallest allocation + is 11 (due to next_prime's algorithm), so an epsilon of 0.1 + should be good enough. */ + float epsilon = 0.1f; + + if (epsilon < tuning->growth_threshold + && tuning->growth_threshold < 1 - epsilon + && 1 + epsilon < tuning->growth_factor + && 0 <= tuning->shrink_threshold + && tuning->shrink_threshold + epsilon < tuning->shrink_factor + && tuning->shrink_factor <= 1 + && tuning->shrink_threshold + epsilon < tuning->growth_threshold) + return true; + + table->tuning = &default_tuning; + return false; +} + +/* Allocate and return a new hash table, or NULL upon failure. The initial + number of buckets is automatically selected so as to _guarantee_ that you + may insert at least CANDIDATE different user entries before any growth of + the hash table size occurs. So, if have a reasonably tight a-priori upper + bound on the number of entries you intend to insert in the hash table, you + may save some table memory and insertion time, by specifying it here. If + the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE + argument has its meaning changed to the wanted number of buckets. + + TUNING points to a structure of user-supplied values, in case some fine + tuning is wanted over the default behavior of the hasher. If TUNING is + NULL, the default tuning parameters are used instead. + + The user-supplied HASHER function should be provided. It accepts two + arguments ENTRY and TABLE_SIZE. It computes, by hashing ENTRY contents, a + slot number for that entry which should be in the range 0..TABLE_SIZE-1. + This slot number is then returned. + + The user-supplied COMPARATOR function should be provided. It accepts two + arguments pointing to user data, it then returns true for a pair of entries + that compare equal, or false otherwise. This function is internally called + on entries which are already known to hash to the same bucket index. + + The user-supplied DATA_FREER function, when not NULL, may be later called + with the user data as an argument, just before the entry containing the + data gets freed. This happens from within `hash_free' or `hash_clear'. + You should specify this function only if you want these functions to free + all of your `data' data. This is typically the case when your data is + simply an auxiliary struct that you have malloc'd to aggregate several + values. */ + +Hash_table * +hash_initialize (size_t candidate, const Hash_tuning *tuning, + Hash_hasher hasher, Hash_comparator comparator, + Hash_data_freer data_freer) +{ + Hash_table *table; + + if (hasher == NULL || comparator == NULL) + return NULL; + + table = malloc (sizeof *table); + if (table == NULL) + return NULL; + + if (!tuning) + tuning = &default_tuning; + table->tuning = tuning; + if (!check_tuning (table)) + { + /* Fail if the tuning options are invalid. This is the only occasion + when the user gets some feedback about it. Once the table is created, + if the user provides invalid tuning options, we silently revert to + using the defaults, and ignore further request to change the tuning + options. */ + goto fail; + } + + if (!tuning->is_n_buckets) + { + float new_candidate = candidate / tuning->growth_threshold; + if (SIZE_MAX <= new_candidate) + goto fail; + candidate = new_candidate; + } + + if (xalloc_oversized (candidate, sizeof *table->bucket)) + goto fail; + table->n_buckets = next_prime (candidate); + if (xalloc_oversized (table->n_buckets, sizeof *table->bucket)) + goto fail; + + table->bucket = calloc (table->n_buckets, sizeof *table->bucket); + table->bucket_limit = table->bucket + table->n_buckets; + table->n_buckets_used = 0; + table->n_entries = 0; + + table->hasher = hasher; + table->comparator = comparator; + table->data_freer = data_freer; + + table->free_entry_list = NULL; +#if USE_OBSTACK + obstack_init (&table->entry_stack); +#endif + return table; + + fail: + free (table); + return NULL; +} + +/* Make all buckets empty, placing any chained entries on the free list. + Apply the user-specified function data_freer (if any) to the datas of any + affected entries. */ + +void +hash_clear (Hash_table *table) +{ + struct hash_entry *bucket; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + struct hash_entry *cursor; + struct hash_entry *next; + + /* Free the bucket overflow. */ + for (cursor = bucket->next; cursor; cursor = next) + { + if (table->data_freer) + (*table->data_freer) (cursor->data); + cursor->data = NULL; + + next = cursor->next; + /* Relinking is done one entry at a time, as it is to be expected + that overflows are either rare or short. */ + cursor->next = table->free_entry_list; + table->free_entry_list = cursor; + } + + /* Free the bucket head. */ + if (table->data_freer) + (*table->data_freer) (bucket->data); + bucket->data = NULL; + bucket->next = NULL; + } + } + + table->n_buckets_used = 0; + table->n_entries = 0; +} + +/* Reclaim all storage associated with a hash table. If a data_freer + function has been supplied by the user when the hash table was created, + this function applies it to the data of each entry before freeing that + entry. */ + +void +hash_free (Hash_table *table) +{ + struct hash_entry *bucket; + struct hash_entry *cursor; + struct hash_entry *next; + + /* Call the user data_freer function. */ + if (table->data_freer && table->n_entries) + { + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + if (bucket->data) + { + for (cursor = bucket; cursor; cursor = cursor->next) + { + (*table->data_freer) (cursor->data); + } + } + } + } + +#if USE_OBSTACK + + obstack_free (&table->entry_stack, NULL); + +#else + + /* Free all bucket overflowed entries. */ + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + for (cursor = bucket->next; cursor; cursor = next) + { + next = cursor->next; + free (cursor); + } + } + + /* Also reclaim the internal list of previously freed entries. */ + for (cursor = table->free_entry_list; cursor; cursor = next) + { + next = cursor->next; + free (cursor); + } + +#endif + + /* Free the remainder of the hash table structure. */ + free (table->bucket); + free (table); +} + +/* Insertion and deletion. */ + +/* Get a new hash entry for a bucket overflow, possibly by reclying a + previously freed one. If this is not possible, allocate a new one. */ + +static struct hash_entry * +allocate_entry (Hash_table *table) +{ + struct hash_entry *new; + + if (table->free_entry_list) + { + new = table->free_entry_list; + table->free_entry_list = new->next; + } + else + { +#if USE_OBSTACK + new = obstack_alloc (&table->entry_stack, sizeof *new); +#else + new = malloc (sizeof *new); +#endif + } + + return new; +} + +/* Free a hash entry which was part of some bucket overflow, + saving it for later recycling. */ + +static void +free_entry (Hash_table *table, struct hash_entry *entry) +{ + entry->data = NULL; + entry->next = table->free_entry_list; + table->free_entry_list = entry; +} + +/* This private function is used to help with insertion and deletion. When + ENTRY matches an entry in the table, return a pointer to the corresponding + user data and set *BUCKET_HEAD to the head of the selected bucket. + Otherwise, return NULL. When DELETE is true and ENTRY matches an entry in + the table, unlink the matching entry. */ + +static void * +hash_find_entry (Hash_table *table, const void *entry, + struct hash_entry **bucket_head, bool delete) +{ + struct hash_entry *bucket + = table->bucket + table->hasher (entry, table->n_buckets); + struct hash_entry *cursor; + + if (! (bucket < table->bucket_limit)) + abort (); + + *bucket_head = bucket; + + /* Test for empty bucket. */ + if (bucket->data == NULL) + return NULL; + + /* See if the entry is the first in the bucket. */ + if ((*table->comparator) (entry, bucket->data)) + { + void *data = bucket->data; + + if (delete) + { + if (bucket->next) + { + struct hash_entry *next = bucket->next; + + /* Bump the first overflow entry into the bucket head, then save + the previous first overflow entry for later recycling. */ + *bucket = *next; + free_entry (table, next); + } + else + { + bucket->data = NULL; + } + } + + return data; + } + + /* Scan the bucket overflow. */ + for (cursor = bucket; cursor->next; cursor = cursor->next) + { + if ((*table->comparator) (entry, cursor->next->data)) + { + void *data = cursor->next->data; + + if (delete) + { + struct hash_entry *next = cursor->next; + + /* Unlink the entry to delete, then save the freed entry for later + recycling. */ + cursor->next = next->next; + free_entry (table, next); + } + + return data; + } + } + + /* No entry found. */ + return NULL; +} + +/* For an already existing hash table, change the number of buckets through + specifying CANDIDATE. The contents of the hash table are preserved. The + new number of buckets is automatically selected so as to _guarantee_ that + the table may receive at least CANDIDATE different user entries, including + those already in the table, before any other growth of the hash table size + occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the + exact number of buckets desired. */ + +bool +hash_rehash (Hash_table *table, size_t candidate) +{ + Hash_table *new_table; + struct hash_entry *bucket; + struct hash_entry *cursor; + struct hash_entry *next; + + new_table = hash_initialize (candidate, table->tuning, table->hasher, + table->comparator, table->data_freer); + if (new_table == NULL) + return false; + + /* Merely reuse the extra old space into the new table. */ +#if USE_OBSTACK + obstack_free (&new_table->entry_stack, NULL); + new_table->entry_stack = table->entry_stack; +#endif + new_table->free_entry_list = table->free_entry_list; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + if (bucket->data) + for (cursor = bucket; cursor; cursor = next) + { + void *data = cursor->data; + struct hash_entry *new_bucket + = (new_table->bucket + + new_table->hasher (data, new_table->n_buckets)); + + if (! (new_bucket < new_table->bucket_limit)) + abort (); + + next = cursor->next; + + if (new_bucket->data) + { + if (cursor == bucket) + { + /* Allocate or recycle an entry, when moving from a bucket + header into a bucket overflow. */ + struct hash_entry *new_entry = allocate_entry (new_table); + + if (new_entry == NULL) + return false; + + new_entry->data = data; + new_entry->next = new_bucket->next; + new_bucket->next = new_entry; + } + else + { + /* Merely relink an existing entry, when moving from a + bucket overflow into a bucket overflow. */ + cursor->next = new_bucket->next; + new_bucket->next = cursor; + } + } + else + { + /* Free an existing entry, when moving from a bucket + overflow into a bucket header. Also take care of the + simple case of moving from a bucket header into a bucket + header. */ + new_bucket->data = data; + new_table->n_buckets_used++; + if (cursor != bucket) + free_entry (new_table, cursor); + } + } + + free (table->bucket); + table->bucket = new_table->bucket; + table->bucket_limit = new_table->bucket_limit; + table->n_buckets = new_table->n_buckets; + table->n_buckets_used = new_table->n_buckets_used; + table->free_entry_list = new_table->free_entry_list; + /* table->n_entries already holds its value. */ +#if USE_OBSTACK + table->entry_stack = new_table->entry_stack; +#endif + free (new_table); + + return true; +} + +/* If ENTRY matches an entry already in the hash table, return the pointer + to the entry from the table. Otherwise, insert ENTRY and return ENTRY. + Return NULL if the storage required for insertion cannot be allocated. */ + +void * +hash_insert (Hash_table *table, const void *entry) +{ + void *data; + struct hash_entry *bucket; + + /* The caller cannot insert a NULL entry. */ + if (! entry) + abort (); + + /* If there's a matching entry already in the table, return that. */ + if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL) + return data; + + /* ENTRY is not matched, it should be inserted. */ + + if (bucket->data) + { + struct hash_entry *new_entry = allocate_entry (table); + + if (new_entry == NULL) + return NULL; + + /* Add ENTRY in the overflow of the bucket. */ + + new_entry->data = (void *) entry; + new_entry->next = bucket->next; + bucket->next = new_entry; + table->n_entries++; + return (void *) entry; + } + + /* Add ENTRY right in the bucket head. */ + + bucket->data = (void *) entry; + table->n_entries++; + table->n_buckets_used++; + + /* If the growth threshold of the buckets in use has been reached, increase + the table size and rehash. There's no point in checking the number of + entries: if the hashing function is ill-conditioned, rehashing is not + likely to improve it. */ + + if (table->n_buckets_used + > table->tuning->growth_threshold * table->n_buckets) + { + /* Check more fully, before starting real work. If tuning arguments + became invalid, the second check will rely on proper defaults. */ + check_tuning (table); + if (table->n_buckets_used + > table->tuning->growth_threshold * table->n_buckets) + { + const Hash_tuning *tuning = table->tuning; + float candidate = + (tuning->is_n_buckets + ? (table->n_buckets * tuning->growth_factor) + : (table->n_buckets * tuning->growth_factor + * tuning->growth_threshold)); + + if (SIZE_MAX <= candidate) + return NULL; + + /* If the rehash fails, arrange to return NULL. */ + if (!hash_rehash (table, candidate)) + entry = NULL; + } + } + + return (void *) entry; +} + +/* If ENTRY is already in the table, remove it and return the just-deleted + data (the user may want to deallocate its storage). If ENTRY is not in the + table, don't modify the table and return NULL. */ + +void * +hash_delete (Hash_table *table, const void *entry) +{ + void *data; + struct hash_entry *bucket; + + data = hash_find_entry (table, entry, &bucket, true); + if (!data) + return NULL; + + table->n_entries--; + if (!bucket->data) + { + table->n_buckets_used--; + + /* If the shrink threshold of the buckets in use has been reached, + rehash into a smaller table. */ + + if (table->n_buckets_used + < table->tuning->shrink_threshold * table->n_buckets) + { + /* Check more fully, before starting real work. If tuning arguments + became invalid, the second check will rely on proper defaults. */ + check_tuning (table); + if (table->n_buckets_used + < table->tuning->shrink_threshold * table->n_buckets) + { + const Hash_tuning *tuning = table->tuning; + size_t candidate = + (tuning->is_n_buckets + ? table->n_buckets * tuning->shrink_factor + : (table->n_buckets * tuning->shrink_factor + * tuning->growth_threshold)); + + hash_rehash (table, candidate); + } + } + } + + return data; +} + +/* Testing. */ + +#if TESTING + +void +hash_print (const Hash_table *table) +{ + struct hash_entry const *bucket; + + for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) + { + struct hash_entry *cursor; + + if (bucket) + printf ("%lu:\n", (unsigned long int) (bucket - table->bucket)); + + for (cursor = bucket; cursor; cursor = cursor->next) + { + char const *s = cursor->data; + /* FIXME */ + if (s) + printf (" %s\n", s); + } + } +} + +#endif /* TESTING */ diff --git a/lib/hash.h b/lib/hash.h new file mode 100644 index 0000000..ab63a86 --- /dev/null +++ b/lib/hash.h @@ -0,0 +1,88 @@ +/* hash - hashing table processing. + 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 + it under the 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. */ + +/* A generic hash table package. */ + +/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use + obstacks instead of malloc, and recompile `hash.c' with same setting. */ + +#ifndef HASH_H_ +# define HASH_H_ + +# include +# include + +typedef size_t (*Hash_hasher) (const void *, size_t); +typedef bool (*Hash_comparator) (const void *, const void *); +typedef void (*Hash_data_freer) (void *); +typedef bool (*Hash_processor) (void *, void *); + +struct hash_entry + { + void *data; + struct hash_entry *next; + }; + +struct hash_tuning + { + /* This structure is mainly used for `hash_initialize', see the block + documentation of `hash_reset_tuning' for more complete comments. */ + + float shrink_threshold; /* ratio of used buckets to trigger a shrink */ + float shrink_factor; /* ratio of new smaller size to original size */ + float growth_threshold; /* ratio of used buckets to trigger a growth */ + float growth_factor; /* ratio of new bigger size to original size */ + bool is_n_buckets; /* if CANDIDATE really means table size */ + }; + +typedef struct hash_tuning Hash_tuning; + +struct hash_table; + +typedef struct hash_table Hash_table; + +/* Information and lookup. */ +size_t hash_get_n_buckets (const Hash_table *); +size_t hash_get_n_buckets_used (const Hash_table *); +size_t hash_get_n_entries (const Hash_table *); +size_t hash_get_max_bucket_length (const Hash_table *); +bool hash_table_ok (const Hash_table *); +void hash_print_statistics (const Hash_table *, FILE *); +void *hash_lookup (const Hash_table *, const void *); + +/* Walking. */ +void *hash_get_first (const Hash_table *); +void *hash_get_next (const Hash_table *, const void *); +size_t hash_get_entries (const Hash_table *, void **, size_t); +size_t hash_do_for_each (const Hash_table *, Hash_processor, void *); + +/* Allocation and clean-up. */ +size_t hash_string (const char *, size_t); +void hash_reset_tuning (Hash_tuning *); +Hash_table *hash_initialize (size_t, const Hash_tuning *, + Hash_hasher, Hash_comparator, + Hash_data_freer); +void hash_clear (Hash_table *); +void hash_free (Hash_table *); + +/* Insertion and deletion. */ +bool hash_rehash (Hash_table *, size_t); +void *hash_insert (Hash_table *, const void *); +void *hash_delete (Hash_table *, const void *); + +#endif diff --git a/lib/imaxtostr.c b/lib/imaxtostr.c new file mode 100644 index 0000000..5e87ad5 --- /dev/null +++ b/lib/imaxtostr.c @@ -0,0 +1,3 @@ +#define inttostr imaxtostr +#define inttype intmax_t +#include "inttostr.c" diff --git a/lib/intprops.h b/lib/intprops.h new file mode 100644 index 0000000..34f971c --- /dev/null +++ b/lib/intprops.h @@ -0,0 +1,78 @@ +/* intprops.h -- properties of integer types + + Copyright (C) 2001, 2002, 2003, 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. */ + +/* Written by Paul Eggert. */ + +#include + +/* The extra casts in the following macros work around compiler bugs, + e.g., in Cray C 5.0.3.0. */ + +/* True if the arithmetic type T is an integer type. bool counts as + an integer. */ +#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) + +/* True if negative values of the signed integer type T use two's + complement, ones' complement, or signed magnitude representation, + respectively. Much GNU code assumes two's complement, but some + people like to be portable to all possible C hosts. */ +#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) +#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) +#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) + +/* True if the arithmetic type T is signed. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* The maximum and minimum values for the integer type T. These + macros have undefined behavior if T is signed and has padding bits. + If this is a problem for you, please let us know how to fix it for + your host. */ +#define TYPE_MINIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) 0 \ + : TYPE_SIGNED_MAGNITUDE (t) \ + ? ~ (t) 0 \ + : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) +#define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) + +/* Return zero if T can be determined to be an unsigned type. + Otherwise, return 1. + When compiling with GCC, INT_STRLEN_BOUND uses this macro to obtain a + tighter bound. Otherwise, it overestimates the true bound by one byte + when applied to unsigned types of size 2, 4, 16, ... bytes. + The symbol signed_type_or_expr__ is private to this header file. */ +#if __GNUC__ >= 2 +# define signed_type_or_expr__(t) TYPE_SIGNED (__typeof__ (t)) +#else +# define signed_type_or_expr__(t) 1 +#endif + +/* Bound on length of the string representing an integer type or expression T. + Subtract 1 for the sign bit if T is signed; log10 (2.0) < 146/485; + add 1 for integer division truncation; add 1 more for a minus sign + if needed. */ +#define INT_STRLEN_BOUND(t) \ + ((sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) * 146 / 485 \ + + signed_type_or_expr__ (t) + 1) + +/* Bound on buffer size needed to represent an integer type or expression T, + including the terminating null. */ +#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) diff --git a/lib/inttostr.c b/lib/inttostr.c new file mode 100644 index 0000000..246d658 --- /dev/null +++ b/lib/inttostr.c @@ -0,0 +1,51 @@ +/* inttostr.c -- convert integers to printable strings + + Copyright (C) 2001, 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 + +#include "inttostr.h" + +/* Convert I to a printable string in BUF, which must be at least + INT_BUFSIZE_BOUND (INTTYPE) bytes long. Return the address of the + printable string, which need not start at BUF. */ + +char * +inttostr (inttype i, char *buf) +{ + char *p = buf + INT_STRLEN_BOUND (inttype); + *p = 0; + + if (i < 0) + { + do + *--p = '0' - i % 10; + while ((i /= 10) != 0); + + *--p = '-'; + } + else + { + do + *--p = '0' + i % 10; + while ((i /= 10) != 0); + } + + return p; +} diff --git a/lib/inttostr.h b/lib/inttostr.h new file mode 100644 index 0000000..31258ca --- /dev/null +++ b/lib/inttostr.h @@ -0,0 +1,30 @@ +/* inttostr.h -- convert integers to printable strings + + Copyright (C) 2001, 2002, 2003, 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) + any 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 + +#include "intprops.h" + +char *offtostr (off_t, char *); +char *imaxtostr (intmax_t, char *); +char *umaxtostr (uintmax_t, char *); +char *uinttostr (unsigned int, char *); diff --git a/lib/inttypes_.h b/lib/inttypes_.h new file mode 100644 index 0000000..6d78325 --- /dev/null +++ b/lib/inttypes_.h @@ -0,0 +1,1100 @@ +/* Copyright (C) 2006-2007 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 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. */ + +/* + * 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_ABSOLUTE_INTTYPES_H +# if @HAVE_INTTYPES_H@ +# if @HAVE_INCLUDE_NEXT@ +# include_next +# else +# include @ABSOLUTE_INTTYPES_H@ +# endif +# endif +#endif + +#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H +#define INTTYPES_H + +/* Include or the gnulib replacement. */ +#include +/* Get CHAR_BIT. */ +#include + +#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX) +# error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to ." +#endif + +/* The definition of GL_LINK_WARNING is copied here. */ + +/* 7.8.1 Macros for format specifiers */ + +#if ! defined __cplusplus || defined __STDC_FORMAT_MACROS + +# if defined _TNS_R_TARGET + /* Tandem NonStop R series and compatible platforms released before + July 2005 support %Ld but not %lld. */ +# define _LONG_LONG_FORMAT_PREFIX "L" +# else +# define _LONG_LONG_FORMAT_PREFIX "ll" +# endif + +# if !defined PRId8 || @PRI_MACROS_BROKEN@ +# undef PRId8 +# ifdef INT8_MAX +# define PRId8 "d" +# endif +# endif +# if !defined PRIi8 || @PRI_MACROS_BROKEN@ +# undef PRIi8 +# ifdef INT8_MAX +# define PRIi8 "i" +# endif +# endif +# if !defined PRIo8 || @PRI_MACROS_BROKEN@ +# undef PRIo8 +# ifdef UINT8_MAX +# define PRIo8 "o" +# endif +# endif +# if !defined PRIu8 || @PRI_MACROS_BROKEN@ +# undef PRIu8 +# ifdef UINT8_MAX +# define PRIu8 "u" +# endif +# endif +# if !defined PRIx8 || @PRI_MACROS_BROKEN@ +# undef PRIx8 +# ifdef UINT8_MAX +# define PRIx8 "x" +# endif +# endif +# if !defined PRIX8 || @PRI_MACROS_BROKEN@ +# undef PRIX8 +# ifdef UINT8_MAX +# define PRIX8 "X" +# endif +# endif +# if !defined PRId16 || @PRI_MACROS_BROKEN@ +# undef PRId16 +# ifdef INT16_MAX +# define PRId16 "d" +# endif +# endif +# if !defined PRIi16 || @PRI_MACROS_BROKEN@ +# undef PRIi16 +# ifdef INT16_MAX +# define PRIi16 "i" +# endif +# endif +# if !defined PRIo16 || @PRI_MACROS_BROKEN@ +# undef PRIo16 +# ifdef UINT16_MAX +# define PRIo16 "o" +# endif +# endif +# if !defined PRIu16 || @PRI_MACROS_BROKEN@ +# undef PRIu16 +# ifdef UINT16_MAX +# define PRIu16 "u" +# endif +# endif +# if !defined PRIx16 || @PRI_MACROS_BROKEN@ +# undef PRIx16 +# ifdef UINT16_MAX +# define PRIx16 "x" +# endif +# endif +# if !defined PRIX16 || @PRI_MACROS_BROKEN@ +# undef PRIX16 +# ifdef UINT16_MAX +# define PRIX16 "X" +# endif +# endif +# if !defined PRId32 || @PRI_MACROS_BROKEN@ +# undef PRId32 +# ifdef INT32_MAX +# define PRId32 "d" +# endif +# endif +# if !defined PRIi32 || @PRI_MACROS_BROKEN@ +# undef PRIi32 +# ifdef INT32_MAX +# define PRIi32 "i" +# endif +# endif +# if !defined PRIo32 || @PRI_MACROS_BROKEN@ +# undef PRIo32 +# ifdef UINT32_MAX +# define PRIo32 "o" +# endif +# endif +# if !defined PRIu32 || @PRI_MACROS_BROKEN@ +# undef PRIu32 +# ifdef UINT32_MAX +# define PRIu32 "u" +# endif +# endif +# if !defined PRIx32 || @PRI_MACROS_BROKEN@ +# undef PRIx32 +# ifdef UINT32_MAX +# define PRIx32 "x" +# endif +# endif +# if !defined PRIX32 || @PRI_MACROS_BROKEN@ +# undef PRIX32 +# ifdef UINT32_MAX +# define PRIX32 "X" +# endif +# endif +# ifdef INT64_MAX +# if INT64_MAX == LONG_MAX +# define _PRI64_PREFIX "l" +# elif defined _MSC_VER || defined __MINGW32__ +# define _PRI64_PREFIX "I64" +# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX +# endif +# if !defined PRId64 || @PRI_MACROS_BROKEN@ +# undef PRId64 +# define PRId64 _PRI64_PREFIX "d" +# endif +# if !defined PRIi64 || @PRI_MACROS_BROKEN@ +# undef PRIi64 +# define PRIi64 _PRI64_PREFIX "i" +# endif +# endif +# ifdef UINT64_MAX +# if UINT64_MAX == ULONG_MAX +# define _PRIu64_PREFIX "l" +# elif defined _MSC_VER || defined __MINGW32__ +# define _PRIu64_PREFIX "I64" +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX +# endif +# if !defined PRIo64 || @PRI_MACROS_BROKEN@ +# undef PRIo64 +# define PRIo64 _PRIu64_PREFIX "o" +# endif +# if !defined PRIu64 || @PRI_MACROS_BROKEN@ +# undef PRIu64 +# define PRIu64 _PRIu64_PREFIX "u" +# endif +# if !defined PRIx64 || @PRI_MACROS_BROKEN@ +# undef PRIx64 +# define PRIx64 _PRIu64_PREFIX "x" +# endif +# if !defined PRIX64 || @PRI_MACROS_BROKEN@ +# undef PRIX64 +# define PRIX64 _PRIu64_PREFIX "X" +# endif +# endif + +# if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIdLEAST8 +# define PRIdLEAST8 "d" +# endif +# if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIiLEAST8 +# define PRIiLEAST8 "i" +# endif +# if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIoLEAST8 +# define PRIoLEAST8 "o" +# endif +# if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIuLEAST8 +# define PRIuLEAST8 "u" +# endif +# if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIxLEAST8 +# define PRIxLEAST8 "x" +# endif +# if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@ +# undef PRIXLEAST8 +# define PRIXLEAST8 "X" +# endif +# if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIdLEAST16 +# define PRIdLEAST16 "d" +# endif +# if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIiLEAST16 +# define PRIiLEAST16 "i" +# endif +# if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIoLEAST16 +# define PRIoLEAST16 "o" +# endif +# if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIuLEAST16 +# define PRIuLEAST16 "u" +# endif +# if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIxLEAST16 +# define PRIxLEAST16 "x" +# endif +# if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@ +# undef PRIXLEAST16 +# define PRIXLEAST16 "X" +# endif +# if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIdLEAST32 +# define PRIdLEAST32 "d" +# endif +# if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIiLEAST32 +# define PRIiLEAST32 "i" +# endif +# if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIoLEAST32 +# define PRIoLEAST32 "o" +# endif +# if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIuLEAST32 +# define PRIuLEAST32 "u" +# endif +# if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIxLEAST32 +# define PRIxLEAST32 "x" +# endif +# if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@ +# undef PRIXLEAST32 +# define PRIXLEAST32 "X" +# endif +# ifdef INT64_MAX +# if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIdLEAST64 +# define PRIdLEAST64 PRId64 +# endif +# if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIiLEAST64 +# define PRIiLEAST64 PRIi64 +# endif +# endif +# ifdef UINT64_MAX +# if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIoLEAST64 +# define PRIoLEAST64 PRIo64 +# endif +# if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIuLEAST64 +# define PRIuLEAST64 PRIu64 +# endif +# if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIxLEAST64 +# define PRIxLEAST64 PRIx64 +# endif +# if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@ +# undef PRIXLEAST64 +# define PRIXLEAST64 PRIX64 +# endif +# endif + +# if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIdFAST8 +# if INT_FAST8_MAX > INT32_MAX +# define PRIdFAST8 PRId64 +# else +# define PRIdFAST8 "d" +# endif +# endif +# if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIiFAST8 +# if INT_FAST8_MAX > INT32_MAX +# define PRIiFAST8 PRIi64 +# else +# define PRIiFAST8 "i" +# endif +# endif +# if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIoFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define PRIoFAST8 PRIo64 +# else +# define PRIoFAST8 "o" +# endif +# endif +# if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIuFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define PRIuFAST8 PRIu64 +# else +# define PRIuFAST8 "u" +# endif +# endif +# if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIxFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define PRIxFAST8 PRIx64 +# else +# define PRIxFAST8 "x" +# endif +# endif +# if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@ +# undef PRIXFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define PRIXFAST8 PRIX64 +# else +# define PRIXFAST8 "X" +# endif +# endif +# if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIdFAST16 +# if INT_FAST16_MAX > INT32_MAX +# define PRIdFAST16 PRId64 +# else +# define PRIdFAST16 "d" +# endif +# endif +# if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIiFAST16 +# if INT_FAST16_MAX > INT32_MAX +# define PRIiFAST16 PRIi64 +# else +# define PRIiFAST16 "i" +# endif +# endif +# if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIoFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define PRIoFAST16 PRIo64 +# else +# define PRIoFAST16 "o" +# endif +# endif +# if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIuFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define PRIuFAST16 PRIu64 +# else +# define PRIuFAST16 "u" +# endif +# endif +# if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIxFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define PRIxFAST16 PRIx64 +# else +# define PRIxFAST16 "x" +# endif +# endif +# if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@ +# undef PRIXFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define PRIXFAST16 PRIX64 +# else +# define PRIXFAST16 "X" +# endif +# endif +# if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIdFAST32 +# if INT_FAST32_MAX > INT32_MAX +# define PRIdFAST32 PRId64 +# else +# define PRIdFAST32 "d" +# endif +# endif +# if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIiFAST32 +# if INT_FAST32_MAX > INT32_MAX +# define PRIiFAST32 PRIi64 +# else +# define PRIiFAST32 "i" +# endif +# endif +# if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIoFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define PRIoFAST32 PRIo64 +# else +# define PRIoFAST32 "o" +# endif +# endif +# if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIuFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define PRIuFAST32 PRIu64 +# else +# define PRIuFAST32 "u" +# endif +# endif +# if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIxFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define PRIxFAST32 PRIx64 +# else +# define PRIxFAST32 "x" +# endif +# endif +# if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@ +# undef PRIXFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define PRIXFAST32 PRIX64 +# else +# define PRIXFAST32 "X" +# endif +# endif +# ifdef INT64_MAX +# if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIdFAST64 +# define PRIdFAST64 PRId64 +# endif +# if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIiFAST64 +# define PRIiFAST64 PRIi64 +# endif +# endif +# ifdef UINT64_MAX +# if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIoFAST64 +# define PRIoFAST64 PRIo64 +# endif +# if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIuFAST64 +# define PRIuFAST64 PRIu64 +# endif +# if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIxFAST64 +# define PRIxFAST64 PRIx64 +# endif +# if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@ +# undef PRIXFAST64 +# define PRIXFAST64 PRIX64 +# endif +# endif + +# if !defined PRIdMAX || @PRI_MACROS_BROKEN@ +# undef PRIdMAX +# if INTMAX_MAX > INT32_MAX +# define PRIdMAX PRId64 +# else +# define PRIdMAX "ld" +# endif +# endif +# if !defined PRIiMAX || @PRI_MACROS_BROKEN@ +# undef PRIiMAX +# if INTMAX_MAX > INT32_MAX +# define PRIiMAX PRIi64 +# else +# define PRIiMAX "li" +# endif +# endif +# if !defined PRIoMAX || @PRI_MACROS_BROKEN@ +# undef PRIoMAX +# if UINTMAX_MAX > UINT32_MAX +# define PRIoMAX PRIo64 +# else +# define PRIoMAX "lo" +# endif +# endif +# if !defined PRIuMAX || @PRI_MACROS_BROKEN@ +# undef PRIuMAX +# if UINTMAX_MAX > UINT32_MAX +# define PRIuMAX PRIu64 +# else +# define PRIuMAX "lu" +# endif +# endif +# if !defined PRIxMAX || @PRI_MACROS_BROKEN@ +# undef PRIxMAX +# if UINTMAX_MAX > UINT32_MAX +# define PRIxMAX PRIx64 +# else +# define PRIxMAX "lx" +# endif +# endif +# if !defined PRIXMAX || @PRI_MACROS_BROKEN@ +# undef PRIXMAX +# if UINTMAX_MAX > UINT32_MAX +# define PRIXMAX PRIX64 +# else +# define PRIXMAX "lX" +# endif +# endif + +# if !defined PRIdPTR || @PRI_MACROS_BROKEN@ +# undef PRIdPTR +# ifdef INTPTR_MAX +# define PRIdPTR @PRIPTR_PREFIX@ "d" +# endif +# endif +# if !defined PRIiPTR || @PRI_MACROS_BROKEN@ +# undef PRIiPTR +# ifdef INTPTR_MAX +# define PRIiPTR @PRIPTR_PREFIX@ "i" +# endif +# endif +# if !defined PRIoPTR || @PRI_MACROS_BROKEN@ +# undef PRIoPTR +# ifdef UINTPTR_MAX +# define PRIoPTR @PRIPTR_PREFIX@ "o" +# endif +# endif +# if !defined PRIuPTR || @PRI_MACROS_BROKEN@ +# undef PRIuPTR +# ifdef UINTPTR_MAX +# define PRIuPTR @PRIPTR_PREFIX@ "u" +# endif +# endif +# if !defined PRIxPTR || @PRI_MACROS_BROKEN@ +# undef PRIxPTR +# ifdef UINTPTR_MAX +# define PRIxPTR @PRIPTR_PREFIX@ "x" +# endif +# endif +# if !defined PRIXPTR || @PRI_MACROS_BROKEN@ +# undef PRIXPTR +# ifdef UINTPTR_MAX +# define PRIXPTR @PRIPTR_PREFIX@ "X" +# endif +# endif + +# if !defined SCNd8 || @PRI_MACROS_BROKEN@ +# undef SCNd8 +# ifdef INT8_MAX +# define SCNd8 "hhd" +# endif +# endif +# if !defined SCNi8 || @PRI_MACROS_BROKEN@ +# undef SCNi8 +# ifdef INT8_MAX +# define SCNi8 "hhi" +# endif +# endif +# if !defined SCNo8 || @PRI_MACROS_BROKEN@ +# undef SCNo8 +# ifdef UINT8_MAX +# define SCNo8 "hho" +# endif +# endif +# if !defined SCNu8 || @PRI_MACROS_BROKEN@ +# undef SCNu8 +# ifdef UINT8_MAX +# define SCNu8 "hhu" +# endif +# endif +# if !defined SCNx8 || @PRI_MACROS_BROKEN@ +# undef SCNx8 +# ifdef UINT8_MAX +# define SCNx8 "hhx" +# endif +# endif +# if !defined SCNd16 || @PRI_MACROS_BROKEN@ +# undef SCNd16 +# ifdef INT16_MAX +# define SCNd16 "hd" +# endif +# endif +# if !defined SCNi16 || @PRI_MACROS_BROKEN@ +# undef SCNi16 +# ifdef INT16_MAX +# define SCNi16 "hi" +# endif +# endif +# if !defined SCNo16 || @PRI_MACROS_BROKEN@ +# undef SCNo16 +# ifdef UINT16_MAX +# define SCNo16 "ho" +# endif +# endif +# if !defined SCNu16 || @PRI_MACROS_BROKEN@ +# undef SCNu16 +# ifdef UINT16_MAX +# define SCNu16 "hu" +# endif +# endif +# if !defined SCNx16 || @PRI_MACROS_BROKEN@ +# undef SCNx16 +# ifdef UINT16_MAX +# define SCNx16 "hx" +# endif +# endif +# if !defined SCNd32 || @PRI_MACROS_BROKEN@ +# undef SCNd32 +# ifdef INT32_MAX +# define SCNd32 "d" +# endif +# endif +# if !defined SCNi32 || @PRI_MACROS_BROKEN@ +# undef SCNi32 +# ifdef INT32_MAX +# define SCNi32 "i" +# endif +# endif +# if !defined SCNo32 || @PRI_MACROS_BROKEN@ +# undef SCNo32 +# ifdef UINT32_MAX +# define SCNo32 "o" +# endif +# endif +# if !defined SCNu32 || @PRI_MACROS_BROKEN@ +# undef SCNu32 +# ifdef UINT32_MAX +# define SCNu32 "u" +# endif +# endif +# if !defined SCNx32 || @PRI_MACROS_BROKEN@ +# undef SCNx32 +# ifdef UINT32_MAX +# define SCNx32 "x" +# endif +# endif +# ifdef INT64_MAX +# if INT64_MAX == LONG_MAX +# define _SCN64_PREFIX "l" +# elif defined _MSC_VER || defined __MINGW32__ +# define _SCN64_PREFIX "I64" +# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX +# endif +# if !defined SCNd64 || @PRI_MACROS_BROKEN@ +# undef SCNd64 +# define SCNd64 _SCN64_PREFIX "d" +# endif +# if !defined SCNi64 || @PRI_MACROS_BROKEN@ +# undef SCNi64 +# define SCNi64 _SCN64_PREFIX "i" +# endif +# endif +# ifdef UINT64_MAX +# if UINT64_MAX == ULONG_MAX +# define _SCNu64_PREFIX "l" +# elif defined _MSC_VER || defined __MINGW32__ +# define _SCNu64_PREFIX "I64" +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX +# endif +# if !defined SCNo64 || @PRI_MACROS_BROKEN@ +# undef SCNo64 +# define SCNo64 _SCNu64_PREFIX "o" +# endif +# if !defined SCNu64 || @PRI_MACROS_BROKEN@ +# undef SCNu64 +# define SCNu64 _SCNu64_PREFIX "u" +# endif +# if !defined SCNx64 || @PRI_MACROS_BROKEN@ +# undef SCNx64 +# define SCNx64 _SCNu64_PREFIX "x" +# endif +# endif + +# if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNdLEAST8 +# define SCNdLEAST8 "hhd" +# endif +# if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNiLEAST8 +# define SCNiLEAST8 "hhi" +# endif +# if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNoLEAST8 +# define SCNoLEAST8 "hho" +# endif +# if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNuLEAST8 +# define SCNuLEAST8 "hhu" +# endif +# if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@ +# undef SCNxLEAST8 +# define SCNxLEAST8 "hhx" +# endif +# if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNdLEAST16 +# define SCNdLEAST16 "hd" +# endif +# if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNiLEAST16 +# define SCNiLEAST16 "hi" +# endif +# if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNoLEAST16 +# define SCNoLEAST16 "ho" +# endif +# if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNuLEAST16 +# define SCNuLEAST16 "hu" +# endif +# if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@ +# undef SCNxLEAST16 +# define SCNxLEAST16 "hx" +# endif +# if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNdLEAST32 +# define SCNdLEAST32 "d" +# endif +# if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNiLEAST32 +# define SCNiLEAST32 "i" +# endif +# if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNoLEAST32 +# define SCNoLEAST32 "o" +# endif +# if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNuLEAST32 +# define SCNuLEAST32 "u" +# endif +# if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@ +# undef SCNxLEAST32 +# define SCNxLEAST32 "x" +# endif +# ifdef INT64_MAX +# if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNdLEAST64 +# define SCNdLEAST64 SCNd64 +# endif +# if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNiLEAST64 +# define SCNiLEAST64 SCNi64 +# endif +# endif +# ifdef UINT64_MAX +# if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNoLEAST64 +# define SCNoLEAST64 SCNo64 +# endif +# if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNuLEAST64 +# define SCNuLEAST64 SCNu64 +# endif +# if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@ +# undef SCNxLEAST64 +# define SCNxLEAST64 SCNx64 +# endif +# endif + +# if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNdFAST8 +# if INT_FAST8_MAX > INT32_MAX +# define SCNdFAST8 SCNd64 +# elif INT_FAST8_MAX == 0x7fff +# define SCNdFAST8 "hd" +# elif INT_FAST8_MAX == 0x7f +# define SCNdFAST8 "hhd" +# else +# define SCNdFAST8 "d" +# endif +# endif +# if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNiFAST8 +# if INT_FAST8_MAX > INT32_MAX +# define SCNiFAST8 SCNi64 +# elif INT_FAST8_MAX == 0x7fff +# define SCNiFAST8 "hi" +# elif INT_FAST8_MAX == 0x7f +# define SCNiFAST8 "hhi" +# else +# define SCNiFAST8 "i" +# endif +# endif +# if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNoFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define SCNoFAST8 SCNo64 +# elif UINT_FAST8_MAX == 0xffff +# define SCNoFAST8 "ho" +# elif UINT_FAST8_MAX == 0xff +# define SCNoFAST8 "hho" +# else +# define SCNoFAST8 "o" +# endif +# endif +# if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNuFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define SCNuFAST8 SCNu64 +# elif UINT_FAST8_MAX == 0xffff +# define SCNuFAST8 "hu" +# elif UINT_FAST8_MAX == 0xff +# define SCNuFAST8 "hhu" +# else +# define SCNuFAST8 "u" +# endif +# endif +# if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@ +# undef SCNxFAST8 +# if UINT_FAST8_MAX > UINT32_MAX +# define SCNxFAST8 SCNx64 +# elif UINT_FAST8_MAX == 0xffff +# define SCNxFAST8 "hx" +# elif UINT_FAST8_MAX == 0xff +# define SCNxFAST8 "hhx" +# else +# define SCNxFAST8 "x" +# endif +# endif +# if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNdFAST16 +# if INT_FAST16_MAX > INT32_MAX +# define SCNdFAST16 SCNd64 +# elif INT_FAST16_MAX == 0x7fff +# define SCNdFAST16 "hd" +# else +# define SCNdFAST16 "d" +# endif +# endif +# if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNiFAST16 +# if INT_FAST16_MAX > INT32_MAX +# define SCNiFAST16 SCNi64 +# elif INT_FAST16_MAX == 0x7fff +# define SCNiFAST16 "hi" +# else +# define SCNiFAST16 "i" +# endif +# endif +# if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNoFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define SCNoFAST16 SCNo64 +# elif UINT_FAST16_MAX == 0xffff +# define SCNoFAST16 "ho" +# else +# define SCNoFAST16 "o" +# endif +# endif +# if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNuFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define SCNuFAST16 SCNu64 +# elif UINT_FAST16_MAX == 0xffff +# define SCNuFAST16 "hu" +# else +# define SCNuFAST16 "u" +# endif +# endif +# if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@ +# undef SCNxFAST16 +# if UINT_FAST16_MAX > UINT32_MAX +# define SCNxFAST16 SCNx64 +# elif UINT_FAST16_MAX == 0xffff +# define SCNxFAST16 "hx" +# else +# define SCNxFAST16 "x" +# endif +# endif +# if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNdFAST32 +# if INT_FAST32_MAX > INT32_MAX +# define SCNdFAST32 SCNd64 +# else +# define SCNdFAST32 "d" +# endif +# endif +# if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNiFAST32 +# if INT_FAST32_MAX > INT32_MAX +# define SCNiFAST32 SCNi64 +# else +# define SCNiFAST32 "i" +# endif +# endif +# if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNoFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define SCNoFAST32 SCNo64 +# else +# define SCNoFAST32 "o" +# endif +# endif +# if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNuFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define SCNuFAST32 SCNu64 +# else +# define SCNuFAST32 "u" +# endif +# endif +# if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@ +# undef SCNxFAST32 +# if UINT_FAST32_MAX > UINT32_MAX +# define SCNxFAST32 SCNx64 +# else +# define SCNxFAST32 "x" +# endif +# endif +# ifdef INT64_MAX +# if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNdFAST64 +# define SCNdFAST64 SCNd64 +# endif +# if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNiFAST64 +# define SCNiFAST64 SCNi64 +# endif +# endif +# ifdef UINT64_MAX +# if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNoFAST64 +# define SCNoFAST64 SCNo64 +# endif +# if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNuFAST64 +# define SCNuFAST64 SCNu64 +# endif +# if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@ +# undef SCNxFAST64 +# define SCNxFAST64 SCNx64 +# endif +# endif + +# if !defined SCNdMAX || @PRI_MACROS_BROKEN@ +# undef SCNdMAX +# if INTMAX_MAX > INT32_MAX +# define SCNdMAX SCNd64 +# else +# define SCNdMAX "ld" +# endif +# endif +# if !defined SCNiMAX || @PRI_MACROS_BROKEN@ +# undef SCNiMAX +# if INTMAX_MAX > INT32_MAX +# define SCNiMAX SCNi64 +# else +# define SCNiMAX "li" +# endif +# endif +# if !defined SCNoMAX || @PRI_MACROS_BROKEN@ +# undef SCNoMAX +# if UINTMAX_MAX > UINT32_MAX +# define SCNoMAX SCNo64 +# else +# define SCNoMAX "lo" +# endif +# endif +# if !defined SCNuMAX || @PRI_MACROS_BROKEN@ +# undef SCNuMAX +# if UINTMAX_MAX > UINT32_MAX +# define SCNuMAX SCNu64 +# else +# define SCNuMAX "lu" +# endif +# endif +# if !defined SCNxMAX || @PRI_MACROS_BROKEN@ +# undef SCNxMAX +# if UINTMAX_MAX > UINT32_MAX +# define SCNxMAX SCNx64 +# else +# define SCNxMAX "lx" +# endif +# endif + +# if !defined SCNdPTR || @PRI_MACROS_BROKEN@ +# undef SCNdPTR +# ifdef INTPTR_MAX +# define SCNdPTR @PRIPTR_PREFIX@ "d" +# endif +# endif +# if !defined SCNiPTR || @PRI_MACROS_BROKEN@ +# undef SCNiPTR +# ifdef INTPTR_MAX +# define SCNiPTR @PRIPTR_PREFIX@ "i" +# endif +# endif +# if !defined SCNoPTR || @PRI_MACROS_BROKEN@ +# undef SCNoPTR +# ifdef UINTPTR_MAX +# define SCNoPTR @PRIPTR_PREFIX@ "o" +# endif +# endif +# if !defined SCNuPTR || @PRI_MACROS_BROKEN@ +# undef SCNuPTR +# ifdef UINTPTR_MAX +# define SCNuPTR @PRIPTR_PREFIX@ "u" +# endif +# endif +# if !defined SCNxPTR || @PRI_MACROS_BROKEN@ +# undef SCNxPTR +# ifdef UINTPTR_MAX +# define SCNxPTR @PRIPTR_PREFIX@ "x" +# endif +# endif + +#endif + +/* 7.8.2 Functions for greatest-width integer types */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if @GNULIB_IMAXABS@ +# if !@HAVE_DECL_IMAXABS@ +extern intmax_t imaxabs (intmax_t); +# endif +#elif defined GNULIB_POSIXCHECK +# undef imaxabs +# define imaxabs(a) \ + (GL_LINK_WARNING ("imaxabs is unportable - " \ + "use gnulib module imaxabs for portability"), \ + imaxabs (a)) +#endif + +#if @GNULIB_IMAXDIV@ +# if !@HAVE_DECL_IMAXDIV@ +typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; +extern imaxdiv_t imaxdiv (intmax_t, intmax_t); +# endif +#elif defined GNULIB_POSIXCHECK +# undef imaxdiv +# define imaxdiv(a,b) \ + (GL_LINK_WARNING ("imaxdiv is unportable - " \ + "use gnulib module imaxdiv for portability"), \ + imaxdiv (a, b)) +#endif + +#if @GNULIB_STRTOIMAX@ +# if !@HAVE_DECL_STRTOIMAX@ +extern intmax_t strtoimax (const char *, char **, int); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtoimax +# define strtoimax(p,e,b) \ + (GL_LINK_WARNING ("strtoimax is unportable - " \ + "use gnulib module strtoimax for portability"), \ + strtoimax (p, e, b)) +#endif + +#if @GNULIB_STRTOUMAX@ +# if !@HAVE_DECL_STRTOUMAX@ +extern uintmax_t strtoumax (const char *, char **, int); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtoumax +# define strtoumax(p,e,b) \ + (GL_LINK_WARNING ("strtoumax is unportable - " \ + "use gnulib module strtoumax for portability"), \ + strtoumax (p, e, b)) +#endif + +/* Don't bother defining or declaring wcstoimax and wcstoumax, since + wide-character functions like this are hardly ever useful. */ + +#ifdef __cplusplus +} +#endif + +#endif /* INTTYPES_H */ diff --git a/lib/lchown.c b/lib/lchown.c new file mode 100644 index 0000000..fa0826e --- /dev/null +++ b/lib/lchown.c @@ -0,0 +1,47 @@ +/* Provide a stub lchown function for systems that lack it. + + Copyright (C) 1998, 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 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 "lchown.h" + +#include + +/* 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 + symlinks, then just call chown. */ + +int +lchown (const char *file, uid_t uid, gid_t gid) +{ +#if ! CHOWN_MODIFIES_SYMLINK + struct stat stats; + + if (lstat (file, &stats) == 0 && S_ISLNK (stats.st_mode)) + { + errno = EOPNOTSUPP; + return -1; + } +#endif + + return chown (file, uid, gid); +} diff --git a/lib/lchown.h b/lib/lchown.h new file mode 100644 index 0000000..6816d1f --- /dev/null +++ b/lib/lchown.h @@ -0,0 +1,42 @@ +/* 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/lib/lstat.c b/lib/lstat.c new file mode 100644 index 0000000..77dd228 --- /dev/null +++ b/lib/lstat.c @@ -0,0 +1,76 @@ +/* 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. + + This program is free software; you can redistribute it and/or modify + it under the 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 + +/* 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. */ + +#include +#include +#include +#include + +/* lstat works differently on Linux and Solaris systems. POSIX (see + `pathname resolution' in the glossary) requires that programs like + `ls' take into consideration the fact that FILE has a trailing slash + when FILE is a symbolic link. On Linux and Solaris 10 systems, the + lstat function already has the desired semantics (in treating + `lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)', + but on Solaris 9 and earlier it does not. + + If FILE has a trailing slash and specifies a symbolic link, + then use stat() to get more info on the referent of FILE. + If the referent is a non-directory, then set errno to ENOTDIR + and return -1. Otherwise, return stat's result. */ + +int +rpl_lstat (const char *file, struct stat *sbuf) +{ + size_t len; + int lstat_result = lstat (file, sbuf); + + if (lstat_result != 0 || !S_ISLNK (sbuf->st_mode)) + return lstat_result; + + len = strlen (file); + if (len == 0 || file[len - 1] != '/') + return 0; + + /* FILE refers to a symbolic link and the name ends with a slash. + Call stat() to get info about the link's referent. */ + + /* If stat fails, then we do the same. */ + if (stat (file, sbuf) != 0) + return -1; + + /* If FILE references a directory, return 0. */ + if (S_ISDIR (sbuf->st_mode)) + return 0; + + /* Here, we know stat succeeded and FILE references a non-directory. + But it was specified via a name including a trailing slash. + Fail with errno set to ENOTDIR to indicate the contradiction. */ + errno = ENOTDIR; + return -1; +} diff --git a/lib/lstat.h b/lib/lstat.h new file mode 100644 index 0000000..6a83fbf --- /dev/null +++ b/lib/lstat.h @@ -0,0 +1,24 @@ +/* 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/lib/malloc.c b/lib/malloc.c new file mode 100644 index 0000000..d4dae3e --- /dev/null +++ b/lib/malloc.c @@ -0,0 +1,35 @@ +/* malloc() function that is glibc compatible. + + Copyright (C) 1997, 1998, 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 +#undef malloc + +#include + +/* 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) +{ + if (n == 0) + n = 1; + return malloc (n); +} diff --git a/lib/mempcpy.c b/lib/mempcpy.c new file mode 100644 index 0000000..1c702c7 --- /dev/null +++ b/lib/mempcpy.c @@ -0,0 +1,29 @@ +/* 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) + any 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 + +/* Copy N bytes of SRC to DEST, return pointer to bytes after the + last written byte. */ +void * +mempcpy (void *dest, const void *src, size_t n) +{ + return (char *) memcpy (dest, src, n) + n; +} diff --git a/lib/memrchr.c b/lib/memrchr.c new file mode 100644 index 0000000..29fd531 --- /dev/null +++ b/lib/memrchr.c @@ -0,0 +1,190 @@ +/* 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. + + 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 by Roland McGrath (roland@ai.mit.edu). + + This program is free software; you can redistribute it and/or modify + it under the 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 _LIBC +# include +#else +# include +# define reg_char char +#endif + +#include +#include + +#undef __memrchr +#undef memrchr + +#ifndef weak_alias +# define __memrchr memrchr +#endif + +/* Search no more than N bytes of S for C. */ +void * +__memrchr (void const *s, int c_in, size_t n) +{ + const unsigned char *char_ptr; + const unsigned long int *longword_ptr; + unsigned long int longword, magic_bits, charmask; + unsigned reg_char c; + int i; + + c = (unsigned char) c_in; + + /* Handle the last few characters by reading one character 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) + if (*--char_ptr == c) + return (void *) 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) + { + /* 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) + { + /* Which of the bytes was C? If none of them were, it was + a misfire; continue the search. */ + + 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; + } + + n -= sizeof longword; + } + + char_ptr = (const unsigned char *) longword_ptr; + + while (n-- > 0) + { + if (*--char_ptr == c) + return (void *) char_ptr; + } + + return 0; +} +#ifdef weak_alias +weak_alias (__memrchr, memrchr) +#endif diff --git a/lib/mkdirat.c b/lib/mkdirat.c new file mode 100644 index 0000000..da0b262 --- /dev/null +++ b/lib/mkdirat.c @@ -0,0 +1,43 @@ +/* fd-relative mkdir + Copyright (C) 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) + any 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 "openat.h" + +#include + +#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ +#include "save-cwd.h" +#include "openat-priv.h" + +/* Solaris 10 has no function like this. + Create a subdirectory, FILE, with mode MODE, in the directory + open on descriptor FD. If possible, do it without changing the + working directory. Otherwise, resort to using save_cwd/fchdir, + then mkdir/restore_cwd. If either the save_cwd or the restore_cwd + fails, then give a diagnostic and exit nonzero. */ + +#define AT_FUNC_NAME mkdirat +#define AT_FUNC_F1 mkdir +#define AT_FUNC_F2 mkdir +#define AT_FUNC_USE_F1_COND 1 +#define AT_FUNC_POST_FILE_PARAM_DECLS , mode_t mode +#define AT_FUNC_POST_FILE_ARGS , mode +#include "at-func.c" diff --git a/lib/mktime.c b/lib/mktime.c new file mode 100644 index 0000000..a91fb20 --- /dev/null +++ b/lib/mktime.c @@ -0,0 +1,663 @@ +/* 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. + Contributed by 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) + any 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. */ + +/* Define this to have a standalone program to test this implementation of + mktime. */ +/* #define DEBUG 1 */ + +#ifndef _LIBC +# include +#endif + +/* Assume that leap seconds are possible, unless told otherwise. + If the host has a `zic' command with a `-L leapsecondfilename' option, + then it supports leap seconds; otherwise it probably doesn't. */ +#ifndef LEAP_SECONDS_POSSIBLE +# define LEAP_SECONDS_POSSIBLE 1 +#endif + +#include + +#include + +#include /* For the real memcpy prototype. */ + +#if DEBUG +# include +# include +/* Make it work even if the system's libc has its own mktime routine. */ +# define mktime my_mktime +#endif /* DEBUG */ + +/* Shift A right by B bits portably, by dividing A by 2**B and + truncating towards minus infinity. A and B should be free of side + effects, and B should be in the range 0 <= B <= INT_BITS - 2, where + INT_BITS is the number of useful bits in an int. GNU code can + assume that INT_BITS is at least 32. + + ISO C99 says that A >> B is implementation-defined if A < 0. Some + implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift + right in the usual way when A < 0, so SHR falls back on division if + ordinary A >> B doesn't seem to be the usual signed shift. */ +#define SHR(a, b) \ + (-1 >> 1 == -1 \ + ? (a) >> (b) \ + : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0)) + +/* The extra casts in the following macros work around compiler bugs, + e.g., in Cray C 5.0.3.0. */ + +/* True if the arithmetic type T is an integer type. bool counts as + an integer. */ +#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) + +/* True if negative values of the signed integer type T use two's + complement, ones' complement, or signed magnitude representation, + respectively. Much GNU code assumes two's complement, but some + people like to be portable to all possible C hosts. */ +#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) +#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) +#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) + +/* True if the arithmetic type T is signed. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* The maximum and minimum values for the integer type T. These + macros have undefined behavior if T is signed and has padding bits. + If this is a problem for you, please let us know how to fix it for + your host. */ +#define TYPE_MINIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) 0 \ + : TYPE_SIGNED_MAGNITUDE (t) \ + ? ~ (t) 0 \ + : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) +#define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) + +#ifndef TIME_T_MIN +# define TIME_T_MIN TYPE_MINIMUM (time_t) +#endif +#ifndef TIME_T_MAX +# define TIME_T_MAX TYPE_MAXIMUM (time_t) +#endif +#define TIME_T_MIDPOINT (SHR (TIME_T_MIN + TIME_T_MAX, 1) + 1) + +/* Verify a requirement at compile-time (unlike assert, which is runtime). */ +#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; } + +verify (time_t_is_integer, TYPE_IS_INTEGER (time_t)); +verify (twos_complement_arithmetic, TYPE_TWOS_COMPLEMENT (int)); +/* The code also assumes that signed integer overflow silently wraps + around, but this assumption can't be stated without causing a + diagnostic on some hosts. */ + +#define EPOCH_YEAR 1970 +#define TM_YEAR_BASE 1900 +verify (base_year_is_a_multiple_of_100, TM_YEAR_BASE % 100 == 0); + +/* Return 1 if YEAR + TM_YEAR_BASE is a leap year. */ +static inline int +leapyear (long int year) +{ + /* Don't add YEAR to TM_YEAR_BASE, as that might overflow. + Also, work even if YEAR is negative. */ + return + ((year & 3) == 0 + && (year % 100 != 0 + || ((year / 100) & 3) == (- (TM_YEAR_BASE / 100) & 3))); +} + +/* How many days come before each month (0-12). */ +#ifndef _LIBC +static +#endif +const unsigned short int __mon_yday[2][13] = + { + /* Normal years. */ + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, + /* Leap years. */ + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } + }; + + +#ifndef _LIBC +/* Portable standalone applications should supply a that + declares a POSIX-compliant localtime_r, for the benefit of older + implementations that lack localtime_r or have a nonstandard one. + See the gnulib time_r module for one way to implement this. */ +# undef __localtime_r +# define __localtime_r localtime_r +# define __mktime_internal mktime_internal +#endif + +/* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) - + (YEAR0-YDAY0 HOUR0:MIN0:SEC0) in seconds, assuming that the clocks + were not adjusted between the time stamps. + + The YEAR values uses the same numbering as TP->tm_year. Values + need not be in the usual range. However, YEAR1 must not be less + than 2 * INT_MIN or greater than 2 * INT_MAX. + + The result may overflow. It is the caller's responsibility to + detect overflow. */ + +static inline time_t +ydhms_diff (long int year1, long int yday1, int hour1, int min1, int sec1, + int year0, int yday0, int hour0, int min0, int sec0) +{ + verify (C99_integer_division, -1 / 2 == 0); + verify (long_int_year_and_yday_are_wide_enough, + INT_MAX <= LONG_MAX / 2 || TIME_T_MAX <= UINT_MAX); + + /* Compute intervening leap days correctly even if year is negative. + Take care to avoid integer overflow here. */ + int a4 = SHR (year1, 2) + SHR (TM_YEAR_BASE, 2) - ! (year1 & 3); + int b4 = SHR (year0, 2) + SHR (TM_YEAR_BASE, 2) - ! (year0 & 3); + int a100 = a4 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 0); + int a400 = SHR (a100, 2); + int b400 = SHR (b100, 2); + int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); + + /* Compute the desired time in time_t precision. Overflow might + occur here. */ + time_t tyear1 = year1; + time_t years = tyear1 - year0; + time_t days = 365 * years + yday1 - yday0 + intervening_leap_days; + time_t hours = 24 * days + hour1 - hour0; + time_t minutes = 60 * hours + min1 - min0; + time_t seconds = 60 * minutes + sec1 - sec0; + return seconds; +} + + +/* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC), + assuming that *T corresponds to *TP and that no clock adjustments + occurred between *TP and the desired time. + If TP is null, return a value not equal to *T; this avoids false matches. + If overflow occurs, yield the minimal or maximal value, except do not + yield a value equal to *T. */ +static time_t +guess_time_tm (long int year, long int yday, int hour, int min, int sec, + const time_t *t, const struct tm *tp) +{ + if (tp) + { + time_t d = ydhms_diff (year, yday, hour, min, sec, + tp->tm_year, tp->tm_yday, + tp->tm_hour, tp->tm_min, tp->tm_sec); + time_t t1 = *t + d; + if ((t1 < *t) == (TYPE_SIGNED (time_t) ? d < 0 : TIME_T_MAX / 2 < d)) + return t1; + } + + /* Overflow occurred one way or another. Return the nearest result + that is actually in range, except don't report a zero difference + if the actual difference is nonzero, as that would cause a false + match; and don't oscillate between two values, as that would + confuse the spring-forward gap detector. */ + return (*t < TIME_T_MIDPOINT + ? (*t <= TIME_T_MIN + 1 ? *t + 1 : TIME_T_MIN) + : (TIME_T_MAX - 1 <= *t ? *t - 1 : TIME_T_MAX)); +} + +/* Use CONVERT to convert *T to a broken down time in *TP. + If *T is out of range for conversion, adjust it so that + it is the nearest in-range value and then convert that. */ +static struct tm * +ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), + time_t *t, struct tm *tp) +{ + struct tm *r = convert (t, tp); + + if (!r && *t) + { + time_t bad = *t; + time_t ok = 0; + + /* BAD is a known unconvertible time_t, and OK is a known good one. + Use binary search to narrow the range between BAD and OK until + they differ by 1. */ + while (bad != ok + (bad < 0 ? -1 : 1)) + { + time_t mid = *t = (bad < 0 + ? bad + ((ok - bad) >> 1) + : ok + ((bad - ok) >> 1)); + r = convert (t, tp); + if (r) + ok = mid; + else + bad = mid; + } + + if (!r && ok) + { + /* The last conversion attempt failed; + revert to the most recent successful attempt. */ + *t = ok; + r = convert (t, tp); + } + } + + return r; +} + + +/* Convert *TP to a time_t value, inverting + the monotonic and mostly-unit-linear conversion function CONVERT. + Use *OFFSET to keep track of a guess at the offset of the result, + compared to what the result would be for UTC without leap seconds. + If *OFFSET's guess is correct, only one CONVERT call is needed. + This function is external because it is used also by timegm.c. */ +time_t +__mktime_internal (struct tm *tp, + struct tm *(*convert) (const time_t *, struct tm *), + time_t *offset) +{ + time_t t, gt, t0, t1, t2; + struct tm tm; + + /* The maximum number of probes (calls to CONVERT) should be enough + to handle any combinations of time zone rule changes, solar time, + leap seconds, and oscillations around a spring-forward gap. + POSIX.1 prohibits leap seconds, but some hosts have them anyway. */ + int remaining_probes = 6; + + /* Time requested. Copy it in case CONVERT modifies *TP; this can + occur if TP is localtime's returned value and CONVERT is localtime. */ + int sec = tp->tm_sec; + int min = tp->tm_min; + int hour = tp->tm_hour; + int mday = tp->tm_mday; + int mon = tp->tm_mon; + int year_requested = tp->tm_year; + int isdst = tp->tm_isdst; + + /* 1 if the previous probe was DST. */ + int dst2; + + /* Ensure that mon is in range, and set year accordingly. */ + int mon_remainder = mon % 12; + int negative_mon_remainder = mon_remainder < 0; + int mon_years = mon / 12 - negative_mon_remainder; + long int lyear_requested = year_requested; + long int year = lyear_requested + mon_years; + + /* The other values need not be in range: + the remaining code handles minor overflows correctly, + assuming int and time_t arithmetic wraps around. + Major overflows are caught at the end. */ + + /* Calculate day of year from year, month, and day of month. + The result need not be in range. */ + int mon_yday = ((__mon_yday[leapyear (year)] + [mon_remainder + 12 * negative_mon_remainder]) + - 1); + long int lmday = mday; + long int yday = mon_yday + lmday; + + time_t guessed_offset = *offset; + + int sec_requested = sec; + + if (LEAP_SECONDS_POSSIBLE) + { + /* Handle out-of-range seconds specially, + since ydhms_tm_diff assumes every minute has 60 seconds. */ + if (sec < 0) + sec = 0; + if (59 < sec) + sec = 59; + } + + /* Invert CONVERT by probing. First assume the same offset as last + time. */ + + t0 = ydhms_diff (year, yday, hour, min, sec, + EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, - guessed_offset); + + if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3) + { + /* time_t isn't large enough to rule out overflows, so check + for major overflows. A gross check suffices, since if t0 + has overflowed, it is off by a multiple of TIME_T_MAX - + TIME_T_MIN + 1. So ignore any component of the difference + that is bounded by a small value. */ + + /* Approximate log base 2 of the number of time units per + biennium. A biennium is 2 years; use this unit instead of + years to avoid integer overflow. For example, 2 average + Gregorian years are 2 * 365.2425 * 24 * 60 * 60 seconds, + which is 63113904 seconds, and rint (log2 (63113904)) is + 26. */ + int ALOG2_SECONDS_PER_BIENNIUM = 26; + int ALOG2_MINUTES_PER_BIENNIUM = 20; + int ALOG2_HOURS_PER_BIENNIUM = 14; + int ALOG2_DAYS_PER_BIENNIUM = 10; + int LOG2_YEARS_PER_BIENNIUM = 1; + + int approx_requested_biennia = + (SHR (year_requested, LOG2_YEARS_PER_BIENNIUM) + - SHR (EPOCH_YEAR - TM_YEAR_BASE, LOG2_YEARS_PER_BIENNIUM) + + SHR (mday, ALOG2_DAYS_PER_BIENNIUM) + + SHR (hour, ALOG2_HOURS_PER_BIENNIUM) + + SHR (min, ALOG2_MINUTES_PER_BIENNIUM) + + (LEAP_SECONDS_POSSIBLE + ? 0 + : SHR (sec, ALOG2_SECONDS_PER_BIENNIUM))); + + int approx_biennia = SHR (t0, ALOG2_SECONDS_PER_BIENNIUM); + int diff = approx_biennia - approx_requested_biennia; + int abs_diff = diff < 0 ? - diff : diff; + + /* IRIX 4.0.5 cc miscaculates TIME_T_MIN / 3: it erroneously + gives a positive value of 715827882. Setting a variable + first then doing math on it seems to work. + (ghazi@caip.rutgers.edu) */ + time_t time_t_max = TIME_T_MAX; + time_t time_t_min = TIME_T_MIN; + time_t overflow_threshold = + (time_t_max / 3 - time_t_min / 3) >> ALOG2_SECONDS_PER_BIENNIUM; + + if (overflow_threshold < abs_diff) + { + /* Overflow occurred. Try repairing it; this might work if + the time zone offset is enough to undo the overflow. */ + time_t repaired_t0 = -1 - t0; + approx_biennia = SHR (repaired_t0, ALOG2_SECONDS_PER_BIENNIUM); + diff = approx_biennia - approx_requested_biennia; + abs_diff = diff < 0 ? - diff : diff; + if (overflow_threshold < abs_diff) + return -1; + guessed_offset += repaired_t0 - t0; + t0 = repaired_t0; + } + } + + /* Repeatedly use the error to improve the guess. */ + + for (t = t1 = t2 = t0, dst2 = 0; + (gt = guess_time_tm (year, yday, hour, min, sec, &t, + ranged_convert (convert, &t, &tm)), + t != gt); + t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0) + if (t == t1 && t != t2 + && (tm.tm_isdst < 0 + || (isdst < 0 + ? dst2 <= (tm.tm_isdst != 0) + : (isdst != 0) != (tm.tm_isdst != 0)))) + /* We can't possibly find a match, as we are oscillating + between two values. The requested time probably falls + within a spring-forward gap of size GT - T. Follow the common + practice in this case, which is to return a time that is GT - T + away from the requested time, preferring a time whose + tm_isdst differs from the requested value. (If no tm_isdst + was requested and only one of the two values has a nonzero + tm_isdst, prefer that value.) In practice, this is more + useful than returning -1. */ + goto offset_found; + else if (--remaining_probes == 0) + return -1; + + /* We have a match. Check whether tm.tm_isdst has the requested + value, if any. */ + if (isdst != tm.tm_isdst && 0 <= isdst && 0 <= tm.tm_isdst) + { + /* tm.tm_isdst has the wrong value. Look for a neighboring + time with the right value, and use its UTC offset. + + Heuristic: probe the adjacent timestamps in both directions, + looking for the desired isdst. This should work for all real + time zone histories in the tz database. */ + + /* Distance between probes when looking for a DST boundary. In + tzdata2003a, the shortest period of DST is 601200 seconds + (e.g., America/Recife starting 2000-10-08 01:00), and the + shortest period of non-DST surrounded by DST is 694800 + seconds (Africa/Tunis starting 1943-04-17 01:00). Use the + minimum of these two values, so we don't miss these short + periods when probing. */ + int stride = 601200; + + /* The longest period of DST in tzdata2003a is 536454000 seconds + (e.g., America/Jujuy starting 1946-10-01 01:00). The longest + period of non-DST is much longer, but it makes no real sense + to search for more than a year of non-DST, so use the DST + max. */ + int duration_max = 536454000; + + /* Search in both directions, so the maximum distance is half + the duration; add the stride to avoid off-by-1 problems. */ + int delta_bound = duration_max / 2 + stride; + + int delta, direction; + + for (delta = stride; delta < delta_bound; delta += stride) + for (direction = -1; direction <= 1; direction += 2) + { + time_t ot = t + delta * direction; + if ((ot < t) == (direction < 0)) + { + struct tm otm; + ranged_convert (convert, &ot, &otm); + if (otm.tm_isdst == isdst) + { + /* We found the desired tm_isdst. + Extrapolate back to the desired time. */ + t = guess_time_tm (year, yday, hour, min, sec, &ot, &otm); + ranged_convert (convert, &t, &tm); + goto offset_found; + } + } + } + } + + offset_found: + *offset = guessed_offset + t - t0; + + if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec) + { + /* Adjust time to reflect the tm_sec requested, not the normalized value. + Also, repair any damage from a false match due to a leap second. */ + int sec_adjustment = (sec == 0 && tm.tm_sec == 60) - sec; + t1 = t + sec_requested; + t2 = t1 + sec_adjustment; + if (((t1 < t) != (sec_requested < 0)) + | ((t2 < t1) != (sec_adjustment < 0)) + | ! convert (&t2, &tm)) + return -1; + t = t2; + } + + *tp = tm; + return t; +} + + +/* FIXME: This should use a signed type wide enough to hold any UTC + offset in seconds. 'int' should be good enough for GNU code. We + can't fix this unilaterally though, as other modules invoke + __mktime_internal. */ +static time_t localtime_offset; + +/* Convert *TP to a time_t value. */ +time_t +mktime (struct tm *tp) +{ +#ifdef _LIBC + /* POSIX.1 8.1.1 requires that whenever mktime() is called, the + time zone names contained in the external variable `tzname' shall + be set as if the tzset() function had been called. */ + __tzset (); +#endif + + return __mktime_internal (tp, __localtime_r, &localtime_offset); +} + +#ifdef weak_alias +weak_alias (mktime, timelocal) +#endif + +#ifdef _LIBC +libc_hidden_def (mktime) +libc_hidden_weak (timelocal) +#endif + +#if DEBUG + +static int +not_equal_tm (const struct tm *a, const struct tm *b) +{ + return ((a->tm_sec ^ b->tm_sec) + | (a->tm_min ^ b->tm_min) + | (a->tm_hour ^ b->tm_hour) + | (a->tm_mday ^ b->tm_mday) + | (a->tm_mon ^ b->tm_mon) + | (a->tm_year ^ b->tm_year) + | (a->tm_yday ^ b->tm_yday) + | (a->tm_isdst ^ b->tm_isdst)); +} + +static void +print_tm (const struct tm *tp) +{ + if (tp) + printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", + tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec, + tp->tm_yday, tp->tm_wday, tp->tm_isdst); + else + printf ("0"); +} + +static int +check_result (time_t tk, struct tm tmk, time_t tl, const struct tm *lt) +{ + if (tk != tl || !lt || not_equal_tm (&tmk, lt)) + { + printf ("mktime ("); + print_tm (lt); + printf (")\nyields ("); + print_tm (&tmk); + printf (") == %ld, should be %ld\n", (long int) tk, (long int) tl); + return 1; + } + + return 0; +} + +int +main (int argc, char **argv) +{ + int status = 0; + struct tm tm, tmk, tml; + struct tm *lt; + time_t tk, tl, tl1; + char trailer; + + if ((argc == 3 || argc == 4) + && (sscanf (argv[1], "%d-%d-%d%c", + &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) + == 3) + && (sscanf (argv[2], "%d:%d:%d%c", + &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) + == 3)) + { + tm.tm_year -= TM_YEAR_BASE; + tm.tm_mon--; + tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); + tmk = tm; + tl = mktime (&tmk); + lt = localtime (&tl); + if (lt) + { + tml = *lt; + lt = &tml; + } + printf ("mktime returns %ld == ", (long int) tl); + print_tm (&tmk); + printf ("\n"); + status = check_result (tl, tmk, tl, lt); + } + else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) + { + time_t from = atol (argv[1]); + time_t by = atol (argv[2]); + time_t to = atol (argv[3]); + + if (argc == 4) + for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) + { + lt = localtime (&tl); + if (lt) + { + tmk = tml = *lt; + tk = mktime (&tmk); + status |= check_result (tk, tmk, tl, &tml); + } + else + { + printf ("localtime (%ld) yields 0\n", (long int) tl); + status = 1; + } + tl1 = tl + by; + if ((tl1 < tl) != (by < 0)) + break; + } + else + for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) + { + /* Null benchmark. */ + lt = localtime (&tl); + if (lt) + { + tmk = tml = *lt; + tk = tl; + status |= check_result (tk, tmk, tl, &tml); + } + else + { + printf ("localtime (%ld) yields 0\n", (long int) tl); + status = 1; + } + tl1 = tl + by; + if ((tl1 < tl) != (by < 0)) + break; + } + } + else + printf ("Usage:\ +\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ +\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ +\t%s FROM BY TO - # Do not test those values (for benchmark).\n", + argv[0], argv[0], argv[0]); + + return status; +} + +#endif /* DEBUG */ + +/* +Local Variables: +compile-command: "gcc -DDEBUG -Wall -W -O -g mktime.c -o mktime" +End: +*/ diff --git a/lib/obstack.c b/lib/obstack.c new file mode 100644 index 0000000..5cd0b7a --- /dev/null +++ b/lib/obstack.c @@ -0,0 +1,431 @@ +/* obstack.c - subroutines used implicitly by object stack macros + + Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 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 + it under the 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. */ + +#ifdef _LIBC +# include +# include +#else +# include +# include "obstack.h" +#endif + +/* NOTE BEFORE MODIFYING THIS FILE: This version number must be + incremented whenever callers compiled using an old obstack.h can no + longer properly call the functions in this obstack.c. */ +#define OBSTACK_INTERFACE_VERSION 1 + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself, and the installed library + supports the same library interface we do. This code is part of the GNU + C Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object + files, it is simpler to just do this in the source for each such file. */ + +#include /* Random thing to get __GNU_LIBRARY__. */ +#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1 +# include +# if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION +# define ELIDE_CODE +# endif +#endif + +#include + +#ifndef ELIDE_CODE + +# include + +/* Determine default alignment. */ +union fooround +{ + uintmax_t i; + long double d; + void *p; +}; +struct fooalign +{ + char c; + union fooround u; +}; +/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT. + But in fact it might be less smart and round addresses to as much as + DEFAULT_ROUNDING. So we prepare for it to do that. */ +enum + { + DEFAULT_ALIGNMENT = offsetof (struct fooalign, u), + DEFAULT_ROUNDING = sizeof (union fooround) + }; + +/* When we copy a long block of data, this is the unit to do it with. + On some machines, copying successive ints does not work; + in such a case, redefine COPYING_UNIT to `long' (if that works) + or `char' as a last resort. */ +# ifndef COPYING_UNIT +# define COPYING_UNIT int +# endif + + +/* The functions allocating more room by calling `obstack_chunk_alloc' + jump to the handler pointed to by `obstack_alloc_failed_handler'. + This can be set to a user defined function which should either + abort gracefully or use longjump - but shouldn't return. This + variable by default points to the internal function + `print_and_abort'. */ +static void print_and_abort (void); +void (*obstack_alloc_failed_handler) (void) = print_and_abort; + +/* Exit value used when `print_and_abort' is used. */ +# include +# ifdef _LIBC +int obstack_exit_failure = EXIT_FAILURE; +# else +# include "exitfail.h" +# define obstack_exit_failure exit_failure +# endif + +# ifdef _LIBC +# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) +/* A looong time ago (before 1994, anyway; we're not sure) this global variable + was used by non-GNU-C macros to avoid multiple evaluation. The GNU C + library still exports it because somebody might use it. */ +struct obstack *_obstack_compat; +compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0); +# endif +# endif + +/* Define a macro that either calls functions with the traditional malloc/free + calling interface, or calls functions with the mmalloc/mfree interface + (that adds an extra first argument), based on the state of use_extra_arg. + For free, do not use ?:, since some compilers, like the MIPS compilers, + do not allow (expr) ? void : void. */ + +# define CALL_CHUNKFUN(h, size) \ + (((h) -> use_extra_arg) \ + ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ + : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) + +# define CALL_FREEFUN(h, old_chunk) \ + do { \ + if ((h) -> use_extra_arg) \ + (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ + else \ + (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ + } while (0) + + +/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). + Objects start on multiples of ALIGNMENT (0 means use default). + CHUNKFUN is the function to use to allocate chunks, + and FREEFUN the function to free them. + + Return nonzero if successful, calls obstack_alloc_failed_handler if + allocation fails. */ + +int +_obstack_begin (struct obstack *h, + int size, int alignment, + void *(*chunkfun) (long), + void (*freefun) (void *)) +{ + register struct _obstack_chunk *chunk; /* points to new chunk */ + + if (alignment == 0) + alignment = DEFAULT_ALIGNMENT; + if (size == 0) + /* Default size is what GNU malloc can fit in a 4096-byte block. */ + { + /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. + Use the values for range checking, because if range checking is off, + the extra bytes won't be missed terribly, but if range checking is on + and we used a larger request, a whole extra 4096 bytes would be + allocated. + + These number are irrelevant to the new GNU malloc. I suspect it is + less sensitive to the size of the request. */ + int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + + 4 + DEFAULT_ROUNDING - 1) + & ~(DEFAULT_ROUNDING - 1)); + size = 4096 - extra; + } + + h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun; + h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; + h->chunk_size = size; + h->alignment_mask = alignment - 1; + h->use_extra_arg = 0; + + chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); + if (!chunk) + (*obstack_alloc_failed_handler) (); + h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents, + alignment - 1); + h->chunk_limit = chunk->limit + = (char *) chunk + h->chunk_size; + chunk->prev = 0; + /* The initial chunk now contains no empty object. */ + h->maybe_empty_object = 0; + h->alloc_failed = 0; + return 1; +} + +int +_obstack_begin_1 (struct obstack *h, int size, int alignment, + void *(*chunkfun) (void *, long), + void (*freefun) (void *, void *), + void *arg) +{ + register struct _obstack_chunk *chunk; /* points to new chunk */ + + if (alignment == 0) + alignment = DEFAULT_ALIGNMENT; + if (size == 0) + /* Default size is what GNU malloc can fit in a 4096-byte block. */ + { + /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. + Use the values for range checking, because if range checking is off, + the extra bytes won't be missed terribly, but if range checking is on + and we used a larger request, a whole extra 4096 bytes would be + allocated. + + These number are irrelevant to the new GNU malloc. I suspect it is + less sensitive to the size of the request. */ + int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + + 4 + DEFAULT_ROUNDING - 1) + & ~(DEFAULT_ROUNDING - 1)); + size = 4096 - extra; + } + + h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun; + h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; + h->chunk_size = size; + h->alignment_mask = alignment - 1; + h->extra_arg = arg; + h->use_extra_arg = 1; + + chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); + if (!chunk) + (*obstack_alloc_failed_handler) (); + h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents, + alignment - 1); + h->chunk_limit = chunk->limit + = (char *) chunk + h->chunk_size; + chunk->prev = 0; + /* The initial chunk now contains no empty object. */ + h->maybe_empty_object = 0; + h->alloc_failed = 0; + return 1; +} + +/* Allocate a new current chunk for the obstack *H + on the assumption that LENGTH bytes need to be added + to the current object, or a new object of length LENGTH allocated. + Copies any partial object from the end of the old chunk + to the beginning of the new one. */ + +void +_obstack_newchunk (struct obstack *h, int length) +{ + register struct _obstack_chunk *old_chunk = h->chunk; + register struct _obstack_chunk *new_chunk; + register long new_size; + register long obj_size = h->next_free - h->object_base; + register long i; + long already; + char *object_base; + + /* Compute size for new chunk. */ + new_size = (obj_size + length) + (obj_size >> 3) + h->alignment_mask + 100; + if (new_size < h->chunk_size) + new_size = h->chunk_size; + + /* Allocate and initialize the new chunk. */ + new_chunk = CALL_CHUNKFUN (h, new_size); + if (!new_chunk) + (*obstack_alloc_failed_handler) (); + h->chunk = new_chunk; + new_chunk->prev = old_chunk; + new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; + + /* Compute an aligned object_base in the new chunk */ + object_base = + __PTR_ALIGN ((char *) new_chunk, new_chunk->contents, h->alignment_mask); + + /* Move the existing object to the new chunk. + Word at a time is fast and is safe if the object + is sufficiently aligned. */ + if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT) + { + for (i = obj_size / sizeof (COPYING_UNIT) - 1; + i >= 0; i--) + ((COPYING_UNIT *)object_base)[i] + = ((COPYING_UNIT *)h->object_base)[i]; + /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT, + but that can cross a page boundary on a machine + which does not do strict alignment for COPYING_UNITS. */ + already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT); + } + else + already = 0; + /* Copy remaining bytes one by one. */ + for (i = already; i < obj_size; i++) + object_base[i] = h->object_base[i]; + + /* If the object just copied was the only data in OLD_CHUNK, + free that chunk and remove it from the chain. + But not if that chunk might contain an empty object. */ + if (! h->maybe_empty_object + && (h->object_base + == __PTR_ALIGN ((char *) old_chunk, old_chunk->contents, + h->alignment_mask))) + { + new_chunk->prev = old_chunk->prev; + CALL_FREEFUN (h, old_chunk); + } + + h->object_base = object_base; + h->next_free = h->object_base + obj_size; + /* The new chunk certainly contains no empty object yet. */ + h->maybe_empty_object = 0; +} +# ifdef _LIBC +libc_hidden_def (_obstack_newchunk) +# endif + +/* Return nonzero if object OBJ has been allocated from obstack H. + This is here for debugging. + If you use it in a program, you are probably losing. */ + +/* Suppress -Wmissing-prototypes warning. We don't want to declare this in + obstack.h because it is just for debugging. */ +int _obstack_allocated_p (struct obstack *h, void *obj); + +int +_obstack_allocated_p (struct obstack *h, void *obj) +{ + register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ + register struct _obstack_chunk *plp; /* point to previous chunk if any */ + + lp = (h)->chunk; + /* We use >= rather than > since the object cannot be exactly at + the beginning of the chunk but might be an empty object exactly + at the end of an adjacent chunk. */ + while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj)) + { + plp = lp->prev; + lp = plp; + } + return lp != 0; +} + +/* Free objects in obstack H, including OBJ and everything allocate + more recently than OBJ. If OBJ is zero, free everything in H. */ + +# undef obstack_free + +void +__obstack_free (struct obstack *h, void *obj) +{ + register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ + register struct _obstack_chunk *plp; /* point to previous chunk if any */ + + lp = h->chunk; + /* We use >= because there cannot be an object at the beginning of a chunk. + But there can be an empty object at that address + at the end of another chunk. */ + while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj)) + { + plp = lp->prev; + CALL_FREEFUN (h, lp); + lp = plp; + /* If we switch chunks, we can't tell whether the new current + chunk contains an empty object, so assume that it may. */ + h->maybe_empty_object = 1; + } + if (lp) + { + h->object_base = h->next_free = (char *) (obj); + h->chunk_limit = lp->limit; + h->chunk = lp; + } + else if (obj != 0) + /* obj is not in any of the chunks! */ + abort (); +} + +# ifdef _LIBC +/* Older versions of libc used a function _obstack_free intended to be + called by non-GCC compilers. */ +strong_alias (obstack_free, _obstack_free) +# endif + +int +_obstack_memory_used (struct obstack *h) +{ + register struct _obstack_chunk* lp; + register int nbytes = 0; + + for (lp = h->chunk; lp != 0; lp = lp->prev) + { + nbytes += lp->limit - (char *) lp; + } + return nbytes; +} + +/* Define the error handler. */ +# ifdef _LIBC +# include +# else +# include "gettext.h" +# endif +# ifndef _ +# define _(msgid) gettext (msgid) +# endif + +# ifdef _LIBC +# 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 +# endif + +static void +__attribute__ ((noreturn)) +print_and_abort (void) +{ + /* Don't change any of these strings. Yes, it would be possible to add + the newline to the string and use fputs or so. But this must not + happen because the "memory exhausted" message appears in other places + like this and the translation should be reused instead of creating + a very similar string which requires a separate translation. */ +# ifdef _LIBC + (void) __fxprintf (NULL, "%s\n", _("memory exhausted")); +# else + fprintf (stderr, "%s\n", _("memory exhausted")); +# endif + exit (obstack_exit_failure); +} + +#endif /* !ELIDE_CODE */ diff --git a/lib/obstack.h b/lib/obstack.h new file mode 100644 index 0000000..3315dfe --- /dev/null +++ b/lib/obstack.h @@ -0,0 +1,513 @@ +/* obstack.h - object stack macros + Copyright (C) 1988-1994,1996-1999,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) + any 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. */ + +/* Summary: + +All the apparent functions defined here are macros. The idea +is that you would use these pre-tested macros to solve a +very specific set of problems, and they would run fast. +Caution: no side-effects in arguments please!! They may be +evaluated MANY times!! + +These macros operate a stack of objects. Each object starts life +small, and may grow to maturity. (Consider building a word syllable +by syllable.) An object can move while it is growing. Once it has +been "finished" it never changes address again. So the "top of the +stack" is typically an immature growing object, while the rest of the +stack is of mature, fixed size and fixed address objects. + +These routines grab large chunks of memory, using a function you +supply, called `obstack_chunk_alloc'. On occasion, they free chunks, +by calling `obstack_chunk_free'. You must define them and declare +them before using any obstack macros. + +Each independent stack is represented by a `struct obstack'. +Each of the obstack macros expects a pointer to such a structure +as the first argument. + +One motivation for this package is the problem of growing char strings +in symbol tables. Unless you are "fascist pig with a read-only mind" +--Gosper's immortal quote from HAKMEM item 154, out of context--you +would not like to put any arbitrary upper limit on the length of your +symbols. + +In practice this often means you will build many short symbols and a +few long symbols. At the time you are reading a symbol you don't know +how long it is. One traditional method is to read a symbol into a +buffer, realloc()ating the buffer every time you try to read a symbol +that is longer than the buffer. This is beaut, but you still will +want to copy the symbol from the buffer to a more permanent +symbol-table entry say about half the time. + +With obstacks, you can work differently. Use one obstack for all symbol +names. As you read a symbol, grow the name in the obstack gradually. +When the name is complete, finalize it. Then, if the symbol exists already, +free the newly read name. + +The way we do this is to take a large chunk, allocating memory from +low addresses. When you want to build a symbol in the chunk you just +add chars above the current "high water mark" in the chunk. When you +have finished adding chars, because you got to the end of the symbol, +you know how long the chars are, and you can create a new object. +Mostly the chars will not burst over the highest address of the chunk, +because you would typically expect a chunk to be (say) 100 times as +long as an average object. + +In case that isn't clear, when we have enough chars to make up +the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed) +so we just point to it where it lies. No moving of chars is +needed and this is the second win: potentially long strings need +never be explicitly shuffled. Once an object is formed, it does not +change its address during its lifetime. + +When the chars burst over a chunk boundary, we allocate a larger +chunk, and then copy the partly formed object from the end of the old +chunk to the beginning of the new larger chunk. We then carry on +accreting characters to the end of the object as we normally would. + +A special macro is provided to add a single char at a time to a +growing object. This allows the use of register variables, which +break the ordinary 'growth' macro. + +Summary: + We allocate large chunks. + We carve out one object at a time from the current chunk. + Once carved, an object never moves. + We are free to append data of any size to the currently + growing object. + Exactly one object is growing in an obstack at any one time. + You can run one obstack per control block. + You may have as many control blocks as you dare. + Because of the way we do it, you can `unwind' an obstack + back to a previous state. (You may remove objects much + as you would with a stack.) +*/ + + +/* Don't do the contents of this file more than once. */ + +#ifndef _OBSTACK_H +#define _OBSTACK_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* We need the type of a pointer subtraction. If __PTRDIFF_TYPE__ is + defined, as with GNU C, use that; that way we don't pollute the + namespace with 's symbols. Otherwise, include + and use ptrdiff_t. */ + +#ifdef __PTRDIFF_TYPE__ +# define PTR_INT_TYPE __PTRDIFF_TYPE__ +#else +# include +# define PTR_INT_TYPE ptrdiff_t +#endif + +/* If B is the base of an object addressed by P, return the result of + aligning P to the next multiple of A + 1. B and P must be of type + char *. A + 1 must be a power of 2. */ + +#define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A))) + +/* Similiar to _BPTR_ALIGN (B, P, A), except optimize the common case + where pointers can be converted to integers, aligned as integers, + and converted back again. If PTR_INT_TYPE is narrower than a + pointer (e.g., the AS/400), play it safe and compute the alignment + relative to B. Otherwise, use the faster strategy of computing the + alignment relative to 0. */ + +#define __PTR_ALIGN(B, P, A) \ + __BPTR_ALIGN (sizeof (PTR_INT_TYPE) < sizeof (void *) ? (B) : (char *) 0, \ + P, A) + +#include + +struct _obstack_chunk /* Lives at front of each chunk. */ +{ + char *limit; /* 1 past end of this chunk */ + struct _obstack_chunk *prev; /* address of prior chunk or NULL */ + char contents[4]; /* objects begin here */ +}; + +struct obstack /* control current object in current chunk */ +{ + long chunk_size; /* preferred size to allocate chunks in */ + struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */ + char *object_base; /* address of object we are building */ + char *next_free; /* where to add next char to current object */ + char *chunk_limit; /* address of char after current chunk */ + union + { + PTR_INT_TYPE tempint; + void *tempptr; + } temp; /* Temporary for some macros. */ + int alignment_mask; /* Mask of alignment for each object. */ + /* These prototypes vary based on `use_extra_arg', and we use + casts to the prototypeless function type in all assignments, + but having prototypes here quiets -Wstrict-prototypes. */ + struct _obstack_chunk *(*chunkfun) (void *, long); + void (*freefun) (void *, struct _obstack_chunk *); + void *extra_arg; /* first arg for chunk alloc/dealloc funcs */ + unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */ + unsigned maybe_empty_object:1;/* There is a possibility that the current + chunk contains a zero-length object. This + prevents freeing the chunk if we allocate + a bigger chunk to replace it. */ + unsigned alloc_failed:1; /* No longer used, as we now call the failed + handler on error, but retained for binary + compatibility. */ +}; + +/* Declare the external functions we use; they are in obstack.c. */ + +extern void _obstack_newchunk (struct obstack *, int); +extern int _obstack_begin (struct obstack *, int, int, + void *(*) (long), void (*) (void *)); +extern int _obstack_begin_1 (struct obstack *, int, int, + void *(*) (void *, long), + void (*) (void *, void *), void *); +extern int _obstack_memory_used (struct obstack *); + +/* The default name of the function for freeing a chunk is 'obstack_free', + but gnulib users can override this by defining '__obstack_free'. */ +#ifndef __obstack_free +# define __obstack_free obstack_free +#endif +extern void __obstack_free (struct obstack *obstack, void *block); + + +/* Error handler called when `obstack_chunk_alloc' failed to allocate + more memory. This can be set to a user defined function which + should either abort gracefully or use longjump - but shouldn't + return. The default action is to print a message and abort. */ +extern void (*obstack_alloc_failed_handler) (void); + +/* Exit value used when `print_and_abort' is used. */ +extern int obstack_exit_failure; + +/* Pointer to beginning of object being allocated or to be allocated next. + Note that this might not be the final address of the object + because a new chunk might be needed to hold the final size. */ + +#define obstack_base(h) ((void *) (h)->object_base) + +/* Size for allocating ordinary chunks. */ + +#define obstack_chunk_size(h) ((h)->chunk_size) + +/* Pointer to next byte not yet allocated in current chunk. */ + +#define obstack_next_free(h) ((h)->next_free) + +/* Mask specifying low bits that should be clear in address of an object. */ + +#define obstack_alignment_mask(h) ((h)->alignment_mask) + +/* To prevent prototype warnings provide complete argument list. */ +#define obstack_init(h) \ + _obstack_begin ((h), 0, 0, \ + (void *(*) (long)) obstack_chunk_alloc, \ + (void (*) (void *)) obstack_chunk_free) + +#define obstack_begin(h, size) \ + _obstack_begin ((h), (size), 0, \ + (void *(*) (long)) obstack_chunk_alloc, \ + (void (*) (void *)) obstack_chunk_free) + +#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \ + _obstack_begin ((h), (size), (alignment), \ + (void *(*) (long)) (chunkfun), \ + (void (*) (void *)) (freefun)) + +#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \ + _obstack_begin_1 ((h), (size), (alignment), \ + (void *(*) (void *, long)) (chunkfun), \ + (void (*) (void *, void *)) (freefun), (arg)) + +#define obstack_chunkfun(h, newchunkfun) \ + ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun)) + +#define obstack_freefun(h, newfreefun) \ + ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun)) + +#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar)) + +#define obstack_blank_fast(h,n) ((h)->next_free += (n)) + +#define obstack_memory_used(h) _obstack_memory_used (h) + +#if defined __GNUC__ && defined __STDC__ && __STDC__ +/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and + does not implement __extension__. But that compiler doesn't define + __GNUC_MINOR__. */ +# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__) +# define __extension__ +# endif + +/* For GNU C, if not -traditional, + we can define these macros to compute all args only once + without using a global variable. + Also, we can avoid using the `temp' slot, to make faster code. */ + +# define obstack_object_size(OBSTACK) \ + __extension__ \ + ({ struct obstack const *__o = (OBSTACK); \ + (unsigned) (__o->next_free - __o->object_base); }) + +# define obstack_room(OBSTACK) \ + __extension__ \ + ({ struct obstack const *__o = (OBSTACK); \ + (unsigned) (__o->chunk_limit - __o->next_free); }) + +# define obstack_make_room(OBSTACK,length) \ +__extension__ \ +({ struct obstack *__o = (OBSTACK); \ + int __len = (length); \ + if (__o->chunk_limit - __o->next_free < __len) \ + _obstack_newchunk (__o, __len); \ + (void) 0; }) + +# define obstack_empty_p(OBSTACK) \ + __extension__ \ + ({ struct obstack const *__o = (OBSTACK); \ + (__o->chunk->prev == 0 \ + && __o->next_free == __PTR_ALIGN ((char *) __o->chunk, \ + __o->chunk->contents, \ + __o->alignment_mask)); }) + +# define obstack_grow(OBSTACK,where,length) \ +__extension__ \ +({ struct obstack *__o = (OBSTACK); \ + int __len = (length); \ + if (__o->next_free + __len > __o->chunk_limit) \ + _obstack_newchunk (__o, __len); \ + memcpy (__o->next_free, where, __len); \ + __o->next_free += __len; \ + (void) 0; }) + +# define obstack_grow0(OBSTACK,where,length) \ +__extension__ \ +({ struct obstack *__o = (OBSTACK); \ + int __len = (length); \ + if (__o->next_free + __len + 1 > __o->chunk_limit) \ + _obstack_newchunk (__o, __len + 1); \ + memcpy (__o->next_free, where, __len); \ + __o->next_free += __len; \ + *(__o->next_free)++ = 0; \ + (void) 0; }) + +# define obstack_1grow(OBSTACK,datum) \ +__extension__ \ +({ struct obstack *__o = (OBSTACK); \ + if (__o->next_free + 1 > __o->chunk_limit) \ + _obstack_newchunk (__o, 1); \ + obstack_1grow_fast (__o, datum); \ + (void) 0; }) + +/* These assume that the obstack alignment is good enough for pointers + or ints, and that the data added so far to the current object + shares that much alignment. */ + +# define obstack_ptr_grow(OBSTACK,datum) \ +__extension__ \ +({ struct obstack *__o = (OBSTACK); \ + if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ + _obstack_newchunk (__o, sizeof (void *)); \ + obstack_ptr_grow_fast (__o, datum); }) \ + +# define obstack_int_grow(OBSTACK,datum) \ +__extension__ \ +({ struct obstack *__o = (OBSTACK); \ + if (__o->next_free + sizeof (int) > __o->chunk_limit) \ + _obstack_newchunk (__o, sizeof (int)); \ + obstack_int_grow_fast (__o, datum); }) + +# define obstack_ptr_grow_fast(OBSTACK,aptr) \ +__extension__ \ +({ struct obstack *__o1 = (OBSTACK); \ + *(const void **) __o1->next_free = (aptr); \ + __o1->next_free += sizeof (const void *); \ + (void) 0; }) + +# define obstack_int_grow_fast(OBSTACK,aint) \ +__extension__ \ +({ struct obstack *__o1 = (OBSTACK); \ + *(int *) __o1->next_free = (aint); \ + __o1->next_free += sizeof (int); \ + (void) 0; }) + +# define obstack_blank(OBSTACK,length) \ +__extension__ \ +({ struct obstack *__o = (OBSTACK); \ + int __len = (length); \ + if (__o->chunk_limit - __o->next_free < __len) \ + _obstack_newchunk (__o, __len); \ + obstack_blank_fast (__o, __len); \ + (void) 0; }) + +# define obstack_alloc(OBSTACK,length) \ +__extension__ \ +({ struct obstack *__h = (OBSTACK); \ + obstack_blank (__h, (length)); \ + obstack_finish (__h); }) + +# define obstack_copy(OBSTACK,where,length) \ +__extension__ \ +({ struct obstack *__h = (OBSTACK); \ + obstack_grow (__h, (where), (length)); \ + obstack_finish (__h); }) + +# define obstack_copy0(OBSTACK,where,length) \ +__extension__ \ +({ struct obstack *__h = (OBSTACK); \ + obstack_grow0 (__h, (where), (length)); \ + obstack_finish (__h); }) + +/* The local variable is named __o1 to avoid a name conflict + when obstack_blank is called. */ +# define obstack_finish(OBSTACK) \ +__extension__ \ +({ struct obstack *__o1 = (OBSTACK); \ + void *__value = (void *) __o1->object_base; \ + if (__o1->next_free == __value) \ + __o1->maybe_empty_object = 1; \ + __o1->next_free \ + = __PTR_ALIGN (__o1->object_base, __o1->next_free, \ + __o1->alignment_mask); \ + if (__o1->next_free - (char *)__o1->chunk \ + > __o1->chunk_limit - (char *)__o1->chunk) \ + __o1->next_free = __o1->chunk_limit; \ + __o1->object_base = __o1->next_free; \ + __value; }) + +# define obstack_free(OBSTACK, OBJ) \ +__extension__ \ +({ struct obstack *__o = (OBSTACK); \ + void *__obj = (OBJ); \ + if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \ + __o->next_free = __o->object_base = (char *)__obj; \ + else (__obstack_free) (__o, __obj); }) + +#else /* not __GNUC__ or not __STDC__ */ + +# define obstack_object_size(h) \ + (unsigned) ((h)->next_free - (h)->object_base) + +# define obstack_room(h) \ + (unsigned) ((h)->chunk_limit - (h)->next_free) + +# define obstack_empty_p(h) \ + ((h)->chunk->prev == 0 \ + && (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk, \ + (h)->chunk->contents, \ + (h)->alignment_mask)) + +/* Note that the call to _obstack_newchunk is enclosed in (..., 0) + so that we can avoid having void expressions + in the arms of the conditional expression. + Casting the third operand to void was tried before, + but some compilers won't accept it. */ + +# define obstack_make_room(h,length) \ +( (h)->temp.tempint = (length), \ + (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0)) + +# define obstack_grow(h,where,length) \ +( (h)->temp.tempint = (length), \ + (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ + memcpy ((h)->next_free, where, (h)->temp.tempint), \ + (h)->next_free += (h)->temp.tempint) + +# define obstack_grow0(h,where,length) \ +( (h)->temp.tempint = (length), \ + (((h)->next_free + (h)->temp.tempint + 1 > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0), \ + memcpy ((h)->next_free, where, (h)->temp.tempint), \ + (h)->next_free += (h)->temp.tempint, \ + *((h)->next_free)++ = 0) + +# define obstack_1grow(h,datum) \ +( (((h)->next_free + 1 > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), 1), 0) : 0), \ + obstack_1grow_fast (h, datum)) + +# define obstack_ptr_grow(h,datum) \ +( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ + obstack_ptr_grow_fast (h, datum)) + +# define obstack_int_grow(h,datum) \ +( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ + obstack_int_grow_fast (h, datum)) + +# define obstack_ptr_grow_fast(h,aptr) \ + (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) + +# define obstack_int_grow_fast(h,aint) \ + (((int *) ((h)->next_free += sizeof (int)))[-1] = (aint)) + +# define obstack_blank(h,length) \ +( (h)->temp.tempint = (length), \ + (((h)->chunk_limit - (h)->next_free < (h)->temp.tempint) \ + ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ + obstack_blank_fast (h, (h)->temp.tempint)) + +# define obstack_alloc(h,length) \ + (obstack_blank ((h), (length)), obstack_finish ((h))) + +# define obstack_copy(h,where,length) \ + (obstack_grow ((h), (where), (length)), obstack_finish ((h))) + +# define obstack_copy0(h,where,length) \ + (obstack_grow0 ((h), (where), (length)), obstack_finish ((h))) + +# define obstack_finish(h) \ +( ((h)->next_free == (h)->object_base \ + ? (((h)->maybe_empty_object = 1), 0) \ + : 0), \ + (h)->temp.tempptr = (h)->object_base, \ + (h)->next_free \ + = __PTR_ALIGN ((h)->object_base, (h)->next_free, \ + (h)->alignment_mask), \ + (((h)->next_free - (char *) (h)->chunk \ + > (h)->chunk_limit - (char *) (h)->chunk) \ + ? ((h)->next_free = (h)->chunk_limit) : 0), \ + (h)->object_base = (h)->next_free, \ + (h)->temp.tempptr) + +# define obstack_free(h,obj) \ +( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \ + ((((h)->temp.tempint > 0 \ + && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \ + ? (int) ((h)->next_free = (h)->object_base \ + = (h)->temp.tempint + (char *) (h)->chunk) \ + : (((__obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0))) + +#endif /* not __GNUC__ or not __STDC__ */ + +#ifdef __cplusplus +} /* C++ */ +#endif + +#endif /* obstack.h */ diff --git a/lib/offtostr.c b/lib/offtostr.c new file mode 100644 index 0000000..45196e2 --- /dev/null +++ b/lib/offtostr.c @@ -0,0 +1,3 @@ +#define inttostr offtostr +#define inttype off_t +#include "inttostr.c" diff --git a/lib/open-safer.c b/lib/open-safer.c new file mode 100644 index 0000000..04a72eb --- /dev/null +++ b/lib/open-safer.c @@ -0,0 +1,50 @@ +/* Invoke open, but avoid some glitches. + + Copyright (C) 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) + any 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 "fcntl-safer.h" + +#include +#include +#include "unistd-safer.h" + +int +open_safer (char const *file, int flags, ...) +{ + mode_t mode = 0; + + if (flags & O_CREAT) + { + va_list ap; + va_start (ap, 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)); + + va_end (ap); + } + + return fd_safer (open (file, flags, mode)); +} diff --git a/lib/openat-die.c b/lib/openat-die.c new file mode 100644 index 0000000..7a28570 --- /dev/null +++ b/lib/openat-die.c @@ -0,0 +1,51 @@ +/* Report a save- or restore-cwd failure in our openat replacement and then exit. + + Copyright (C) 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) + any 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 + +#include "error.h" +#include "exitfail.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + +void +openat_save_fail (int errno) +{ + error (exit_failure, errno, + _("unable to record current working directory")); + + /* The `noreturn' attribute cannot be applied to error, since it returns + when its first argument is 0. To help compilers understand that this + function does not return, call abort. Also, the abort is a + safety feature if exit_failure is 0 (which shouldn't happen). */ + abort (); +} + +void +openat_restore_fail (int errno) +{ + error (exit_failure, errno, + _("failed to return to initial working directory")); + + /* As above. */ + abort (); +} diff --git a/lib/openat-priv.h b/lib/openat-priv.h new file mode 100644 index 0000000..2d98821 --- /dev/null +++ b/lib/openat-priv.h @@ -0,0 +1,55 @@ +/* Internals for openat-like functions. + + Copyright (C) 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) + any 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 + +#define OPENAT_BUFFER_SIZE 512 +char *openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file); + +/* Some systems don't have ENOSYS. */ +#ifndef ENOSYS +# ifdef ENOTSUP +# define ENOSYS ENOTSUP +# else +/* Some systems don't have ENOTSUP either. */ +# define ENOSYS EINVAL +# endif +#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 + +/* Trying to access a BUILD_PROC_NAME file will fail on systems without + /proc support, and even on systems *with* ProcFS support. Return + nonzero if the failure may be legitimate, e.g., because /proc is not + readable, or the particular .../fd/N directory is not present. */ +#define EXPECTED_ERRNO(Errno) \ + ((Errno) == ENOTDIR || (Errno) == ENOENT \ + || (Errno) == EPERM || (Errno) == EACCES \ + || (Errno) == ENOSYS /* Solaris 8 */ \ + || (Errno) == EOPNOTSUPP /* FreeBSD */) diff --git a/lib/openat-proc.c b/lib/openat-proc.c new file mode 100644 index 0000000..ff2fff0 --- /dev/null +++ b/lib/openat-proc.c @@ -0,0 +1,95 @@ +/* Create /proc/self/fd-related names for subfiles of open directories. + + 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 Paul Eggert. */ + +#include + +#include "openat-priv.h" + +#include +#include +#include + +#include +#include + +#include "dirname.h" +#include "intprops.h" +#include "same-inode.h" +#include "xalloc.h" + +/* The results of open() in this file are not used with fchdir, + therefore save some unnecessary work in fchdir.c. */ +#undef open +#undef close + +#define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/%s" + +#define PROC_SELF_FD_NAME_SIZE_BOUND(len) \ + (sizeof PROC_SELF_FD_FORMAT - sizeof "%d%s" \ + + INT_STRLEN_BOUND (int) + (len) + 1) + + +/* Set BUF to the expansion of PROC_SELF_FD_FORMAT, using FD and FILE + respectively for %d and %s. If successful, return BUF if the + result fits in BUF, dynamically allocated memory otherwise. But + return NULL if /proc is not reliable. */ +char * +openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file) +{ + static int proc_status = 0; + + if (! proc_status) + { + /* Set PROC_STATUS to a positive value if /proc/self/fd is + reliable, and a negative value otherwise. Solaris 10 + /proc/self/fd mishandles "..", and any file name might expand + to ".." after symbolic link expansion, so avoid /proc/self/fd + if it mishandles "..". Solaris 10 has openat, but this + problem is exhibited on code that built on Solaris 8 and + running on Solaris 10. */ + + int proc_self_fd = open ("/proc/self/fd", O_RDONLY); + if (proc_self_fd < 0) + proc_status = -1; + else + { + struct stat proc_self_fd_dotdot_st; + struct stat proc_self_st; + char dotdot_buf[PROC_SELF_FD_NAME_SIZE_BOUND (sizeof ".." - 1)]; + sprintf (dotdot_buf, PROC_SELF_FD_FORMAT, proc_self_fd, ".."); + proc_status = + ((stat (dotdot_buf, &proc_self_fd_dotdot_st) == 0 + && stat ("/proc/self", &proc_self_st) == 0 + && SAME_INODE (proc_self_fd_dotdot_st, proc_self_st)) + ? 1 : -1); + close (proc_self_fd); + } + } + + if (proc_status < 0) + return NULL; + else + { + size_t bufsize = PROC_SELF_FD_NAME_SIZE_BOUND (strlen (file)); + char *result = (bufsize < OPENAT_BUFFER_SIZE ? buf : xmalloc (bufsize)); + sprintf (result, PROC_SELF_FD_FORMAT, fd, file); + return result; + } +} diff --git a/lib/openat.c b/lib/openat.c new file mode 100644 index 0000000..cd49654 --- /dev/null +++ b/lib/openat.c @@ -0,0 +1,270 @@ +/* provide a replacement openat function + Copyright (C) 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) + any 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 "openat.h" + +#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" + +/* Replacement for Solaris' openat function. + + First, try to simulate it via open ("/proc/self/fd/FD/FILE"). + Failing that, simulate it by doing save_cwd/fchdir/open/restore_cwd. + If either the save_cwd or the restore_cwd fails (relatively unlikely), + then give a diagnostic and exit nonzero. + Otherwise, upon failure, set errno and return -1, as openat does. + Upon successful completion, return a file descriptor. */ +int +openat (int fd, char const *file, int flags, ...) +{ + mode_t 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); + } + + return openat_permissive (fd, file, flags, mode, NULL); +} + +/* Like openat (FD, FILE, FLAGS, MODE), but if CWD_ERRNO is + nonnull, set *CWD_ERRNO to an errno value if unable to save + or restore the initial working directory. This is needed only + the first time remove.c's remove_dir opens a command-line + directory argument. + + If a previous attempt to restore the current working directory + failed, then we must not even try to access a `.'-relative name. + It is the caller's responsibility not to call this function + in that case. */ + +int +openat_permissive (int fd, char const *file, int flags, mode_t mode, + int *cwd_errno) +{ + struct saved_cwd saved_cwd; + int saved_errno; + int err; + bool save_ok; + + if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file)) + return open (file, flags, mode); + + { + char buf[OPENAT_BUFFER_SIZE]; + char *proc_file = openat_proc_name (buf, fd, file); + if (proc_file) + { + int open_result = open (proc_file, flags, mode); + int open_errno = errno; + if (proc_file != buf) + free (proc_file); + /* If the syscall succeeds, or if it fails with an unexpected + errno value, then return right away. Otherwise, fall through + and resort to using save_cwd/restore_cwd. */ + if (0 <= open_result || ! EXPECTED_ERRNO (open_errno)) + { + errno = open_errno; + return open_result; + } + } + } + + save_ok = (save_cwd (&saved_cwd) == 0); + if (! save_ok) + { + if (! cwd_errno) + openat_save_fail (errno); + *cwd_errno = errno; + } + + err = fchdir (fd); + saved_errno = errno; + + if (! err) + { + err = open (file, flags, mode); + saved_errno = errno; + if (save_ok && restore_cwd (&saved_cwd) != 0) + { + if (! cwd_errno) + openat_restore_fail (errno); + *cwd_errno = errno; + } + } + + free_cwd (&saved_cwd); + errno = saved_errno; + return err; +} + +/* Return true if our openat implementation must resort to + using save_cwd and restore_cwd. */ +bool +openat_needs_fchdir (void) +{ + bool needs_fchdir = true; + int fd = open ("/", O_RDONLY); + + if (0 <= fd) + { + char buf[OPENAT_BUFFER_SIZE]; + char *proc_file = openat_proc_name (buf, fd, "."); + if (proc_file) + { + needs_fchdir = false; + if (proc_file != buf) + free (proc_file); + } + close (fd); + } + + return needs_fchdir; +} + +#if !HAVE_FDOPENDIR + +/* Replacement for Solaris' function by the same name. + + First, try to simulate it via opendir ("/proc/self/fd/FD"). Failing + that, simulate it by doing save_cwd/fchdir/opendir(".")/restore_cwd. + If either the save_cwd or the restore_cwd fails (relatively unlikely), + then give a diagnostic and exit nonzero. + Otherwise, this function works just like Solaris' fdopendir. + + W A R N I N G: + Unlike the other fd-related functions here, this one + effectively consumes its FD parameter. The caller should not + close or otherwise manipulate FD if this function returns successfully. */ +DIR * +fdopendir (int fd) +{ + struct saved_cwd saved_cwd; + int saved_errno; + DIR *dir; + + char buf[OPENAT_BUFFER_SIZE]; + char *proc_file = openat_proc_name (buf, fd, "."); + if (proc_file) + { + dir = opendir (proc_file); + saved_errno = errno; + } + else + { + dir = NULL; + saved_errno = EOPNOTSUPP; + } + + /* If the syscall fails with an expected errno value, resort to + save_cwd/restore_cwd. */ + if (! dir && EXPECTED_ERRNO (saved_errno)) + { + if (save_cwd (&saved_cwd) != 0) + openat_save_fail (errno); + + if (fchdir (fd) != 0) + { + dir = NULL; + saved_errno = errno; + } + else + { + dir = opendir ("."); + saved_errno = errno; + + if (restore_cwd (&saved_cwd) != 0) + openat_restore_fail (errno); + } + + free_cwd (&saved_cwd); + } + + if (dir) + close (fd); + if (proc_file != buf) + free (proc_file); + errno = saved_errno; + return dir; +} + +#endif + +/* Replacement for Solaris' function by the same name. + + First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE"). + Failing that, simulate it via save_cwd/fchdir/(stat|lstat)/restore_cwd. + If either the save_cwd or the restore_cwd fails (relatively unlikely), + then give a diagnostic and exit nonzero. + Otherwise, this function works just like Solaris' fstatat. */ + +#define AT_FUNC_NAME fstatat +#define AT_FUNC_F1 lstat +#define AT_FUNC_F2 stat +#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW +#define AT_FUNC_POST_FILE_PARAM_DECLS , struct stat *st, int flag +#define AT_FUNC_POST_FILE_ARGS , st +#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 + +/* Replacement for Solaris' function by the same name. + + First, try to simulate it via (unlink|rmdir) ("/proc/self/fd/FD/FILE"). + Failing that, simulate it via save_cwd/fchdir/(unlink|rmdir)/restore_cwd. + If either the save_cwd or the restore_cwd fails (relatively unlikely), + then give a diagnostic and exit nonzero. + Otherwise, this function works just like Solaris' unlinkat. */ + +#define AT_FUNC_NAME unlinkat +#define AT_FUNC_F1 rmdir +#define AT_FUNC_F2 unlink +#define AT_FUNC_USE_F1_COND flag == AT_REMOVEDIR +#define AT_FUNC_POST_FILE_PARAM_DECLS , int flag +#define AT_FUNC_POST_FILE_ARGS /* empty */ +#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/lib/openat.h b/lib/openat.h new file mode 100644 index 0000000..f8333f0 --- /dev/null +++ b/lib/openat.h @@ -0,0 +1,127 @@ +/* provide a replacement openat function + Copyright (C) 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) + any 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 +#include +#include + +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# define __attribute__(x) /* empty */ +# endif +#endif + +#ifndef ATTRIBUTE_NORETURN +# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +#endif + +/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its + value exceeds INT_MAX, so its use as an int doesn't conform to the + C standard, and GCC and Sun C complain in some cases. If the bug + is present, undef AT_FDCWD here, so it can be redefined below. */ +#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553 +# undef AT_FDCWD +#endif + +/* Use the same bit pattern as Solaris 9, but with the proper + signedness. The bit pattern is important, in case this actually is + Solaris with the above workaround. */ +#ifndef AT_FDCWD +# define AT_FDCWD (-3041965) +#endif + +/* Use the same values as Solaris 9. This shouldn't matter, but + there's no real reason to differ. */ +#ifndef AT_SYMLINK_NOFOLLOW +# define AT_SYMLINK_NOFOLLOW 4096 +# define AT_REMOVEDIR 1 +#endif + +#ifdef __OPENAT_PREFIX + +# undef openat +# define __OPENAT_CONCAT(x, y) x ## y +# define __OPENAT_XCONCAT(x, y) __OPENAT_CONCAT (x, y) +# define __OPENAT_ID(y) __OPENAT_XCONCAT (__OPENAT_PREFIX, y) +# define openat __OPENAT_ID (openat) +int openat (int fd, char const *file, int flags, /* mode_t mode */ ...); +int openat_permissive (int fd, char const *file, int flags, mode_t mode, + int *cwd_errno); +# if ! HAVE_FDOPENDIR +# define fdopendir __OPENAT_ID (fdopendir) +# endif +DIR *fdopendir (int fd); +# define fstatat __OPENAT_ID (fstatat) +int fstatat (int fd, char const *file, struct stat *st, int flag); +# define unlinkat __OPENAT_ID (unlinkat) +int unlinkat (int fd, char const *file, int flag); +bool openat_needs_fchdir (void); + +#else + +# define openat_permissive(Fd, File, Flags, Mode, Cwd_errno) \ + openat (Fd, File, Flags, Mode) +# define openat_needs_fchdir() false + +#endif + +#if HAVE_OPENAT && ! LSTAT_FOLLOWS_SLASHED_SYMLINK +int rpl_fstatat (int fd, char const *file, struct stat *st, int flag); +# if !COMPILING_FSTATAT +# undef fstatat +# define fstatat rpl_fstatat +# endif +#endif + +int mkdirat (int fd, char const *file, mode_t mode); +void openat_restore_fail (int) ATTRIBUTE_NORETURN; +void openat_save_fail (int) ATTRIBUTE_NORETURN; +int fchmodat (int fd, char const *file, mode_t mode, int flag); +int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag); + +/* Using these function names makes application code + slightly more readable than it would be with + fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW). */ +static inline int +chownat (int fd, char const *file, uid_t owner, gid_t group) +{ + return fchownat (fd, file, owner, group, 0); +} + +static inline int +lchownat (int fd, char const *file, uid_t owner, gid_t group) +{ + return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW); +} + +static inline int +chmodat (int fd, char const *file, mode_t mode) +{ + return fchmodat (fd, file, mode, 0); +} + +static inline int +lchmodat (int fd, char const *file, mode_t mode) +{ + return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW); +} diff --git a/lib/pathmax.h b/lib/pathmax.h new file mode 100644 index 0000000..6941e45 --- /dev/null +++ b/lib/pathmax.h @@ -0,0 +1,47 @@ +/* Define PATH_MAX somehow. Requires sys/types.h. + Copyright (C) 1992, 1999, 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) + any 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 _PATHMAX_H +# define _PATHMAX_H + +# include + +# include + +# ifndef _POSIX_PATH_MAX +# define _POSIX_PATH_MAX 256 +# endif + +# if !defined PATH_MAX && defined _PC_PATH_MAX +# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \ + : pathconf ("/", _PC_PATH_MAX)) +# endif + +/* Don't include sys/param.h if it already has been. */ +# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN +# include +# endif + +# if !defined PATH_MAX && defined MAXPATHLEN +# define PATH_MAX MAXPATHLEN +# endif + +# ifndef PATH_MAX +# define PATH_MAX _POSIX_PATH_MAX +# endif + +#endif /* _PATHMAX_H */ diff --git a/lib/paxerror.c b/lib/paxerror.c new file mode 100644 index 0000000..000d9e4 --- /dev/null +++ b/lib/paxerror.c @@ -0,0 +1,365 @@ +/* Miscellaneous error functions + + 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 +#include +#include +#include + +/* Decode MODE from its binary form in a stat structure, and encode it + into a 9-byte string STRING, terminated with a NUL. */ + +void +pax_decode_mode (mode_t mode, char *string) +{ + *string++ = mode & S_IRUSR ? 'r' : '-'; + *string++ = mode & S_IWUSR ? 'w' : '-'; + *string++ = (mode & S_ISUID + ? (mode & S_IXUSR ? 's' : 'S') + : (mode & S_IXUSR ? 'x' : '-')); + *string++ = mode & S_IRGRP ? 'r' : '-'; + *string++ = mode & S_IWGRP ? 'w' : '-'; + *string++ = (mode & S_ISGID + ? (mode & S_IXGRP ? 's' : 'S') + : (mode & S_IXGRP ? 'x' : '-')); + *string++ = mode & S_IROTH ? 'r' : '-'; + *string++ = mode & S_IWOTH ? 'w' : '-'; + *string++ = (mode & S_ISVTX + ? (mode & S_IXOTH ? 't' : 'T') + : (mode & S_IXOTH ? 'x' : '-')); + *string = '\0'; +} + +/* Report an error associated with the system call CALL and the + optional name NAME. */ +void +call_arg_error (char const *call, char const *name) +{ + int e = errno; + /* TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. + Directly translating this to another language will not work, first because + %s itself is not translated. + Translate it as `%s: Function %s failed'. */ + ERROR ((0, e, _("%s: Cannot %s"), quotearg_colon (name), call)); +} + +/* Report a fatal error associated with the system call CALL and + the optional file name NAME. */ +void +call_arg_fatal (char const *call, char const *name) +{ + int e = errno; + /* TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. + Directly translating this to another language will not work, first because + %s itself is not translated. + Translate it as `%s: Function %s failed'. */ + FATAL_ERROR ((0, e, _("%s: Cannot %s"), quotearg_colon (name), call)); +} + +/* Report a warning associated with the system call CALL and + the optional file name NAME. */ +void +call_arg_warn (char const *call, char const *name) +{ + int e = errno; + /* TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. + Directly translating this to another language will not work, first because + %s itself is not translated. + Translate it as `%s: Function %s failed'. */ + WARN ((0, e, _("%s: Warning: Cannot %s"), quotearg_colon (name), call)); +} + +void +chmod_error_details (char const *name, mode_t mode) +{ + int e = errno; + char buf[10]; + pax_decode_mode (mode, buf); + ERROR ((0, e, _("%s: Cannot change mode to %s"), + quotearg_colon (name), buf)); +} + +void +chown_error_details (char const *name, uid_t uid, gid_t gid) +{ + int e = errno; + ERROR ((0, e, _("%s: Cannot change ownership to uid %lu, gid %lu"), + quotearg_colon (name), (unsigned long) uid, (unsigned long) gid)); +} + +void +close_error (char const *name) +{ + call_arg_error ("close", name); +} + +void +close_warn (char const *name) +{ + call_arg_warn ("close", name); +} + +void +exec_fatal (char const *name) +{ + call_arg_fatal ("exec", name); +} + +void +link_error (char const *target, char const *source) +{ + int e = errno; + ERROR ((0, e, _("%s: Cannot hard link to %s"), + quotearg_colon (source), quote_n (1, target))); +} + +void +mkdir_error (char const *name) +{ + call_arg_error ("mkdir", name); +} + +void +mkfifo_error (char const *name) +{ + call_arg_error ("mkfifo", name); +} + +void +mknod_error (char const *name) +{ + call_arg_error ("mknod", name); +} + +void +open_error (char const *name) +{ + call_arg_error ("open", name); +} + +void +open_fatal (char const *name) +{ + call_arg_fatal ("open", name); +} + +void +open_warn (char const *name) +{ + call_arg_warn ("open", name); +} + +void +read_error (char const *name) +{ + call_arg_error ("read", name); +} + +void +read_error_details (char const *name, off_t offset, size_t size) +{ + char buf[UINTMAX_STRSIZE_BOUND]; + int e = errno; + ERROR ((0, e, + ngettext ("%s: Read error at byte %s, while reading %lu byte", + "%s: Read error at byte %s, while reading %lu bytes", + size), + quotearg_colon (name), STRINGIFY_BIGINT (offset, buf), + (unsigned long) size)); +} + +void +read_warn_details (char const *name, off_t offset, size_t size) +{ + char buf[UINTMAX_STRSIZE_BOUND]; + int e = errno; + WARN ((0, e, + ngettext ("%s: Warning: Read error at byte %s, while reading %lu byte", + "%s: Warning: Read error at byte %s, while reading %lu bytes", + size), + quotearg_colon (name), STRINGIFY_BIGINT (offset, buf), + (unsigned long) size)); +} + +void +read_fatal (char const *name) +{ + call_arg_fatal ("read", name); +} + +void +read_fatal_details (char const *name, off_t offset, size_t size) +{ + char buf[UINTMAX_STRSIZE_BOUND]; + int e = errno; + FATAL_ERROR ((0, e, + ngettext ("%s: Read error at byte %s, while reading %lu byte", + "%s: Read error at byte %s, while reading %lu bytes", + size), + quotearg_colon (name), STRINGIFY_BIGINT (offset, buf), + (unsigned long) size)); +} + +void +readlink_error (char const *name) +{ + call_arg_error ("readlink", name); +} + +void +readlink_warn (char const *name) +{ + call_arg_warn ("readlink", name); +} + +void +rmdir_error (char const *name) +{ + call_arg_error ("rmdir", name); +} + +void +savedir_error (char const *name) +{ + call_arg_error ("savedir", name); +} + +void +savedir_warn (char const *name) +{ + call_arg_warn ("savedir", name); +} + +void +seek_error (char const *name) +{ + call_arg_error ("seek", name); +} + +void +seek_error_details (char const *name, off_t offset) +{ + char buf[UINTMAX_STRSIZE_BOUND]; + int e = errno; + ERROR ((0, e, _("%s: Cannot seek to %s"), + quotearg_colon (name), + STRINGIFY_BIGINT (offset, buf))); +} + +void +seek_warn (char const *name) +{ + call_arg_warn ("seek", name); +} + +void +seek_warn_details (char const *name, off_t offset) +{ + char buf[UINTMAX_STRSIZE_BOUND]; + int e = errno; + WARN ((0, e, _("%s: Warning: Cannot seek to %s"), + quotearg_colon (name), + STRINGIFY_BIGINT (offset, buf))); +} + +void +symlink_error (char const *contents, char const *name) +{ + int e = errno; + ERROR ((0, e, _("%s: Cannot create symlink to %s"), + quotearg_colon (name), quote_n (1, contents))); +} + +void +stat_fatal (char const *name) +{ + call_arg_fatal ("stat", name); +} + +void +stat_error (char const *name) +{ + call_arg_error ("stat", name); +} + +void +stat_warn (char const *name) +{ + call_arg_warn ("stat", name); +} + +void +truncate_error (char const *name) +{ + call_arg_error ("truncate", name); +} + +void +truncate_warn (char const *name) +{ + call_arg_warn ("truncate", name); +} + +void +unlink_error (char const *name) +{ + call_arg_error ("unlink", name); +} + +void +utime_error (char const *name) +{ + call_arg_error ("utime", name); +} + +void +waitpid_error (char const *name) +{ + call_arg_error ("waitpid", name); +} + +void +write_error (char const *name) +{ + call_arg_error ("write", name); +} + +void +write_error_details (char const *name, size_t status, size_t size) +{ + if (status == 0) + write_error (name); + else + ERROR ((0, 0, + ngettext ("%s: Wrote only %lu of %lu byte", + "%s: Wrote only %lu of %lu bytes", + size), + name, (unsigned long int) status, (unsigned long int) size)); +} + +void +write_fatal (char const *name) +{ + call_arg_fatal ("write", name); +} + +void +chdir_fatal (char const *name) +{ + call_arg_fatal ("chdir", name); +} diff --git a/lib/paxexit.c b/lib/paxexit.c new file mode 100644 index 0000000..a511f79 --- /dev/null +++ b/lib/paxexit.c @@ -0,0 +1,28 @@ +/* Miscellaneous error functions + + Copyright (C) 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) any 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 + +int exit_status = PAXEXIT_SUCCESS; + +void +pax_exit () +{ + exit (exit_status); +} diff --git a/lib/paxlib.h b/lib/paxlib.h new file mode 100644 index 0000000..381c4c7 --- /dev/null +++ b/lib/paxlib.h @@ -0,0 +1,115 @@ +/* This file is part of GNU paxutils + + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 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) + any 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 _paxlib_h_ +#define _paxlib_h_ + +#include +#include + +/* Error reporting functions and definitions */ + +/* Exit status for paxutils app. Let's try to keep this list as simple as + possible. tar -d option strongly invites a status different for unequal + comparison and other errors. */ +#define PAXEXIT_SUCCESS 0 +#define PAXEXIT_DIFFERS 1 +#define PAXEXIT_FAILURE 2 + +/* Both WARN and ERROR write a message on stderr and continue processing, + however ERROR manages so tar will exit unsuccessfully. FATAL_ERROR + writes a message on stderr and aborts immediately, with another message + line telling so. USAGE_ERROR works like FATAL_ERROR except that the + other message line suggests trying --help. All four macros accept a + single argument of the form ((0, errno, _("FORMAT"), Args...)). errno + is zero when the error is not being detected by the system. */ + +#define WARN(Args) \ + error Args +#define ERROR(Args) \ + (error Args, exit_status = PAXEXIT_FAILURE) +#define FATAL_ERROR(Args) \ + (error Args, fatal_exit ()) +#define USAGE_ERROR(Args) \ + (error Args, usage (PAXEXIT_FAILURE)) + +extern int exit_status; + +void pax_decode_mode (mode_t mode, char *string); +void call_arg_error (char const *call, char const *name); +void call_arg_fatal (char const *call, char const *name) __attribute__ ((noreturn)); +void call_arg_warn (char const *call, char const *name); +void chmod_error_details (char const *name, mode_t mode); +void chown_error_details (char const *name, uid_t uid, gid_t gid); + +void decode_mode (mode_t, char *); + +void chdir_fatal (char const *) __attribute__ ((noreturn)); +void chmod_error_details (char const *, mode_t); +void chown_error_details (char const *, uid_t, gid_t); +void close_error (char const *); +void close_warn (char const *); +void exec_fatal (char const *) __attribute__ ((noreturn)); +void link_error (char const *, char const *); +void mkdir_error (char const *); +void mkfifo_error (char const *); +void mknod_error (char const *); +void open_error (char const *); +void open_fatal (char const *) __attribute__ ((noreturn)); +void open_warn (char const *); +void read_error (char const *); +void read_error_details (char const *, off_t, size_t); +void read_fatal (char const *) __attribute__ ((noreturn)); +void read_fatal_details (char const *, off_t, size_t) __attribute__ ((noreturn)); +void read_warn_details (char const *, off_t, size_t); +void readlink_error (char const *); +void readlink_warn (char const *); +void rmdir_error (char const *); +void savedir_error (char const *); +void savedir_warn (char const *); +void seek_error (char const *); +void seek_error_details (char const *, off_t); +void seek_warn (char const *); +void seek_warn_details (char const *, off_t); +void stat_fatal (char const *); +void stat_error (char const *); +void stat_warn (char const *); +void symlink_error (char const *, char const *); +void truncate_error (char const *); +void truncate_warn (char const *); +void unlink_error (char const *); +void utime_error (char const *); +void waitpid_error (char const *); +void write_error (char const *); + +void pax_exit (void); +void fatal_exit (void) __attribute__ ((noreturn)); + +#define STRINGIFY_BIGINT(i, b) umaxtostr (i, b) + + +/* Name-related functions */ +bool hash_string_insert (Hash_table **table, char const *string); +bool hash_string_lookup (Hash_table const *table, char const *string); + +bool removed_prefixes_p (void); +char *safer_name_suffix (char const *file_name, bool link_target, bool absolute_names); + +#endif diff --git a/lib/paxnames.c b/lib/paxnames.c new file mode 100644 index 0000000..3ca8bfa --- /dev/null +++ b/lib/paxnames.c @@ -0,0 +1,156 @@ +/* This file is part of GNU paxutils + 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 +#include +#include + + +/* Hash tables of strings. */ + +/* Calculate the hash of a string. */ +static size_t +hash_string_hasher (void const *name, size_t n_buckets) +{ + return hash_string (name, n_buckets); +} + +/* Compare two strings for equality. */ +static bool +hash_string_compare (void const *name1, void const *name2) +{ + return strcmp (name1, name2) == 0; +} + +/* Return zero if TABLE contains a copy of STRING; otherwise, insert a + copy of STRING to TABLE and return 1. */ +bool +hash_string_insert (Hash_table **table, char const *string) +{ + Hash_table *t = *table; + char *s = xstrdup (string); + char *e; + + if (! ((t + || (*table = t = hash_initialize (0, 0, hash_string_hasher, + hash_string_compare, 0))) + && (e = hash_insert (t, s)))) + xalloc_die (); + + if (e == s) + return 1; + else + { + free (s); + return 0; + } +} + +/* Return 1 if TABLE contains STRING. */ +bool +hash_string_lookup (Hash_table const *table, char const *string) +{ + return table && hash_lookup (table, string); +} + + +static Hash_table *prefix_table[2]; + +/* Return true if file names of some members in the archive were stripped off + their leading components. We could have used + return prefix_table[0] || prefix_table[1] + but the following seems to be safer: */ +bool +removed_prefixes_p (void) +{ + return (prefix_table[0] && hash_get_n_entries (prefix_table[0]) != 0) + || (prefix_table[1] && hash_get_n_entries (prefix_table[1]) != 0); +} + +/* Return a safer suffix of FILE_NAME, or "." if it has no safer + suffix. Check for fully specified file names and other atrocities. + Warn the user if we do not return NAME. If LINK_TARGET is 1, + FILE_NAME is the target of a hard link, not a member name. + If ABSOLUTE_NAMES is 0, strip filesystem prefix from the file name. */ + +char * +safer_name_suffix (char const *file_name, bool link_target, bool absolute_names) +{ + char const *p; + + if (absolute_names) + p = file_name; + else + { + /* Skip file system prefixes, leading file name components that contain + "..", and leading slashes. */ + + size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (file_name); + + for (p = file_name + prefix_len; *p; ) + { + if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2])) + prefix_len = p + 2 - file_name; + + do + { + char c = *p++; + if (ISSLASH (c)) + break; + } + while (*p); + } + + for (p = file_name + prefix_len; ISSLASH (*p); p++) + continue; + prefix_len = p - file_name; + + if (prefix_len) + { + char *prefix = alloca (prefix_len + 1); + memcpy (prefix, file_name, prefix_len); + prefix[prefix_len] = '\0'; + + if (hash_string_insert (&prefix_table[link_target], prefix)) + { + static char const *const diagnostic[] = + { + N_("Removing leading `%s' from member names"), + N_("Removing leading `%s' from hard link targets") + }; + WARN ((0, 0, _(diagnostic[link_target]), prefix)); + } + } + } + + if (! *p) + { + if (p == file_name) + { + static char const *const diagnostic[] = + { + N_("Substituting `.' for empty member name"), + N_("Substituting `.' for empty hard link target") + }; + WARN ((0, 0, "%s", _(diagnostic[link_target]))); + } + + p = "."; + } + + return (char *) p; +} diff --git a/lib/pipe-safer.c b/lib/pipe-safer.c new file mode 100644 index 0000000..e4431b3 --- /dev/null +++ b/lib/pipe-safer.c @@ -0,0 +1,57 @@ +/* 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 + it under the 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 "unistd-safer.h" + +#include +#include + +/* Like pipe, but ensure that neither of the file descriptors is + STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. Fail with ENOSYS on + platforms that lack pipe. */ + +int +pipe_safer (int fd[2]) +{ +#if HAVE_PIPE + if (pipe (fd) == 0) + { + int i; + for (i = 0; i < 2; i++) + { + fd[i] = fd_safer (fd[i]); + if (fd[i] < 0) + { + int e = errno; + close (fd[1 - i]); + errno = e; + return -1; + } + } + + return 0; + } +#else + errno = ENOSYS; +#endif + + return -1; +} diff --git a/lib/printf-args.c b/lib/printf-args.c new file mode 100644 index 0000000..f039b2d --- /dev/null +++ b/lib/printf-args.c @@ -0,0 +1,139 @@ +/* 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) + any 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 "printf-args.h" + +#ifdef STATIC +STATIC +#endif +int +printf_fetchargs (va_list args, arguments *a) +{ + size_t i; + argument *ap; + + for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) + switch (ap->type) + { + case TYPE_SCHAR: + ap->a.a_schar = va_arg (args, /*signed char*/ int); + break; + case TYPE_UCHAR: + ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); + break; + case TYPE_SHORT: + ap->a.a_short = va_arg (args, /*short*/ int); + break; + case TYPE_USHORT: + ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); + break; + case TYPE_INT: + ap->a.a_int = va_arg (args, int); + break; + case TYPE_UINT: + ap->a.a_uint = va_arg (args, unsigned int); + break; + case TYPE_LONGINT: + ap->a.a_longint = va_arg (args, long int); + break; + case TYPE_ULONGINT: + ap->a.a_ulongint = va_arg (args, unsigned long int); + break; +#if HAVE_LONG_LONG_INT + case TYPE_LONGLONGINT: + ap->a.a_longlongint = va_arg (args, long long int); + break; + case TYPE_ULONGLONGINT: + ap->a.a_ulonglongint = va_arg (args, unsigned long long int); + break; +#endif + case TYPE_DOUBLE: + ap->a.a_double = va_arg (args, double); + break; + case TYPE_LONGDOUBLE: + ap->a.a_longdouble = va_arg (args, long double); + break; + case TYPE_CHAR: + ap->a.a_char = va_arg (args, int); + break; +#if HAVE_WINT_T + case TYPE_WIDE_CHAR: + /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by + default argument promotions", this is not the case in mingw32, + where wint_t is 'unsigned short'. */ + ap->a.a_wide_char = + (sizeof (wint_t) < sizeof (int) + ? va_arg (args, int) + : va_arg (args, wint_t)); + break; +#endif + case TYPE_STRING: + ap->a.a_string = va_arg (args, const char *); + /* A null pointer is an invalid argument for "%s", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_string == NULL) + ap->a.a_string = "(NULL)"; + break; +#if HAVE_WCHAR_T + case TYPE_WIDE_STRING: + ap->a.a_wide_string = va_arg (args, const wchar_t *); + /* A null pointer is an invalid argument for "%ls", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_wide_string == NULL) + { + static const wchar_t wide_null_string[] = + { + (wchar_t)'(', + (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L', + (wchar_t)')', + (wchar_t)0 + }; + ap->a.a_wide_string = wide_null_string; + } + break; +#endif + case TYPE_POINTER: + ap->a.a_pointer = va_arg (args, void *); + break; + case TYPE_COUNT_SCHAR_POINTER: + ap->a.a_count_schar_pointer = va_arg (args, signed char *); + break; + case TYPE_COUNT_SHORT_POINTER: + ap->a.a_count_short_pointer = va_arg (args, short *); + break; + case TYPE_COUNT_INT_POINTER: + ap->a.a_count_int_pointer = va_arg (args, int *); + break; + case TYPE_COUNT_LONGINT_POINTER: + ap->a.a_count_longint_pointer = va_arg (args, long int *); + break; +#if HAVE_LONG_LONG_INT + case TYPE_COUNT_LONGLONGINT_POINTER: + ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); + break; +#endif + default: + /* Unknown type. */ + return -1; + } + return 0; +} diff --git a/lib/printf-args.h b/lib/printf-args.h new file mode 100644 index 0000000..bcf4470 --- /dev/null +++ b/lib/printf-args.h @@ -0,0 +1,132 @@ +/* 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) + any 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 _PRINTF_ARGS_H +#define _PRINTF_ARGS_H + +/* Get size_t. */ +#include + +/* Get wchar_t. */ +#if HAVE_WCHAR_T +# include +#endif + +/* Get wint_t. */ +#if HAVE_WINT_T +# include +#endif + +/* Get va_list. */ +#include + + +/* Argument types */ +typedef enum +{ + TYPE_NONE, + TYPE_SCHAR, + TYPE_UCHAR, + TYPE_SHORT, + TYPE_USHORT, + TYPE_INT, + TYPE_UINT, + TYPE_LONGINT, + TYPE_ULONGINT, +#if HAVE_LONG_LONG_INT + TYPE_LONGLONGINT, + TYPE_ULONGLONGINT, +#endif + TYPE_DOUBLE, + TYPE_LONGDOUBLE, + TYPE_CHAR, +#if HAVE_WINT_T + TYPE_WIDE_CHAR, +#endif + TYPE_STRING, +#if HAVE_WCHAR_T + TYPE_WIDE_STRING, +#endif + TYPE_POINTER, + TYPE_COUNT_SCHAR_POINTER, + TYPE_COUNT_SHORT_POINTER, + TYPE_COUNT_INT_POINTER, + TYPE_COUNT_LONGINT_POINTER +#if HAVE_LONG_LONG_INT +, TYPE_COUNT_LONGLONGINT_POINTER +#endif +} arg_type; + +/* Polymorphic argument */ +typedef struct +{ + arg_type type; + union + { + signed char a_schar; + unsigned char a_uchar; + short a_short; + unsigned short a_ushort; + int a_int; + unsigned int a_uint; + long int a_longint; + unsigned long int a_ulongint; +#if HAVE_LONG_LONG_INT + long long int a_longlongint; + unsigned long long int a_ulonglongint; +#endif + float a_float; + double a_double; + long double a_longdouble; + int a_char; +#if HAVE_WINT_T + wint_t a_wide_char; +#endif + const char* a_string; +#if HAVE_WCHAR_T + const wchar_t* a_wide_string; +#endif + void* a_pointer; + signed char * a_count_schar_pointer; + short * a_count_short_pointer; + int * a_count_int_pointer; + long int * a_count_longint_pointer; +#if HAVE_LONG_LONG_INT + long long int * a_count_longlongint_pointer; +#endif + } + a; +} +argument; + +typedef struct +{ + size_t count; + argument *arg; +} +arguments; + + +/* Fetch the arguments, putting them into a. */ +#ifdef STATIC +STATIC +#else +extern +#endif +int printf_fetchargs (va_list args, arguments *a); + +#endif /* _PRINTF_ARGS_H */ diff --git a/lib/printf-parse.c b/lib/printf-parse.c new file mode 100644 index 0000000..7de0b9f --- /dev/null +++ b/lib/printf-parse.c @@ -0,0 +1,543 @@ +/* Formatted output to strings. + Copyright (C) 1999-2000, 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) + any 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. */ +#if WIDE_CHAR_VERSION +# include "wprintf-parse.h" +#else +# include "printf-parse.h" +#endif + +/* Get size_t, NULL. */ +#include + +/* Get intmax_t. */ +#ifdef IN_LIBINTL +# if HAVE_STDINT_H_WITH_UINTMAX +# include +# endif +# if HAVE_INTTYPES_H_WITH_UINTMAX +# include +# endif +#else +# include +#endif + +/* malloc(), realloc(), free(). */ +#include + +/* Checked size_t computations. */ +#include "xsize.h" + +#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 +#endif + +#ifdef STATIC +STATIC +#endif +int +PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) +{ + const CHAR_T *cp = format; /* pointer into format */ + size_t arg_posn = 0; /* number of regular arguments consumed */ + size_t d_allocated; /* allocated elements of d->dir */ + size_t a_allocated; /* allocated elements of a->arg */ + size_t max_width_length = 0; + size_t max_precision_length = 0; + + d->count = 0; + d_allocated = 1; + d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE)); + if (d->dir == NULL) + /* Out of memory. */ + return -1; + + a->count = 0; + a_allocated = 0; + a->arg = NULL; + +#define REGISTER_ARG(_index_,_type_) \ + { \ + size_t n = (_index_); \ + if (n >= a_allocated) \ + { \ + size_t memory_size; \ + argument *memory; \ + \ + a_allocated = xtimes (a_allocated, 2); \ + if (a_allocated <= n) \ + 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 = (argument *) (a->arg \ + ? realloc (a->arg, memory_size) \ + : malloc (memory_size)); \ + if (memory == NULL) \ + /* Out of memory. */ \ + goto error; \ + a->arg = memory; \ + } \ + while (a->count <= n) \ + a->arg[a->count++].type = TYPE_NONE; \ + if (a->arg[n].type == TYPE_NONE) \ + a->arg[n].type = (_type_); \ + else if (a->arg[n].type != (_type_)) \ + /* Ambiguous type for positional argument. */ \ + goto error; \ + } + + while (*cp != '\0') + { + CHAR_T c = *cp++; + if (c == '%') + { + size_t arg_index = ARG_NONE; + DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */ + + /* Initialize the next directive. */ + dp->dir_start = cp - 1; + dp->flags = 0; + dp->width_start = NULL; + dp->width_end = NULL; + dp->width_arg_index = ARG_NONE; + dp->precision_start = NULL; + dp->precision_end = NULL; + dp->precision_arg_index = ARG_NONE; + dp->arg_index = ARG_NONE; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + 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; + } + } + + /* Read the flags. */ + for (;;) + { + if (*cp == '\'') + { + dp->flags |= FLAG_GROUP; + cp++; + } + else if (*cp == '-') + { + dp->flags |= FLAG_LEFT; + cp++; + } + else if (*cp == '+') + { + dp->flags |= FLAG_SHOWSIGN; + cp++; + } + else if (*cp == ' ') + { + dp->flags |= FLAG_SPACE; + cp++; + } + else if (*cp == '#') + { + dp->flags |= FLAG_ALT; + cp++; + } + else if (*cp == '0') + { + dp->flags |= FLAG_ZERO; + cp++; + } + else + break; + } + + /* Parse the field width. */ + if (*cp == '*') + { + dp->width_start = cp; + cp++; + dp->width_end = cp; + if (max_width_length < 1) + max_width_length = 1; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + 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; + } + } + if (dp->width_arg_index == ARG_NONE) + { + dp->width_arg_index = arg_posn++; + if (dp->width_arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->width_arg_index, TYPE_INT); + } + else if (*cp >= '0' && *cp <= '9') + { + size_t width_length; + + dp->width_start = cp; + for (; *cp >= '0' && *cp <= '9'; cp++) + ; + dp->width_end = cp; + width_length = dp->width_end - dp->width_start; + if (max_width_length < width_length) + max_width_length = width_length; + } + + /* Parse the precision. */ + if (*cp == '.') + { + cp++; + if (*cp == '*') + { + dp->precision_start = cp - 1; + cp++; + dp->precision_end = cp; + if (max_precision_length < 2) + max_precision_length = 2; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + 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; + } + } + if (dp->precision_arg_index == ARG_NONE) + { + dp->precision_arg_index = arg_posn++; + if (dp->precision_arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->precision_arg_index, TYPE_INT); + } + else + { + size_t precision_length; + + dp->precision_start = cp - 1; + for (; *cp >= '0' && *cp <= '9'; cp++) + ; + dp->precision_end = cp; + precision_length = dp->precision_end - dp->precision_start; + if (max_precision_length < precision_length) + max_precision_length = precision_length; + } + } + + { + arg_type type; + + /* Parse argument type/size specifiers. */ + { + int flags = 0; + + for (;;) + { + if (*cp == 'h') + { + flags |= (1 << (flags & 1)); + cp++; + } + else if (*cp == 'L') + { + flags |= 4; + cp++; + } + else if (*cp == 'l') + { + flags += 8; + cp++; + } + else if (*cp == 'j') + { + if (sizeof (intmax_t) > sizeof (long)) + { + /* intmax_t = long long */ + flags += 16; + } + else if (sizeof (intmax_t) > sizeof (int)) + { + /* intmax_t = long */ + flags += 8; + } + cp++; + } + else if (*cp == 'z' || *cp == 'Z') + { + /* 'z' is standardized in ISO C 99, but glibc uses 'Z' + because the warning facility in gcc-2.95.2 understands + only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ + if (sizeof (size_t) > sizeof (long)) + { + /* size_t = long long */ + flags += 16; + } + else if (sizeof (size_t) > sizeof (int)) + { + /* size_t = long */ + flags += 8; + } + cp++; + } + else if (*cp == 't') + { + if (sizeof (ptrdiff_t) > sizeof (long)) + { + /* ptrdiff_t = long long */ + flags += 16; + } + else if (sizeof (ptrdiff_t) > sizeof (int)) + { + /* ptrdiff_t = long */ + flags += 8; + } + cp++; + } + else + break; + } + + /* Read the conversion character. */ + c = *cp++; + switch (c) + { + case 'd': case 'i': +#if HAVE_LONG_LONG_INT + /* If 'long long' exists and is larger than 'long': */ + if (flags >= 16 || (flags & 4)) + type = TYPE_LONGLONGINT; + else +#endif + /* If 'long long' exists and is the same as 'long', we parse + "lld" into TYPE_LONGINT. */ + if (flags >= 8) + type = TYPE_LONGINT; + else if (flags & 2) + type = TYPE_SCHAR; + else if (flags & 1) + type = TYPE_SHORT; + else + type = TYPE_INT; + break; + case 'o': case 'u': case 'x': case 'X': +#if HAVE_LONG_LONG_INT + /* If 'long long' exists and is larger than 'long': */ + if (flags >= 16 || (flags & 4)) + type = TYPE_ULONGLONGINT; + else +#endif + /* If 'unsigned long long' exists and is the same as + 'unsigned long', we parse "llu" into TYPE_ULONGINT. */ + if (flags >= 8) + type = TYPE_ULONGINT; + else if (flags & 2) + type = TYPE_UCHAR; + else if (flags & 1) + type = TYPE_USHORT; + else + type = TYPE_UINT; + break; + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': + case 'a': case 'A': + if (flags >= 16 || (flags & 4)) + type = TYPE_LONGDOUBLE; + else + type = TYPE_DOUBLE; + break; + case 'c': + if (flags >= 8) +#if HAVE_WINT_T + type = TYPE_WIDE_CHAR; +#else + goto error; +#endif + else + type = TYPE_CHAR; + break; +#if HAVE_WINT_T + case 'C': + type = TYPE_WIDE_CHAR; + c = 'c'; + break; +#endif + case 's': + if (flags >= 8) +#if HAVE_WCHAR_T + type = TYPE_WIDE_STRING; +#else + goto error; +#endif + else + type = TYPE_STRING; + break; +#if HAVE_WCHAR_T + case 'S': + type = TYPE_WIDE_STRING; + c = 's'; + break; +#endif + case 'p': + type = TYPE_POINTER; + break; + case 'n': +#if HAVE_LONG_LONG_INT + /* If 'long long' exists and is larger than 'long': */ + if (flags >= 16 || (flags & 4)) + type = TYPE_COUNT_LONGLONGINT_POINTER; + else +#endif + /* If 'long long' exists and is the same as 'long', we parse + "lln" into TYPE_COUNT_LONGINT_POINTER. */ + if (flags >= 8) + type = TYPE_COUNT_LONGINT_POINTER; + else if (flags & 2) + type = TYPE_COUNT_SCHAR_POINTER; + else if (flags & 1) + type = TYPE_COUNT_SHORT_POINTER; + else + type = TYPE_COUNT_INT_POINTER; + break; + case '%': + type = TYPE_NONE; + break; + default: + /* Unknown conversion character. */ + goto error; + } + } + + if (type != TYPE_NONE) + { + dp->arg_index = arg_index; + if (dp->arg_index == ARG_NONE) + { + dp->arg_index = arg_posn++; + if (dp->arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->arg_index, type); + } + dp->conversion = c; + dp->dir_end = cp; + } + + d->count++; + if (d->count >= d_allocated) + { + size_t memory_size; + DIRECTIVE *memory; + + 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; + memory = (DIRECTIVE *) realloc (d->dir, memory_size); + if (memory == NULL) + /* Out of memory. */ + goto error; + d->dir = memory; + } + } + } + d->dir[d->count].dir_start = cp; + + d->max_width_length = max_width_length; + d->max_precision_length = max_precision_length; + return 0; + +error: + if (a->arg) + free (a->arg); + if (d->dir) + free (d->dir); + return -1; +} + +#undef DIRECTIVES +#undef DIRECTIVE +#undef CHAR_T +#undef PRINTF_PARSE diff --git a/lib/printf-parse.h b/lib/printf-parse.h new file mode 100644 index 0000000..82a0d37 --- /dev/null +++ b/lib/printf-parse.h @@ -0,0 +1,74 @@ +/* Parse printf format string. + Copyright (C) 1999, 2002-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 _PRINTF_PARSE_H +#define _PRINTF_PARSE_H + +#include "printf-args.h" + + +/* Flags */ +#define FLAG_GROUP 1 /* ' flag */ +#define FLAG_LEFT 2 /* - flag */ +#define FLAG_SHOWSIGN 4 /* + flag */ +#define FLAG_SPACE 8 /* space flag */ +#define FLAG_ALT 16 /* # flag */ +#define FLAG_ZERO 32 + +/* arg_index value indicating that no argument is consumed. */ +#define ARG_NONE (~(size_t)0) + +/* A parsed directive. */ +typedef struct +{ + const char* dir_start; + const char* dir_end; + int flags; + const char* width_start; + const char* width_end; + size_t width_arg_index; + 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 */ + size_t arg_index; +} +char_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + char_directive *dir; + size_t max_width_length; + size_t max_precision_length; +} +char_directives; + + +/* 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 +#else +extern +#endif +int printf_parse (const char *format, char_directives *d, arguments *a); + +#endif /* _PRINTF_PARSE_H */ diff --git a/lib/quote.c b/lib/quote.c new file mode 100644 index 0000000..119be72 --- /dev/null +++ b/lib/quote.c @@ -0,0 +1,41 @@ +/* quote.c - quote arguments for output + + 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 + it under the 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 "quotearg.h" +#include "quote.h" + +/* Return an unambiguous printable representation of NAME, + allocated in slot N, suitable for diagnostics. */ +char const * +quote_n (int n, char const *name) +{ + return quotearg_n_style (n, locale_quoting_style, name); +} + +/* Return an unambiguous printable representation of NAME, + suitable for diagnostics. */ +char const * +quote (char const *name) +{ + return quote_n (0, name); +} diff --git a/lib/quote.h b/lib/quote.h new file mode 100644 index 0000000..5400ead --- /dev/null +++ b/lib/quote.h @@ -0,0 +1,22 @@ +/* quote.h - prototypes for quote.c + + Copyright (C) 1998, 1999, 2000, 2001, 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. */ + + +char const *quote_n (int n, char const *name); +char const *quote (char const *name); diff --git a/lib/quotearg.c b/lib/quotearg.c new file mode 100644 index 0000000..f7f326a --- /dev/null +++ b/lib/quotearg.c @@ -0,0 +1,697 @@ +/* quotearg.c - quote arguments for output + + Copyright (C) 1998, 1999, 2000, 2001, 2002, 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) + any 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 "quotearg.h" + +#include "xalloc.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gettext.h" +#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 + +#define INT_BITS (sizeof (int) * CHAR_BIT) + +struct quoting_options +{ + /* Basic quoting style. */ + enum quoting_style style; + + /* 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]; +}; + +/* Names of quoting styles. */ +char const *const quoting_style_args[] = +{ + "literal", + "shell", + "shell-always", + "c", + "escape", + "locale", + "clocale", + 0 +}; + +/* Correspondences to quoting style names. */ +enum quoting_style const quoting_style_vals[] = +{ + literal_quoting_style, + shell_quoting_style, + shell_always_quoting_style, + c_quoting_style, + escape_quoting_style, + locale_quoting_style, + clocale_quoting_style +}; + +/* The default quoting options. */ +static struct quoting_options default_quoting_options; + +/* Allocate a new set of quoting options, with contents initially identical + to O if O is not null, or to the default if O is null. + It is the caller's responsibility to free the result. */ +struct quoting_options * +clone_quoting_options (struct quoting_options *o) +{ + int e = errno; + struct quoting_options *p = xmemdup (o ? o : &default_quoting_options, + sizeof *o); + errno = e; + return p; +} + +/* Get the value of O's quoting style. If O is null, use the default. */ +enum quoting_style +get_quoting_style (struct quoting_options *o) +{ + return (o ? o : &default_quoting_options)->style; +} + +/* In O (or in the default if O is null), + set the value of the quoting style to S. */ +void +set_quoting_style (struct quoting_options *o, enum quoting_style s) +{ + (o ? o : &default_quoting_options)->style = s; +} + +/* In O (or in the default if O is null), + set the value of the quoting options for character C to I. + Return the old value. Currently, the only values defined for I are + 0 (the default) and 1 (which means to quote the character even if + it would not otherwise be quoted). */ +int +set_char_quoting (struct quoting_options *o, char c, int i) +{ + unsigned char uc = c; + unsigned int *p = + (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS; + int shift = uc % INT_BITS; + int r = (*p >> shift) & 1; + *p ^= ((i & 1) ^ r) << shift; + return r; +} + +/* MSGID approximates a quotation mark. Return its translation if it + has one; otherwise, return either it or "\"", depending on S. */ +static char const * +gettext_quote (char const *msgid, enum quoting_style s) +{ + char const *translation = _(msgid); + if (translation == msgid && s == clocale_quoting_style) + translation = "\""; + return translation; +} + +/* 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. + 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 + value that would have been returned had BUFFERSIZE been large enough. + 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. */ + +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) +{ + size_t i; + size_t len = 0; + char const *quote_string = 0; + size_t quote_string_len = 0; + bool backslash_escapes = false; + bool unibyte_locale = MB_CUR_MAX == 1; + +#define STORE(c) \ + do \ + { \ + if (len < buffersize) \ + buffer[len] = (c); \ + len++; \ + } \ + while (0) + + switch (quoting_style) + { + case c_quoting_style: + STORE ('"'); + backslash_escapes = true; + quote_string = "\""; + quote_string_len = 1; + break; + + case escape_quoting_style: + backslash_escapes = true; + break; + + case locale_quoting_style: + case clocale_quoting_style: + { + /* TRANSLATORS: + Get translations for open and closing quotation marks. + + The message catalog should translate "`" to a left + quotation mark suitable for the locale, and similarly for + "'". If the catalog has no translation, + locale_quoting_style quotes `like this', and + clocale_quoting_style quotes "like this". + + For example, an American English Unicode locale should + translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and + should translate "'" to U+201D (RIGHT DOUBLE QUOTATION + MARK). A British English Unicode locale should instead + translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and + U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. + + If you don't know what to put here, please see + + and use glyphs suitable for your language. */ + + 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); + backslash_escapes = true; + quote_string = right; + quote_string_len = strlen (quote_string); + } + break; + + case shell_always_quoting_style: + STORE ('\''); + quote_string = "'"; + quote_string_len = 1; + break; + + default: + break; + } + + for (i = 0; ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize); i++) + { + unsigned char c; + unsigned char esc; + + if (backslash_escapes + && quote_string_len + && i + quote_string_len <= argsize + && memcmp (arg + i, quote_string, quote_string_len) == 0) + STORE ('\\'); + + c = arg[i]; + switch (c) + { + case '\0': + if (backslash_escapes) + { + STORE ('\\'); + STORE ('0'); + STORE ('0'); + c = '0'; + } + break; + + case '?': + switch (quoting_style) + { + case shell_quoting_style: + goto use_shell_always_quoting_style; + + case c_quoting_style: + if (i + 2 < argsize && arg[i + 1] == '?') + switch (arg[i + 2]) + { + case '!': case '\'': + case '(': case ')': case '-': case '/': + case '<': case '=': case '>': + /* Escape the second '?' in what would otherwise be + a trigraph. */ + c = arg[i + 2]; + i += 2; + STORE ('?'); + STORE ('\\'); + STORE ('?'); + break; + + default: + break; + } + break; + + default: + break; + } + break; + + case '\a': esc = 'a'; goto c_escape; + case '\b': esc = 'b'; goto c_escape; + case '\f': esc = 'f'; goto c_escape; + case '\n': esc = 'n'; goto c_and_shell_escape; + 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; + + c_and_shell_escape: + if (quoting_style == shell_quoting_style) + goto use_shell_always_quoting_style; + c_escape: + if (backslash_escapes) + { + c = esc; + goto store_escape; + } + break; + + case '{': case '}': /* sometimes special if isolated */ + if (! (argsize == SIZE_MAX ? arg[1] == '\0' : argsize == 1)) + break; + /* Fall through. */ + case '#': case '~': + if (i != 0) + break; + /* Fall through. */ + case ' ': + case '!': /* special in bash */ + case '"': case '$': case '&': + case '(': case ')': case '*': case ';': + case '<': + case '=': /* sometimes special in 0th or (with "set -k") later args */ + case '>': case '[': + case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */ + case '`': case '|': + /* A shell special character. In theory, '$' and '`' could + 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; + break; + + case '\'': + switch (quoting_style) + { + case shell_quoting_style: + goto use_shell_always_quoting_style; + + case shell_always_quoting_style: + STORE ('\''); + STORE ('\\'); + STORE ('\''); + break; + + default: + break; + } + break; + + case '%': case '+': case ',': case '-': case '.': case '/': + case '0': case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': case ':': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': + case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': case ']': case '_': case 'a': case 'b': + case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': + case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': + case 'o': case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': + /* These characters don't cause problems, no matter what the + quoting style is. They cannot start multibyte sequences. */ + break; + + default: + /* If we have a multibyte sequence, copy it until we reach + its end, find an error, or come back to the initial shift + state. For C-like styles, if the sequence has + unprintable characters, escape the whole sequence, since + we can't easily escape single characters within it. */ + { + /* Length of multibyte sequence found so far. */ + size_t m; + + bool printable; + + if (unibyte_locale) + { + m = 1; + printable = isprint (c) != 0; + } + else + { + mbstate_t mbstate; + memset (&mbstate, 0, sizeof mbstate); + + m = 0; + printable = true; + if (argsize == SIZE_MAX) + argsize = strlen (arg); + + do + { + wchar_t w; + size_t bytes = mbrtowc (&w, &arg[i + m], + argsize - (i + m), &mbstate); + if (bytes == 0) + break; + else if (bytes == (size_t) -1) + { + printable = false; + break; + } + else if (bytes == (size_t) -2) + { + printable = false; + while (i + m < argsize && arg[i + m]) + m++; + break; + } + else + { + /* Work around a bug with older shells that "see" a '\' + 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) + { + size_t j; + for (j = 1; j < bytes; j++) + switch (arg[i + m + j]) + { + case '[': case '\\': case '^': + case '`': case '|': + goto use_shell_always_quoting_style; + + default: + break; + } + } + + if (! iswprint (w)) + printable = false; + m += bytes; + } + } + while (! mbsinit (&mbstate)); + } + + if (1 < m || (backslash_escapes && ! printable)) + { + /* Output a multibyte sequence, or an escaped + unprintable unibyte character. */ + size_t ilim = i + m; + + for (;;) + { + if (backslash_escapes && ! printable) + { + STORE ('\\'); + STORE ('0' + (c >> 6)); + STORE ('0' + ((c >> 3) & 7)); + c = '0' + (c & 7); + } + if (ilim <= i + 1) + break; + STORE (c); + c = arg[++i]; + } + + goto store_c; + } + } + } + + if (! (backslash_escapes + && o->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))) + goto store_c; + + store_escape: + STORE ('\\'); + + store_c: + STORE (c); + } + + if (i == 0 && quoting_style == shell_quoting_style) + goto use_shell_always_quoting_style; + + if (quote_string) + for (; *quote_string; quote_string++) + STORE (*quote_string); + + if (len < buffersize) + buffer[len] = '\0'; + return len; + + use_shell_always_quoting_style: + return quotearg_buffer_restyled (buffer, buffersize, arg, argsize, + shell_always_quoting_style, o); +} + +/* 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. + 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 + value that would have been returned had BUFFERSIZE been large enough. + If ARGSIZE is SIZE_MAX, use the string length of the argument for + ARGSIZE. */ +size_t +quotearg_buffer (char *buffer, size_t buffersize, + char const *arg, size_t argsize, + struct quoting_options const *o) +{ + 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); + errno = e; + return r; +} + +/* Like quotearg_buffer (..., ARG, ARGSIZE, O), except return newly + allocated storage containing the quoted string. */ +char * +quotearg_alloc (char const *arg, size_t argsize, + struct quoting_options const *o) +{ + int e = errno; + size_t bufsize = quotearg_buffer (0, 0, arg, argsize, o) + 1; + char *buf = xcharalloc (bufsize); + quotearg_buffer (buf, bufsize, arg, argsize, o); + errno = e; + return buf; +} + +/* A storage slot with size and pointer to a value. */ +struct slotvec +{ + size_t size; + char *val; +}; + +/* Preallocate a slot 0 buffer, so that the caller can always quote + one small component of a "memory exhausted" message in slot 0. */ +static char slot0[256]; +static unsigned int nslots = 1; +static struct slotvec slotvec0 = {sizeof slot0, slot0}; +static struct slotvec *slotvec = &slotvec0; + +void +quotearg_free (void) +{ + struct slotvec *sv = slotvec; + unsigned int i; + for (i = 1; i < nslots; i++) + free (sv[i].val); + if (sv[0].val != slot0) + { + free (sv[0].val); + slotvec0.size = sizeof slot0; + slotvec0.val = slot0; + } + if (sv != &slotvec0) + { + free (sv); + slotvec = &slotvec0; + } + nslots = 1; +} + +/* Use storage slot N to return a quoted version of argument ARG. + ARG is of size ARGSIZE, but if that is SIZE_MAX, ARG is a + null-terminated string. + OPTIONS specifies the 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 is deliberately declared with type "int" + to allow for future extensions (using negative values). */ +static char * +quotearg_n_options (int n, char const *arg, size_t argsize, + struct quoting_options const *options) +{ + int e = errno; + + unsigned int n0 = n; + struct slotvec *sv = slotvec; + + if (n < 0) + abort (); + + if (nslots <= n0) + { + /* FIXME: technically, the type of n1 should be `unsigned int', + but that evokes an unsuppressible warning from gcc-4.0.1 and + older. If gcc ever provides an option to suppress that warning, + revert to the original type, so that the test in xalloc_oversized + is once again performed only at compile time. */ + size_t n1 = n0 + 1; + bool preallocated = (sv == &slotvec0); + + if (xalloc_oversized (n1, sizeof *sv)) + xalloc_die (); + + slotvec = sv = xrealloc (preallocated ? NULL : sv, n1 * sizeof *sv); + if (preallocated) + *sv = slotvec0; + memset (sv + nslots, 0, (n1 - nslots) * sizeof *sv); + nslots = n1; + } + + { + size_t size = sv[n].size; + char *val = sv[n].val; + size_t qsize = quotearg_buffer (val, size, arg, argsize, options); + + if (size <= qsize) + { + sv[n].size = size = qsize + 1; + if (val != slot0) + free (val); + sv[n].val = val = xcharalloc (size); + quotearg_buffer (val, size, arg, argsize, options); + } + + errno = e; + return val; + } +} + +char * +quotearg_n (int n, char const *arg) +{ + return quotearg_n_options (n, arg, SIZE_MAX, &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) +{ + struct quoting_options o; + o.style = style; + memset (o.quote_these_too, 0, sizeof o.quote_these_too); + return o; +} + +char * +quotearg_n_style (int n, enum quoting_style s, char const *arg) +{ + struct quoting_options const o = quoting_options_from_style (s); + return quotearg_n_options (n, arg, SIZE_MAX, &o); +} + +char * +quotearg_n_style_mem (int n, enum quoting_style s, + char const *arg, size_t argsize) +{ + struct quoting_options const o = quoting_options_from_style (s); + return quotearg_n_options (n, arg, argsize, &o); +} + +char * +quotearg_style (enum quoting_style s, char const *arg) +{ + return quotearg_n_style (0, s, arg); +} + +char * +quotearg_char (char const *arg, 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); +} + +char * +quotearg_colon (char const *arg) +{ + return quotearg_char (arg, ':'); +} diff --git a/lib/quotearg.h b/lib/quotearg.h new file mode 100644 index 0000000..4887df3 --- /dev/null +++ b/lib/quotearg.h @@ -0,0 +1,140 @@ +/* quotearg.h - quote arguments for output + + Copyright (C) 1998, 1999, 2000, 2001, 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 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 */ + +#ifndef QUOTEARG_H_ +# define QUOTEARG_H_ 1 + +# include + +/* Basic quoting styles. */ +enum quoting_style + { + /* Output names as-is (ls --quoting-style=literal). */ + literal_quoting_style, + + /* Quote names for the shell if they contain shell metacharacters + or would cause ambiguous output (ls --quoting-style=shell). */ + shell_quoting_style, + + /* Quote names for the shell, even if they would normally not + require quoting (ls --quoting-style=shell-always). */ + shell_always_quoting_style, + + /* Quote names as for a C language string (ls --quoting-style=c). */ + c_quoting_style, + + /* Like c_quoting_style except omit the surrounding double-quote + characters (ls --quoting-style=escape). */ + escape_quoting_style, + + /* Like clocale_quoting_style, but quote `like this' instead of + "like this" in the default C locale (ls --quoting-style=locale). */ + locale_quoting_style, + + /* Like c_quoting_style except use quotation marks appropriate for + the locale (ls --quoting-style=clocale). */ + clocale_quoting_style + }; + +/* For now, --quoting-style=literal is the default, but this may change. */ +# ifndef DEFAULT_QUOTING_STYLE +# define DEFAULT_QUOTING_STYLE literal_quoting_style +# endif + +/* Names of quoting styles and their corresponding values. */ +extern char const *const quoting_style_args[]; +extern enum quoting_style const quoting_style_vals[]; + +struct quoting_options; + +/* The functions listed below set and use a hidden variable + that contains the default quoting style options. */ + +/* Allocate a new set of quoting options, with contents initially identical + to O if O is not null, or to the default if O is null. + It is the caller's responsibility to free the result. */ +struct quoting_options *clone_quoting_options (struct quoting_options *o); + +/* Get the value of O's quoting style. If O is null, use the default. */ +enum quoting_style get_quoting_style (struct quoting_options *o); + +/* In O (or in the default if O is null), + set the value of the quoting style to S. */ +void set_quoting_style (struct quoting_options *o, enum quoting_style s); + +/* In O (or in the default if O is null), + set the value of the quoting options for character C to I. + Return the old value. Currently, the only values defined for I are + 0 (the default) and 1 (which means to quote the character even if + it would not otherwise be quoted). */ +int set_char_quoting (struct quoting_options *o, char c, 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. + 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 + value that would have been returned had BUFFERSIZE been large enough. + If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */ +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. */ +char *quotearg_alloc (char const *arg, size_t argsize, + 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. */ +char *quotearg_n (int n, char const *arg); + +/* Equivalent to quotearg_n (0, ARG). */ +char *quotearg (char const *arg); + +/* 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. */ +char *quotearg_n_style (int n, enum quoting_style s, char const *arg); + +/* Use style S and storage slot N to return a quoted version of the + argument ARG of size ARGSIZE. This is like quotearg_n_style + (N, S, ARG), except it can quote null bytes. */ +char *quotearg_n_style_mem (int n, enum quoting_style s, + char const *arg, size_t argsize); + +/* Equivalent to quotearg_n_style (0, S, ARG). */ +char *quotearg_style (enum quoting_style s, char const *arg); + +/* Like quotearg (ARG), except also quote any instances of CH. */ +char *quotearg_char (char const *arg, char ch); + +/* Equivalent to quotearg_char (ARG, ':'). */ +char *quotearg_colon (char const *arg); + +/* Free any dynamically allocated memory. */ +void quotearg_free (void); + +#endif /* !QUOTEARG_H_ */ diff --git a/lib/readlink.c b/lib/readlink.c new file mode 100644 index 0000000..3cbdc1c --- /dev/null +++ b/lib/readlink.c @@ -0,0 +1,50 @@ +/* Stub for readlink(). + 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. */ + +#include + +/* Specification. */ +#include + +#include +#include +#include +#include + +#if !HAVE_READLINK + +/* readlink() substitute for systems that don't have a readlink() function, + such as DJGPP 2.03 and mingw32. */ + +/* The official POSIX return type of readlink() is ssize_t, but since here + we have no declaration in a public header file, we use 'int' as return + type. */ + +int +readlink (const char *path, char *buf, size_t bufsize) +{ + struct stat statbuf; + + /* In general we should use lstat() here, not stat(). But on platforms + without symbolic links lstat() - if it exists - would be equivalent to + stat(), therefore we can use stat(). This saves us a configure check. */ + if (stat (path, &statbuf) >= 0) + errno = EINVAL; + return -1; +} + +#endif diff --git a/lib/rmt-command.h b/lib/rmt-command.h new file mode 100644 index 0000000..7460e6f --- /dev/null +++ b/lib/rmt-command.h @@ -0,0 +1,4 @@ +#define LOCALEDIR "/usr/local/share/locale" +#ifndef DEFAULT_RMT_COMMAND +# define DEFAULT_RMT_COMMAND "/usr/local/libexec/rmt" +#endif diff --git a/lib/rmt.h b/lib/rmt.h new file mode 100644 index 0000000..9f96cdb --- /dev/null +++ b/lib/rmt.h @@ -0,0 +1,99 @@ +/* Definitions for communicating with a remote tape drive. + + Copyright (C) 1988, 1992, 1996, 1997, 2001, 2003, 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. */ + +extern char *rmt_command; +extern char *rmt_dev_name__; + +int rmt_open__ (const char *, int, int, const char *); +int rmt_close__ (int); +size_t rmt_read__ (int, char *, size_t); +size_t rmt_write__ (int, char *, size_t); +off_t rmt_lseek__ (int, off_t, int); +int rmt_ioctl__ (int, int, char *); + +extern bool force_local_option; + +/* A filename is remote if it contains a colon not preceded by a slash, + to take care of `/:/' which is a shorthand for `/...//fs' + on machines running OSF's Distributing Computing Environment (DCE) and + Distributed File System (DFS). However, when --force-local, a + filename is never remote. */ + +#define _remdev(dev_name) \ + (!force_local_option && (rmt_dev_name__ = strchr (dev_name, ':')) \ + && rmt_dev_name__ > (dev_name) \ + && ! memchr (dev_name, '/', rmt_dev_name__ - (dev_name))) + +#define _isrmt(fd) \ + ((fd) >= __REM_BIAS) + +#define __REM_BIAS (1 << 30) + +#ifndef O_CREAT +# define O_CREAT 01000 +#endif + +#define rmtopen(dev_name, oflag, mode, command) \ + (_remdev (dev_name) ? rmt_open__ (dev_name, oflag, __REM_BIAS, command) \ + : open (dev_name, oflag, mode)) + +#define rmtaccess(dev_name, amode) \ + (_remdev (dev_name) ? 0 : access (dev_name, amode)) + +#define rmtstat(dev_name, buffer) \ + (_remdev (dev_name) ? (errno = EOPNOTSUPP), -1 : stat (dev_name, buffer)) + +#define rmtcreat(dev_name, mode, command) \ + (_remdev (dev_name) \ + ? rmt_open__ (dev_name, 1 | O_CREAT, __REM_BIAS, command) \ + : creat (dev_name, mode)) + +#define rmtlstat(dev_name, muffer) \ + (_remdev (dev_name) ? (errno = EOPNOTSUPP), -1 : lstat (dev_name, buffer)) + +#define rmtread(fd, buffer, length) \ + (_isrmt (fd) ? rmt_read__ (fd - __REM_BIAS, buffer, length) \ + : safe_read (fd, buffer, length)) + +#define rmtwrite(fd, buffer, length) \ + (_isrmt (fd) ? rmt_write__ (fd - __REM_BIAS, buffer, length) \ + : full_write (fd, buffer, length)) + +#define rmtlseek(fd, offset, where) \ + (_isrmt (fd) ? rmt_lseek__ (fd - __REM_BIAS, offset, where) \ + : lseek (fd, offset, where)) + +#define rmtclose(fd) \ + (_isrmt (fd) ? rmt_close__ (fd - __REM_BIAS) : close (fd)) + +#define rmtioctl(fd, request, argument) \ + (_isrmt (fd) ? rmt_ioctl__ (fd - __REM_BIAS, request, argument) \ + : ioctl (fd, request, argument)) + +#define rmtdup(fd) \ + (_isrmt (fd) ? (errno = EOPNOTSUPP), -1 : dup (fd)) + +#define rmtfstat(fd, buffer) \ + (_isrmt (fd) ? (errno = EOPNOTSUPP), -1 : fstat (fd, buffer)) + +#define rmtfcntl(cd, command, argument) \ + (_isrmt (fd) ? (errno = EOPNOTSUPP), -1 : fcntl (fd, command, argument)) + +#define rmtisatty(fd) \ + (_isrmt (fd) ? 0 : isatty (fd)) diff --git a/lib/rtapelib.c b/lib/rtapelib.c new file mode 100644 index 0000000..af19b04 --- /dev/null +++ b/lib/rtapelib.c @@ -0,0 +1,740 @@ +/* Functions for communicating with a remote tape drive. + + Copyright (C) 1988, 1992, 1994, 1996, 1997, 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) + any 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. */ + +/* The man page rmt(8) for /etc/rmt documents the remote mag tape protocol + which rdump and rrestore use. Unfortunately, the man page is *WRONG*. + The author of the routines I'm including originally wrote his code just + based on the man page, and it didn't work, so he went to the rdump source + to figure out why. The only thing he had to change was to check for the + 'F' return code in addition to the 'E', and to separate the various + arguments with \n instead of a space. I personally don't think that this + is much of a problem, but I wanted to point it out. -- Arnold Robbins + + Originally written by Jeff Lee, modified some by Arnold Robbins. Redone + as a library that can replace open, read, write, etc., by Fred Fish, with + some additional work by Arnold Robbins. Modified to make all rmt* calls + into macros for speed by Jay Fenlason. Use -DWITH_REXEC for rexec + code, courtesy of Dan Kegel. */ + +#include "system.h" +#include "system-ioctl.h" + +#include +#include + +/* Try hard to get EOPNOTSUPP defined. 486/ISC has it in net/errno.h, + 3B2/SVR3 has it in sys/inet.h. Otherwise, like on MSDOS, use EINVAL. */ + +#ifndef EOPNOTSUPP +# if HAVE_NET_ERRNO_H +# include +# endif +# if HAVE_SYS_INET_H +# include +# endif +# ifndef EOPNOTSUPP +# define EOPNOTSUPP EINVAL +# endif +#endif + +#include + +#if HAVE_NETDB_H +# include +#endif + +#include +#include + +/* Exit status if exec errors. */ +#define EXIT_ON_EXEC_ERROR 128 + +/* FIXME: Size of buffers for reading and writing commands to rmt. */ +#define COMMAND_BUFFER_SIZE 64 + +#ifndef RETSIGTYPE +# define RETSIGTYPE void +#endif + +/* FIXME: Maximum number of simultaneous remote tape connections. */ +#define MAXUNIT 4 + +#define PREAD 0 /* read file descriptor from pipe() */ +#define PWRITE 1 /* write file descriptor from pipe() */ + +/* Return the parent's read side of remote tape connection Fd. */ +#define READ_SIDE(Fd) (from_remote[Fd][PREAD]) + +/* Return the parent's write side of remote tape connection Fd. */ +#define WRITE_SIDE(Fd) (to_remote[Fd][PWRITE]) + +/* The pipes for receiving data from remote tape drives. */ +static int from_remote[MAXUNIT][2] = {{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}}; + +/* The pipes for sending data to remote tape drives. */ +static int to_remote[MAXUNIT][2] = {{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}}; + +char *rmt_command = DEFAULT_RMT_COMMAND; + +/* Temporary variable used by macros in rmt.h. */ +char *rmt_dev_name__; + +/* If true, always consider file names to be local, even if they contain + colons */ +bool force_local_option; + + + +/* Close remote tape connection HANDLE, and reset errno to ERRNO_VALUE. */ +static void +_rmt_shutdown (int handle, int errno_value) +{ + close (READ_SIDE (handle)); + close (WRITE_SIDE (handle)); + READ_SIDE (handle) = -1; + WRITE_SIDE (handle) = -1; + errno = errno_value; +} + +/* Attempt to perform the remote tape command specified in BUFFER on + remote tape connection HANDLE. Return 0 if successful, -1 on + error. */ +static int +do_command (int handle, const char *buffer) +{ + /* Save the current pipe handler and try to make the request. */ + + size_t length = strlen (buffer); + RETSIGTYPE (*pipe_handler) () = signal (SIGPIPE, SIG_IGN); + ssize_t written = full_write (WRITE_SIDE (handle), buffer, length); + signal (SIGPIPE, pipe_handler); + + if (written == length) + return 0; + + /* Something went wrong. Close down and go home. */ + + _rmt_shutdown (handle, EIO); + return -1; +} + +static char * +get_status_string (int handle, char *command_buffer) +{ + char *cursor; + int counter; + + /* Read the reply command line. */ + + for (counter = 0, cursor = command_buffer; + counter < COMMAND_BUFFER_SIZE; + counter++, cursor++) + { + if (safe_read (READ_SIDE (handle), cursor, 1) != 1) + { + _rmt_shutdown (handle, EIO); + return 0; + } + if (*cursor == '\n') + { + *cursor = '\0'; + break; + } + } + + if (counter == COMMAND_BUFFER_SIZE) + { + _rmt_shutdown (handle, EIO); + return 0; + } + + /* Check the return status. */ + + for (cursor = command_buffer; *cursor; cursor++) + if (*cursor != ' ') + break; + + if (*cursor == 'E' || *cursor == 'F') + { + /* Skip the error message line. */ + + /* FIXME: there is better to do than merely ignoring error messages + coming from the remote end. Translate them, too... */ + + { + char character; + + while (safe_read (READ_SIDE (handle), &character, 1) == 1) + if (character == '\n') + break; + } + + errno = atoi (cursor + 1); + + if (*cursor == 'F') + _rmt_shutdown (handle, errno); + + return 0; + } + + /* Check for mis-synced pipes. */ + + if (*cursor != 'A') + { + _rmt_shutdown (handle, EIO); + return 0; + } + + /* Got an `A' (success) response. */ + + return cursor + 1; +} + +/* Read and return the status from remote tape connection HANDLE. If + an error occurred, return -1 and set errno. */ +static long int +get_status (int handle) +{ + char command_buffer[COMMAND_BUFFER_SIZE]; + const char *status = get_status_string (handle, command_buffer); + if (status) + { + long int result = atol (status); + if (0 <= result) + return result; + errno = EIO; + } + return -1; +} + +static off_t +get_status_off (int handle) +{ + char command_buffer[COMMAND_BUFFER_SIZE]; + const char *status = get_status_string (handle, command_buffer); + + if (! status) + return -1; + else + { + /* Parse status, taking care to check for overflow. + We can't use standard functions, + since off_t might be longer than long. */ + + off_t count = 0; + int negative; + + for (; *status == ' ' || *status == '\t'; status++) + continue; + + negative = *status == '-'; + status += negative || *status == '+'; + + for (;;) + { + int digit = *status++ - '0'; + if (9 < (unsigned) digit) + break; + else + { + off_t c10 = 10 * count; + off_t nc = negative ? c10 - digit : c10 + digit; + if (c10 / 10 != count || (negative ? c10 < nc : nc < c10)) + return -1; + count = nc; + } + } + + return count; + } +} + +#if WITH_REXEC + +/* Execute /etc/rmt as user USER on remote system HOST using rexec. + Return a file descriptor of a bidirectional socket for stdin and + stdout. If USER is zero, use the current username. + + By default, this code is not used, since it requires that the user + have a .netrc file in his/her home directory, or that the + application designer be willing to have rexec prompt for login and + password info. This may be unacceptable, and .rhosts files for use + with rsh are much more common on BSD systems. */ +static int +_rmt_rexec (char *host, char *user) +{ + int saved_stdin = dup (STDIN_FILENO); + int saved_stdout = dup (STDOUT_FILENO); + struct servent *rexecserv; + int result; + + /* When using cpio -o < filename, stdin is no longer the tty. But the + rexec subroutine reads the login and the passwd on stdin, to allow + remote execution of the command. So, reopen stdin and stdout on + /dev/tty before the rexec and give them back their original value + after. */ + + if (! freopen ("/dev/tty", "r", stdin)) + freopen ("/dev/null", "r", stdin); + if (! freopen ("/dev/tty", "w", stdout)) + freopen ("/dev/null", "w", stdout); + + if (rexecserv = getservbyname ("exec", "tcp"), !rexecserv) + error (EXIT_ON_EXEC_ERROR, 0, _("exec/tcp: Service not available")); + + result = rexec (&host, rexecserv->s_port, user, 0, rmt_command, 0); + if (fclose (stdin) == EOF) + error (0, errno, _("stdin")); + fdopen (saved_stdin, "r"); + if (fclose (stdout) == EOF) + error (0, errno, _("stdout")); + fdopen (saved_stdout, "w"); + + return result; +} + +#endif /* WITH_REXEC */ + +/* Place into BUF a string representing OFLAG, which must be suitable + as argument 2 of `open'. BUF must be large enough to hold the + result. This function should generate a string that decode_oflag + can parse. */ +static void +encode_oflag (char *buf, int oflag) +{ + sprintf (buf, "%d ", oflag); + + switch (oflag & O_ACCMODE) + { + case O_RDONLY: strcat (buf, "O_RDONLY"); break; + case O_RDWR: strcat (buf, "O_RDWR"); break; + case O_WRONLY: strcat (buf, "O_WRONLY"); break; + default: abort (); + } + +#ifdef O_APPEND + if (oflag & O_APPEND) strcat (buf, "|O_APPEND"); +#endif + if (oflag & O_CREAT) strcat (buf, "|O_CREAT"); +#ifdef O_DSYNC + if (oflag & O_DSYNC) strcat (buf, "|O_DSYNC"); +#endif + if (oflag & O_EXCL) strcat (buf, "|O_EXCL"); +#ifdef O_LARGEFILE + if (oflag & O_LARGEFILE) strcat (buf, "|O_LARGEFILE"); +#endif +#ifdef O_NOCTTY + if (oflag & O_NOCTTY) strcat (buf, "|O_NOCTTY"); +#endif + if (oflag & O_NONBLOCK) strcat (buf, "|O_NONBLOCK"); +#ifdef O_RSYNC + if (oflag & O_RSYNC) strcat (buf, "|O_RSYNC"); +#endif +#ifdef O_SYNC + if (oflag & O_SYNC) strcat (buf, "|O_SYNC"); +#endif + if (oflag & O_TRUNC) strcat (buf, "|O_TRUNC"); +} + +/* Open a file (a magnetic tape device?) on the system specified in + FILE_NAME, as the given user. FILE_NAME has the form `[USER@]HOST:FILE'. + OPEN_MODE is O_RDONLY, O_WRONLY, etc. If successful, return the + remote pipe number plus BIAS. REMOTE_SHELL may be overridden. On + error, return -1. */ +int +rmt_open__ (const char *file_name, int open_mode, int bias, + const char *remote_shell) +{ + int remote_pipe_number; /* pseudo, biased file descriptor */ + char *file_name_copy; /* copy of file_name string */ + char *remote_host; /* remote host name */ + char *remote_file; /* remote file name (often a device) */ + char *remote_user; /* remote user name */ + + /* Find an unused pair of file descriptors. */ + + for (remote_pipe_number = 0; + remote_pipe_number < MAXUNIT; + remote_pipe_number++) + if (READ_SIDE (remote_pipe_number) == -1 + && WRITE_SIDE (remote_pipe_number) == -1) + break; + + if (remote_pipe_number == MAXUNIT) + { + errno = EMFILE; + return -1; + } + + /* Pull apart the system and device, and optional user. */ + + { + char *cursor; + + file_name_copy = xstrdup (file_name); + remote_host = file_name_copy; + remote_user = 0; + remote_file = 0; + + for (cursor = file_name_copy; *cursor; cursor++) + switch (*cursor) + { + default: + break; + + case '\n': + /* Do not allow newlines in the file_name, since the protocol + uses newline delimiters. */ + free (file_name_copy); + errno = ENOENT; + return -1; + + case '@': + if (!remote_user) + { + remote_user = remote_host; + *cursor = '\0'; + remote_host = cursor + 1; + } + break; + + case ':': + if (!remote_file) + { + *cursor = '\0'; + remote_file = cursor + 1; + } + break; + } + } + + /* FIXME: Should somewhat validate the decoding, here. */ + + if (remote_user && *remote_user == '\0') + remote_user = 0; + +#if WITH_REXEC + + /* Execute the remote command using rexec. */ + + READ_SIDE (remote_pipe_number) = _rmt_rexec (remote_host, remote_user); + if (READ_SIDE (remote_pipe_number) < 0) + { + int e = errno; + free (file_name_copy); + errno = e; + return -1; + } + + WRITE_SIDE (remote_pipe_number) = READ_SIDE (remote_pipe_number); + +#else /* not WITH_REXEC */ + { + const char *remote_shell_basename; + pid_t status; + + /* Identify the remote command to be executed. */ + + if (!remote_shell) + { +#ifdef REMOTE_SHELL + remote_shell = REMOTE_SHELL; +#else + free (file_name_copy); + errno = EIO; + return -1; +#endif + } + remote_shell_basename = base_name (remote_shell); + + /* Set up the pipes for the `rsh' command, and fork. */ + + if (pipe (to_remote[remote_pipe_number]) == -1 + || pipe (from_remote[remote_pipe_number]) == -1) + { + int e = errno; + free (file_name_copy); + errno = e; + return -1; + } + + status = fork (); + if (status == -1) + { + int e = errno; + free (file_name_copy); + errno = e; + return -1; + } + + if (status == 0) + { + /* Child. */ + + close (STDIN_FILENO); + dup (to_remote[remote_pipe_number][PREAD]); + close (to_remote[remote_pipe_number][PREAD]); + close (to_remote[remote_pipe_number][PWRITE]); + + close (STDOUT_FILENO); + dup (from_remote[remote_pipe_number][PWRITE]); + close (from_remote[remote_pipe_number][PREAD]); + close (from_remote[remote_pipe_number][PWRITE]); + + sys_reset_uid_gid (); + + if (remote_user) + execl (remote_shell, remote_shell_basename, remote_host, + "-l", remote_user, rmt_command, (char *) 0); + else + execl (remote_shell, remote_shell_basename, remote_host, + rmt_command, (char *) 0); + + /* Bad problems if we get here. */ + + /* In a previous version, _exit was used here instead of exit. */ + error (EXIT_ON_EXEC_ERROR, errno, _("Cannot execute remote shell")); + } + + /* Parent. */ + + close (from_remote[remote_pipe_number][PWRITE]); + close (to_remote[remote_pipe_number][PREAD]); + } +#endif /* not WITH_REXEC */ + + /* Attempt to open the tape device. */ + + { + size_t remote_file_len = strlen (remote_file); + char *command_buffer = xmalloc (remote_file_len + 1000); + sprintf (command_buffer, "O%s\n", remote_file); + encode_oflag (command_buffer + remote_file_len + 2, open_mode); + strcat (command_buffer, "\n"); + if (do_command (remote_pipe_number, command_buffer) == -1 + || get_status (remote_pipe_number) == -1) + { + int e = errno; + free (command_buffer); + free (file_name_copy); + _rmt_shutdown (remote_pipe_number, e); + return -1; + } + free (command_buffer); + } + + free (file_name_copy); + return remote_pipe_number + bias; +} + +/* Close remote tape connection HANDLE and shut down. Return 0 if + successful, -1 on error. */ +int +rmt_close__ (int handle) +{ + long int status; + + if (do_command (handle, "C\n") == -1) + return -1; + + status = get_status (handle); + _rmt_shutdown (handle, errno); + return status; +} + +/* Read up to LENGTH bytes into BUFFER from remote tape connection HANDLE. + Return the number of bytes read on success, SAFE_READ_ERROR on error. */ +size_t +rmt_read__ (int handle, char *buffer, size_t length) +{ + char command_buffer[COMMAND_BUFFER_SIZE]; + size_t status; + size_t rlen; + size_t counter; + + sprintf (command_buffer, "R%lu\n", (unsigned long) length); + if (do_command (handle, command_buffer) == -1 + || (status = get_status (handle)) == SAFE_READ_ERROR) + return SAFE_READ_ERROR; + + for (counter = 0; counter < status; counter += rlen, buffer += rlen) + { + rlen = safe_read (READ_SIDE (handle), buffer, status - counter); + if (rlen == SAFE_READ_ERROR || rlen == 0) + { + _rmt_shutdown (handle, EIO); + return SAFE_READ_ERROR; + } + } + + return status; +} + +/* Write LENGTH bytes from BUFFER to remote tape connection HANDLE. + Return the number of bytes written. */ +size_t +rmt_write__ (int handle, char *buffer, size_t length) +{ + char command_buffer[COMMAND_BUFFER_SIZE]; + RETSIGTYPE (*pipe_handler) (); + size_t written; + + sprintf (command_buffer, "W%lu\n", (unsigned long) length); + if (do_command (handle, command_buffer) == -1) + return 0; + + pipe_handler = signal (SIGPIPE, SIG_IGN); + written = full_write (WRITE_SIDE (handle), buffer, length); + signal (SIGPIPE, pipe_handler); + if (written == length) + { + long int r = get_status (handle); + if (r < 0) + return 0; + if (r == length) + return length; + written = r; + } + + /* Write error. */ + + _rmt_shutdown (handle, EIO); + return written; +} + +/* Perform an imitation lseek operation on remote tape connection + HANDLE. Return the new file offset if successful, -1 if on error. */ +off_t +rmt_lseek__ (int handle, off_t offset, int whence) +{ + char command_buffer[COMMAND_BUFFER_SIZE]; + char operand_buffer[UINTMAX_STRSIZE_BOUND]; + uintmax_t u = offset < 0 ? - (uintmax_t) offset : (uintmax_t) offset; + char *p = operand_buffer + sizeof operand_buffer; + + *--p = 0; + do + *--p = '0' + (int) (u % 10); + while ((u /= 10) != 0); + if (offset < 0) + *--p = '-'; + + switch (whence) + { + case SEEK_SET: whence = 0; break; + case SEEK_CUR: whence = 1; break; + case SEEK_END: whence = 2; break; + default: abort (); + } + + sprintf (command_buffer, "L%s\n%d\n", p, whence); + + if (do_command (handle, command_buffer) == -1) + return -1; + + return get_status_off (handle); +} + +/* Perform a raw tape operation on remote tape connection HANDLE. + Return the results of the ioctl, or -1 on error. */ +int +rmt_ioctl__ (int handle, int operation, char *argument) +{ + switch (operation) + { + default: + errno = EOPNOTSUPP; + return -1; + +#ifdef MTIOCTOP + case MTIOCTOP: + { + char command_buffer[COMMAND_BUFFER_SIZE]; + char operand_buffer[UINTMAX_STRSIZE_BOUND]; + uintmax_t u = (((struct mtop *) argument)->mt_count < 0 + ? - (uintmax_t) ((struct mtop *) argument)->mt_count + : (uintmax_t) ((struct mtop *) argument)->mt_count); + char *p = operand_buffer + sizeof operand_buffer; + + *--p = 0; + do + *--p = '0' + (int) (u % 10); + while ((u /= 10) != 0); + if (((struct mtop *) argument)->mt_count < 0) + *--p = '-'; + + /* MTIOCTOP is the easy one. Nothing is transferred in binary. */ + + sprintf (command_buffer, "I%d\n%s\n", + ((struct mtop *) argument)->mt_op, p); + if (do_command (handle, command_buffer) == -1) + return -1; + + return get_status (handle); + } +#endif /* MTIOCTOP */ + +#ifdef MTIOCGET + case MTIOCGET: + { + ssize_t status; + size_t counter; + + /* Grab the status and read it directly into the structure. This + assumes that the status buffer is not padded and that 2 shorts + fit in a long without any word alignment problems; i.e., the + whole struct is contiguous. NOTE - this is probably NOT a good + assumption. */ + + if (do_command (handle, "S") == -1 + || (status = get_status (handle), status == -1)) + return -1; + + for (; status > 0; status -= counter, argument += counter) + { + counter = safe_read (READ_SIDE (handle), argument, status); + if (counter == SAFE_READ_ERROR || counter == 0) + { + _rmt_shutdown (handle, EIO); + return -1; + } + } + + /* Check for byte position. mt_type (or mt_model) is a small integer + field (normally) so we will check its magnitude. If it is larger + than 256, we will assume that the bytes are swapped and go through + and reverse all the bytes. */ + + if (((struct mtget *) argument)->MTIO_CHECK_FIELD < 256) + return 0; + + for (counter = 0; counter < status; counter += 2) + { + char copy = argument[counter]; + + argument[counter] = argument[counter + 1]; + argument[counter + 1] = copy; + } + + return 0; + } +#endif /* MTIOCGET */ + + } +} diff --git a/lib/safe-read.c b/lib/safe-read.c new file mode 100644 index 0000000..b7bf1d5 --- /dev/null +++ b/lib/safe-read.c @@ -0,0 +1,78 @@ +/* An interface to read and write that retries after interrupts. + + 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 + it under the 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 + +/* Specification. */ +#ifdef SAFE_WRITE +# include "safe-write.h" +#else +# include "safe-read.h" +#endif + +/* Get ssize_t. */ +#include +#include + +#include + +#ifdef EINTR +# define IS_EINTR(x) ((x) == EINTR) +#else +# define IS_EINTR(x) 0 +#endif + +#include + +#ifdef SAFE_WRITE +# define safe_rw safe_write +# define rw write +#else +# define safe_rw safe_read +# define rw read +# undef const +# define const /* empty */ +#endif + +/* Read(write) up to COUNT bytes at BUF from(to) descriptor FD, retrying if + interrupted. Return the actual number of bytes read(written), zero for EOF, + or SAFE_READ_ERROR(SAFE_WRITE_ERROR) upon error. */ +size_t +safe_rw (int fd, void const *buf, size_t count) +{ + /* Work around a bug in Tru64 5.1. Attempting to read more than + INT_MAX bytes fails with errno == EINVAL. See + . + When decreasing COUNT, keep it block-aligned. */ + enum { BUGGY_READ_MAXIMUM = INT_MAX & ~8191 }; + + for (;;) + { + ssize_t result = rw (fd, buf, count); + + if (0 <= result) + return result; + else if (IS_EINTR (errno)) + continue; + else if (errno == EINVAL && BUGGY_READ_MAXIMUM < count) + count = BUGGY_READ_MAXIMUM; + else + return result; + } +} diff --git a/lib/safe-read.h b/lib/safe-read.h new file mode 100644 index 0000000..3451955 --- /dev/null +++ b/lib/safe-read.h @@ -0,0 +1,35 @@ +/* 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 + it under the 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 + +#ifdef __cplusplus +extern "C" { +#endif + + +#define SAFE_READ_ERROR ((size_t) -1) + +/* Read up to COUNT bytes at BUF from descriptor FD, retrying if interrupted. + Return the actual number of bytes read, zero for EOF, or SAFE_READ_ERROR + upon error. */ +extern size_t safe_read (int fd, void *buf, size_t count); + + +#ifdef __cplusplus +} +#endif diff --git a/lib/safe-write.c b/lib/safe-write.c new file mode 100644 index 0000000..4c375a6 --- /dev/null +++ b/lib/safe-write.c @@ -0,0 +1,19 @@ +/* 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 + it under the 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. */ + +#define SAFE_WRITE +#include "safe-read.c" diff --git a/lib/safe-write.h b/lib/safe-write.h new file mode 100644 index 0000000..c194636 --- /dev/null +++ b/lib/safe-write.h @@ -0,0 +1,25 @@ +/* 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 + it under the 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 + +#define SAFE_WRITE_ERROR ((size_t) -1) + +/* Write up to COUNT bytes at BUF to descriptor FD, retrying if interrupted. + Return the actual number of bytes written, zero for EOF, or SAFE_WRITE_ERROR + upon error. */ +extern size_t safe_write (int fd, const void *buf, size_t count); diff --git a/lib/same-inode.h b/lib/same-inode.h new file mode 100644 index 0000000..deca87b --- /dev/null +++ b/lib/same-inode.h @@ -0,0 +1,26 @@ +/* Determine whether two stat buffers refer to the same file. + + 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. */ + +#ifndef SAME_INODE_H +# define SAME_INODE_H 1 + +# define SAME_INODE(Stat_buf_1, Stat_buf_2) \ + ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \ + && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev) + +#endif diff --git a/lib/save-cwd.c b/lib/save-cwd.c new file mode 100644 index 0000000..f07973a --- /dev/null +++ b/lib/save-cwd.c @@ -0,0 +1,103 @@ +/* save-cwd.c -- Save and restore current working directory. + + 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 + it under the 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 "save-cwd.h" + +#include +#include +#include +#include +#include + +#include "chdir-long.h" +#include "fcntl--.h" +#include "xgetcwd.h" + +/* On systems without the fchdir function (WOE), pretend that open + always returns -1 so that save_cwd resorts to using xgetcwd. + Since chdir_long requires fchdir, use chdir instead. */ +#if !HAVE_FCHDIR +# undef open +# define open(File, Flags) (-1) +# undef fchdir +# define fchdir(Fd) (abort (), -1) +# undef chdir_long +# define chdir_long(Dir) chdir (Dir) +#endif + +/* Record the location of the current working directory in CWD so that + the program may change to other directories and later use restore_cwd + to return to the recorded location. This function may allocate + space using malloc (via xgetcwd) or leave a file descriptor open; + use free_cwd to perform the necessary free or close. Upon failure, + no memory is allocated, any locally opened file descriptors are + closed; return non-zero -- in that case, free_cwd need not be + called, but doing so is ok. Otherwise, return zero. + + The `raison d'etre' for this interface is that the working directory + is sometimes inaccessible, and getcwd is not robust or as efficient. + So, we prefer to use the open/fchdir approach, but fall back on + getcwd if necessary. + + Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin, + SCO Xenix. Also, SunOS 4 and Irix 5.3 provide the function, yet it + doesn't work for partitions on which auditing is enabled. If + you're still using an obsolete system with these problems, please + send email to the maintainer of this code. */ + +int +save_cwd (struct saved_cwd *cwd) +{ + cwd->name = NULL; + + cwd->desc = open (".", O_RDONLY); + if (cwd->desc < 0) + { + cwd->name = xgetcwd (); + return cwd->name ? 0 : -1; + } + + return 0; +} + +/* Change to recorded location, CWD, in directory hierarchy. + Upon failure, return -1 (errno is set by chdir or fchdir). + Upon success, return zero. */ + +int +restore_cwd (const struct saved_cwd *cwd) +{ + if (0 <= cwd->desc) + return fchdir (cwd->desc); + else + return chdir_long (cwd->name); +} + +void +free_cwd (struct saved_cwd *cwd) +{ + if (cwd->desc >= 0) + close (cwd->desc); + if (cwd->name) + free (cwd->name); +} diff --git a/lib/save-cwd.h b/lib/save-cwd.h new file mode 100644 index 0000000..d646b55 --- /dev/null +++ b/lib/save-cwd.h @@ -0,0 +1,34 @@ +/* Save and restore current working directory. + + Copyright (C) 1995, 1997, 1998, 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. */ + +/* Written by Jim Meyering. */ + +#ifndef SAVE_CWD_H +# define SAVE_CWD_H 1 + +struct saved_cwd + { + int desc; + char *name; + }; + +int save_cwd (struct saved_cwd *cwd); +int restore_cwd (const struct saved_cwd *cwd); +void free_cwd (struct saved_cwd *cwd); + +#endif /* SAVE_CWD_H */ diff --git a/lib/savedir.c b/lib/savedir.c new file mode 100644 index 0000000..d930fb4 --- /dev/null +++ b/lib/savedir.c @@ -0,0 +1,137 @@ +/* savedir.c -- save the list of files in a directory in a string + + 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 + it under the 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 . */ + +#include + +#include "savedir.h" + +#include + +#include + +#include +#ifndef _D_EXACT_NAMLEN +# define _D_EXACT_NAMLEN(dp) strlen ((dp)->d_name) +#endif + +#include +#include +#include + +#include "openat.h" +#include "xalloc.h" + +#ifndef NAME_SIZE_DEFAULT +# define NAME_SIZE_DEFAULT 512 +#endif + +/* The results of opendir() in this file are not used with dirfd and fchdir, + therefore save some unnecessary work in fchdir.c. */ +#undef opendir +#undef closedir + +/* Return a freshly allocated string containing the file names + in directory DIRP, separated by '\0' characters; + the end is marked by two '\0' characters in a row. + Return NULL (setting errno) if DIRP cannot be read or closed. + If DIRP is NULL, return NULL without affecting errno. */ + +static char * +savedirstream (DIR *dirp) +{ + char *name_space; + size_t allocated = NAME_SIZE_DEFAULT; + size_t used = 0; + int save_errno; + + if (dirp == NULL) + return NULL; + + name_space = xmalloc (allocated); + + for (;;) + { + struct dirent const *dp; + char const *entry; + + errno = 0; + dp = readdir (dirp); + if (! dp) + break; + + /* Skip "", ".", and "..". "" is returned by at least one buggy + implementation: Solaris 2.4 readdir on NFS file systems. */ + entry = dp->d_name; + if (entry[entry[0] != '.' ? 0 : entry[1] != '.' ? 1 : 2] != '\0') + { + size_t entry_size = _D_EXACT_NAMLEN (dp) + 1; + if (used + entry_size < used) + xalloc_die (); + if (allocated <= used + entry_size) + { + do + { + if (2 * allocated < allocated) + xalloc_die (); + allocated *= 2; + } + while (allocated <= used + entry_size); + + name_space = xrealloc (name_space, allocated); + } + memcpy (name_space + used, entry, entry_size); + used += entry_size; + } + } + name_space[used] = '\0'; + save_errno = errno; + if (closedir (dirp) != 0) + save_errno = errno; + if (save_errno != 0) + { + free (name_space); + errno = save_errno; + return NULL; + } + return name_space; +} + +/* Return a freshly allocated string containing the file names + in directory DIR, separated by '\0' characters; + the end is marked by two '\0' characters in a row. + Return NULL (setting errno) if DIR cannot be opened, read, or closed. */ + +char * +savedir (char const *dir) +{ + return savedirstream (opendir (dir)); +} + +/* Return a freshly allocated string containing the file names + in directory FD, separated by '\0' characters; + the end is marked by two '\0' characters in a row. + Return NULL (setting errno) if FD cannot be read or closed. */ + +char * +fdsavedir (int fd) +{ + return savedirstream (fdopendir (fd)); +} diff --git a/lib/savedir.h b/lib/savedir.h new file mode 100644 index 0000000..5b7bef9 --- /dev/null +++ b/lib/savedir.h @@ -0,0 +1,27 @@ +/* Save the list of files in a directory in a string. + + Copyright (C) 1997, 1999, 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) + any 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 . */ + +#if !defined SAVEDIR_H_ +# define SAVEDIR_H_ + +char *savedir (char const *dir); +char *fdsavedir (int fd); + +#endif diff --git a/lib/setenv.c b/lib/setenv.c new file mode 100644 index 0000000..c54c28d --- /dev/null +++ b/lib/setenv.c @@ -0,0 +1,332 @@ +/* Copyright (C) 1992,1995-1999,2000-2003,2005-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) + any 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 !_LIBC +# include +#endif +#include + +#include +#ifndef __set_errno +# define __set_errno(ev) ((errno) = (ev)) +#endif + +#include +#include +#if _LIBC || HAVE_UNISTD_H +# include +#endif + +#if _LIBC || !HAVE_SETENV + +#if !_LIBC +# include "allocsa.h" +#endif + +#if !_LIBC +# define __environ environ +# ifndef HAVE_ENVIRON_DECL +extern char **environ; +# endif +#endif + +#if _LIBC +/* This lock protects against simultaneous modifications of `environ'. */ +# include +__libc_lock_define_initialized (static, envlock) +# define LOCK __libc_lock_lock (envlock) +# define UNLOCK __libc_lock_unlock (envlock) +#else +# define LOCK +# define UNLOCK +#endif + +/* In the GNU C library we must keep the namespace clean. */ +#ifdef _LIBC +# define setenv __setenv +# define clearenv __clearenv +# define tfind __tfind +# define tsearch __tsearch +#endif + +/* In the GNU C library implementation we try to be more clever and + allow arbitrarily many changes of the environment given that the used + values are from a small set. Outside glibc this will eat up all + memory after a while. */ +#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \ + && defined __GNUC__) +# define USE_TSEARCH 1 +# include +typedef int (*compar_fn_t) (const void *, const void *); + +/* This is a pointer to the root of the search tree with the known + values. */ +static void *known_values; + +# define KNOWN_VALUE(Str) \ + ({ \ + void *value = tfind (Str, &known_values, (compar_fn_t) strcmp); \ + value != NULL ? *(char **) value : NULL; \ + }) +# define STORE_VALUE(Str) \ + tsearch (Str, &known_values, (compar_fn_t) strcmp) + +#else +# undef USE_TSEARCH + +# define KNOWN_VALUE(Str) NULL +# define STORE_VALUE(Str) do { } while (0) + +#endif + + +/* If this variable is not a null pointer we allocated the current + environment. */ +static char **last_environ; + + +/* This function is used by `setenv' and `putenv'. The difference between + the two functions is that for the former must create a new string which + is then placed in the environment, while the argument of `putenv' + must be used directly. This is all complicated by the fact that we try + to reuse values once generated for a `setenv' call since we can never + free the strings. */ +int +__add_to_environ (const char *name, const char *value, const char *combined, + int replace) +{ + register char **ep; + register size_t size; + const size_t namelen = strlen (name); + const size_t vallen = value != NULL ? strlen (value) + 1 : 0; + + LOCK; + + /* We have to get the pointer now that we have the lock and not earlier + since another thread might have created a new environment. */ + ep = __environ; + + size = 0; + if (ep != NULL) + { + for (; *ep != NULL; ++ep) + if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=') + break; + else + ++size; + } + + if (ep == NULL || *ep == NULL) + { + char **new_environ; +#ifdef USE_TSEARCH + char *new_value; +#endif + + /* We allocated this space; we can extend it. */ + new_environ = + (char **) (last_environ == NULL + ? malloc ((size + 2) * sizeof (char *)) + : realloc (last_environ, (size + 2) * sizeof (char *))); + if (new_environ == NULL) + { + UNLOCK; + return -1; + } + + /* If the whole entry is given add it. */ + if (combined != NULL) + /* We must not add the string to the search tree since it belongs + to the user. */ + new_environ[size] = (char *) combined; + else + { + /* See whether the value is already known. */ +#ifdef USE_TSEARCH +# ifdef _LIBC + new_value = (char *) alloca (namelen + 1 + vallen); + __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), + value, vallen); +# else + new_value = (char *) allocsa (namelen + 1 + vallen); + if (new_value == NULL) + { + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + memcpy (new_value, name, namelen); + new_value[namelen] = '='; + memcpy (&new_value[namelen + 1], value, vallen); +# endif + + new_environ[size] = KNOWN_VALUE (new_value); + if (new_environ[size] == NULL) +#endif + { + new_environ[size] = (char *) malloc (namelen + 1 + vallen); + if (new_environ[size] == NULL) + { +#if defined USE_TSEARCH && !defined _LIBC + freesa (new_value); +#endif + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + +#ifdef USE_TSEARCH + memcpy (new_environ[size], new_value, namelen + 1 + vallen); +#else + memcpy (new_environ[size], name, namelen); + new_environ[size][namelen] = '='; + memcpy (&new_environ[size][namelen + 1], value, vallen); +#endif + /* And save the value now. We cannot do this when we remove + the string since then we cannot decide whether it is a + user string or not. */ + STORE_VALUE (new_environ[size]); + } +#if defined USE_TSEARCH && !defined _LIBC + freesa (new_value); +#endif + } + + if (__environ != last_environ) + memcpy ((char *) new_environ, (char *) __environ, + size * sizeof (char *)); + + new_environ[size + 1] = NULL; + + last_environ = __environ = new_environ; + } + else if (replace) + { + char *np; + + /* Use the user string if given. */ + if (combined != NULL) + np = (char *) combined; + else + { +#ifdef USE_TSEARCH + char *new_value; +# ifdef _LIBC + new_value = alloca (namelen + 1 + vallen); + __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), + value, vallen); +# else + new_value = allocsa (namelen + 1 + vallen); + if (new_value == NULL) + { + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + memcpy (new_value, name, namelen); + new_value[namelen] = '='; + memcpy (&new_value[namelen + 1], value, vallen); +# endif + + np = KNOWN_VALUE (new_value); + if (np == NULL) +#endif + { + np = malloc (namelen + 1 + vallen); + if (np == NULL) + { +#if defined USE_TSEARCH && !defined _LIBC + freesa (new_value); +#endif + __set_errno (ENOMEM); + UNLOCK; + return -1; + } + +#ifdef USE_TSEARCH + memcpy (np, new_value, namelen + 1 + vallen); +#else + memcpy (np, name, namelen); + np[namelen] = '='; + memcpy (&np[namelen + 1], value, vallen); +#endif + /* And remember the value. */ + STORE_VALUE (np); + } +#if defined USE_TSEARCH && !defined _LIBC + freesa (new_value); +#endif + } + + *ep = np; + } + + UNLOCK; + + return 0; +} + +int +setenv (const char *name, const char *value, int replace) +{ + return __add_to_environ (name, value, NULL, replace); +} + +/* The `clearenv' was planned to be added to POSIX.1 but probably + never made it. Nevertheless the POSIX.9 standard (POSIX bindings + for Fortran 77) requires this function. */ +int +clearenv (void) +{ + LOCK; + + if (__environ == last_environ && __environ != NULL) + { + /* We allocated this environment so we can free it. */ + free (__environ); + last_environ = NULL; + } + + /* Clear the environment pointer removes the whole environment. */ + __environ = NULL; + + UNLOCK; + + return 0; +} + +#ifdef _LIBC +static void +free_mem (void) +{ + /* Remove all traces. */ + clearenv (); + + /* Now remove the search tree. */ + __tdestroy (known_values, free); + known_values = NULL; +} +text_set_element (__libc_subfreeres, free_mem); + + +# undef setenv +# undef clearenv +weak_alias (__setenv, setenv) +weak_alias (__clearenv, clearenv) +#endif + +#endif /* _LIBC || !HAVE_SETENV */ diff --git a/lib/setenv.h b/lib/setenv.h new file mode 100644 index 0000000..92e7bba --- /dev/null +++ b/lib/setenv.h @@ -0,0 +1,54 @@ +/* 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/lib/sleep.c b/lib/sleep.c new file mode 100644 index 0000000..037559b --- /dev/null +++ b/lib/sleep.c @@ -0,0 +1,47 @@ +/* Pausing execution of the current thread. + 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 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 + +/* Specification. */ +#include + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include + +unsigned int +sleep (unsigned int seconds) +{ + unsigned int remaining; + + /* Sleep for 1 second many times, because + 1. Sleep is not interruptiple by Ctrl-C, + 2. we want to avoid arithmetic overflow while multiplying with 1000. */ + for (remaining = seconds; remaining > 0; remaining--) + Sleep (1000); + + return remaining; +} + +#else + + #error "Please port gnulib sleep.c to your platform, possibly using usleep() or select(), then report this to bug-gnulib." + +#endif diff --git a/lib/stdbool_.h b/lib/stdbool_.h new file mode 100644 index 0000000..150a010 --- /dev/null +++ b/lib/stdbool_.h @@ -0,0 +1,118 @@ +/* Copyright (C) 2001, 2002, 2003, 2006, 2007 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) + any 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_STDBOOL_H +#define _GL_STDBOOL_H + +/* ISO C 99 for platforms that lack it. */ + +/* Usage suggestions: + + Programs that use should be aware of some limitations + and standards compliance issues. + + Standards compliance: + + - must be #included before 'bool', 'false', 'true' + can be used. + + - You cannot assume that sizeof (bool) == 1. + + - Programs should not undefine the macros bool, true, and false, + as C99 lists that as an "obsolescent feature". + + Limitations of this substitute, when used in a C89 environment: + + - must be #included before the '_Bool' type can be used. + + - You cannot assume that _Bool is a typedef; it might be a macro. + + - Bit-fields of type 'bool' are not supported. Portable code + should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'. + + - In C99, casts and automatic conversions to '_Bool' or 'bool' are + performed in such a way that every nonzero value gets converted + to 'true', and zero gets converted to 'false'. This doesn't work + with this substitute. With this substitute, only the values 0 and 1 + give the expected result when converted to _Bool' or 'bool'. + + Also, it is suggested that programs use 'bool' rather than '_Bool'; + this isn't required, but 'bool' is more common. */ + + +/* 7.16. Boolean type and values */ + +/* BeOS already #defines false 0, true 1. We use the same + definitions below, but temporarily we have to #undef them. */ +#ifdef __BEOS__ +# include /* defines bool but not _Bool */ +# undef false +# undef true +#endif + +/* For the sake of symbolic names in gdb, we define true and false as + enum constants, not only as macros. + It is tempting to write + typedef enum { false = 0, true = 1 } _Bool; + so that gdb prints values of type 'bool' symbolically. But if we do + this, values of type '_Bool' may promote to 'int' or 'unsigned int' + (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__ + /* A compiler known to have 'bool'. */ + /* If the compiler already has both 'bool' and '_Bool', we can assume they + are the same types. */ +# if !@HAVE__BOOL@ +typedef bool _Bool; +# endif +#else +# if !defined __GNUC__ + /* If @HAVE__BOOL@: + Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when + the built-in _Bool type is used. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + Similar bugs are likely with other compilers as well; this file + wouldn't be used if was working. + So we override the _Bool type. + If !@HAVE__BOOL@: + Need to define _Bool ourselves. As 'signed char' or as an enum type? + Use of a typedef, with SunPRO C, leads to a stupid + "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. */ +# 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@ +typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; +# endif +# endif +#endif +#define bool _Bool + +/* The other macros must be usable in preprocessor directives. */ +#define false 0 +#define true 1 +#define __bool_true_false_are_defined 1 + +#endif /* _GL_STDBOOL_H */ diff --git a/lib/stdint_.h b/lib/stdint_.h new file mode 100644 index 0000000..d374535 --- /dev/null +++ b/lib/stdint_.h @@ -0,0 +1,512 @@ +/* Copyright (C) 2001-2002, 2004-2007 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) + any 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. */ + +/* + * ISO C 99 for platforms that lack it. + * + */ + +#ifndef _GL_STDINT_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 + signed char int8_t;" that will get messed up by our macro. Our + macros should all be consistent with the system versions, except + for the "fast" types and macros, which we recommend against using + in public interfaces due to compiler differences. */ + +#if @HAVE_STDINT_H@ +# if defined __sgi && ! defined __c99 + /* Bypass IRIX's if in C89 mode, since it merely annoys users + with "This header file is to be used only for c99 mode compilations" + diagnostics. */ +# define __STDINT_H__ +# endif + /* 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. + The include_next requires a split double-inclusion guard. */ +# if @HAVE_INCLUDE_NEXT@ +# include_next +# else +# include @ABSOLUTE_STDINT_H@ +# endif +#endif + +#ifndef _GL_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@. */ +#if @HAVE_SYS_TYPES_H@ && ! defined _AIX +# include +#endif + +/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ +#include + +#if @HAVE_INTTYPES_H@ + /* 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. */ +# include +#endif + +#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ + /* Linux libc4 >= 4.6.7 and libc5 have a that defines + int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is + included by . */ +# include +#endif + +#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS + +/* Get WCHAR_MIN, WCHAR_MAX. */ +# if ! (defined WCHAR_MIN && defined WCHAR_MAX) +# include +# endif + +#endif + +/* Minimum and maximum values for a integer type under the usual assumption. + Return an unspecified value if BITS == 0, adding a check to pacify + picky compilers. */ + +#define _STDINT_MIN(signed, bits, zero) \ + ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) + +#define _STDINT_MAX(signed, bits, zero) \ + ((signed) \ + ? ~ _STDINT_MIN (signed, bits, zero) \ + : ((((zero) + 1) << ((bits) ? (bits) - 1 : 0)) - 1) * 2 + 1) + +/* 7.18.1.1. Exact-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. */ + +#undef int8_t +#undef uint8_t +#define int8_t signed char +#define uint8_t unsigned char + +#undef int16_t +#undef uint16_t +#define int16_t short int +#define uint16_t unsigned short int + +#undef int32_t +#undef uint32_t +#define int32_t int +#define uint32_t unsigned int + +/* 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 +# define GL_INT64_T +#elif defined _MSC_VER +# undef int64_t +# define int64_t __int64 +# define GL_INT64_T +#elif @HAVE_LONG_LONG_INT@ +# undef int64_t +# define int64_t long long int +# define GL_INT64_T +#endif + +#if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# undef uint64_t +# define uint64_t unsigned long int +# define GL_UINT64_T +#elif defined _MSC_VER +# undef uint64_t +# define uint64_t unsigned __int64 +# define GL_UINT64_T +#elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# undef uint64_t +# define uint64_t unsigned long long int +# define GL_UINT64_T +#endif + +/* Avoid collision with Solaris 2.5.1 etc. */ +#define _UINT8_T +#define _UINT32_T +#define _UINT64_T + + +/* 7.18.1.2. Minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types + are the same as the corresponding N_t types. */ + +#undef int_least8_t +#undef uint_least8_t +#undef int_least16_t +#undef uint_least16_t +#undef int_least32_t +#undef uint_least32_t +#undef int_least64_t +#undef uint_least64_t +#define int_least8_t int8_t +#define uint_least8_t uint8_t +#define int_least16_t int16_t +#define uint_least16_t uint16_t +#define int_least32_t int32_t +#define uint_least32_t uint32_t +#ifdef GL_INT64_T +# define int_least64_t int64_t +#endif +#ifdef GL_UINT64_T +# define uint_least64_t uint64_t +#endif + +/* 7.18.1.3. Fastest minimum-width integer types */ + +/* Note: Other substitutes may define these types differently. + It is not recommended to use these types in public header files. */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types + are taken from the same list of types. Assume that 'long int' + is fast enough for all narrower integers. */ + +#undef int_fast8_t +#undef uint_fast8_t +#undef int_fast16_t +#undef uint_fast16_t +#undef int_fast32_t +#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 +#ifdef GL_INT64_T +# define int_fast64_t int64_t +#endif +#ifdef GL_UINT64_T +# define uint_fast64_t uint64_t +#endif + +/* 7.18.1.4. Integer types capable of holding object pointers */ + +#undef intptr_t +#undef uintptr_t +#define intptr_t long int +#define uintptr_t unsigned long int + +/* 7.18.1.5. Greatest-width integer types */ + +/* Note: These types are compiler dependent. It may be unwise to use them in + public header files. */ + +#undef intmax_t +#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define intmax_t long long int +#elif defined GL_INT64_T +# define intmax_t int64_t +#else +# define intmax_t long int +#endif + +#undef uintmax_t +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define uintmax_t unsigned long long int +#elif defined GL_UINT64_T +# define uintmax_t uint64_t +#else +# define uintmax_t unsigned long int +#endif + +/* 7.18.2. Limits of specified-width integer types */ + +#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS + +/* 7.18.2.1. Limits of exact-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. */ + +#undef INT8_MIN +#undef INT8_MAX +#undef UINT8_MAX +#define INT8_MIN (~ INT8_MAX) +#define INT8_MAX 127 +#define UINT8_MAX 255 + +#undef INT16_MIN +#undef INT16_MAX +#undef UINT16_MAX +#define INT16_MIN (~ INT16_MAX) +#define INT16_MAX 32767 +#define UINT16_MAX 65535 + +#undef INT32_MIN +#undef INT32_MAX +#undef UINT32_MAX +#define INT32_MIN (~ INT32_MAX) +#define INT32_MAX 2147483647 +#define UINT32_MAX 4294967295U + +#undef INT64_MIN +#undef INT64_MAX +#ifdef GL_INT64_T +/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 + evaluates the latter incorrectly in preprocessor expressions. */ +# define INT64_MIN (- INTMAX_C (1) << 63) +# define INT64_MAX INTMAX_C (9223372036854775807) +#endif + +#undef UINT64_MAX +#ifdef GL_UINT64_T +# define UINT64_MAX UINTMAX_C (18446744073709551615) +#endif + +/* 7.18.2.2. Limits of minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types + are the same as the corresponding N_t types. */ + +#undef INT_LEAST8_MIN +#undef INT_LEAST8_MAX +#undef UINT_LEAST8_MAX +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define UINT_LEAST8_MAX UINT8_MAX + +#undef INT_LEAST16_MIN +#undef INT_LEAST16_MAX +#undef UINT_LEAST16_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define UINT_LEAST16_MAX UINT16_MAX + +#undef INT_LEAST32_MIN +#undef INT_LEAST32_MAX +#undef UINT_LEAST32_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define UINT_LEAST32_MAX UINT32_MAX + +#undef INT_LEAST64_MIN +#undef INT_LEAST64_MAX +#ifdef GL_INT64_T +# define INT_LEAST64_MIN INT64_MIN +# define INT_LEAST64_MAX INT64_MAX +#endif + +#undef UINT_LEAST64_MAX +#ifdef GL_UINT64_T +# define UINT_LEAST64_MAX UINT64_MAX +#endif + +/* 7.18.2.3. Limits of fastest minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types + are taken from the same list of types. */ + +#undef INT_FAST8_MIN +#undef INT_FAST8_MAX +#undef UINT_FAST8_MAX +#define INT_FAST8_MIN LONG_MIN +#define INT_FAST8_MAX LONG_MAX +#define UINT_FAST8_MAX ULONG_MAX + +#undef INT_FAST16_MIN +#undef INT_FAST16_MAX +#undef UINT_FAST16_MAX +#define INT_FAST16_MIN LONG_MIN +#define INT_FAST16_MAX LONG_MAX +#define UINT_FAST16_MAX ULONG_MAX + +#undef INT_FAST32_MIN +#undef INT_FAST32_MAX +#undef UINT_FAST32_MAX +#define INT_FAST32_MIN LONG_MIN +#define INT_FAST32_MAX LONG_MAX +#define UINT_FAST32_MAX ULONG_MAX + +#undef INT_FAST64_MIN +#undef INT_FAST64_MAX +#ifdef GL_INT64_T +# define INT_FAST64_MIN INT64_MIN +# define INT_FAST64_MAX INT64_MAX +#endif + +#undef UINT_FAST64_MAX +#ifdef GL_UINT64_T +# define UINT_FAST64_MAX UINT64_MAX +#endif + +/* 7.18.2.4. Limits of integer types capable of holding object pointers */ + +#undef INTPTR_MIN +#undef INTPTR_MAX +#undef UINTPTR_MAX +#define INTPTR_MIN LONG_MIN +#define INTPTR_MAX LONG_MAX +#define UINTPTR_MAX ULONG_MAX + +/* 7.18.2.5. Limits of greatest-width integer types */ + +#undef INTMAX_MIN +#undef INTMAX_MAX +#ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN +# define INTMAX_MAX INT64_MAX +#else +# define INTMAX_MIN INT32_MIN +# define INTMAX_MAX INT32_MAX +#endif + +#undef UINTMAX_MAX +#ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +#else +# define UINTMAX_MAX UINT32_MAX +#endif + +/* 7.18.3. Limits of other integer types */ + +/* 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@) + +/* sig_atomic_t limits */ +#undef SIG_ATOMIC_MIN +#undef SIG_ATOMIC_MAX +#define SIG_ATOMIC_MIN \ + _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ + 0@SIG_ATOMIC_T_SUFFIX@) +#define SIG_ATOMIC_MAX \ + _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ + 0@SIG_ATOMIC_T_SUFFIX@) + + +/* size_t limit */ +#undef SIZE_MAX +#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) + +/* wchar_t limits */ +#undef WCHAR_MIN +#undef WCHAR_MAX +#define WCHAR_MIN \ + _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) +#define WCHAR_MAX \ + _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) + +/* wint_t limits */ +#undef WINT_MIN +#undef WINT_MAX +#define WINT_MIN \ + _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) +#define WINT_MAX \ + _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) + +#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */ + +/* 7.18.4. Macros for integer constants */ + +#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS + +/* 7.18.4.1. Macros for minimum-width integer constants */ +/* According to ISO C 99 Technical Corrigendum 1 */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ + +#undef INT8_C +#undef UINT8_C +#define INT8_C(x) x +#define UINT8_C(x) x + +#undef INT16_C +#undef UINT16_C +#define INT16_C(x) x +#define UINT16_C(x) x + +#undef INT32_C +#undef UINT32_C +#define INT32_C(x) x +#define UINT32_C(x) x ## U + +#undef INT64_C +#undef UINT64_C +#if LONG_MAX >> 31 >> 31 == 1 +# define INT64_C(x) x##L +#elif defined _MSC_VER +# define INT64_C(x) x##i64 +#elif @HAVE_LONG_LONG_INT@ +# define INT64_C(x) x##LL +#endif +#if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# define UINT64_C(x) x##UL +#elif defined _MSC_VER +# define UINT64_C(x) x##ui64 +#elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# define UINT64_C(x) x##ULL +#endif + +/* 7.18.4.2. Macros for greatest-width integer constants */ + +#undef INTMAX_C +#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define INTMAX_C(x) x##LL +#elif defined GL_INT64_T +# define INTMAX_C(x) INT64_C(x) +#else +# define INTMAX_C(x) x##L +#endif + +#undef UINTMAX_C +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +#elif defined GL_UINT64_T +# define UINTMAX_C(x) UINT64_C(x) +#else +# define UINTMAX_C(x) x##UL +#endif + +#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ + +#endif /* _GL_STDINT_H */ +#endif /* _GL_STDINT_H */ diff --git a/lib/stdio_.h b/lib/stdio_.h new file mode 100644 index 0000000..7afaede --- /dev/null +++ b/lib/stdio_.h @@ -0,0 +1,320 @@ +/* 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. */ + +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_STDIO_H@ +#endif + +#else +/* Normal invocation convention. */ + +#ifndef _GL_STDIO_H + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_STDIO_H@ +#endif + +#ifndef _GL_STDIO_H +#define _GL_STDIO_H + +#include +#include + +#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) +/* Get off_t. */ +# include +#endif + +#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 + +#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_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 + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_STDIO_H */ +#endif /* _GL_STDIO_H */ +#endif diff --git a/lib/stdlib_.h b/lib/stdlib_.h new file mode 100644 index 0000000..130f071 --- /dev/null +++ b/lib/stdlib_.h @@ -0,0 +1,140 @@ +/* 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. */ + +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_STDLIB_H@ +#endif + +#else +/* Normal invocation convention. */ + +#ifndef _GL_STDLIB_H + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_STDLIB_H@ +#endif + +#ifndef _GL_STDLIB_H +#define _GL_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 /* _GL_STDLIB_H */ +#endif diff --git a/lib/stpcpy.c b/lib/stpcpy.c new file mode 100644 index 0000000..4089d39 --- /dev/null +++ b/lib/stpcpy.c @@ -0,0 +1,49 @@ +/* stpcpy.c -- copy a string and return pointer to end of new string + Copyright (C) 1992, 1995, 1997-1998, 2006 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 + under the 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 + +#include + +#undef __stpcpy +#ifdef _LIBC +# undef stpcpy +#endif + +#ifndef weak_alias +# define __stpcpy stpcpy +#endif + +/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ +char * +__stpcpy (char *dest, const char *src) +{ + register char *d = dest; + register const char *s = src; + + do + *d++ = *s; + while (*s++ != '\0'); + + return d - 1; +} +#ifdef weak_alias +weak_alias (__stpcpy, stpcpy) +#endif diff --git a/lib/strcasecmp.c b/lib/strcasecmp.c new file mode 100644 index 0000000..c605fb0 --- /dev/null +++ b/lib/strcasecmp.c @@ -0,0 +1,63 @@ +/* Case-insensitive string comparison function. + Copyright (C) 1998-1999, 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) + any 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 + +#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + +/* 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 with multibyte strings! */ + +int +strcasecmp (const char *s1, const char *s2) +{ + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2) + return 0; + + do + { + c1 = TOLOWER (*p1); + c2 = TOLOWER (*p2); + + if (c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); +} diff --git a/lib/strchrnul.c b/lib/strchrnul.c new file mode 100644 index 0000000..07014be --- /dev/null +++ b/lib/strchrnul.c @@ -0,0 +1,32 @@ +/* Searching in a string. + 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. */ + +#include + +/* Specification. */ +#include + +/* Find the first occurrence of C in S or the final NUL byte. */ +char * +strchrnul (const char *s, int c_in) +{ + char c = c_in; + while (*s && (*s != c)) + s++; + + return (char *) s; +} diff --git a/lib/strdup.c b/lib/strdup.c new file mode 100644 index 0000000..c614108 --- /dev/null +++ b/lib/strdup.c @@ -0,0 +1,55 @@ +/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004, 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) + any 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 _LIBC +# include +#endif + +/* Get specification. */ +#include + +#include + +#undef __strdup +#ifdef _LIBC +# undef strdup +#endif + +#ifndef weak_alias +# define __strdup strdup +#endif + +/* Duplicate S, returning an identical malloc'd string. */ +char * +__strdup (const char *s) +{ + size_t len = strlen (s) + 1; + void *new = malloc (len); + + if (new == NULL) + return NULL; + + return (char *) memcpy (new, s, len); +} +#ifdef libc_hidden_def +libc_hidden_def (__strdup) +#endif +#ifdef weak_alias +weak_alias (__strdup, strdup) +#endif diff --git a/lib/strerror.c b/lib/strerror.c new file mode 100644 index 0000000..54b851b --- /dev/null +++ b/lib/strerror.c @@ -0,0 +1,57 @@ +/* strerror.c --- ANSI C compatible system error routine + + Copyright (C) 1986, 1988, 1989, 1991, 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) + any 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 !HAVE_STRERROR + +#include + +/* Don't include , since it may or may not declare + sys_errlist and its declarations may collide with ours. Just + declare the stuff that we need directly. Standard hosted C89 + implementations define strerror and they don't need this strerror + function, so take some liberties with the standard to cater to + ancient or limited freestanding implementations. */ +int sprintf (char *, char const *, ...); +extern int sys_nerr; +extern char *sys_errlist[]; + +char * +strerror (int n) +{ + static char const fmt[] = "Unknown error (%d)"; + static char mesg[sizeof fmt + sizeof n * CHAR_BIT / 3]; + + if (n < 0 || n >= sys_nerr) + { + sprintf (mesg, fmt, n); + return mesg; + } + else + return sys_errlist[n]; +} + +#else + +/* This declaration is solely to ensure that after preprocessing + this file is never empty. */ +typedef int dummy; + +#endif diff --git a/lib/string_.h b/lib/string_.h new file mode 100644 index 0000000..6ec72c3 --- /dev/null +++ b/lib/string_.h @@ -0,0 +1,546 @@ +/* A GNU-like . + + Copyright (C) 1995-1996, 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. */ + +#ifndef _GL_STRING_H + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_STRING_H@ +#endif + +#ifndef _GL_STRING_H +#define _GL_STRING_H + + +/* The definition of GL_LINK_WARNING is copied here. */ + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return the first occurrence of NEEDLE in HAYSTACK. */ +#if @GNULIB_MEMMEM@ +# if ! @HAVE_DECL_MEMMEM@ +extern void *memmem (void const *__haystack, size_t __haystack_len, + void const *__needle, size_t __needle_len); +# 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"), \ + memmem (a, al, b, bl)) +#endif + +/* Copy N bytes of SRC to DEST, return pointer to bytes after the + last written byte. */ +#if @GNULIB_MEMPCPY@ +# if ! @HAVE_MEMPCPY@ +extern void *mempcpy (void *restrict __dest, void const *restrict __src, + size_t __n); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mempcpy +# define mempcpy(a,b,n) \ + (GL_LINK_WARNING ("mempcpy is unportable - " \ + "use gnulib module mempcpy for portability"), \ + mempcpy (a, b, n)) +#endif + +/* 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); +# endif +#elif defined GNULIB_POSIXCHECK +# undef memrchr +# define memrchr(a,b,c) \ + (GL_LINK_WARNING ("memrchr is unportable - " \ + "use gnulib module memrchr for portability"), \ + memrchr (a, b, c)) +#endif + +/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ +#if @GNULIB_STPCPY@ +# if ! @HAVE_STPCPY@ +extern char *stpcpy (char *restrict __dst, char const *restrict __src); +# endif +#elif defined GNULIB_POSIXCHECK +# undef stpcpy +# define stpcpy(a,b) \ + (GL_LINK_WARNING ("stpcpy is unportable - " \ + "use gnulib module stpcpy for portability"), \ + stpcpy (a, b)) +#endif + +/* Copy no more than N bytes of SRC to DST, returning a pointer past the + last non-NUL byte written into DST. */ +#if @GNULIB_STPNCPY@ +# if ! @HAVE_STPNCPY@ +# define stpncpy gnu_stpncpy +extern char *stpncpy (char *restrict __dst, char const *restrict __src, + size_t __n); +# endif +#elif defined GNULIB_POSIXCHECK +# undef stpncpy +# define stpncpy(a,b,n) \ + (GL_LINK_WARNING ("stpncpy is unportable - " \ + "use gnulib module stpncpy for portability"), \ + 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. */ +# undef strchr +# define strchr(s,c) \ + (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \ + "in some multibyte locales - " \ + "use mbschr if you care about internationalization"), \ + strchr (s, c)) +#endif + +/* 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); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strchrnul +# define strchrnul(a,b) \ + (GL_LINK_WARNING ("strchrnul is unportable - " \ + "use gnulib module strchrnul for portability"), \ + strchrnul (a, b)) +#endif + +/* Duplicate S, returning an identical malloc'd string. */ +#if @GNULIB_STRDUP@ +# if ! @HAVE_DECL_STRDUP@ && ! defined strdup +extern char *strdup (char const *__s); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strdup +# define strdup(a) \ + (GL_LINK_WARNING ("strdup is unportable - " \ + "use gnulib module strdup for portability"), \ + strdup (a)) +#endif + +/* Return a newly allocated copy of at most N bytes of STRING. */ +#if @GNULIB_STRNDUP@ +# if ! @HAVE_STRNDUP@ +# undef strndup +# define strndup rpl_strndup +# endif +# if ! @HAVE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@ +extern char *strndup (char const *__string, size_t __n); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strndup +# define strndup(a,n) \ + (GL_LINK_WARNING ("strndup is unportable - " \ + "use gnulib module strndup for portability"), \ + strndup (a, n)) +#endif + +/* Find the length (number of bytes) of STRING, but scan at most + MAXLEN bytes. If no '\0' terminator is found in that many bytes, + return MAXLEN. */ +#if @GNULIB_STRNLEN@ +# if ! @HAVE_DECL_STRNLEN@ +extern size_t strnlen (char const *__string, size_t __maxlen); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strnlen +# define strnlen(a,n) \ + (GL_LINK_WARNING ("strnlen is unportable - " \ + "use gnulib module strnlen for portability"), \ + strnlen (a, n)) +#endif + +#if defined GNULIB_POSIXCHECK +/* strcspn() assumes the second argument is a list of single-byte characters. + Even in this simple case, it does not work with multibyte strings if the + locale encoding is GB18030 and one of the characters to be searched is a + digit. */ +# undef strcspn +# define strcspn(s,a) \ + (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbscspn if you care about internationalization"), \ + strcspn (s, a)) +#endif + +/* 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); +# endif +# if defined GNULIB_POSIXCHECK +/* strpbrk() assumes the second argument is a list of single-byte characters. + Even in this simple case, it does not work with multibyte strings if the + locale encoding is GB18030 and one of the characters to be searched is a + digit. */ +# undef strpbrk +# define strpbrk(s,a) \ + (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbspbrk if you care about internationalization"), \ + strpbrk (s, a)) +# endif +#elif defined GNULIB_POSIXCHECK +# undef strpbrk +# define strpbrk(s,a) \ + (GL_LINK_WARNING ("strpbrk is unportable - " \ + "use gnulib module strpbrk for portability"), \ + strpbrk (s, a)) +#endif + +#if defined GNULIB_POSIXCHECK +/* strspn() assumes the second argument is a list of single-byte characters. + Even in this simple case, it cannot work with multibyte strings. */ +# undef strspn +# define strspn(s,a) \ + (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbsspn if you care about internationalization"), \ + strspn (s, a)) +#endif + +#if defined GNULIB_POSIXCHECK +/* strrchr() does not work with multibyte strings if the locale encoding is + GB18030 and the character to be searched is a digit. */ +# undef strrchr +# define strrchr(s,c) \ + (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \ + "in some multibyte locales - " \ + "use mbsrchr if you care about internationalization"), \ + strrchr (s, c)) +#endif + +/* Search the next delimiter (char listed in DELIM) starting at *STRINGP. + If one is found, overwrite it with a NUL, and advance *STRINGP + to point to the next char after it. Otherwise, set *STRINGP to NULL. + If *STRINGP was already NULL, nothing happens. + Return the old value of *STRINGP. + + This is a variant of strtok() that is multithread-safe and supports + empty fields. + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + Caveat: It doesn't work with multibyte strings unless all of the delimiter + characters are ASCII characters < 0x30. + + See also strtok_r(). */ +#if @GNULIB_STRSEP@ +# if ! @HAVE_STRSEP@ +extern char *strsep (char **restrict __stringp, char const *restrict __delim); +# endif +# if defined GNULIB_POSIXCHECK +# undef strsep +# define strsep(s,d) \ + (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbssep if you care about internationalization"), \ + strsep (s, d)) +# endif +#elif defined GNULIB_POSIXCHECK +# undef strsep +# define strsep(s,d) \ + (GL_LINK_WARNING ("strsep is unportable - " \ + "use gnulib module strsep for portability"), \ + strsep (s, d)) +#endif + +#if 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"), \ + 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 +/* strcasestr() does not work with multibyte strings: + It is a glibc extension, and glibc implements it only for unibyte + locales. */ +# undef strcasestr +# define strcasestr(a,b) \ + (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \ + "in multibyte locales - " \ + "use mbscasestr if you care about " \ + "internationalization, or use c-strcasestr if you want " \ + "a locale independent function"), \ + strcasestr (a, b)) +#endif + +/* Parse S into tokens separated by characters in DELIM. + If S is NULL, the saved pointer in SAVE_PTR is used as + the next starting point. For example: + char s[] = "-abc-=-def"; + char *sp; + x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def" + x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL + x = strtok_r(NULL, "=", &sp); // x = NULL + // s = "abc\0-def\0" + + This is a variant of strtok() that is multithread-safe. + + For the POSIX documentation for this function, see: + http://www.opengroup.org/susv3xsh/strtok.html + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + Caveat: It doesn't work with multibyte strings unless all of the delimiter + characters are ASCII characters < 0x30. + + See also strsep(). */ +#if @GNULIB_STRTOK_R@ +# if ! @HAVE_DECL_STRTOK_R@ +extern char *strtok_r (char *restrict s, char const *restrict delim, + char **restrict save_ptr); +# endif +# if defined GNULIB_POSIXCHECK +# undef strtok_r +# define strtok_r(s,d,p) \ + (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbstok_r if you care about internationalization"), \ + strtok_r (s, d, p)) +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtok_r +# define strtok_r(s,d,p) \ + (GL_LINK_WARNING ("strtok_r is unportable - " \ + "use gnulib module strtok_r for portability"), \ + strtok_r (s, d, p)) +#endif + + +/* The following functions are not specified by POSIX. They are gnulib + extensions. */ + +#if @GNULIB_MBSLEN@ +/* Return the number of multibyte characters in the character string STRING. + This considers multibyte characters, unlike strlen, which counts bytes. */ +extern size_t mbslen (const char *string); +#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. + Unlike strchr(), this function works correctly in multibyte locales with + encodings such as GB18030. */ +# define mbschr rpl_mbschr /* avoid collision with HP-UX function */ +extern char * mbschr (const char *string, int c); +#endif + +#if @GNULIB_MBSRCHR@ +/* Locate the last single-byte character C in the character string STRING, + and return a pointer to it. Return NULL if C is not found in STRING. + Unlike strrchr(), this function works correctly in multibyte locales with + encodings such as GB18030. */ +# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */ +extern char * mbsrchr (const char *string, int c); +#endif + +#if @GNULIB_MBSSTR@ +/* Find the first occurrence of the character string NEEDLE in the character + string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. + Unlike strstr(), this function works correctly in multibyte locales with + encodings different from UTF-8. */ +extern char * mbsstr (const char *haystack, const char *needle); +#endif + +#if @GNULIB_MBSCASECMP@ +/* Compare the character 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 may, in multibyte locales, return 0 for strings of + different lengths! + Unlike strcasecmp(), this function works correctly in multibyte locales. */ +extern int mbscasecmp (const char *s1, const char *s2); +#endif + +#if @GNULIB_MBSNCASECMP@ +/* Compare the initial segment of the character string S1 consisting of at most + N characters with the initial segment of the character string S2 consisting + of at most N characters, ignoring case, returning less than, equal to or + greater than zero if the initial segment of S1 is lexicographically less + than, equal to or greater than the initial segment of S2. + Note: This function may, in multibyte locales, return 0 for initial segments + of different lengths! + Unlike strncasecmp(), this function works correctly in multibyte locales. + But beware that N is not a byte count but a character count! */ +extern int mbsncasecmp (const char *s1, const char *s2, size_t n); +#endif + +#if @GNULIB_MBSPCASECMP@ +/* Compare the initial segment of the character string STRING consisting of + at most mbslen (PREFIX) characters with the character string PREFIX, + ignoring case, returning less than, equal to or greater than zero if this + initial segment is lexicographically less than, equal to or greater than + PREFIX. + Note: This function may, in multibyte locales, return 0 if STRING is of + smaller length than PREFIX! + Unlike strncasecmp(), this function works correctly in multibyte + locales. */ +extern char * mbspcasecmp (const char *string, const char *prefix); +#endif + +#if @GNULIB_MBSCASESTR@ +/* Find the first occurrence of the character string NEEDLE in the character + string HAYSTACK, using case-insensitive comparison. + Note: This function may, in multibyte locales, return success even if + strlen (haystack) < strlen (needle) ! + Unlike strcasestr(), this function works correctly in multibyte locales. */ +extern char * mbscasestr (const char *haystack, const char *needle); +#endif + +#if @GNULIB_MBSCSPN@ +/* Find the first occurrence in the character string STRING of any character + in the character string ACCEPT. Return the number of bytes from the + beginning of the string to this occurrence, or to the end of the string + if none exists. + Unlike strcspn(), this function works correctly in multibyte locales. */ +extern size_t mbscspn (const char *string, const char *accept); +#endif + +#if @GNULIB_MBSPBRK@ +/* Find the first occurrence in the character string STRING of any character + in the character string ACCEPT. Return the pointer to it, or NULL if none + exists. + Unlike strpbrk(), this function works correctly in multibyte locales. */ +# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ +extern char * mbspbrk (const char *string, const char *accept); +#endif + +#if @GNULIB_MBSSPN@ +/* Find the first occurrence in the character string STRING of any character + not in the character string REJECT. Return the number of bytes from the + beginning of the string to this occurrence, or to the end of the string + if none exists. + Unlike strspn(), this function works correctly in multibyte locales. */ +extern size_t mbsspn (const char *string, const char *reject); +#endif + +#if @GNULIB_MBSSEP@ +/* Search the next delimiter (multibyte character listed in the character + string DELIM) starting at the character string *STRINGP. + If one is found, overwrite it with a NUL, and advance *STRINGP to point + to the next multibyte character after it. Otherwise, set *STRINGP to NULL. + If *STRINGP was already NULL, nothing happens. + Return the old value of *STRINGP. + + This is a variant of mbstok_r() that supports empty fields. + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + + See also mbstok_r(). */ +extern char * mbssep (char **stringp, const char *delim); +#endif + +#if @GNULIB_MBSTOK_R@ +/* Parse the character string STRING into tokens separated by characters in + the character string DELIM. + If STRING is NULL, the saved pointer in SAVE_PTR is used as + the next starting point. For example: + char s[] = "-abc-=-def"; + char *sp; + x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def" + x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL + x = mbstok_r(NULL, "=", &sp); // x = NULL + // s = "abc\0-def\0" + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + + See also mbssep(). */ +extern char * mbstok_r (char *string, const char *delim, char **save_ptr); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_STRING_H */ +#endif /* _GL_STRING_H */ diff --git a/lib/stripslash.c b/lib/stripslash.c new file mode 100644 index 0000000..342d497 --- /dev/null +++ b/lib/stripslash.c @@ -0,0 +1,45 @@ +/* stripslash.c -- remove redundant trailing slashes from a file name + + Copyright (C) 1990, 2001, 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. */ + +#include + +#include "dirname.h" + +/* Remove trailing slashes from FILE. Return true if a trailing slash + was removed. This is useful when using file name completion from a + shell that adds a "/" after directory names (such as tcsh and + bash), because on symlinks to directories, several system calls + have different semantics according to whether a trailing slash is + present. */ + +bool +strip_trailing_slashes (char *file) +{ + char *base = last_component (file); + char *base_lim; + bool had_slash; + + /* last_component returns "" for file system roots, but we need to turn + `///' into `/'. */ + if (! *base) + base = file; + base_lim = base + base_len (base); + had_slash = (*base_lim != '\0'); + *base_lim = '\0'; + return had_slash; +} diff --git a/lib/strncasecmp.c b/lib/strncasecmp.c new file mode 100644 index 0000000..473a610 --- /dev/null +++ b/lib/strncasecmp.c @@ -0,0 +1,63 @@ +/* strncasecmp.c -- case insensitive string comparator + Copyright (C) 1998-1999, 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) + any 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 + +#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + +/* 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. */ + +int +strncasecmp (const char *s1, const char *s2, size_t n) +{ + register const unsigned char *p1 = (const unsigned char *) s1; + register const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2 || n == 0) + return 0; + + do + { + c1 = TOLOWER (*p1); + c2 = TOLOWER (*p2); + + if (--n == 0 || c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); +} diff --git a/lib/strndup.c b/lib/strndup.c new file mode 100644 index 0000000..3a1b0ea --- /dev/null +++ b/lib/strndup.c @@ -0,0 +1,37 @@ +/* A replacement function, for systems that lack strndup. + + Copyright (C) 1996, 1997, 1998, 2001, 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. */ + +#include + +#include + +#include + +char * +strndup (char const *s, size_t n) +{ + size_t len = strnlen (s, n); + char *new = malloc (len + 1); + + if (new == NULL) + return NULL; + + new[len] = '\0'; + return memcpy (new, s, len); +} diff --git a/lib/strnlen.c b/lib/strnlen.c new file mode 100644 index 0000000..d346d32 --- /dev/null +++ b/lib/strnlen.c @@ -0,0 +1,31 @@ +/* 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) + any 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 + +/* Find the length of STRING, but scan at most MAXLEN characters. + If no '\0' terminator is found in that many characters, return MAXLEN. */ + +size_t +strnlen (const char *string, size_t maxlen) +{ + const char *end = memchr (string, '\0', maxlen); + return end ? (size_t) (end - string) : maxlen; +} diff --git a/lib/strtol.c b/lib/strtol.c new file mode 100644 index 0000000..e14d3cf --- /dev/null +++ b/lib/strtol.c @@ -0,0 +1,436 @@ +/* Convert string representation of a number into an integer value. + + Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005, + 2006, 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 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. */ + +#ifdef _LIBC +# define USE_NUMBER_GROUPING +#else +# include +#endif + +#include +#include +#ifndef __set_errno +# define __set_errno(Val) errno = (Val) +#endif + +#include +#include +#include +#include + +#ifdef USE_NUMBER_GROUPING +# include "../locale/localeinfo.h" +#endif + +/* Nonzero if we are defining `strtoul' or `strtoull', operating on + unsigned integers. */ +#ifndef UNSIGNED +# define UNSIGNED 0 +# define INT LONG int +#else +# define INT unsigned LONG int +#endif + +/* Determine the name. */ +#ifdef USE_IN_EXTENDED_LOCALE_MODEL +# if UNSIGNED +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol __wcstoull_l +# else +# define strtol __wcstoul_l +# endif +# else +# ifdef QUAD +# define strtol __strtoull_l +# else +# define strtol __strtoul_l +# endif +# endif +# else +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol __wcstoll_l +# else +# define strtol __wcstol_l +# endif +# else +# ifdef QUAD +# define strtol __strtoll_l +# else +# define strtol __strtol_l +# endif +# endif +# endif +#else +# if UNSIGNED +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol wcstoull +# else +# define strtol wcstoul +# endif +# else +# ifdef QUAD +# define strtol strtoull +# else +# define strtol strtoul +# endif +# endif +# else +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol wcstoll +# else +# define strtol wcstol +# endif +# else +# ifdef QUAD +# define strtol strtoll +# endif +# endif +# endif +#endif + +/* If QUAD is defined, we are defining `strtoll' or `strtoull', + operating on `long long int's. */ +#ifdef QUAD +# define LONG long long +# define STRTOL_LONG_MIN LONG_LONG_MIN +# define STRTOL_LONG_MAX LONG_LONG_MAX +# define STRTOL_ULONG_MAX ULONG_LONG_MAX + +/* The extra casts in the following macros work around compiler bugs, + e.g., in Cray C 5.0.3.0. */ + +/* True if negative values of the signed integer type T use two's + complement, ones' complement, or signed magnitude representation, + respectively. Much GNU code assumes two's complement, but some + people like to be portable to all possible C hosts. */ +# define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) +# define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) +# define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) + +/* True if the arithmetic type T is signed. */ +# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* The maximum and minimum values for the integer type T. These + macros have undefined behavior if T is signed and has padding bits. + If this is a problem for you, please let us know how to fix it for + your host. */ +# define TYPE_MINIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) 0 \ + : TYPE_SIGNED_MAGNITUDE (t) \ + ? ~ (t) 0 \ + : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) +# define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) + +# ifndef ULONG_LONG_MAX +# define ULONG_LONG_MAX TYPE_MAXIMUM (unsigned long long) +# endif +# ifndef LONG_LONG_MAX +# define LONG_LONG_MAX TYPE_MAXIMUM (long long int) +# endif +# ifndef LONG_LONG_MIN +# define LONG_LONG_MIN TYPE_MINIMUM (long long int) +# endif + +# if __GNUC__ == 2 && __GNUC_MINOR__ < 7 + /* Work around gcc bug with using this constant. */ + static const unsigned long long int maxquad = ULONG_LONG_MAX; +# undef STRTOL_ULONG_MAX +# define STRTOL_ULONG_MAX maxquad +# endif +#else +# define LONG long +# define STRTOL_LONG_MIN LONG_MIN +# define STRTOL_LONG_MAX LONG_MAX +# define STRTOL_ULONG_MAX ULONG_MAX +#endif + + +/* We use this code also for the extended locale handling where the + function gets as an additional argument the locale which has to be + used. To access the values we have to redefine the _NL_CURRENT + macro. */ +#ifdef USE_IN_EXTENDED_LOCALE_MODEL +# undef _NL_CURRENT +# define _NL_CURRENT(category, item) \ + (current->values[_NL_ITEM_INDEX (item)].string) +# define LOCALE_PARAM , loc +# define LOCALE_PARAM_PROTO , __locale_t loc +#else +# define LOCALE_PARAM +# define LOCALE_PARAM_PROTO +#endif + +#include + +#ifdef USE_WIDE_CHAR +# include +# define L_(Ch) L##Ch +# define UCHAR_TYPE wint_t +# define STRING_TYPE wchar_t +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define ISSPACE(Ch) __iswspace_l ((Ch), loc) +# define ISALPHA(Ch) __iswalpha_l ((Ch), loc) +# define TOUPPER(Ch) __towupper_l ((Ch), loc) +# else +# define ISSPACE(Ch) iswspace (Ch) +# define ISALPHA(Ch) iswalpha (Ch) +# define TOUPPER(Ch) towupper (Ch) +# endif +#else +# define L_(Ch) Ch +# define UCHAR_TYPE unsigned char +# define STRING_TYPE char +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define ISSPACE(Ch) __isspace_l ((Ch), loc) +# define ISALPHA(Ch) __isalpha_l ((Ch), loc) +# define TOUPPER(Ch) __toupper_l ((Ch), loc) +# else +# define ISSPACE(Ch) isspace (Ch) +# define ISALPHA(Ch) isalpha (Ch) +# define TOUPPER(Ch) toupper (Ch) +# endif +#endif + +#define INTERNAL(X) INTERNAL1(X) +#define INTERNAL1(X) __##X##_internal +#define WEAKNAME(X) WEAKNAME1(X) + +#ifdef USE_NUMBER_GROUPING +/* This file defines a function to check for correct grouping. */ +# include "grouping.h" +#endif + + + +/* Convert NPTR to an `unsigned long int' or `long int' in base BASE. + If BASE is 0 the base is determined by the presence of a leading + zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. + If BASE is < 2 or > 36, it is reset to 10. + If ENDPTR is not NULL, a pointer to the character after the last + one converted is stored in *ENDPTR. */ + +INT +INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr, + int base, int group LOCALE_PARAM_PROTO) +{ + int negative; + register unsigned LONG int cutoff; + register unsigned int cutlim; + register unsigned LONG int i; + register const STRING_TYPE *s; + register UCHAR_TYPE c; + const STRING_TYPE *save, *end; + int overflow; + +#ifdef USE_NUMBER_GROUPING +# ifdef USE_IN_EXTENDED_LOCALE_MODEL + struct locale_data *current = loc->__locales[LC_NUMERIC]; +# endif + /* The thousands character of the current locale. */ + wchar_t thousands = L'\0'; + /* The numeric grouping specification of the current locale, + in the format described in . */ + const char *grouping; + + if (group) + { + grouping = _NL_CURRENT (LC_NUMERIC, GROUPING); + if (*grouping <= 0 || *grouping == CHAR_MAX) + grouping = NULL; + else + { + /* Figure out the thousands separator character. */ +# if defined _LIBC || defined _HAVE_BTOWC + thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); + if (thousands == WEOF) + thousands = L'\0'; +# endif + if (thousands == L'\0') + grouping = NULL; + } + } + else + grouping = NULL; +#endif + + if (base < 0 || base == 1 || base > 36) + { + __set_errno (EINVAL); + return 0; + } + + save = s = nptr; + + /* Skip white space. */ + while (ISSPACE (*s)) + ++s; + if (*s == L_('\0')) + goto noconv; + + /* Check for a sign. */ + if (*s == L_('-')) + { + negative = 1; + ++s; + } + else if (*s == L_('+')) + { + negative = 0; + ++s; + } + else + negative = 0; + + /* Recognize number prefix and if BASE is zero, figure it out ourselves. */ + if (*s == L_('0')) + { + if ((base == 0 || base == 16) && TOUPPER (s[1]) == L_('X')) + { + s += 2; + base = 16; + } + else if (base == 0) + base = 8; + } + else if (base == 0) + base = 10; + + /* Save the pointer so we can check later if anything happened. */ + save = s; + +#ifdef USE_NUMBER_GROUPING + if (group) + { + /* Find the end of the digit string and check its grouping. */ + end = s; + for (c = *end; c != L_('\0'); c = *++end) + if ((wchar_t) c != thousands + && ((wchar_t) c < L_('0') || (wchar_t) c > L_('9')) + && (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base)) + break; + if (*s == thousands) + end = s; + else + end = correctly_grouped_prefix (s, end, thousands, grouping); + } + else +#endif + end = NULL; + + cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base; + cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base; + + overflow = 0; + i = 0; + for (c = *s; c != L_('\0'); c = *++s) + { + if (s == end) + break; + if (c >= L_('0') && c <= L_('9')) + c -= L_('0'); + else if (ISALPHA (c)) + c = TOUPPER (c) - L_('A') + 10; + else + break; + if ((int) c >= base) + break; + /* Check for overflow. */ + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + i *= (unsigned LONG int) base; + i += c; + } + } + + /* Check if anything actually happened. */ + if (s == save) + goto noconv; + + /* Store in ENDPTR the address of one character + past the last character we converted. */ + if (endptr != NULL) + *endptr = (STRING_TYPE *) s; + +#if !UNSIGNED + /* Check for a value that is within the range of + `unsigned LONG int', but outside the range of `LONG int'. */ + if (overflow == 0 + && i > (negative + ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1 + : (unsigned LONG int) STRTOL_LONG_MAX)) + overflow = 1; +#endif + + if (overflow) + { + __set_errno (ERANGE); +#if UNSIGNED + return STRTOL_ULONG_MAX; +#else + return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX; +#endif + } + + /* Return the result of the appropriate sign. */ + return negative ? -i : i; + +noconv: + /* We must handle a special case here: the base is 0 or 16 and the + first two characters are '0' and 'x', but the rest are no + hexadecimal digits. This is no error case. We return 0 and + ENDPTR points to the `x`. */ + if (endptr != NULL) + { + if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X') + && save[-2] == L_('0')) + *endptr = (STRING_TYPE *) &save[-1]; + else + /* There was no number to convert. */ + *endptr = (STRING_TYPE *) nptr; + } + + return 0L; +} + +/* External user entry point. */ + + +INT +#ifdef weak_function +weak_function +#endif +strtol (const STRING_TYPE *nptr, STRING_TYPE **endptr, + int base LOCALE_PARAM_PROTO) +{ + return INTERNAL (strtol) (nptr, endptr, base, 0 LOCALE_PARAM); +} diff --git a/lib/sys_stat_.h b/lib/sys_stat_.h new file mode 100644 index 0000000..13333d3 --- /dev/null +++ b/lib/sys_stat_.h @@ -0,0 +1,284 @@ +/* Provide a more complete sys/stat header file. + 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. */ + +/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */ + +/* 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. */ + +#ifndef _GL_SYS_STAT_H + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_SYS_STAT_H@ +#endif + +#ifndef _GL_SYS_STAT_H +#define _GL_SYS_STAT_H + +#ifndef S_IFMT +# define S_IFMT 0170000 +#endif + +#if STAT_MACROS_BROKEN +# undef S_ISBLK +# undef S_ISCHR +# undef S_ISDIR +# undef S_ISFIFO +# undef S_ISLNK +# undef S_ISNAM +# undef S_ISMPB +# undef S_ISMPC +# undef S_ISNWK +# undef S_ISREG +# undef S_ISSOCK +#endif + +#ifndef S_ISBLK +# ifdef S_IFBLK +# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +# else +# define S_ISBLK(m) 0 +# endif +#endif + +#ifndef S_ISCHR +# ifdef S_IFCHR +# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +# else +# define S_ISCHR(m) 0 +# endif +#endif + +#ifndef S_ISDIR +# ifdef S_IFDIR +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# else +# define S_ISDIR(m) 0 +# endif +#endif + +#ifndef S_ISDOOR /* Solaris 2.5 and up */ +# define S_ISDOOR(m) 0 +#endif + +#ifndef S_ISFIFO +# ifdef S_IFIFO +# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +# else +# define S_ISFIFO(m) 0 +# endif +#endif + +#ifndef S_ISLNK +# ifdef S_IFLNK +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +# else +# define S_ISLNK(m) 0 +# endif +#endif + +#ifndef S_ISMPB /* V7 */ +# ifdef S_IFMPB +# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) +# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) +# else +# define S_ISMPB(m) 0 +# define S_ISMPC(m) 0 +# endif +#endif + +#ifndef S_ISNAM /* Xenix */ +# ifdef S_IFNAM +# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) +# else +# define S_ISNAM(m) 0 +# endif +#endif + +#ifndef S_ISNWK /* HP/UX */ +# ifdef S_IFNWK +# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) +# else +# define S_ISNWK(m) 0 +# endif +#endif + +#ifndef S_ISPORT /* Solaris 10 and up */ +# define S_ISPORT(m) 0 +#endif + +#ifndef S_ISREG +# ifdef S_IFREG +# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +# else +# define S_ISREG(m) 0 +# endif +#endif + +#ifndef S_ISSOCK +# ifdef S_IFSOCK +# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +# else +# define S_ISSOCK(m) 0 +# endif +#endif + + +#ifndef S_TYPEISMQ +# define S_TYPEISMQ(p) 0 +#endif + +#ifndef S_TYPEISTMO +# define S_TYPEISTMO(p) 0 +#endif + + +#ifndef S_TYPEISSEM +# ifdef S_INSEM +# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM) +# else +# define S_TYPEISSEM(p) 0 +# endif +#endif + +#ifndef S_TYPEISSHM +# ifdef S_INSHD +# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD) +# else +# define S_TYPEISSHM(p) 0 +# endif +#endif + +/* high performance ("contiguous data") */ +#ifndef S_ISCTG +# define S_ISCTG(p) 0 +#endif + +/* Cray DMF (data migration facility): off line, with data */ +#ifndef S_ISOFD +# define S_ISOFD(p) 0 +#endif + +/* Cray DMF (data migration facility): off line, with no data */ +#ifndef S_ISOFL +# define S_ISOFL(p) 0 +#endif + +/* 4.4BSD whiteout */ +#ifndef S_ISWHT +# define S_ISWHT(m) 0 +#endif + +/* If any of the following are undefined, + define them to their de facto standard values. */ +#if !S_ISUID +# define S_ISUID 04000 +#endif +#if !S_ISGID +# define S_ISGID 02000 +#endif + +/* S_ISVTX is a common extension to POSIX. */ +#ifndef S_ISVTX +# define S_ISVTX 01000 +#endif + +#if !S_IRUSR && S_IREAD +# define S_IRUSR S_IREAD +#endif +#if !S_IRUSR +# define S_IRUSR 00400 +#endif +#if !S_IRGRP +# define S_IRGRP (S_IRUSR >> 3) +#endif +#if !S_IROTH +# define S_IROTH (S_IRUSR >> 6) +#endif + +#if !S_IWUSR && S_IWRITE +# define S_IWUSR S_IWRITE +#endif +#if !S_IWUSR +# define S_IWUSR 00200 +#endif +#if !S_IWGRP +# define S_IWGRP (S_IWUSR >> 3) +#endif +#if !S_IWOTH +# define S_IWOTH (S_IWUSR >> 6) +#endif + +#if !S_IXUSR && S_IEXEC +# define S_IXUSR S_IEXEC +#endif +#if !S_IXUSR +# define S_IXUSR 00100 +#endif +#if !S_IXGRP +# define S_IXGRP (S_IXUSR >> 3) +#endif +#if !S_IXOTH +# define S_IXOTH (S_IXUSR >> 6) +#endif + +#if !S_IRWXU +# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) +#endif +#if !S_IRWXG +# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) +#endif +#if !S_IRWXO +# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) +#endif + +/* S_IXUGO is a common extension to POSIX. */ +#if !S_IXUGO +# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) +#endif + +#ifndef S_IRWXUGO +# 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 +#endif + +/* 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 + +static inline int +rpl_mkdir (char const *name, mode_t mode) +{ + return _mkdir (name); +} + +# define mkdir rpl_mkdir +#endif + +#endif /* _GL_SYS_STAT_H */ +#endif /* _GL_SYS_STAT_H */ diff --git a/lib/sys_time_.h b/lib/sys_time_.h new file mode 100644 index 0000000..253316f --- /dev/null +++ b/lib/sys_time_.h @@ -0,0 +1,52 @@ +/* Provide a more complete sys/time.h. + + 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 Paul Eggert. */ + +#ifndef _GL_SYS_TIME_H + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_SYS_TIME_H@ +# if @HAVE_INCLUDE_NEXT@ +# include_next +# else +# include @ABSOLUTE_SYS_TIME_H@ +# endif +#else +# include +#endif + +#ifndef _GL_SYS_TIME_H +#define _GL_SYS_TIME_H + +#if ! @HAVE_STRUCT_TIMEVAL@ +struct timeval +{ + time_t tv_sec; + long int tv_usec; +}; +#endif + +#if @REPLACE_GETTIMEOFDAY@ +# undef gettimeofday +# define gettimeofday rpl_gettimeofday +int gettimeofday (struct timeval *restrict, void *restrict); +#endif + +#endif /* _GL_SYS_TIME_H */ +#endif /* _GL_SYS_TIME_H */ diff --git a/lib/sysexits_.h b/lib/sysexits_.h new file mode 100644 index 0000000..ba12aa2 --- /dev/null +++ b/lib/sysexits_.h @@ -0,0 +1,72 @@ +/* exit() exit codes for some BSD system programs. + 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) + any 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 based on sysexits(3) man page */ + +#ifndef _GL_SYSEXITS_H + +#if @HAVE_SYSEXITS_H@ + +/* IRIX 6.5 has an that defines a macro EX_OK with a nonzero + value. Override it. See + */ +# ifdef __sgi +# include +# undef EX_OK +# endif + +/* The include_next requires a split double-inclusion guard. */ +# if @HAVE_INCLUDE_NEXT@ +# include_next +# else +# include @ABSOLUTE_SYSEXITS_H@ +# endif + +/* HP-UX 11 ends at EX_NOPERM. */ +# ifndef EX_CONFIG +# define EX_CONFIG 78 +# endif + +#endif + +#ifndef _GL_SYSEXITS_H +#define _GL_SYSEXITS_H + +#if !@HAVE_SYSEXITS_H@ + +# define EX_OK 0 /* same value as EXIT_SUCCESS */ + +# define EX_USAGE 64 +# define EX_DATAERR 65 +# define EX_NOINPUT 66 +# define EX_NOUSER 67 +# define EX_NOHOST 68 +# define EX_UNAVAILABLE 69 +# define EX_SOFTWARE 70 +# define EX_OSERR 71 +# define EX_OSFILE 72 +# define EX_CANTCREAT 73 +# define EX_IOERR 74 +# define EX_TEMPFAIL 75 +# define EX_PROTOCOL 76 +# define EX_NOPERM 77 +# define EX_CONFIG 78 + +#endif + +#endif /* _GL_SYSEXITS_H */ +#endif /* _GL_SYSEXITS_H */ diff --git a/lib/system-ioctl.h b/lib/system-ioctl.h new file mode 100644 index 0000000..a61c5fd --- /dev/null +++ b/lib/system-ioctl.h @@ -0,0 +1,55 @@ +/* System dependent definitions for GNU tar's use of ioctl macros. + + Copyright (C) 1994, 1995, 1996, 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 + it under the 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 a real challenge to properly get MTIO* symbols :-(. ISC uses + . SCO and BSDi uses ; BSDi also requires + and for defining tp_dev and tpr_t. It + seems that the rest use , which itself requires other files, + depending on systems. Pyramid defines _IOW in , for example. */ + +#if HAVE_SYS_GENTAPE_H +# include +#else +# if HAVE_SYS_TAPE_H +# if HAVE_SYS_DEVICE_H +# include +# endif +# if HAVE_SYS_PARAM_H +# include +# endif +# if HAVE_SYS_BUF_H +# include +# endif +# if HAVE_SYS_TPRINTF_H +# include +# endif +# include +# else +# if HAVE_SYS_MTIO_H +# include +# if HAVE_SGTTY_H +# include +# endif +# if HAVE_SYS_IO_TRIOCTL_H +# include +# endif +# include +# endif +# endif +#endif diff --git a/lib/system.h b/lib/system.h new file mode 100644 index 0000000..7602263 --- /dev/null +++ b/lib/system.h @@ -0,0 +1,475 @@ +/* System dependent definitions for GNU tar. + + Copyright (C) 1994, 1995, 1996, 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 + it under the 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_CONFIG_H +# include +#endif + +#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 +#endif + +#include +#include + +/* IN_CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given + as an argument to macros like `isspace'. */ +#if STDC_HEADERS +# define IN_CTYPE_DOMAIN(c) 1 +#else +# define IN_CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) +#endif + +#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) +#define ISODIGIT(c) ((unsigned) (c) - '0' <= 7) +#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c)) +#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c)) + +/* Declare string and memory handling routines. Take care that an ANSI + string.h and pre-ANSI memory.h might conflict, and that memory.h and + strings.h conflict on some systems. */ + +#if STDC_HEADERS || HAVE_STRING_H +# include +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +#else +# include +# ifndef strchr +# define strchr index +# endif +# ifndef strrchr +# define strrchr rindex +# endif +# ifndef memcpy +# define memcpy(d, s, n) bcopy ((char const *) (s), (char *) (d), n) +# endif +# ifndef memcmp +# define memcmp(a, b, n) bcmp ((char const *) (a), (char const *) (b), n) +# endif +#endif + +/* Declare errno. */ + +#include +#ifndef errno +extern int errno; +#endif + +/* Declare open parameters. */ + +#if HAVE_FCNTL_H +# include +#else +# include +#endif + /* Pick only one of the next three: */ +#ifndef O_RDONLY +# define O_RDONLY 0 /* only allow read */ +#endif +#ifndef O_WRONLY +# define O_WRONLY 1 /* only allow write */ +#endif +#ifndef O_RDWR +# define O_RDWR 2 /* both are allowed */ +#endif +#ifndef O_ACCMODE +# define O_ACCMODE (O_RDONLY | O_RDWR | O_WRONLY) +#endif + /* The rest can be OR-ed in to the above: */ +#ifndef O_CREAT +# define O_CREAT 8 /* create file if needed */ +#endif +#ifndef O_EXCL +# define O_EXCL 16 /* file cannot already exist */ +#endif +#ifndef O_TRUNC +# define O_TRUNC 32 /* truncate file on open */ +#endif + +#ifndef O_BINARY +# define O_BINARY 0 +#endif +#ifndef O_DIRECTORY +# define O_DIRECTORY 0 +#endif +#ifndef O_NOATIME +# define O_NOATIME 0 +#endif +#ifndef O_NONBLOCK +# define O_NONBLOCK 0 +#endif + +/* Declare file status routines and bits. */ + +#include + +#if !HAVE_LSTAT && !defined lstat +# define lstat stat +#endif + +#if STX_HIDDEN && !_LARGE_FILES /* AIX */ +# ifdef stat +# undef stat +# endif +# define stat(file_name, buf) statx (file_name, buf, STATSIZE, STX_HIDDEN) +# ifdef lstat +# undef lstat +# endif +# define lstat(file_name, buf) statx (file_name, buf, STATSIZE, STX_HIDDEN | STX_LINK) +#endif + +#if STAT_MACROS_BROKEN +# undef S_ISBLK +# undef S_ISCHR +# undef S_ISCTG +# undef S_ISDIR +# undef S_ISFIFO +# undef S_ISLNK +# undef S_ISREG +# undef S_ISSOCK +#endif + +/* On MSDOS, there are missing things from . */ +#if MSDOS +# define S_ISUID 0 +# define S_ISGID 0 +# define S_ISVTX 0 +#endif + +#ifndef S_ISDIR +# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +#endif +#ifndef S_ISREG +# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) +#endif + +#ifndef S_ISBLK +# ifdef S_IFBLK +# define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK) +# else +# define S_ISBLK(mode) 0 +# endif +#endif +#ifndef S_ISCHR +# ifdef S_IFCHR +# define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR) +# else +# define S_ISCHR(mode) 0 +# endif +#endif +#ifndef S_ISCTG +# ifdef S_IFCTG +# define S_ISCTG(mode) (((mode) & S_IFMT) == S_IFCTG) +# else +# define S_ISCTG(mode) 0 +# endif +#endif +#ifndef S_ISDOOR +# define S_ISDOOR(mode) 0 +#endif +#ifndef S_ISFIFO +# ifdef S_IFIFO +# define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO) +# else +# define S_ISFIFO(mode) 0 +# endif +#endif +#ifndef S_ISLNK +# ifdef S_IFLNK +# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) +# else +# define S_ISLNK(mode) 0 +# endif +#endif +#ifndef S_ISSOCK +# ifdef S_IFSOCK +# define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK) +# else +# define S_ISSOCK(mode) 0 +# endif +#endif + +#if !HAVE_MKFIFO && !defined mkfifo && defined S_IFIFO +# define mkfifo(file_name, mode) (mknod (file_name, (mode) | S_IFIFO, 0)) +#endif + +#ifndef S_ISUID +# define S_ISUID 0004000 +#endif +#ifndef S_ISGID +# define S_ISGID 0002000 +#endif +#ifndef S_ISVTX +# define S_ISVTX 0001000 +#endif +#ifndef S_IRUSR +# define S_IRUSR 0000400 +#endif +#ifndef S_IWUSR +# define S_IWUSR 0000200 +#endif +#ifndef S_IXUSR +# define S_IXUSR 0000100 +#endif +#ifndef S_IRGRP +# define S_IRGRP 0000040 +#endif +#ifndef S_IWGRP +# define S_IWGRP 0000020 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0000010 +#endif +#ifndef S_IROTH +# define S_IROTH 0000004 +#endif +#ifndef S_IWOTH +# define S_IWOTH 0000002 +#endif +#ifndef S_IXOTH +# define S_IXOTH 0000001 +#endif + +#define MODE_WXUSR (S_IWUSR | S_IXUSR) +#define MODE_R (S_IRUSR | S_IRGRP | S_IROTH) +#define MODE_RW (S_IWUSR | S_IWGRP | S_IWOTH | MODE_R) +#define MODE_RWX (S_IXUSR | S_IXGRP | S_IXOTH | MODE_RW) +#define MODE_ALL (S_ISUID | S_ISGID | S_ISVTX | MODE_RWX) + +/* Include before any preprocessor test of _POSIX_VERSION. */ +#include + +#ifndef SEEK_SET +# define SEEK_SET 0 +#endif +#ifndef SEEK_CUR +# define SEEK_CUR 1 +#endif +#ifndef SEEK_END +# define SEEK_END 2 +#endif + +#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 make device, major and minor. Since major is a function on + SVR4, we have to resort to GOT_MAJOR instead of just testing if + major is #define'd. */ + +#if MAJOR_IN_MKDEV +# include +# if !defined(makedev) && defined(mkdev) +# define makedev(a,b) mkdev((a),(b)) +# endif +# define GOT_MAJOR +#endif + +#if MAJOR_IN_SYSMACROS +# include +# define GOT_MAJOR +#endif + +/* Some defines the macros. */ +#ifdef major +# define GOT_MAJOR +#endif + +#ifndef GOT_MAJOR +# if MSDOS +# define major(device) (device) +# define minor(device) (device) +# define makedev(major, minor) (((major) << 8) | (minor)) +# define GOT_MAJOR +# endif +#endif + +/* For HP-UX before HP-UX 8, major/minor are not in . */ +#ifndef GOT_MAJOR +# if defined(hpux) || defined(__hpux__) || defined(__hpux) +# include +# define GOT_MAJOR +# endif +#endif + +#ifndef GOT_MAJOR +# define major(device) (((device) >> 8) & 0xff) +# define minor(device) ((device) & 0xff) +# define makedev(major, minor) (((major) << 8) | (minor)) +#endif + +#undef GOT_MAJOR + +/* Declare wait status. */ + +#if HAVE_SYS_WAIT_H +# include +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(s) (((s) >> 8) & 0xff) +#endif +#ifndef WIFSIGNALED +# define WIFSIGNALED(s) (((s) & 0xffff) - 1 < (unsigned) 0xff) +#endif +#ifndef WTERMSIG +# define WTERMSIG(s) ((s) & 0x7f) +#endif + +/* FIXME: It is wrong to use BLOCKSIZE for buffers when the logical block + size is greater than 512 bytes; so ST_BLKSIZE code below, in preparation + for some cleanup in this area, later. */ + +/* Extract or fake data from a `struct stat'. ST_BLKSIZE gives the + optimal I/O blocksize for the file, in bytes. Some systems, like + Sequents, return st_blksize of 0 on pipes. */ + +#define DEFAULT_ST_BLKSIZE 512 + +#if !HAVE_ST_BLKSIZE +# define ST_BLKSIZE(statbuf) DEFAULT_ST_BLKSIZE +#else +# define ST_BLKSIZE(statbuf) \ + ((statbuf).st_blksize > 0 ? (statbuf).st_blksize : DEFAULT_ST_BLKSIZE) +#endif + +/* Extract or fake data from a `struct stat'. ST_NBLOCKS gives the + number of ST_NBLOCKSIZE-byte blocks in the file (including indirect blocks). + HP-UX counts st_blocks in 1024-byte units, + this loses when mixing HP-UX and BSD filesystems with NFS. AIX PS/2 + counts st_blocks in 4K units. */ + +#if !HAVE_ST_BLOCKS +# if defined(_POSIX_SOURCE) || !defined(BSIZE) +# define ST_NBLOCKS(statbuf) ((statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0)) +# else + off_t st_blocks (); +# define ST_NBLOCKS(statbuf) (st_blocks ((statbuf).st_size)) +# endif +#else +# define ST_NBLOCKS(statbuf) ((statbuf).st_blocks) +# if defined(hpux) || defined(__hpux__) || defined(__hpux) +# define ST_NBLOCKSIZE 1024 +# else +# if defined(_AIX) && defined(_I386) +# define ST_NBLOCKSIZE (4 * 1024) +# endif +# endif +#endif + +#ifndef ST_NBLOCKSIZE +# define ST_NBLOCKSIZE 512 +#endif + +#define ST_IS_SPARSE(st) \ + (ST_NBLOCKS (st) \ + < ((st).st_size / ST_NBLOCKSIZE + ((st).st_size % ST_NBLOCKSIZE != 0))) + +/* Declare standard functions. */ + +#if STDC_HEADERS +# include +#else +void *malloc (); +char *getenv (); +#endif + +#include +#include + +#include +#if !defined _POSIX_VERSION && MSDOS +# include +#endif + +#if WITH_DMALLOC +# define DMALLOC_FUNC_CHECK +# include +#endif + +#include + +#ifndef MB_LEN_MAX +# define MB_LEN_MAX 1 +#endif + +#include + +#include + +#define UINTMAX_STRSIZE_BOUND INT_BUFSIZE_BOUND (uintmax_t) + +/* Prototypes for external functions. */ + +#if HAVE_LOCALE_H +# include +#endif +#if !HAVE_SETLOCALE +# define setlocale(category, locale) /* empty */ +#endif + +#include +#ifdef TIME_WITH_SYS_TIME +# include +#endif + +/* Library modules. */ + +#include +#include +#include +#include +#include + +#include +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + +#if MSDOS +# include +# define SET_BINARY_MODE(arc) setmode(arc, O_BINARY) +# define ERRNO_IS_EACCES errno == EACCES +# define mkdir(file, mode) (mkdir) (file) +# define TTY_NAME "con" +# define sys_reset_uid_gid() +#else +# include +# include +# define SET_BINARY_MODE(arc) +# define ERRNO_IS_EACCES 0 +# define TTY_NAME "/dev/tty" +# define sys_reset_uid_gid() \ + do { setuid (getuid ()); setgid (getgid ()); } while (0) +#endif + +#if XENIX +# include +#endif diff --git a/lib/time_.h b/lib/time_.h new file mode 100644 index 0000000..9a0507e --- /dev/null +++ b/lib/time_.h @@ -0,0 +1,125 @@ +/* A more-standard . + + 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. */ + +/* 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 + +# if @HAVE_INCLUDE_NEXT@ +# include_next +# else +# include @ABSOLUTE_TIME_H@ +# endif + +#else +/* Normal invocation convention. */ + +# if ! defined _GL_TIME_H + +/* The include_next requires a split double-inclusion guard. */ +# if @HAVE_INCLUDE_NEXT@ +# include_next +# else +# include @ABSOLUTE_TIME_H@ +# endif + +# if ! defined _GL_TIME_H +# define _GL_TIME_H + +# ifdef __cplusplus +extern "C" { +# endif + +/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3). + Or they define it with the wrong member names or define it in + (e.g., FreeBSD circa 1997). */ +# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@ +# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +# include +# else +# undef timespec +# define timespec rpl_timespec +struct timespec +{ + time_t tv_sec; + long int tv_nsec; +}; +# endif +# endif + +/* Sleep for at least RQTP seconds unless interrupted, If interrupted, + return -1 and store the remaining time into RMTP. See + . */ +# if @REPLACE_NANOSLEEP@ +# define nanosleep rpl_nanosleep +int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp); +# endif + +/* Convert TIMER to RESULT, assuming local time and UTC respectively. See + and + . */ +# if @REPLACE_LOCALTIME_R@ +# undef localtime_r +# define localtime_r rpl_localtime_r +# undef gmtime_r +# define gmtime_r rpl_gmtime_r +struct tm *localtime_r (time_t const *restrict __timer, + struct tm *restrict __result); +struct tm *gmtime_r (time_t const *restrict __timer, + struct tm *restrict __result); +# endif + +/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store + the resulting broken-down time into TM. See + . */ +# if @REPLACE_STRPTIME@ +# undef strptime +# define strptime rpl_strptime +char *strptime (char const *restrict __buf, char const *restrict __format, + struct tm *restrict __tm); +# endif + +/* Convert TM to a time_t value, assuming UTC. */ +# if @REPLACE_TIMEGM@ +# undef timegm +# define timegm rpl_timegm +time_t timegm (struct tm *__tm); +# endif + +/* Encourage applications to avoid unsafe functions that can overrun + buffers when given outlandish struct tm values. Portable + applications should use strftime (or even sprintf) instead. */ +# if GNULIB_PORTCHECK +# undef asctime +# define asctime eschew_asctime +# undef asctime_r +# define asctime_r eschew_asctime_r +# undef ctime +# define ctime eschew_ctime +# undef ctime_r +# define ctime_r eschew_ctime_r +# endif + +# ifdef __cplusplus +} +# endif + +# endif /* _GL_TIME_H */ +# endif /* _GL_TIME_H */ +#endif diff --git a/lib/time_r.c b/lib/time_r.c new file mode 100644 index 0000000..2b72692 --- /dev/null +++ b/lib/time_r.c @@ -0,0 +1,47 @@ +/* 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) + any 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 + +#include + +static struct tm * +copy_tm_result (struct tm *dest, struct tm const *src) +{ + if (! src) + return 0; + *dest = *src; + return dest; +} + + +struct tm * +gmtime_r (time_t const * restrict t, struct tm * restrict tp) +{ + return copy_tm_result (tp, gmtime (t)); +} + +struct tm * +localtime_r (time_t const * restrict t, struct tm * restrict tp) +{ + return copy_tm_result (tp, localtime (t)); +} diff --git a/lib/timespec.h b/lib/timespec.h new file mode 100644 index 0000000..cce2d66 --- /dev/null +++ b/lib/timespec.h @@ -0,0 +1,37 @@ +/* timespec -- System time interface + + Copyright (C) 2000, 2002, 2004, 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) + any 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 TIMESPEC_H +# define TIMESPEC_H + +# include + +/* Return negative, zero, positive if A < B, A == B, A > B, respectively. + Assume the nanosecond components are in range, or close to it. */ +static inline int +timespec_cmp (struct timespec a, struct timespec b) +{ + return (a.tv_sec < b.tv_sec ? -1 + : a.tv_sec > b.tv_sec ? 1 + : a.tv_nsec - b.tv_nsec); +} + +void gettime (struct timespec *); +int settime (struct timespec const *); + +#endif diff --git a/lib/uinttostr.c b/lib/uinttostr.c new file mode 100644 index 0000000..52d288e --- /dev/null +++ b/lib/uinttostr.c @@ -0,0 +1,3 @@ +#define inttostr uinttostr +#define inttype unsigned int +#include "inttostr.c" diff --git a/lib/umaxtostr.c b/lib/umaxtostr.c new file mode 100644 index 0000000..4f49a7f --- /dev/null +++ b/lib/umaxtostr.c @@ -0,0 +1,3 @@ +#define inttostr umaxtostr +#define inttype uintmax_t +#include "inttostr.c" diff --git a/lib/unistd--.h b/lib/unistd--.h new file mode 100644 index 0000000..1fe6ce8 --- /dev/null +++ b/lib/unistd--.h @@ -0,0 +1,28 @@ +/* Like unistd.h, but redefine some names to avoid glitches. + + 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 "unistd-safer.h" + +#undef dup +#define dup dup_safer + +#undef pipe +#define pipe pipe_safer diff --git a/lib/unistd-safer.h b/lib/unistd-safer.h new file mode 100644 index 0000000..f95999d --- /dev/null +++ b/lib/unistd-safer.h @@ -0,0 +1,23 @@ +/* Invoke unistd-like functions, but avoid some glitches. + + Copyright (C) 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) + any 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. */ + +int dup_safer (int); +int fd_safer (int); +int pipe_safer (int[2]); diff --git a/lib/unistd_.h b/lib/unistd_.h new file mode 100644 index 0000000..f34bc66 --- /dev/null +++ b/lib/unistd_.h @@ -0,0 +1,242 @@ +/* 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 + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_UNISTD_H@ +# if @HAVE_INCLUDE_NEXT@ +# include_next +# else +# include @ABSOLUTE_UNISTD_H@ +# endif +#endif + +#ifndef _GL_UNISTD_H +#define _GL_UNISTD_H + +/* mingw doesn't define the SEEK_* macros in . */ +#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) +# include +#endif + +/* mingw fails to declare _exit in . */ +#include + +/* 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_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 + + +#ifdef __cplusplus +} +#endif + + +#endif /* _GL_UNISTD_H */ +#endif /* _GL_UNISTD_H */ diff --git a/lib/unlocked-io.h b/lib/unlocked-io.h new file mode 100644 index 0000000..d009303 --- /dev/null +++ b/lib/unlocked-io.h @@ -0,0 +1,137 @@ +/* Prefer faster, non-thread-safe stdio functions if available. + + Copyright (C) 2001, 2002, 2003, 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. */ + +#ifndef UNLOCKED_IO_H +# define UNLOCKED_IO_H 1 + +/* These are wrappers for functions/macros from the GNU C library, and + from other C libraries supporting POSIX's optional thread-safe functions. + + The standard I/O functions are thread-safe. These *_unlocked ones are + more efficient but not thread-safe. That they're not thread-safe is + fine since all of the applications in this package are single threaded. + + Also, some code that is shared with the GNU C library may invoke + the *_unlocked functions directly. On hosts that lack those + functions, invoke the non-thread-safe versions instead. */ + +# include + +# if HAVE_DECL_CLEARERR_UNLOCKED +# undef clearerr +# define clearerr(x) clearerr_unlocked (x) +# else +# define clearerr_unlocked(x) clearerr (x) +# endif + +# if HAVE_DECL_FEOF_UNLOCKED +# undef feof +# define feof(x) feof_unlocked (x) +# else +# define feof_unlocked(x) feof (x) +# endif + +# if HAVE_DECL_FERROR_UNLOCKED +# undef ferror +# define ferror(x) ferror_unlocked (x) +# else +# define ferror_unlocked(x) ferror (x) +# endif + +# if HAVE_DECL_FFLUSH_UNLOCKED +# undef fflush +# define fflush(x) fflush_unlocked (x) +# else +# define fflush_unlocked(x) fflush (x) +# endif + +# if HAVE_DECL_FGETS_UNLOCKED +# undef fgets +# define fgets(x,y,z) fgets_unlocked (x,y,z) +# else +# define fgets_unlocked(x,y,z) fgets (x,y,z) +# endif + +# if HAVE_DECL_FPUTC_UNLOCKED +# undef fputc +# define fputc(x,y) fputc_unlocked (x,y) +# else +# define fputc_unlocked(x,y) fputc (x,y) +# endif + +# if HAVE_DECL_FPUTS_UNLOCKED +# undef fputs +# define fputs(x,y) fputs_unlocked (x,y) +# else +# define fputs_unlocked(x,y) fputs (x,y) +# endif + +# if HAVE_DECL_FREAD_UNLOCKED +# undef fread +# define fread(w,x,y,z) fread_unlocked (w,x,y,z) +# else +# define fread_unlocked(w,x,y,z) fread (w,x,y,z) +# endif + +# if HAVE_DECL_FWRITE_UNLOCKED +# undef fwrite +# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z) +# else +# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z) +# endif + +# if HAVE_DECL_GETC_UNLOCKED +# undef getc +# define getc(x) getc_unlocked (x) +# else +# define getc_unlocked(x) getc (x) +# endif + +# if HAVE_DECL_GETCHAR_UNLOCKED +# undef getchar +# define getchar() getchar_unlocked () +# else +# define getchar_unlocked() getchar () +# endif + +# if HAVE_DECL_PUTC_UNLOCKED +# undef putc +# define putc(x,y) putc_unlocked (x,y) +# else +# define putc_unlocked(x,y) putc (x,y) +# endif + +# if HAVE_DECL_PUTCHAR_UNLOCKED +# undef putchar +# define putchar(x) putchar_unlocked (x) +# else +# define putchar_unlocked(x) putchar (x) +# endif + +# undef flockfile +# define flockfile(x) ((void) 0) + +# undef ftrylockfile +# define ftrylockfile(x) 0 + +# undef funlockfile +# define funlockfile(x) ((void) 0) + +#endif /* UNLOCKED_IO_H */ diff --git a/lib/unsetenv.c b/lib/unsetenv.c new file mode 100644 index 0000000..0f83744 --- /dev/null +++ b/lib/unsetenv.c @@ -0,0 +1,92 @@ +/* Copyright (C) 1992,1995-1999,2000-2002,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) + any 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 !_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 +/* This lock protects against simultaneous modifications of `environ'. */ +# include +__libc_lock_define_initialized (static, envlock) +# define LOCK __libc_lock_lock (envlock) +# define UNLOCK __libc_lock_unlock (envlock) +#else +# define LOCK +# define UNLOCK +#endif + +/* In the GNU C library we must keep the namespace clean. */ +#ifdef _LIBC +# define unsetenv __unsetenv +#endif + + +int +unsetenv (const char *name) +{ + size_t len; + char **ep; + + if (name == NULL || *name == '\0' || strchr (name, '=') != NULL) + { + __set_errno (EINVAL); + return -1; + } + + len = strlen (name); + + LOCK; + + ep = __environ; + while (*ep != NULL) + if (!strncmp (*ep, name, len) && (*ep)[len] == '=') + { + /* Found it. Remove this pointer by moving later ones back. */ + char **dp = ep; + + do + dp[0] = dp[1]; + while (*dp++); + /* Continue the loop in case NAME appears again. */ + } + else + ++ep; + + UNLOCK; + + return 0; +} + +#ifdef _LIBC +# undef unsetenv +weak_alias (__unsetenv, unsetenv) +#endif diff --git a/lib/utimens.c b/lib/utimens.c new file mode 100644 index 0000000..7e3175a --- /dev/null +++ b/lib/utimens.c @@ -0,0 +1,189 @@ +/* Set file access and modification times. + + Copyright (C) 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) any + 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. */ + +/* derived from a function in touch.c */ + +#include + +#include "utimens.h" + +#include +#include +#include +#include + +#if HAVE_UTIME_H +# include +#endif + +/* Some systems (even some that do have ) don't declare this + structure anywhere. */ +#ifndef HAVE_STRUCT_UTIMBUF +struct utimbuf +{ + long actime; + long modtime; +}; +#endif + +/* Some systems don't have ENOSYS. */ +#ifndef ENOSYS +# ifdef ENOTSUP +# define ENOSYS ENOTSUP +# else +/* Some systems don't have ENOTSUP either. */ +# define ENOSYS EINVAL +# endif +#endif + +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# define __attribute__(x) +# endif +#endif + +#ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + +/* Set the access and modification time stamps of FD (a.k.a. FILE) to be + TIMESPEC[0] and TIMESPEC[1], respectively. + FD must be either negative -- in which case it is ignored -- + or a file descriptor that is open on FILE. + If FD is nonnegative, then FILE can be NULL, which means + use just futimes (or equivalent) instead of utimes (or equivalent), + and fail if on an old system without futimes (or equivalent). + If TIMESPEC is null, set the time stamps to the current time. + Return 0 on success, -1 (setting errno) on failure. */ + +int +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 + configure-time test for this, but please see + for references to + some of the problems with Linux 2.6.16. If this affects you, + compile with -DHAVE_BUGGY_NFS_TIME_STAMPS; this is reported to + help in some cases, albeit at a cost in performance. But you + really should upgrade your kernel to a fixed version, since the + problem affects many applications. */ + +#if HAVE_BUGGY_NFS_TIME_STAMPS + if (fd < 0) + sync (); + else + 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; + + + 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 + + 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 +} + +/* Set the access and modification time stamps of FILE to be + TIMESPEC[0] and TIMESPEC[1], respectively. */ +int +utimens (char const *file, struct timespec const timespec[2]) +{ + return gl_futimens (-1, file, timespec); +} diff --git a/lib/utimens.h b/lib/utimens.h new file mode 100644 index 0000000..169521d --- /dev/null +++ b/lib/utimens.h @@ -0,0 +1,3 @@ +#include +int gl_futimens (int, char const *, struct timespec const [2]); +int utimens (char const *, struct timespec const [2]); diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c new file mode 100644 index 0000000..c60888c --- /dev/null +++ b/lib/vasnprintf.c @@ -0,0 +1,3193 @@ +/* vsprintf with automatic memory allocation. + Copyright (C) 1999, 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 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. */ + +/* 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. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#include +#ifndef IN_LIBINTL +# include +#endif + +/* Specification. */ +#if WIDE_CHAR_VERSION +# include "vasnwprintf.h" +#else +# include "vasnprintf.h" +#endif + +#include /* localeconv() */ +#include /* snprintf(), sprintf() */ +#include /* abort(), malloc(), realloc(), free() */ +#include /* memcpy(), strlen() */ +#include /* errno */ +#include /* CHAR_BIT */ +#include /* DBL_MAX_EXP, LDBL_MAX_EXP */ +#if HAVE_NL_LANGINFO +# include +#endif +#if WIDE_CHAR_VERSION +# include "wprintf-parse.h" +#else +# include "printf-parse.h" +#endif + +/* Checked size_t computations. */ +#include "xsize.h" + +#if NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL +# include +# include "float+.h" +#endif + +#if NEED_PRINTF_INFINITE_DOUBLE && !defined IN_LIBINTL +# include +# include "isnan.h" +#endif + +#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !defined IN_LIBINTL +# include +# include "isnanl-nolibm.h" +#endif + +#if NEED_PRINTF_DIRECTIVE_A && !defined IN_LIBINTL +# include +# include "isnan.h" +# include "printf-frexp.h" +# include "isnanl-nolibm.h" +# include "printf-frexpl.h" +# include "fpucw.h" +#endif + +/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ +#ifndef EOVERFLOW +# define EOVERFLOW E2BIG +#endif + +#if HAVE_WCHAR_T +# if HAVE_WCSLEN +# define local_wcslen wcslen +# else + /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid + a dependency towards this library, here is a local substitute. + Define this substitute only once, even if this file is included + twice in the same compilation unit. */ +# ifndef local_wcslen_defined +# define local_wcslen_defined 1 +static size_t +local_wcslen (const wchar_t *s) +{ + const wchar_t *ptr; + + for (ptr = s; *ptr != (wchar_t) 0; ptr++) + ; + return ptr - s; +} +# endif +# 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 +# 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 +# /* 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. */ +# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ +# 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 + +#if NEED_PRINTF_DIRECTIVE_A && !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 && !defined IN_LIBINTL + +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ +static int +is_infinite_or_zero (double x) +{ + return isnan (x) || x + x == x; +} + +#endif + +#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !defined IN_LIBINTL + +/* Equivalent to !isfinite(x), but does not require libm. */ +static int +is_infinitel (long double x) +{ + return isnanl (x) || (x + x == x && x != 0.0L); +} + +#endif + +#if NEED_PRINTF_LONG_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-(hightest 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; +} + +/* 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 (!(y == 0.0L)) + abort (); + /* Normalise. */ + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) + m.nlimbs--; + *mp = m; + *ep = exp - LDBL_MANT_BIT; + return m.limbs; +} + +/* 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; + mpn_t m; + void *memory = decode_long_double (x, &e, &m); + 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; + *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; +} + +/* 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; + /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ... + Four terms are enough to get an approximation with error < 10^-7. */ + l -= 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 + +CHAR_T * +VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args) +{ + DIRECTIVES d; + arguments a; + + if (PRINTF_PARSE (format, &d, &a) < 0) + { + errno = EINVAL; + return NULL; + } + +#define CLEANUP() \ + free (d.dir); \ + if (a.arg) \ + free (a.arg); + + if (printf_fetchargs (args, &a) < 0) + { + CLEANUP (); + errno = EINVAL; + return NULL; + } + + { + size_t buf_neededlength; + CHAR_T *buf; + CHAR_T *buf_malloced; + const CHAR_T *cp; + size_t i; + DIRECTIVE *dp; + /* Output string accumulator. */ + CHAR_T *result; + size_t allocated; + size_t length; + + /* Allocate a small buffer that will hold a directive passed to + sprintf or snprintf. */ + buf_neededlength = + xsum4 (7, d.max_width_length, d.max_precision_length, 6); +#if HAVE_ALLOCA + if (buf_neededlength < 4000 / sizeof (CHAR_T)) + { + buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T)); + buf_malloced = NULL; + } + else +#endif + { + size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T)); + if (size_overflow_p (buf_memsize)) + goto out_of_memory_1; + buf = (CHAR_T *) malloc (buf_memsize); + if (buf == NULL) + goto out_of_memory_1; + buf_malloced = buf; + } + + if (resultbuf != NULL) + { + result = resultbuf; + allocated = *lengthp; + } + else + { + result = NULL; + allocated = 0; + } + length = 0; + /* Invariants: + result is either == resultbuf or == NULL or malloc-allocated. + If length > 0, then result != NULL. */ + + /* 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; \ + \ + allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ + if ((needed) > allocated) \ + allocated = (needed); \ + memory_size = xtimes (allocated, sizeof (CHAR_T)); \ + if (size_overflow_p (memory_size)) \ + goto out_of_memory; \ + if (result == resultbuf || result == NULL) \ + memory = (CHAR_T *) malloc (memory_size); \ + else \ + memory = (CHAR_T *) realloc (result, memory_size); \ + if (memory == NULL) \ + goto out_of_memory; \ + if (result == resultbuf && length > 0) \ + memcpy (memory, result, length * sizeof (CHAR_T)); \ + 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 (augmented_length); + memcpy (result + length, cp, n * sizeof (CHAR_T)); + length = augmented_length; + } + if (i == d.count) + break; + + /* Execute a single directive. */ + if (dp->conversion == '%') + { + size_t augmented_length; + + if (!(dp->arg_index == ARG_NONE)) + abort (); + augmented_length = xsum (length, 1); + ENSURE_ALLOCATION (augmented_length); + result[length] = '%'; + length = augmented_length; + } + else + { + if (!(dp->arg_index != ARG_NONE)) + abort (); + + if (dp->conversion == 'n') + { + switch (a.arg[dp->arg_index].type) + { + case TYPE_COUNT_SCHAR_POINTER: + *a.arg[dp->arg_index].a.a_count_schar_pointer = length; + break; + case TYPE_COUNT_SHORT_POINTER: + *a.arg[dp->arg_index].a.a_count_short_pointer = length; + break; + case TYPE_COUNT_INT_POINTER: + *a.arg[dp->arg_index].a.a_count_int_pointer = length; + break; + case TYPE_COUNT_LONGINT_POINTER: + *a.arg[dp->arg_index].a.a_count_longint_pointer = length; + break; +#if HAVE_LONG_LONG_INT + case TYPE_COUNT_LONGLONGINT_POINTER: + *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; + break; +#endif + default: + abort (); + } + } +#if (NEED_PRINTF_INFINITE_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') + && (0 +# if 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. */ + && is_infinitel (a.arg[dp->arg_index].a.a_longdouble)) +# endif + )) + { +# if 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; + CHAR_T tmpbuf[700]; + CHAR_T *tmp; + CHAR_T *pad_ptr; + CHAR_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 CHAR_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 CHAR_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. */ + if (!has_precision) + precision = 6; + + /* Allocate a temporary buffer of sufficient size. */ +# if 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; +# else + tmp_length = 0; +# endif + if (tmp_length < precision) + tmp_length = precision; +# if NEED_PRINTF_LONG_DOUBLE +# if 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 + /* 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 (CHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (CHAR_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_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. */ + *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); + } +# else + sprintf (p, "%+.2d", exponent); +# endif + while (*p != '\0') + p++; + } + 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. */ + + /* 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); + } +# else + sprintf (p, "%+.2d", exponent); +# endif + while (*p != '\0') + p++; + } + + free (digits); + } + } + else + abort (); +# else + /* arg is finite. */ + abort (); +# endif + } + + END_LONG_DOUBLE_ROUNDING (); + } + } +# if NEED_PRINTF_INFINITE_DOUBLE + else +# endif +# endif +# if NEED_PRINTF_INFINITE_DOUBLE + { + /* Simpler than above: handle only NaN, Infinity, zero. */ + double arg = a.arg[dp->arg_index].a.a_double; + + if (isnan (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.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.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 (!(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 + + /* 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); + CHAR_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. */ + CHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + CHAR_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 (CHAR_T)); + if (tmp != tmpbuf) + free (tmp); + length += count; + } + } +#endif +#if NEED_PRINTF_DIRECTIVE_A && !defined IN_LIBINTL + else if (dp->conversion == 'a' || dp->conversion == 'A') + { + 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; + CHAR_T tmpbuf[700]; + CHAR_T *tmp; + CHAR_T *pad_ptr; + CHAR_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 CHAR_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 CHAR_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 (CHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (CHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } + + pad_ptr = NULL; + p = tmp; + if (type == TYPE_LONGDOUBLE) + { + 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); + } +# else + sprintf (p, "%+d", exponent); +# endif + while (*p != '\0') + p++; + } + + END_LONG_DOUBLE_ROUNDING (); + } + } + else + { + double arg = a.arg[dp->arg_index].a.a_double; + + if (isnan (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); + } +# else + sprintf (p, "%+d", exponent); +# endif + while (*p != '\0') + p++; + } + } + } + /* 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); + CHAR_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. */ + CHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + CHAR_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 (CHAR_T)); + if (tmp != tmpbuf) + free (tmp); + length += count; + } + } +#endif + else + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; +#if !USE_SNPRINTF || NEED_PRINTF_FLAG_ZERO + int has_width; + size_t width; +#endif +#if NEED_PRINTF_FLAG_ZERO + int pad_ourselves; +#else +# define pad_ourselves 0 +#endif + CHAR_T *fbp; + unsigned int prefix_count; + int prefixes[2]; +#if !USE_SNPRINTF + size_t tmp_length; + CHAR_T tmpbuf[700]; + CHAR_T *tmp; +#endif + +#if !USE_SNPRINTF || NEED_PRINTF_FLAG_ZERO + 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 CHAR_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 + /* Allocate a temporary buffer of sufficient size for calling + sprintf. */ + { + size_t precision; + + 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) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + } + } + + switch (dp->conversion) + { + + case 'd': case 'i': case 'u': +# if HAVE_LONG_LONG_INT + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + ) + + 1; /* turn floor into ceil */ + else +# endif + if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + ) + + 1; /* turn floor into ceil */ + 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 = xsum (tmp_length, 1); + break; + + case 'o': +# if HAVE_LONG_LONG_INT + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1; /* turn floor into ceil */ + else +# endif + if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Add 1, to account for a leading sign. */ + tmp_length = xsum (tmp_length, 1); + break; + + case 'x': case 'X': +# if HAVE_LONG_LONG_INT + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else +# endif + if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Add 2, to account for a leading sign or alternate form. */ + tmp_length = xsum (tmp_length, 2); + break; + + case 'f': case 'F': + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) (LDBL_MAX_EXP + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 10; /* sign, decimal point etc. */ + else + tmp_length = + (unsigned int) (DBL_MAX_EXP + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 10; /* sign, decimal point etc. */ + 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 = xsum (tmp_length, precision); + break; + + case 'a': case 'A': + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) (LDBL_DIG + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (DBL_DIG + * 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); + break; + + case 'c': +# if HAVE_WINT_T && !WIDE_CHAR_VERSION + if (type == TYPE_WIDE_CHAR) + tmp_length = MB_CUR_MAX; + else +# endif + tmp_length = 1; + break; + + case 's': +# 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 + tmp_length = xtimes (tmp_length, MB_CUR_MAX); +# endif + } + else +# endif + tmp_length = strlen (a.arg[dp->arg_index].a.a_string); + break; + + case 'p': + tmp_length = + (unsigned int) (sizeof (void *) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1 /* turn floor into ceil */ + + 2; /* account for leading 0x */ + break; + + default: + abort (); + } + + if (tmp_length < width) + tmp_length = width; + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + } + + if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (CHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } +#endif + + /* Decide whether to perform the padding ourselves. */ +#if NEED_PRINTF_FLAG_ZERO + switch (dp->conversion) + { + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': + case 'a': case 'A': + pad_ourselves = 1; + break; + default: + pad_ourselves = 0; + break; + } +#endif + + /* Construct the format string for calling snprintf or + sprintf. */ + 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) + { + if (flags & FLAG_ZERO) + *fbp++ = '0'; + if (dp->width_start != dp->width_end) + { + size_t n = dp->width_end - dp->width_start; + memcpy (fbp, dp->width_start, n * sizeof (CHAR_T)); + fbp += n; + } + } + if (dp->precision_start != dp->precision_end) + { + size_t n = dp->precision_end - dp->precision_start; + memcpy (fbp, dp->precision_start, n * sizeof (CHAR_T)); + fbp += n; + } + + switch (type) + { +#if HAVE_LONG_LONG_INT + case TYPE_LONGLONGINT: + case TYPE_ULONGLONGINT: +# 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: +#if HAVE_WINT_T + case TYPE_WIDE_CHAR: +#endif +#if HAVE_WCHAR_T + case TYPE_WIDE_STRING: +#endif + *fbp++ = 'l'; + break; + case TYPE_LONGDOUBLE: + *fbp++ = 'L'; + break; + default: + break; + } +#if NEED_PRINTF_DIRECTIVE_F + if (dp->conversion == 'F') + *fbp = 'f'; + else +#endif + *fbp = dp->conversion; +#if USE_SNPRINTF + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0'; +#else + fbp[1] = '\0'; +#endif + + /* Construct the arguments for calling snprintf or sprintf. */ + prefix_count = 0; + 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 (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; + } + +#if USE_SNPRINTF + /* Prepare checking whether snprintf returns the count + via %n. */ + ENSURE_ALLOCATION (xsum (length, 1)); + result[length] = '\0'; +#endif + + for (;;) + { + size_t maxlen; + int count; + int retcount; + + maxlen = allocated - length; + count = -1; + retcount = 0; + +#if USE_SNPRINTF + /* SNPRINTF can fail if maxlen > INT_MAX. */ + if (maxlen > INT_MAX) + goto overflow; +# define SNPRINTF_BUF(arg) \ + switch (prefix_count) \ + { \ + case 0: \ + retcount = SNPRINTF (result + length, maxlen, buf, \ + arg, &count); \ + break; \ + case 1: \ + retcount = SNPRINTF (result + length, maxlen, buf, \ + prefixes[0], arg, &count); \ + break; \ + case 2: \ + retcount = SNPRINTF (result + length, maxlen, buf, \ + prefixes[0], prefixes[1], arg, \ + &count); \ + break; \ + default: \ + abort (); \ + } +#else +# define SNPRINTF_BUF(arg) \ + switch (prefix_count) \ + { \ + case 0: \ + count = sprintf (tmp, buf, arg); \ + break; \ + case 1: \ + count = sprintf (tmp, buf, prefixes[0], arg); \ + break; \ + case 2: \ + count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ + arg); \ + break; \ + default: \ + abort (); \ + } +#endif + + switch (type) + { + case TYPE_SCHAR: + { + int arg = a.arg[dp->arg_index].a.a_schar; + SNPRINTF_BUF (arg); + } + break; + case TYPE_UCHAR: + { + unsigned int arg = a.arg[dp->arg_index].a.a_uchar; + SNPRINTF_BUF (arg); + } + break; + case TYPE_SHORT: + { + int arg = a.arg[dp->arg_index].a.a_short; + SNPRINTF_BUF (arg); + } + break; + case TYPE_USHORT: + { + unsigned int arg = a.arg[dp->arg_index].a.a_ushort; + SNPRINTF_BUF (arg); + } + break; + case TYPE_INT: + { + int arg = a.arg[dp->arg_index].a.a_int; + SNPRINTF_BUF (arg); + } + break; + case TYPE_UINT: + { + unsigned int arg = a.arg[dp->arg_index].a.a_uint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_LONGINT: + { + long int arg = a.arg[dp->arg_index].a.a_longint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_ULONGINT: + { + unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; + SNPRINTF_BUF (arg); + } + break; +#if HAVE_LONG_LONG_INT + case TYPE_LONGLONGINT: + { + long long int arg = a.arg[dp->arg_index].a.a_longlongint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_ULONGLONGINT: + { + unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_DOUBLE: + { + double arg = a.arg[dp->arg_index].a.a_double; + SNPRINTF_BUF (arg); + } + break; + case TYPE_LONGDOUBLE: + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + SNPRINTF_BUF (arg); + } + break; + case TYPE_CHAR: + { + int arg = a.arg[dp->arg_index].a.a_char; + SNPRINTF_BUF (arg); + } + break; +#if HAVE_WINT_T + case TYPE_WIDE_CHAR: + { + wint_t arg = a.arg[dp->arg_index].a.a_wide_char; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_STRING: + { + const char *arg = a.arg[dp->arg_index].a.a_string; + SNPRINTF_BUF (arg); + } + break; +#if HAVE_WCHAR_T + case TYPE_WIDE_STRING: + { + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_POINTER: + { + void *arg = a.arg[dp->arg_index].a.a_pointer; + SNPRINTF_BUF (arg); + } + break; + default: + abort (); + } + +#if USE_SNPRINTF + /* Portability: Not all implementations of snprintf() + are ISO C 99 compliant. Determine the number of + bytes that snprintf() has produced or would have + produced. */ + if (count >= 0) + { + /* Verify that snprintf() has NUL-terminated its + result. */ + if (count < maxlen && result[length + count] != '\0') + abort (); + /* Portability hack. */ + if (retcount > count) + count = retcount; + } + else + { + /* snprintf() doesn't understand the '%n' + directive. */ + if (fbp[1] != '\0') + { + /* Don't use the '%n' directive; instead, look + at the snprintf() return value. */ + fbp[1] = '\0'; + continue; + } + else + { + /* Look at the snprintf() return value. */ + if (retcount < 0) + { + /* HP-UX 10.20 snprintf() is doubly deficient: + It doesn't understand the '%n' directive, + *and* it returns -1 (rather than the length + that would have been required) when the + buffer is too small. */ + size_t bigger_need = + xsum (xtimes (allocated, 2), 12); + ENSURE_ALLOCATION (bigger_need); + continue; + } + else + count = retcount; + } + } +#endif + + /* Attempt to handle failure. */ + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EINVAL; + return NULL; + } + + /* Make room for the result. */ + if (count >= maxlen) + { + /* Need at least count bytes. But allocate + proportionally, to avoid looping eternally if + snprintf() reports a too small count. */ + size_t n = + xmax (xsum (length, count), xtimes (allocated, 2)); + + ENSURE_ALLOCATION (n); +#if USE_SNPRINTF + continue; +#else + maxlen = allocated - length; +#endif + } + + /* Perform padding. */ +#if NEED_PRINTF_FLAG_ZERO + if (pad_ourselves && has_width && count < width) + { +# if USE_SNPRINTF + /* Make room for the result. */ + if (width >= maxlen) + { + /* Need at least width bytes. But allocate + proportionally, to avoid looping eternally if + snprintf() reports a too small count. */ + size_t n = + xmax (xsum (length + 1, width), + xtimes (allocated, 2)); + + length += count; + ENSURE_ALLOCATION (n); + length -= count; + maxlen = allocated - length; /* > width */ + } + /* Here width < maxlen. */ +# endif + { +# if USE_SNPRINTF + CHAR_T * const rp = result + length; +# else + CHAR_T * const rp = tmp; +# endif + CHAR_T *p = rp + count; + size_t pad = width - count; + CHAR_T *end = p + pad; + CHAR_T *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. */ + + 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. */ + CHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + CHAR_T *q = end; + + while (p > rp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + + count = width; /* = count + pad = end - rp */ + } + } +#endif + +#if !USE_SNPRINTF + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); +#endif + + /* Here still count < maxlen. */ + +#if USE_SNPRINTF + /* The snprintf() result did fit. */ +#else + /* Append the sprintf() result. */ + memcpy (result + length, tmp, count * sizeof (CHAR_T)); + if (tmp != tmpbuf) + free (tmp); +#endif + +#if NEED_PRINTF_DIRECTIVE_F + if (dp->conversion == 'F') + { + /* Convert the %f result to upper case for %F. */ + CHAR_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; + } + } + } + } + + /* Add the final NUL. */ + ENSURE_ALLOCATION (xsum (length, 1)); + result[length] = '\0'; + + if (result != resultbuf && length + 1 < allocated) + { + /* Shrink the allocated memory if possible. */ + CHAR_T *memory; + + memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T)); + if (memory != NULL) + result = memory; + } + + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + *lengthp = length; + /* 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; + + overflow: + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EOVERFLOW; + return NULL; + + out_of_memory: + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + out_of_memory_1: + CLEANUP (); + errno = ENOMEM; + return NULL; + } +} + +#undef SNPRINTF +#undef USE_SNPRINTF +#undef PRINTF_PARSE +#undef DIRECTIVES +#undef DIRECTIVE +#undef CHAR_T +#undef VASNPRINTF diff --git a/lib/vasnprintf.h b/lib/vasnprintf.h new file mode 100644 index 0000000..7a0c01f --- /dev/null +++ b/lib/vasnprintf.h @@ -0,0 +1,81 @@ +/* vsprintf with automatic memory allocation. + Copyright (C) 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. */ + +#ifndef _VASNPRINTF_H +#define _VASNPRINTF_H + +/* Get va_list. */ +#include + +/* Get size_t. */ +#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(). + You can pass a preallocated buffer for the result in RESULTBUF and its + size in *LENGTHP; otherwise you pass RESULTBUF = NULL. + If successful, return the address of the string (this may be = RESULTBUF + if no dynamic memory allocation was necessary) and set *LENGTHP to the + number of resulting bytes, excluding the trailing NUL. Upon error, set + errno and return NULL. + + When dynamic memory allocation occurs, the preallocated buffer is left + alone (with possibly modified contents). This makes it possible to use + a statically allocated or stack-allocated buffer, like this: + + char buf[100]; + size_t len = sizeof (buf); + char *output = vasnprintf (buf, &len, format, args); + if (output == NULL) + ... error handling ...; + else + { + ... use the output string ...; + if (output != buf) + free (output); + } + */ +#if REPLACE_VASNPRINTF +# define asnprintf rpl_asnprintf +# define vasnprintf rpl_vasnprintf +#endif +extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); +extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 3, 0))); + +#ifdef __cplusplus +} +#endif + +#endif /* _VASNPRINTF_H */ diff --git a/lib/verify.h b/lib/verify.h new file mode 100644 index 0000000..d603b17 --- /dev/null +++ b/lib/verify.h @@ -0,0 +1,141 @@ +/* Compile-time assert-like macros. + + Copyright (C) 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) + any 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, Bruno Haible, and Jim Meyering. */ + +#ifndef VERIFY_H +# define VERIFY_H 1 + +/* Each of these macros verifies that its argument R is nonzero. To + be portable, R should be an integer constant expression. Unlike + assert (R), there is no run-time overhead. + + There are two macros, since no single macro can be used in all + contexts in C. verify_true (R) is for scalar contexts, including + integer constant expression contexts. verify (R) is for declaration + contexts, e.g., the top level. + + Symbols ending in "__" are private to this header. + + The code below uses several ideas. + + * The first step is ((R) ? 1 : -1). Given an expression R, of + integral or boolean or floating-point type, this yields an + expression of integral type, whose value is later verified to be + constant and nonnegative. + + * Next this expression W is wrapped in a type + struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }. + If W is negative, this yields a compile-time error. No compiler can + deal with a bit-field of negative size. + + One might think that an array size check would have the same + effect, that is, that the type struct { unsigned int dummy[W]; } + would work as well. However, inside a function, some compilers + (such as C++ compilers and GNU C) allow local parameters and + variables inside array size expressions. With these compilers, + an array size check would not properly diagnose this misuse of + the verify macro: + + void function (int n) { verify (n < 0); } + + * For the verify macro, the struct verify_type__ will need to + somehow be embedded into a declaration. To be portable, this + declaration must declare an object, a constant, a function, or a + typedef name. If the declared entity uses the type directly, + such as in + + struct dummy {...}; + typedef struct {...} dummy; + extern struct {...} *dummy; + extern void dummy (struct {...} *); + extern struct {...} *dummy (void); + + two uses of the verify macro would yield colliding declarations + if the entity names are not disambiguated. A workaround is to + attach the current line number to the entity name: + + #define GL_CONCAT0(x, y) x##y + #define GL_CONCAT(x, y) GL_CONCAT0 (x, y) + extern struct {...} * GL_CONCAT(dummy,__LINE__); + + But this has the problem that two invocations of verify from + within the same macro would collide, since the __LINE__ value + would be the same for both invocations. + + A solution is to use the sizeof operator. It yields a number, + getting rid of the identity of the type. Declarations like + + extern int dummy [sizeof (struct {...})]; + extern void dummy (int [sizeof (struct {...})]); + extern int (*dummy (void)) [sizeof (struct {...})]; + + can be repeated. + + * Should the implementation use a named struct or an unnamed struct? + Which of the following alternatives can be used? + + extern int dummy [sizeof (struct {...})]; + extern int dummy [sizeof (struct verify_type__ {...})]; + extern void dummy (int [sizeof (struct {...})]); + extern void dummy (int [sizeof (struct verify_type__ {...})]); + extern int (*dummy (void)) [sizeof (struct {...})]; + extern int (*dummy (void)) [sizeof (struct verify_type__ {...})]; + + In the second and sixth case, the struct type is exported to the + outer scope; two such declarations therefore collide. GCC warns + about the first, third, and fourth cases. So the only remaining + possibility is the fifth case: + + extern int (*dummy (void)) [sizeof (struct {...})]; + + * This implementation exploits the fact that GCC does not warn about + the last declaration mentioned above. If a future version of GCC + introduces a warning for this, the problem could be worked around + by using code specialized to GCC, e.g.,: + + #if 4 <= __GNUC__ + # define verify(R) \ + extern int (* verify_function__ (void)) \ + [__builtin_constant_p (R) && (R) ? 1 : -1] + #endif + + * In C++, any struct definition inside sizeof is invalid. + Use a template type to work around the problem. */ + + +/* Verify requirement R at compile-time, as an integer constant expression. + Return 1. */ + +# ifdef __cplusplus +template + struct verify_type__ { unsigned int verify_error_if_negative_size__: w; }; +# define verify_true(R) \ + (!!sizeof (verify_type__<(R) ? 1 : -1>)) +# else +# define verify_true(R) \ + (!!sizeof \ + (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; })) +# endif + +/* Verify requirement R at compile-time, as a declaration without a + trailing ';'. */ + +# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)] + +#endif diff --git a/lib/version-etc-fsf.c b/lib/version-etc-fsf.c new file mode 100644 index 0000000..f25eb65 --- /dev/null +++ b/lib/version-etc-fsf.c @@ -0,0 +1,31 @@ +/* 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 + it under the 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 + +/* Specification. */ +#include "version-etc.h" + +/* Default copyright goes to the FSF. */ + +const char version_etc_copyright[] = + /* Do *not* mark this string for translation. %s is a copyright + symbol suitable for this locale, and %d is the copyright + year. */ + "Copyright %s %d Free Software Foundation, Inc."; diff --git a/lib/version-etc.c b/lib/version-etc.c new file mode 100644 index 0000000..1ae82c4 --- /dev/null +++ b/lib/version-etc.c @@ -0,0 +1,173 @@ +/* Utility to help print --version output in a consistent format. + Copyright (C) 1999-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 Jim Meyering. */ + +#include + +/* Specification. */ +#include "version-etc.h" + +#include +#include +#include + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +enum { COPYRIGHT_YEAR = 2007 }; + +/* Like version_etc, below, but with the NULL-terminated author list + provided via a variable of type va_list. */ +void +version_etc_va (FILE *stream, + const char *command_name, const char *package, + const char *version, va_list authors) +{ + size_t n_authors; + + /* Count the number of authors. */ + { + va_list tmp_authors; + + va_copy (tmp_authors, authors); + + n_authors = 0; + while (va_arg (tmp_authors, const char *) != NULL) + ++n_authors; + } + + if (command_name) + fprintf (stream, "%s (%s) %s\n", command_name, package, version); + else + fprintf (stream, "%s %s\n", package, version); + + /* TRANSLATORS: Translate "(C)" to the copyright symbol + (C-in-a-circle), if this symbol is available in the user's + locale. Otherwise, do not translate "(C)"; leave it as-is. */ + fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR); + + fputs (_("\ +\n\ +License GPLv2+: GNU GPL version 2 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\ +"), + stream); + + switch (n_authors) + { + case 0: + /* The caller must provide at least one author name. */ + abort (); + case 1: + /* TRANSLATORS: %s denotes an author name. */ + vfprintf (stream, _("Written by %s.\n"), authors); + break; + case 2: + /* TRANSLATORS: Each %s denotes an author name. */ + vfprintf (stream, _("Written by %s and %s.\n"), authors); + break; + case 3: + /* TRANSLATORS: Each %s denotes an author name. */ + vfprintf (stream, _("Written by %s, %s, and %s.\n"), authors); + break; + case 4: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("Written by %s, %s, %s,\nand %s.\n"), authors); + break; + case 5: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("Written by %s, %s, %s,\n%s, and %s.\n"), authors); + break; + case 6: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"), + authors); + break; + case 7: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"), + authors); + break; + case 8: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("\ +Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"), + authors); + break; + case 9: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("\ +Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"), + authors); + break; + default: + /* 10 or more authors. Use an abbreviation, since the human reader + will probably not want to read the entire list anyway. */ + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("\ +Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"), + authors); + break; + } + va_end (authors); +} + + +/* Display the --version information the standard way. + + If COMMAND_NAME is NULL, the PACKAGE is asumed to be the name of + the program. The formats are therefore: + + PACKAGE VERSION + + or + + COMMAND_NAME (PACKAGE) VERSION. + + The author names are passed as separate arguments, with an additional + NULL argument at the end. */ +void +version_etc (FILE *stream, + const char *command_name, const char *package, + const char *version, /* const char *author1, ...*/ ...) +{ + va_list authors; + + va_start (authors, version); + version_etc_va (stream, command_name, package, version, authors); +} diff --git a/lib/version-etc.h b/lib/version-etc.h new file mode 100644 index 0000000..84da535 --- /dev/null +++ b/lib/version-etc.h @@ -0,0 +1,37 @@ +/* Utility to help print --version output in a consistent format. + Copyright (C) 1999, 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) + any 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. */ + +#ifndef VERSION_ETC_H +# define VERSION_ETC_H 1 + +# include +# include + +extern const char version_etc_copyright[]; + +extern void version_etc_va (FILE *stream, + const char *command_name, const char *package, + const char *version, va_list authors); + +extern void version_etc (FILE *stream, + const char *command_name, const char *package, + const char *version, + /* const char *author1, ...*/ ...); + +#endif /* VERSION_ETC_H */ diff --git a/lib/vsnprintf.c b/lib/vsnprintf.c new file mode 100644 index 0000000..4f841fc --- /dev/null +++ b/lib/vsnprintf.c @@ -0,0 +1,76 @@ +/* Formatted output to strings. + Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc. + Written by Simon Josefsson and Yoann Vandoorselaere . + + This program is free software; you can redistribute it and/or modify + it under the 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. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* Specification. */ +#include + +#include +#include +#include +#include +#include + +#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 vsprintf, but + additional length SIZE limit how much is written into STR. Returns + string length of formatted string (which may be larger than SIZE). + STR may be NULL, in which case nothing will be written. On error, + return a negative value. */ +int +vsnprintf (char *str, size_t size, const char *format, va_list args) +{ + char *output; + size_t len; + size_t lenbuf = size; + + output = vasnprintf (str, &lenbuf, format, args); + len = lenbuf; + + if (!output) + return -1; + + if (output != str) + { + if (size) + { + size_t pruned_len = (len < size ? len : size - 1); + memcpy (str, output, pruned_len); + str[pruned_len] = '\0'; + } + + free (output); + } + + if (len > INT_MAX) + { + errno = EOVERFLOW; + return -1; + } + + return len; +} diff --git a/lib/wchar_.h b/lib/wchar_.h new file mode 100644 index 0000000..2a71b8b --- /dev/null +++ b/lib/wchar_.h @@ -0,0 +1,50 @@ +/* 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 + +/* 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 . */ +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_INCLUDE_NEXT@ +# include_next +#else +# include @ABSOLUTE_WCHAR_H@ +#endif + +#ifndef _GL_WCHAR_H +#define _GL_WCHAR_H + +#endif /* _GL_WCHAR_H */ +#endif /* _GL_WCHAR_H */ diff --git a/lib/wctype_.h b/lib/wctype_.h new file mode 100644 index 0000000..ebbfca4 --- /dev/null +++ b/lib/wctype_.h @@ -0,0 +1,165 @@ +/* A substitute for ISO C99 , for platforms that lack it. + + 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. */ + +/* Written by Bruno Haible and Paul Eggert. */ + +/* + * ISO C 99 for platforms that lack it. + * + * + * iswctype, towctrans, towlower, towupper, wctrans, wctype, + * wctrans_t, and wctype_t are not yet implemented. + */ + +#ifndef _GL_WCTYPE_H + +#if @HAVE_WINT_T@ +/* Solaris 2.5 has a bug: must be included before . + 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 +#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@ +# if @HAVE_INCLUDE_NEXT@ +# include_next +# else +# include @ABSOLUTE_WCTYPE_H@ +# endif +#endif + +#ifndef _GL_WCTYPE_H +#define _GL_WCTYPE_H + +#if @HAVE_WINT_T@ +typedef wint_t __wctype_wint_t; +#else +typedef int __wctype_wint_t; +#endif + +/* FreeBSD 4.4 to 4.11 has but lacks the functions. + Assume all 12 functions are implemented the same way, or not at all. */ +#if ! @HAVE_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 + refer to system functions like _iswctype that are not in the + standard C library. Rather than try to get ancient buggy + implementations like this to work, just disable them. */ +# undef iswalnum +# undef iswalpha +# undef iswblank +# undef iswcntrl +# undef iswdigit +# undef iswgraph +# undef iswlower +# undef iswprint +# undef iswpunct +# undef iswspace +# undef iswupper +# undef iswxdigit + +static inline int +iswalnum (__wctype_wint_t wc) +{ + return ((wc >= '0' && wc <= '9') + || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')); +} + +static inline int +iswalpha (__wctype_wint_t wc) +{ + return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'; +} + +static inline int +iswblank (__wctype_wint_t wc) +{ + return wc == ' ' || wc == '\t'; +} + +static inline int +iswcntrl (__wctype_wint_t wc) +{ + return (wc & ~0x1f) == 0 || wc == 0x7f; +} + +static inline int +iswdigit (__wctype_wint_t wc) +{ + return wc >= '0' && wc <= '9'; +} + +static inline int +iswgraph (__wctype_wint_t wc) +{ + return wc >= '!' && wc <= '~'; +} + +static inline int +iswlower (__wctype_wint_t wc) +{ + return wc >= 'a' && wc <= 'z'; +} + +static inline int +iswprint (__wctype_wint_t wc) +{ + return wc >= ' ' && wc <= '~'; +} + +static inline int +iswpunct (__wctype_wint_t wc) +{ + return (wc >= '!' && wc <= '~' + && !((wc >= '0' && wc <= '9') + || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'))); +} + +static inline int +iswspace (__wctype_wint_t wc) +{ + return (wc == ' ' || wc == '\t' + || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r'); +} + +static inline int +iswupper (__wctype_wint_t wc) +{ + return wc >= 'A' && wc <= 'Z'; +} + +static inline int +iswxdigit (__wctype_wint_t wc) +{ + return ((wc >= '0' && wc <= '9') + || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')); +} + +# endif /* ! HAVE_ISWCNTRL */ + +#endif /* _GL_WCTYPE_H */ +#endif /* _GL_WCTYPE_H */ diff --git a/lib/xalloc-die.c b/lib/xalloc-die.c new file mode 100644 index 0000000..090f060 --- /dev/null +++ b/lib/xalloc-die.c @@ -0,0 +1,42 @@ +/* Report a memory allocation failure and exit. + + 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 + it under the 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 + +#include "xalloc.h" + +#include + +#include "error.h" +#include "exitfail.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +void +xalloc_die (void) +{ + error (exit_failure, 0, "%s", _("memory exhausted")); + + /* The `noreturn' cannot be given to error, since it may return if + its first argument is 0. To help compilers understand the + xalloc_die does not return, call abort. Also, the abort is a + safety feature if exit_failure is 0 (which shouldn't happen). */ + abort (); +} diff --git a/lib/xalloc.h b/lib/xalloc.h new file mode 100644 index 0000000..0c6d8dc --- /dev/null +++ b/lib/xalloc.h @@ -0,0 +1,271 @@ +/* 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. + + This program is free software; you can redistribute it and/or modify + it under the 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 XALLOC_H_ +# define XALLOC_H_ + +# include + + +# ifdef __cplusplus +extern "C" { +# endif + + +# ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# define __attribute__(x) +# endif +# endif + +# ifndef ATTRIBUTE_NORETURN +# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +# 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 + function to call when one wants the program to die because of a + 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 *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); + +/* 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 + nonnegative. This is a macro, not an inline function, so that it + works correctly even when SIZE_MAX < N. + + By gnulib convention, SIZE_MAX represents overflow in size + calculations, so the conservative dividend to use here is + SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value. + However, malloc (SIZE_MAX) fails on all known hosts where + sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for + exactly-SIZE_MAX allocations on such hosts; this avoids a test and + branch when S is known to be 1. */ +# define xalloc_oversized(n, s) \ + ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n)) + + +/* In the following macros, T must be an elementary or structure/union or + typedef'ed type, or a pointer to such a type. To apply one of the + following macros to a function pointer or array type, you need to typedef + it first and use the typedef name. */ + +/* Allocate an object of type T dynamically, with error checking. */ +/* extern t *XMALLOC (typename t); */ +# define XMALLOC(t) ((t *) xmalloc (sizeof (t))) + +/* Allocate memory for N elements of type T, with error checking. */ +/* extern t *XNMALLOC (size_t n, typename t); */ +# define XNMALLOC(n, t) \ + ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t)))) + +/* Allocate an object of type T dynamically, with error checking, + and zero it. */ +/* extern t *XZALLOC (typename t); */ +# define XZALLOC(t) ((t *) xzalloc (sizeof (t))) + +/* Allocate memory for N elements of type T, with error checking, + and zero it. */ +/* extern t *XCALLOC (size_t n, typename t); */ +# define XCALLOC(n, t) \ + ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t)))) + + +# if HAVE_INLINE +# define static_inline static inline +# else + void *xnmalloc (size_t n, size_t s); + 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); +# endif + +# ifdef static_inline + +/* 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) +{ + if (xalloc_oversized (n, s)) + xalloc_die (); + return xmalloc (n * s); +} + +/* Change the size of an allocated block of memory P to an array of N + objects each of S bytes, with error checking. S must be nonzero. */ + +static_inline void * +xnrealloc (void *p, size_t n, size_t s) +{ + if (xalloc_oversized (n, s)) + xalloc_die (); + return xrealloc (p, n * s); +} + +/* If P is null, allocate a block of at least *PN such objects; + otherwise, reallocate P so that it contains more than *PN objects + each of S bytes. *PN must be nonzero unless P is null, and S must + be nonzero. Set *PN to the new number of objects, and return the + pointer to the new block. *PN is never set to zero, and the + returned pointer is never null. + + Repeated reallocations are guaranteed to make progress, either by + allocating an initial block with a nonzero size, or by allocating a + larger block. + + In the following implementation, nonzero sizes are increased by a + factor of approximately 1.5 so that repeated reallocations have + O(N) overall cost rather than O(N**2) cost, but the + specification for this function does not guarantee that rate. + + Here is an example of use: + + int *p = NULL; + size_t used = 0; + size_t allocated = 0; + + void + append_int (int value) + { + if (used == allocated) + p = x2nrealloc (p, &allocated, sizeof *p); + p[used++] = value; + } + + This causes x2nrealloc to allocate a block of some nonzero size the + first time it is called. + + To have finer-grained control over the initial size, set *PN to a + nonzero value before calling this function with P == NULL. For + example: + + int *p = NULL; + size_t used = 0; + size_t allocated = 0; + size_t allocated1 = 1000; + + void + append_int (int value) + { + if (used == allocated) + { + p = x2nrealloc (p, &allocated1, sizeof *p); + allocated = allocated1; + } + p[used++] = value; + } + + */ + +static_inline void * +x2nrealloc (void *p, size_t *pn, size_t s) +{ + size_t n = *pn; + + if (! p) + { + if (! n) + { + /* The approximate size to use for initial small allocation + requests, when the invoking code specifies an old size of + zero. 64 bytes is the largest "small" request for the + GNU C library malloc. */ + enum { DEFAULT_MXFAST = 64 }; + + n = DEFAULT_MXFAST / s; + n += !n; + } + } + else + { + /* Set N = ceil (1.5 * N) so that progress is made if N == 1. + Check for overflow, so that N * S stays in size_t range. + The check is slightly conservative, but an exact check isn't + worth the trouble. */ + if ((size_t) -1 / 3 * 2 / s <= n) + xalloc_die (); + n += (n + 1) / 2; + } + + *pn = n; + return xrealloc (p, n * 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) +{ + return XNMALLOC (n, char); +} + +# endif + +# ifdef __cplusplus +} + +/* C++ does not allow conversions from void * to other pointer types + without a cast. Use templates to work around the problem when + possible. */ + +template inline T * +xrealloc (T *p, size_t s) +{ + return (T *) xrealloc ((void *) p, s); +} + +template inline T * +xnrealloc (T *p, size_t n, size_t s) +{ + return (T *) xnrealloc ((void *) p, n, s); +} + +template inline T * +x2realloc (T *p, size_t *pn) +{ + return (T *) x2realloc ((void *) p, pn); +} + +template inline T * +x2nrealloc (T *p, size_t *pn, size_t s) +{ + return (T *) x2nrealloc ((void *) p, pn, s); +} + +template inline T * +xmemdup (T const *p, size_t s) +{ + return (T *) xmemdup ((void const *) p, s); +} + +# endif + + +#endif /* !XALLOC_H_ */ diff --git a/lib/xgetcwd.c b/lib/xgetcwd.c new file mode 100644 index 0000000..26ea5da --- /dev/null +++ b/lib/xgetcwd.c @@ -0,0 +1,41 @@ +/* xgetcwd.c -- return current directory with unlimited length + + Copyright (C) 2001, 2003, 2004, 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 Jim Meyering. */ + +#include + +#include "xgetcwd.h" + +#include +#include + +#include "xalloc.h" + +/* Return the current directory, newly allocated. + Upon an out-of-memory error, call xalloc_die. + Upon any other type of error, return NULL. */ + +char * +xgetcwd (void) +{ + char *cwd = getcwd (NULL, 0); + if (! cwd && errno == ENOMEM) + xalloc_die (); + return cwd; +} diff --git a/lib/xgetcwd.h b/lib/xgetcwd.h new file mode 100644 index 0000000..70afe35 --- /dev/null +++ b/lib/xgetcwd.h @@ -0,0 +1,18 @@ +/* prototype for xgetcwd + Copyright (C) 1995, 2001, 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. */ + +extern char *xgetcwd (void); diff --git a/lib/xmalloc.c b/lib/xmalloc.c new file mode 100644 index 0000000..318e0dd --- /dev/null +++ b/lib/xmalloc.c @@ -0,0 +1,123 @@ +/* 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, + 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 ! HAVE_INLINE +# define static_inline +#endif +#include "xalloc.h" +#undef static_inline + +#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. */ +#if defined HAVE_CALLOC || defined __GLIBC__ +enum { HAVE_GNU_CALLOC = 1 }; +#else +enum { HAVE_GNU_CALLOC = 0 }; +#endif + +/* Allocate N bytes of memory dynamically, with error checking. */ + +void * +xmalloc (size_t n) +{ + void *p = malloc (n); + if (!p && n != 0) + xalloc_die (); + return p; +} + +/* Change the size of an allocated block of memory P to N bytes, + with error checking. */ + +void * +xrealloc (void *p, size_t n) +{ + p = realloc (p, n); + if (!p && n != 0) + xalloc_die (); + return p; +} + +/* If P is null, allocate a block of at least *PN bytes; otherwise, + reallocate P so that it contains more than *PN bytes. *PN must be + nonzero unless P is null. Set *PN to the new block's size, and + return the pointer to the new block. *PN is never set to zero, and + the returned pointer is never null. */ + +void * +x2realloc (void *p, size_t *pn) +{ + return x2nrealloc (p, pn, 1); +} + +/* Allocate S bytes of zeroed memory dynamically, with error checking. + There's no need for xnzalloc (N, S), since it would be equivalent + to xcalloc (N, S). */ + +void * +xzalloc (size_t s) +{ + return memset (xmalloc (s), 0, s); +} + +/* Allocate zeroed memory for N elements of S bytes, with error + checking. S must be nonzero. */ + +void * +xcalloc (size_t n, size_t s) +{ + void *p; + /* Test for overflow, since some calloc implementations don't have + proper overflow checks. But omit overflow and size-zero tests if + HAVE_GNU_CALLOC, since GNU calloc catches overflow and never + returns NULL if successful. */ + if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s)) + || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0))) + xalloc_die (); + return p; +} + +/* Clone an object P of size S, with error checking. There's no need + for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any + need for an arithmetic overflow check. */ + +void * +xmemdup (void const *p, size_t s) +{ + return memcpy (xmalloc (s), p, s); +} + +/* Clone STRING. */ + +char * +xstrdup (char const *string) +{ + return xmemdup (string, strlen (string) + 1); +} diff --git a/lib/xsize.h b/lib/xsize.h new file mode 100644 index 0000000..341fb16 --- /dev/null +++ b/lib/xsize.h @@ -0,0 +1,108 @@ +/* xsize.h -- Checked size_t computations. + + Copyright (C) 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 _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 tupe 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/lib/xstrndup.c b/lib/xstrndup.c new file mode 100644 index 0000000..7ccefd7 --- /dev/null +++ b/lib/xstrndup.c @@ -0,0 +1,37 @@ +/* Duplicate a bounded initial segment of a string, with out-of-memory + checking. + 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) + any 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 "xstrndup.h" + +#include +#include "xalloc.h" + +/* Return a newly allocated copy of at most N bytes of STRING. + In other words, return a copy of the initial segment of length N of + STRING. */ +char * +xstrndup (const char *string, size_t n) +{ + char *s = strndup (string, n); + if (! s) + xalloc_die (); + return s; +} diff --git a/lib/xstrndup.h b/lib/xstrndup.h new file mode 100644 index 0000000..88354cf --- /dev/null +++ b/lib/xstrndup.h @@ -0,0 +1,24 @@ +/* Duplicate a bounded initial segment of a string, with out-of-memory + checking. + Copyright (C) 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. */ + +#include + +/* Return a newly allocated copy of at most N bytes of STRING. + In other words, return a copy of the initial segment of length N of + STRING. */ +extern char *xstrndup (const char *string, size_t n); diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4 new file mode 100644 index 0000000..c649df0 --- /dev/null +++ b/m4/absolute-header.m4 @@ -0,0 +1,44 @@ +# absolute-header.m4 serial 6 +dnl Copyright (C) 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Derek Price. + +# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...) +# --------------------------------------- +# Find the absolute name of a header file, assuming the header exists. +# If the header were sys/inttypes.h, this macro would define +# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of sys/inttypes.h +# in config.h +# (e.g. `#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"'). +# The three "///" are to pacify Sun C 5.8, which otherwise would say +# "warning: #include of /usr/include/... may be non-portable". +# Use `""', not `<>', so that the /// cannot be confused with a C99 comment. +AC_DEFUN([gl_ABSOLUTE_HEADER], +[AC_LANG_PREPROC_REQUIRE()dnl +AC_FOREACH([gl_HEADER_NAME], [$1], + [AS_VAR_PUSHDEF([gl_absolute_header], + [gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl + AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>], + m4_quote(m4_defn([gl_absolute_header])), + [AS_VAR_PUSHDEF([ac_header_exists], + [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl + AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl + if test AS_VAR_GET(ac_header_exists) = yes; then + AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])]) +dnl eval is necessary to expand ac_cpp. +dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. + AS_VAR_SET(gl_absolute_header, +[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | +sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#;s#^/[^/]#//&#;p;q;}'`]) + fi + AS_VAR_POPDEF([ac_header_exists])dnl + ])dnl + AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))), + ["AS_VAR_GET(gl_absolute_header)"], + [Define this to an absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.]) + AS_VAR_POPDEF([gl_absolute_header])dnl +])dnl +])# gl_ABSOLUTE_HEADER diff --git a/m4/alloca.m4 b/m4/alloca.m4 new file mode 100644 index 0000000..eb62e0e --- /dev/null +++ b/m4/alloca.m4 @@ -0,0 +1,50 @@ +# alloca.m4 serial 7 +dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_ALLOCA], +[ + dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. + AC_REQUIRE([AC_PROG_CPP]) + AC_REQUIRE([AC_PROG_EGREP]) + + AC_REQUIRE([AC_FUNC_ALLOCA]) + if test $ac_cv_func_alloca_works = no; then + gl_PREREQ_ALLOCA + fi + + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [ + AC_EGREP_CPP([Need own alloca], [ +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif + ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no]) + ]) + if test $gl_cv_rpl_alloca = yes; then + dnl OK, alloca can be implemented through a compiler built-in. + AC_DEFINE([HAVE_ALLOCA], 1, + [Define to 1 if you have 'alloca' after including , + a header that may be supplied by this distribution.]) + ALLOCA_H=alloca.h + else + dnl alloca exists as a library function, i.e. it is slow and probably + dnl a memory leak. Don't define HAVE_ALLOCA in this case. + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + AC_SUBST([ALLOCA_H]) + + AC_DEFINE(HAVE_ALLOCA_H, 1, + [Define HAVE_ALLOCA_H for backward compatibility with older code + that includes only if HAVE_ALLOCA_H is defined.]) +]) + +# Prerequisites of lib/alloca.c. +# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. +AC_DEFUN([gl_PREREQ_ALLOCA], [:]) diff --git a/m4/allocsa.m4 b/m4/allocsa.m4 new file mode 100644 index 0000000..5f51c98 --- /dev/null +++ b/m4/allocsa.m4 @@ -0,0 +1,14 @@ +# allocsa.m4 serial 7 +dnl Copyright (C) 2003-2004, 2006-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_ALLOCSA], +[ + dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables + dnl @ALLOCA@ and @LTALLOCA@. + dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies. + AC_REQUIRE([gl_EEMALLOC]) + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) +]) diff --git a/m4/argmatch.m4 b/m4/argmatch.m4 new file mode 100644 index 0000000..beda5a1 --- /dev/null +++ b/m4/argmatch.m4 @@ -0,0 +1,10 @@ +#serial 3 +dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_ARGMATCH], +[ + AC_LIBOBJ([argmatch]) +]) diff --git a/m4/argp.m4 b/m4/argp.m4 new file mode 100644 index 0000000..77f1510 --- /dev/null +++ b/m4/argp.m4 @@ -0,0 +1,65 @@ +# argp.m4 serial 8 +dnl Copyright (C) 2003-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_ARGP], +[ + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + dnl argp-parse.c depends on GNU getopt internals, therefore use GNU getopt + dnl always. + gl_GETOPT_SUBSTITUTE + dnl Note: gl_GETOPT_SUBSTITUTE does AC_LIBOBJ(getopt), AC_LIBOBJ(getopt1). + + AC_CHECK_DECL([program_invocation_name], + [AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_NAME, 1, + [Define if program_invocation_name is declared])], + [AC_DEFINE(GNULIB_PROGRAM_INVOCATION_NAME, 1, + [Define to 1 to add extern declaration of program_invocation_name to argp.h])], + [#include ]) + AC_CHECK_DECL([program_invocation_short_name], + [AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME, 1, + [Define if program_invocation_short_name is declared])], + [AC_DEFINE(GNULIB_PROGRAM_INVOCATION_SHORT_NAME, 1, + [Define to 1 to add extern declaration of program_invocation_short_name to argp.h])], + [#include ]) + + # Check if program_invocation_name and program_invocation_short_name + # are defined elsewhere. It is improbable that only one of them will + # be defined and other not, I prefer to stay on the safe side and to + # test each one separately. + AC_MSG_CHECKING(whether program_invocation_name is defined) + AC_TRY_COMPILE([#include ], + [ program_invocation_name = "test"; ], + [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1, + [Define if program_invocation_name is defined]) + AC_MSG_RESULT(yes)], + [ AC_MSG_RESULT(no)] ) + + AC_MSG_CHECKING(whether program_invocation_short_name is defined) + AC_TRY_COMPILE([#include ], + [ program_invocation_short_name = "test"; ], + [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME,1, + [Define if program_invocation_short_name is defined]) + AC_MSG_RESULT(yes)], + [ AC_MSG_RESULT(no)] ) + + AC_CHECK_DECLS_ONCE([clearerr_unlocked]) + AC_CHECK_DECLS_ONCE([feof_unlocked]) + AC_CHECK_DECLS_ONCE([ferror_unlocked]) + AC_CHECK_DECLS_ONCE([fflush_unlocked]) + AC_CHECK_DECLS_ONCE([fgets_unlocked]) + AC_CHECK_DECLS_ONCE([fputc_unlocked]) + AC_CHECK_DECLS_ONCE([fputs_unlocked]) + AC_CHECK_DECLS_ONCE([fread_unlocked]) + AC_CHECK_DECLS_ONCE([fwrite_unlocked]) + AC_CHECK_DECLS_ONCE([getc_unlocked]) + AC_CHECK_DECLS_ONCE([getchar_unlocked]) + AC_CHECK_DECLS_ONCE([putc_unlocked]) + AC_CHECK_DECLS_ONCE([putchar_unlocked]) + AC_CHECK_FUNCS_ONCE([flockfile funlockfile]) + AC_CHECK_HEADERS_ONCE([features.h linewrap.h]) +]) diff --git a/m4/bison.m4 b/m4/bison.m4 new file mode 100644 index 0000000..91039b1 --- /dev/null +++ b/m4/bison.m4 @@ -0,0 +1,24 @@ +#serial 4 + +# Copyright (C) 2002, 2005 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. + +AC_DEFUN([gl_BISON], +[ + # getdate.y works with bison only. + : ${YACC='bison -y'} +dnl +dnl Declaring YACC & YFLAGS precious will not be necessary after GNULIB +dnl requires an Autoconf greater than 2.59c, but it will probably still be +dnl useful to override the description of YACC in the --help output, re +dnl getdate.y assuming `bison -y'. + AC_ARG_VAR(YACC, +[The `Yet Another C Compiler' implementation to use. Defaults to `bison -y'. +Values other than `bison -y' will most likely break on most systems.])dnl + AC_ARG_VAR(YFLAGS, +[YFLAGS contains the list arguments that will be passed by default to Bison. +This script will default YFLAGS to the empty string to avoid a default value of +`-d' given by some make applications.])dnl +]) diff --git a/m4/canonicalize-lgpl.m4 b/m4/canonicalize-lgpl.m4 new file mode 100755 index 0000000..b0a7902 --- /dev/null +++ b/m4/canonicalize-lgpl.m4 @@ -0,0 +1,35 @@ +# canonicalize-lgpl.m4 serial 4 +dnl Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_CANONICALIZE_LGPL], +[ + dnl Do this replacement check manually because the file name is shorter + dnl than the function name. + AC_CHECK_DECLS_ONCE(canonicalize_file_name) + AC_CHECK_FUNCS_ONCE(canonicalize_file_name) + if test $ac_cv_func_canonicalize_file_name = no; then + AC_LIBOBJ(canonicalize-lgpl) + AC_DEFINE([realpath], [rpl_realpath], + [Define to a replacement function name for realpath().]) + gl_PREREQ_CANONICALIZE_LGPL + fi +]) + +# Like gl_CANONICALIZE_LGPL, except prepare for separate compilation +# (no AC_LIBOBJ). +AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE], +[ + AC_CHECK_DECLS_ONCE(canonicalize_file_name) + AC_CHECK_FUNCS_ONCE(canonicalize_file_name) + gl_PREREQ_CANONICALIZE_LGPL +]) + +# Prerequisites of lib/canonicalize-lgpl.c. +AC_DEFUN([gl_PREREQ_CANONICALIZE_LGPL], +[ + AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h) + AC_CHECK_FUNCS_ONCE(getcwd readlink) +]) diff --git a/m4/chdir-long.m4 b/m4/chdir-long.m4 new file mode 100644 index 0000000..7f34f60 --- /dev/null +++ b/m4/chdir-long.m4 @@ -0,0 +1,38 @@ +#serial 10 + +# Use Gnulib's robust chdir function. +# It can handle arbitrarily long directory names, which means +# that when it is given the name of an existing directory, it +# never fails with ENAMETOOLONG. +# Arrange to compile chdir-long.c only on systems that define PATH_MAX. + +dnl Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Written by Jim Meyering. + +AC_DEFUN([gl_FUNC_CHDIR_LONG], +[ + AC_CACHE_CHECK([whether this system has an arbitrary file name length limit], + gl_cv_have_arbitrary_file_name_length_limit, + [AC_EGREP_CPP([have_arbitrary_file_name_length_limit], + [#include +#include +#if defined PATH_MAX || defined MAXPATHLEN +have_arbitrary_file_name_length_limit +#endif], + gl_cv_have_arbitrary_file_name_length_limit=yes, + gl_cv_have_arbitrary_file_name_length_limit=no)]) + + if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then + AC_LIBOBJ([chdir-long]) + gl_PREREQ_CHDIR_LONG + fi +]) + +AC_DEFUN([gl_PREREQ_CHDIR_LONG], +[ + : +]) diff --git a/m4/chown.m4 b/m4/chown.m4 new file mode 100644 index 0000000..89761f5 --- /dev/null +++ b/m4/chown.m4 @@ -0,0 +1,83 @@ +#serial 17 +# Determine whether we need the chown wrapper. + +dnl Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007 Free +dnl Software Foundation, Inc. + +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# chown should accept arguments of -1 for uid and gid, and it should +# dereference symlinks. If it doesn't, arrange to use the replacement +# function. + +# From Jim Meyering. + +AC_DEFUN([gl_FUNC_CHOWN], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_TYPE_UID_T]) + AC_REQUIRE([AC_FUNC_CHOWN]) + AC_REQUIRE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK]) + + if test $ac_cv_func_chown_works = no; then + AC_DEFINE(CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE, 1, + [Define if chown is not POSIX compliant regarding IDs of -1.]) + fi + + # If chown has either of the above problems, then we need the wrapper. + if test $ac_cv_func_chown_works$gl_cv_func_chown_follows_symlink = yesyes; then + : # no wrapper needed + else + REPLACE_CHOWN=1 + AC_LIBOBJ(chown) + gl_PREREQ_CHOWN + fi +]) + +# Determine whether chown follows symlinks (it should). +AC_DEFUN([gl_FUNC_CHOWN_FOLLOWS_SYMLINK], +[ + AC_CACHE_CHECK( + [whether chown(2) dereferences symlinks], + gl_cv_func_chown_follows_symlink, + [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include + + int + main () + { + char const *dangling_symlink = "conftest.dangle"; + + unlink (dangling_symlink); + if (symlink ("conftest.no-such", dangling_symlink)) + abort (); + + /* Exit successfully on a conforming system, + i.e., where chown must fail with ENOENT. */ + exit ( ! (chown (dangling_symlink, getuid (), getgid ()) != 0 + && errno == ENOENT)); + } + ]])], + [gl_cv_func_chown_follows_symlink=yes], + [gl_cv_func_chown_follows_symlink=no], + [gl_cv_func_chown_follows_symlink=yes] + ) + ] + ) + + if test $gl_cv_func_chown_follows_symlink = no; then + AC_DEFINE(CHOWN_MODIFIES_SYMLINK, 1, + [Define if chown modifies symlinks.]) + fi +]) + +# Prerequisites of lib/chown.c. +AC_DEFUN([gl_PREREQ_CHOWN], +[ + AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)]) +]) diff --git a/m4/clock_time.m4 b/m4/clock_time.m4 new file mode 100644 index 0000000..227a597 --- /dev/null +++ b/m4/clock_time.m4 @@ -0,0 +1,30 @@ +# clock_time.m4 serial 8 +dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME. +# For a program named, say foo, you should add a line like the following +# in the corresponding Makefile.am file: +# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) + +AC_DEFUN([gl_CLOCK_TIME], +[ + dnl Persuade glibc and Solaris to declare these functions. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + gl_saved_libs=$LIBS + AC_SEARCH_LIBS(clock_gettime, [rt posix4], + [test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) + AC_SUBST([LIB_CLOCK_GETTIME]) + AC_CHECK_FUNCS(clock_gettime clock_settime) + LIBS=$gl_saved_libs +]) diff --git a/m4/close-stream.m4 b/m4/close-stream.m4 new file mode 100644 index 0000000..b1f9d54 --- /dev/null +++ b/m4/close-stream.m4 @@ -0,0 +1,13 @@ +#serial 3 +dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_CLOSE_STREAM], +[ + AC_LIBOBJ([close-stream]) + + dnl Prerequisites of lib/close-stream.c. + : +]) diff --git a/m4/closeout.m4 b/m4/closeout.m4 new file mode 100644 index 0000000..55a65f0 --- /dev/null +++ b/m4/closeout.m4 @@ -0,0 +1,13 @@ +# closeout.m4 serial 5 +dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_CLOSEOUT], +[ + AC_LIBOBJ([closeout]) + + dnl Prerequisites of lib/closeout.c. + : +]) diff --git a/m4/d-ino.m4 b/m4/d-ino.m4 new file mode 100644 index 0000000..6e6dab3 --- /dev/null +++ b/m4/d-ino.m4 @@ -0,0 +1,41 @@ +#serial 10 + +dnl From Jim Meyering. +dnl +dnl Check whether struct dirent has a member named d_ino. +dnl + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2006, 2007 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. + +AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO], + [AC_CACHE_CHECK([for d_ino member in directory struct], + gl_cv_struct_dirent_d_ino, + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + ]], + [[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);]])], + [gl_cv_struct_dirent_d_ino=yes], + [gl_cv_struct_dirent_d_ino=no], + [gl_cv_struct_dirent_d_ino=no])]) + if test $gl_cv_struct_dirent_d_ino = yes; then + AC_DEFINE(D_INO_IN_DIRENT, 1, + [Define if struct dirent has a member d_ino that actually works.]) + fi + ] +) diff --git a/m4/dirfd.m4 b/m4/dirfd.m4 new file mode 100644 index 0000000..125966b --- /dev/null +++ b/m4/dirfd.m4 @@ -0,0 +1,74 @@ +#serial 14 -*- Autoconf -*- + +dnl Find out how to get the file descriptor associated with an open DIR*. + +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 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. + +dnl From Jim Meyering + +AC_DEFUN([gl_FUNC_DIRFD], +[ + dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. + AC_REQUIRE([AC_PROG_CPP]) + AC_REQUIRE([AC_PROG_EGREP]) + AC_CHECK_FUNCS(dirfd) + AC_CHECK_DECLS([dirfd], , , + [#include + #include ]) + + AC_CACHE_CHECK([whether dirfd is a macro], + gl_cv_func_dirfd_macro, + [AC_EGREP_CPP([dirent_header_defines_dirfd], [ +#include +#include +#ifdef dirfd + dirent_header_defines_dirfd +#endif], + gl_cv_func_dirfd_macro=yes, + gl_cv_func_dirfd_macro=no)]) + + # Use the replacement only if we have no function, macro, + # or declaration with that name. + if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$gl_cv_func_dirfd_macro \ + = no,no,no; then + AC_REPLACE_FUNCS([dirfd]) + AC_CACHE_CHECK( + [how to get the file descriptor associated with an open DIR*], + gl_cv_sys_dir_fd_member_name, + [ + dirfd_save_CFLAGS=$CFLAGS + for ac_expr in d_fd dd_fd; do + + CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" + AC_TRY_COMPILE( + [#include + #include ], + [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;], + dir_fd_found=yes + ) + CFLAGS=$dirfd_save_CFLAGS + test "$dir_fd_found" = yes && break + done + test "$dir_fd_found" = yes || ac_expr=no_such_member + + gl_cv_sys_dir_fd_member_name=$ac_expr + ] + ) + if test $gl_cv_sys_dir_fd_member_name != no_such_member; then + AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME, + $gl_cv_sys_dir_fd_member_name, + [the name of the file descriptor member of DIR]) + fi + AH_VERBATIM(DIR_TO_FD, + [#ifdef DIR_FD_MEMBER_NAME +# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME) +#else +# define DIR_TO_FD(Dir_p) -1 +#endif +]) + fi +]) diff --git a/m4/dirname.m4 b/m4/dirname.m4 new file mode 100644 index 0000000..e35da96 --- /dev/null +++ b/m4/dirname.m4 @@ -0,0 +1,18 @@ +#serial 7 -*- autoconf -*- +dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_DIRNAME], +[ + AC_LIBOBJ([basename]) + AC_LIBOBJ([dirname]) + AC_LIBOBJ([stripslash]) + + dnl Prerequisites of lib/dirname.h. + AC_REQUIRE([gl_AC_DOS]) + AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) + + dnl No prerequisites of lib/basename.c, lib/dirname.c, lib/stripslash.c. +]) diff --git a/m4/dos.m4 b/m4/dos.m4 new file mode 100644 index 0000000..dd59571 --- /dev/null +++ b/m4/dos.m4 @@ -0,0 +1,71 @@ +#serial 10 -*- autoconf -*- + +# Define some macros required for proper operation of code in lib/*.c +# on MSDOS/Windows systems. + +# Copyright (C) 2000, 2001, 2004, 2005, 2006 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. + +# From Jim Meyering. + +AC_DEFUN([gl_AC_DOS], + [ + AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos], + [ + AC_TRY_COMPILE([], + [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__ +neither MSDOS nor Windows +#endif], + [ac_cv_win_or_dos=yes], + [ac_cv_win_or_dos=no]) + ]) + + 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 + AC_CACHE_CHECK([whether drive letter can start relative path], + [ac_cv_drive_letter_can_be_relative], + [ + AC_TRY_COMPILE([], + [#if defined __CYGWIN__ +drive letters are always absolute +#endif], + [ac_cv_drive_letter_can_be_relative=yes], + [ac_cv_drive_letter_can_be_relative=no]) + ]) + if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then + ac_fs_drive_letter_can_be_relative=1 + else + ac_fs_drive_letter_can_be_relative=0 + fi + else + ac_fs_accepts_drive_letter_prefix=0 + ac_fs_backslash_is_file_name_separator=0 + ac_fs_drive_letter_can_be_relative=0 + fi + + AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX], + $ac_fs_accepts_drive_letter_prefix, + [Define on systems for which file names may have a so-called + `drive letter' prefix, define this to compute the length of that + prefix, including the colon.]) + + AH_VERBATIM(ISSLASH, + [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#else +# define ISSLASH(C) ((C) == '/') +#endif]) + + AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR], + $ac_fs_backslash_is_file_name_separator, + [Define if the backslash character may also serve as a file name + component separator.]) + + AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE], + $ac_fs_drive_letter_can_be_relative, + [Define if a drive letter prefix denotes a relative path if it is + not followed by a file name component separator.]) + ]) diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4 new file mode 100644 index 0000000..69d60d0 --- /dev/null +++ b/m4/double-slash-root.m4 @@ -0,0 +1,38 @@ +# double-slash-root.m4 serial 2 -*- Autoconf -*- +dnl Copyright (C) 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_DOUBLE_SLASH_ROOT], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root], + [ if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + 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 + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi]) + if test "$gl_cv_double_slash_root" = yes; then + AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], 1, + [Define to 1 if // is a file system root distinct from /.]) + fi +]) diff --git a/m4/dup2.m4 b/m4/dup2.m4 new file mode 100644 index 0000000..0549823 --- /dev/null +++ b/m4/dup2.m4 @@ -0,0 +1,15 @@ +#serial 5 +dnl Copyright (C) 2002, 2005, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_DUP2], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([dup2]) + if test $ac_cv_func_dup2 = no; then + HAVE_DUP2=0 + AC_LIBOBJ([dup2]) + fi +]) diff --git a/m4/eealloc.m4 b/m4/eealloc.m4 new file mode 100644 index 0000000..adcfd06 --- /dev/null +++ b/m4/eealloc.m4 @@ -0,0 +1,32 @@ +# eealloc.m4 serial 1 +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_EEALLOC], +[ + AC_REQUIRE([gl_EEMALLOC]) + AC_REQUIRE([gl_EEREALLOC]) + AC_REQUIRE([AC_C_INLINE]) +]) + +AC_DEFUN([gl_EEMALLOC], +[ + _AC_FUNC_MALLOC_IF( + [gl_cv_func_malloc_0_nonnull=1], + [gl_cv_func_malloc_0_nonnull=0]) + AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], $gl_cv_func_malloc_0_nonnull, + [If malloc(0) is != NULL, define this to 1. Otherwise define this + to 0.]) +]) + +AC_DEFUN([gl_EEREALLOC], +[ + _AC_FUNC_REALLOC_IF( + [gl_cv_func_realloc_0_nonnull=1], + [gl_cv_func_realloc_0_nonnull=0]) + AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], $gl_cv_func_realloc_0_nonnull, + [If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this + to 0.]) +]) diff --git a/m4/eoverflow.m4 b/m4/eoverflow.m4 new file mode 100644 index 0000000..3bffd10 --- /dev/null +++ b/m4/eoverflow.m4 @@ -0,0 +1,70 @@ +# eoverflow.m4 serial 2 +dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +# The EOVERFLOW errno value ought to be defined in , according to +# POSIX. But some systems (like AIX 3) don't define it, and some systems +# (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined. + +# Define EOVERFLOW as a C macro and as a substituted macro in such a way that +# 1. on all systems, after inclusion of , EOVERFLOW is usable, +# 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric +# value. + +AC_DEFUN([gl_EOVERFLOW], +[ + AC_REQUIRE([AC_PROG_CC])dnl + + AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [ + AC_EGREP_CPP(yes,[ +#include +#ifdef EOVERFLOW +yes +#endif + ], have_eoverflow=1) + if test -n "$have_eoverflow"; then + dnl EOVERFLOW exists in . Don't need to define EOVERFLOW ourselves. + ac_cv_decl_EOVERFLOW=yes + else + AC_EGREP_CPP(yes,[ +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EOVERFLOW +yes +#endif + ], have_eoverflow=1) + if test -n "$have_eoverflow"; then + dnl EOVERFLOW exists but is hidden. + dnl Define it to the same value. + AC_COMPUTE_INT([ac_cv_decl_EOVERFLOW], [EOVERFLOW], [ +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +]) + else + dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but + dnl don't define it as EINVAL, because snprintf() callers want to + dnl distinguish EINVAL and EOVERFLOW. + ac_cv_decl_EOVERFLOW=E2BIG + fi + fi + ]) + if test "$ac_cv_decl_EOVERFLOW" != yes; then + AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW], + [Define as good substitute value for EOVERFLOW.]) + EOVERFLOW="$ac_cv_decl_EOVERFLOW" + AC_SUBST(EOVERFLOW) + fi +]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) diff --git a/m4/error.m4 b/m4/error.m4 new file mode 100644 index 0000000..7c7746e --- /dev/null +++ b/m4/error.m4 @@ -0,0 +1,22 @@ +#serial 11 + +# Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004 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. + +AC_DEFUN([gl_ERROR], +[ + AC_FUNC_ERROR_AT_LINE + dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). + gl_PREREQ_ERROR +]) + +# Prerequisites of lib/error.c. +AC_DEFUN([gl_PREREQ_ERROR], +[ + AC_REQUIRE([AC_FUNC_STRERROR_R]) + : +]) diff --git a/m4/exitfail.m4 b/m4/exitfail.m4 new file mode 100644 index 0000000..b7a691e --- /dev/null +++ b/m4/exitfail.m4 @@ -0,0 +1,13 @@ +# exitfail.m4 serial 6 +dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_EXITFAIL], +[ + AC_LIBOBJ([exitfail]) + + dnl No prerequisites of lib/exitfail.c. + : +]) diff --git a/m4/extensions.m4 b/m4/extensions.m4 new file mode 100644 index 0000000..143a9e5 --- /dev/null +++ b/m4/extensions.m4 @@ -0,0 +1,58 @@ +# serial 4 -*- Autoconf -*- +# Enable extensions on systems that normally disable them. + +# Copyright (C) 2003, 2006 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. + +# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS +# Autoconf. Perhaps we can remove this once we can assume Autoconf +# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly +# enough in this area it's likely we'll need to redefine +# AC_USE_SYSTEM_EXTENSIONS for quite some time. + +# AC_USE_SYSTEM_EXTENSIONS +# ------------------------ +# Enable extensions on systems that normally disable them, +# typically due to standards-conformance issues. +AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], +[ + AC_BEFORE([$0], [AC_COMPILE_IFELSE]) + AC_BEFORE([$0], [AC_RUN_IFELSE]) + + AC_REQUIRE([AC_GNU_SOURCE]) + AC_REQUIRE([AC_AIX]) + AC_REQUIRE([AC_MINIX]) + + AH_VERBATIM([__EXTENSIONS__], +[/* Enable extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif]) + AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], + [ac_cv_safe_to_define___extensions__], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ +# define __EXTENSIONS__ 1 + AC_INCLUDES_DEFAULT])], + [ac_cv_safe_to_define___extensions__=yes], + [ac_cv_safe_to_define___extensions__=no])]) + test $ac_cv_safe_to_define___extensions__ = yes && + AC_DEFINE([__EXTENSIONS__]) + AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) + AC_DEFINE([_TANDEM_SOURCE]) +]) + +# gl_USE_SYSTEM_EXTENSIONS +# ------------------------ +# Enable extensions on systems that normally disable them, +# typically due to standards-conformance issues. +AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], + [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])]) diff --git a/m4/fchdir.m4 b/m4/fchdir.m4 new file mode 100644 index 0000000..58c933c --- /dev/null +++ b/m4/fchdir.m4 @@ -0,0 +1,28 @@ +# fchdir.m4 serial 3 +dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_FCHDIR], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([fchdir]) + if test $ac_cv_func_fchdir = no; then + REPLACE_FCHDIR=1 + AC_LIBOBJ([fchdir]) + gl_PREREQ_FCHDIR + AC_DEFINE([FCHDIR_REPLACEMENT], 1, + [Define if gnulib's fchdir() replacement is used.]) + gl_ABSOLUTE_HEADER([dirent.h]) + ABSOLUTE_DIRENT_H=\"$gl_cv_absolute_dirent_h\" + DIRENT_H='dirent.h' + else + DIRENT_H= + fi + AC_SUBST([ABSOLUTE_DIRENT_H]) + AC_SUBST([DIRENT_H]) +]) + +# Prerequisites of lib/fchdir.c. +AC_DEFUN([gl_PREREQ_FCHDIR], [:]) diff --git a/m4/fcntl-safer.m4 b/m4/fcntl-safer.m4 new file mode 100644 index 0000000..3475b0a --- /dev/null +++ b/m4/fcntl-safer.m4 @@ -0,0 +1,11 @@ +#serial 5 +dnl Copyright (C) 2005-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FCNTL_SAFER], +[ + AC_LIBOBJ([open-safer]) + AC_LIBOBJ([creat-safer]) +]) diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4 new file mode 100644 index 0000000..9846b2f --- /dev/null +++ b/m4/fcntl_h.m4 @@ -0,0 +1,81 @@ +# Configure fcntl.h. +dnl Copyright (C) 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_FCNTL_H], +[ + AC_CACHE_CHECK([for working fcntl.h], gl_cv_header_working_fcntl_h, + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + ]], + [[ + int status = !constants; + { + static char const sym[] = "conftest.sym"; + if (symlink (".", sym) != 0 + || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) + status |= 32; + } + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + char c; + struct stat st0, st1; + if (fd < 0 + || fstat (fd, &st0) != 0 + || sleep (1) != 0 + || read (fd, &c, 1) != 1 + || close (fd) != 0 + || stat (file, &st1) != 0 + || st0.st_atime != st1.st_atime) + status |= 64; + } + return status;]])], + [gl_cv_header_working_fcntl_h=yes], + [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], + [gl_cv_header_working_fcntl_h=cross-compiling])]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], + [Define to 1 if O_NOATIME works.]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], + [Define to 1 if O_NOFOLLOW works.]) + + gl_ABSOLUTE_HEADER([fcntl.h]) + ABSOLUTE_FCNTL_H=\"$gl_cv_absolute_fcntl_h\" + AC_SUBST([ABSOLUTE_FCNTL_H]) + FCNTL_H='fcntl.h' + AC_SUBST([FCNTL_H]) +]) diff --git a/m4/fileblocks.m4 b/m4/fileblocks.m4 new file mode 100644 index 0000000..5fb6311 --- /dev/null +++ b/m4/fileblocks.m4 @@ -0,0 +1,20 @@ +# fileblocks.m4 serial 4 +dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FILEBLOCKS], +[ + AC_STRUCT_ST_BLOCKS + dnl Note: AC_STRUCT_ST_BLOCKS does AC_LIBOBJ(fileblocks). + if test $ac_cv_member_struct_stat_st_blocks = no; then + gl_PREREQ_FILEBLOCKS + fi +]) + +# Prerequisites of lib/fileblocks.c. +AC_DEFUN([gl_PREREQ_FILEBLOCKS], [ + AC_CHECK_HEADERS_ONCE(sys/param.h) + : +]) diff --git a/m4/float_h.m4 b/m4/float_h.m4 new file mode 100644 index 0000000..36a07dc --- /dev/null +++ b/m4/float_h.m4 @@ -0,0 +1,21 @@ +# float_h.m4 serial 1 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FLOAT_H], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + FLOAT_H= + case "$host_os" in + beos*) + FLOAT_H=float.h + gl_ABSOLUTE_HEADER([float.h]) + ABSOLUTE_FLOAT_H=\"$gl_cv_absolute_float_h\" + AC_SUBST([ABSOLUTE_FLOAT_H]) + ;; + esac + AC_SUBST([FLOAT_H]) +]) diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4 new file mode 100644 index 0000000..3778742 --- /dev/null +++ b/m4/fnmatch.m4 @@ -0,0 +1,127 @@ +# Check for fnmatch. + +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 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. + +# Autoconf defines AC_FUNC_FNMATCH, but that is obsolescent. +# New applications should use the macros below instead. + +# _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE) +# ------------------------------------------------------------------------- +# If a STANDARD compliant fnmatch is found, run IF-TRUE, otherwise +# IF-FALSE. Use CACHE_VAR. +AC_DEFUN([_AC_FUNC_FNMATCH_IF], +[AC_CACHE_CHECK( + [for working $1 fnmatch], + [$2], + [dnl Some versions of Solaris, SCO, and the GNU C Library + dnl have a broken or incompatible fnmatch. + dnl So we run a test program. If we are cross-compiling, take no chance. + dnl Thanks to John Oleynick, François Pinard, and Paul Eggert for this test. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#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; + } + ]], + [[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' < '\\\\') + && ]m4_if([$1], [GNU], + [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)], + 1))[;]])], + [$2=yes], + [$2=no], + [$2=cross])]) +AS_IF([test $$2 = yes], [$3], [$4]) +])# _AC_FUNC_FNMATCH_IF + + +# _AC_LIBOBJ_FNMATCH +# ------------------ +# Prepare the replacement of fnmatch. +AC_DEFUN([_AC_LIBOBJ_FNMATCH], +[AC_REQUIRE([AC_FUNC_ALLOCA])dnl +AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl +AC_CHECK_DECLS([isblank], [], [], [#include ]) +AC_CHECK_FUNCS_ONCE([btowc iswctype mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy]) +AC_CHECK_HEADERS_ONCE([wctype.h]) +AC_LIBOBJ([fnmatch]) +FNMATCH_H=fnmatch.h +])# _AC_LIBOBJ_FNMATCH + + +AC_DEFUN([gl_FUNC_FNMATCH_POSIX], +[ + FNMATCH_H= + _AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_posix], + [rm -f lib/fnmatch.h], + [_AC_LIBOBJ_FNMATCH]) + if test $ac_cv_func_fnmatch_posix != yes; then + dnl We must choose a different name for our function, since on ELF systems + dnl a broken fnmatch() in libc.so would override our fnmatch() if it is + dnl compiled into a shared library. + AC_DEFINE([fnmatch], [posix_fnmatch], + [Define to a replacement function name for fnmatch().]) + fi + AC_SUBST([FNMATCH_H]) +]) + + +AC_DEFUN([gl_FUNC_FNMATCH_GNU], +[ + dnl Persuade glibc to declare FNM_CASEFOLD etc. + AC_REQUIRE([AC_GNU_SOURCE]) + + FNMATCH_H= + _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu], + [rm -f lib/fnmatch.h], + [_AC_LIBOBJ_FNMATCH]) + if test $ac_cv_func_fnmatch_gnu != yes; then + dnl We must choose a different name for our function, since on ELF systems + dnl a broken fnmatch() in libc.so would override our fnmatch() if it is + dnl compiled into a shared library. + AC_DEFINE([fnmatch], [gnu_fnmatch], + [Define to a replacement function name for fnmatch().]) + fi + AC_SUBST([FNMATCH_H]) +]) diff --git a/m4/fpending.m4 b/m4/fpending.m4 new file mode 100644 index 0000000..a073483 --- /dev/null +++ b/m4/fpending.m4 @@ -0,0 +1,78 @@ +#serial 10 + +# Copyright (C) 2000, 2001, 2004, 2005, 2006 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. + +dnl From Jim Meyering +dnl Using code from emacs, based on suggestions from Paul Eggert +dnl and Ulrich Drepper. + +dnl Find out how to determine the number of pending output bytes on a stream. +dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems, +dnl we have to grub around in the FILE struct. + +AC_DEFUN([gl_FUNC_FPENDING], +[ + AC_CHECK_HEADERS_ONCE(stdio_ext.h) + AC_REPLACE_FUNCS([__fpending]) + fp_headers=' +# include +# if HAVE_STDIO_EXT_H +# include +# endif +' + AC_CHECK_DECLS([__fpending], , , $fp_headers) + if test $ac_cv_func___fpending = no; then + AC_CACHE_CHECK( + [how to determine the number of pending output bytes on a stream], + ac_cv_sys_pending_output_n_bytes, + [ + 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 \ + ; do + + # Skip each embedded comment. + case "$ac_expr" in '#'*) continue;; esac + + AC_TRY_COMPILE( + [#include + ], + [FILE *fp = stdin; (void) ($ac_expr);], + fp_done=yes + ) + test "$fp_done" = yes && break + done + + ac_cv_sys_pending_output_n_bytes=$ac_expr + ] + ) + AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES, + $ac_cv_sys_pending_output_n_bytes, + [the number of pending output bytes on stream `fp']) + fi +]) diff --git a/m4/getcwd-abort-bug.m4 b/m4/getcwd-abort-bug.m4 new file mode 100644 index 0000000..a431a7c --- /dev/null +++ b/m4/getcwd-abort-bug.m4 @@ -0,0 +1,106 @@ +#serial 1 +# Determine whether getcwd aborts when the length of the working directory +# name is unusually large. Any length between 4k and 16k trigger the bug +# when using glibc-2.4.90-9 or older. + +# Copyright (C) 2006 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. + +# From Jim Meyering + +# gl_FUNC_GETCWD_ABORT_BUG([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG], +[ + AC_CHECK_DECLS_ONCE(getcwd) + AC_CHECK_FUNCS(getpagesize) + AC_CACHE_CHECK([whether getcwd aborts when 4k < cwd_length < 16k], + gl_cv_func_getcwd_abort_bug, + [# 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---" + AC_RUN_IFELSE( + [AC_LANG_SOURCE( + [[ +#include +#include +#include +#include +#include + +/* Don't get link errors because mkdir is redefined to rpl_mkdir. */ +#undef mkdir + +#ifndef S_IRWXU +# define S_IRWXU 0700 +#endif + +/* FIXME: skip the run-test altogether on systems without getpagesize. */ +#if ! HAVE_GETPAGESIZE +# define getpagesize() 0 +#endif + +/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than + the 16kB pagesize on ia64 linux. Those conditions make the code below + trigger a bug in glibc's getcwd implementation before 2.4.90-10. */ +#define TARGET_LEN (5 * 1024) + +int +main () +{ + char const *dir_name = "confdir-14B---"; + char *cwd; + size_t initial_cwd_len; + int fail = 0; + size_t desired_depth; + size_t d; + + /* The bug is triggered when PATH_MAX < getpagesize (), so skip + this relative expensive and invasive test if that's not true. */ + if (getpagesize () <= PATH_MAX) + return 0; + + cwd = getcwd (NULL, 0); + if (cwd == NULL) + return 0; + + initial_cwd_len = strlen (cwd); + free (cwd); + desired_depth = ((TARGET_LEN - 1 - initial_cwd_len) + / (1 + strlen (dir_name))); + for (d = 0; d < desired_depth; d++) + { + if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0) + { + fail = 3; /* Unable to construct deep hierarchy. */ + break; + } + } + + /* If libc has the bug in question, this invocation of getcwd + results in a failed assertion. */ + cwd = getcwd (NULL, 0); + if (cwd == NULL) + fail = 4; /* getcwd failed. This is ok, and expected. */ + free (cwd); + + /* Call rmdir first, in case the above chdir failed. */ + rmdir (dir_name); + while (0 < d--) + { + if (chdir ("..") < 0) + break; + rmdir (dir_name); + } + + return 0; +} + ]])], + [gl_cv_func_getcwd_abort_bug=no], + [gl_cv_func_getcwd_abort_bug=yes], + [gl_cv_func_getcwd_abort_bug=yes]) + ]) + AS_IF([test $gl_cv_func_getcwd_abort_bug = yes], [$1], [$2]) +]) diff --git a/m4/getcwd-path-max.m4 b/m4/getcwd-path-max.m4 new file mode 100644 index 0000000..5e6d58b --- /dev/null +++ b/m4/getcwd-path-max.m4 @@ -0,0 +1,190 @@ +#serial 13 +# Check for several getcwd bugs with long file names. +# If so, arrange to compile the wrapper function. + +# This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20. +# I've heard that this is due to a Linux kernel bug, and that it has +# been fixed between 2.4.21-pre3 and 2.4.21-pre4. */ + +# Copyright (C) 2003, 2004, 2005, 2006, 2007 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. + +# From Jim Meyering + +AC_DEFUN([gl_FUNC_GETCWD_PATH_MAX], +[ + AC_CHECK_DECLS_ONCE(getcwd) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CACHE_CHECK([whether getcwd handles long file names properly], + gl_cv_func_getcwd_path_max, + [# Arrange for deletion of the temporary directory this test creates. + ac_clean_files="$ac_clean_files confdir3" + AC_RUN_IFELSE( + [AC_LANG_SOURCE( + [[ +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef AT_FDCWD +# define AT_FDCWD 0 +#endif +#ifdef ENAMETOOLONG +# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG) +#else +# define is_ENAMETOOLONG(x) 0 +#endif + +/* Don't get link errors because mkdir is redefined to rpl_mkdir. */ +#undef mkdir + +#ifndef S_IRWXU +# define S_IRWXU 0700 +#endif + +/* The length of this name must be 8. */ +#define DIR_NAME "confdir3" +#define DIR_NAME_LEN 8 +#define DIR_NAME_SIZE (DIR_NAME_LEN + 1) + +/* The length of "../". */ +#define DOTDOTSLASH_LEN 3 + +/* Leftover bytes in the buffer, to work around library or OS bugs. */ +#define BUF_SLOP 20 + +int +main () +{ +#ifndef PATH_MAX + /* The Hurd doesn't define this, so getcwd can't exhibit the bug -- + at least not on a local file system. And if we were to start worrying + about remote file systems, we'd have to enable the wrapper function + all of the time, just to be safe. That's not worth the cost. */ + exit (0); +#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \ + - DIR_NAME_SIZE - BUF_SLOP) \ + <= PATH_MAX) + /* FIXME: Assuming there's a system for which this is true, + this should be done in a compile test. */ + exit (0); +#else + char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) + + DIR_NAME_SIZE + BUF_SLOP]; + char *cwd = getcwd (buf, PATH_MAX); + size_t initial_cwd_len; + size_t cwd_len; + int fail = 0; + size_t n_chdirs = 0; + + if (cwd == NULL) + exit (1); + + cwd_len = initial_cwd_len = strlen (cwd); + + while (1) + { + size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN); + char *c = NULL; + + cwd_len += DIR_NAME_SIZE; + /* If mkdir or chdir fails, it could be that this system cannot create + any file with an absolute name longer than PATH_MAX, such as cygwin. + If so, leave fail as 0, because the current working directory can't + be too long for getcwd if it can't even be created. For other + errors, be pessimistic and consider that as a failure, too. */ + if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0) + { + if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) + fail = 2; + break; + } + + if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE) + { + c = getcwd (buf, PATH_MAX); + if (!c && errno == ENOENT) + { + fail = 1; + break; + } + if (c || ! (errno == ERANGE || is_ENAMETOOLONG (errno))) + { + fail = 2; + break; + } + } + + if (dotdot_max <= cwd_len - initial_cwd_len) + { + if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len) + break; + c = getcwd (buf, cwd_len + 1); + if (!c) + { + if (! (errno == ERANGE || errno == ENOENT + || is_ENAMETOOLONG (errno))) + { + fail = 2; + break; + } + if (AT_FDCWD || errno == ERANGE || errno == ENOENT) + { + fail = 1; + break; + } + } + } + + if (c && strlen (c) != cwd_len) + { + fail = 2; + break; + } + ++n_chdirs; + } + + /* Leaving behind such a deep directory is not polite. + So clean up here, right away, even though the driving + shell script would also clean up. */ + { + size_t i; + + /* Try rmdir first, in case the chdir failed. */ + rmdir (DIR_NAME); + for (i = 0; i <= n_chdirs; i++) + { + if (chdir ("..") < 0) + break; + if (rmdir (DIR_NAME) != 0) + break; + } + } + + exit (fail); +#endif +} + ]])], + [gl_cv_func_getcwd_path_max=yes], + [case $? in + 1) gl_cv_func_getcwd_path_max='no, but it is partly working';; + *) gl_cv_func_getcwd_path_max=no;; + esac], + [gl_cv_func_getcwd_path_max=no]) + ]) + case $gl_cv_func_getcwd_path_max in + no,*) + AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], 1, + [Define to 1 if getcwd works, except it sometimes fails when it shouldn't, + setting errno to ERANGE, ENAMETOOLONG, or ENOENT. If __GETCWD_PREFIX + is not defined, it doesn't matter whether HAVE_PARTLY_WORKING_GETCWD + is defined.]);; + esac +]) diff --git a/m4/getcwd.m4 b/m4/getcwd.m4 new file mode 100644 index 0000000..6ebe2fc --- /dev/null +++ b/m4/getcwd.m4 @@ -0,0 +1,64 @@ +# getcwd.m4 - check for working getcwd that is compatible with glibc + +# Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 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. + +# Written by Paul Eggert. + +AC_DEFUN([gl_FUNC_GETCWD_NULL], + [ + AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result], + [gl_cv_func_getcwd_null], + [AC_TRY_RUN( + [ +# include +# include +# ifndef getcwd + char *getcwd (); +# endif + int + main () + { + if (chdir ("/") != 0) + exit (1); + else + { + char *f = getcwd (NULL, 0); + exit (! (f && f[0] == '/' && !f[1])); + } + }], + [gl_cv_func_getcwd_null=yes], + [gl_cv_func_getcwd_null=no], + [gl_cv_func_getcwd_null=no])]) +]) + +AC_DEFUN([gl_FUNC_GETCWD], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_GETCWD_NULL]) + + gl_abort_bug=no + case $gl_cv_func_getcwd_null in + yes) + gl_FUNC_GETCWD_PATH_MAX + gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes]);; + esac + + case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in + yes,yes,no) ;; + *) + REPLACE_GETCWD=1 + AC_LIBOBJ([getcwd]) + gl_PREREQ_GETCWD;; + esac +]) + +# Prerequisites of lib/getcwd.c. +AC_DEFUN([gl_PREREQ_GETCWD], +[ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO]) + : +]) diff --git a/m4/getdate.m4 b/m4/getdate.m4 new file mode 100644 index 0000000..d160329 --- /dev/null +++ b/m4/getdate.m4 @@ -0,0 +1,33 @@ +# getdate.m4 serial 12 +dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_C_COMPOUND_LITERALS], +[ + AC_CACHE_CHECK([for compound literals], gl_cv_compound_literals, + [AC_TRY_COMPILE([struct s { int i, j; }; struct s s = (struct s) { 1, 2 };], + [struct s t = (struct s) { 3, 4 }; + if (t.i != 0) return 0;], + gl_cv_compound_literals=yes, + gl_cv_compound_literals=no)]) + if test $gl_cv_compound_literals = yes; then + AC_DEFINE(HAVE_COMPOUND_LITERALS, 1, + [Define if you have compound literals.]) + fi +]) + +AC_DEFUN([gl_GETDATE], +[ + dnl Prerequisites of lib/getdate.h. + AC_REQUIRE([AM_STDBOOL_H]) + AC_REQUIRE([gl_TIMESPEC]) + + dnl Prerequisites of lib/getdate.y. + AC_REQUIRE([gl_BISON]) + AC_REQUIRE([gl_C_COMPOUND_LITERALS]) + AC_STRUCT_TIMEZONE + AC_REQUIRE([gl_CLOCK_TIME]) + AC_REQUIRE([gl_TM_GMTOFF]) +]) diff --git a/m4/getopt.m4 b/m4/getopt.m4 new file mode 100644 index 0000000..c0a73b2 --- /dev/null +++ b/m4/getopt.m4 @@ -0,0 +1,83 @@ +# getopt.m4 serial 13 +dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# The getopt module assume you want GNU getopt, with getopt_long etc, +# rather than vanilla POSIX getopt. This means your code should +# always include for the getopt prototypes. + +AC_DEFUN([gl_GETOPT_SUBSTITUTE], +[ + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_GETOPT_SUBSTITUTE_HEADER + gl_PREREQ_GETOPT +]) + +AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], +[ + GETOPT_H=getopt.h + AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], + [Define to rpl_ if the getopt replacement functions and variables + should be used.]) + AC_SUBST([GETOPT_H]) +]) + +AC_DEFUN([gl_GETOPT_CHECK_HEADERS], +[ + if test -z "$GETOPT_H"; then + AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h]) + fi + + if test -z "$GETOPT_H"; then + AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h]) + fi + + dnl BSD getopt_long uses an incompatible method to reset option processing, + dnl and (as of 2004-10-15) mishandles optional option-arguments. + if test -z "$GETOPT_H"; then + AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include ]) + fi + + dnl Solaris 10 getopt doesn't handle `+' as a leading character in an + dnl option string (as of 2005-05-05). + if test -z "$GETOPT_H"; then + AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([#include ], + [[ + char *myargv[3]; + myargv[0] = "conftest"; + myargv[1] = "-+"; + myargv[2] = 0; + return getopt (2, myargv, "+a") != '?'; + ]])], + [gl_cv_func_gnu_getopt=yes], + [gl_cv_func_gnu_getopt=no], + [dnl cross compiling - pessimistically guess based on decls + dnl Solaris 10 getopt doesn't handle `+' as a leading character in an + dnl option string (as of 2005-05-05). + AC_CHECK_DECL([getopt_clip], + [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes], + [#include ])])]) + if test "$gl_cv_func_gnu_getopt" = "no"; then + GETOPT_H=getopt.h + fi + fi +]) + +AC_DEFUN([gl_GETOPT_IFELSE], +[ + AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) + AS_IF([test -n "$GETOPT_H"], [$1], [$2]) +]) + +AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])]) + +# Prerequisites of lib/getopt*. +AC_DEFUN([gl_PREREQ_GETOPT], +[ + AC_CHECK_DECLS_ONCE([getenv]) +]) diff --git a/m4/gettext.m4 b/m4/gettext.m4 new file mode 100644 index 0000000..4ffe433 --- /dev/null +++ b/m4/gettext.m4 @@ -0,0 +1,420 @@ +# gettext.m4 serial 59 (gettext-0.16.1) +dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2006. + +dnl Macro to add for using GNU gettext. + +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The +dnl default (if it is not specified or empty) is 'no-libtool'. +dnl INTLSYMBOL should be 'external' for packages with no intl directory, +dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. +dnl If INTLSYMBOL is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. If NEEDSYMBOL is specified and is +dnl 'need-formatstring-macros', then GNU gettext implementations that don't +dnl support the ISO C 99 formatstring macros will be ignored. +dnl INTLDIR is used to find the intl libraries. If empty, +dnl the value `$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_GNU_GETTEXT], +[ + dnl Argument checking. + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT +])])])])]) + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT +])])])]) + define([gt_included_intl], + ifelse([$1], [external], + ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), + [yes])) + define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) + gt_NEEDS_INIT + AM_GNU_GETTEXT_NEED([$2]) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + ifelse(gt_included_intl, yes, [ + AC_REQUIRE([AM_INTL_SUBDIR])dnl + ]) + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Sometimes libintl requires libiconv, so first search for libiconv. + dnl Ideally we would do this search only after the + dnl if test "$USE_NLS" = "yes"; then + dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl the configure script would need to contain the same shell code + dnl again, outside any 'if'. There are two solutions: + dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. + dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. + dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not + dnl documented, we avoid it. + ifelse(gt_included_intl, yes, , [ + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + ]) + + dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. + gt_INTL_MACOSX + + dnl Set USE_NLS. + AC_REQUIRE([AM_NLS]) + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl Add a version number to the cache macros. + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + ifelse(gt_included_intl, yes, [ + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + ]) + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], + [AC_TRY_LINK([#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings;], + [bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], + [eval "$gt_func_gnugettext_libc=yes"], + [eval "$gt_func_gnugettext_libc=no"])]) + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + ifelse(gt_included_intl, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + [$gt_func_gnugettext_libintl], + [gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_TRY_LINK([#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *);], + [bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], + [eval "$gt_func_gnugettext_libintl=yes"], + [eval "$gt_func_gnugettext_libintl=no"]) + dnl Now see whether libintl exists and depends on libiconv. + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *);], + [bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + ]) + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + ifelse(gt_included_intl, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + CATOBJEXT= + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions to use GNU gettext tools. + CATOBJEXT=.gmo + fi + ]) + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Some extra flags are needed during linking. + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE(HAVE_GETTEXT, 1, + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE(HAVE_DCGETTEXT, 1, + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + ifelse(gt_included_intl, yes, [ + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATOBJEXT) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST(DATADIRNAME) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST(INSTOBJEXT) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST(GENCAT) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLOBJS= + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST(INTLOBJS) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST(INTLLIBS) + + dnl Make all documented variables known to autoconf. + AC_SUBST(LIBINTL) + AC_SUBST(LTLIBINTL) + AC_SUBST(POSUB) +]) + + +dnl Checks for special options needed on MacOS X. +dnl Defines INTL_MACOSX_LIBS. +AC_DEFUN([gt_INTL_MACOSX], +[ + dnl Check for API introduced in MacOS X 10.2. + AC_CACHE_CHECK([for CFPreferencesCopyAppValue], + gt_cv_func_CFPreferencesCopyAppValue, + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_TRY_LINK([#include ], + [CFPreferencesCopyAppValue(NULL, NULL)], + [gt_cv_func_CFPreferencesCopyAppValue=yes], + [gt_cv_func_CFPreferencesCopyAppValue=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, + [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + fi + dnl Check for API introduced in MacOS X 10.3. + AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], + [gt_cv_func_CFLocaleCopyCurrent=yes], + [gt_cv_func_CFLocaleCopyCurrent=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, + [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + AC_SUBST([INTL_MACOSX_LIBS]) +]) + + +dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. +m4_define([gt_NEEDS_INIT], +[ + m4_divert_text([DEFAULTS], [gt_needs=]) + m4_define([gt_NEEDS_INIT], []) +]) + + +dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) +AC_DEFUN([AM_GNU_GETTEXT_NEED], +[ + m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) + AC_DEFUN([gl_LOCK_EARLY], []) diff --git a/m4/gettime.m4 b/m4/gettime.m4 new file mode 100644 index 0000000..601a5e6 --- /dev/null +++ b/m4/gettime.m4 @@ -0,0 +1,15 @@ +# gettime.m4 serial 6 +dnl Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_GETTIME], +[ + AC_LIBOBJ([gettime]) + + dnl Prerequisites of lib/gettime.c. + AC_REQUIRE([gl_CLOCK_TIME]) + AC_REQUIRE([gl_TIMESPEC]) + AC_CHECK_FUNCS_ONCE(gettimeofday nanotime) +]) diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 new file mode 100644 index 0000000..b9bbb10 --- /dev/null +++ b/m4/gettimeofday.m4 @@ -0,0 +1,101 @@ +#serial 11 + +# Copyright (C) 2001, 2002, 2003, 2005, 2007 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. + +dnl From Jim Meyering. + +AC_DEFUN([gl_FUNC_GETTIMEOFDAY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_SYS_TIME_H]) + AC_CHECK_FUNCS_ONCE([gettimeofday]) + + AC_CACHE_CHECK([for gettimeofday with POSIX signature], + [gl_cv_func_gettimeofday_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + struct timeval c; + ]], + [[ + int (*f) (struct timeval *restrict, void *restrict) = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + ]])], + [gl_cv_func_gettimeofday_posix_signature=yes], + [gl_cv_func_gettimeofday_posix_signature=no])]) + + gl_FUNC_GETTIMEOFDAY_CLOBBER + + if test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + if test $gl_cv_func_gettimeofday_clobber != yes; then + AC_LIBOBJ(gettimeofday) + gl_PREREQ_GETTIMEOFDAY + fi + fi +]) + + +dnl See if gettimeofday clobbers the static buffer that localtime uses +dnl for its return value. The gettimeofday function from Mac OS X 10.0.4 +dnl (i.e., Darwin 1.3.7) has this problem. +dnl +dnl If it does, then arrange to use gettimeofday and localtime only via +dnl the wrapper functions that work around the problem. + +AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], +[ + AC_REQUIRE([gl_HEADER_SYS_TIME_H]) + + AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], + [gl_cv_func_gettimeofday_clobber], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + #include + ]], + [[ + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + ]])], + [gl_cv_func_gettimeofday_clobber=no], + [gl_cv_func_gettimeofday_clobber=yes], + dnl When crosscompiling, assume it is broken. + [gl_cv_func_gettimeofday_clobber=yes])]) + + if test $gl_cv_func_gettimeofday_clobber = yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + gl_GETTIMEOFDAY_REPLACE_LOCALTIME + AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], 1, + [Define if gettimeofday clobbers the localtime buffer.]) + fi +]) + +AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ + AC_LIBOBJ(gettimeofday) + gl_PREREQ_GETTIMEOFDAY + AC_DEFINE([gmtime], [rpl_gmtime], + [Define to rpl_gmtime if the replacement function should be used.]) + AC_DEFINE([localtime], [rpl_localtime], + [Define to rpl_localtime if the replacement function should be used.]) +]) + +# Prerequisites of lib/gettimeofday.c. +AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [ + AC_CHECK_HEADERS([sys/timeb.h]) + AC_CHECK_FUNCS([_ftime]) +]) diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 new file mode 100644 index 0000000..5398010 --- /dev/null +++ b/m4/gnulib-common.m4 @@ -0,0 +1,22 @@ +# gnulib-common.m4 serial 2 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# gl_MODULE_INDICATOR([modulename]) +# defines a C macro indicating the presence of the given module. +AC_DEFUN([gl_MODULE_INDICATOR], +[ + AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], + [Define to 1 when using the gnulib module ]$1[.]) +]) + +# AC_PROG_MKDIR_P +# is a backport of autoconf-2.60's AC_PROG_MKDIR_P. +# Remove this macro when we can assume autoconf >= 2.60. +m4_ifdef([AC_PROG_MKDIR_P], [], [ + AC_DEFUN([AC_PROG_MKDIR_P], + [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + MKDIR_P='$(mkdir_p)' + AC_SUBST([MKDIR_P])])]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 new file mode 100644 index 0000000..4d77019 --- /dev/null +++ b/m4/gnulib-comp.m4 @@ -0,0 +1,498 @@ +# -*- buffer-read-only: t -*- vi: set ro: +# DO NOT EDIT! GENERATED AUTOMATICALLY! +# DO NOT EDIT! GENERATED AUTOMATICALLY! +# Copyright (C) 2004-2007 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 +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# +# This file represents the compiled summary of the specification in +# gnulib-cache.m4. It lists the computed macro invocations that need +# to be invoked from configure.ac. +# In projects using CVS, this file can be treated like other built files. + + +# This macro should be invoked from ./configure.ac, in the section +# "Checks for programs", right after AC_PROG_CC, and certainly before +# any checks for libraries, header files, types and library functions. +AC_DEFUN([gl_EARLY], +[ + m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace + m4_pattern_allow([^gl_ES$])dnl a valid locale name + m4_pattern_allow([^gl_LIBOBJS$])dnl a variable + m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable + AC_REQUIRE([AC_PROG_RANLIB]) + AC_REQUIRE([AC_GNU_SOURCE]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode + dnl for the builtin va_copy to work. With Autoconf 2.60 or later, + dnl AC_PROG_CC_STDC arranges for this. With older Autoconf AC_PROG_CC_STDC + dnl shouldn't hurt, though installers are on their own to set c99 mode. + AC_REQUIRE([AC_PROG_CC_STDC]) +]) + +# This macro should be invoked from ./configure.ac, in the section +# "Check for header files, types and library functions". +AC_DEFUN([gl_INIT], +[ + m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) + m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) + AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_source_base='.#bootmp/lib' + gl_FUNC_ALLOCA + gl_ALLOCSA + gl_ARGMATCH + gl_ARGP + gl_CANONICALIZE_LGPL + gl_FUNC_CHDIR_LONG + gl_FUNC_CHOWN + gl_UNISTD_MODULE_INDICATOR([chown]) + gl_CLOCK_TIME + gl_CLOSE_STREAM + gl_MODULE_INDICATOR([close-stream]) + gl_CLOSEOUT + gl_CHECK_TYPE_STRUCT_DIRENT_D_INO + gl_FUNC_DIRFD + gl_DIRNAME + gl_DOUBLE_SLASH_ROOT + gl_FUNC_DUP2 + gl_UNISTD_MODULE_INDICATOR([dup2]) + gl_ERROR + gl_EXITFAIL + gl_FUNC_FCHDIR + gl_UNISTD_MODULE_INDICATOR([fchdir]) + gl_FCNTL_H + gl_FCNTL_SAFER + gl_MODULE_INDICATOR([fcntl-safer]) + gl_FILEBLOCKS + gl_FLOAT_H + # No macro. You should also use one of fnmatch-posix or fnmatch-gnu. + gl_FUNC_FNMATCH_GNU + gl_FUNC_FPENDING + gl_FUNC_GETCWD + gl_UNISTD_MODULE_INDICATOR([getcwd]) + gl_GETDATE + gl_GETOPT + dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. + AM_GNU_GETTEXT_VERSION([0.16.1]) + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + gl_GETTIME + gl_FUNC_GETTIMEOFDAY + gl_HASH + gl_INLINE + gl_INTTOSTR + gl_INTTYPES_H + gl_FUNC_LCHOWN + gl_FUNC_LSTAT + AC_FUNC_MALLOC + gl_FUNC_MEMPCPY + gl_STRING_MODULE_INDICATOR([mempcpy]) + gl_FUNC_MEMRCHR + gl_STRING_MODULE_INDICATOR([memrchr]) + gl_FUNC_MKTIME + AC_FUNC_OBSTACK + dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]). + gl_FUNC_OPENAT + gl_PATHMAX + gl_QUOTE + gl_QUOTEARG + gl_FUNC_READLINK + gl_UNISTD_MODULE_INDICATOR([readlink]) + gl_SAFE_READ + gl_SAFE_WRITE + gl_SAVE_CWD + gl_SAVEDIR + gl_FUNC_SETENV + gl_FUNC_UNSETENV + gl_FUNC_SLEEP + gl_UNISTD_MODULE_INDICATOR([sleep]) + gt_TYPE_SSIZE_T + gl_STDARG_H + AM_STDBOOL_H + gl_STDINT_H + gl_STDIO_H + gl_STDLIB_H + gl_FUNC_STPCPY + gl_STRING_MODULE_INDICATOR([stpcpy]) + gl_STRCASE + gl_FUNC_STRCHRNUL + gl_STRING_MODULE_INDICATOR([strchrnul]) + gl_FUNC_STRDUP + gl_STRING_MODULE_INDICATOR([strdup]) + gl_FUNC_STRERROR + gl_HEADER_STRING_H + gl_FUNC_STRNDUP + gl_STRING_MODULE_INDICATOR([strndup]) + gl_FUNC_STRNLEN + gl_STRING_MODULE_INDICATOR([strnlen]) + gl_FUNC_STRTOL + gl_HEADER_SYS_STAT_H + AC_PROG_MKDIR_P + gl_HEADER_SYS_TIME_H + AC_PROG_MKDIR_P + gl_SYSEXITS + gl_HEADER_TIME_H + gl_TIME_R + gl_TIMESPEC + gl_UNISTD_H + gl_UNISTD_SAFER + gl_FUNC_GLIBC_UNLOCKED_IO + gl_UTIMENS + gl_FUNC_VASNPRINTF + gl_FUNC_VSNPRINTF + gl_STDIO_MODULE_INDICATOR([vsnprintf]) + gl_WCHAR_H + gl_WCTYPE_H + gl_XALLOC + gl_XGETCWD + gl_XSIZE + gl_XSTRNDUP + LIBCPIO_LIBDEPS="$gl_libdeps" + AC_SUBST([LIBCPIO_LIBDEPS]) + LIBCPIO_LTLIBDEPS="$gl_ltlibdeps" + AC_SUBST([LIBCPIO_LTLIBDEPS]) + m4_popdef([AC_LIBSOURCES]) + m4_popdef([AC_REPLACE_FUNCS]) + m4_popdef([AC_LIBOBJ]) + AC_CONFIG_COMMANDS_PRE([ + gl_libobjs= + gl_ltlibobjs= + if test -n "$gl_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do + gl_libobjs="$gl_libobjs $i.$ac_objext" + gl_ltlibobjs="$gl_ltlibobjs $i.lo" + done + fi + AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) + AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) + ]) +]) + +# Like AC_LIBOBJ, except that the module name goes +# into gl_LIBOBJS instead of into LIBOBJS. +AC_DEFUN([gl_LIBOBJ], + [gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"]) + +# Like AC_REPLACE_FUNCS, except that the module name goes +# into gl_LIBOBJS instead of into LIBOBJS. +AC_DEFUN([gl_REPLACE_FUNCS], + [AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])]) + +# Like AC_LIBSOURCES, except that it does nothing. +# We rely on EXTRA_lib..._SOURCES instead. +AC_DEFUN([gl_LIBSOURCES], + []) + +# This macro records the list of files which have been installed by +# gnulib-tool and may be removed by future gnulib-tool invocations. +AC_DEFUN([gl_FILE_LIST], [ + build-aux/config.rpath + build-aux/link-warning.h + doc/getdate.texi + lib/__fpending.c + lib/__fpending.h + lib/alloca.c + lib/alloca_.h + lib/allocsa.c + lib/allocsa.h + lib/allocsa.valgrind + lib/argmatch.c + lib/argmatch.h + lib/argp-ba.c + lib/argp-eexst.c + lib/argp-fmtstream.c + lib/argp-fmtstream.h + lib/argp-fs-xinl.c + lib/argp-help.c + lib/argp-namefrob.h + lib/argp-parse.c + lib/argp-pin.c + lib/argp-pv.c + lib/argp-pvh.c + lib/argp-xinl.c + lib/argp.h + lib/asnprintf.c + lib/at-func.c + lib/basename.c + lib/canonicalize-lgpl.c + lib/canonicalize.h + lib/chdir-long.c + lib/chdir-long.h + lib/chown.c + lib/close-stream.c + lib/close-stream.h + lib/closeout.c + lib/closeout.h + lib/creat-safer.c + lib/dirent_.h + lib/dirfd.c + lib/dirfd.h + lib/dirname.c + lib/dirname.h + lib/dup-safer.c + lib/dup2.c + lib/error.c + lib/error.h + lib/exitfail.c + lib/exitfail.h + lib/fchdir.c + lib/fchmodat.c + lib/fchown-stub.c + lib/fchownat.c + lib/fcntl--.h + lib/fcntl-safer.h + lib/fcntl_.h + lib/fd-safer.c + lib/fileblocks.c + lib/float+.h + lib/float_.h + lib/fnmatch.c + lib/fnmatch_.h + lib/fnmatch_loop.c + lib/fstatat.c + lib/full-write.c + lib/full-write.h + lib/getcwd.c + lib/getdate.h + lib/getdate.y + lib/getopt.c + lib/getopt1.c + lib/getopt_.h + lib/getopt_int.h + lib/gettext.h + lib/gettime.c + lib/gettimeofday.c + lib/hash.c + lib/hash.h + lib/imaxtostr.c + lib/intprops.h + lib/inttostr.c + lib/inttostr.h + lib/inttypes_.h + lib/lchown.c + lib/lchown.h + lib/lstat.c + lib/lstat.h + lib/malloc.c + lib/mempcpy.c + lib/memrchr.c + lib/mkdirat.c + lib/mktime.c + lib/obstack.c + lib/obstack.h + lib/offtostr.c + lib/open-safer.c + lib/openat-die.c + lib/openat-priv.h + lib/openat-proc.c + lib/openat.c + lib/openat.h + lib/pathmax.h + lib/pipe-safer.c + lib/printf-args.c + lib/printf-args.h + lib/printf-parse.c + lib/printf-parse.h + lib/quote.c + lib/quote.h + lib/quotearg.c + lib/quotearg.h + lib/readlink.c + lib/safe-read.c + lib/safe-read.h + lib/safe-write.c + lib/safe-write.h + lib/same-inode.h + lib/save-cwd.c + lib/save-cwd.h + lib/savedir.c + lib/savedir.h + lib/setenv.c + lib/setenv.h + lib/sleep.c + lib/stdbool_.h + lib/stdint_.h + lib/stdio_.h + lib/stdlib_.h + lib/stpcpy.c + lib/strcasecmp.c + lib/strchrnul.c + lib/strdup.c + lib/strerror.c + lib/string_.h + lib/stripslash.c + lib/strncasecmp.c + lib/strndup.c + lib/strnlen.c + lib/strtol.c + lib/sys_stat_.h + lib/sys_time_.h + lib/sysexits_.h + lib/time_.h + lib/time_r.c + lib/timespec.h + lib/uinttostr.c + lib/umaxtostr.c + lib/unistd--.h + lib/unistd-safer.h + lib/unistd_.h + lib/unlocked-io.h + lib/unsetenv.c + lib/utimens.c + lib/utimens.h + lib/vasnprintf.c + lib/vasnprintf.h + lib/verify.h + lib/version-etc-fsf.c + lib/version-etc.c + lib/version-etc.h + lib/vsnprintf.c + lib/wchar_.h + lib/wctype_.h + lib/xalloc-die.c + lib/xalloc.h + lib/xgetcwd.c + lib/xgetcwd.h + lib/xmalloc.c + lib/xsize.h + lib/xstrndup.c + lib/xstrndup.h + m4/absolute-header.m4 + m4/alloca.m4 + m4/allocsa.m4 + m4/argmatch.m4 + m4/argp.m4 + m4/bison.m4 + m4/canonicalize-lgpl.m4 + m4/chdir-long.m4 + m4/chown.m4 + m4/clock_time.m4 + m4/close-stream.m4 + m4/closeout.m4 + m4/codeset.m4 + m4/d-ino.m4 + m4/dirfd.m4 + m4/dirname.m4 + m4/dos.m4 + m4/double-slash-root.m4 + m4/dup2.m4 + m4/eealloc.m4 + m4/eoverflow.m4 + m4/error.m4 + m4/exitfail.m4 + m4/extensions.m4 + m4/fchdir.m4 + m4/fcntl-safer.m4 + m4/fcntl_h.m4 + m4/fileblocks.m4 + m4/float_h.m4 + m4/fnmatch.m4 + m4/fpending.m4 + m4/getcwd-abort-bug.m4 + m4/getcwd-path-max.m4 + m4/getcwd.m4 + m4/getdate.m4 + m4/getopt.m4 + m4/gettext.m4 + m4/gettime.m4 + m4/gettimeofday.m4 + m4/glibc2.m4 + m4/glibc21.m4 + m4/gnulib-common.m4 + m4/hash.m4 + m4/iconv.m4 + m4/inline.m4 + m4/intdiv0.m4 + m4/intl.m4 + m4/intldir.m4 + m4/intmax.m4 + m4/intmax_t.m4 + m4/inttostr.m4 + m4/inttypes-pri.m4 + m4/inttypes.m4 + m4/inttypes_h.m4 + m4/lchown.m4 + m4/lcmessage.m4 + m4/lib-ld.m4 + m4/lib-link.m4 + m4/lib-prefix.m4 + m4/lock.m4 + m4/longlong.m4 + m4/lstat.m4 + m4/mbrtowc.m4 + m4/mbstate_t.m4 + m4/mempcpy.m4 + m4/memrchr.m4 + m4/mktime.m4 + m4/nls.m4 + m4/onceonly_2_57.m4 + m4/openat.m4 + m4/pathmax.m4 + m4/po.m4 + m4/printf-posix.m4 + m4/progtest.m4 + m4/quote.m4 + m4/quotearg.m4 + m4/readlink.m4 + m4/safe-read.m4 + m4/safe-write.m4 + m4/save-cwd.m4 + m4/savedir.m4 + m4/setenv.m4 + m4/size_max.m4 + m4/sleep.m4 + m4/ssize_t.m4 + m4/stdarg.m4 + m4/stdbool.m4 + m4/stdint.m4 + m4/stdint_h.m4 + m4/stdio_h.m4 + m4/stdlib_h.m4 + m4/stpcpy.m4 + m4/strcase.m4 + m4/strchrnul.m4 + m4/strdup.m4 + m4/strerror.m4 + m4/string_h.m4 + m4/strndup.m4 + m4/strnlen.m4 + m4/strtol.m4 + m4/sys_stat_h.m4 + m4/sys_time_h.m4 + m4/sysexits.m4 + m4/time_h.m4 + m4/time_r.m4 + m4/timespec.m4 + m4/tm_gmtoff.m4 + m4/uintmax_t.m4 + m4/ulonglong.m4 + m4/unistd-safer.m4 + m4/unistd_h.m4 + m4/unlocked-io.m4 + m4/utimbuf.m4 + m4/utimens.m4 + m4/utimes.m4 + m4/vasnprintf.m4 + m4/visibility.m4 + m4/vsnprintf.m4 + m4/wchar.m4 + m4/wchar_t.m4 + m4/wctype.m4 + m4/wint_t.m4 + m4/xalloc.m4 + m4/xgetcwd.m4 + m4/xsize.m4 + m4/xstrndup.m4 +]) diff --git a/m4/hash.m4 b/m4/hash.m4 new file mode 100644 index 0000000..1b1873c --- /dev/null +++ b/m4/hash.m4 @@ -0,0 +1,13 @@ +# hash.m4 serial 6 +dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_HASH], +[ + AC_LIBOBJ([hash]) + + dnl Prerequisites of lib/hash.c. + AC_REQUIRE([AM_STDBOOL_H]) +]) diff --git a/m4/iconv.m4 b/m4/iconv.m4 new file mode 100644 index 0000000..8e36b52 --- /dev/null +++ b/m4/iconv.m4 @@ -0,0 +1,180 @@ +# iconv.m4 serial AM6 (gettext-0.16.2) +dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ + dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + AC_TRY_RUN([ +#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; +}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + LIBS="$am_save_LIBS" + ]) + 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 + AC_DEFINE(HAVE_ICONV, 1, + [Define if you have the iconv() function and it works.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST(LIBICONV) + AC_SUBST(LTLIBICONV) +]) + +AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + 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);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi +]) diff --git a/m4/inline.m4 b/m4/inline.m4 new file mode 100644 index 0000000..a07076c --- /dev/null +++ b/m4/inline.m4 @@ -0,0 +1,40 @@ +# inline.m4 serial 3 +dnl Copyright (C) 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Test for the 'inline' keyword or equivalent. +dnl Define 'inline' to a supported equivalent, or to nothing if not supported, +dnl like AC_C_INLINE does. Also, define HAVE_INLINE if 'inline' or an +dnl equivalent is effectively supported, i.e. if the compiler is likely to +dnl drop unused 'static inline' functions. +AC_DEFUN([gl_INLINE], +[ + AC_REQUIRE([AC_C_INLINE]) + AC_CACHE_CHECK([whether the compiler generally respects inline], + [gl_cv_c_inline_effective], + [if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is + dnl specified. + dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result + dnl depends on optimization flags, which can be in CFLAGS. + dnl (AC_EGREP_CPP looks only at the CPPFLAGS.) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], + [[#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif]])], + [gl_cv_c_inline_effective=yes], + [gl_cv_c_inline_effective=no]) + fi + ]) + if test $gl_cv_c_inline_effective = yes; then + AC_DEFINE([HAVE_INLINE], 1, + [Define to 1 if the compiler supports one of the keywords + 'inline', '__inline__', '__inline' and effectively inlines + functions marked as such.]) + fi +]) diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4 new file mode 100644 index 0000000..17c7b0a --- /dev/null +++ b/m4/intmax_t.m4 @@ -0,0 +1,61 @@ +# intmax_t.m4 serial 5 +dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +AC_PREREQ(2.13) + +# Define intmax_t to 'long' or 'long long' +# if it is not already defined in or . + +AC_DEFUN([gl_AC_TYPE_INTMAX_T], +[ + dnl For simplicity, we assume that a header file defines 'intmax_t' if and + dnl only if it defines 'uintmax_t'. + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then + AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) + test $ac_cv_type_long_long = yes \ + && ac_type='long long' \ + || ac_type='long' + AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + [Define to long or long long if and don't define.]) + else + AC_DEFINE(HAVE_INTMAX_T, 1, + [Define if you have the 'intmax_t' type in or .]) + fi +]) + +dnl An alternative would be to explicitly test for 'intmax_t'. + +AC_DEFUN([gt_AC_TYPE_INTMAX_T], +[ + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, + [AC_TRY_COMPILE([ +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif +], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) + if test $gt_cv_c_intmax_t = yes; then + AC_DEFINE(HAVE_INTMAX_T, 1, + [Define if you have the 'intmax_t' type in or .]) + else + AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) + test $ac_cv_type_long_long = yes \ + && ac_type='long long' \ + || ac_type='long' + AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + [Define to long or long long if and don't define.]) + fi +]) diff --git a/m4/inttostr.m4 b/m4/inttostr.m4 new file mode 100644 index 0000000..0a41fad --- /dev/null +++ b/m4/inttostr.m4 @@ -0,0 +1,37 @@ +#serial 7 +dnl Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_INTTOSTR], +[ + AC_LIBOBJ([imaxtostr]) + AC_LIBOBJ([offtostr]) + AC_LIBOBJ([umaxtostr]) + AC_LIBOBJ([uinttostr]) + + gl_PREREQ_INTTOSTR + gl_PREREQ_IMAXTOSTR + gl_PREREQ_OFFTOSTR + gl_PREREQ_UMAXTOSTR + gl_PREREQ_UINTTOSTR +]) + +# Prerequisites of lib/inttostr.h. +AC_DEFUN([gl_PREREQ_INTTOSTR], [ + AC_REQUIRE([AC_TYPE_OFF_T]) + : +]) + +# Prerequisites of lib/imaxtostr.c. +AC_DEFUN([gl_PREREQ_IMAXTOSTR], [:]) + +# Prerequisites of lib/offtostr.c. +AC_DEFUN([gl_PREREQ_OFFTOSTR], [:]) + +# Prerequisites of lib/umaxtostr.c. +AC_DEFUN([gl_PREREQ_UMAXTOSTR], [:]) + +# Prerequisites of lib/uinttostr.c. +AC_DEFUN([gl_PREREQ_UINTTOSTR], [:]) diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 new file mode 100644 index 0000000..7c7f894 --- /dev/null +++ b/m4/inttypes-pri.m4 @@ -0,0 +1,36 @@ +# inttypes-pri.m4 serial 4 (gettext-0.16) +dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_PREREQ(2.52) + +# Define PRI_MACROS_BROKEN if exists and defines the PRI* +# macros to non-string values. This is the case on AIX 4.3.3. + +AC_DEFUN([gt_INTTYPES_PRI], +[ + AC_CHECK_HEADERS([inttypes.h]) + if test $ac_cv_header_inttypes_h = yes; then + AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], + gt_cv_inttypes_pri_broken, + [ + AC_TRY_COMPILE([#include +#ifdef PRId32 +char *p = PRId32; +#endif +], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) + ]) + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, + [Define if exists and defines unusable PRI* macros.]) + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + AC_SUBST([PRI_MACROS_BROKEN]) +]) diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 new file mode 100644 index 0000000..095ace9 --- /dev/null +++ b/m4/inttypes.m4 @@ -0,0 +1,223 @@ +# inttypes.m4 serial 8 +dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Derek Price, Bruno Haible. +dnl Test whether is supported or must be substituted. + +AC_DEFUN([gl_INTTYPES_H], +[ + AC_REQUIRE([gl_STDINT_H]) + AC_REQUIRE([gt_INTTYPES_PRI]) + AC_CHECK_DECLS_ONCE([imaxabs]) + AC_CHECK_DECLS_ONCE([imaxdiv]) + AC_CHECK_DECLS_ONCE([strtoimax]) + AC_CHECK_DECLS_ONCE([strtoumax]) + + dnl Now see if we need a substitute . + dnl A complete requires + dnl - a complete , + dnl - the existence of an , + dnl - that imaxabs, imaxdiv, strtoimax, strtoumax are declared, + dnl - some additional tests. + AC_CACHE_CHECK([whether inttypes.h conforms to C99], + [gl_cv_header_working_inttypes_h], + [gl_cv_header_working_inttypes_h=no + if test "$gl_cv_header_working_stdint_h" = yes \ + && test $ac_cv_header_inttypes_h = yes \ + && test "$ac_cv_have_decl_imaxabs" = yes \ + && test "$ac_cv_have_decl_imaxdiv" = yes \ + && test "$ac_cv_have_decl_strtoimax" = yes \ + && test "$ac_cv_have_decl_strtoumax" = yes; then + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ +#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 + +/* No need to duplicate the tests of stdint.m4; they are subsumed by + $gl_cv_header_working_stdint_h = yes. */ + +/* Tests for macros supposed to be defined in inttypes.h. */ + +const char *k = /* implicit string concatenation */ +#ifdef INT8_MAX + PRId8 PRIi8 +#endif +#ifdef UINT8_MAX + PRIo8 PRIu8 PRIx8 PRIX8 +#endif +#ifdef INT16_MAX + PRId16 PRIi16 +#endif +#ifdef UINT16_MAX + PRIo16 PRIu16 PRIx16 PRIX16 +#endif +#ifdef INT32_MAX + PRId32 PRIi32 +#endif +#ifdef UINT32_MAX + PRIo32 PRIu32 PRIx32 PRIX32 +#endif +#ifdef INT64_MAX + PRId64 PRIi64 +#endif +#ifdef UINT64_MAX + PRIo64 PRIu64 PRIx64 PRIX64 +#endif + PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8 + PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16 + PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32 + PRIdLEAST64 PRIiLEAST64 + PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64 + PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8 + PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16 + PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32 + PRIdFAST64 PRIiFAST64 + PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64 + PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX +#ifdef INTPTR_MAX + PRIdPTR PRIiPTR +#endif +#ifdef UINTPTR_MAX + PRIoPTR PRIuPTR PRIxPTR PRIXPTR +#endif + ; +const char *l = /* implicit string concatenation */ +#ifdef INT8_MAX + SCNd8 SCNi8 +#endif +#ifdef UINT8_MAX + SCNo8 SCNu8 SCNx8 +#endif +#ifdef INT16_MAX + SCNd16 SCNi16 +#endif +#ifdef UINT16_MAX + SCNo16 SCNu16 SCNx16 +#endif +#ifdef INT32_MAX + SCNd32 SCNi32 +#endif +#ifdef UINT32_MAX + SCNo32 SCNu32 SCNx32 +#endif +#ifdef INT64_MAX + SCNd64 SCNi64 +#endif +#ifdef UINT64_MAX + SCNo64 SCNu64 SCNx64 +#endif + SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8 + SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16 + SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32 + SCNdLEAST64 SCNiLEAST64 + SCNoLEAST64 SCNuLEAST64 SCNxLEAST64 + SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8 + SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16 + SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32 + SCNdFAST64 SCNiFAST64 + SCNoFAST64 SCNuFAST64 SCNxFAST64 + SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX +#ifdef INTPTR_MAX + SCNdPTR SCNiPTR +#endif +#ifdef UINTPTR_MAX + SCNoPTR SCNuPTR SCNxPTR +#endif + ; + ])], + [gl_cv_header_working_inttypes_h=yes]) + fi]) + + dnl Override always, so that the portability warnings work. + if false && test $gl_cv_header_working_inttypes_h = yes; then + dnl Use the existing . + INTTYPES_H='' + else + + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. + if test $ac_cv_header_inttypes_h = yes; then + gl_ABSOLUTE_HEADER([inttypes.h]) + ABSOLUTE_INTTYPES_H=\"$gl_cv_absolute_inttypes_h\" + else + ABSOLUTE_INTTYPES_H=\"no/such/file/inttypes.h\" + fi + AC_SUBST([ABSOLUTE_INTTYPES_H]) + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + dnl Using the gnulib . It always defines intptr_t to 'long'. + PRIPTR_PREFIX='"l"' + else + dnl Using the system's . + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([#include + extern intptr_t foo; + extern $gltype1 foo;])], + [PRIPTR_PREFIX='"'$glpfx'"']) + test -n "$PRIPTR_PREFIX" && break + done + fi + AC_SUBST([PRIPTR_PREFIX]) + + if test "$ac_cv_have_decl_imaxabs" = yes; then + HAVE_DECL_IMAXABS=1 + else + HAVE_DECL_IMAXABS=0 + fi + + if test "$ac_cv_have_decl_imaxdiv" = yes; then + HAVE_DECL_IMAXDIV=1 + else + HAVE_DECL_IMAXDIV=0 + fi + + if test "$ac_cv_have_decl_strtoimax" = yes; then + HAVE_DECL_STRTOIMAX=1 + else + HAVE_DECL_STRTOIMAX=0 + fi + + if test "$ac_cv_have_decl_strtoumax" = yes; then + HAVE_DECL_STRTOUMAX=1 + else + HAVE_DECL_STRTOUMAX=0 + fi + + INTTYPES_H='inttypes.h' + fi + AC_SUBST(INTTYPES_H) +]) + +AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_INTTYPES_H_DEFAULTS], +[ + GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS]) + GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV]) + GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX]) + GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS]) + HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) + HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) + HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) +]) diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 new file mode 100644 index 0000000..edc8ecb --- /dev/null +++ b/m4/inttypes_h.m4 @@ -0,0 +1,26 @@ +# inttypes_h.m4 serial 7 +dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN([gl_AC_HEADER_INTTYPES_H], +[ + AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, + [AC_TRY_COMPILE( + [#include +#include ], + [uintmax_t i = (uintmax_t) -1; return !i;], + gl_cv_header_inttypes_h=yes, + gl_cv_header_inttypes_h=no)]) + if test $gl_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff --git a/m4/lchown.m4 b/m4/lchown.m4 new file mode 100644 index 0000000..a7b3572 --- /dev/null +++ b/m4/lchown.m4 @@ -0,0 +1,19 @@ +#serial 11 + +dnl Copyright (C) 1998, 2001, 2003, 2004, 2005, 2006 Free Software +dnl Foundation, Inc. + +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. +dnl Provide lchown on systems that lack it. + +AC_DEFUN([gl_FUNC_LCHOWN], +[ + AC_REQUIRE([AC_TYPE_UID_T]) + AC_REQUIRE([gl_FUNC_CHOWN]) + AC_CHECK_DECLS_ONCE([lchown]) + AC_REPLACE_FUNCS(lchown) +]) diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 new file mode 100644 index 0000000..96c4e2c --- /dev/null +++ b/m4/lib-ld.m4 @@ -0,0 +1,110 @@ +# lib-ld.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Subroutines of libtool.m4, +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision +dnl with libtool.m4. + +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 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 +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(acl_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$acl_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_LIB_PROG_LD_GNU +]) diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 new file mode 100644 index 0000000..f157d98 --- /dev/null +++ b/m4/lib-link.m4 @@ -0,0 +1,709 @@ +# lib-link.m4 serial 13 (gettext-0.16.2) +dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_PREREQ(2.54) + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + AC_SUBST([LIB]NAME[_PREFIX]) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. If found, it +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + LIB[]NAME[]_PREFIX= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + AC_SUBST([LIB]NAME[_PREFIX]) + undefine([Name]) + undefine([NAME]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl acl_libext, +dnl acl_shlibext, +dnl acl_hardcode_libdir_flag_spec, +dnl acl_hardcode_libdir_separator, +dnl acl_hardcode_direct, +dnl acl_hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + dnl Tell automake >= 1.10 to complain if config.rpath is missing. + m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found +dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl Autoconf >= 2.61 supports dots in --with options. + define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], +[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + LIB[]NAME[]_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + dnl The same code as in the loop below: + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$acl_hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIB[]NAME[]_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) + +dnl For those cases where a variable contains several -L and -l options +dnl referring to unknown libraries and directories, this macro determines the +dnl necessary additional linker options for the runtime path. +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) +dnl sets LDADDVAR to linker options needed together with LIBSVALUE. +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, +dnl otherwise linking without libtool is assumed. +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], +[ + AC_REQUIRE([AC_LIB_RPATH]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + $1= + if test "$enable_rpath" != no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode directories into the resulting + dnl binary. + rpathdirs= + next= + for opt in $2; do + if test -n "$next"; then + dir="$next" + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""$3""; then + dnl libtool is used for linking. Use -R options. + for dir in $rpathdirs; do + $1="${$1}${$1:+ }-R$dir" + done + else + dnl The linker is used for linking directly. + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user + dnl must pass all path elements in one option. + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="$flag" + else + dnl The -rpath options are cumulative. + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="${$1}${$1:+ }$flag" + done + fi + fi + fi + fi + fi + AC_SUBST([$1]) +]) diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 new file mode 100644 index 0000000..a8684e1 --- /dev/null +++ b/m4/lib-prefix.m4 @@ -0,0 +1,185 @@ +# lib-prefix.m4 serial 5 (gettext-0.15) +dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing +dnl the basename of the libdir, either "lib" or "lib64". +AC_DEFUN([AC_LIB_PREPARE_MULTILIB], +[ + dnl There is no formal standard regarding lib and lib64. The current + dnl practice is that on a system supporting 32-bit and 64-bit instruction + dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit + dnl libraries go under $prefix/lib. We determine the compiler's default + dnl mode by looking at the compiler's library search path. If at least + dnl of its elements ends in /lib64 or points to a directory whose absolute + dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the + dnl default, namely "lib". + 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 ;; + esac + fi + done + IFS="$acl_save_IFS" + fi +]) diff --git a/m4/longlong.m4 b/m4/longlong.m4 new file mode 100644 index 0000000..1f9e862 --- /dev/null +++ b/m4/longlong.m4 @@ -0,0 +1,72 @@ +# longlong.m4 serial 10 +dnl Copyright (C) 1999-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_LONG_LONG_INT if 'long long int' works. +# This fixes a bug in Autoconf 2.60, but can be removed once we +# assume 2.61 everywhere. + +# Note: If the type 'long long int' exists but is only 32 bits large +# (as on some very old compilers), HAVE_LONG_LONG_INT will not be +# defined. In this case you can treat 'long long int' like 'long int'. + +AC_DEFUN([AC_TYPE_LONG_LONG_INT], +[ + AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + typedef int a[((-9223372036854775807LL < 0 + && 0 < 9223372036854775807ll) + ? 1 : -1)]; + int i = 63;]], + [[long long int llmax = 9223372036854775807ll; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll));]])], + [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. + dnl If cross compiling, assume the bug isn't important, since + dnl nobody cross compiles for this platform as far as we know. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[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;]])], + [ac_cv_type_long_long_int=yes], + [ac_cv_type_long_long_int=no], + [ac_cv_type_long_long_int=yes])], + [ac_cv_type_long_long_int=no])]) + if test $ac_cv_type_long_long_int = yes; then + AC_DEFINE([HAVE_LONG_LONG_INT], 1, + [Define to 1 if the system has the type `long long int'.]) + fi +]) + +# This macro is obsolescent and should go away soon. +AC_DEFUN([gl_AC_TYPE_LONG_LONG], +[ + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + ac_cv_type_long_long=$ac_cv_type_long_long_int + if test $ac_cv_type_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, + [Define if you have the 'long long' type.]) + fi +]) diff --git a/m4/lstat.m4 b/m4/lstat.m4 new file mode 100644 index 0000000..b9777a6 --- /dev/null +++ b/m4/lstat.m4 @@ -0,0 +1,17 @@ +#serial 16 + +# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 +# 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. + +dnl From Jim Meyering. + +AC_DEFUN([gl_FUNC_LSTAT], +[ + AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK + dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ(lstat). + : +]) diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 new file mode 100644 index 0000000..a3bd911 --- /dev/null +++ b/m4/mbrtowc.m4 @@ -0,0 +1,31 @@ +# mbrtowc.m4 serial 8 +dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert + +dnl This file can be removed, and gl_FUNC_MBRTOWC replaced with +dnl AC_FUNC_MBRTOWC, when autoconf 2.60 can be assumed everywhere. + +AC_DEFUN([gl_FUNC_MBRTOWC], +[ + dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. + AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], + gl_cv_func_mbrtowc, + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[wchar_t wc; + char const s[] = ""; + size_t n = 1; + mbstate_t state; + return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])], + gl_cv_func_mbrtowc=yes, + gl_cv_func_mbrtowc=no)]) + if test $gl_cv_func_mbrtowc = yes; then + AC_DEFINE([HAVE_MBRTOWC], 1, + [Define to 1 if mbrtowc and mbstate_t are properly declared.]) + fi +]) diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4 new file mode 100644 index 0000000..df2a275 --- /dev/null +++ b/m4/mbstate_t.m4 @@ -0,0 +1,30 @@ +# mbstate_t.m4 serial 9 +dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# From Paul Eggert. + +# BeOS 5 has but does not define mbstate_t, +# so you can't declare an object of that type. +# Check for this incompatibility with Standard C. + +# AC_TYPE_MBSTATE_T +# ----------------- +AC_DEFUN([AC_TYPE_MBSTATE_T], + [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT +# include ], + [mbstate_t x; return sizeof x;])], + [ac_cv_type_mbstate_t=yes], + [ac_cv_type_mbstate_t=no])]) + if test $ac_cv_type_mbstate_t = yes; then + AC_DEFINE([HAVE_MBSTATE_T], 1, + [Define to 1 if declares mbstate_t.]) + else + AC_DEFINE([mbstate_t], int, + [Define to a type if does not define.]) + fi]) diff --git a/m4/mempcpy.m4 b/m4/mempcpy.m4 new file mode 100644 index 0000000..9e854e8 --- /dev/null +++ b/m4/mempcpy.m4 @@ -0,0 +1,26 @@ +# mempcpy.m4 serial 7 +dnl Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MEMPCPY], +[ + dnl Persuade glibc to declare mempcpy(). + AC_REQUIRE([AC_GNU_SOURCE]) + + dnl The mempcpy() declaration in lib/string_.h uses 'restrict'. + AC_REQUIRE([AC_C_RESTRICT]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REPLACE_FUNCS(mempcpy) + if test $ac_cv_func_mempcpy = no; then + HAVE_MEMPCPY=0 + gl_PREREQ_MEMPCPY + fi +]) + +# Prerequisites of lib/mempcpy.c. +AC_DEFUN([gl_PREREQ_MEMPCPY], [ + : +]) diff --git a/m4/memrchr.m4 b/m4/memrchr.m4 new file mode 100644 index 0000000..69674ff --- /dev/null +++ b/m4/memrchr.m4 @@ -0,0 +1,25 @@ +# memrchr.m4 serial 7 +dnl Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MEMRCHR], +[ + dnl Persuade glibc to declare memrchr(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([memrchr]) + if test $ac_cv_have_decl_memrchr = no; then + HAVE_DECL_MEMRCHR=0 + fi + + AC_REPLACE_FUNCS(memrchr) + if test $ac_cv_func_memrchr = no; then + gl_PREREQ_MEMRCHR + fi +]) + +# Prerequisites of lib/memrchr.c. +AC_DEFUN([gl_PREREQ_MEMRCHR], [:]) diff --git a/m4/mktime.m4 b/m4/mktime.m4 new file mode 100644 index 0000000..5faf393 --- /dev/null +++ b/m4/mktime.m4 @@ -0,0 +1,227 @@ +#serial 13 +dnl Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. + +# Redefine AC_FUNC_MKTIME, to fix a bug in Autoconf 2.61a and earlier. +# This redefinition can be removed once a new version of Autoconf is assumed. +# The redefinition is taken from +# . +# AC_FUNC_MKTIME +# -------------- +AC_DEFUN([AC_FUNC_MKTIME], +[AC_CHECK_HEADERS_ONCE(unistd.h) +AC_CHECK_FUNCS_ONCE(alarm) +AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime, +[AC_RUN_IFELSE([AC_LANG_SOURCE( +[[/* Test program from Paul Eggert and Tony Leneis. */ +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef HAVE_ALARM +# define alarm(X) /* empty */ +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static char *tz_strings[] = { + (char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (now) + time_t now; +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (now) + time_t now; +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (j) + int j; +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + time_t t, delta; + int i, j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + alarm (60); + + for (;;) + { + t = (time_t_max << 1) + 1; + if (t <= time_t_max) + break; + time_t_max = t; + } + time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) + if (! mktime_test (t)) + return 1; + if (! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + return 1; + + for (j = 1; ; j <<= 1) + if (! bigtime_test (j)) + return 1; + else if (INT_MAX / 2 < j) + break; + if (! bigtime_test (INT_MAX)) + return 1; + } + return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); +}]])], + [ac_cv_func_working_mktime=yes], + [ac_cv_func_working_mktime=no], + [ac_cv_func_working_mktime=no])]) +if test $ac_cv_func_working_mktime = no; then + AC_LIBOBJ([mktime]) +fi +])# AC_FUNC_MKTIME + +AC_DEFUN([gl_FUNC_MKTIME], +[ + AC_FUNC_MKTIME + dnl Note: AC_FUNC_MKTIME does AC_LIBOBJ(mktime). + if test $ac_cv_func_working_mktime = no; then + AC_DEFINE(mktime, rpl_mktime, + [Define to rpl_mktime if the replacement function should be used.]) + gl_PREREQ_MKTIME + fi +]) + +# Prerequisites of lib/mktime.c. +AC_DEFUN([gl_PREREQ_MKTIME], +[ + AC_REQUIRE([AC_C_INLINE]) +]) diff --git a/m4/nls.m4 b/m4/nls.m4 new file mode 100644 index 0000000..7967cc2 --- /dev/null +++ b/m4/nls.m4 @@ -0,0 +1,31 @@ +# nls.m4 serial 3 (gettext-0.15) +dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +AC_PREREQ(2.50) + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) +]) diff --git a/m4/onceonly_2_57.m4 b/m4/onceonly_2_57.m4 new file mode 100644 index 0000000..15884b3 --- /dev/null +++ b/m4/onceonly_2_57.m4 @@ -0,0 +1,86 @@ +# onceonly_2_57.m4 serial 4 +dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl This file defines some "once only" variants of standard autoconf macros. +dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS +dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS +dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS +dnl AC_REQUIRE([AC_FUNC_STRCOLL]) like AC_FUNC_STRCOLL +dnl The advantage is that the check for each of the headers/functions/decls +dnl will be put only once into the 'configure' file. It keeps the size of +dnl the 'configure' file down, and avoids redundant output when 'configure' +dnl is run. +dnl The drawback is that the checks cannot be conditionalized. If you write +dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi +dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to +dnl empty, and the check will be inserted before the body of the AC_DEFUNed +dnl function. + +dnl This is like onceonly.m4, except that it uses diversions to named sections +dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once, +dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The +dnl size reduction is ca. 9%. + +dnl Autoconf version 2.57 or newer is recommended. +AC_PREREQ(2.57) + +# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of +# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). +AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ + : + AC_FOREACH([gl_HEADER_NAME], [$1], [ + AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, + [./-], [___])), [ + m4_divert_text([INIT_PREPARE], + [gl_header_list="$gl_header_list gl_HEADER_NAME"]) + gl_HEADERS_EXPANSION + AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])), + [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.]) + ]) + AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, + [./-], [___]))) + ]) +]) +m4_define([gl_HEADERS_EXPANSION], [ + m4_divert_text([DEFAULTS], [gl_header_list=]) + AC_CHECK_HEADERS([$gl_header_list]) + m4_define([gl_HEADERS_EXPANSION], []) +]) + +# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of +# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). +AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ + : + AC_FOREACH([gl_FUNC_NAME], [$1], [ + AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ + m4_divert_text([INIT_PREPARE], + [gl_func_list="$gl_func_list gl_FUNC_NAME"]) + gl_FUNCS_EXPANSION + AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])), + [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.]) + ]) + AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) + ]) +]) +m4_define([gl_FUNCS_EXPANSION], [ + m4_divert_text([DEFAULTS], [gl_func_list=]) + AC_CHECK_FUNCS([$gl_func_list]) + m4_define([gl_FUNCS_EXPANSION], []) +]) + +# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of +# AC_CHECK_DECLS(DECL1, DECL2, ...). +AC_DEFUN([AC_CHECK_DECLS_ONCE], [ + : + AC_FOREACH([gl_DECL_NAME], [$1], [ + AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ + AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) + ]) + AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) + ]) +]) diff --git a/m4/openat.m4 b/m4/openat.m4 new file mode 100644 index 0000000..43f46d0 --- /dev/null +++ b/m4/openat.m4 @@ -0,0 +1,90 @@ +#serial 15 +# See if we need to use our replacement for Solaris' openat et al functions. + +dnl Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Written by Jim Meyering. + +AC_DEFUN([gl_FUNC_OPENAT], +[ + AC_LIBOBJ([openat-proc]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_FUNCS_ONCE([lchmod]) + AC_CHECK_FUNCS_ONCE([fdopendir]) + AC_REPLACE_FUNCS([fchmodat mkdirat openat]) + case $ac_cv_func_openat+$ac_cv_func_lstat_dereferences_slashed_symlink in + yes+yes) ;; + yes+*) AC_LIBOBJ([fstatat]);; + *) + AC_DEFINE([__OPENAT_PREFIX], [[rpl_]], + [Define to rpl_ if the openat replacement function should be used.]) + gl_PREREQ_OPENAT;; + esac + gl_FUNC_FCHOWNAT +]) + +# gl_FUNC_FCHOWNAT_DEREF_BUG([ACTION-IF-BUGGY[, ACTION-IF-NOT_BUGGY]]) +AC_DEFUN([gl_FUNC_FCHOWNAT_DEREF_BUG], +[ + AC_CACHE_CHECK([whether fchownat works with AT_SYMLINK_NOFOLLOW], + gl_cv_func_fchownat_nofollow_works, + [ + gl_dangle=conftest.dangle + # Remove any remnants of a previous test. + rm -f $gl_dangle + # Arrange for deletion of the temporary file this test creates. + ac_clean_files="$ac_clean_files $gl_dangle" + ln -s conftest.no-such $gl_dangle + AC_RUN_IFELSE( + [AC_LANG_SOURCE( + [[ +#include +#include +#include +#include +#include +int +main () +{ + return (fchownat (AT_FDCWD, "$gl_dangle", -1, getgid (), + AT_SYMLINK_NOFOLLOW) != 0 + && errno == ENOENT); +} + ]])], + [gl_cv_func_fchownat_nofollow_works=yes], + [gl_cv_func_fchownat_nofollow_works=no], + [gl_cv_func_fchownat_nofollow_works=no], + ) + ]) + AS_IF([test $gl_cv_func_fchownat_nofollow_works = no], [$1], [$2]) +]) + +# If we have the fchownat function, and it has the bug (in glibc-2.4) +# that it dereferences symlinks even with AT_SYMLINK_NOFOLLOW, then +# use the replacement function. +# Also use the replacement function if fchownat is simply not available. +AC_DEFUN([gl_FUNC_FCHOWNAT], +[ + # Assume we'll use the replacement function. + # The only case in which we won't is when we have fchownat, and it works. + use_replacement_fchownat=yes + + AC_CHECK_FUNC([fchownat], [have_fchownat=yes], [have_fchownat=no]) + if test $have_fchownat = yes; then + gl_FUNC_FCHOWNAT_DEREF_BUG([], [use_replacement_fchownat=no]) + fi + + if test $use_replacement_fchownat = yes; then + AC_LIBOBJ(fchownat) + AC_DEFINE(fchownat, rpl_fchownat, + [Define to rpl_fchownat if the replacement function should be used.]) + fi +]) + +AC_DEFUN([gl_PREREQ_OPENAT], +[ + : +]) diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 new file mode 100644 index 0000000..64bf26f --- /dev/null +++ b/m4/pathmax.m4 @@ -0,0 +1,11 @@ +# pathmax.m4 serial 6 +dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_PATHMAX], +[ + dnl Prerequisites of lib/pathmax.h. + AC_CHECK_HEADERS_ONCE(sys/param.h) +]) diff --git a/m4/paxutils.m4 b/m4/paxutils.m4 new file mode 100644 index 0000000..9419c95 --- /dev/null +++ b/m4/paxutils.m4 @@ -0,0 +1,7 @@ +# This file is generated automatically. Please, do not edit. +# +AC_DEFUN([cpio_PAXUTILS],[ +PU_RMT +PU_RTAPELIB +PU_SYSTEM +]) diff --git a/m4/po.m4 b/m4/po.m4 new file mode 100644 index 0000000..00133ef --- /dev/null +++ b/m4/po.m4 @@ -0,0 +1,428 @@ +# po.m4 serial 13 (gettext-0.15) +dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +AC_PREREQ(2.50) + +dnl Checks for all prerequisites of the po subdirectory. +AC_DEFUN([AM_PO_SUBDIRS], +[ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + AC_REQUIRE([AM_NLS])dnl + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Test whether it is GNU msgfmt >= 0.15. +changequote(,)dnl + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([MSGFMT_015]) +changequote(,)dnl + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([GMSGFMT_015]) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Test whether it is GNU xgettext >= 0.15. +changequote(,)dnl + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac +changequote([,])dnl + AC_SUBST([XGETTEXT_015]) + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) + + dnl Installation directories. + dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we + dnl have to define it here, so that it can be used in po/Makefile. + test -n "$localedir" || localedir='${datadir}/locale' + AC_SUBST([localedir]) + + AC_CONFIG_COMMANDS([po-directories], [[ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done]], + [# 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. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) +]) + +dnl Postprocesses a Makefile in a directory containing PO files. +AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], +[ + # When this code is run, in config.status, two variables have already been + # set: + # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, + # - LINGUAS is the value of the environment variable LINGUAS at configure + # time. + +changequote(,)dnl + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + # Find a way to echo strings without interpreting backslash. + if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='echo' + else + if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='printf %s\n' + else + echo_func () { + cat < "$ac_file.tmp" + if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + cat >> "$ac_file.tmp" < /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` + cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. + +AC_PREREQ(2.50) + +# Search path for a program which passes the given test. + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[ +# Prepare PATH_SEPARATOR. +# 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 + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in ifelse([$5], , $PATH, [$5]); do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) diff --git a/m4/quote.m4 b/m4/quote.m4 new file mode 100644 index 0000000..0f08791 --- /dev/null +++ b/m4/quote.m4 @@ -0,0 +1,13 @@ +# quote.m4 serial 5 +dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_QUOTE], +[ + AC_LIBOBJ([quote]) + + dnl Prerequisites of lib/quote.c. + dnl (none) +]) diff --git a/m4/quotearg.m4 b/m4/quotearg.m4 new file mode 100644 index 0000000..db635d0 --- /dev/null +++ b/m4/quotearg.m4 @@ -0,0 +1,15 @@ +# quotearg.m4 serial 6 +dnl Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_QUOTEARG], +[ + AC_LIBOBJ([quotearg]) + + dnl Prerequisites of lib/quotearg.c. + AC_CHECK_FUNCS_ONCE([mbsinit]) + AC_TYPE_MBSTATE_T + gl_FUNC_MBRTOWC +]) diff --git a/m4/readlink.m4 b/m4/readlink.m4 new file mode 100644 index 0000000..1c347a0 --- /dev/null +++ b/m4/readlink.m4 @@ -0,0 +1,29 @@ +# readlink.m4 serial 4 +dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_READLINK], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([readlink]) + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + AC_LIBOBJ(readlink) + gl_PREREQ_READLINK + fi +]) + +# Like gl_FUNC_READLINK, except prepare for separate compilation (no AC_LIBOBJ). +AC_DEFUN([gl_FUNC_READLINK_SEPARATE], +[ + AC_CHECK_FUNCS_ONCE([readlink]) + gl_PREREQ_READLINK +]) + +# Prerequisites of lib/readlink.c. +AC_DEFUN([gl_PREREQ_READLINK], +[ + : +]) diff --git a/m4/rmt.m4 b/m4/rmt.m4 new file mode 100644 index 0000000..4a82e09 --- /dev/null +++ b/m4/rmt.m4 @@ -0,0 +1,74 @@ + +AC_DEFUN([PU_RMT],[ + # Set LIB_SETSOCKOPT to -lnsl -lsocket if necessary. + pu_save_LIBS=$LIBS + LIB_SETSOCKOPT= + AC_SEARCH_LIBS(setsockopt, [socket], , + [AC_SEARCH_LIBS(setsockopt, [socket], , , [-lnsl])]) + AC_SEARCH_LIBS(setsockopt, [nsl]) + + case "$ac_cv_search_setsockopt" in + -l*) LIB_SETSOCKOPT=$ac_cv_search_setsockopt + esac + AC_SUBST(LIB_SETSOCKOPT) + LIBS=$pu_save_LIBS + + AC_CHECK_FUNCS_ONCE([strerror]) + enable_rmt() { + if test $ac_cv_header_sys_mtio_h = yes; then + AC_CACHE_CHECK(for remote tape header files, pu_cv_header_rmt, + [AC_TRY_CPP([ +#if HAVE_SGTTY_H +# include +#endif +#include ], + pu_cv_header_rmt=yes, + pu_cv_header_rmt=no)]) + test $pu_cv_header_rmt = yes && PU_RMT_PROG='rmt$(EXEEXT)' + AC_SUBST(PU_RMT_PROG) + fi + } + + AC_CHECK_HEADERS([sys/mtio.h]) + AC_CACHE_CHECK(which ioctl field to test for reversed bytes, + pu_cv_header_mtio_check_field, + [AC_EGREP_HEADER(mt_model, sys/mtio.h, + pu_cv_header_mtio_check_field=mt_model, + pu_cv_header_mtio_check_field=mt_type)]) + AC_DEFINE_UNQUOTED(MTIO_CHECK_FIELD, + $pu_cv_header_mtio_check_field, + [Define to mt_model (v.g., for DG/UX), else to mt_type.]) + + + AC_ARG_VAR([DEFAULT_RMT_DIR], + [Define full file name of the directory where to install `rmt'. (default: $(libexecdir))]) + if test "x$DEFAULT_RMT_DIR" != x; then + DEFAULT_RMT_COMMAND=$DEFAULT_RMT_DIR/rmt + else + DEFAULT_RMT_DIR='$(libexecdir)' + fi + + AC_MSG_CHECKING([whether to build rmt]) + AC_ARG_WITH([rmt], + AC_HELP_STRING([--with-rmt=FILE], + [Use FILE as the default `rmt' program. Do not build included copy of `rmt'.]), + [case $withval in + yes|no) AC_MSG_ERROR([Invalid argument to --with-rmt]);; + /*) DEFAULT_RMT_COMMAND=$withval + AC_MSG_RESULT([no, use $withval instead]);; + *) AC_MSG_ERROR([Argument to --with-rmt must be an absolute file name]);; + esac], + [AC_MSG_RESULT([yes]) + enable_rmt + if test "$PU_RMT_PROG" = ""; then + AC_MSG_WARN([not building rmt, required header files are missing]) + fi]) + + AC_SUBST(DEFAULT_RMT_COMMAND) + if test "x$DEFAULT_RMT_COMMAND" != x; then + AC_DEFINE_UNQUOTED(DEFAULT_RMT_COMMAND, "$DEFAULT_RMT_COMMAND", + [Define full file name of rmt program.]) + fi +]) + + diff --git a/m4/rtapelib.m4 b/m4/rtapelib.m4 new file mode 100644 index 0000000..7b2c503 --- /dev/null +++ b/m4/rtapelib.m4 @@ -0,0 +1,3 @@ +AC_DEFUN([PU_RTAPELIB],[ + AC_CHECK_HEADERS_ONCE([net/errno.h sys/inet.h netdb.h]) +]) diff --git a/m4/safe-read.m4 b/m4/safe-read.m4 new file mode 100644 index 0000000..7a89d0a --- /dev/null +++ b/m4/safe-read.m4 @@ -0,0 +1,18 @@ +# safe-read.m4 serial 5 +dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SAFE_READ], +[ + AC_LIBOBJ([safe-read]) + + gl_PREREQ_SAFE_READ +]) + +# Prerequisites of lib/safe-read.c. +AC_DEFUN([gl_PREREQ_SAFE_READ], +[ + AC_REQUIRE([gt_TYPE_SSIZE_T]) +]) diff --git a/m4/safe-write.m4 b/m4/safe-write.m4 new file mode 100644 index 0000000..db119ff --- /dev/null +++ b/m4/safe-write.m4 @@ -0,0 +1,18 @@ +# safe-write.m4 serial 3 +dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SAFE_WRITE], +[ + AC_LIBOBJ([safe-write]) + + gl_PREREQ_SAFE_WRITE +]) + +# Prerequisites of lib/safe-write.c. +AC_DEFUN([gl_PREREQ_SAFE_WRITE], +[ + gl_PREREQ_SAFE_READ +]) diff --git a/m4/save-cwd.m4 b/m4/save-cwd.m4 new file mode 100644 index 0000000..7a2286b --- /dev/null +++ b/m4/save-cwd.m4 @@ -0,0 +1,12 @@ +#serial 8 +dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SAVE_CWD], +[ + AC_LIBOBJ([save-cwd]) + dnl Prerequisites for lib/save-cwd.c. + AC_CHECK_FUNCS_ONCE(fchdir) +]) diff --git a/m4/savedir.m4 b/m4/savedir.m4 new file mode 100644 index 0000000..1fc6c81 --- /dev/null +++ b/m4/savedir.m4 @@ -0,0 +1,10 @@ +# savedir.m4 serial 9 +dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SAVEDIR], +[ + AC_LIBOBJ([savedir]) +]) diff --git a/m4/setenv.m4 b/m4/setenv.m4 new file mode 100644 index 0000000..d6901de --- /dev/null +++ b/m4/setenv.m4 @@ -0,0 +1,82 @@ +# setenv.m4 serial 8 +dnl Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_SETENV], +[ + AC_CHECK_FUNCS_ONCE([setenv]) + if test $ac_cv_func_setenv = no; then + AC_LIBOBJ([setenv]) + gl_PREREQ_SETENV + fi +]) + +# Like gl_FUNC_SETENV, except prepare for separate compilation (no AC_LIBOBJ). +AC_DEFUN([gl_FUNC_SETENV_SEPARATE], +[ + AC_CHECK_FUNCS_ONCE([setenv]) + gl_PREREQ_SETENV +]) + +AC_DEFUN([gl_FUNC_UNSETENV], +[ + AC_CHECK_FUNCS([unsetenv]) + if test $ac_cv_func_unsetenv = no; then + AC_LIBOBJ([unsetenv]) + gl_PREREQ_UNSETENV + else + AC_CACHE_CHECK([for unsetenv() return type], gt_cv_func_unsetenv_ret, + [AC_TRY_COMPILE([#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +int unsetenv (const char *name); +#else +int unsetenv(); +#endif +], , gt_cv_func_unsetenv_ret='int', gt_cv_func_unsetenv_ret='void')]) + if test $gt_cv_func_unsetenv_ret = 'void'; then + AC_DEFINE(VOID_UNSETENV, 1, [Define if unsetenv() returns void, not int.]) + fi + fi +]) + +# Check if a variable is properly declared. +# gt_CHECK_VAR_DECL(includes,variable) +AC_DEFUN([gt_CHECK_VAR_DECL], +[ + define([gt_cv_var], [gt_cv_var_]$2[_declaration]) + AC_MSG_CHECKING([if $2 is properly declared]) + AC_CACHE_VAL(gt_cv_var, [ + AC_TRY_COMPILE([$1 + extern struct { int foo; } $2;], + [$2.foo = 1;], + gt_cv_var=no, + gt_cv_var=yes)]) + AC_MSG_RESULT($gt_cv_var) + if test $gt_cv_var = yes; then + AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_DECL], 1, + [Define if you have the declaration of $2.]) + fi +]) + +# Prerequisites of lib/setenv.c. +AC_DEFUN([gl_PREREQ_SETENV], +[ + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_CHECK_HEADERS_ONCE(unistd.h) + AC_CHECK_HEADERS(search.h) + AC_CHECK_FUNCS(tsearch) + gt_CHECK_VAR_DECL([#include ], environ) +]) + +# Prerequisites of lib/unsetenv.c. +AC_DEFUN([gl_PREREQ_UNSETENV], +[ + AC_CHECK_HEADERS_ONCE(unistd.h) + gt_CHECK_VAR_DECL([#include ], environ) +]) diff --git a/m4/size_max.m4 b/m4/size_max.m4 new file mode 100644 index 0000000..6cb4868 --- /dev/null +++ b/m4/size_max.m4 @@ -0,0 +1,68 @@ +# size_max.m4 serial 6 +dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([gl_SIZE_MAX], +[ + AC_CHECK_HEADERS(stdint.h) + dnl First test whether the system already has SIZE_MAX. + AC_MSG_CHECKING([for SIZE_MAX]) + AC_CACHE_VAL([gl_cv_size_max], [ + gl_cv_size_max= + AC_EGREP_CPP([Found it], [ +#include +#if HAVE_STDINT_H +#include +#endif +#ifdef SIZE_MAX +Found it +#endif +], gl_cv_size_max=yes) + if test -z "$gl_cv_size_max"; then + dnl Define it ourselves. Here we assume that the type 'size_t' is not wider + dnl than the type 'unsigned long'. Try hard to find a definition that can + dnl be used in a preprocessor #if, i.e. doesn't contain a cast. + AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], + [#include +#include ], size_t_bits_minus_1=) + AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], + [#include ], fits_in_uint=) + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + dnl Even though SIZE_MAX fits in an unsigned int, it must be of type + dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. + AC_TRY_COMPILE([#include + extern size_t foo; + extern unsigned long foo; + ], [], fits_in_uint=0) + fi + dnl We cannot use 'expr' to simplify this expression, because 'expr' + dnl works only with 'long' integers in the host environment, while we + dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. + 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 + dnl Shouldn't happen, but who knows... + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + ]) + AC_MSG_RESULT([$gl_cv_size_max]) + if test "$gl_cv_size_max" != yes; then + AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], + [Define as the maximum value of type 'size_t', if the system doesn't define it.]) + fi +]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) diff --git a/m4/sleep.m4 b/m4/sleep.m4 new file mode 100644 index 0000000..2c9d75c --- /dev/null +++ b/m4/sleep.m4 @@ -0,0 +1,19 @@ +# sleep.m4 serial 1 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_SLEEP], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([sleep]) + if test $ac_cv_func_sleep = no; then + HAVE_SLEEP=0 + AC_LIBOBJ([sleep]) + gl_PREREQ_SLEEP + fi +]) + +# Prerequisites of lib/sleep.c. +AC_DEFUN([gl_PREREQ_SLEEP], [:]) diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4 new file mode 100644 index 0000000..4eaef93 --- /dev/null +++ b/m4/ssize_t.m4 @@ -0,0 +1,21 @@ +# ssize_t.m4 serial 4 (gettext-0.15) +dnl Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether ssize_t is defined. + +AC_DEFUN([gt_TYPE_SSIZE_T], +[ + AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], + [AC_TRY_COMPILE([#include ], + [int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x;], + [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])]) + if test $gt_cv_ssize_t = no; then + AC_DEFINE([ssize_t], [int], + [Define as a signed type of the same size as size_t.]) + fi +]) diff --git a/m4/stdarg.m4 b/m4/stdarg.m4 new file mode 100644 index 0000000..e8e680a --- /dev/null +++ b/m4/stdarg.m4 @@ -0,0 +1,40 @@ +# stdarg.m4 serial 1 +dnl Copyright (C) 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Provide a working va_copy in combination with . + +AC_DEFUN([gl_STDARG_H], +[ + AC_MSG_CHECKING([for va_copy]) + AC_CACHE_VAL([gl_cv_func_va_copy], [ + AC_TRY_COMPILE([#include ], [ +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif +], + [gl_cv_func_va_copy=yes], [gl_cv_func_va_copy=no])]) + AC_MSG_RESULT([$gl_cv_func_va_copy]) + if test $gl_cv_func_va_copy = no; then + # Provide a substitute, either __va_copy or as a simple assignment. + AC_CACHE_VAL([gl_cv_func___va_copy], [ + AC_TRY_COMPILE([#include ], [ +#ifndef __va_copy +error, bail out +#endif +], + [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])]) + if test $gl_cv_func___va_copy = yes; then + AC_DEFINE([va_copy], [__va_copy], + [Define as a macro for copying va_list variables.]) + else + AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b))]) + AC_DEFINE([va_copy], [gl_va_copy], + [Define as a macro for copying va_list variables.]) + fi + fi +]) diff --git a/m4/stdbool.m4 b/m4/stdbool.m4 new file mode 100644 index 0000000..2204ecd --- /dev/null +++ b/m4/stdbool.m4 @@ -0,0 +1,115 @@ +# Check for stdbool.h that conforms to C99. + +dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Prepare for substituting if it is not supported. + +AC_DEFUN([AM_STDBOOL_H], +[ + AC_REQUIRE([AC_HEADER_STDBOOL]) + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + AC_SUBST([STDBOOL_H]) + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + AC_SUBST([HAVE__BOOL]) +]) + +# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. +AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) + +# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf +# have this macro built-in. + +AC_DEFUN([AC_HEADER_STDBOOL], + [AC_CACHE_CHECK([for stdbool.h that conforms to C99], + [ac_cv_header_stdbool_h], + [AC_TRY_COMPILE( + [ + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + #if defined __xlc__ || defined __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a run-time + test, and that would make cross-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. We also test + this with GCC, where it should work, to detect more + quickly whether someone messes up the test in the + future. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); + #endif + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + ], + [ + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + ], + [ac_cv_header_stdbool_h=yes], + [ac_cv_header_stdbool_h=no])]) + AC_CHECK_TYPES([_Bool]) + if test $ac_cv_header_stdbool_h = yes; then + AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) + fi]) diff --git a/m4/stdint.m4 b/m4/stdint.m4 new file mode 100644 index 0000000..3de7e13 --- /dev/null +++ b/m4/stdint.m4 @@ -0,0 +1,371 @@ +# stdint.m4 serial 24 +dnl Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert and Bruno Haible. +dnl Test whether is supported or must be substituted. + +AC_DEFUN([gl_STDINT_H], +[ + AC_PREREQ(2.59)dnl + + dnl Check for long long int and unsigned long long int. + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi + AC_SUBST([HAVE_LONG_LONG_INT]) + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + HAVE_UNSIGNED_LONG_LONG_INT=1 + else + HAVE_UNSIGNED_LONG_LONG_INT=0 + fi + AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) + + dnl Check for . + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi + AC_SUBST([HAVE_INTTYPES_H]) + + dnl Check for . + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h. + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + AC_SUBST([HAVE_SYS_TYPES_H]) + + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_stdint_h. + if test $ac_cv_header_stdint_h = yes; then + gl_ABSOLUTE_HEADER([stdint.h]) + ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\" + HAVE_STDINT_H=1 + else + ABSOLUTE_STDINT_H=\"no/such/file/stdint.h\" + HAVE_STDINT_H=0 + fi + AC_SUBST([ABSOLUTE_STDINT_H]) + AC_SUBST([HAVE_STDINT_H]) + + dnl Now see whether we need a substitute . Use + dnl ABSOLUTE_STDINT_H, not , so that it also works during + dnl a "config.status --recheck" if a stdint.h has been + dnl created in the build directory. + if test $ac_cv_header_stdint_h = yes; then + AC_CACHE_CHECK([whether stdint.h conforms to C99], + [gl_cv_header_working_stdint_h], + [gl_cv_header_working_stdint_h=no + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([gl_STDINT_INCLUDES + [ +#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 +#ifdef INT8_MAX +int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; +#endif +#ifdef INT16_MAX +int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; +#endif +#ifdef INT32_MAX +int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; +#endif +#ifdef INT64_MAX +int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; +#endif +#ifdef UINT8_MAX +uint8_t b1 = UINT8_MAX; +#else +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; +#endif +#ifdef UINT16_MAX +uint16_t b2 = UINT16_MAX; +#endif +#ifdef UINT32_MAX +uint32_t b3 = UINT32_MAX; +#endif +#ifdef UINT64_MAX +uint64_t b4 = UINT64_MAX; +#endif +int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; +int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; +int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; +int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; +uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; +uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; +uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; +uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; +int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; +int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; +int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; +int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; +uint_fast8_t f1 = UINT_FAST8_MAX; +uint_fast16_t f2 = UINT_FAST16_MAX; +uint_fast32_t f3 = UINT_FAST32_MAX; +uint_fast64_t f4 = UINT_FAST64_MAX; +#ifdef INTPTR_MAX +intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; +#endif +#ifdef UINTPTR_MAX +uintptr_t h = UINTPTR_MAX; +#endif +intmax_t i = INTMAX_MAX; +uintmax_t j = UINTMAX_MAX; +struct s { + int check_PTRDIFF: PTRDIFF_MIN < (ptrdiff_t) 0 && (ptrdiff_t) 0 < PTRDIFF_MAX ? 1 : -1; + int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= (sig_atomic_t) 0 && (sig_atomic_t) 0 < SIG_ATOMIC_MAX ? 1 : -1; + int check_SIZE: (size_t) 0 < SIZE_MAX ? 1 : -1; + int check_WCHAR: WCHAR_MIN <= (wchar_t) 0 && (wchar_t) 0 < WCHAR_MAX ? 1 : -1; + int check_WINT: WINT_MIN <= (wint_t) 0 && (wint_t) 0 < WINT_MAX + && (WINT_MIN < (wint_t) 0 || (wint_t) -1 == (wint_t) WINT_MAX) + ? 1 : -1; + + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ + int check_UINT8_C: + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; + int check_UINT16_C: + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; + + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; +#endif +#ifdef UINT16_MAX + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; +#endif +#ifdef UINT32_MAX + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; +#endif +#ifdef UINT64_MAX + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; +#endif + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; +}; + ]])], + [gl_cv_header_working_stdint_h=yes])]) + fi + if test "$gl_cv_header_working_stdint_h" = yes; then + STDINT_H= + else + dnl Check for , and for + dnl (used in Linux libc4 >= 4.6.7 and libc5). + AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + else + HAVE_SYS_INTTYPES_H=0 + fi + AC_SUBST([HAVE_SYS_INTTYPES_H]) + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + else + HAVE_SYS_BITYPES_H=0 + fi + AC_SUBST([HAVE_SYS_BITYPES_H]) + + gl_STDINT_TYPE_PROPERTIES + STDINT_H=stdint.h + fi + AC_SUBST(STDINT_H) +]) + +dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) +dnl Determine the size of each of the given types in bits. +AC_DEFUN([gl_STDINT_BITSIZEOF], +[ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + AC_FOREACH([gltype], [$1], + [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [Define to the number of bits in type ']gltype['.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], + [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], + [$2 +#include ], [result=unknown]) + eval gl_cv_bitsizeof_${gltype}=\$result + ]) + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + dnl Use a nonempty default, because some compilers, such as IRIX 5 cc, + dnl do a syntax check even on unused #if conditions and give an error + dnl on valid C code like this: + dnl #if 0 + dnl # if > 32 + dnl # endif + dnl #endif + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) + eval BITSIZEOF_${GLTYPE}=\$result + done + AC_FOREACH([gltype], [$1], + [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) +]) + +dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES) +dnl Determine the signedness of each of the given types. +dnl Define HAVE_SIGNED_TYPE if type is signed. +AC_DEFUN([gl_CHECK_TYPES_SIGNED], +[ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + AC_FOREACH([gltype], [$1], + [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [Define to 1 if ']gltype[' is a signed integer type.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([$2[ + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])], + result=yes, result=no) + eval gl_cv_type_${gltype}_signed=\$result + ]) + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1) + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + AC_FOREACH([gltype], [$1], + [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) +]) + +dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES) +dnl Determine the suffix to use for integer constants of the given types. +dnl Define t_SUFFIX for each such type. +AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], +[ + dnl Use a shell loop, to avoid bloating configure, and + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into + dnl config.h.in, + dnl - extra AC_SUBST calls, so that the right substitutions are made. + AC_FOREACH([gltype], [$1], + [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], + [Define to l, ll, u, ul, ull, etc., as suitable for + constants of type ']gltype['.])]) + for gltype in $1 ; do + AC_CACHE_CHECK([for $gltype integer literal suffix], + [gl_cv_type_${gltype}_suffix], + [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 + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([$2 + extern $gltype foo; + extern $gltype1 foo;])], + [eval gl_cv_type_${gltype}_suffix=\$glsuf]) + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done]) + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) + done + AC_FOREACH([gltype], [$1], + [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) +]) + +dnl gl_STDINT_INCLUDES +AC_DEFUN([gl_STDINT_INCLUDES], +[[ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #include + #include + #include +]]) + +dnl gl_STDINT_TYPE_PROPERTIES +dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t +dnl of interest to stdint_.h. +AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], +[ + gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no + gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) +]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) + +# Hey Emacs! +# Local Variables: +# indent-tabs-mode: nil +# End: diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 new file mode 100644 index 0000000..db9a8ac --- /dev/null +++ b/m4/stdint_h.m4 @@ -0,0 +1,26 @@ +# stdint_h.m4 serial 6 +dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_STDINT_H_WITH_UINTMAX if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN([gl_AC_HEADER_STDINT_H], +[ + AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, + [AC_TRY_COMPILE( + [#include +#include ], + [uintmax_t i = (uintmax_t) -1; return !i;], + gl_cv_header_stdint_h=yes, + gl_cv_header_stdint_h=no)]) + if test $gl_cv_header_stdint_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 new file mode 100644 index 0000000..955c912 --- /dev/null +++ b/m4/stdio_h.m4 @@ -0,0 +1,79 @@ +# stdio_h.m4 serial 6 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STDIO_H], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_ABSOLUTE_HEADER([stdio.h]) + ABSOLUTE_STDIO_H=\"$gl_cv_absolute_stdio_h\" + AC_SUBST([ABSOLUTE_STDIO_H]) +]) + +AC_DEFUN([gl_STDIO_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_STDIO_H_DEFAULTS], +[ + GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) + GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) + GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) + GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) + GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) + GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) + GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) + GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) + GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) + GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) + GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) + GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) + GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) + dnl Assume proper GNU behavior unless another module says otherwise. + REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) + REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) + REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) + REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) + REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) + HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) + REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) + HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) + REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) + REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) + HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) + REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) + HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) + REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) + REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) + HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) + REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) + REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) + REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) +]) + +dnl Code shared by fseeko and ftello. Determine if large files are supported, +dnl but stdin does not start as a large file by default. +AC_DEFUN([gl_STDIN_LARGE_OFFSET], + [ + AC_CACHE_CHECK([whether stdin defaults to large file offsets], + [gl_cv_var_stdin_large_offset], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], +[#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 at the same time + that cygwin started exporting asnprintf (cygwin 1.7.0), so we use + that as a link-time test for cross-compiles rather than building + a runtime test. */ + size_t s; + if (asnprintf (NULL, &s, "")) + return 0; +#endif])], + [gl_cv_var_stdin_large_offset=yes], + [gl_cv_var_stdin_large_offset=no])]) +]) diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 new file mode 100644 index 0000000..d46a5f0 --- /dev/null +++ b/m4/stdlib_h.m4 @@ -0,0 +1,31 @@ +# stdlib_h.m4 serial 1 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STDLIB_H], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + gl_ABSOLUTE_HEADER([stdlib.h]) + ABSOLUTE_STDLIB_H=\"$gl_cv_absolute_stdlib_h\" + AC_SUBST([ABSOLUTE_STDLIB_H]) +]) + +AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_STDLIB_H_DEFAULTS], +[ + GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) + GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) + GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) + HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) + REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) +]) diff --git a/m4/stpcpy.m4 b/m4/stpcpy.m4 new file mode 100644 index 0000000..c48aa9c --- /dev/null +++ b/m4/stpcpy.m4 @@ -0,0 +1,26 @@ +# stpcpy.m4 serial 4 +dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STPCPY], +[ + dnl Persuade glibc to declare stpcpy(). + AC_REQUIRE([AC_GNU_SOURCE]) + + dnl The stpcpy() declaration in lib/string_.h uses 'restrict'. + AC_REQUIRE([AC_C_RESTRICT]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REPLACE_FUNCS(stpcpy) + if test $ac_cv_func_stpcpy = no; then + HAVE_STPCPY=0 + gl_PREREQ_STPCPY + fi +]) + +# Prerequisites of lib/stpcpy.c. +AC_DEFUN([gl_PREREQ_STPCPY], [ + : +]) diff --git a/m4/strcase.m4 b/m4/strcase.m4 new file mode 100644 index 0000000..ae24215 --- /dev/null +++ b/m4/strcase.m4 @@ -0,0 +1,44 @@ +# strcase.m4 serial 8 +dnl Copyright (C) 2002, 2005-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STRCASE], +[ + gl_FUNC_STRCASECMP + gl_FUNC_STRNCASECMP +]) + +AC_DEFUN([gl_FUNC_STRCASECMP], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REPLACE_FUNCS(strcasecmp) + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + gl_PREREQ_STRCASECMP + fi +]) + +AC_DEFUN([gl_FUNC_STRNCASECMP], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REPLACE_FUNCS(strncasecmp) + if test $ac_cv_func_strncasecmp = no; then + gl_PREREQ_STRNCASECMP + fi + AC_CHECK_DECLS(strncasecmp) + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi +]) + +# Prerequisites of lib/strcasecmp.c. +AC_DEFUN([gl_PREREQ_STRCASECMP], [ + : +]) + +# Prerequisites of lib/strncasecmp.c. +AC_DEFUN([gl_PREREQ_STRNCASECMP], [ + : +]) diff --git a/m4/strchrnul.m4 b/m4/strchrnul.m4 new file mode 100644 index 0000000..fec2a10 --- /dev/null +++ b/m4/strchrnul.m4 @@ -0,0 +1,21 @@ +# strchrnul.m4 serial 5 +dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRCHRNUL], +[ + dnl Persuade glibc to declare strchrnul(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REPLACE_FUNCS(strchrnul) + if test $ac_cv_func_strchrnul = no; then + HAVE_STRCHRNUL=0 + gl_PREREQ_STRCHRNUL + fi +]) + +# Prerequisites of lib/strchrnul.c. +AC_DEFUN([gl_PREREQ_STRCHRNUL], [:]) diff --git a/m4/strdup.m4 b/m4/strdup.m4 new file mode 100644 index 0000000..8796e9e --- /dev/null +++ b/m4/strdup.m4 @@ -0,0 +1,22 @@ +# strdup.m4 serial 9 + +dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software +dnl Foundation, Inc. + +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRDUP], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REPLACE_FUNCS(strdup) + AC_CHECK_DECLS_ONCE(strdup) + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi + gl_PREREQ_STRDUP +]) + +# Prerequisites of lib/strdup.c. +AC_DEFUN([gl_PREREQ_STRDUP], [:]) diff --git a/m4/strerror.m4 b/m4/strerror.m4 new file mode 100644 index 0000000..bbcda30 --- /dev/null +++ b/m4/strerror.m4 @@ -0,0 +1,26 @@ +# strerror.m4 serial 3 +dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRERROR], +[ + AC_CHECK_FUNCS_ONCE([strerror]) + if test $ac_cv_func_strerror = no; then + AC_LIBOBJ([strerror]) + gl_PREREQ_STRERROR + fi +]) + +# Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ). +AC_DEFUN([gl_FUNC_STRERROR_SEPARATE], +[ + AC_CHECK_FUNCS_ONCE([strerror]) + gl_PREREQ_STRERROR +]) + +# Prerequisites of lib/strerror.c. +AC_DEFUN([gl_PREREQ_STRERROR], [ + : +]) diff --git a/m4/string_h.m4 b/m4/string_h.m4 new file mode 100644 index 0000000..f706d49 --- /dev/null +++ b/m4/string_h.m4 @@ -0,0 +1,78 @@ +# Configure a GNU-like replacement for . + +# Copyright (C) 2007 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. + +# Written by Paul Eggert. + +AC_DEFUN([gl_HEADER_STRING_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_STRING_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_STRING_H_BODY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + gl_ABSOLUTE_HEADER([string.h]) + ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\" + AC_SUBST([ABSOLUTE_STRING_H]) +]) + +AC_DEFUN([gl_STRING_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], +[ + GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) + GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) + GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) + GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) + GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) + GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) + GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) + GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) + GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) + GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) + GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) + GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) + GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) + GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) + GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) + GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) + GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) + GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) + GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) + GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) + GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) + GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) + GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) + GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) + GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) + GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) + HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) + HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) + HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) + HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) + HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) + HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP]) + HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) + HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) + HAVE_STRNDUP=1; AC_SUBST([HAVE_STRNDUP]) + HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP]) + HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN]) + HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) + HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) + HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) + HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) +]) diff --git a/m4/strndup.m4 b/m4/strndup.m4 new file mode 100644 index 0000000..baa6c03 --- /dev/null +++ b/m4/strndup.m4 @@ -0,0 +1,53 @@ +# strndup.m4 serial 13 +dnl Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRNDUP], +[ + dnl Persuade glibc to declare strndup(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([strndup]) + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi + + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup, + [AC_RUN_IFELSE([ + AC_LANG_PROGRAM([#include + #include ], [[ +#ifndef HAVE_DECL_STRNDUP + extern char *strndup (const char *, size_t); +#endif + char *s; + s = strndup ("some longer string", 15); + free (s); + s = strndup ("shorter string", 13); + return s[13] != '\0';]])], + [gl_cv_func_strndup=yes], + [gl_cv_func_strndup=no], + [AC_CHECK_FUNC([strndup], + [AC_EGREP_CPP([too risky], [ +#ifdef _AIX + too risky +#endif + ], + [gl_cv_func_strndup=no], + [gl_cv_func_strndup=yes])], + [gl_cv_func_strndup=no])])]) + if test $gl_cv_func_strndup = yes; then + AC_DEFINE([HAVE_STRNDUP], 1, + [Define if you have the strndup() function and it works.]) + else + HAVE_STRNDUP=0 + AC_LIBOBJ([strndup]) + gl_PREREQ_STRNDUP + fi +]) + +# Prerequisites of lib/strndup.c. +AC_DEFUN([gl_PREREQ_STRNDUP], [:]) diff --git a/m4/strnlen.m4 b/m4/strnlen.m4 new file mode 100644 index 0000000..0e2815b --- /dev/null +++ b/m4/strnlen.m4 @@ -0,0 +1,31 @@ +# strnlen.m4 serial 8 +dnl Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRNLEN], +[ + dnl Persuade glibc to declare strnlen(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([strnlen]) + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + fi + + AC_FUNC_STRNLEN + if test $ac_cv_func_strnlen_working = no; then + # This is necessary because automake-1.6.1 doens't understand + # that the above use of AC_FUNC_STRNLEN means we may have to use + # lib/strnlen.c. + #AC_LIBOBJ(strnlen) + AC_DEFINE(strnlen, rpl_strnlen, + [Define to rpl_strnlen if the replacement function should be used.]) + gl_PREREQ_STRNLEN + fi +]) + +# Prerequisites of lib/strnlen.c. +AC_DEFUN([gl_PREREQ_STRNLEN], [:]) diff --git a/m4/strtol.m4 b/m4/strtol.m4 new file mode 100644 index 0000000..7fbae60 --- /dev/null +++ b/m4/strtol.m4 @@ -0,0 +1,10 @@ +# strtol.m4 serial 4 +dnl Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STRTOL], +[ + AC_REPLACE_FUNCS(strtol) +]) diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 new file mode 100644 index 0000000..2283138 --- /dev/null +++ b/m4/sys_stat_h.m4 @@ -0,0 +1,50 @@ +# sys_stat_h.m4 serial 5 -*- Autoconf -*- +dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Eric Blake. +dnl Test whether contains lstat and mkdir or must be substituted. + +AC_DEFUN([gl_HEADER_SYS_STAT_H], +[ + dnl Check for lstat. Systems that lack it (mingw) also lack symlinks, so + dnl stat is a good replacement. + AC_CHECK_FUNCS_ONCE([lstat]) + if test $ac_cv_func_lstat = yes; then + HAVE_LSTAT=1 + else + HAVE_LSTAT=0 + fi + AC_SUBST([HAVE_LSTAT]) + + dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard + dnl instead. + AC_CHECK_DECLS([mkdir], + [], + [AC_CHECK_HEADERS([io.h])], + [#include ]) + if test $ac_cv_have_decl_mkdir = yes; then + HAVE_DECL_MKDIR=1 + else + HAVE_DECL_MKDIR=0 + fi + AC_SUBST([HAVE_DECL_MKDIR]) + if test "$ac_cv_header_io_h" = yes; then + HAVE_IO_H=1 + else + HAVE_IO_H=0 + fi + AC_SUBST([HAVE_IO_H]) + AC_REQUIRE([AC_C_INLINE]) + + dnl Check for broken stat macros. + AC_REQUIRE([AC_HEADER_STAT]) + + gl_ABSOLUTE_HEADER([sys/stat.h]) + ABSOLUTE_SYS_STAT_H=\"$gl_cv_absolute_sys_stat_h\" + AC_SUBST([ABSOLUTE_SYS_STAT_H]) + SYS_STAT_H='sys/stat.h' + AC_SUBST([SYS_STAT_H]) +]) # gl_HEADER_SYS_STAT_H diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 new file mode 100644 index 0000000..b38e1bc --- /dev/null +++ b/m4/sys_time_h.m4 @@ -0,0 +1,61 @@ +# Configure a replacement for . + +# Copyright (C) 2007 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. + +# Written by Paul Eggert and Martin Lambers. + +AC_DEFUN([gl_HEADER_SYS_TIME_H], +[ + dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement + dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1 + dnl statements that occur in other macros. + AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + + if test $ac_cv_header_sys_time_h = yes; then + gl_ABSOLUTE_HEADER([sys/time.h]) + 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 + AC_SUBST([ABSOLUTE_SYS_TIME_H]) + AC_SUBST([HAVE_SYS_TIME_H]) + + AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if HAVE_SYS_TIME_H + #include + #endif + #include + ]], + [[static struct timeval x; x.tv_sec = x.tv_usec;]])], + [gl_cv_sys_struct_timeval=yes], + [gl_cv_sys_struct_timeval=no])]) + if test $gl_cv_sys_struct_timeval = yes; then + HAVE_STRUCT_TIMEVAL=1 + else + HAVE_STRUCT_TIMEVAL=0 + fi + AC_SUBST([HAVE_STRUCT_TIMEVAL]) + + dnl Assume POSIX behavior unless another module says otherwise. + REPLACE_GETTIMEOFDAY=0 + AC_SUBST([REPLACE_GETTIMEOFDAY]) + if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then + SYS_TIME_H=sys/time.h + else + SYS_TIME_H= + fi + AC_SUBST([SYS_TIME_H]) +]) diff --git a/m4/sysexits.m4 b/m4/sysexits.m4 new file mode 100644 index 0000000..17d5aee --- /dev/null +++ b/m4/sysexits.m4 @@ -0,0 +1,45 @@ +# sysexits.m4 serial 3 +dnl Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SYSEXITS], +[ + AC_CHECK_HEADERS_ONCE([sysexits.h]) + if test $ac_cv_header_sysexits_h = yes; then + HAVE_SYSEXITS_H=1 + gl_ABSOLUTE_HEADER([sysexits.h]) + ABSOLUTE_SYSEXITS_H=\"$gl_cv_absolute_sysexits_h\" + AC_TRY_COMPILE([#include ], + [switch (0) + { + case EX_OK: + case EX_USAGE: + case EX_DATAERR: + case EX_NOINPUT: + case EX_NOUSER: + case EX_NOHOST: + case EX_UNAVAILABLE: + case EX_SOFTWARE: + case EX_OSERR: + case EX_OSFILE: + case EX_CANTCREAT: + case EX_IOERR: + case EX_TEMPFAIL: + case EX_PROTOCOL: + case EX_NOPERM: + case EX_CONFIG: + break; + } + ], + [SYSEXITS_H=], + [SYSEXITS_H=sysexits.h]) + else + HAVE_SYSEXITS_H=0 + SYSEXITS_H=sysexits.h + fi + AC_SUBST([HAVE_SYSEXITS_H]) + AC_SUBST([ABSOLUTE_SYSEXITS_H]) + AC_SUBST([SYSEXITS_H]) +]) diff --git a/m4/system.m4 b/m4/system.m4 new file mode 100644 index 0000000..0e00364 --- /dev/null +++ b/m4/system.m4 @@ -0,0 +1,29 @@ +# Configuration for paxutils/lib/system.h. + +# Copyright (C) 2005, 2006 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. + +AC_DEFUN([PU_SYSTEM],[ + AC_REQUIRE([AC_HEADER_STDC]) + + AC_CHECK_HEADERS_ONCE([string.h memory.h fcntl.h sys/wait.h \ + sys/gentape.h sys/tape.h sys/device.h sys/param.h sys/tprintf.h sys/mtio.h \ + sgtty.h sys/io/trioctl.h locale.h]) + + AC_CHECK_HEADERS([sys/buf.h], [], [], + [#if HAVE_SYS_PARAM_H +#include +#endif]) + + AC_REQUIRE([AC_HEADER_TIME]) + + AC_CHECK_MEMBERS([struct stat.st_blksize]) dnl instead of AC_STRUCT_ST_BLKSIZE + AC_REQUIRE([AC_STRUCT_ST_BLOCKS]) + AC_REQUIRE([AC_STRUCT_ST_BLKSIZE]) + + AC_CHECK_FUNCS_ONCE(lstat mkfifo setlocale) + AC_REQUIRE([gl_INTTYPES_H]) + AC_REQUIRE([gl_STDINT_H]) +]) diff --git a/m4/time_h.m4 b/m4/time_h.m4 new file mode 100644 index 0000000..e90ed7a --- /dev/null +++ b/m4/time_h.m4 @@ -0,0 +1,76 @@ +# Configure a more-standard replacement for . + +# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007 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. + +# Written by Paul Eggert and Jim Meyering. + +AC_DEFUN([gl_HEADER_TIME_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_TIME_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_TIME_H_BODY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + gl_ABSOLUTE_HEADER([time.h]) + ABSOLUTE_TIME_H=\"$gl_cv_absolute_time_h\" + AC_SUBST([ABSOLUTE_TIME_H]) + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) +]) + +AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], +[ + dnl If another module says to replace or to not replace, do that. + dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; + dnl this lets maintainers check for portability. + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) + REPLACE_STRPTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRPTIME]) + REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) +]) + +dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared +dnl in time.h or sys/time.h. + +AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], +[ + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_CACHE_CHECK([for struct timespec in ], + [gl_cv_sys_struct_timespec_in_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_time_h=yes], + [gl_cv_sys_struct_timespec_in_time_h=no])]) + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + AC_CACHE_CHECK([for struct timespec in ], + [gl_cv_sys_struct_timespec_in_sys_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [gl_cv_sys_struct_timespec_in_sys_time_h=yes], + [gl_cv_sys_struct_timespec_in_sys_time_h=no])]) + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + fi + fi + AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) +]) diff --git a/m4/time_r.m4 b/m4/time_r.m4 new file mode 100644 index 0000000..dbb6396 --- /dev/null +++ b/m4/time_r.m4 @@ -0,0 +1,41 @@ +dnl Reentrant time functions like localtime_r. + +dnl Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_TIME_R], +[ + dnl Persuade glibc and Solaris to declare localtime_r. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + + AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature], + [gl_cv_time_r_posix], + [AC_TRY_COMPILE( + [#include ], + [/* We don't need to append 'restrict's to the argument types, + even though the POSIX signature has the 'restrict's, + since C99 says they can't affect type compatibility. */ + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) return 0;], + [gl_cv_time_r_posix=yes], + [gl_cv_time_r_posix=no])]) + if test $gl_cv_time_r_posix = yes; then + REPLACE_LOCALTIME_R=0 + else + REPLACE_LOCALTIME_R=1 + AC_LIBOBJ([time_r]) + gl_PREREQ_TIME_R + fi +]) + +# Prerequisites of lib/time_r.c. +AC_DEFUN([gl_PREREQ_TIME_R], [ + : +]) diff --git a/m4/timespec.m4 b/m4/timespec.m4 new file mode 100644 index 0000000..36f1238 --- /dev/null +++ b/m4/timespec.m4 @@ -0,0 +1,16 @@ +#serial 14 + +# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007 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. + +dnl From Jim Meyering + +AC_DEFUN([gl_TIMESPEC], +[ + dnl Prerequisites of lib/timespec.h. + AC_REQUIRE([AC_C_INLINE]) +]) diff --git a/m4/tm_gmtoff.m4 b/m4/tm_gmtoff.m4 new file mode 100644 index 0000000..cb0b3c8 --- /dev/null +++ b/m4/tm_gmtoff.m4 @@ -0,0 +1,14 @@ +# tm_gmtoff.m4 serial 2 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_TM_GMTOFF], +[ + AC_CHECK_MEMBER([struct tm.tm_gmtoff], + [AC_DEFINE(HAVE_TM_GMTOFF, 1, + [Define if struct tm has the tm_gmtoff member.])], + , + [#include ]) +]) diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4 new file mode 100644 index 0000000..9fae98e --- /dev/null +++ b/m4/ulonglong.m4 @@ -0,0 +1,48 @@ +# ulonglong.m4 serial 6 +dnl Copyright (C) 1999-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. +# This fixes a bug in Autoconf 2.60, but can be removed once we +# assume 2.61 everywhere. + +# Note: If the type 'unsigned long long int' exists but is only 32 bits +# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT +# will not be defined. In this case you can treat 'unsigned long long int' +# like 'unsigned long int'. + +AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], +[ + AC_CACHE_CHECK([for unsigned long long int], + [ac_cv_type_unsigned_long_long_int], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[unsigned long long int ull = 18446744073709551615ULL; + typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63;]], + [[unsigned long long int ullmax = 18446744073709551615ull; + return (ull << 63 | ull >> 63 | ull << i | ull >> i + | ullmax / ull | ullmax % ull);]])], + [ac_cv_type_unsigned_long_long_int=yes], + [ac_cv_type_unsigned_long_long_int=no])]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, + [Define to 1 if the system has the type `unsigned long long int'.]) + fi +]) + +# This macro is obsolescent and should go away soon. +AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], +[ + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_unsigned_long_long = yes; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, + [Define if you have the 'unsigned long long' type.]) + fi +]) diff --git a/m4/unistd-safer.m4 b/m4/unistd-safer.m4 new file mode 100644 index 0000000..09adf93 --- /dev/null +++ b/m4/unistd-safer.m4 @@ -0,0 +1,13 @@ +#serial 8 +dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_UNISTD_SAFER], +[ + AC_CHECK_FUNCS_ONCE([pipe]) + AC_LIBOBJ([dup-safer]) + AC_LIBOBJ([fd-safer]) + AC_LIBOBJ([pipe-safer]) +]) diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 new file mode 100644 index 0000000..60dd730 --- /dev/null +++ b/m4/unistd_h.m4 @@ -0,0 +1,55 @@ +# unistd_h.m4 serial 7 +dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Simon Josefsson, Bruno Haible. + +AC_DEFUN([gl_UNISTD_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + gl_ABSOLUTE_HEADER([unistd.h]) + ABSOLUTE_UNISTD_H=\"$gl_cv_absolute_unistd_h\" + else + HAVE_UNISTD_H=0 + fi + AC_SUBST([HAVE_UNISTD_H]) + AC_SUBST([ABSOLUTE_UNISTD_H]) +]) + +AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_UNISTD_H_DEFAULTS], +[ + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) + HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) + HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) + REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) + REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) + REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) + REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) +]) diff --git a/m4/unlocked-io.m4 b/m4/unlocked-io.m4 new file mode 100644 index 0000000..20b2da2 --- /dev/null +++ b/m4/unlocked-io.m4 @@ -0,0 +1,42 @@ +# unlocked-io.m4 serial 14 + +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# 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. + +dnl From Jim Meyering. +dnl +dnl See if the glibc *_unlocked I/O macros or functions are available. +dnl Use only those *_unlocked macros or functions that are declared +dnl (because some of them were declared in Solaris 2.5.1 but were removed +dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run +dnl on Solaris 2.6). + +AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO], +[ + AC_DEFINE([USE_UNLOCKED_IO], 1, + [Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, + but it is not safe for multithreaded apps.]) + + dnl Persuade glibc and Solaris to declare + dnl fgets_unlocked(), fputs_unlocked() etc. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_DECLS_ONCE([clearerr_unlocked]) + AC_CHECK_DECLS_ONCE([feof_unlocked]) + AC_CHECK_DECLS_ONCE([ferror_unlocked]) + AC_CHECK_DECLS_ONCE([fflush_unlocked]) + AC_CHECK_DECLS_ONCE([fgets_unlocked]) + AC_CHECK_DECLS_ONCE([fputc_unlocked]) + AC_CHECK_DECLS_ONCE([fputs_unlocked]) + AC_CHECK_DECLS_ONCE([fread_unlocked]) + AC_CHECK_DECLS_ONCE([fwrite_unlocked]) + AC_CHECK_DECLS_ONCE([getc_unlocked]) + AC_CHECK_DECLS_ONCE([getchar_unlocked]) + AC_CHECK_DECLS_ONCE([putc_unlocked]) + AC_CHECK_DECLS_ONCE([putchar_unlocked]) +]) diff --git a/m4/utimbuf.m4 b/m4/utimbuf.m4 new file mode 100644 index 0000000..9927908 --- /dev/null +++ b/m4/utimbuf.m4 @@ -0,0 +1,39 @@ +#serial 8 + +# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2007 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. + +dnl From Jim Meyering + +dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared -- +dnl usually in . +dnl Some systems have utime.h but don't declare the struct anywhere. + +AC_DEFUN([gl_CHECK_TYPE_STRUCT_UTIMBUF], +[ + AC_CHECK_HEADERS_ONCE(sys/time.h utime.h) + AC_CACHE_CHECK([for struct utimbuf], [gl_cv_sys_struct_utimbuf], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if HAVE_SYS_TIME_H + #include + #endif + #include + #ifdef HAVE_UTIME_H + #include + #endif + ]], + [[static struct utimbuf x; x.actime = x.modtime;]])], + [gl_cv_sys_struct_utimbuf=yes], + [gl_cv_sys_struct_utimbuf=no])]) + + if test $gl_cv_sys_struct_utimbuf = yes; then + AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, + [Define if struct utimbuf is declared -- usually in . + Some systems have utime.h but don't declare the struct anywhere. ]) + fi +]) diff --git a/m4/utimens.m4 b/m4/utimens.m4 new file mode 100644 index 0000000..9ac9c3e --- /dev/null +++ b/m4/utimens.m4 @@ -0,0 +1,15 @@ +dnl Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_UTIMENS], +[ + AC_LIBOBJ([utimens]) + + dnl Prerequisites of lib/utimens.c. + AC_REQUIRE([gl_FUNC_UTIMES]) + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_UTIMBUF]) + AC_CHECK_FUNCS_ONCE([futimes futimesat]) +]) diff --git a/m4/utimes.m4 b/m4/utimes.m4 new file mode 100644 index 0000000..7efb2b0 --- /dev/null +++ b/m4/utimes.m4 @@ -0,0 +1,83 @@ +# Detect some bugs in glibc's implementation of utimes. + +dnl Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# See if we need to work around bugs in glibc's implementation of +# utimes from 2003-07-12 to 2003-09-17. +# First, there was a bug that would make utimes set mtime +# and atime to zero (1970-01-01) unconditionally. +# Then, there was code to round rather than truncate. +# Then, there was an implementation (sparc64, Linux-2.4.28, glibc-2.3.3) +# that didn't honor the NULL-means-set-to-current-time semantics. +# Finally, there was also a version of utimes that failed on read-only +# files, while utime worked fine (linux-2.2.20, glibc-2.2.5). +# +# From Jim Meyering, with suggestions from Paul Eggert. + +AC_DEFUN([gl_FUNC_UTIMES], +[ + AC_CACHE_CHECK([determine whether the utimes function works], + gl_cv_func_working_utimes, + [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main () +{ + static struct timeval timeval[2] = {{9, 10}, {999999, 999999}}; + struct stat sbuf; + char const *file = "conftest.utimes"; + FILE *f; + time_t now; + int fd; + + int ok = ((f = fopen (file, "w")) + && fclose (f) == 0 + && utimes (file, timeval) == 0 + && lstat (file, &sbuf) == 0 + && sbuf.st_atime == timeval[0].tv_sec + && sbuf.st_mtime == timeval[1].tv_sec); + unlink (file); + if (!ok) + exit (1); + + ok = + ((f = fopen (file, "w")) + && fclose (f) == 0 + && time (&now) != (time_t)-1 + && utimes (file, NULL) == 0 + && lstat (file, &sbuf) == 0 + && now - sbuf.st_atime <= 2 + && now - sbuf.st_mtime <= 2); + unlink (file); + if (!ok) + exit (1); + + ok = (0 <= (fd = open (file, O_WRONLY|O_CREAT, 0444)) + && close (fd) == 0 + && utimes (file, NULL) == 0); + unlink (file); + + exit (!ok); +} + ]])], + [gl_cv_func_working_utimes=yes], + [gl_cv_func_working_utimes=no], + [gl_cv_func_working_utimes=no])]) + + if test $gl_cv_func_working_utimes = yes; then + AC_DEFINE([HAVE_WORKING_UTIMES], 1, [Define if utimes works properly. ]) + fi +]) diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4 new file mode 100644 index 0000000..fa953aa --- /dev/null +++ b/m4/vasnprintf.m4 @@ -0,0 +1,181 @@ +# vasnprintf.m4 serial 17 +dnl Copyright (C) 2002-2004, 2006-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_VASNPRINTF], +[ + AC_REQUIRE([gl_EOVERFLOW]) + AC_CHECK_FUNCS_ONCE([vasnprintf]) + if test $ac_cv_func_vasnprintf = no; then + gl_REPLACE_VASNPRINTF + fi +]) + +AC_DEFUN([gl_REPLACE_VASNPRINTF], +[ + AC_CHECK_FUNCS_ONCE([vasnprintf]) + AC_LIBOBJ([vasnprintf]) + AC_LIBOBJ([printf-args]) + AC_LIBOBJ([printf-parse]) + AC_LIBOBJ([asnprintf]) + if test $ac_cv_func_vasnprintf = yes; then + AC_DEFINE([REPLACE_VASNPRINTF], 1, + [Define if vasnprintf exists but is overridden by gnulib.]) + fi + gl_PREREQ_PRINTF_ARGS + gl_PREREQ_PRINTF_PARSE + gl_PREREQ_VASNPRINTF + gl_PREREQ_ASNPRINTF +]) + +# Prequisites of lib/printf-args.h, lib/printf-args.c. +AC_DEFUN([gl_PREREQ_PRINTF_ARGS], +[ + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) +]) + +# Prequisites of lib/printf-parse.h, lib/printf-parse.c. +AC_DEFUN([gl_PREREQ_PRINTF_PARSE], +[ + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + AC_REQUIRE([AC_TYPE_SIZE_T]) + AC_CHECK_TYPES(ptrdiff_t) + AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) +]) + +# Prerequisites of lib/vasnprintf.c. +AC_DEFUN([gl_PREREQ_VASNPRINTF], +[ + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + AC_CHECK_FUNCS(snprintf wcslen) +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting 'long double' +# arguments. +AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) + case "$gl_cv_func_printf_long_double" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double' +# arguments. +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_INFINITE]) + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1, + [Define if the vasnprintf implementation needs special code for + infinite 'double' arguments.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double' +# arguments. +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) + dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if + dnl NEED_PRINTF_LONG_DOUBLE is already set. + AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE]) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1, + [Define if the vasnprintf implementation needs special code for + infinite 'long double' arguments.]) + ;; + esac + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1, + [Define if the vasnprintf implementation needs special code for + the 'a' and 'A' directives.]) + AC_CHECK_FUNCS([nl_langinfo]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1, + [Define if the vasnprintf implementation needs special code for + the 'F' directive.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], +[ + AC_REQUIRE([gl_PRINTF_FLAG_GROUPING]) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1, + [Define if the vasnprintf implementation needs special code for the + ' flag.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], +[ + AC_REQUIRE([gl_PRINTF_FLAG_ZERO]) + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1, + [Define if the vasnprintf implementation needs special code for the + 0 flag.]) + ;; + esac +]) + +# Prerequisites of lib/asnprintf.c. +AC_DEFUN([gl_PREREQ_ASNPRINTF], +[ +]) diff --git a/m4/vsnprintf.m4 b/m4/vsnprintf.m4 new file mode 100644 index 0000000..accc79f --- /dev/null +++ b/m4/vsnprintf.m4 @@ -0,0 +1,31 @@ +# vsnprintf.m4 serial 4 +dnl Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_VSNPRINTF], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_CHECK_FUNCS([vsnprintf]) + if test $ac_cv_func_vsnprintf = no; then + gl_REPLACE_VSNPRINTF + fi + AC_CHECK_DECLS_ONCE([vsnprintf]) + if test $ac_cv_have_decl_vsnprintf = no; then + HAVE_DECL_VSNPRINTF=0 + fi +]) + +AC_DEFUN([gl_REPLACE_VSNPRINTF], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_LIBOBJ([vsnprintf]) + if test $ac_cv_func_vsnprintf = yes; then + REPLACE_VSNPRINTF=1 + fi + gl_PREREQ_VSNPRINTF +]) + +# Prerequisites of lib/vsnprintf.c. +AC_DEFUN([gl_PREREQ_VSNPRINTF], [:]) diff --git a/m4/wchar.m4 b/m4/wchar.m4 new file mode 100644 index 0000000..068f22d --- /dev/null +++ b/m4/wchar.m4 @@ -0,0 +1,29 @@ +dnl A placeholder for ISO C99 , for platforms that have issues. + +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Eric Blake. + +# wchar.m4 serial 1 + +AC_DEFUN([gl_WCHAR_H], +[ + AC_CACHE_CHECK([whether is standalone], + [gl_cv_header_wchar_h_standalone], + [AC_COMPILE_IFELSE([[#include +wchar_t w;]], + [gl_cv_header_wchar_h_standalone=yes], + [gl_cv_header_wchar_h_standalone=no])]) + if test $gl_cv_header_wchar_h_standalone = yes; then + WCHAR_H= + else + gl_ABSOLUTE_HEADER([wchar.h]) + ABSOLUTE_WCHAR_H=\"$gl_cv_absolute_wchar_h\" + WCHAR_H=wchar.h + fi + AC_SUBST([ABSOLUTE_WCHAR_H]) + AC_SUBST([WCHAR_H]) +]) diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 new file mode 100644 index 0000000..cde2129 --- /dev/null +++ b/m4/wchar_t.m4 @@ -0,0 +1,20 @@ +# wchar_t.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether has the 'wchar_t' type. +dnl Prerequisite: AC_PROG_CC + +AC_DEFUN([gt_TYPE_WCHAR_T], +[ + AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, + [AC_TRY_COMPILE([#include + wchar_t foo = (wchar_t)'\0';], , + gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) + if test $gt_cv_c_wchar_t = yes; then + AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) + fi +]) diff --git a/m4/wctype.m4 b/m4/wctype.m4 new file mode 100644 index 0000000..a56834d --- /dev/null +++ b/m4/wctype.m4 @@ -0,0 +1,47 @@ +dnl A placeholder for ISO C99 , for platforms that lack it. + +dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_WCTYPE_H], +[ + AC_CHECK_FUNCS_ONCE([iswcntrl]) + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + AC_SUBST([HAVE_ISWCNTRL]) + AC_CHECK_HEADERS_ONCE([wctype.h]) + AC_REQUIRE([AC_C_INLINE]) + + AC_REQUIRE([gt_TYPE_WINT_T]) + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + AC_SUBST([HAVE_WINT_T]) + + WCTYPE_H=wctype.h + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + WCTYPE_H= + fi + dnl Compute ABSOLUTE_WCTYPE_H even if WCTYPE_H is empty, + dnl for the benefit of builds from non-distclean directories. + gl_ABSOLUTE_HEADER([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 + AC_SUBST([ABSOLUTE_WCTYPE_H]) + AC_SUBST([HAVE_WCTYPE_H]) + AC_SUBST([WCTYPE_H]) +]) diff --git a/m4/wint_t.m4 b/m4/wint_t.m4 new file mode 100644 index 0000000..2cac1a7 --- /dev/null +++ b/m4/wint_t.m4 @@ -0,0 +1,28 @@ +# wint_t.m4 serial 2 (gettext-0.16.2) +dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether has the 'wint_t' type. +dnl Prerequisite: AC_PROG_CC + +AC_DEFUN([gt_TYPE_WINT_T], +[ + AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, + [AC_TRY_COMPILE([ +/* 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';], , + gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) + if test $gt_cv_c_wint_t = yes; then + AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) + fi +]) diff --git a/m4/xalloc.m4 b/m4/xalloc.m4 new file mode 100644 index 0000000..837a948 --- /dev/null +++ b/m4/xalloc.m4 @@ -0,0 +1,24 @@ +# xalloc.m4 serial 16 +dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_XALLOC], +[ + AC_LIBOBJ([xmalloc]) + + gl_PREREQ_XALLOC + gl_PREREQ_XMALLOC +]) + +# Prerequisites of lib/xalloc.h. +AC_DEFUN([gl_PREREQ_XALLOC], [ + AC_REQUIRE([gl_INLINE]) + : +]) + +# Prerequisites of lib/xmalloc.c. +AC_DEFUN([gl_PREREQ_XMALLOC], [ + : +]) diff --git a/m4/xgetcwd.m4 b/m4/xgetcwd.m4 new file mode 100644 index 0000000..d8609d1 --- /dev/null +++ b/m4/xgetcwd.m4 @@ -0,0 +1,12 @@ +#serial 6 +dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_XGETCWD], +[ + AC_LIBOBJ([xgetcwd]) + + AC_REQUIRE([gl_FUNC_GETCWD]) +]) diff --git a/m4/xsize.m4 b/m4/xsize.m4 new file mode 100644 index 0000000..85bb721 --- /dev/null +++ b/m4/xsize.m4 @@ -0,0 +1,13 @@ +# xsize.m4 serial 3 +dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_XSIZE], +[ + dnl Prerequisites of lib/xsize.h. + AC_REQUIRE([gl_SIZE_MAX]) + AC_REQUIRE([AC_C_INLINE]) + AC_CHECK_HEADERS(stdint.h) +]) diff --git a/m4/xstrndup.m4 b/m4/xstrndup.m4 new file mode 100644 index 0000000..8a30ab1 --- /dev/null +++ b/m4/xstrndup.m4 @@ -0,0 +1,15 @@ +# xstrndup.m4 serial 2 +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_XSTRNDUP], +[ + gl_PREREQ_XSTRNDUP +]) + +# Prerequisites of lib/xstrndup.c. +AC_DEFUN([gl_PREREQ_XSTRNDUP], [ + : +]) diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..c0732b4 --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1,19 @@ +da +de +es +fr +ga +gl +hu +ko +nl +pl +pt_BR +ro +ru +rw +sv +tr +uk +vi +zh_CN diff --git a/po/Makefile.in.in b/po/Makefile.in.in new file mode 100644 index 0000000..82c71eb --- /dev/null +++ b/po/Makefile.in.in @@ -0,0 +1,405 @@ +# -*- buffer-read-only: t -*- vi: set ro: +# DO NOT EDIT! GENERATED AUTOMATICALLY! +# Makefile for PO directory in any package using GNU gettext. +# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License but which still want to provide support for the GNU gettext +# functionality. +# Please note that the actual code of GNU gettext is covered by the GNU +# General Public License and is *not* in the public domain. +# +# Origin: gettext-0.16 + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ +datadir = @datadir@ +localedir = @localedir@ +gettextsrcdir = $(datadir)/gettext/po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +# We use $(mkdir_p). +# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as +# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, +# @install_sh@ does not start with $(SHELL), so we add it. +# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined +# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake +# versions, $(mkinstalldirs) and $(install_sh) are unused. +mkinstalldirs = $(SHELL) @install_sh@ -d +install_sh = $(SHELL) @install_sh@ +MKDIR_P = @MKDIR_P@ +mkdir_p = @mkdir_p@ + +GMSGFMT_ = @GMSGFMT@ +GMSGFMT_no = @GMSGFMT@ +GMSGFMT_yes = @GMSGFMT_015@ +GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) +MSGFMT_ = @MSGFMT@ +MSGFMT_no = @MSGFMT@ +MSGFMT_yes = @MSGFMT_015@ +MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) +XGETTEXT_ = @XGETTEXT@ +XGETTEXT_no = @XGETTEXT@ +XGETTEXT_yes = @XGETTEXT_015@ +XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +UPDATEPOFILES = @UPDATEPOFILES@ +DUMMYPOFILES = @DUMMYPOFILES@ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ +$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ +$(POFILES) $(GMOFILES) \ +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) + +POTFILES = \ + +CATALOGS = @CATALOGS@ + +# Makevars gets inserted here. (Don't remove this line!) + +.SUFFIXES: +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all: all-@USE_NLS@ + +all-yes: stamp-po +all-no: + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. +# In this case, stamp-po is a nop (i.e. a phony target). + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch stamp-po" && \ + echo timestamp > stamp-poT && \ + mv stamp-poT stamp-po; \ + } + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + for file in $(DISTFILES.common) Makevars.template; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +install-data-no: all +install-data-yes: all + $(mkdir_p) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +install-strip: install + +installdirs: installdirs-exec installdirs-data +installdirs-exec: +installdirs-data: installdirs-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi +installdirs-data-no: +installdirs-data-yes: + $(mkdir_p) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: uninstall-exec uninstall-data +uninstall-exec: +uninstall-data: uninstall-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in $(DISTFILES.common) Makevars.template; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +uninstall-data-no: +uninstall-data-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +check: all + +info dvi ps pdf html tags TAGS ctags CTAGS ID: + +mostlyclean: + rm -f remove-potcdate.sed + rm -f stamp-poT + rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f stamp-po $(GMOFILES) + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: + $(MAKE) update-po + @$(MAKE) dist2 +# This is a separate target because 'update-po' must be executed before. +dist2: stamp-po $(DISTFILES) + dists="$(DISTFILES)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + dists="$$dists $(DOMAIN).pot stamp-po"; \ + fi; \ + if test -f $(srcdir)/ChangeLog; then \ + dists="$$dists ChangeLog"; \ + fi; \ + for i in 0 1 2 3 4 5 6 7 8 9; do \ + if test -f $(srcdir)/ChangeLog.$$i; then \ + dists="$$dists ChangeLog.$$i"; \ + fi; \ + done; \ + if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ + for file in $$dists; do \ + if test -f $$file; then \ + cp -p $$file $(distdir) || exit 1; \ + else \ + cp -p $(srcdir)/$$file $(distdir) || exit 1; \ + fi; \ + done + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: + +Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ + cd $(top_builddir) \ + && $(SHELL) ./config.status $(subdir)/$@.in po-directories + +force: + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/po/Makevars b/po/Makevars new file mode 100644 index 0000000..6e15a78 --- /dev/null +++ b/po/Makevars @@ -0,0 +1,59 @@ +# -*- buffer-read-only: t -*- vi: set ro: +# DO NOT EDIT! GENERATED AUTOMATICALLY! +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ \ + \ + --flag=_:1:pass-c-format\ + --flag=N_:1:pass-c-format\ + --flag=error:3:c-format --flag=error_at_line:5:c-format\ +\ + --flag=_:1:pass-c-format\ + --flag=N_:1:pass-c-format\ + --flag=error:3:c-format --flag=error_at_line:5:c-format\ + --flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\ + --flag=argp_error:2:c-format\ + --flag=__argp_error:2:c-format\ + --flag=argp_failure:4:c-format\ + --flag=__argp_failure:4:c-format\ + --flag=argp_fmtstream_printf:2:c-format\ + --flag=__argp_fmtstream_printf:2:c-format\ + $${end_of_xgettext_options+} + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Free Software Foundation, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-cpio@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..2b6afca --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,16 @@ +src/copyin.c +src/copyout.c +src/copypass.c +src/dstring.c +src/main.c +src/makepath.c +src/mt.c +src/tar.c +src/userspec.c +src/util.c + +lib/getopt.c +lib/rtapelib.c +lib/paxerror.c +lib/paxexit.c +lib/paxnames.c diff --git a/po/Rules-quot b/po/Rules-quot new file mode 100644 index 0000000..9c2a995 --- /dev/null +++ b/po/Rules-quot @@ -0,0 +1,47 @@ +# Special Makefile rules for English message catalogs with quotation marks. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-create: + $(MAKE) en@quot.po-update +en@boldquot.po-create: + $(MAKE) en@boldquot.po-update + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff --git a/po/boldquot.sed b/po/boldquot.sed new file mode 100644 index 0000000..4b937aa --- /dev/null +++ b/po/boldquot.sed @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g diff --git a/po/cpio.pot b/po/cpio.pot new file mode 100644 index 0000000..882e2e1 --- /dev/null +++ b/po/cpio.pot @@ -0,0 +1,911 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "" +msgstr[1] "" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "" + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "" + +#: src/copyin.c:642 +#, c-format +msgid "%s is not a directory" +msgstr "" + +#: src/copyin.c:755 +#, c-format +msgid "%s: Cannot symlink to %s" +msgstr "" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "" +msgstr[1] "" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, c-format +msgid "%s: truncating %s" +msgstr "" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +msgid "inode number" +msgstr "" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +msgid "device number" +msgstr "" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "" + +#: src/main.c:119 +msgid "STRING" +msgstr "" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "" + +#: src/main.c:137 +msgid "FLAG" +msgstr "" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "" + +#: src/main.c:233 +msgid "Print program version" +msgstr "" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" + +#: src/main.c:725 +#, c-format +msgid "Cannot open %s" +msgstr "" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "" + +#: src/util.c:493 src/util.c:543 +#, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:499 src/util.c:549 +#, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "" + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "" + +#: lib/paxerror.c:127 +#, c-format +msgid "%s: Cannot hard link to %s" +msgstr "" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, c-format +msgid "%s: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" diff --git a/po/da.gmo b/po/da.gmo new file mode 100644 index 0000000000000000000000000000000000000000..9c22793a8fe1e2de62c0a579261a0642f422ed12 GIT binary patch literal 4330 zcmb7`O^h5z6~~(p0@(yY!bcKfNC8=!VE1^|j+4#UM8+S)D{Kj zs^0s*uYUWXyMLZAj`AGfdHq94au&S*!~8HFxjRX|1U?Er0GfrM&)^Z>{|Y48Fl=YJoR^RI%BfUkpc&#ytz=Q{Wl_+B@^{;~GH zlc1dYD)@2m$KV&hpMm#-zXj#I-*xy`P|kf1Tm$d9x83(3C~}X3!qaB=ei`iXUV`_5 zzW^ur;0;iCdw|JLf+=_bd=6X(e*#ARL9y$4hwp$X@BadYzb8@h32+OPc?-(^UxKpl z_n_$WHYj%90EMsnFjnv&xCwq8{5E(E+yMUs9s>UZ3eN{WktD~#lc3n?K+*p-P~z&1 z4zGg}FMk7%fd2$fflm-zqK5|MoF9T>-U&L3R;*lJbAwCxS z37h0AJTing%!&iLqTS*%;bk$Nl(z#J{Ig=`6~} z%e={(O8dnXgZM{TIU+cxDra+U8mOYGOpYpU7Uak@RqLa*cE!$hRb;nW>11D7AFbDi zROU==4`EL%%Z#$kbZC5JrLm=TJGP}W?9Rl01Jzh>MlQF-HQczg zSmKDj2+7n8W@>f${Ps(iztvN>-L>u1 z$XWDm%n>EJsm#oakvS@H*7|;DVyq&vvfbWV^8d=eBJ8(8r-n^fMRtbUM#1^rWLRli z3Z+IBxpm%T$w*s?=iFe-#1MITVO8#3GZTZgkZU}Ccxmh0LRRuYkq2!;bO%gzi9w5- zlqj>17lTMIGb-z5s>b9BdDLz5X6oifjT-NX$$bm8F{L8pT@z+aScumNGBJ9Wgi6q48!Bo(rXKS%{S^x}iNEuBFuA!}K|o)PV@rK2wE-YKa?RfeV%ktrPaG z%nKhHSefEJzf06jbW>9glO63X{0$Zas@6g^(KUfBrO`wurMLv!c6<>~U#L%B^zI6A znr>z3%WVmTms#P|vEK3Cvl|<0m(9%ikY1|uB1_LSd7W;%0im9!B6d2rP0#s!?Zp?i z)3Z{ZshH_Gs`Nk|>-V2Y`%kC+XVk`1gN>&T_mB7c2&R|GKq=NMxs9}cEZsORa{d1E zm$ug~>N=#`Ufa6TczmGFR@ka86gI1K-Bjw-NG5(TIbBRC|Glhyjy*PScuBX7o(|MG zZHs!MPGuZYo-QfdQR>pxrSmIOH+ucGv(yLDAl;@q5NlMJqq9mE_GIi%wFzI_`pygK z=H`iK(~Xs|=r%S!J#R-Yi{x((i?H_H^m${AZi0IK~r)ezkHjL475V&g%uuFrmSg$$V-84 z56aDyLl*bzY6_L6DsrjX3MslFnMJ9}gG^aHw{f<~cdM*m62-``e1E_AUuz5TLv2Uo zwUVssG@v!!)Dc(GQch{nSQmEX-nLoXv|jo>Xi$)KheO()_yMoH^|bvaE=W;rZ>%Zg z;-^TB9+#ws*d!e>r65wZThdB;SLAWk4%?}fA^SSv`R5ubZI4-+`({S}7LT<35oZj2laqwB$>pBtA4S+hHLzOfQb~1JD^YQ^TJ2FJ z!xb`T)h?H3j<3*<>nvTL4uHWRvQ zx~GoKQ)tSPE|(SEv#i4nz6`3`EN5Hp7q3B0_Wd5Ihnmx6F%oU@xv10jPrt_n;~Q0O65(^+>hxcx0=YT> literal 0 HcmV?d00001 diff --git a/po/da.po b/po/da.po new file mode 100644 index 0000000..07c93c7 --- /dev/null +++ b/po/da.po @@ -0,0 +1,1154 @@ +# Danish cpio translation po-file +# Copyright (C) 2000 Free Software Foundation, Inc. +# Claus Hindsgaul , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.3.911\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2001-02-13 14:00GMT\n" +"Last-Translator: Claus Hindsgaul \n" +"Language-Team: Danish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 0.8\n" + +#: src/copyin.c:45 +#, fuzzy, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "advarsel: sprang over %ld ubrugelige byte" +msgstr[1] "advarsel: sprang over %ld ubrugelige byte" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "omdøb %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: for langt filnavn" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: fejl i tjeksum (0x%x, burde være 0x%x)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "" +"%s ikke oprettet: nyere version eller version med samme alder eksisterer" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "kan ikke fjerne nuværende %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "kan ikke lænke %s til %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "kan ikke ombytte ord-halvdele i %s: ulige antal ord-halvdele" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "kan ikke ombytte byte i %s: ulige antal byte" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "'%s' eksisterer, men er ikke et katalog" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "kan ikke lænke %s til %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: ukendt filtype" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "arkivet endte for tidligt" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "advarsel: arkivhoved har omvendt byte-rækkefølge" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "standard-ind er lukket" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, fuzzy, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d blokke\n" +msgstr[1] "%d blokke\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "kan ikke læse tjeksum for %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: afkorter inode-nummer" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "filnummer = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "filnummer = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: afkorter inode-nummer" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "standard-ud er lukket" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "ignorerede tom linie" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s ikke gemt: ikke en almindelig fil " + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: for lang symbolsk lænke" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s lænket til %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "" + +#: src/main.c:87 +#, fuzzy +msgid "Main operation mode:" +msgstr "bånd-aktivitet" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "" + +#: src/main.c:119 +msgid "STRING" +msgstr "" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "" + +#: src/main.c:137 +msgid "FLAG" +msgstr "" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "" + +#: src/main.c:233 +msgid "Print program version" +msgstr "" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "ugyldig blokstørrelse" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "" + +#: src/main.c:389 +#, fuzzy, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"ugyldigt arkivformat '%s'; gyldige formater er:\n" +"crc, newc, odc, bin, ustar, tar, hpodc, hpbin" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "kan ikke åbne katalog %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "fejl ved lukning af arkiv" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "kan ikke oprette katalog '%s'" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "'%s' eksisterer, men er ikke et katalog" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s er ikke en tegn-specialfil" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, fuzzy, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Brug: %s [-V] [-f enhed] [--file=enhed] [--help] [--version] operation " +"[antal]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "ingen bånd-enhed angivet" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "ugyldigt hoved: fejl i tjeksum" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "ugyldig bruger" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "kan ikke finde logind-gruppe for numerisk bruger-ID" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "ugyldig gruppe" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "skrivefejl" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "læsefejl" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "filen endte for tidligt" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Fil %s skrumpede med %ld byte, udfylder med nuller" +msgstr[1] "Fil %s skrumpede med %ld byte, udfylder med nuller" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Læsefejl ved byte %ld i fil %s, udfylder med nuller" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "virtuel hukommelse er opbrugt" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "kan ikke søge i uddata" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Båndafslutning fundet. Indsæt næste bånd og tryk RETUR. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Båndafslutning fundet. Indtast klargjort enheds- eller filnavn for at " +"fortsætte.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "Indtast navn på en klargjort enhed eller en fil.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "intern fejl: bånd-deskriptor ændredes fra %d til %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: tilvalg '%s' er flertydigt\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: tilvalg '--%s' tillader ikke et argument\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: tilvalg '%c%s' tillader ikke et argument\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: tilvalg '%s' kræver et argument\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ukendt tilvalg '--%s'\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ukendt tilvalg '%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ugyldigt tilvalg -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ugyldigt tilvalg -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: tilvalg kræver et argument -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, fuzzy, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: tilvalg '%s' er flertydigt\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, fuzzy, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: tilvalg '--%s' tillader ikke et argument\n" + +#: lib/rtapelib.c:299 +#, fuzzy, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: service utilgængelig" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, fuzzy, c-format +msgid "Cannot execute remote shell" +msgstr "kan ikke køre fjern-skal" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "kan ikke lænke %s til %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "Læsefejl ved byte %ld i fil %s, udfylder med nuller" +msgstr[1] "Læsefejl ved byte %ld i fil %s, udfylder med nuller" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "kan ikke lænke %s til %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "kan ikke lænke %s til %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "Læsefejl ved byte %ld i fil %s, udfylder med nuller" +#~ msgstr[1] "Læsefejl ved byte %ld i fil %s, udfylder med nuller" + +#~ msgid "Memory exhausted" +#~ msgstr "Hukommelsen er opbrugt" + +#~ msgid "block size cannot be 0" +#~ msgstr "blokstørrelse kan ikke være 0" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt version %s\n" + +#~ msgid "Success" +#~ msgstr "Succes" + +#~ msgid "parse error in blocksize" +#~ msgstr "tolkningsfejl i blokstørrelse" + +#~ msgid "Regular expression too big" +#~ msgstr "For stort regulært udtryk" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Brug: %s {-o|--create} [-0acvABLV] [-C byte] [-H format] [-M besked]\n" +#~ " [-O [[bruger@]vært:]arkiv] [-F [[bruger@]vært:]arkiv]\n" +#~ " [--file=[[bruger@]vært:]arkiv] [--format=format] [--" +#~ "message=besked]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blokke] [--dereference] [--io-size=byte] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < liste_med_navne [> arkiv]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "Regulært udtryk endte for tidligt" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f arkiv] [-s erstatning]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=erstatning] [mønster...] [< arkiv]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "bloknummer = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "Ugyldigt navn på tegnklasse" + +#~ msgid "drive type = %d\n" +#~ msgstr "drev-type = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "ukendt flag '%c' for -p; accepterede flag er 'aemop'" + +#~ msgid "ambiguous" +#~ msgstr "flertydig" + +#~ msgid "missing regexp" +#~ msgstr "manglende regulært udtryk" + +#~ msgid "1 block\n" +#~ msgstr "1 blok\n" + +#~ msgid "No match" +#~ msgstr "Ingen træffere" + +#~ msgid "residue count = %d\n" +#~ msgstr "resterende antal = %d\n" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [bruger][:.][gruppe]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[bruger][:.][gruppe]] [--no-preserve-" +#~ "owner]\n" +#~ " [--sparse] [--help] [--version] mål-katalog < liste_med_navne\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "drev-status = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "Uparret [ eller [^" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C byte] [-E fil] [-H " +#~ "format]\n" +#~ " [-M besked] [-R [bruger][:.][gruppe]] [-I [[bruger@]vært:]arkiv]\n" +#~ " [-F [[bruger@]vært:]arkiv] [--file=[[bruger@]vært:]arkiv]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blokke] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=byte] [--pattern-file=fil] [--format=format]\n" +#~ " [--owner=[bruger][:.][gruppe]] [--no-preserve-owner] [--" +#~ "message=besked]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [mønster...] [< arkiv]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f arkiv] [-s erstatning]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=erstatning] [mønster...] [< arkiv]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "drev-status (lav) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "Ugyldigt sorterings-tegn" + +#~ msgid "Unmatched \\{" +#~ msgstr "Uparret \\{" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr "Uparret ) eller \\)" + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "Ugyldigt foranstillet regulært udtryk" + +#~ msgid "null regexp" +#~ msgstr "tomt regulært udtryk" + +#~ msgid "%s already exists; not created" +#~ msgstr "%s eksisterer allerede, blev derfor ikke oprettet" + +#~ msgid "Invalid back reference" +#~ msgstr "Ugyldig bagudreference" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Brug: %s [-cdnv] [-f arkiv] [-s erstatning] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=erstatning] [mønster...] [< arkiv]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "Uparret ( eller \\(" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio version %s\n" + +#~ msgid "invalid" +#~ msgstr "ugyldig" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax version %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "Ugyldigt indhold af \\{\\}" + +#~ msgid "Invalid range end" +#~ msgstr "Ugyldig område-afslutning" + +#~ msgid "Trailing backslash" +#~ msgstr "Afsluttende omvendt skråstreg" + +#~ msgid "can not omit both user and group" +#~ msgstr "kan ikke udelade både bruger og gruppe" + +#~ msgid "Invalid regular expression" +#~ msgstr "Ugyldigt regulært udtryk" + +#~ msgid "No previous regular expression" +#~ msgstr "Intet tidligere regulært udtryk" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f arkiv] [-s erstatning]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=erstatning] [mønster...] [< arkiv]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "drev-status (høj) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "%s under fortolkning af mønster" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "ugyldig modificerings-tegn for regulært udtryk '%c'" diff --git a/po/de.gmo b/po/de.gmo new file mode 100644 index 0000000000000000000000000000000000000000..0a6c7817958399299784992c485ae2e16a5aaf9e GIT binary patch literal 4592 zcmb7{O>7)z8Gr`}g_=NV`Dp`zzCfKHl3CkHn3#m-NYHgO`yX{91WW@o;go$l;6 z+izy<*b)**9C}9OQYvxlp%OxH=&>BQAyqN&rGD$gI`)9~Z={p{zP^PYpc z?`!aj@aOQ`@E33|{2kQ&-fQ_+sQZ2lXW&B*H|rjSI`2uSb~@SqUV$Bc58)T!oA3%g zcpJ|0``>Kx6}XSVvoM4qv{27^3#xv${_5A=Yz+b`d!}p>3 z?>|uGdjuubUx!*=gctaoz>Dx5xD5XV55u!xYUFqop5gaTq1xvUQ04ysYMksLcpirb zpujWm1^8na!FQngaqpM$F`R?yzZ|MuKZD5ILBPM@sg@_8 z#?hsg1E~7F4v)jPq1y3p5VHq_tAEQ{X*@$`}Q8{rxdLjGY(uY<}t z*SzvFcKA+sczsnjeU9?c{8O79;iHfGO=VO0_4#xI?{AGswS(GLAN94`m#_&A@zDp< z2bje_nAhul5aR0TqdpAzkUl;hG#1oMyKSN z9hyX{LS{?-t@C4NqRJ#)v1Xkm1*@Wwktj8?W?Y#SR?O|JtfmW+dNlU){bA0ebso9N z5nca9tZq>ih2(`zIjJjIo|_a=igBe|hM~;HGtG!yi}EblWu%>ZYc`%O4@y#)(jG*? zJTKNIvJ$zp9vNFT+e{}j6;ni`UY6EHUEV+H%xiV#409f|M;QM92ky4pcJ<1QQLo6e z*c*SRO)6L0II1$6N@k11h^KH^E7Ji zI_|ZZ2`(13O~mji`cg$>(-FB+Ldlqqj_kT>wUD^5$X%PG zqOwV1*0R{lX`D5_UmqANL{_rVnF&7W{99`MCg`MBSN9@2!EJF>xQ(EfM|P+tHIk*a za3%@j$Z9;N24x0@$V)RTsVnNSDjcbCjl&N&FQ1>x)qD{0ph<{!gHbd@p~*?2!c69? zLZp|8hh;sIKDk03wac6t6>CP~+Bsr!+dyf|Pzd>=uEupWnO?3(W9e;Fgdx(YZ;J$1 z_yEv1erU(!L6rB`3zs}#!E`t<&LLTx7o|p4RyE1l%Zqp@C2==>imKX~NqA0#zHh)+GVg|Fe{8L#1|NoJBq%E)IC6<(7E^27s1-P1I?y;_+sInx zsv4_|aG%>C>IP9=QV)am$XV>yofuFW4P_9O1h$q&=XmGT!otjo85gb!ua;?+giCc=hO0%FP)|dhb~d$jr*P@a^=qr) zIW5mr%_M^qd+oml1Bab8zNr!x9CF=tq1)0$Qgu9|4nmFJBc zQ8Z5{=4_s+h-YT5UcP$ao|X%p`I&Q+1~MRAr7#d?6qmVi9%c49-N-hBwA$liud_%>n`dm-MJ` z)SXf0^N)8niw6~6*)(-pb!FMqh9INVI!SZGV3gyv)=5pt$&9O{j0c6)O`8q+rmRv@ zW#BTy*HVT^ z?~XT`?uco<8-{jk+{Y$zNK5l!*>1(*7H%Z7@m{!Gk0|Ee>q;|l# zW?*95#*&jxIaxLxZTsW}j738$Wr<<}QiDWY4qK>=BTV2YbBvd z`F(}7<}l46w!1a$tQzJ=eP;Orpy{P~u&GI5vogqyX38r@JG$?%x*&KFL$^VdWQOYl zJvMya)no1e_=-*NLepr~rB<6Q=|@6VCb!M<*-2J4Y3lP<1GF99CWP<3lNfebo;zea z>$=Y8;Jp`+mD_ zVh;xw%^*jGp2}5-l3J z5{YUqBuQ{{TAG%$`KRvg-_7=y#@5xQajEzIy#Xhe+N;3SN4D=p4W`A;$x^#I@Rd|E zjq29tKOjRN{672xOx|}}1I@T;IxYI^Ou5TgoBliOa>d63hmjNhmO$?5Md3z!Q6ONw z|Fy&T0?&0pBj|sPzofSY4M!*RA&mehTVz^)E6=OoWv&kB+NGeXABM%a&$XeFdX$=> Z8K}K|IINhAXz~SehtznJoTUH+{{, 1996. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.3.911\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 1996-06-23 18:00\n" +"Last-Translator: Daniel Naber \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/copyin.c:45 +#, fuzzy, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "Warnung: %ld Bytes Müll (junk) übersprungen" +msgstr[1] "Warnung: %ld Bytes Müll (junk) übersprungen" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "Benenne %s um -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: Dateiname zu lang" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: Prüfsummenfehler (0x%x, hätte 0x%x sein müssen)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s nicht erzeugt: Neuere oder gleichalte Version existiert schon" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "Kann `%s' nicht löschen" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "Kann %s nicht mit %s verbinden" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "" +"Kann halfwords (Byte-Paare) von %s nicht vertauschen: ungerade Anzahl von " +"halfwords (Byte-Paaren)" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "" +"Kann die Bytes von %s nicht vertauschen: unterschiedliche Anzahl von Bytes" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "`%s' existiert, ist aber kein Verzeichnis" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "Kann %s nicht mit %s verbinden" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: unbekannter Dateityp" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "verfrühtes Ende des Archivs" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "Warnung: Archivkopf hat umgekehrte Byte-Reihenfolge" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "Standardeingabe ist geschlossen" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, fuzzy, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d Blöcke\n" +msgstr[1] "%d Blöcke\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "Kann Prüfsumme für %s nicht lesen" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: kürze inode-Nummer" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "Dateinummer = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "Dateinummer = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: kürze inode-Nummer" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "Standardeingabe ist geschlossen" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "leere Zeile ignoriert" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s nicht festgeschrieben: Kein reguläre Datei" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: Symbolische Verknüpfung (link) zu lang" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s verbunden mit %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "" + +#: src/main.c:87 +#, fuzzy +msgid "Main operation mode:" +msgstr "Bandoperation" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "" + +#: src/main.c:119 +msgid "STRING" +msgstr "" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "" + +#: src/main.c:137 +msgid "FLAG" +msgstr "" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "" + +#: src/main.c:233 +msgid "Print program version" +msgstr "" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "Ungültige Blockgröße" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "" + +#: src/main.c:389 +#, fuzzy, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"Ungültiges Archiv-Format `%s'; gültige Formate sind:\n" +"crc, newc, odc, bin, ustar, tar, hpodc, hpbin" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "Kann Verzeichnis `%s' nicht öffnen" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "Fehler beim Schliessen des Archivs" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "Kann Verzeichnis `%s' nicht erstellen" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s' existiert, ist aber kein Verzeichnis" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s ist keine Buchstaben-Spezial-Datei" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, fuzzy, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Usage: %s [-V] [-f gerät] [--file=gerät] [--help] [--version] operation " +"[count]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "Kein Bandlaufwerk angegeben" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "Ungültiger Header: Prüfsummenfehler" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "ungültiger Benutzer" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "Kann nicht die Login-Gruppe zu einer numerischen UID ermitteln" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "Ungültige Benutzergruppe" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "Fehler beim Schreiben" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "Fehler beim Lesen" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "verfrühtes Ende der Datei" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Datei %s um %ld Bytes geschrumpft, wird mit Nullen aufgefüllt" +msgstr[1] "Datei %s um %ld Bytes geschrumpft, wird mit Nullen aufgefüllt" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Lesefehler bei Byte %ld in Datei %s, wird mit Nullen aufgefüllt" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "Virtueller Speicher überfüllt" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "Kann nicht in der Ausgabe suchen" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Ende des Bandes gefunden. Nächstes Band einlegen und RETURN drücken. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Ende des Bandes gefunden. Zum Weitermachen Gerät/Datei-Namen angeben.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "" +"Zum Weitermachen Geräte- bzw. Datei-Namen angeben, wenn das Gerät bereit " +"ist.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "interner Fehler: Bandbeschreibung änderte sich von %d auf %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: Option `%s' ist nicht eindeutig\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: Option `--%s' erlaubt kein folgendes Argument\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: Option `%c%s' erlaubt kein folgendes Argument\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: Option `%s' benötigt ein Argument\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: unbekannte Option `--%s'\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: unerkannte Option `%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: illegale Option -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ungültige Option -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: Option benötigt ein folgendes Argument -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, fuzzy, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: Option `%s' ist nicht eindeutig\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, fuzzy, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: Option `--%s' erlaubt kein folgendes Argument\n" + +#: lib/rtapelib.c:299 +#, fuzzy, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: Service nicht erhältlich" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, fuzzy, c-format +msgid "Cannot execute remote shell" +msgstr "Kann keine 'remote shell' ausführen (Shell auf anderen Rechner)" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "Kann %s nicht mit %s verbinden" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "Lesefehler bei Byte %ld in Datei %s, wird mit Nullen aufgefüllt" +msgstr[1] "Lesefehler bei Byte %ld in Datei %s, wird mit Nullen aufgefüllt" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "Kann %s nicht mit %s verbinden" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "Kann %s nicht mit %s verbinden" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "Lesefehler bei Byte %ld in Datei %s, wird mit Nullen aufgefüllt" +#~ msgstr[1] "Lesefehler bei Byte %ld in Datei %s, wird mit Nullen aufgefüllt" + +#~ msgid "Memory exhausted" +#~ msgstr "Speicher überfüllt" + +#~ msgid "block size cannot be 0" +#~ msgstr "Blockgröße kann nicht 0 sein" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt version %s\n" + +#~ msgid "Success" +#~ msgstr "Erfolgreich" + +#~ msgid "parse error in blocksize" +#~ msgstr "kann die Blockgröße nicht interpretieren" + +#~ msgid "Regular expression too big" +#~ msgstr "Regulärer Ausdruck ist zu lang" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M " +#~ "nachricht]\n" +#~ " [-O [[benutzer@]rechner:]archiv] [-F [[benutzer@]rechner:]archiv]\n" +#~ " [--file=[[benutzer@]host:]archiv] [--format=format] [--" +#~ "message=nachricht]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < namens-liste [> archiv]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "Verfrühtes Ende des regulären Ausdrucks" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archiv] [-s ersatz]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=ersatz] [muster...] [< archiv]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "Blocknummer = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "Ungültiger Charakterklassen-Name" + +#~ msgid "drive type = %d\n" +#~ msgstr "Laufwerks-Typ = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "unbekannter Schalter `%c' für -p; bekannte Schalter sind `aemop'" + +#~ msgid "ambiguous" +#~ msgstr "unklar" + +#~ msgid "missing regexp" +#~ msgstr "fehlender regulärer Ausdruck" + +#~ msgid "1 block\n" +#~ msgstr "1 Block\n" + +#~ msgid "No match" +#~ msgstr "Keine Übereinstimmung" + +#~ msgid "residue count = %d\n" +#~ msgstr "Rückwärtszähler = %d\n" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [benutzer][:.][gruppe]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[benutzer][:.][gruppe]] [--no-preserve-" +#~ "owner]\n" +#~ " [--sparse] [--help] [--version] zielverzeichnis < namens-liste\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "Laufwerkszustand = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "Einzelne [ oder [^ ohne Entsprechung" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E datei] [-H " +#~ "format]\n" +#~ " [-M nachricht] [-R [benutzer][:.][gruppe]] [-I [[benutzer@]" +#~ "rechner:]archiv]\n" +#~ " [-F [[benutzer@]rechner:]archiv] [--file=[[benutzer@]rechner:]" +#~ "archiv]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[benutzer][:.][gruppe]] [--no-preserve-owner] [--" +#~ "message=nachricht]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [muster...] [< archiv]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f archiv] [-s ersatz]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=ersatz] [muster...] [< archiv]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "Laufwerkszustand (tief) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "Ungültiger Vergleichsbuchstabe" + +#~ msgid "Unmatched \\{" +#~ msgstr "Einzelne \\{ ohne Entsprechung" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr "Einzelne ) oder \\) ohne Entprechung" + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "Ungültiger vorangehender regulärer Ausdruck" + +#~ msgid "null regexp" +#~ msgstr "leerer regulärer Ausdruck" + +#~ msgid "%s already exists; not created" +#~ msgstr "%s existierte bereits und wurde deshalb nicht neu erzeugt" + +#~ msgid "Invalid back reference" +#~ msgstr "Ungültige Rückreferenz" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Usage: %s [-cdnv] [-f archiv] [-s ersatz] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=ersatz] [muster...] [< archiv]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "Einzelne ( oder \\( ohne Entsprechung" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio Version %s\n" + +#~ msgid "invalid" +#~ msgstr "ungültig" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax Version %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "Ungültiger Inhalt von \\{\\}" + +#~ msgid "Invalid range end" +#~ msgstr "Ungültiges Bereichsende" + +#~ msgid "sense key error = %d\n" +#~ msgstr "Schlüsselfehler = %d\n" + +#~ msgid "Trailing backslash" +#~ msgstr "Nachfolgender Backslash (`\\')" + +#~ msgid "can not omit both user and group" +#~ msgstr "Benutzer und Gruppe können nicht gleichzeitig ausgelassen werden" + +#~ msgid "Invalid regular expression" +#~ msgstr "Ungültiger regulärer Ausdruck" + +#~ msgid "No previous regular expression" +#~ msgstr "Kein vorangehender regulärer Ausdruck" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f archiv] [-s ersatz]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=ersatz] [muster...] [< archiv]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "Laufwerkszustand (hoch) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "%s während der Compilierung des Musters" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "Ungültiger Zusatz `%c' zu regulärem Ausdruck" diff --git a/po/en@boldquot.header b/po/en@boldquot.header new file mode 100644 index 0000000..fedb6a0 --- /dev/null +++ b/po/en@boldquot.header @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff --git a/po/en@quot.header b/po/en@quot.header new file mode 100644 index 0000000..a9647fc --- /dev/null +++ b/po/en@quot.header @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# diff --git a/po/es.gmo b/po/es.gmo new file mode 100644 index 0000000000000000000000000000000000000000..1683db0aa2f52cb5b42b2a2b9bb9938eeb043f2a GIT binary patch literal 15282 zcmcJVdyE`OeaDN}0n7V1?g1eb2gWvbuh+)DJJ$B$^?Gdz-MA4+xL&5{VKef$&EjL=l1{5}+swAyG&K5dk3~AV`ozh~yHa0dpW(Rl#)b|D$fxiw~@N?iR z!0&=D1fTLOV_pPW@CD!z@Fn0vz!KcY@81mg1#q0-{|mkjeCe~96U@Ln!CwL23;rGW zK5&-JoC3cNYTR3&YYba9cY!;>X>b>K5qv86AyDi2T`&bd3myP(f1Yo@4DROl+rjhT zCqVUo+KnFfgWAXa;H$t6Xu*$xu)usV;8(yK`296d>-ZLU2>dZP4IX^HF?*h1%wj8Z9|Zh!Q1g8SJPdvVRQqSaRMGb!I03f6 z{osee6X2J?mx0f`#kZdT`DE?|8N%eClMhhyejL>J{}k$9aI2qp5BPGv9{@Gay`bpx z0dN-lYj6R)0pZ#U-Ur?Rz7N#;J_kY?^L_9ls7=$wWT57MFSrN%1o%Plo1o} zhrokiBYgh|D7pJ2cnJI|n1D}0Xf;m?BFg4%pyc?2{D*3oKL$1aX99i=)I9$QN`8L~ zs^8NYT;p8~!P6u-}g`g_4~es@6e^`jsvYrY4*13CL4D86zLABou_#sgI{WQoD&A)=um!E|1yAdYI*Zm+vnO_A}|0z)N z@sHvAk3g1WUcyHUz6MnL^Pt9mcfdab5AgeYUz8-#m8X@p9IDCFMyKo{{Zg-pLnOYgNH%YH$X^b-VbX3p8-XmZ-K`^ zby@285IKQ6*kxqjPp!$ClM9drywU7D{kLm|jn72?m zl!DTu=s{$iO_F?<6zwOaoTI#sGWYU# z&pjU8|Dws;DB`Ie?JcJu7ET@j=U3-J$<3Sef#(9HOL?Py@Q7D>o=6cr9;84jb1&r# zr9ly0^*rFg$$?&9M3F7fvrbubZ~nh01Jd{V!nfyvF=dnTPKspm`4s7Z9?7`)dXXag z@j{B8+bK6w-c4DftWcy+mnjD+dMxEhdf~Z=vO$ro)z2-wNOz?VO^W0Kb#U?1G4Pit zZ>GG0BAsYcD#|M5)sz=gCMbGdLqUYyBR$t6d7h)lF6ddNJkz~-*}glxzZI13$o`;S zW{UC#%DX6fUhBcxb-hYX^*n7(Y3K{uE%BE>?WnHI!QB)GrO8*iJD|-elcm;ZV|eueX~sBZqk~xd2)#^ z1-;^SV&k>MZX{)u7P(C>r&ZU@p$@HHyW`rs$;xD{m&Ij0#iV<&xrXQ#h0Th5jhQEH znq|ovODQ^C4H-ptM^hW3Cf|s&v^An8v^~G0xue=?TSZdkJK12C6_;$B+qhiowUfN- zhv_$_DMX6fjdZP7^c>YD>%q@!pfY)&mzD`_t~N##UB`scy-@RUFE6yd>Iz3KZkSrt zX1h^jY18p?D~Y>hFK@Vu7(iHrvKB(Mb*0 zAFIf-&3ZsDvJ%xON-lRL>}CprR9#!Fx-ClnoUWh+?KGEw+r}okk@vD}NI}xP>LxLJ zUsYXl2?a^aRHu{VPD_~I$-YP$m(BHbBN;bS{>76LKBA>@w$~;bNp90sn|3QN{>>uq z#!O(F1zJ#T=@;}vWP(@yHB{X=Z^dPcZ=GIu+|D~?L2H&5XBH6GmVNE~;*wYE)lJ)7 zcZ4oo&3eK1!@hG!$H;D1WzsIX=(At-b*-Z4b${;5D9U!+mBLDJoV{92VOGi(iq2-# zi7|3*3G*(|DvDNp2QRF<2ix(V+r6xtc94`-vI;9(=J@IP>DNb#v-i)K;{~QNnsvlN zxZ*NMX+0IFi9);itG0tGzTx!z+}zZe6K2{=eR4Tz_Mmhic(tBnnVCii$|AFu;!-x- zw$iGT#hc@Hx>uIiE|z-o^wcR4pvWD^cILe7+-r9Rb$0LAyq)8A&hL(9PA)KD&1R1+ zBi`d?+SzegM<!1ROmARLsH2sV$0j2L2} zAVG}mE^JMoNi{`wn-la}rR2@T+Pd!(HBFc1tA&~IW+jkvwJh4m!|2@yx!HY1ANJB$XRk=+!+WZc@*1$HaP{J9TKT4jwZyD+n~yl`gR zno+%$3dYRw5xr!ul^`vy$ z6ULjCYHV!ga@_8~*vT<#UuLJpZO>@gC8yMSiJYZo1aT_}6dg2+jS73jEyFiDcX!=j z#SJ-vEu#iW?YSdcJO0$Qw2}&{pfE)q^);lwst#ltQ9ry^XeDKfZM9yMT`apID7=u+ zS9RCXa;!qfxhgZ8I|2}7H402y*NGwg6@Rb{iqi-4=gH|IcW%jEk{B97)X$`%+mVa zWgv2k+E!JH`j|O99ZO(h7v9N`PMSH{?KpF?)VIiImgkPoESP!ua}8MwluSX(Yd0RD zxy~jxYn5JOFS+f+U3P{iogbb@N>f(W$B-;S-Td@dZ{~st+G_p?ysq}OwVS-gI<`#E z_hFOftTRW8OAE7SPI(eae1l@gcB9DPa=q(D+`QQ9AVaM*mV*anbFqDxLqFu%tC_e!mtlq4Dn`> zw^Fg3kDIip5@*omnPiK)sp2rE^kyJl)u}}C5bS!JE((%ZIcA7x-R}c_z*fbw92NW+ zPTpMLr>e!nNzIlWg%+10wop*2S9|V-N$?LEk>~^wh%q@>#QZDel;Y;+XX~TfJ12Ek|7c zBJQ~fHS?ez;%eAd+>OWW3@0Bn1@j_8MAf1nQVsfDojBF~<>OWB3GU|C&$`-8?>cA= zcGp2a%OYf0ZchoyF_q(jtqh`@& zjMmYBD`QWmp{%cK5stPiLpJMN6EE9c8Dp-RlXbKc+_fq~bQfa3;c$gXU02bk$XeLO z(re$Ysm1Bp+1<56lFnk`LR<7&VL^0eYHntDw0`X16jf&(A4L3I4h8pkAB08ruDNFT zkU_b(Oo?s18oP5HhkhJfh^3IY2a~cOBCQbMxP(w%V(u$?w%y}o;>8+^?xWnONIRU? zd>lJIwp4D~^Dx(QXs5R8e>yk1)0w$;K}4$HOw_|L5S^TpimaTQ9A7!-6lBGmbDxf_ z=$tgU(xLj$U+w4r*MUn$J7f;iTIL#E~7(#OVILBJoebNW8FsNA~6dKP(_aVC6;qz53dU+pT zE2S3%N3_Gi{rgWyVVO*hHOr=s^i6i#v<(=97?P+`*@g9unsJAgSyiCZbrNKEe-x|R87B;W z{1DGcSMIjv3M+y1iWf*|zrtG$$#uU5=SzKy8ncm>-5!i+BT=Yea(O+5O7ss=;bhHI z;#O@J!>>3**3)~82(!;d`^~G1DcO^j-GKp=N0EG8Ao+Cl7EUOA6K7)lHqVyD1x~5a zY%9VzDGNDibrx}lgahMuj1i1rU!%EdEp0`|duvs+R7|46Ymu59Tg!XnMY%S1c77>x z$5%#(PH<43v~{b7#F(-N`08khgBohWVQ(KHSehSpDJ){G zqqB?i(Oq{PdUdpa&{&J(5FX7Cohi_ow0A{~v^#b->y>d9oy34*1M-ghSsgua*!tI_ zyK?)|qjvx9!({(l`uTxgGW6;b(30si!5CJoEG1$m1e8fbBB@F$l8V@VELW*tApy-f zpc#_ViEHZHCAkkM2mKMNbu!ozc-ZNZZ=`8*LSsq6qYBv>KEXm@j3v2+&LEhRv{0f` zOYlPwN;lmY+ZGiv*0hEQMZ19#vb=i9Eflj#>1pNQ3fHRWG&MB_=pho-FlyuL;i z(hzDx0-Ke@t+w2#QbCUmlFx} z>Fe)t_2rISsU6TTNI{jh8;^1nDPYHT9>7(f5VNRP{uusM?OeFn{j#%T2ldMjUjF=Ah$~|vOT07~i6W${_gbX+$ zJfgEQ-qoYomD5PzqsSi;kaqtQOW?BJ%V>r|HsTf0Lc(0>HApkT7-aJ)aDR@(o=9L& z#)sSu5&3Y`G`CrAjV)#U=)qd7DVrdwk#7}!Tgjl+DKyN zA!W_SNr_ct%9p1WX6Nmuo%{S7mS@jQIVIHj6v}veq?09y{fuFIF@}S-lBs%j6yLTV z;-Ca=p$wUHCssqdc4vU%de>X&mh1m#xr4Pn&V`DIgUxHZK2+MGFl?5Cw?wQ?yzlCD zQzZvPlAs-R27WhZXPIi3XqOwb5q}#k50@)oUY%nJfk7RJ@GeZ z2yQ=gDxGBoZSbVXKUfh_%jov=quVRKnO`_Db7qU`CWI9|#emSjrRcE+T#yuXrXFF( z*`!EDmOdCeyN}QlRN0uXMKx}xnhKe8@tD~8v(vNRJc9tsDiHD6Yh>>iQ*oh%=mk=V zq8x`R5`3tY&*bMmkW$QJc(NfjaPF3+W-Ha{E=C+$SHUrFp}Rk*O_r2iw!d)SSgIUL z)1`Yu1_x#s(fG!LnNFDCWUFqBBr6-v()!1QZp7Uqo? zoNx~?FT)x7*&XDF=_i${(_nff%E5RyL4C0KHY zQ7geadv^#uLhpV$zanwJtzG}Fp%}Vr*dh(v2O7F)2)(8y&Oc>AL)yzimE? z+m4n?6qR9yCf#gsdxtekw+_xta_ykh!NXidpjGq1gkfmBLqW%?Ns_vb_(ODXM}907_0Dpd zd*Y0feh8@v;w4nWUZ#JdAd z#F@LI!2b{2m^t&$bJEX6?(Ctbc)4X-S+QK!u^C_RhD@=1k58f@3*?fblu^gf%k0dB zOm>UBk&Da*t8j-2XGOK@jDQ3GA;!2>x%~GvdR0Z{DY?~B<0K!)lvnADng3blRtlc} zK`y7KaJ^FlhTydbyI|w6l|p#^orm)Y5=<^T94#Ri3?g)|$D^q(JUI2^8i=E6i{kG* zAoftpm{5YW9X#QWJ!*M&9AbJOHuhW7%-w(BCy{VxKXLrS)%DR+qlG(>7!j8ll30## z)rgnwMdaQ?q#*y}LkdZ`KfubY>6)Z3JAE^TQRws@cJh)XNr_x>!4?AM3@70FyK3ac zNlK7wG8j|`QS1-b_xaM@H*Uv|xD|Srs=;UWEn=F7 zu2CLmkE`6NJigwU^{VLNJwYdGxKxD7iM%+3K8R$saQrZ zV`K#QaYdAQy(eL%#_N;t$fKpq=v9xwwSgWMop5m^7bpV^Jr!ysm=<#U{CQw4Vy==) z<{XQsyCfI0L;R+@Ome!^Z>n&TBp?EFB4LQZakeB%cL@+ldwrTG{hyFMkOI?HEzf zS{!q;m%>ccJUFMqV4T&Wv)OY=ri zmj2l753FHMzahnH&RgnUVVAD4b~}NuMSFN8C1U%Q*&iJHw$|lzeR42u!&t4u`-vg) zT{!?!Gr~TP8tRH>;rfdM2J%{O&Rygb=E^%Tq8bH>vRt_fOWi$(-%74jw@z*S8!(oQ zTKiMlh|{2`+Y;MaW<(wbS?5oneX^P;-sz>gG({QfptIsa<(fBS`29xuFn^fQPi@GX ziYe`Q^RcSQUmaGv4Xf@42w6~I?GwTFGZ`Redz2d8E}*|1a}xFfAc1f(?8FRs0n5#uvq-yI*LSrK|r~K z)7esL<8I+ta&3+=-Yyx*qR4AGu|RjVr>)t)t@T&-HdnMZ?tYE{m3t;<47kYR1oJ4D zV#5R-+EKWp8N?1y)_F#eTvpT!hF~&(Z0uj!vE4>oX}8yC, 1996. +# Santiago Vila , 1996, 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU cpio 2.6\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2005-01-04 14:50+0100\n" +"Last-Translator: Santiago Vila Doncel \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "atención: salto de %ld byte de basura" +msgstr[1] "atención: salto de %ld bytes de basura" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "se renombra %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: nombre de fichero demasiado largo" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s error en la suma de comprobación (0x%x, debería ser 0x%x)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s no se ha creado: existe una versión con fecha igual o posterior" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "no se puede borrar el actual %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "no se puede crear un enlace de %s a %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "" +"no se pueden intercambiar las medias palabras de %s: número impar de medias " +"palabras" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "no se pueden intercambiar los bytes de %s: número impar de bytes" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "`%s' existe pero no es un directorio" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "no se puede crear un enlace de %s a %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: tipo de archivo desconocido" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "fin prematuro del archivo" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "atención: la cabecera del archivo tiene los bytes en orden inverso" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "la entrada estándar está cerrada" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d bloque\n" +msgstr[1] "%d bloques\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "no se puede leer la suma de comprobación de %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: se trunca el número de nodo-i" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "número del fichero = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "número del fichero = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: se trunca el número de nodo-i" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "la salida estándar está cerrada" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "línea en blanco descartada" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s no se ha volcado: no es un fichero regular" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: enlace simbólico demasiado largo" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s es un enlace a %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"GNU `cpio' copia ficheros a y desde archivos\n" +"\n" +"Ejemplos:\n" +" # Copia ficheros en lista-de-nombres al archivo\n" +" cpio -s < lista-de-nombres [> archivo]\n" +" # Extrae ficheros del archivo\n" +" cpio -i [< archivo]\n" +" # Copia ficheros en lista-de-nombres a directorio-destino\n" +" cpio -p directorio-destino < lista-de-nombres\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "%s no tiene sentido con %s" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "Modo de operación principal:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "Crea el archivo (ejecutado en modo copy-out)" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "Extrae ficheros de un archivo (ejecutado en modo copy-in)" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "Opera en modo copy-pass" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "Muestra una tabla del contenido de la entrada" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "Modificadores de operación válidos en cualquier modo:" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[USUARIO@]MÁQUINA:]NOMBRE-DE-FICHERO" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"Utiliza este NOMBRE-DE-FICHERO en lugar de la entrada o la salida estándar. " +"Los USUARIO y MÁQUINA opcionales especifican en usuario y nombre de máquina " +"en el caso de un archivo remoto" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "El archivo es local, incluso si el nombre contiene dos puntos" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "FORMATO" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "Utiliza el FORMATO de archivo dado" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "Establece el tamaño de bloque de E/S a 5120 bytes" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "TAMAÑO-DE-BLOQUE" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "Establece el tamaño de bloque de E/S a BLOCK-SIZE * 512 bytes" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "Utiliza el antiguo formato de archivo transportable (ASCII)" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "Muestra un \".\" por cada fichero procesado" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "NÚMERO" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "Establece el tamaño de bloque de E/S al NÚMERO dado de bytes" + +#: src/main.c:119 +msgid "STRING" +msgstr "CADENA" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" +"Muestra CADENA cuando se alcanza el final de un volumen en el medio de " +"respaldo" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" +"Solo copia los ficheros que no encajan en ninguno de los patrones dados" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" +"En el modo detallado de lista de contenido, muestra el UID y el GID numéricos" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "ORDEN" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "Utiliza la ORDEN remota en lugar de rsh" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "No muestra el número de bloques copiados" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "Muestra los ficheros procesados con detalle" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "Activa la información de depuración" + +#: src/main.c:137 +msgid "FLAG" +msgstr "OPCIÓN" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"Controla la visualización de los avisos. Actualmente OPCIÓN puede ser " +"'none', 'truncate', 'all'. Si se dan varias opciones, se acumulan." + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Modificadores de operación válidos solamente en modo copy-in" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "FICHERO" + +#: src/main.c:146 +#, fuzzy +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" +"En modo copy-in, lee patrones adicionales que especifican los ficheros que " +"se extraen o listan de FICHERO" + +#: src/main.c:148 +#, fuzzy +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" +"Cuando se lee un archivo en formato CRC en modo copy-in, solamente verifica " +"los CRC's de cada fichero en el archivo, sin extraer realmente los ficheros" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "Renombra ficheros interactivamente" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" +"Intercambia tanto las medias palabras de las palabras como los bytes de las " +"medias palabras de los datos. Equivalente a -sS" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "Intercambia los bytes de cada media palabra de los ficheros" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" +"Intercambia las medias palabras de cada palabra (4 bytes) de los ficheros" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "Extrae los ficheros a la salida estándar" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Modificadores de operación válidos solamente en modo copy-out:" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "Añade a un archivo que ya exista." + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Nombre del archivo que se usará en lugar de la salida estándar. Los USUARIO " +"y MÁQUINA opcionales especifican el usuario y nombre de máquina en caso de " +"un archivo remoto" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Modificadores de operación válidos solamente en modo copy-pass:" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "Enlaza los ficheros en lugar de copiarlos, cuando sea posible" + +#: src/main.c:186 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "Modificadores de operación válidos para los modos copy-in y copy-pass:" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "Crea todos los ficheros relativos al directorio actual" + +#: src/main.c:196 +#, fuzzy +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" +"Modificadores de operación válidos para los modos copy-out y copy-pass:" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" +"Una lista de nombres de ficheros se termina mediante un carácter nulo en " +"lugar de un carácter de nueva línea" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Nombre del archivo que se usará en lugar de la entrada estándar. Los USUARIO " +"y MÁQUINA opcionales especifican el usuario y el nombre de la máquina en " +"caso de un archivo remoto" + +# FIXME: No me acaba de gustar "desreferenciar" +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"Desreferencia los enlaces simbólicos (copia los ficheros a los que apuntan " +"en lugar de copiar los enlaces)." + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[USUARIO][:.][GRUPO]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" +"Establece el propietario de todos los ficheros creados al USUARIO y/o GRUPO " +"especificados" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "Actualiza la fecha de acceso de los ficheros después de leerlos" + +#: src/main.c:212 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "Modificadores de operación válidos para los modos copy-in y copy-pass:" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" +"Mantiene las fechas de modificación previas de los ficheros cuando se crean" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "Crea los directorios iniciales cuando sea necesario" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "No cambia el propietario de los ficheros" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "Reemplaza todos los ficheros incondicionalmente" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "Escribe ficheros con grandes bloques de ceros como ficheros dispersos" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "Opciones informativas:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "Da esta lista de ayuda" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "Muestra un mensaje corto de uso" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "Muestra la licencia y finaliza" + +#: src/main.c:233 +msgid "Print program version" +msgstr "Muestra la versión del programa" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, fuzzy, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +" GNU cpio es software libre; puede redistribuirse y/o modificarse\n" +" bajo los términos de la Licencia Pública General de GNU tal y como\n" +" se publica por la Free Software Foundation; bien en la versión 2\n" +" de la Licencia, o (a su elección) cualquier versión posterior.\n" +"\n" +" GNU cpio se distribuye con la esperanza de que sea útil, pero\n" +" SIN NINGUNA GARANTÍA; ni siquiera la garantía implícita de\n" +" COMERCIABILIDAD o IDONEIDAD PARA UN FIN DETERMINADO. Véase la\n" +" Licencia Pública General de GNU para más detalles.\n" +"\n" +" Usted debería haber recibido una copia de la Licencia Pública General\n" +" de GNU junto con GNU cpio; en caso contrario, escriba a la Free Software\n" +" Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 EE." +"UU.\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "el tamaño del bloque no es válido" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "Se ha definido varias veces el formato de archivo" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"formato de archivo `%s' inválido, los formatos válidos son:\n" +"crc newc odc bin ustar tar (también puede ser todo en mayúsculas)" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "Modo ya definido" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "No se puede usar --no-preserve-owner con --owner" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "No se puede usar --owner con --no-preserve-owner" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "Valor inválido para la opción --warning: %s" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[directorio-destino]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"Debe especificar una de las opciones -oipt.\n" +"Pruebe `%s --help' o `%s --usage' para más información.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "Se está usando tanto -I como -F en modo copy-in" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "Demasiados argumentos" + +# FIXME: Falta un paréntesis en el original (?) +#: src/main.c:677 +#, fuzzy, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"Se usa --append pero no se ha dado el nombre del fichero (utilice las " +"opciones -F o -O)" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "Se está usando tanto -O como -F en modo copy-out" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "Demasiados argumentos" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" +"No se especifica el formato de archivo en modo copy-pass (utilice la opción " +"--format)" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "-F sólo se puede usar con --create o con --extract" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "no se puede abrir el directorio %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "error al cerrar el archivo" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "no se puede crear el directorio `%s'" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s' existe pero no es un directorio" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s no es un fichero especial de caracteres" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Modo de empleo: %s [-V] [-f dispositivo] [--file=dispositivo]\n" +"\t[--rsh-command=orden] [--help] [--version] operación [contador]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "no se ha especificado ningún dispositivo de cinta" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "la cabecera es inválida: error en la suma de comprobación" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "usuario inválido" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "no se puede obtener el grupo de login de un UID numérico" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "grupo inválido" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "error de escritura" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "error de lectura" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "fin prematuro del fichero" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "El fichero %s ha sido reducido en %ld bytes, se rellena con ceros" +msgstr[1] "El fichero %s ha sido reducido en %ld bytes, se rellena con ceros" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Error de lectura en el byte %ld del fichero %s, se rellena con ceros" + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "El fichero %s ha crecido, no se han copiado %ld bytes nuevos" +msgstr[1] "El fichero %s ha crecido, no se han copiado %ld bytes nuevos" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "El fichero %s ha sido modificado mientras se copiaba" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "memoria agotada" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "no puede posicionarse (seek) en la salida" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "" +"Se ha encontrado el final de la cinta.\n" +"Cargue la siguiente cinta y pulse INTRO." + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Se ha encontrado el final de la cinta. Para continuar,\n" +"introduzca el nombre del dispositivo/fichero cuando esté listo.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "" +"Para continuar, introduzca el nombre del dispositivo/fichero cuando esté " +"listo.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "error interno: el descriptor de la cinta ha sido modificado de %d a %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: la opción `%s' es ambigua\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: la opción `--%s' no admite ningún argumento\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: la opción `%c%s' no admite ningún argumento\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: la opción `%s' necesita un argumento\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opción `--%s' no reconocida.\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opción no reconocida `%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opción inválida -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opción inválida -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: la opción necesita un argumento - %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: la opción `-W %s' es ambigua\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: la opción `-W %s' no admite ningún argumento\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: Servicio no disponible" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "entrada estándar" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "salida estándar" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "No se puede ejecutar el shell remoto" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, fuzzy, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "No cambia el propietario de los ficheros" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "no se puede crear un enlace de %s a %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +"Error de lectura en el byte %ld del fichero %s, se rellena con ceros" +msgstr[1] "" +"Error de lectura en el byte %ld del fichero %s, se rellena con ceros" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "no se puede crear un enlace de %s a %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "no se puede crear un enlace de %s a %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#~ msgid "error %d" +#~ msgstr "error %d" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "" +#~ "Error de lectura en el byte %ld del fichero %s, se rellena con ceros" +#~ msgstr[1] "" +#~ "Error de lectura en el byte %ld del fichero %s, se rellena con ceros" + +#~ msgid "Memory exhausted" +#~ msgstr "Memoria agotada" + +#~ msgid "block size cannot be 0" +#~ msgstr "el tamaño del bloque no puede ser 0" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt versión %s\n" + +#~ msgid "Success" +#~ msgstr "Conseguido" + +# ¿"del tamaño" o "en el tamaño"? sv +# Es error al analizar el tamaño del bloque, no es que +# en el bloque haya un error sintáctico. em +# Sí que lo hay: en el tamaño del bloque que le hemos dicho que use +# hay (se ha producido) un error de análisis sintáctico. +# Además es "in", no "of". +# Si lo quieres más claro: el tamaño del bloque no es quien provoca el error +# sino su análisis sintáctico, por eso no es "un error del tamaño del bloque" +# Además, así parece que está hablando del tamaño del error: +# Error (de análisis sintáctico) del tamaño de una casa... :-) sv +#~ msgid "parse error in blocksize" +#~ msgstr "error de análisis sintáctico del tamaño del bloque" + +#~ msgid "Regular expression too big" +#~ msgstr "Expresión regular demasiado grande" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Modo de empleo: %s {-o|--create} [-0acvABLV] [-C bytes] [-H formato] [-M " +#~ "mensaje]\n" +#~ " [-O [[usuario@]nodo:]archivo] [-F [[usuario@]nodo:]archivo]\n" +#~ " [--file=[[usuario@]nodo:]archivo] [--format=formato] [--" +#~ "message=mensaje]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=bloques] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < lista-de-nombres [> " +#~ "archivo]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "Fin prematuro de la expresión regular" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archivo] [-s reemplazo]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=reemplazo] [patrón...] [< archivo]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "número del bloque = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "El nombre de clase del carácter es inválido" + +#~ msgid "drive type = %d\n" +#~ msgstr "tipo de unidad = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "" +#~ "la opción `%c' no es reconocida para -p, las opciones reconocidas\n" +#~ "son `aemop'" + +#~ msgid "ambiguous" +#~ msgstr "ambiguo" + +#~ msgid "missing regexp" +#~ msgstr "falta la expresión regular" + +#~ msgid "1 block\n" +#~ msgstr "1 bloque\n" + +#~ msgid "No match" +#~ msgstr "No concuerda" + +#~ msgid "residue count = %d\n" +#~ msgstr "contador residual = %d\n" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [usuario][:.][grupo]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[usuario][:.][grupo]] [--no-preserve-" +#~ "owner]\n" +#~ " [--sparse] [--help] [--version] directorio-destino < lista-de-" +#~ "nombres\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "estado de la unidad = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "[ o [^ desemparejado" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M mensaje] [-R [usuario][:.][grupo]] [-I [[usuario@]nodo:]" +#~ "archivo]\n" +#~ " [-F [[usuario@]nodo:]archivo] [--file=[[usuario@]nodo:]archivo]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocs] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=archivo] [--format=formato]\n" +#~ " [--owner=[usuario][:.][grupo]] [--no-preserve-owner] [--" +#~ "message=mensaje]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [patrón...] [< archivo]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f archivo] [-s reemplazo]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=reemplazo] [patrón...] [< archivo]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "estado de la unidad (bajo) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "El carácter de cotejo es inválido" + +#~ msgid "Unmatched \\{" +#~ msgstr "\\{ desemparejado" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr ") o \\) desemparejado" + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "La expresión regular precedente es inválida" + +#~ msgid "null regexp" +#~ msgstr "expresión regular nula" + +#~ msgid "%s already exists; not created" +#~ msgstr "%s ya existe; no ha sido creado" + +# Iñaky dirá que retro-referencia. Habrá que discutirlo. sv +#~ msgid "Invalid back reference" +#~ msgstr "Referencia hacia atrás inválida" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Modo de empleo: %s [-cdnv] [-f archivo] [-s reemplazo] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=reemplazo] [patrón...] [< archivo]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "( o \\( desemparejado" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio versión %s\n" + +#~ msgid "invalid" +#~ msgstr "inválido" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax versión %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "El contenido entre \\{\\} es inválido" + +#~ msgid "Invalid range end" +#~ msgstr "Fin de rango inválido" + +# ¿? +# ¿ A qué se refiere exactamente ? em +# ¿ O será detección de un error de tecleado ? ar +#~ msgid "sense key error = %d\n" +#~ msgstr "Detección de un error en la llave = %d\n" + +#~ msgid "Trailing backslash" +#~ msgstr "Barra invertida al final" + +#~ msgid "can not omit both user and group" +#~ msgstr "no se pueden omitir simultánemente el usuario y el grupo" + +#~ msgid "Invalid regular expression" +#~ msgstr "Expresión regular inválida" + +#~ msgid "No previous regular expression" +#~ msgstr "No hay ninguna expresión regular previa" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s reemplazo]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=reemplazo] [patrón...] [< archive]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "estado de la unidad (alto) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "%s al compilar el patrón" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "el modificador de la expresión regular `%c' es inválido" diff --git a/po/fr.gmo b/po/fr.gmo new file mode 100644 index 0000000000000000000000000000000000000000..4d54858cf23c99675ab38d18becda72ca4166d0b GIT binary patch literal 15578 zcmdU#ZH!!3dB+chgk*v8o&;#iA=Io*_Kw%aPMoo0yk3u;4c=XMUlPD9$=#W|yEmS> zcer2bWOD?Z1ZTm$;05rh;0HkM=fhwOejYps-u!Iee-+%v z?>B?@fu8_1{<`OQJOJt(uLWNLc0mh%41@*d&kOu2crCvl2DOiGfrr5#fwSPD=Nfa% zlZ?3picTMcS$s8L0#Ab90L8x>SWNG40Y%r-;6bnh>itIw`~y(yeHA3SIzpXoi?JsP*3o-U5CCd^h+F zQ1bkGn5lUl1lPdNgRsopfKsqUv$wz#p!&ZW)H-hjHQ#T7qT?TfOlcklnZi5|>!9S} z1EA#pk3f!O{t?tTy@bT(W>D+A64X3vpy>Fn0>1#>&hH<98{ibi$Aa$%XTaYFzYhKf z_z?IP2>mMf4i*i-Z-bZ$a~+dQ9&ZG7zE^?Qfo}tu+Wb2BA@DPxO7$~{@E{I8Uo7cL}<`8GWn?Ri_0vq6m zLGAaSz~i7rX&1qJL5^U4x4>_MlKX35Dk5YKg13Q7;0f^Ep!WBdpyXulL4V#^@Cd)} z0$&CGDyVfI2DQ%fVa6sHfycnFfqFjybM*ck_$=@v;G4kDg0R-q5Dt!LRzdOe9pLYQ zp9lG8E^x?m;77p(`~mnpFl5t`zise2;0Hm`?{`3*>zkm~{~?HonmU_Dw9V^5M94e{ z?g2kp;KQKk_V3^+@DM^Ox!wUS_#yBF_yzDc!2bp{-+Su*T%Q3MYQ6;C0RAV)Kl99^ zUN7zfU%>B8Q2Tul)chX+r7xcYb)Ij6*MR>9ir@bQz7P~qMfVqh_kx?C=J_&+m^s;& z9F`x+List!7mexCQd*y;kL2PRG*rZ7H0>v*ou}PJ8~tcc`mi0R=X2m|X%}hN({7?g zG<}w6_tD-;yN-q^xzF7N3Pg)H(OUY!=Oj)1l?;eK`pnXtY=N)S13vfDdbC&T2cH!W z=I21s;{lrJeh+Pdwoa2g=<@~-&OYeti)hjXeYR-J?wkMbDS-6-HN~@MgCT8)_BL9B z_FNj|cOS{9LE=)@b7EB^oN=K9>KV?7uqM-sb!1;*64Fk#AXIbU-d z=e84tNt|r9qdd14*^4rpccW$;w(UmTj?|?cCl{iY?WM&K z^>1cT*o#_qn?x5Gk}@jnL^j-v>~@spahllZQk?hP8XC~*ce<{>TP%w<`|U6*m#Dih zHqjKlG_~zC*<|Iqjoa;LldYuPo~8@}yQirG@g~_0+i`1`H$~t3_B8k8leU#cc{0fX z+wJtC4HFw?oBd9d^!zkcXSzb9u(KX-_S3$jTD_e7K24NGZ|KKaM4zk85d=?Q!QdXK z`4exi=zY~4?zXv6YUMkf^|T!~9WTd8+{^k&GwdN6&@^pDHtBcPqs$SxpIk`Ni;3q> zZ>KA9sM~&$Ma^_Gi61~JDguhyo~FCLcf^@6L6D?D7cxfKb`&r-!qW^BNyvI+`#Cc@ z;SBsc`afQuE9Nr6X-!wnl_u?-azZb%64fAxF7+hrW(I=fJ)3U0BTD|9uAl{-IFW$c z^&NC0>9^Y>3KA!IFA6#PhTcUNQIN>Ybh}aFw1oAY?2Dvf*4&D>qnerVUpy({BU&1^ zr);zxB{tr$aWD7c-%OKU$O5*Rq6PWbxI#ZfCU{ltA@7ArE6iFv>-Kv!yXce!tyx`e zEFrEfd*|ZvidXB69oyS-gwEWXt(4;z=T0CUGrLn|Q77%8&wkfWXcuX}_cPx{nsvgS z6jp-c?A1mLvto{rc6Wkqh>`0^nD>fSL9pQmcwyZ)JdS_d>9>1v7fESF8?drvPM%$y zeO0hL_u7UznPMt~IY%snE6fThEtdkdP|M_SKR>f@%FKGHk1j>cK9nv9 zo^M6%wwXl;vb1e4hM8=(ZN+)F9q!cZY(LAeU2OIA*_ksUK$rKat@ubMx}p z8$)$+epPDOMbbh5HiolQ>g*NC zoSr+|Fk-hky|^?#vtmv|1)K-c;ez2CHpOlw zm_PTxNvo`JZkHM>t4j+tYjzv8k}_w4kLX8JR(^nkZ^zAOzo_Qz7OYPYp0Kr3n=oe< zR_%SwZk$f~z2pT&IGxOqCyX~O`NTxyQrPLj*!qOEFSWDcwr8~Ll2dAZ37n;7263wp zCIG_+lKFS{&?A8%}u!rTXvfyw&#zH5B#xvX+=3yL1EG)s5GS7RTnbt@_ux$ z&`Qb{+I%a`dRTTvP$H;s`*HwVqWh? zMagfJ;rCbPPC3$_nLEW4-W+P-!Y0&th||L*@(}BSE-DuDN-SN~dbZmizU3e!$S~v5u+hNanAu?Ph5ci5uy2rBoGG(nT1>RD_dJf(S~ZiFbO%V`kgT z!cLh6n578Ug<&7M7~;(|X~kkW4|nL1N6w(jGszb9V#Q%B>CHg6p{zvmP}ubjLlh*j zbIcIYx<3c}fUSyUNfrDYPTpMLr=eb)mqvV0MP%ctYnF?h%*7t#F^qxApl?5VdS+>H^_*G0 z7T(kT8_B>i@4_&)XKy65LeT-!d_Uj4Kg1z1@j_81o^U`QXQ(HPMpf| z^6`4>3GUX{&+@ff-VM+m?A}9untkKLR-T~KSs`)kNRP`5FE^_)qcTqRd~o*~|7{eG zOWye{ z5#1HB-)OkPqHd_@leSyf#>{Kq-kIguxw(C%Lz2#7;flWKwZej6VP?KDI$ISxI7L;i z@0v@7j~JADvY6P`tFg=LNcwSbMJ$EHJrHFn5owM9hZ%(O67!n0 zZ##W56ED_SbRXpgY1}1S^Koo#VkO(L_rYAxp-COr|8#D2(wVtVN<^yQOw_|L5S^Tt zimaWl*VfKE1z9ua-J=t0%9HAA6=lu&UH$i(VU@|EzG2r1>|uuzk#HnRUT=rELuH0G z-b~m;%M^L;W?^F5DS@Ni%u=j1lu(vg`RcN-0$7PJYKMm{Cg_A0(9AL(*O4d7S2B_$ zs!{Vo-tV~c4~Izx@%UvxKYWo#(FG`6h)OwC?yQFFopz_ZKWz~@y5hjlN)=mjoyXMs z$^q4D6J;5!YPQo{R=LbEl?mThL9XTPFm}R*L?sBgPIva zq4`{NUqqLCe7&m0DDUG-rSyW}h<3Da|NaqDm__x8X4X_n-{iDSyAFd8Lkd-Dd$GPj zGwjl{ou}w@Sp?Zvt>OgRxs2+OV{r9r3kF45eaItsnCdmzYGx8*T%z^DR1HnL!QCOm zeFVDn{Y83y#S5vCal+u|FXB1r%5iHhvl2+Jc!7jgFTB-|Tvu;!zPxYo#%#w~uMZ~|=bzCAc_#7-ZnPfrKahv|1V%zME~7A83fc8Unh$0%ysE~V=+!3>2?dn_xy zpO{-(tgX(g3J`_u+U(46h9{eSyjidkg`K)Rt!#PA9;1xa>Nih#(8iBX%+Jj?hQ~ip zo1RcP0p}g8kh!5ZWPkgK$>QXwt7#E@-7&Yk7#ulrm^}|WYpZ1CL4$BjkyqUw3E1ky zxpqGb+reopDn=pcx}W(S2aj6+^^U!XJ#G)|J4!Xsm!qpMz8IZMhBoXs3Bz&%NE>cP zO<6aDGnph`B4W>}G2#j+ogqAA11{yvy91S_YwD;B;!$4EtsN8O=l!gjB6JfBdIO5o zgMrGG!!8>Vza zvPKEpzxD1)rR)KvY*nMGB6j)8+o-Wu?aAWhr|8Yj9>OYFGMEnDLj-C~mSGOmWe=nM z)mw!0)$D)4kkEM3#1S>c<(d%L=N4@4DY=8@p}Q z4vFXmz!$j1&dbQpPgmc@!L|DGUxO@#dal;(8B`QBD*naFPcQ?cR4blEwq(a;G%X2L z39!5alSG_&x0<(OCXvHqXt?e7Vj`%4*M!R}-;dXG*ZOxix_sU|>bE1^d6X;o+UQY^v9NmfEQ&3S>_cJRWl=9h zGnq%XOL5wx4&J1&jaEP6^s@BIP6b0Wvu4g#i#i#1<#Q*^Ma8`H7`bj9+Z={U@gQ># z6W|2-Q?_m&G7IDC$m(sB#ZSbtj@ay=+9~g;zu**NCN65}HG38+aKy0lC@jjUrO%w9 znvV9}`OTFEP8nlF4S{vrlP=uM^bYkdj6r*H>xa;iq1>jas^aM1!ltSdg?2|F(&A!c zdEDy{SRZmhI5(E6FS`*<{=b}vsGX{UV&382#ZO;mm&x*67~0f=jsqKYTs_4XS1@on zrF+k*2Zpw-EadN_O6hI@ipsr`{>Tg3kkzt)tpNr7*sRRVoh4g3)d-ZJBVvRPMKPSx zK76CHk31nmUK4qbQ&D}VEcT3#S^NpcC{QZ$y@pwk?M5x5O9NH=9gkh9A3gA-YDT{5 z|3jq1OYDaHiOPY}N1P<`Ns&fkB;mBDXBOrb7yPuue@RP*M3kqulJ!32tz3CK5`=$v zoC|_cauft*j(oDXC(wcv^9Sr2ZI<||-U1_4K=aoH8*H#|vjP68my(!3HDZJW0=Qus zG4hh*^&Uev+G&={U?(_b3Z9HB`&WXpw<6dWKcFqQ27_#{F;E=D&a{La0sF2z0U|`H zP9enDmffYn!0p&uD#zrqo126y191!`^))3;L12Ji&te4@qH#%rvS;Y{RV?P+j4WvG zl3jmqFyK0`PwW>H<;x}&942j~+enV;EN_QiqN=~+*xMQqq87IWqVU*}#!TE*Xci|| z8?8WR7Zb?E!|a`N6kWZf4R0SD>*cjWD`He6YB`?shX7KVIO3kdx!kP3&Lv0|b>Ww; zAZBp|n~qMdP_U&!p6`PqhTU#|hnJ0ol_f2`+Y}S$t>JjP&-vU2V@~Q=*zDw#`x@_u(92;aP{h&>6z^pfl*m%9vBm zn}+aTld5Egt-^^C=ZRn{F7UM=_mmye(9%RYO_iiLrPDPDQm9*!#lk^Udby1mrSJ?3 zDbt{?m~nq!;ynAPKAO9o{iTnqJzz;BuvI)81Xbd@N7p7!b}NH27MHLqZ^EW3@ooAL zv$#U3`RkGv*}|Z>MbYJDGwz1%;wq&zxF09u9U(>LuPiO%X`ERc#)YH1w^VzTY(TfB z@^svyETK!&Bxqcy5K^;W4wb~YHsH(d&gJ+ML(GvKIXSO}IKE!$B za<1V%$GkwCxD$>nKDy|S8H@}0DMl+msgKBIXlL)7`KyIS#UuxSetFaA%-P znKBNNZ+B@L7gQ3b;e2R=u4$au5Ch0bmUfIxKkf}iyW&m#U34YtF5+%a!Z|GNu&bD? z;2n^|2vHKUVd`v1JUrJm*+^&Zm3#@ssS~xzW*oJVf6N`%IlILIOiJxMRx04qC4a?} z@COZ%SsD7X4Uny<)^J>v`#6Fp z^!_4+c*I{7rTi@&fByD_1~U10sA^y4Zjt^sb0I?ui}NR!8d62K7jn2H8JOikTNw%8 zWq8KJnq4A16;X1$SbMTcf%fAKiA-GaykXqUF;dE(R(R&LqW&ew-H8MKhRCzReL>7b z^>Qja}1&n|Tt z<>%eE%Pjxbfyas}MZ-$Yt`}CL(aiAL>WZgN=<=#`73Xo{rjW2VMP8Z+v@+~rm|D+0MqW#H14>EPveUSm5!i0?hsxVH#KM`tfB zoDa@+iC}#aUuJrh_>O1r&Yrlq%$;(W%e$XG5x;8IK1_3~NTxI)>*2QkCeNAKvZ_*w zBQ+{n@!Wic%Ztl{`NGk1GsHz?nLe+z_>0CZ=rWlX=WXPUOtJnaUy~muU@u zo2IASr%@`YuZ?riNa%_@(T9U;#w|$AQhzZlCqkG#ED<0#!x7Yn?H&&(my5aSU=`q3(5=CZx7kE z@})g_wUX~c1UlTNCn2S%BJXcIF00B!@Th4Nlx9V)KQh&z9aCG=t|tfWfeS2)RC;tl z5QCh04hMsMCJm)0IsWNl`<9JMJoQ%H0J{=`wIi zw}DgsI#4Mm_ko18x*pYtPI!MmZ&GIUgE3Qx6G<<8CP&TpNo>dChBEpqw^B1_bQP@F z$%n3pI*~=-N+k*t%jb1nfQkea-!GFX4J^&r$T(`R?$Tw{b+|b^9Y>>5-OwntFRODk zmxvQyx$8$|SYy0&S^CgGRsBZgKrshW;Oe``o?{g8om<8Q4-}M@B?ZUbu@$*i#aI_5 zOOT}B5c0BG?bvIsD2Er7^FC3;?{HzMIMfc5!)uzEyBkX@bIZ$(c}flL`Xo~YZ6rV` zXfC_TbLRpoevF_0vbm7bkWj*x?%bWGQ$3{N{-`&&V(F`NS8YxGQOQ!9CI^VWr{ezr DQ8Tx9 literal 0 HcmV?d00001 diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..9584edb --- /dev/null +++ b/po/fr.po @@ -0,0 +1,1244 @@ +# Messages français pour GNU concernant cpio. +# Copyright © 2004 Free Software Foundation, Inc. +# Michel Robitaille , traducteur depuis/since 1996. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU cpio 2.5.90\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2004-09-18 08:00-0500\n" +"Last-Translator: Michel Robitaille \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "AVERTISSEMENT: escamotage de %ld octet rejeté." +msgstr[1] "AVERTISSEMENT: escamotage de %ld octets rejetés." + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "Le nom de %s a été changé pour ->" + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: nom de fichier trop long." + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: erreur sur la somme de contrôle (0x%x, devrait être 0x%x)." + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s n'a pas été créé: une version récente ou identique existe." + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "Ne peut éliminer l'élément courant %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "Ne peut créer un lien de %s vers %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "Ne peut intervertir les demi-mots de %s: nombre impair de demi-mots." + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "Ne peut intervertir les octets de %s: nombre d'octets impairs." + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "« %s » existe mais n'est pas un répertoire." + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "Ne peut créer un lien de %s vers %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: type de fichier inconnu." + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "Fin prématurée de l'archive." + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "" +"AVERTISSEMENT: l'ordre des octets est inversée dans l'en-tête de l'archive." + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "L'entrée standard est fermée." + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d bloc\n" +msgstr[1] "%d blocs\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "Ne peut lire la somme de contrôle de %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: troncation du numéro d'inode." + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "Numéro de fichier = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "Numéro de fichier = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: troncation du numéro d'inode." + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "La sortie standard est fermée." + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "La ligne blanche a été ignorée." + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s n'a pas été versé: n'est pas un fichier régulier." + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: lien symbolique trop long." + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s possède un lien sur %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"GNU `cpio' copie des fichiers vers ou depuis des archives\n" +"\n" +"Exemples:\n" +" # Copier des fichiers à partir des noms contenus dans une liste vers " +"l'archive\n" +" cpio -o < liste [> archive]\n" +" # Extraire des fichiers à partir d'une archive\n" +" cpio -i [< archive]\n" +" # Copier des fichiers à partir des noms contenus dans une liste vers un " +"répertoire cible\n" +" cpio -p répertoire-cible < liste\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "%s n'a aucun sens avec %s" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "Mode d'opération principal:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "Créer l'archive (exécuter en mode copy-out)" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "Extraire les fichiers de l'archive (exécuter en mode copy-in)" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "Exécuter en mode copy-pass" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "Afficher une table du contenur de l'entrée" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "Modificateurs valides d'opération dans tous les modes:" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[USAGER@]HÔTE:]NOM_DE_FICHIER" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"Utiliser le NOM_DE_FICHIER au lieu de l'entrée ou de la sortie standard. Les " +"options USAGER et HÔTE spécifie les noms de l'usager et de l'hôte dans le " +"cas d'une archive distante." + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "Le fichier d'archive est local, même si son nom contient un « : »" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "FORMAT" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "Utiliser le FORMAT fourni de l'archive" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "Utiliser la taille de bloc d'entrée/sortie à 5120 octets" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "TAILLE-DE-BLOC" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" +"Utiliser la taille de bloc d'entrée/sortie à la TAILLE-DE-BLOC & 512 octets" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "Utiliser un vieux format d'archive portable (ASCII)" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "Afficher un \".\" pour chaque fichier traité" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "NUMÉRO" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "Utiliser la taille de bloc d'entrée/sortie à un NOMBRE d'octets donné" + +#: src/main.c:119 +msgid "STRING" +msgstr "CHAÎNE" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" +"Afficher la CHAÎNE lorsque la fin du volume d'un média d'archivage est " +"atteinte" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" +"Copier seulement les fichiers qui ne concordent pas avec des patrons fournis" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" +"Dans la table commentée du listing du contenu, afficher les valeurs " +"numériques de UID et GID" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "COMMANDE" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "Utiliser la COMMANDE à distance au lieu de rsh" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "Ne pas afficher les numéros des blocs copiés" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "Afficher en mode bavard la liste des fichiers traités" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "Autoriser l'affichaga des informations de mise au point (débug)" + +#: src/main.c:137 +msgid "FLAG" +msgstr "FANION" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"Contrôle de l'affichage des avertissement. Le FANION peut prendre une des " +"valeurs suivantes: 'none', 'truncate', 'all'. Les options multiples " +"s'accumulent." + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Les modificateurs d'opération sont valides seulement en mode copy-in:" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "FICHIER" + +#: src/main.c:146 +#, fuzzy +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" +"En mode copy-in, lire les patrons additionnels spécifiant les noms de " +"fichier à extraire ou la liste à partir du FICHIER" + +#: src/main.c:148 +#, fuzzy +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" +"Lors de la lecture d'un format CRC dans une archive en mode copy-in, " +"vérifier seulement le CRC de chaque fichier dans l'archive, ne pas extraire " +"le fichier" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "Renommer interactivement les fichiers" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" +"Interchanger les deux demi-mots des mots et des octets des demi-mots dans " +"les données. Équivalent à -sS" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "Interchanger les octets de chaque demi-mot dans les fichiers" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "Interchanger les demi-mots de chaque mot (4 octets) dans les fichiers" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "Extraire les fichiers vers la sortie standard" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Modificateurs d'opération valides seulement en mode copy-out:" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "Accoler à une archive existante." + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Nom de fichier de l'archive à utiliser au lieu de la sortie standard. Les " +"paramètres USAGER et HÔTE spécifient l'usager et le nom de l'hôte " +"respectivement dans le cas du machine distante." + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Modificateurs d'opération valides seulement en mode copy-pass:" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "Lier les fichier au lieu de les copier, lorsque c'est possible." + +#: src/main.c:186 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" +"Modificateurs d'opération valides seulement en mode copy-in et copy-pass:" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "Créer tous les fichiers relatifs au répertoire courant" + +#: src/main.c:196 +#, fuzzy +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" +"Modificateurs d'opération valides seulement en mode copy-out et copy-pass:" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" +"Une liste des noms de fichiers doit être terminé par un caractère NULL au " +"lieu d'un retour de chariot." + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Nom de fichier de l'archive à utiliser au lieu de la sortie standard. Les " +"paramètres USAGER et HÔTE spécifient l'usager et le nom de l'hôte " +"respectivement dans le cas d'une archive située sur un hôte distante." + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"Déréférencer les liens symboliques (copier les fichiers pointés au lieu de " +"copier les liens)." + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[USAGER][:.][GROUPE]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" +"Sélectionner la propriété de tous les fichiers créés à l'USAGER et/ou au " +"GROUPE" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "Réinitialiser les temps d'accès des fichiers après les avoir lus" + +#: src/main.c:212 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" +"Modificateurs d'opération valides seulement en mode copy-in et copy-pass:" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" +"Conserver les temps de modification précédents des fichiers lors de la " +"création des fichiers" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "Créer les répertoire de tête lorsque nécessaire" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "Ne pas modifier la propriété des fichiers" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "Remplacer tous les fichiers de manière inconditionnelle" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" +"Écrire les fichiers avec de grands blocs de fichier comme des fichiers " +"dispersés" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "Options informatives:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "Afficher l'aide-mémoire" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "Afficher un court message sur l'usage" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "Afficher les termes de la licence et quitter" + +#: src/main.c:233 +msgid "Print program version" +msgstr "Afficher la version du logiciel" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, fuzzy, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +"GNU cpio est un logiciel libre; vous pouvez le redistribuer ou le\n" +"modifier selon les termes de la License Publique Générale de GNU, publiée\n" +"par la Free Software Foundation; soit la version 2 de la Licence ou,\n" +"soit (selon vos préférences) toute version ultérieure.\n" +"\n" +"GNU cpio est distribué dans l'espoir qu'il soit utile,\n" +"mais AUCUNE garantie n'est donnée tant pour des raisons COMMERCIALES que\n" +"pour RÉPONDRE À UN BESOIN PARTICULIER. Consulter la licence\n" +"GNU General Public License pour plus de détails.\n" +"\n" +"Vous devriez avoir reçu copie de la Licence Publique Générale de GNU\n" +"avec ce programme; sinon, écrire à la Free Software Foundation, Inc.,\n" +"59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "La taille de blocage est invalide." + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "Format multiplicateur de l'archive est défini" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"format d'archive « %s » est invalide; les formats valables sont:\n" +"crc, newc, odc, bin, ustar, tar (toutes les majuscules sont aussi reconnues)" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "Mode déjà défini" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "--no-preserve-owner ne peut être utilisé avec --owner" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "--owner ne peut être utilisé avec --no-preserve-owner" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "Valeur invalide pour l'option --warning: %s" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[répertoire-cible]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"Vous devez spécifier une des options -oipt.\n" +"Essayez « %s --help » ou « %s --usage » pour plus d'informations.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "Les options -I et -F sont utilisées en mode copy-in" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "Trop d'arguments" + +#: src/main.c:677 +#, fuzzy, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"--append est utiliser mais aucun nom de fichier d'archive n'a été donné " +"(utilisez les options -F ou -O)" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "Les options -O et -F sont utilisées en mode copy-out" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "Trop d'arguments" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" +"Le format d'archive n'est pas spécifié em mode copy-pass (utilisez l'option " +"--format)" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "-F peut être utilisé seulement avec --create ou --extract" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "Ne peut ouvrir le répertoire %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "Erreur de fermeture de l'archive." + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "Ne peut créer le répertoire « %s »" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "« %s » existe mais n'est pas un répertoire." + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s n'est pas un fichier de type spécial." + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Usage: %s [-V] [-f périphérique] [--file=périphérique] [--rsh-" +"command=command]\n" +"\t[--help] [--version] opération [répétition]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "Aucun périphérique sur ruban d'archivage n'a été spécifié." + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "L'en-tête est invalide: erreur sur la somme de contrôle." + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "L'usager est invalide." + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "Ne peut repérer le numéro du groupe d'établissement de session (UID)." + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "Groupe invalide." + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "Erreur d'écriture." + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "Erreur de lecture." + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "Fin de fichier prématuré." + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Le fichier %s a été réduit de %ld octets, rempli par des zéros." +msgstr[1] "Le fichier %s a été réduit de %ld octets, rempli par des zéros." + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Erreur de lecture sur l'octet %ld du fichier %s, rempli par des zéros." + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "Le fichier %s a grossit, %ld nouveaux octets n'ont pas été copiés" +msgstr[1] "Le fichier %s a grossit, %ld nouveaux octets n'ont pas été copiés" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "Fichier %s a été modifier durant sa copie" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "Mémoire virtuelle épuisée." + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "Ne peut se positionner sur la sortie." + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Fin du ruban repérée. Charger le prochain ruban et appuyer ENTRER" + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Fin du ruban repérée.\n" +"Pour continuer, taper le nom « périphérique/fichier » lorsque prêt à " +"procéder.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "" +"Pour continuer, taper le nom « périphérique/fichier » lorsque prêt à " +"procéder.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "Erreur interne: le descripteur du ruban a été modifié de %d à %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: l'option « %s » est ambiguë.\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: l'option « --%s » ne permet pas d'argument\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: l'option « %c%s » ne permet pas d'argument\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: option « %s » requiert un argument.\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: option « --%s » n'est pas reconnue.\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: option inconnue « %c%s »\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: option illégale -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: option invalide -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'option requiert un argument - %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: l'option « -W %s » est ambiguë.\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: l'option « -W %s » ne permet pas d'argument.\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: service non disponible" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "stdin" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "stdout" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "Ne peut exécuter un shell à distance" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, fuzzy, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "Ne pas modifier la propriété des fichiers" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "Ne peut créer un lien de %s vers %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +"Erreur de lecture sur l'octet %ld du fichier %s, rempli par des zéros." +msgstr[1] "" +"Erreur de lecture sur l'octet %ld du fichier %s, rempli par des zéros." + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "Ne peut créer un lien de %s vers %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "Ne peut créer un lien de %s vers %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#~ msgid "error %d" +#~ msgstr "erreur %d" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "" +#~ "Erreur de lecture sur l'octet %ld du fichier %s, rempli par des zéros." +#~ msgstr[1] "" +#~ "Erreur de lecture sur l'octet %ld du fichier %s, rempli par des zéros." + +#~ msgid "Memory exhausted" +#~ msgstr "Mémoire épuisée." + +#~ msgid "block size cannot be 0" +#~ msgstr "La taille de blocage ne peut être 0" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "« mt » de GNU version %s\n" + +#~ msgid "Success" +#~ msgstr "Succès." + +#~ msgid "parse error in blocksize" +#~ msgstr "Erreur d'analyse syntaxique de la taille de blocage." + +#~ msgid "Regular expression too big" +#~ msgstr "Expression régulière trop grande." + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C octets] [-H format] [-M message]\n" +#~ " [-O [[usager@]hôte:]archive] [-F [[usager@]hôte:]archive]\n" +#~ " [--file=[[usager@]hôte:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "Fin prématurée de l'expression régulière." + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s " +#~ "remplacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=remplacement] [pattern...] [< archive]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "Numéro de bloc= %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "Le nom de classe de caractère est invalide." + +#~ msgid "drive type = %d\n" +#~ msgstr "Type de périphérique = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "" +#~ "L'option « %c » est non reconnue pour -p, les options reconnues sont « " +#~ "aemop »" + +#~ msgid "ambiguous" +#~ msgstr "ambiguës" + +#~ msgid "missing regexp" +#~ msgstr "Expression régulière manquante." + +#~ msgid "1 block\n" +#~ msgstr "1 bloc\n" + +#~ msgid "No match" +#~ msgstr "Aucune concordance." + +#~ msgid "residue count = %d\n" +#~ msgstr "Compte résiduel = %d\n" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [usager][:.][groupe]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[usager][:.][groupe]] [--no-preserve-" +#~ "owner]\n" +#~ " [--sparse] [--help] [--version] répertoire_cible < liste-de-noms\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "Statut du périphérique = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "[ ou [^ non repéré." + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [usager][:.][groupe]] [-I [[usager@]hôte:]" +#~ "archive]\n" +#~ " [-F [[usager@]hôte:]archive] [--file=[[user@]hôte:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocs] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[usager][:.][groupe]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [patron...] [< archive]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s remplacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=remplacement] [patron...] [< archive]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "état du périphérique (bas) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "Le caractère de suffixe est invalide." + +#~ msgid "Unmatched \\{" +#~ msgstr "\\{ non repéré." + +#~ msgid "Unmatched ) or \\)" +#~ msgstr " ) ou \\) non repéré." + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "L'expression régulière qui précède est invalide." + +#~ msgid "null regexp" +#~ msgstr "L'expression régulière est vide." + +#~ msgid "%s already exists; not created" +#~ msgstr "%s existe déjà: n'a pas été créé." + +#~ msgid "Invalid back reference" +#~ msgstr "La référence arrière est invalide." + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Usage: %s [-cdnv] [-f archive] [-s remplacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=remplacement] [patron...] [< archive]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "( ou \\( non repérée." + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "« cpio » de GNU version %s\n" + +#~ msgid "invalid" +#~ msgstr "Invalide" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "« pax » de GNU version %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "Le contenu entre \\{\\} est invalide." + +#~ msgid "Invalid range end" +#~ msgstr "Fin de plage invalide." + +#~ msgid "sense key error = %d\n" +#~ msgstr "Détection d'une erreur sur la clé = %d\n" + +#~ msgid "Trailing backslash" +#~ msgstr "Barre oblique inverse de fin de séquence." + +#~ msgid "can not omit both user and group" +#~ msgstr "Ne peut omettre les deux paramètres usager et groupe." + +#~ msgid "Invalid regular expression" +#~ msgstr "L'expression régulière est invalide." + +#~ msgid "No previous regular expression" +#~ msgstr "N'a pas été précédé d'expression régulière." + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s remplacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=remplacement] [patron...] [< archive]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "État du périphérique (haut) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "Lors de la compilation du patron %s" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "Le modificateur d'expression régulière « %c » est invalide." diff --git a/po/ga.gmo b/po/ga.gmo new file mode 100644 index 0000000000000000000000000000000000000000..cbb9812bc6b5e5bb4c5015747314061e33ec9ae7 GIT binary patch literal 22553 zcmdU%3zS_~dEXCU8#CD9;YSMQvB8l?W9yD*WXm=q%jjw}lE&7|h?$XvBSduO-ZS?e z>)vxN_uMO4G$Ah_m?i{hOcTzP$5{gJ2T8nftH5A_!guUh~Qzcq8~a@D{KNQYAPBPJj*Y4d9Q1H-i5JRR8}H zyc_%@@b%y=HwD3~!Cj#GIRgGIa22eB-wWOf{#WpI;Qs|rgRh2|hrkbkcY$93E8w4i zs(&Y)iOy<{$H5)k_rceK9|O06|15w0HBjwuqOk+3;2q!!$R~p*bNnd~(t}?EMfWox zQxbd?ybb&YNLRs)-|okEdydoKEYEA8#{bJXegzy?eFpt7_#mip{t$RS_%!$)@DIWF zf^`OU5d80;=Ii^1OqMc;Gaw}Jl~jKOPpxD!l4wfh)2 z2L3DXB>2BT^>dWP6TS=7y#G9?aefWF2mBMzffG#bHQ-xvd=$Kn`{Ur-z!gy6`E76) z_{ZQh_*w>i*9(Fm1R*W>5eBDu{{?U#_*syp4gMU|`Z+b7B~ey4QhSXK=JV_nA}NlAGjavfwzOd396s3fGl}% z4G;C*+d!@3BzPbA-JtmHQ=rEEpFp|}uKx~C_nn~VIsvNvPk^HLS3&*@KEpqv;}1a1 z^9?Yq_-HREzJEU`Iz9s~f?omky$K%b`zJt+=f^p6-+~v=y@Bc{@w+? zAN(bdp#{5G^wZ#5LG|}C|zV|Gse!mQAeXhULuitAy zSSxq{6dlW;#@_}-{||!qf}a4z2Y-~~H$mx>8|l>M8-yi-N$@4$TXH-OzKHt>)I7%E z4d4gBUEoiG5%_OG(Rn`~Rlg5|lE1fts(%L5INuGb|Bry8_h-PDfxnsGKMRVU{|sIO z{vU7z{L>t-N4eUBWri6_DR;BSC01^*O$ z_65+!%P+q$2)@W-i(fvm)33`KDE|E>sBzu}6TKXK2;2)UfSR8Vf?CH{&Da&zW+tgasPE1>G{iHmP0&$Gx!DW--j|2pFj41r|&87 zR_=cnbl_J&R7mh=puT$>LaB9q3#jqD1Jv`6f#Spe0E*6+A+#FbPVg46p5r^go4NlW zC_ei+Q0w@){QirezW4R~{sxFsz3t#pa6kAU_|Y7{1Tq!D%{=^0@DTV0@Mpn&;O~H+ z1h3zNZ2*4@d=zY>EFm>`21L~be+J$NzUIxozdJ$E|8`J(^Fi=6;8URH=ab-j!Dm6H zFgUW;%k%p{rabr!@a^C__-_YL=bwKEE^vPV6dyf&!0V+I5D^QW1hsCT z2E~W}1JwBb9DFr+>p@S?B=|P&9{{!PPl1cz?}AIk&#;J3lO;EQIl+2DTg z2>4zQQ3$>SieF#+u%CwtcoX;YUZf5kIe0@OJJ`gL?l_P~ZClQ0w!0 zCgpnYK~VEB18Tl|pw{V=U>*E#pvJK<=jr%9Q2g^WsC9V3yl;0esQK%HqVJ!B5%}*x z$>)Q-d?Ofwn#Xs8p8P{Np!#_Pd?olcQ0-Ds^YLNuTJSUAb>L?~ z(f=<%@%`_CuypWM@T=e*$9zB6y_L1*o?+NJ{1o^}ihhq#QoHhV@OScSSl4v_4})zA zUD%H$H<`T$yw5)>|2@UkZImCP^eG>pyn~{j`2B-+HTdT^mq#d-{E>L>A5dVE^7mS< zn6}_&^Ct~ZJgo8SSEGp6f0}X&U!w|xznfq0$Wc1uUdl>-U%+-Qp2%;01pGzH_vH8Q0wu%x{RCy4 zGDZ1b$}~m4J(QD_Z=?J@ig-c#d_U#qDL+QJneq=QcTo0Hil6xRXDH%7@v45mN*S>$ z|Id@aJ1K9VNI%CE{UlqvDTgROO40AI2lG2n3&w|f^!F)Cl!WpU$`4Q`C^M8@6v>Nz zl80ZTR4FaWcT>ds;@6K+evqQyU6hYfq#qD>vx6T3B{##rU&?O|=6DwTF3Ni-`zSq1 z@%zVINIrH_eva~wD8fpQ(j1UAEiV21Vz7JpgcwSxNi8}PB}xFqr9G?UzhS;%7=BMpL6cu{83ly z#Houjx7v*&m!+${GhsK{?arosR|^x@jp}jM>&7enUgYAQ3zPcYY1g&Wdc1megg$uI zPwG+E^_r3EMcsDh(p9@r?+2qK>V_?Mq`%UNYwmDdi;^sIVdgq|k~O2cTd{uB{D5d! z%4u*1QaTQMahmLQQOx_UI~{d1?%mGf8+nI2T-p^e+ryqH@4B?3c4Lrx*0n;&Dw>Xu zsNV3v2ji=|I5EnbX@{{i>5S2xiCZnV61jdBt@c|x)SSt1$7YugEgW5T)%nNVvFhSt zb$i<@uSV zC3j$9(N*1%>f-Y3^wGoBMR(-r;*o`=nQ`Zqm>%Y#7{Mhbch%OX8@YPa3*%Pihx`}| znn7Eu?waB0h=r|1@o6XvT`ld1uIE`aeKl;QNy7$NPT_7Buev1d?QmzhF+9>st)ELR zrOn@LQXAjlc1^P2VREX)tS|LgdippJulAbmKr2nVJKVlB>!ryKH&=BNJ0~Y6DwFq2 zOuC~>)sc~48+_ABYo`WR8JC$jxgCW`oHSZdmU&XQW%(P()Nq?&H>`;#vQAWs;m*~# z6>X?ekC~oc+C8hM(07V?Vqm@_^-}9ba8-TECD9o=V#c$u4PQ5+g3(;`1cGB^yB)4Ju$^b7))HRF!x>&JDst<~S*8vX+6 z2b~$kE<4-Sc*@a~@0pak4fWzzSrl#2;NqSZqp`r^h9URBea*lx-sq)F?njT;%;F#Kbe zeC?apno;dk)^F#Nx_#n_ZLKGE6k?1{vIk>E=4u=v+GpZA@*`Ht`m3vPEsm0&lR`j} zx;Fj3XK}ns#In6Kb&_i91XUL`5D2e6U8Ul-)g)F^XvWiF3$D8OP5$KMw%WFA)Ya1{ zOGXj1Rx3S&`gLKq(QiYA@20FwRYWyxuf&ah+BeyqDmp)@j=Ir1`bZ&lF4ae+aupw} z9CKG+`;ruHMcnXgb=$pKE5*>QqJX2i%^=U>wAMr0Y;>z(aL!%bnU(QIiWiQkDzD_28H=ND+p z_cqfbL8TIQpcXTk$r_@8v2;nw64#oT68|M*Dk?O1lDO^EbCm;9kd=k}d)XL0C26I@ z>PFquQN?taybbZKx3uD97`fu#QU7vvF6t}bi*jCyzDxk~4!!0!f-2DyJz0XF%4BCf znLx>fMqq|S-b|cG&!e$097!KfU|>DsBVsD(&_ic-GaG5 z2=mdUnMJ6nyF&|0%iiX#o;4#)52$M1G_kbyVaA;>b@Xhb>PBrTu$=s>q5?1IFP)6E z+m?^UoJrxyn4<;Fi<3)J>4bOyW<5O{R#1d$;Msm`FdYB5-EZ~c4yw8yt+JH$@;#cb zk0~3!)3`$J9g~CS(ujh6hZm+FsVvQY=S;9K6~oTje8PWt(OyV2p`r#9EqT3#OV(5W zR&jb^ZmvptD)$YdC!(61@O({hom;KqohcD?!Zd8tOfoO_g46xEsbyq*GrLbGf~^BHGqB8v$c3-;4$ zm6FsVC(p(!PSczj!GQU-#^|0z^XTdJtm~vPb`eU4`#rgaz{*W z2L2X2pa<4t~;RI!F4@|IRTQavevwU=Me%u9HwOUT;Gr^kn z8G!5~vwE8N^lq)F*TS%+BH*xoc6=mI%y?4K@~EeU1v18G>ZC&btb6sIjf~7Z5fb@D z*%V>Z?QR<0%BxFzn~Ks!#q16}h-GqSr-8-fmDD|GWcW(QA1W%Gur9Y)^Q}6G-SG!E zHhf-M>QTn5Sm0eLgj6BAr>es=ZSj7XR_02IAe5upB|VTSEW)M={i|LR4TJ*gnBfg( zeXLA$zapopXFSgOYJE%;G)*vpxxQy4TTvGe>FDf!oBD&Z`{}|fcYQe5S5rL1gk#`& zh~`62$l>(@JDdBnUbo9bu2c%G>Dy1i-oatTN`9TURuyf~X!4XsUOUsM1^9MZ}NCb1`6uQ%C3r;mf#p9K*cB5SXY|@{}$0GYoZ z$aN`sC-6)YEajBU-o4-*1(y+-X|{Jw?wl~|nq8*S!2NW0s>Sm*5Py1Q;nj>eD46iU zM>aS(gGsbOp}ulkHE_0z=t5cHgNqACj|5Bo6|{A)Z-MH`aaNR9QM*I(bMvxZuI|vP z21{qcj$4s~-9(X|NxOAhFMlCzAveSx4c@a}8Z8;*aNNz1Oh5x-Of-T@w&c51g|ev$ zUeR8>tGC7ygUZEg`<68j4Q~6rzMHX)&6cmy#aJd6)0TcNk|tSjR7O*#$Q`dddV+se zb2mlT6;ZdxyDfH4Ca{7BNgwq+Ii47K2^D2)twx?fKQUyXj@L-E_fCxPt%5lUzdQH* z^db*C@}PuqmVqZ9wWgY`6shlE^v!~AuP#l`&XR;Lf?kWW^15h1>5j^Lb#7+3x6%zY zl_q85{n5Xafc8=EabRh^BUUW7(M zZ}$o2y@28%_%N@M#+@SYWkX=Od)A?B@p;4;qnc%ZYrdM7*mg=trtm_8MaAI)AD6J7 zI6gIg;<$wu_vGijITEm zh^Pm7Y6v@E^V>=ZeO#lPVosR}C1y&8u&ApDPEv!kbKKH=_Otuy78$im?>_?0+Kc2d$C7~jg3@>jA; z0s9JpHYH4@FU?FZxr}ULf;Qex(j+8d;O@C^Vqz@Vkc}iJ#x2FgFhZt$lm>&;h=EB< zE2Ty*B@dyt`JI+JU3iyuqxP^x+nsx}o;OKMbfc+}TDPVwT#ebTxfK`$F<^^DWjjJv zsf8VCwz3peR%Ad$sQ-!ymKopjkug|#*Mvc$?$m%sY%t|(rP6|nJc7U?4x2jiqzYGa z?LEj=1$jUKV_4Q9z{x=1`Uqd)NahQ6(F?6m(1j=LAI}x}rI;Zwp7vzsv5!RlAs1}Y zu?V4MtLuXoo}=ZamT&NecwgsDz&=xOI_^q&;m@Kdq`{gY6OORvQPfnSABpocb69Tq zys|&u=2kGA%vo7II~9{V)drR~=MwG5NiXB~xIGcBs*?I-_uI*wL zO`F_1$L|||)5Hi4A_l55m%+@Hef>sOSx%==MvaPU?QJCe@wD3*IkK=^u}l;lRQ8kW znsPfQCho6H+*g^n-%Z{-HF@7%6ZcF^P_eRzTc{5W>fKk-cI8et`M}iV&dS6t>KzWV zUS*lIVMd}Xg_9nk6+55OO{DVNgQqgP+}mg)g5#L)hiH>D`ZxfU%&kN$4F z<(Lh2rL}R3_slLWR33O>*PAMngUX_rG+Si`M_NAdlzU($?u{I2_1W659Kb-JF&70B@f;|#-p8XiYNE^CzF$UbPu)e z-8~Yp;XI3d3)AjOGi^lLL3ihdH=c3C&&B9-1rR-6k#VSnaR+`QI&So{yOZYv47KBxBIoIkyHU@^A;)+NL{Lop;rRdAF~+_&E+6?A8dVy&7L|B8&f4 z!tNSd4a)oX`f)=8tB=mk@BjS5;pOV|p=Ae|2WB{=@Z7xJ?jJpHXl8c*p*eNM;e^98 zoP!_-ci^19r+K>UOxBu2LpHXyElrjt-Ef^1T5Ybu^maI7pSI}FvrhTAR--l3;^(A| z&XYEMp4G}b6M@LrIUET{>uI*M#1it|_(<^5N^`Xz#vC-j60N5zO+L#MT(qj{$P$R= z2JLWHc6vdrp6>udlkFe2-OzViT(xDA{9C(V^jfo(W_KM{N0aLgUnE&4@zHMLzToq* z_+hK(8Jg^G60NmJTI#$*6GJ#^4F@gow3r}uLU-_GjU zxHIW%v}%FUPw3NY@gRb6)(oH#a2~%l?!nq@gAzD451x}AVsK)O&x2<*!;A;5=sxy zvM%bwb~B%ajdWOb=7bMizT&7H!_nbdD2t0|zM`+sp!L?+ch6Xub0UnMR?q@ED`Gm% zpC~}H@QC$M9UJA})P`uPZ;{lC+AW4FuzmB=EL2t)@Y3a$rmX%g&)xrrJ#4WaS38P} z7G_?upDR_f#mJTpzF=nT{EKmGE{lKVHT{6E=<6DoRpi2?Fy>fI+-6@RB3?qVx#CF9 zN@25Bctx6O=wME=-jYed^JwGwW^2ratUWQ0?2S}7iX!Ws=L0SKnAhfbWo_3zzY2$k z_L%f7+8JZkMuFl;gyw||9nl%8fLz3_b;A4d{En=IwOThHf@H#ZZB@pO%xEar0jJ1! z;1BZn(;&-hM!J3Zq@ABRC;OAun*Kc&q38+cs@_~@=v#JK951;FGV((wx#74{;{7?F zEvPRJ0DVgX7@9~tByX;YGd{LB!%yv$&qYtQMQ;x`tNr0Mh8OU4BFqwEW3^$oCN|B- z)0^JaynV-D!3qgR!Z?T6OmpTJbMS6>Suc8*&-J1$^x&9J;x1$uAMZ<=LHGWe90KD{ zJd2*<2XZyrt*ZYl_Fsp7a0@C6V{$igH+`#PKcWA|W>>8^`7_+up8>jLgNu&=ZQ?ea z%E-Sa->FjZNo}LEJPS0~sFUKK)QzKce0ex>SqrZjMzes)ObL+Lvl+FIc}L0gm;t%)4aoc z_cn~M<`nrrRbB2DU&AYbsGusn!OftJKGpQAQ_=)wa&~d?!no0_M{5Z*k8}1~?sy7G z&nTu^3#w^6o$jf@vAE$8KL+aL$Nn-ezM>Y<)P%HZJc&owssT0RWXYh3l5uQRLLcU zsq=D38sBoPW5JT9thtV)U9wZ&5i*{4$(r*s+a_>Ig2R25V|dN&w30F|#FW9@v$Ok2 zv{&Y|UlcqinKl;JX(g?g9amEDc@fDhkD{mHHk@3#e4DVX77L5}p9|(o(dV3XLX;Dx zc-&YT6xPs7Gl9H8E_%VDLHkZUSUTGru(gx>c z!0oZcQ78)<47KyZt9K!3=*-(|^gu2T4ZQUz9jY&RCkul@WfSitqv(S(eXwiKiYPA~Qc=`2vxJ^bIQBHZMz)TWi4EUJRqN`F ztce0my)PFB^#U4px5OouFG^bEl;}M$J3S(63fd1>olZRKx$QAX*65nBXohM+nx_3vUfpT zT5qz`HJ$5h26R#xqfwtb${7}R*=`h`A1m1|92r^Ck*{z)Kk{Wgn8cM_YTlEW7u%Fh~X{|D( z_{wi|NI-3V$+55@;zxqzLZ>TV8y;Ylti(j@-!x z`ASt?)>>Jhh3JXxqNI&R7j!yj4~b71(qDYiIGYoU^%HJoMRWpI3Uuio~R^d5DBIk_u}`CC zGm%%@ysE?c`-@_Hp{!jP==*y16~9DCiCKM{=z&421?;W5(piUm&X3%ANMy8x*`6EEQz7 zQMCG;cWP(vu0l+n+VcnVz>_#ejC3{d}8*Kxug5WpMm1Tps6s)5*r z9Y*~D^{TbO_r`yhdax8IJt^j6$FaEbexIhtIAcRC#m+weH14W6=vX8rBPC8c&{uX% zHQQrQhJjp*nJYY2`$WsBmz+H|G}-W}Vs3C6IO3qwecr3z(E2ah=d4OUvDI87ljGB~ z>pt$@c>J${P-KJCe}miM!+)HuxNymne|QW^;r85d#cmw@vyfQpdEgL#>Oo}VdVRKn z#S-R7D#16X)Kh5h6woV)Q)Ibx3b5>_ml5bO;XW-ACya|zYU;5#6S!s1KFq4l&d-@B zmwo3U8O)t4a9m*Y!C!OQYG5Na$Pt;jA%n!)X2vF1DmJ!rj}B2`SD8PZz;$E;oR0Iz zl*2>px3edKee`wt(=t@%s`>wO$Uc3Vzh{ypV_z^o<+(yu%-`nc z3b7Sb#h*ml=s0)&%iaIrc&W~cQ-&xqoiZ$+?>#Y`ikvzzV42|f#o@<^fYmU2$jF#A zxH8PAtk^a8d*A^l`El8y$sG5LOd}B^2TPQ@U1_c*WU(0?F0UO_$X)sdr%F0ZBaanJ zlp%z;cPQ=6gm^=nXOnUK2Wf4;s78e+G}pryhU#qEbjs}_-*p?h;yXSGWeT5F=?(R9 z@y2I{z2v8*7&VNJmtzjfk@~H% zVQ6VI%Yfkaaqt7>u&o{xT3|S698!?R!Tf(VIHaRf9ymEjVcurl>?=8k%N>7g5c%pH zB>6_KJ=XXGZWISzD3fA-Y%&&jpGW(PdEBZ4C_%$me2B8ZbU|;8$aU!Hlq=_8(;jJX zLHTCe9vG@0-~(>(;r!?2F~C*Y6fU#tX5oC=C@7MRa$AEkijYY!4V9gX@$P37ctz>yD`)G( zA_por9;>X0uh2QGO(sEyyVm*36|$Xq`kVg|gHFV8m@DBT`5RuE6W zM#FP6=%%5NOS)aj5<7Bf9*$Tar>ajbp7W!=&J^?ZS612QDzB6bR*L_%$`HvzOP8NN G2>u@wr>oll literal 0 HcmV?d00001 diff --git a/po/ga.po b/po/ga.po new file mode 100644 index 0000000..385b880 --- /dev/null +++ b/po/ga.po @@ -0,0 +1,1019 @@ +# Irish translations for cpio. +# Copyright (C) 2005 Free Software Foundation, Inc. +# This file is distributed under the same license as the cpio package. +# Alastair McKinstry , 1998. +# Kevin Patrick Scannell , 2005, 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.6.90\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2006-10-12 18:12-0500\n" +"Last-Translator: Kevin Scannell \n" +"Language-Team: Irish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : (n>2 && n<7) ? 2 :" +"(n>6 && n<11) ? 3 : 4;\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "rabhadh: gabhadh thar %ld bheart de bhruscar" +msgstr[1] "rabhadh: gabhadh thar %ld bheart de bhruscar" +msgstr[2] "rabhadh: gabhadh thar %ld bheart de bhruscar" +msgstr[3] "rabhadh: gabhadh thar %ld mbeart de bhruscar" +msgstr[4] "rabhadh: gabhadh thar %ld beart de bhruscar" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "athainmnigh %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: comhadainm rófhada" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: earráid i suim sheiceála (0x%lx, ba chóir bheith 0x%lx)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "níor cruthaíodh %s: tá leagan níos nuaí ann, nó den aois chéanna" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "ní féidir %s reatha a bhaint" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "ní féidir %s a nascadh le %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "ní féidir leathfhocail de %s a bhabhtáil: tá uimhir chorr ann" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "ní féidir bearta de %s a bhabhtáil: tá uimhir chorr ann" + +#: src/copyin.c:642 +#, c-format +msgid "%s is not a directory" +msgstr "ní comhadlann é %s" + +#: src/copyin.c:755 +#, c-format +msgid "%s: Cannot symlink to %s" +msgstr "%s: Ní féidir nasc siombalach a dhéanamh le %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: cineál anaithnid comhaid" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "Uimhir mhíchumtha %.*s" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "Luach cartlainne %.*s as raon" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "deireadh na cartlainne gan choinne" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "rabhadh: is san ord iompaithe iad na bearta i gceanntásc na cartlainne" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "tá an t-ionchur caighdeánach dúnta" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d bhloc\n" +msgstr[1] "%d bhloc\n" +msgstr[2] "%d bhloc\n" +msgstr[3] "%d mbloc\n" +msgstr[4] "%d bloc\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "ní féidir suim sheiceála a léamh do %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "%s: níl an réimse sách leathan chun %s a stóráil" + +#: src/copyout.c:308 +#, c-format +msgid "%s: truncating %s" +msgstr "%s: %s á teascadh" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +msgid "inode number" +msgstr "uimhir inode" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "mód comhaid" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "uid" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "gid" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "líon na nasc" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "am mionathraithe" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "méid comhaid" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "príomhuimhir ghléis" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "mionuimhir ghléis" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "príomh-rdev" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "mion-rdev" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "méid ainm" + +#: src/copyout.c:403 +msgid "device number" +msgstr "uimhir ghléis" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "rdev" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: uimhir inode á teascadh" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "is dúnta é an t-aschur caighdeánach" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "rinneadh neamhshuim ar líne bhán" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "níor dumpáladh %s: ní gnáthchomhad é" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: nasc siombalach rófhada" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s nasctha le %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"Cóipeálann `cpio' GNU comhaid go (agus ó) cartlanna\n" +"\n" +"Samplaí:\n" +" # Cóipeáil na comhaid sonraithe i ainm-liosta go dtí an chartlann\n" +" cpio -o < ainm-liosta [> cartlann]\n" +" # Bain comhaid as an chartlann\n" +" cpio -i [< cartlann]\n" +" # Cóipeáil na comhaid sonraithe i ainm-liosta go dtí an sprioc-" +"chomhadlann\n" +" cpio -p sprioc-chomhadlann < ainm-liosta\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "is gan bhrí é %s gan %s" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "Príomh-mhód oibre:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "Cruthaigh an chartlann (rith sa mhód cóipeála amach)" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "Bain comhaid as cartlann (rith sa mhód cóipeála isteach)" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "Rith sa mhód cóipeála trasna" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "Priontáil clár na n-ábhar den ionchur" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "Mionathraitheoirí oibre atá bailí i mód ar bith:" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[ÚSÁIDEOIR@]ÓSTRÍOMHAIRE:]COMHADAINM" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"Úsáid an COMHADAINM seo in ionad aschur nó ionchur caighdeánach. Sonraíonn " +"ÚSÁIDEOIR agus ÓSTRÍOMHAIRE (roghnach) an t-úsáideoir agus an t-óstainm " +"nuair atá cartlann chianda i gceist" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "Is logánta é an comhad cartlainne, fiú má tá idirstadanna ina ainm" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "FORMÁID" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "Úsáid an FHORMÁID tugtha chartlainne" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "Socraigh méid na mbloc I/A a bheith 5120 beart" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "MÉID-NA-MBLOC" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "Socraigh méid na mbloc I/A a bheith MÉID-NA-MBLOC * 512 beart" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "Úsáid an tseanfhormáid iniompartha (ASCII) chartlainne" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "Priontáil \".\" nuair atá gach comhad próiseáilte" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "UIMHIR" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "Socraigh méid na mbloc I/A a bheith an UIMHIR sonraithe" + +#: src/main.c:119 +msgid "STRING" +msgstr "TEAGHRÁN" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" +"Priontáil TEAGHRÁN nuair a shroichtear deireadh an imleabhair ar an meán " +"cúltaca" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" +"Ná cóipeáil ach na comhaid nach bhfuil comhoiriúnach le haon cheann de na " +"patrúin shonraithe" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" +"Agus clár na n-ábhar á thaispeáint go foclach, taispeáin UID agus GID " +"uimhriúil" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "ORDÚ" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "Úsáid an tORDÚ cianda in ionad rsh" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "Ná taispeáin líon na mbloc cóipeáilte" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "Taispeáin gach comhad atá próiseáilte, go foclach" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "Cumasaigh faisnéis dífhabhtaithe" + +#: src/main.c:137 +msgid "FLAG" +msgstr "BRATACH" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"Rialaigh taispeáint na rabhadh. Faoi láthair, is BRATACH ceann de 'none', " +"'truncate', nó 'all'. Úsáidtear roghanna iomadúla le chéile." + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Mionathraitheoirí oibre atá bailí sa mhód cóipeála isteach amháin::" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "COMHAD" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" +"Léigh patrúin bhreisithe a shonraíonn comhadainmneacha le baint amach nó le " +"taispeáint, ó CHOMHAD" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" +"Agus cartlann i bhformáid CRC á léamh, fíoraigh an CRC de gach comhad sa " +"chartlann, ach ná bain na comhaid amach" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "Athainmnigh comhaid go hidirghníomhach" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" +"Babhtáil leathfhocail d'fhocail agus bearta de leathfhocail sna sonraí. Ar " +"comhbhrí le -sS" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "Babhtáil na bearta i ngach leathfhocal sna comhaid" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "Babhtáil na leathfhocail de gach focal (4 bheart) sna comhaid" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "Bain comhaid amach go dtí an t-aschur caighdeánach" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Mionathraitheoirí oibre atá bailí sa mhód cóipeála amach amháin:" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "Iarcheangail le cartlann atá ann." + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Ainm na cartlainne le húsáid in ionad aschuir caighdeánach. Sonraíonn " +"ÚSÁIDEOIR agus ÓSTRÍOMHAIRE (roghnach) an t-úsáideoir agus an t-óstainm " +"nuair atá cartlann chianda i gceist" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Mionathraitheoirí oibre atá bailí sa mhód cóipeála trasna amháin:" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "Nasc comhaid in ionad iad a chóipeáil, nuair is féidir" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" +"Mionathraitheoirí oibre atá bailí sa mhóid chóipeála isteach agus chóipeála " +"amach:" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "Ná struipeáil réimíreanna córais comhaid ó ainmneacha comhaid" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "Cruthaigh gach comhad coibhneasta ón chomhadlann reatha" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" +"Mionathraitheoirí oibre atá bailí sa mhóid chóipeála amach agus chóipeála " +"trasna:" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" +"Cuirtear deireadh le liosta de chomhadainmneacha le carachtar nialasach, in " +"ionad líne nua" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Ainm na cartlainne le húsáid in ionad ionchuir caighdeánach. Sonraíonn " +"ÚSÁIDEOIR agus ÓSTRÍOMHAIRE (roghnach) an t-úsáideoir agus an t-óstainm " +"nuair atá cartlann chianda i gceist" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"Lean naisc shiombalacha (.i. cóipeáil na comhaid a bhfuil nasctha leo, in " +"ionad na nasc féin)." + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[ÚSÁIDEOIR][:.][GRÚPA]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" +"Socraigh an tÚSÁIDEOIR agus/nó an GRÚPA sonraithe a bheith an t-úinéir de " +"gach comhad a chruthaítear" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "Athshocraigh an t-am rochtana de gach comhad i ndiaidh é a léamh" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" +"Mionathraitheoirí oibre atá bailí sa mhóid chóipeála isteach agus chóipeála " +"trasna:" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "Coinnigh na hamanna mionathraithe roimhe seo agus comhaid á gcruthú" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "Cruthaigh comhadlanna tosaithe nuair atá gá leo" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "Ná hathraigh úinéirí na gcomhad" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "Athchuir gach comhad gan choinníoll" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "Scríobh comhaid le bloic mhóra de nialais mar ghannchomhaid" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "Roghanna faisnéiseacha:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "Taispeáin an chabhair seo agus scoir" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "Taispeáin beagán eolais faoin úsáid agus scoir" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "Taispeáin an ceadúnas agus scoir" + +#: src/main.c:233 +msgid "Print program version" +msgstr "Taispeáin an leagan" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "moill de SOIC soicind (réamhshocrú: 3600)" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +" Is saorbhogearra é GNU cpio; is féidir leat é a scaipeadh agus/nó\n" +" a athrú de réir na gcoinníollacha den GNU General Public License mar atá\n" +" foilsithe ag an Free Software Foundation; faoi leagan 2 den cheadúnas,\n" +" nó (más mian leat) aon leagan níos déanaí.\n" +"\n" +" Scaiptear GNU cpio le súil go mbeidh sé áisiúil, ach GAN AON BARÁNTA;\n" +" go fiú gan an barántas intuigthe d'INDÍOLTACHT nó FEILIÚNACHT D'FHEIDHM\n" +" AR LEITH. Féach ar an GNU General Public License chun níos mó\n" +" sonraí a fháil.\n" +"\n" +" Ba chóir go mbeifeá tar éis cóip den GNU General Public License a fháil\n" +" in éineacht le GNU cpio; mura bhfuair, scríobh chuig an Free Software\n" +" Foundation, Inc., 51 Franklin Street, Fifth Floor,\n" +" Boston, MA 02110-1301 USA\n" +"\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "méid neamhbhailí bloc" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "Sainmhíníodh formáid na cartlainne níos mó ná uair amháin" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"formáid neamhbhailí chartlainne `%s'; is iad seo na formáidí bailí:\n" +"crc newc odc bin ustar tar (glactar leo sa chás uachtair freisin)" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "Sainmhíníodh an mód cheana" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "ní féidir --no-preserve-owner a úsáid in éineacht le --owner" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "ní féidir --owner a úsáid in éineacht le --no-preserve-owner" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "Luach neamhbhailí ar an rogha --warning: %s" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[sprioc-chomhadlann]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"Caithfidh tú ceann de na roghanna -oipt.\n" +"Bain triail as `%s --help' nó `%s --usage' chun tuilleadh eolais a fháil.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "Úsáidtear -I agus -F araon sa mhód cóipeála isteach" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "An iomarca argóintí" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"Rogha --append in úsáid, ach níor sonraíodh ainm cartlainne (úsáid roghanna -" +"F nó -O)" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "Úsáidtear -O agus -F araon sa mhód cóipeála amach" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "An iomarca argóintí" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" +"Níor sonraíodh formáid na cartlainne sa mhód cóipeála trasna (úsáid an rogha " +"--format)" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "ní cheadaítear -F a úsáid gan --create nó --extract" + +#: src/main.c:725 +#, c-format +msgid "Cannot open %s" +msgstr "Ní féidir %s a oscailt" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "earráid agus cartlann á dúnadh" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "ní féidir comhadlann `%s' a chruthú" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "tá `%s' ann cheana, ach ní comhadlann é" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "ní comhad speisialta den chineál `carachtar' é %s" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "%s: theip ar rmtioctl" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Úsáid: %s [-V] [-f gléas] [--file=gléas] [--rsh-command=ordú]\n" +"\t[--help] [--version] oibríocht [líon]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "níor sonraíodh gléas téipe" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "%s: theip ar rmtopen" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "%s: theip ar rmtclose" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "ceanntásc neamhbhailí: earráid i suim sheiceála" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "úsáideoir neamhbhailí" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "níl aon fháil ar an ghrúpa don UID uimhriúil seo" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "grúpa neamhbhailí" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "earráid sa scríobh" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "earráid sa léamh" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "comhadchríoch gan choinne" + +#: src/util.c:493 src/util.c:543 +#, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Chrap comhad %s (%s bheart); á stuáil le nialais" +msgstr[1] "Chrap comhad %s (%s bheart); á stuáil le nialais" +msgstr[2] "Chrap comhad %s (%s bheart); á stuáil le nialais" +msgstr[3] "Chrap comhad %s (%s mbeart); á stuáil le nialais" +msgstr[4] "Chrap comhad %s (%s beart); á stuáil le nialais" + +#: src/util.c:499 src/util.c:549 +#, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Earráid sa léamh ag beart %lld i gcomhad %s; á stuáil le nialais" + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "D'fhás comhad %s, níor cóipeáladh %ld beart nua" +msgstr[1] "D'fhás comhad %s, níor cóipeáladh %ld beart nua" +msgstr[2] "D'fhás comhad %s, níor cóipeáladh %ld beart nua" +msgstr[3] "D'fhás comhad %s, níor cóipeáladh %ld beart nua" +msgstr[4] "D'fhás comhad %s, níor cóipeáladh %ld beart nua" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "Mionathraíodh comhad %s le linn é a chóipeáil" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "cuimhne fhíorúil ídithe" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "ní féidir 'seek' a dhéanamh san aschur" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "" +"Aimsíodh críoch na téipe. Luchtaigh an chéad téip eile agus brúigh RETURN. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Aimsíodh críoch na téipe. Chun dul ar aghaidh, iontráil ainm an ghléis nó " +"comhadainm nuair atá tú réidh.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "" +"Chun dul ar aghaidh, iontráil ainm an ghléis nó comhadainm nuair atá tú " +"réidh.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "earráid inmheánach: d'athraigh tuarascálaí na téipe ó %d go %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: Tá an rogha `%s' débhríoch\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: ní cheadaítear argóint i ndiaidh na rogha `--%s'\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: ní cheadaítear argóint i ndiaidh na rogha `%c%s'\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: tá argóint de dhíth i ndiaidh na rogha `%s'\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: rogha anaithnid `--%s'\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: rogha anaithnid `%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: rogha neamhcheadaithe -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: rogha neamhbhailí -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: tá argóint de dhíth i ndiaidh na rogha -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: Tá an rogha `-W %s' débhríoch\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: ní cheadaítear argóint i ndiaidh na rogha `-W %s'\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: Níl an tseirbhís ar fáil" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "stdin" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "stdout" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "Ní féidir cianbhlaosc a rith" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "%s: Theip ar fheidhm %s" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "%s: Rabhadh: Theip ar fheidhm %s" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "%s: Ní féidir an mód a athrú go %s" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "%s: Ní féidir an t-úinéir a athrú go UID %lu, GID %lu" + +#: lib/paxerror.c:127 +#, c-format +msgid "%s: Cannot hard link to %s" +msgstr "%s: Ní féidir nasc crua a dhéanamh le %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: Earráid sa léamh ag beart %s agus %lu bheart á léamh" +msgstr[1] "%s: Earráid sa léamh ag beart %s agus %lu bheart á léamh" +msgstr[2] "%s: Earráid sa léamh ag beart %s agus %lu bheart á léamh" +msgstr[3] "%s: Earráid sa léamh ag beart %s agus %lu mbeart á léamh" +msgstr[4] "%s: Earráid sa léamh ag beart %s agus %lu beart á léamh" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: Rabhadh: Earráid sa léamh ag beart %s agus %lu bheart á léamh" +msgstr[1] "%s: Rabhadh: Earráid sa léamh ag beart %s agus %lu bheart á léamh" +msgstr[2] "%s: Rabhadh: Earráid sa léamh ag beart %s agus %lu bheart á léamh" +msgstr[3] "%s: Rabhadh: Earráid sa léamh ag beart %s agus %lu mbeart á léamh" +msgstr[4] "%s: Rabhadh: Earráid sa léamh ag beart %s agus %lu beart á léamh" + +#: lib/paxerror.c:259 +#, c-format +msgid "%s: Cannot seek to %s" +msgstr "%s: Ní féidir 'seek' a dhéanamh ag %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "%s: Rabhadh: Ní féidir 'seek' a dhéanamh ag %s" + +#: lib/paxerror.c:284 +#, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "%s: Ní féidir nasc siombalach a dhéanamh le %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "%s: Níor scríobhadh ach %lu as %lu bheart" +msgstr[1] "%s: Níor scríobhadh ach %lu as %lu bheart" +msgstr[2] "%s: Níor scríobhadh ach %lu as %lu bheart" +msgstr[3] "%s: Níor scríobhadh ach %lu as %lu mbeart" +msgstr[4] "%s: Níor scríobhadh ach %lu as %lu beart" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "Gach `%s' tosaigh á bhaint amach as ainmneacha baill" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "Gach `%s' tosaigh á bhaint amach as spriocanna na nasc crua" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "Ag cur `.' in ionad ainm baill folamh" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "Ag cur `.' in ionad sprioc fholamh an naisc crua" + +#~ msgid "error %d" +#~ msgstr "earráid %d" + +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "%s: Earráid sa léamh ag beart %s, %lu bheart á léamh" +#~ msgstr[1] "%s: Earráid sa léamh ag beart %s, %lu bheart á léamh" +#~ msgstr[2] "%s: Earráid sa léamh ag beart %s, %lu bheart á léamh" +#~ msgstr[3] "%s: Earráid sa léamh ag beart %s, %lu mbeart á léamh" +#~ msgstr[4] "%s: Earráid sa léamh ag beart %s, %lu beart á léamh" diff --git a/po/gl.gmo b/po/gl.gmo new file mode 100644 index 0000000000000000000000000000000000000000..bab3f43cf1f966fffb0308c6bcbdb7751b2f49e1 GIT binary patch literal 4708 zcmb`KO^h5z6~`M0hAe@65%Pf{6=36l-Q(FfaqNj>oHz~`+1M8|N5wx?=b z-M#A#;sg?0LCFOn0YdUELR@k}NC=4o5{Ls52T-J3A~_OLEZ?jg_`T|$53}niNVMGh zpRRiK>V5p{z4GgK-SSGpbC7p0@5}E?l9S+VAK(wqeYYgZXTbZx+reXCA3Os-1b!d< z1o#W^e(<#p{{|l5`z`QO;JqJAl4bC5P{zLvJ`DaCd;t6n_(|~3;631*;Dg{h9q!%3 zTE35gVqXBo=GQ>6?@jP7@YW9{$$oGz_;K*dpy+=Q6#bXL`@ok$+2>VI?D-@382ENK zzWm{Kzb8S_dlCF7_(Sm1;7`HZz~6$R@An=40~Eb)gG=C^TibPaf+F`IC~-Q{eXoK& zzBj;+fIkB(a&Q?GKOSIE;`)>(lZj|veSp^Au0$t^}1b-$o%0)^rudWD0+yMuA0ja84|&?ClIY>`J|Bz`RO?&p<9;wW4a`{j9m3(+r$ z!QH%)D|sZB_wquUGm8}6oU(YDszNS?6=3Tr(b;5Tnw#4d=I98_s%rBKaGr z#s!o4!r7NdBCTp3FJL&Pn{GIt~z!Tuq2frB+X^ zJ-_5 zleVn(VLKU?+HFWkjk1OF!Q@G%o$$FZIJ0hGUSXXof^R0`u$JJOKpvhy{p?g$&V%9{ zv^F_dnh@aR!bD}vhJy0GsV7Z6 z6|c7RL=CrVXoz)^Tc4APNB|j$Q#S~&>vFW^Lw=J5v+2ZyfMr?fD`A!n*}B~{iFH&2 z#|ezngEry0sj^@vgjA}AD`3?q__11Ui$u<<_HYhMpKYiL-pz($XlGyRgvNxyJUVfk z*>qFEYv-rC3R~LhG_s@)&W&~51T&@Q)aV@(v696!wEBs)lp1oF9#=_K!(bh9WgVdw z-bfVKU^dYvVPR&|hPojtW6~G4VcoiJD(YdfrGq1WgJ}R&>!DiL6~va(XkwC5Qi5+= z!Pb~Bp-;{S|6O>Rp3c)3+7e1!Cf2J*dxv^QS5}r*&BTW~JzEtvPoHUuDqZsfs9vNZ zcA{`i&xc~^{JFLCq?BhWX8J5udY~Td_n%1nhtvKOYUQ!P%HjR}L;XI2=_)5siuGKs zpRTN={iAASWpJp!zrTXq8C})sTF|a4H8~%sZ~E$rdfHv`>bwcY2CddS{I$WWW0Q8| z1c#)#loq9!bQ~3~XlM@Un$hEd`Vys^7UR^hV$zgp9dzDg8Frk=Ow$|LUXy1%QypJA zd;09Dc{Emf{iTzX5Kccs~0u9KQB5!ZH2R8;7EEL;_KU!QkC-*%9N1r*^cT_4rE zO?I76B0g=!JCwAY^u6!8n@%;qD;QU5sT_7Zyaw?+k=q%qwyknJy>i#7`65L{puxsq z)^-v{79w6{{wg=6d`GmU+r}A9ADFk2RD+X-c)@s9Ph@kSjDwQDyW=b`en1M6@Anp4DwWUgZq?%4`b+S+b)QAtQJ)ci+Dxra%70(g6nQn|9LMxkoXcA0IuU8yoya}N z59Rji>E2D7tG1cvFpcglUGfT@+~2Tf1TlhevEvA8IF0dOFRGU7uBe{d)OPqqnG!`L zs39F_$^3W{{7}bZ6t&*4?~sBSHFD*adO#sr)Fo+z#c=vXetlwuZ1(UJ{w345MMw;$`PjCsZV;Ucsb%dfOG%qMMjWhfRkpFnCo zG+FFJ3zC{TOka)h+a)JSQ#G3E8r?-u0@hk}M zIvEW^Pf5RTg2v}q&|zL3JljS_hj=*=-b;T3tNIPOr^Fv^*kMJ-j+@NJ`-#1V!8G2bz>(S`p2DyK@_ literal 0 HcmV?d00001 diff --git a/po/gl.po b/po/gl.po new file mode 100644 index 0000000..b1f90d0 --- /dev/null +++ b/po/gl.po @@ -0,0 +1,1162 @@ +# Mensaxes en galego para GNU cpio. +# Copyright (C) 2000 Free Software Foundation, Inc. +# Xosé Anxo Pereira Torreiro , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.3.911\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2000-11-09 11:30+0100\n" +"Last-Translator: Xosé Anxo Pereira Torreiro \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/copyin.c:45 +#, fuzzy, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "atención: salto de %ld bytes de lixo" +msgstr[1] "atención: salto de %ld bytes de lixo" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "o nome %s trocouse por -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: nome de ficheiro demasiado longo" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: erro na suma de comprobación (0x%x, debería ser 0x%x)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s non foi creado: existe unha versión coa data igual ou posterior" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "non se pode borrar o actual %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "non se pode facer un enlace de %s a %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "" +"non se poden intercambiar as medias-verbas de %s: número impar de medias-" +"verbas" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "non se poden intercambiar os bytes de %s: número impar de bytes" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "`%s' existe pero non é un directorio" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "non se pode facer un enlace de %s a %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: tipo de ficheiro descoñecido" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "remate prematuro do ficheiro" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "atención: a cabeceira do ficheiro ten os bytes en orde inverso" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "a entrada estándar está pechada" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, fuzzy, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d bloques\n" +msgstr[1] "%d bloques\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "non se pode ler a suma de comprobación de %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: truncase o número de inode" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "número do ficheiro = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "número do ficheiro = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: truncase o número de inode" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "a saida estándar está pechada" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "líña en branco descartada" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s non foi volcado: non é un ficheiro regular" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: enlace simbólico demasiado longo" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s é unha ligazón a %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "" + +#: src/main.c:87 +#, fuzzy +msgid "Main operation mode:" +msgstr "operación de cinta en curso" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "" + +#: src/main.c:119 +msgid "STRING" +msgstr "" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "" + +#: src/main.c:137 +msgid "FLAG" +msgstr "" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "" + +#: src/main.c:233 +msgid "Print program version" +msgstr "" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "o tamaño do bloque non é válido" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "" + +#: src/main.c:389 +#, fuzzy, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"formato de arquivo `%s' non válido, os formatos válidos son:\n" +"crc, newc, odc, bin, ustar, tar, hpodc, hpbin" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "non se pode abrir o directorio %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "erro ó pechar o ficheiro" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "non se pode crear o directorio `%s'" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s' existe pero non é un directorio" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s non é un ficheiro especial de caracteres" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, fuzzy, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Modo de emprego: %s [-V] [-f dispositivo] [--file=dispositivo] [--help] [--" +"version] operación [contador]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "non se especificou ningún dispositivo de cinta" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "a cabeceira non é válida: erro na suma de comprobación" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "usuario non válido" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "non se pode obter o grupo de login dun UID numérico" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "grupo non válido" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "erro de escritura" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "erro de lectura" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "remate prematuro do ficheiro" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "O arquivo %s foi reducido en %ld bytes, rechease con ceros" +msgstr[1] "O arquivo %s foi reducido en %ld bytes, rechease con ceros" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Erro de lectura no byte %ld do ficheiro %s, rechease con ceros" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "memoria virtual esgotada" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "non se pode posicionar na saida" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Atopouse o remate da cinta. Cargue a seguinte cinta e prema RETURN." + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Atopuose o remate da cinta. Para continuar, escriba o nome do dispositivo/" +"ficheiro cando estea listo.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "" +"Para continuar, escriba o nome do dispositivo/ficheiro cando estea listo.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "erro interno: o descriptor da cinta foi modificado de %d a %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: a opción `%s' é ambigua\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: a opción `--%s' non admite ningún argumento\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: a opción `%c%s' non admite ningún argumento\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: a opción `%s' require un argumento\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opción `--%s' non recoñecida.\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opción non recoñecida `%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opción non válida -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opción non válida -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: a opción require un argumento - %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, fuzzy, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: a opción `%s' é ambigua\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, fuzzy, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: a opción `--%s' non admite ningún argumento\n" + +#: lib/rtapelib.c:299 +#, fuzzy, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: servicio non dispoñible" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, fuzzy, c-format +msgid "Cannot execute remote shell" +msgstr "non se pode executar o shell remoto" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "non se pode facer un enlace de %s a %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "Erro de lectura no byte %ld do ficheiro %s, rechease con ceros" +msgstr[1] "Erro de lectura no byte %ld do ficheiro %s, rechease con ceros" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "non se pode facer un enlace de %s a %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "non se pode facer un enlace de %s a %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "Erro de lectura no byte %ld do ficheiro %s, rechease con ceros" +#~ msgstr[1] "Erro de lectura no byte %ld do ficheiro %s, rechease con ceros" + +#~ msgid "Memory exhausted" +#~ msgstr "Memoria esgotada" + +#~ msgid "block size cannot be 0" +#~ msgstr "o tamaño do bloque non pode ser 0" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt versión %s\n" + +#~ msgid "Success" +#~ msgstr "Feito" + +#~ msgid "parse error in blocksize" +#~ msgstr "erro de análise sintáctico do tamaño do bloque" + +#~ msgid "Regular expression too big" +#~ msgstr "Expresión regular demasiado grande" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Modo de emprego: %s {-o|--create} [-0acvABLV] [-C bytes] [-H formato]\n" +#~ " [-M mensaxe] [-O [[usuario@]host:]ficheiro]\n" +#~ " [-F [[usuario@]host:]ficheiro] [--file=[[usuario@]host:]ficheiro]\n" +#~ " [--format=formato] [--message=mensaxe] [--null]\n" +#~ " [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=bloques] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < lista-de-nomes [> ficheiro]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "Remate prematuro da expresión regular" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f ficheiro] [-s remprazo]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=reemprazo] [patrón...] [< ficheiro]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "número do bloque = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "O nome de clase do carácter non é válido" + +#~ msgid "drive type = %d\n" +#~ msgstr "tipo de unidade = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "" +#~ "a opción `%c' non é recoñecida para -p, as opcions recoñecidas son `aemop'" + +#~ msgid "ambiguous" +#~ msgstr "ambiguo" + +#~ msgid "missing regexp" +#~ msgstr "non se atopa a expresión regular" + +#~ msgid "1 block\n" +#~ msgstr "1 bloque\n" + +#~ msgid "No match" +#~ msgstr "Non coincide" + +#~ msgid "residue count = %d\n" +#~ msgstr "contador residual = %d\n" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [usuario][:.][grupo]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[usuario][:.][grupo]] [--no-preserve-" +#~ "owner]\n" +#~ " [--sparse] [--help] [--version] directorio-destino < lista_de_nomes\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "estado da unidade = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "[ ou [^ non emparellado" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M mensaxe] [-R [usuario][:.][grupo]] [-I [[usuario@]nodo:]" +#~ "ficheiro]\n" +#~ " [-F [[usuario@]nodo:]ficheiro] [--file=[[usuario@]nodo:]ficheiro]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocs] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=archivo] [--format=formato]\n" +#~ " [--owner=[usuario][:.][grupo]] [--no-preserve-owner] [--" +#~ "message=mensaxe]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [patrón...] [< ficheiro]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f ficheiro] [-s reemprazo]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=reemprazo] [patrón...] [< ficheiro]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "estado da unidade (baixa) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "O carácter de ordeación non é válido" + +#~ msgid "Unmatched \\{" +#~ msgstr "\\{ non emparellado" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr ") ou \\) non emparellado" + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "A expresión regular precedente non é válida" + +#~ msgid "null regexp" +#~ msgstr "expresión regular nula" + +#~ msgid "%s already exists; not created" +#~ msgstr "%s xa existe; non se creou" + +#~ msgid "Invalid back reference" +#~ msgstr "Referencia cara a atrás non válida" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Modo de emprego: %s [-cdnv] [-f ficheiro] [-s reemprazo] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=reemprazo] [patrón...] [< ficheiro]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "( ou \\( non emparellado" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio versión %s\n" + +#~ msgid "invalid" +#~ msgstr "non válido" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax versión %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "O contido entre \\{\\} non é válido" + +#~ msgid "Invalid range end" +#~ msgstr "Remate de rango non válido" + +# ¿De que chave falará eiquí? (Anxo) +# sense key é o estado da unidade / controladora, básicamente (Jacobo) +#~ msgid "sense key error = %d\n" +#~ msgstr "erro de estado = %d\n" + +#~ msgid "Trailing backslash" +#~ msgstr "Barra invertida ao remate" + +#~ msgid "can not omit both user and group" +#~ msgstr "non se poden omitir ó mesmo tempo o usuario e o grupo" + +#~ msgid "Invalid regular expression" +#~ msgstr "Expresión regular non válida" + +#~ msgid "No previous regular expression" +#~ msgstr "Non existe unha expresión regular previa" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f ficheiro] [-s reemprazo]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=reemprazo] [patrón...] [< ficheiro]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "estado da unidade (alta) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "%s ao compilar o patrón" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "o modificador da expresión regular `%c' non é válido" diff --git a/po/hu.gmo b/po/hu.gmo new file mode 100644 index 0000000000000000000000000000000000000000..5cd72c45bbb4bb0f8715865435b46195bc6d0fe1 GIT binary patch literal 4582 zcmbtWO^h5z6>cB|vY4NQfE_TT_*px_+q1K_<2Yku8Ei+fWGB|L$ps-&(_Pb3+tpR$ zs_I@(OWY!Xhy)S}7Y-0{fD?jTa)bkyh!ZysNWfeo4X{$A#e1+V#P_OuX2ectY_g??yv4?&f;aSD!Fg|a*FN!Vz4}1V$cn&=jMPCFy0sJ`dEU*i_0{jB- zJHSr^e+GO4_;!nb1g_x!-+`Y49{gYwEd!qc()c%lM}Xf0eg^n!;Aeq<0DcPiF7Qd< zofZ#2jJ5cG7D)bCAo=_@ko2;9=n7z!!kD|F?j&{|(?F;2S_X=T|`T z=l8&q!1vnmpGaqd>BI z5=cCqZvU?XJNTaiKLY#-@H%4f3n1}(2!jWKJ>Y5JI&c~II*@pO3-~4AJ3!*=pTITX z0XRqF=YVv-K9KnOA@CINcR<>I7fAab!sW=nE|A7A1Burhcn$ai;8oyXfoFj6$C|iG zAf5YN;1%F6fwb;lz%K(2LNrH!XMsn736REL2ljx!Y4IOG(%+F!G=5$H()}Fplfdr- zp9cOENdCS9BwhUtNPPbr_$cske8I)&2oPIFCxPVO#THW_t$PhfeEu9rar!e5v`3I@ zcv|^~-^3$5v@bnmPYGeSu*67Ctg_QMk0}1v4K>AOqA5QNSQZm+0lQpPpsfxq&=p^7M2*S z;)P&56RZ-}Nu!y#A)TKuNXudr?89MJWToPEc0@1yV4Ak@#xP}chLd_sDkUl)C6hq@-JEz^>V$i#GbXi31=D5G7dEg`>Rg*G z-O%aBBZ^;-mD-BLWLnk;Ri zq-+Fc99zG%@$&kM9k%bP4Z{+n;dd!k82QFhQOQKClFpjgZw-ZJP*ytbEJgpT{j0=& zBRbYE{hqQ@ge~#Lj-$TfIwwj6lbJSFq*1~(={Xa)%uqminba(^rX10QIgu+Y;_&k2 zi!)ow2ZlUo5~AIp;5jZdJBg7qGkdxa(n}<{D+@M2t{{)vWmXiX5-cgLg(ep!oDeyK zErJtF*Ek0uXv4;%d9mUq92t^P8jfAPYjE7tewv0_5uwXtN32Wh5qKqSDahnWf zB_gR&5i~L|O!u0Ar@|#xjzB3@4V^(%18WMl+!TovtD5BOE0g5RL3i_^K<)hB5Y!0U z+hZpjGoLOUbgj+oR8mV*ody!2gXRkEODksboH>2pM5tsT49))Fno12~7@uR2^H4Ci zDU%vhlWvFw95A0~g0L`CN$X3nQXqVG4Al*J=}-@&Ep9dV>&*yc%?;U*I|!RfqXO%SsRTiTdc8HJi|Bd^wF@X-X(~8A-#AcTRMkTU%RN7b9bReAQ(#jlW)IF5WOb zNIi?m?0lxnjtf~774CezVYzmSBj!E!HJw`AXG0b!;b%R;xB2;j6^Msa zond(nYjjqk8^jxe7d`eusWWaRO6OVMZbYYgOvc0VyrNFgai+A1Kz?MRqlG`WboKJp zOM6_bb-GIzP(Y9;@dnBV#E25KI#OKfGogJs;lFzM8!yGDPe1cqe0-u?;&5$Maa05RjfbL+FiI$Zdl75G7`1S!$PSOoFu6UO_9O0QRs&g3+aVpDY5B? zo>t7?Qfz3Pt8Za(V_m>O$~rnd=cB|KwX@hfrnZ`D6bXfDy5BrUc?!*OHu)y`5VnM( zDfycgSr(>kle7ZWb!H!Y7TI`eaY%8y=_2>ofRTlbn5*yPZVF=O#!b7NZF!FiBgCWt zXLjzu%usVwly);PjrR;9d+xF2i%hs$hCZ5?V4RN(h`)zVkf(E_koKXMx_VLso~1+G z7oI4jNcinhN$)a9?EA>uGkwtA_AJoXUI7c(#noK#47cg94S^!wr@?%;5Q2Hi(K{dU4~@I_uM$k@n-;zO&DU&l@%N+)o?@VH=f=Hm{j*b-r7#(tQxY zYKqNyA#;@ReClc<6Yl*#YlBEysjr~D2c6`*dR+O5jqXr}Ih;0-*%-PZb#7O8AaCSL z#UtWmQn*^!+th9;(NOuVH}%e&eX&V$CT^xqA|(ygLNx9s4TosoQ0_!2KH5e(m)H!c zx;Wirv6f)DP2!N;Gw=AK?JT9S4>Da4)i-T@a~D}Cvgx8F)ddH$JvTTDo}!4z#s#7L zq%x{;YtODQHNBFtr>N6EO|hqnAW+_d?@gE3$R&kG4p>|;~+lhv|2QAkT{_vgxkjHimbN4aBCJCOtZ6av$;cSSs|? zT2ItYgpP~Eh9f*hm2R8^EsfkGN_bp>Bl7Lds%f?`O6fo&A(Rt{i*6ZBJTipDh9Kfj zh{^nIpf5t8C?Bc*fTTvev)70=koV4qcZLaC9Xu^|&, 2002 +# Tímár András , 2003 +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.3.911\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2003-04-17 13:34+0200\n" +"Last-Translator: Andras Timar \n" +"Language-Team: Hungarian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/copyin.c:45 +#, fuzzy, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "figyelem: %ld (szemét) byte átugorva" +msgstr[1] "figyelem: %ld (szemét) byte átugorva" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "átnevezés %s ->" + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: fájlnév túl hosszú" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: hibás ellenõrzõösszeg (0x%x helyett 0x%x van)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s nem lett létrehozva: újabb vagy azonos verzió létezik" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "nem lehet a jelenlegi %s-t eltávolítani" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "a %s-t nem lehet csatolni a %s-hez" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "nem lehet %s félszavait felcserélni: páratlan számú félszó" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "a %s byte-jait nem lehet felcserélni: nem páros számú byte" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "`%s' létezik, de nem könyvtár" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "a %s-t nem lehet csatolni a %s-hez" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: ismeretlen fájltípus" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "túl korai archívumvég" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "figyelem: az archív fájl fejléce fordított byte-sorrendû" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "a standard bemenet le van zárva" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, fuzzy, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d blokk\n" +msgstr[1] "%d blokk\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "%s ellenõrzõösszegét nem lehet olvasni" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: csonkolt inode szám" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "fájlszám = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "fájlszám = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: csonkolt inode szám" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "a standard kimenet le van zárva" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "üres sor figyelmen kívül hagyva" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s nincs kimentés: nem reguláris fájl" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: szimbolikus kapocs túl hosszú" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "a %s csatolva a %s-hez" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "" + +#: src/main.c:87 +#, fuzzy +msgid "Main operation mode:" +msgstr "szalagmûvelet" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "" + +#: src/main.c:119 +msgid "STRING" +msgstr "" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "" + +#: src/main.c:137 +msgid "FLAG" +msgstr "" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "" + +#: src/main.c:233 +msgid "Print program version" +msgstr "" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "érvénytelen blokkméret" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "" + +#: src/main.c:389 +#, fuzzy, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"a `%s' érvénytelen formátum; érvényes formátumok:\n" +"crc, newc, odc, bin, ustar, tar, hpodc, hpbin" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "nem lehet a következõ könyvtárat megnyitni: %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "hiba az archívum lezárásakor" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "a %s könyvtárat nem lehet létrehozni" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s' létezik, de nem könyvtár" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s nem karakteres különleges fájl" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, fuzzy, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Használat: %s [-V] [-f eszköz] [--file=eszköz] [--help] [--version] mûvelet " +"[számláló]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "nincs megadva szalagos eszköz" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "érvénytelen fejléc: hibás ellenõrzõösszeg" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "érvénytelen felhasználó" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "" +"a számszerû UID-hez tartozó bejelentkezési csoportot nem lehet megállapítani" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "érvénytelen csoport" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "írási hiba" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "olvasási hiba" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "túl korai fájlvég" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "A %s fájl összement %ld byte-tal, nullákkal feltöltve" +msgstr[1] "A %s fájl összement %ld byte-tal, nullákkal feltöltve" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Olvasási hiba %s fájlban %ld byte-nál, feltöltve nullákkal" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "a virtuális memória elfogyott" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "nem lehet mozogni (seek) a kimeneten" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "" +"Vége a szalagnak. Tedd be a következõ szalagot, és nyomd le az ENTER " +"billentyût." + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Vége a szalagnak. Folytatáshoz írd be az eszköz/fájl nevét, amikor kész " +"van.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "Folytatáshoz írd be az eszköz/fájl nevét, amikor kész van.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "belsõ hiba: a szalagleíró megváltozott %d -> %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: a `%s' kapcsoló nem egyértelmû\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: a `--%s' kapcsoló nem enged meg paramétert\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: a `%c%s' kapcsoló nem enged meg argumentumot\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: a `%s' kapcsolóhoz argumentum szükséges\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: a `--%s' kapcsoló ismeretlen.\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: a `%c%s' kapcsoló ismeretlen\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: nem megengedett kapcsoló -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: érvénytelen kapcsoló -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: a kapcsolónak szüksége van egy argumentumra -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, fuzzy, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: a `%s' kapcsoló nem egyértelmû\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, fuzzy, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: a `--%s' kapcsoló nem enged meg paramétert\n" + +#: lib/rtapelib.c:299 +#, fuzzy, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: a szolgáltatás nem elérhetõ" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, fuzzy, c-format +msgid "Cannot execute remote shell" +msgstr "nem lehet futtatni a távoli héjat" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "a %s-t nem lehet csatolni a %s-hez" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "Olvasási hiba %s fájlban %ld byte-nál, feltöltve nullákkal" +msgstr[1] "Olvasási hiba %s fájlban %ld byte-nál, feltöltve nullákkal" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "a %s-t nem lehet csatolni a %s-hez" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "a %s-t nem lehet csatolni a %s-hez" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "Olvasási hiba %s fájlban %ld byte-nál, feltöltve nullákkal" +#~ msgstr[1] "Olvasási hiba %s fájlban %ld byte-nál, feltöltve nullákkal" + +#~ msgid "Memory exhausted" +#~ msgstr "Elfogyott a memória" + +#~ msgid "block size cannot be 0" +#~ msgstr "blokkméret nem lehet 0" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt verzió %s\n" + +#~ msgid "Success" +#~ msgstr "Sikerült" + +#~ msgid "parse error in blocksize" +#~ msgstr "feldolgozási hiba a blokkméretben" + +#~ msgid "Regular expression too big" +#~ msgstr "Túl nagy reguláris kifejezés" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Használat: %s {-o|--create} [-0acvABLV] [-C byte] [-H formátum] [-M " +#~ "üzenet]\n" +#~ " [-O [[felhasználó@]kiszolgáló:]archívum] [-F [[felhasználó@]" +#~ "kiszolgáló:]archívum]\n" +#~ " [--fájl=[[felhasználó@]kiszolgáló:]archívum] [--format=formátum] " +#~ "[--message=üzenet]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blokk] [--dereference] [--io-size=byte] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < névlista [> archívum]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "A reguláris kifejezés túl hamar ért véget" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archívum] [-s helyettesítõ " +#~ "szöveg]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=helyettesítõ szöveg] [minta...] [< archívum]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "blokkszám = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "Érvénytelen karakterosztály-név" + +#~ msgid "drive type = %d\n" +#~ msgstr "meghajtó típusa = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "a `%c' érvénytelen jelzõje -p-nek; érvényes jelzõ az `aemop'" + +#~ msgid "ambiguous" +#~ msgstr "nem egyértelmû" + +#~ msgid "missing regexp" +#~ msgstr "hiányzó regexp" + +#~ msgid "1 block\n" +#~ msgstr "1 blokk\n" + +#~ msgid "No match" +#~ msgstr "Nincs találat" + +#~ msgid "residue count = %d\n" +#~ msgstr "visszamaradt = %d\n" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [felhasználó][:.]" +#~ "[csoport]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[felhasználó][:.][csoport]] [--no-" +#~ "preserve-owner]\n" +#~ " [--sparse] [--help] [--version] célkönyvtár < névlista\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "meghajtó állapota = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "Pár nélküli [ vagy [^" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C byte] [-E fájl] [-H " +#~ "formátum]\n" +#~ " [-M üzenet] [-R [felhasználó][:.][csoport]] [-I [[felhasználó@]" +#~ "kiszolgáló:]archívum]\n" +#~ " [-F [[felhasználó@]kiszolgáló:]archívum] [--file=[[felhasználó@]" +#~ "kiszolgáló:]archívum]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blokk] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=byte] [--pattern-file=fájl] [--format=formátum]\n" +#~ " [--owner=[felhasználó][:.][csoport]] [--no-preserve-owner] [--" +#~ "message=üzenet]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [minta...] [< archívum]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f archívum] [-s helyettesítõ szöveg]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=helyettesítõ szöveg] [minta..] [< archívum]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "meghajtó állapota (alacsony) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "Érvénytelen rendezõkarakter" + +#~ msgid "Unmatched \\{" +#~ msgstr "Pár nélküli \\{" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr "Pár nélküli ) vagy \\)" + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "Helytelen volt az elõzõ reguláris kifejezés" + +#~ msgid "null regexp" +#~ msgstr "üres regexp" + +#~ msgid "%s already exists; not created" +#~ msgstr "%s létezik, nem lehet létrehozni" + +#~ msgid "Invalid back reference" +#~ msgstr "Érvénytelen visszahivatkozás" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Használat: %s [-cdnv] [-f archívum] [-s helyettesítõ szöveg] [--" +#~ "nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=helyettesítõ szöveg] [minta...] [< archívum]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "Pár nélküli ( vagy \\(" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio %s verzió\n" + +#~ msgid "invalid" +#~ msgstr "érvénytelen" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax %s verzió\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "Helytelen tartalom a \\{\\}-ben" + +#~ msgid "Invalid range end" +#~ msgstr "Helytelen tartományvég" + +#~ msgid "sense key error = %d\n" +#~ msgstr "sense key hiba = %d\n" + +#~ msgid "Trailing backslash" +#~ msgstr "Záró backslash" + +#~ msgid "can not omit both user and group" +#~ msgstr "a felhasználót és a csoportot nem lehet egyszerre kihagyni" + +#~ msgid "Invalid regular expression" +#~ msgstr "Érvénytelen reguláris kifejezés" + +#~ msgid "No previous regular expression" +#~ msgstr "Nincs elõzõ reguláris kifejezés" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f archívum] [-s helyettesítõ szöveg]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=helyettesítõ szöveg] [minta...] [< archívum]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "meghajtó állapota (magas) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "%s a minta lefordítása közben" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "`%c' érvénytelen regexp módosító" diff --git a/po/insert-header.sin b/po/insert-header.sin new file mode 100644 index 0000000..b26de01 --- /dev/null +++ b/po/insert-header.sin @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/po/ko.gmo b/po/ko.gmo new file mode 100644 index 0000000000000000000000000000000000000000..9d258afba1d5026e6bb77193fc97aa404f76dfa1 GIT binary patch literal 5437 zcmcImO^h3786KbnxyGgoB8#12xc6MTW z#+@JUZrb!vq#QW)0tbXR(>sEKdP7_gNL-MRs5k-Qzy%3T2#M$YK99$CoRCT|()js) z-tYb1pXYtYe?0xvcNILdc%R1`ene3gfxrGJe(=2aF-7?X@Mpkhfgb=fz`p^ffiFCz zC|?9tfnNdM>|+;r3G?p&UjY6Tm;(N;zy2@adCV_&9UCPsV=^+Y}?irfkA%4SLkuREqO5!2?@dH|m2iJ=S zX%ajlo6h1zc*FxbDKFwB?jsd~6U0M`71aU4Hu8|~l*bfaghp@*AUH@kiLpfhxn|d0_FtF^+IMa^U&}OGvq!Cy4-Y(Hal?IoJ87=+u{}rJ(db+ zPV%PDjgVU!bNLaDcsONrI5TX{dfX2j&t?4B3BthvE9!KGytvHgcGNcf_zF!7m`f@` z&tq-RwQ-ZioOYYrFvaVJq*7H`%AArrZqH~t)`XqD?46XE3NA3q>yzBGVBgf~Ed6W)Seew$@X&ZJgIO#OKwquImkH#eQ zBiA%S$F-T`dKPDH)M;{GL?v=tu6N|haE2#c%Adv}*XO2ZyUsnNao{n9N4hz2UwAX6 zta*`ZF^<0FX~s4@!$RVZL$QE>Sgec41Z=0idt+xS%_g4O^_c0oush@w z-g8VoM?90cKRV9ChMI;gr1Dwl(>(+ci(^)}KJ zq}z7d^wKTAf^)7Np- zI>21FZ8+|t_<969T&mw#QLpVJf@IeL_tm;?iMJ#DzAs5B6i&0^#>c+EDPk&S2Sa>m>=d1d5JeGU$tX9l?)j!zc7_6_4{* z;@#@ia)ZW0A6JT{wxz$J-*3G17_t5*mZV8Zby_4*gi+rr_k^orR$Ym;B)O~{FX{d4 z$*)kXhD7h6eTsxmid*Gou|5c}JWKNOrpMaRSg%^+C*@Z=zWjgSLqbprieUI4B;;Gl z6rL?&EErKdkC9{q*;m*iArcw0l$Ivvdg-cGF3!crh~pR!_)%E{Z(DgD@0X6RoE3LU ztM2Ds9bA;0xfV+gCoDt1g0{Pr-Q}9%D3BRnOc#lzb9C-H8jSy)a!mAO{q zm9i>xN`FShbrZ`vaf)QFoJZ$hh@CI(=^Jb5>P%Usm2s!#Zr({;)%T0((%$^-|7Pz) znqG@4_=CRge=N3W~QKkV0k00V@n(B $(C8^=CAv(B. +# Copyright (C) 1997 Free Software Foundation, Inc. +# Kim Seong-Jin , 1997. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.3.911\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 1997-10-31 19:25+0900\n" +"Last-Translator: Kim Seong-Jin \n" +"Language-Team: Korean \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=EUC-KR\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/copyin.c:45 +#, fuzzy, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "$(C0f0m(B: %ld$(C9Y@LF.8&(B $(C0G3J6Y>z=@4O4Y(B" +msgstr[1] "$(C0f0m(B: %ld$(C9Y@LF.8&(B $(C0G3J6Y>z=@4O4Y(B" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "$(C@L8'(B $(C9Y2Y1b(B %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: $(C3J9+(B $(C1d(B $(CFD@O(B $(C@L8'(B" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: $(CCn>_(B $(CGT(B)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "" +"%s $(C;}<:>H5J(B: $(C4u(B $(C;u7N?n(B $(C9v@|@L3*(B $(C5?@O(B $(C9v@|@L(B " +"$(CA8@gGU4O4Y(B" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "$(CGv@g@G(B %s$(C@;(B($(C8&(B) $(C;hA&GR(B $(Cx=@4O4Y(B" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "%s$(C@;(B($(C8&(B) %s$(C?!(B $(C85E)GR(B $(Cx=@4O4Y(B" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "" +"%s$(C@G(B $(C9](B $(C?v5e8&(B $(C@Z8.9Y2^GR(B $(Cx@=(B: $(CH&x=@4O4Y(B" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "`%s'$(C@L(B($(C0!(B) $(CA8@gGOAv88(B $(C5p7:Ed8.4B(B $(C>F4U4O4Y(B" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "%s$(C@;(B($(C8&(B) %s$(C?!(B $(C85E)GR(B $(Cx=@4O4Y(B" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: $(C>K(B $(Cx4B(B $(CFD@O(B $(C@/G|(B" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, fuzzy, c-format +msgid "premature end of archive" +msgstr "$(C6'@L8%(B $(C>FD+@L:j@G(B $(C3!(B" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "" +"$(C0f0m(B: $(C>FD+@L:j(B $(CGl4u?!(B $(C0E2Y7N(B $(C5H(B $(C9Y@LF.(B-$(Cx=@4O4Y(B" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: $(C>F@L3k5e(B $(C9xH#8&(B $(C@}4\\GU4O4Y(B" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "$(CFD@O(B $(C9xH#(B = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "$(CFD@O(B $(C9xH#(B = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: $(C>F@L3k5e(B $(C9xH#8&(B $(C@}4\\GU4O4Y(B" + +#: src/copyout.c:620 +#, fuzzy, c-format +msgid "standard output is closed" +msgstr "$(CG%AXCb7B@L(B $(C4]G{=@4O4Y(B" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "$(C0x9iG`@:(B $(C9+=C5K4O4Y(B" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "" +"%s$(C@L(B($(C0!(B) $(C1b7O5GAv(B $(C>J@=(B: $(CA$1T(B $(CFD@O@L(B $(C>F4T(B" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: $(C3J9+(B $(C1d(B $(C=I:<8/(B $(C85E)(B" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s$(C@:(B($(C4B(B) %s$(C?!(B $(C85E)5J(B" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "" + +#: src/main.c:87 +#, fuzzy +msgid "Main operation mode:" +msgstr "$(CEW@LGA(B $(C5?@[(B" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "" + +#: src/main.c:119 +msgid "STRING" +msgstr "" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "" + +#: src/main.c:137 +msgid "FLAG" +msgstr "" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "" + +#: src/main.c:233 +msgid "Print program version" +msgstr "" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "$(C:N@{@}GQ(B $(C:m70E)1b(B" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "" + +#: src/main.c:389 +#, fuzzy, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"`%s'$(C@:(B($(C4B(B) $(C:N@{@}GQ(B $(C>FD+@L:j(B $(CG|=D@S(B; $(C?G@:(B $(CG|" +"=D@:(B:\n" +"crc, newc, odc, bin, ustar, tar, hpodc, hpbin$(C@T4O4Y(B" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "$(C5p7:Ed8.(B %s$(C@;(B($(C8&(B) $(C?-(B $(Cx=@4O4Y(B" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "$(C>FD+@L:j(B $(C4]1b(B $(C?@7y(B" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "$(C5p7:Ed8.(B `%s'$(C@;(B($(C8&(B) $(C885i(B $(Cx=@4O4Y(B" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s'$(C@L(B($(C0!(B) $(CA8@gGOAv88(B $(C5p7:Ed8.4B(B $(C>F4U4O4Y(B" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s$(C@:(B($(C4B(B) $(C9.@ZG|(B $(CF/F4U4O4Y(B" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, fuzzy, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"$(C;g?k9}(B: %s [-V] [-f $(C@eD!(B] [--file=$(C@eD!(B] [--help] [--version] " +"$(C8m7I(B [$(C09J>R=@4O4Y(B" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "$(C:N@{@}GQ(B $(CGl4u(B: $(CCK(B $(Cx=@4O4Y(B" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "$(C:N@{@}GQ(B $(C1W7l(B" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "$(C>21b(B $(C?@7y(B" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "$(C@P1b(B $(C?@7y(B" + +#: src/util.c:208 +#, fuzzy, c-format +msgid "premature end of file" +msgstr "$(C6'@L8%(B $(CH-@O@G(B $(C3!(B" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "" +"$(CFD@O(B %s$(C@;(B($(C8&(B) %ld$(C9Y@LF.(B $(CC`n5g(B " +"$(C88E-(B 0$(C@87N(B $(C8^?v(B $(C3V=@4O4Y(B" +msgstr[1] "" +"$(CFD@O(B %s$(C@;(B($(C8&(B) %ld$(C9Y@LF.(B $(CC`n5g(B " +"$(C88E-(B 0$(C@87N(B $(C8^?v(B $(C3V=@4O4Y(B" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "" +"$(CFD@O(B %s$(C@G(B %ld$(C9xB0(B $(C9Y@LF.?!<-(B $(C@P1b(B $(C?@7y@T4O4Y(B. " +"$(C8x@P@:(B $(C:N:P@:(B 0$(C@87N(B $(C8^?s4O4Y(B" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "$(C0!;s(B $(C8^8p8.0!(B $(C9Y4Z35=@4O4Y(B" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "$(CCb7B?!(B $(C4kGX<-4B(B seek$(CGR(B $(Cx=@4O4Y(B" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "" +"$(CEW@LGA@G(B $(C3!@T4O4Y(B. $(C4Y@=(B $(CEW@LGA8&(B $(C@{@gGQ(B $(CHD(B " +"$(C8.EO@;(B $(C4)8#=J=C?@(B. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"$(CEW@LGA@G(B $(C3!@T4O4Y(B. $(C0hz=@4O4Y(B" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: $(C?IV8EGU4O4Y(B\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: `--%s' $(C?Ix=@4O4Y(B\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: `%c%s' $(C?Ix=@4O4Y(B\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: `%s' $(C?Ix4B(B $(C?Ix4B(B $(C?IV8EGU4O4Y(B\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, fuzzy, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: `--%s' $(C?Ix=@4O4Y(B\n" + +#: lib/rtapelib.c:299 +#, fuzzy, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: $(C;g?kGR(B $(Cx4B(B $(C<-:q=:(B" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, fuzzy, c-format +msgid "Cannot execute remote shell" +msgstr "$(C?x0]=)@;(B $(C=GG`GR(B $(Cx=@4O4Y(B" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "%s$(C@;(B($(C8&(B) %s$(C?!(B $(C85E)GR(B $(Cx=@4O4Y(B" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +"$(CFD@O(B %s$(C@G(B %ld$(C9xB0(B $(C9Y@LF.?!<-(B $(C@P1b(B $(C?@7y@T4O4Y(B. " +"$(C8x@P@:(B $(C:N:P@:(B 0$(C@87N(B $(C8^?s4O4Y(B" +msgstr[1] "" +"$(CFD@O(B %s$(C@G(B %ld$(C9xB0(B $(C9Y@LF.?!<-(B $(C@P1b(B $(C?@7y@T4O4Y(B. " +"$(C8x@P@:(B $(C:N:P@:(B 0$(C@87N(B $(C8^?s4O4Y(B" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "%s$(C@;(B($(C8&(B) %s$(C?!(B $(C85E)GR(B $(Cx=@4O4Y(B" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "%s$(C@;(B($(C8&(B) %s$(C?!(B $(C85E)GR(B $(Cx=@4O4Y(B" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "" +#~ "$(CFD@O(B %s$(C@G(B %ld$(C9xB0(B $(C9Y@LF.?!<-(B $(C@P1b(B $(C?@7y@T4O4Y" +#~ "(B. $(C8x@P@:(B $(C:N:P@:(B 0$(C@87N(B $(C8^?s4O4Y(B" +#~ msgstr[1] "" +#~ "$(CFD@O(B %s$(C@G(B %ld$(C9xB0(B $(C9Y@LF.?!<-(B $(C@P1b(B $(C?@7y@T4O4Y" +#~ "(B. $(C8x@P@:(B $(C:N:P@:(B 0$(C@87N(B $(C8^?s4O4Y(B" + +#~ msgid "Memory exhausted" +#~ msgstr "$(C8^8p8.0!(B $(C9Y4Z35=@4O4Y(B" + +#~ msgid "block size cannot be 0" +#~ msgstr "$(C:m70(B $(CE)1b4B(B 0$(C@L(B $(C>F4O>n>_(B $(CGU4O4Y(B" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt $(C9v@|(B %s\n" + +#~ msgid "Success" +#~ msgstr "$(C<:0x(B" + +#~ msgid "parse error in blocksize" +#~ msgstr "blocksize$(C?!<-(B $(C189.:P<.(B $(C?@7y(B" + +#~ msgid "Regular expression too big" +#~ msgstr "$(CA$1T=D@L(B $(C3J9+(B $(CE.4O4Y(B" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "$(C;g?k9}(B: %s {-o|--create} [-0acvABLV] [-C $(C9Y@LF.(B] [-H $(CG|=D(B] " +#~ "[-M $(C8^=CAv(B]\n" +#~ " [-O [[$(C;g?k@Z(B@]$(CH#=:F.(B:]$(C>FD+@L:j(B] [-F [[$(C;g?k@Z(B@]" +#~ "$(CH#=:F.(B:]$(C>FD+@L:j(B]\n" +#~ " [--file=[[$(C;g?k@Z(B@]$(CH#=:F.(B:]$(C>FD+@L:j(B] [--format=$(CG|" +#~ "=D(B] [--message=$(C8^=CAv(B]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=$(C:m70(B] [--dereference] [--io-size=$(C9Y@LF.(B] " +#~ "[--quiet]\n" +#~ " [--force-local] [--help] [--version] < $(C@L8'8q7O(B [> $(C>FD+@L:j" +#~ "(B]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "$(CA$1T=D@L(B $(C9L?O@N(B $(CC$7N(B $(C3!32(B" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s $(C4kC<90(B]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=$(C4kC<90(B] [$(CFPEO(B...] [< $(C>FD+@L:j(B]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "$(C:m70(B $(C9xH#(B = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "$(C:N@{@}GQ(B $(C9.@Z7y(B $(C@L8'(B" + +#~ msgid "drive type = %d\n" +#~ msgstr "$(C5e6s@L:j(B $(C@/G|(B = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "" +#~ "-p$(C?!(B $(C4kGQ(B, $(C@N=DGR(B $(Cx4B(B $(CGC7!1W(B `%c'; " +#~ "$(C@N=DGR(B $(CV8EGU4O4Y(B" + +#~ msgid "missing regexp" +#~ msgstr "$(CA$1T=D@L(B $(C:|A3=@4O4Y(B" + +#~ msgid "1 block\n" +#~ msgstr "1$(C:m70(B\n" + +#~ msgid "No match" +#~ msgstr "$(C4k@@5G4B(B $(C0M@L(B $(C>x=@4O4Y(B" + +#~ msgid "residue count = %d\n" +#~ msgstr "$(C32@:(B $(C09J4B(B [$(C3*(B [^" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C $(C9Y>FF.(B] [-E $(CFD@O" +#~ "(B] [-H $(CG|=D(B]\n" +#~ " [-M $(C8^=CAv(B] [-R [$(C;g?k@Z(B][:.][$(C1W7l(B]] [-I [[$(C;g?k@Z" +#~ "(B@]$(CH#=:F.(B:]$(C>FD+@L:j(B]\n" +#~ " [-F [[$(C;g?k@Z(B@]$(CH#=:F.(B:]$(C>FD+@L:j(B] [--file=[[$(C;g?k@Z" +#~ "(B@]$(CH#=:F.(B:]$(C>FD+@L:j(B]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=$(C:m70(B] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=$(C9Y@LF.(B] [--pattern-file=$(CFD@O(B] [--format=$(CG|" +#~ "=D(B]\n" +#~ " [--owner=[$(C;g?k@Z(B][:.][$(C1W7l(B]] [--no-preserve-owner] [--" +#~ "message=$(C8^=CAv(B]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [$(CFPEO(B...] [< $(C>FD+@L:j(B]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f $(C>FD+@L:j(B] [-s $(C4kC<90(B]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=$(C4kC<90(B] [$(CFPEO(B...] [< $(C>FD+@L:j(B]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "$(C5e6s@L:j(B $(C;sEB(B ($(CCVGO@'(B $(C:qF.(B) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "$(C:N@{@}GQ(B $(CA$7DJ4B(B \\{" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr "$(CB&@L(B $(C8BAv(B $(C>J4B(B )$(C3*(B \\)" + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "$(C:N@{@}GQ(B $(C<1G`(B $(CA$1T=D(B" + +#~ msgid "null regexp" +#~ msgstr "$(C3N(B $(CA$1T=D(B" + +#~ msgid "%s already exists; not created" +#~ msgstr "" +#~ "%s$(C@L(B($(C0!(B) $(C@L9L(B $(CA8@gGO9G7N(B $(C;}<:GOAv(B $(C>J>R=@4O4Y(B" + +#~ msgid "Invalid back reference" +#~ msgstr "$(C:N@{@}GQ(B $(CHD9f(B $(CB|A6(B" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "$(C;g?k9}(B: %s [-cdnv] [-f $(C>FD+@L:j(B] [-s $(C4kC<90(B] [--" +#~ "nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=$(C4kC<90(B] [$(CFPEO(B...] [< $(C>FD+@L:j(B]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "$(CB&@L(B $(C8BAv(B $(C>J4B(B ($(C3*(B \\(" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio $(C9v@|(B %s\n" + +#~ msgid "invalid" +#~ msgstr "$(C:N@{@}(B" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax $(C9v@|(B %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "\\{\\}$(C@G(B $(C3;?k@L(B $(C:N@{@}GU4O4Y(B" + +#~ msgid "Invalid range end" +#~ msgstr "$(C:N@{@}GQ(B, $(C9|@'@G(B $(C3!(B" + +#~ msgid "sense key error = %d\n" +#~ msgstr "$(C9fGbE0(B $(C?@7y(B = %d\n" + +#~ msgid "Trailing backslash" +#~ msgstr "$(C2?8.?!(B $(C:Y@:(B $(C9i==7!=,(B" + +#~ msgid "can not omit both user and group" +#~ msgstr "" +#~ "$(C;g?k@Z?M(B $(C1W7l(B $(C5Q(B $(C4Y8&(B $(C;}7+GR(B $(Cx=@4O4Y(B" + +#~ msgid "Invalid regular expression" +#~ msgstr "$(C:N@{@}GQ(B $(CA$1T=D(B" + +#~ msgid "No previous regular expression" +#~ msgstr "$(C@L@|(B $(CA$1T=D@L(B $(C>x=@4O4Y(B" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f $(C>FD+@L:j(B] [-s $(C4kC<90(B]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=$(C4kC<90(B] [$(CFPEO(B...] [< $(C>FD+@L:j(B]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "$(C5e6s@L:j(B $(C;sEB(B ($(CCV;s@'(B $(C:qF.(B) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "$(CFPEO@;(B $(CDDFD@OGO4x(B $(CA_(B %s" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "$(C:N@{@}GQ(B $(CA$1T=D(B $(Cn(B `%c'" diff --git a/po/nl.gmo b/po/nl.gmo new file mode 100644 index 0000000000000000000000000000000000000000..b42a25616f707af7ac5a95899fa4794b6b4a39a8 GIT binary patch literal 20939 zcmcJW50G6~ec!JW+nBWh+Yo5Lm;<(0$==iK|=u2zx-lQ%m1y?@R*_jk_u{Xa*4cjqCyMrgui^gBZ;7Js2d}*~irxa=4t^gv3sNOI4NieA@Xg>)g0BF71yujP z3GM~I0lo?RzE?-l>%sd#^>Y&Z8{jI~1m6q37W~iP?ciU58{q39<{|LMz`McU25aEA zK-IsC&P3;Iz%$?k_XF^a;B(+E@YllgZ-Q$7Y8pFm7JMtX0`ke|nSh@HAwBvMD7s$+ znUd%~f^Pu-0;H?x6|eK-yCdKnIM4G2sPX??z^{Xos?VSw1s?=8&JTh2gU^E>0RIsD zAlPJ3N5DS=HGlU&gw|mR90NDNaqxZMZt!#9%fNpJioX8a)M2Tn1$*Me^k_!xLS_h-O&f-9iD^Q+)} z;C}(Hu`^{-oM8A_1O!G{>MPQe+Cp?pAPq5 z2KD`~fivK5gId>{V9p1?d%(X5w!vxec~I-~pFr{PElln{@E~{y?1OiJUjfz6*Fly% zx|WCf?i)a@<38|h;JZQb-7kO|_aA|D9o=xJr~58Ybe#p&{u7|+eF5ZO^h^8^9lsB1 zo^OI_#YYc=;`hC?^ zhryo(8CrB7i@pKA15|&%1)c@3he^cuO%N82HUfSORJ-RveeY|a`uzh?>vO|he*NAE z!dlS-py*fzHU17L`hN(#7yKe9KKMq!zXYXEUO}fe-ykdz?E_y9zCGX>@O!yWK+R(c z-UNOOybt^&n1KHl6rK0;QT6*MDEWH_sQR0r#`%6w{r?0gdVd;x75J5K|20tb{4sbf z_c z03u4!pM#?Fbq{)dd;nDYdcZaC2JSxsioR#TTfr}bPlCSz9su9UpVxy;Q2o9a)ck)2 zl%BekMb$bT0<}IpP~UwXMC7A?4I;wP{{&wK-UgB4*E<950oS>o1l9hhK#lL;fOYVe zhmj5V?KG%){o<_Wx8DQlGWyeSzlTO|;{G8}>-8ka5Ta+mSAxF|YJ9&3YX1KO6yIMv zhb{+i1Z~~Hhq?a{NY~MCf>e#h4*BsO2Vw2#y`bp*c~I@Y35u@|K(zSg9H{R;3yKeZ z29#d?3aEAdQ;;D>cOLfostKyykAfQ4uYlr`2FA;9`*0<1J!>Fz6< zw}G~v;9Ge9B#7um?*mzq=qsT5`8Fu}Z$07Xdlz^c_xFOkz_)|105?JD&kum#3w|7| zfu8_x0)GQUWTM{%o8Zk0e%%J3+I`>kjo--tqUGY2Wa?5X>JJI_g z%7F4Q$`4TVizz>9SHnNzMM$@~*VBaZk0_8^{WLD=yq^hATHq6u>%)Bm)Ea%7BH8*R zWgq45P@bn~oX#QV}0hbW(+ zJWF{E`Q4`VM(*u6T zJQ)9-;QG37{|~_>N=A`v|6R%yrB1nzatlR2$@7;evy?XF-INk%7c_2qeu^p{(d&x90_K#H{)J1RQ0??;j>>BVh# zaDk4_*%Ql;&rrF)mh(2*NPJgmr`t{$B(vI! zv;KJqR}aVQi*t|AWcJ|vvH9i4A>SRIUp`S^T5^XM7Tv5nIlH(#KX>Zb?4mn)YVqX4 zQhn07C8mdYC`WLK$z8Se=_Rh2^y9Q$_#r>ef)>!$Zo0L2BVl11NxA`Lv1{aA(RGDI z(^unmp0#X{)fCRSbk${ff5L6{Qh21FTR)dtN}Ip=tT8#^?%T(L$Ju(DSzqe2^z?B! zUG1;A!|gopO}K-3(a*C9cYM}O?ccX=s0CHiK3e{Qn+(9Z6{l*G*hOhpZCt|DfF!~PYld=q+S}m z1g>gMyDZtHBWApaJMeWYDH+WrPa`Z*YX!oKkUpXcE$OQ##4=^de5XZZKxN&Dw1S} z1{e3Vn8Zz&^m@z&qO)=yZrD}87i&x}{1!J^713v}jJB(4p}CxPr{kVhx1u}D%J#?G zXs%vg)fcyZ@T!^yVtYB0kZ0}lHg05W%kWQM^0jZ?SW6n~#h?==b@$ZMyV_4rlwyod zvIl#N%+)kOv^Ucx@*`F%2CJ)SBTcftlR`j}dN%#OXK}pC#IpT7cam!B1XY)`5D2e6 zU9IMJH6&KkXvU4W4OdMeqG#a4LVTayQwNu6;X{l zD`{(x4@`Ea%g&!tN4?|+21p@wF4ae^b`>A2opx7W`;rvyMBM0X^*a4VJIBziqJWd8 z%^=UxywOM7Y*JSp$P8De}uW@+8fqCbB_iCF$As2HARs zb}${|`scgSaMRdoG+W-v(hI1xYBjWUet~v;Z!)oO7UYB7_AtRWg0OPA#=abpcr z;=g1}MTHhmGPj$0u69@ovbGSuSL~suEU$H0-K4jX)J%uT+YsM+ODj%>k!$`P^)FZF zqP`-&DCec@%LFiV=ry+yR7;-j%MwJhOm@+i36xxD1ZGI&&7_(1JQ@qbkqz(!hSnp^ zioP@+&3Kn=vS3Lx>t_gM%=gU%Xt}}+O-8e$Q^hP{!s7OXcNeguX}|DN*~l|&cUEAV z5zb;uyCAk&0>rYSq3GkANr|UfchH}73+4hL%%_&>i%`>ak1Q-Ldz-g<-i$OopsIPZ zhNZO+GwzJ3qh}jcFX>2u1@ffKpRuUaNwlH_Jwlx1l zJvx|+Vdrf=;Xk}+FC>~!Q3HyWP;cRq_0+#roLe}4eD=hlDEJ1+(@8^4cvur$=XSe% zXG#Q}FbCW8^0vH98A*q4+il0^C*9nj*Fy<2xWmV0k7&yB%+`23<6?ZmjR#d?*C_At zNq5}O2i1&|(8P_#fJs6iCZjp*xi|xfkjxa2#S3YH-~cxK7a^f^r9zW-a0JR1DUCOA z?onPz(q!60Jp}}%X4#GAGtSgRmJ_rmIz+2gO4dl6JR7e#O>-6m1LoHnqk9s~qo>>R zuA8UWMJOGSAJx{J>ATXs#h%INP;RUh95KBa`djdT9$439#V$6MetGN_u^7eNR0(ny z-YhFBr0RNwS)50NI}UBQnm$dnPL~zQPz0;Jyib)2nt3MqR`6b0PVbdLM4&DmYrM*o>>7r(KhaSW-f!S$b zF?lU_4;mT1(wT?K3TLg$9oBrOPEvQ~!L1FiNJ}#*m=z1WYo(AXME6v6nWi1ykJ8Fq zNfE?yRC}Zc3WY`3RH1*>Uqb_-z`AC5qj?`I6Wy=KY3dt~v%Xp%69r8ZOkl3>rerJW z;US%xKV(yXWd0Ccc;&7S2YofoLrgdZo`+~Y^n@H^3CuVWl8Ul~41qE&5pbpcrILqT_Pe;vh8&+ocCAHLNs&Brursm#3YDw~yMz^JYIjqZ#YDh2b=p=S;nS6^yYIY@es6BJoBVhel?ipK656q!;vfRkSVMu zSV3F&2NtM4HOY$dD(Q4der{jZ%herO)o5um?z$B@*lQ@#&AivN_3{_e7IH)E(eOR% zrO}c>jwfB6WC9uxW1;t&%xPzdLw-dJ)2o5R@>^D)8i^)>PA#BlTU3zFF|yvrBXH z^CaQRpx5H8P!|m--BCL+d%Ql{TjhqDN|Unj{^(yzK>L{YIIy(d5i1vbMD?C7eLzWc z?B*8d#Lo&N!?4(Ukf~;3*%2|Gq0ab_K}-V%ZmOCzb4!vn`U6Dle5G249CzB1>0Tk3 zS53MYFDe8R=qmHFwUJVE;~wkd8C6;S&VXRv3n&hP5A$ky+ARZLHUyS?=N-xxpGS-_ zu37fC=Bs&$?c{`H3NJKRR2(kw843H@Gt-l2&zPv6jn3GkhtDdtFnzXK(CEyLPU6|f zG`!D@TlNSpQ0yL$go!I{_5>7x@%2^)5zQ#1hOh%RzwMmR$F+Jn=9HOGVy1Ek%eso- zBsEAoZd~Y~6R)EX%79cu9xq=>-ILo1`BrJHVKcElZe1 zPuL&N72#6M5E)N6FuPu`^EXb1Ou+hPUY`0r#tPOBV@LpT)!4*AvmF-*A8PTPFUnW(I0~GLn+9b?Qvb}x-eKS3GA#L#l?L!^n=neLaH)9guJlr7t z#Up*_5}V`~a#R6H4cAKSBtj$MW9(j`j%awv-D`pj^vQZMz)80&m@G{OY!Zi^VL-%D)8e##n)vY01Mkw?})G`7ET-@*IAp}ktT3)NKFp#=5@N#M5F z3nvL?X9`5vWA(+O3kxR?&dx4AQYXKH5FV*7%{?-IblL77Ti|#?y?(+Ste>2nJ$A?) zTBskJ)cBuZNSB{;tq}UcmTTl>!ol<$^D#PlhN--f&EC55rdM82Q2?hi1Th5zTT50D zs2NfnjWxF4>7RA*6UU6AxGtpUI9p)Sa}KAPv1@JB&!t!2A6(e+CW{2=yNYOB0Wwuu;w$+P+L2=g zXLdK78U_D2h zw~}C*k(_ByQY+ca@rSH_=C?f$6Mn;AZdb9J=!oPl;~K2@>1f&=g(Pey0kzRn$+QWX z(dz3Yl63L+4%L(dv@;K60d*0nQ=6Z#A;1bJ&QF5eANhb@K`;~LhpILTP_J0KB;CF; zE+^3Ty*&dl(C>%@b$TpGid76O?#nq_UOFQ;ot{Idu~(Q}C@CL3Lvgi@{Lb-drjwZ& zY?_8&z04wQt+`&#?oQ*@7`9e#eU?9bozHX9md zt_Z^M2bfW5-oWoGk~KVPShEuv5D@v}864A~H-y1b+-$55&u3ij729`-8~5ikydWFr zmPrO;q{MIjEAg$GUdfoSp=g@8dui*U8t8^ZyXI0wWmj7&`STes<%8jH##K~hCNE9i zPLz$#Re3t&Vue(m(b(~gHd!xzv9p%(D_t!ds>WONcol^lcfIjbG4Ak5bOfaIFwBAQhGm2WXU1B| zN^g*^2bLSJ9VT6{>c(pe<7^v$0f*a)nLYb%Tk;jikS-#! z69W#dB;WVB%0Om$$O9VuKseE<$Rmr|_|7<)bW+Z-qP1*fC9uE}W*OfTr;gRkEIVWu z2RcT#s3|A;63KHj@vkEd)U31FOcv0LWWr`;o^0gQ<N);c57?1ihWFY~%kVNm2q=T3hoR@xt8VSR(McS~_Yx z+SXoPrH!nkBrnwiSC{oRF?V!hXE<>Fu&@llrVb^xu45cWkJe8_Pvmmljk&Z0Dbg`+*^gw8nWRYKQnEY4_lGvboHl6} zQf#Jow%1JQvu#V_9hNq)$%rFMgf-A}9bBtk85j9Atsc7Fpv7i2ku^zcN}Mpf_7$&X|zsZcqNm6T&zN88!d zmwsntcP5?0M1%~_w>U<-wtU0S&(uEC|KEWLE1#xFa z=7flD#e!J|K;EHBuqGot565MDZaN&pQ93`FX;#hUu$uX?rUaOWz+Z|UyRm4F4%U~J zb&^O-6fHk~lEX?~#XGnU>Eo}035}OCC#}4M z7PFx>!1Rz5WM0}9%MNGS%u-aBM)kUx+I(R{!E2_&9x;hpy)%Z&kcGrl4O47x3;J~8(N69f$^7P8W zY@sD6PoWu2&^v_@FK3`dVNyYzLXJ+%Pgn6=n0srfT0awFyVcwe}0!YKc8q(Ac` zllHoqFSxQ&dscaiNR{m4z0P4Dc-Wjofggh4R_RT+N~uyW&Sv6DPPMSNVn69FW$pqS z`wU35L&75*HYw}vDz+K0V2O@d5*bFf5Vy*)nu=ngBn8_NKs?<{TCgyC02yCa68hry z{Ktq8It=S>^R#k2@-jbdqRt%fJ%t1GM{LmIhGP@wnuU&oqBneeF_d7G5pQHsF&VbZ zmJo`(_adcnacgW?$ncHo0^7T{jxd*ApP9legObS0=m_IQ%XQr2#d`hdlE~$>N=^Py znb)A3;c*p&JkWWGs=?X5t2(c8#TMcLh9Vv4Pit)X#1<#dru`)h+XSf$p*WtReFbeP zCtX&V1dFVeyt|#4B1DMQ3R0QG_W0zuZ))5?OV3|B)Vg3%2J`4Qb}br}Y9x26z!b%4 z(O)^#E!FbQX3CK;xL`&+An%xte6Uh1jcdxQc9P!e6Zke|OI50#^F2Oog3dX?ns02B zjJCKMmuVS$qL8yp3c=z>eCW;Q5Uyr*kfrp&hDTYpJQ+RAl6RXNso?|%IV(c>#Zl9G)z5jw3whodBkE4a32bY*{nhCdrJMR7|H)BKiuu@V^WtG6c5qa6jD?DJ8;-G< z4YLiWVVI?3EY%!VXIbheb(W=iULI%(fz#57+1cZqY4M)y*~rX?O@VES_;?go%v>t% zz3{*2bYcp-!Ltm6Ya&JOjM7f8)J)Y_p1<;6wUc2Xq}(|LPD&40m)ndI-`imiL*2^> zH{z@x1i;7b>S$!`O{XzWR>>O?)hI*$@{PEvj9b;YkusY0XFV7XMp_JP)N)&CpR${w z-cjCCi?>CWm+iJGq${@`X%LlqqsGqRYSU*_hYyRv%C<-0w%Ti9OUlwg@&JNRkDQOu z|5DTWm@-er%9FfWmkNl2Ab5wpx(kLe(#iA@kEdT=J>grmFc z06PbvMCe_dQ$PpQMh?zE5Q}7rq3IWub4F53yP8$RQjW)zlz2lKUB8JiqQ2N2W;+!9 z%qf})J4S=9YjVj!nhAfBhK;D0|CGJfwdZSH-c%p)(q4{wxEEnuK2i%GR7`O3PD(V= zCTL-fhS(l|>Dfdw$B0F%&p9OdwKf~&%1a|vixPYVAAeasEK)=+|A;_k=pC0!z2nQU zvcm&5TbK(&y-^!7R>etPoT|XF6t&^08}g9BPd0_&Q_SJu4ex?9iPuPnTK;+X(l;F5 zm!gN}U;=UN(NLB*(b*iC;8wDh4CG^;hAYanVmO(TtTI2;Fq=pIu|p0{` qk!?+Pm8Wy0)=3tT{xYK|VmYX?{Yzza_I)o=znVG7<0Odo<^DgIGLAj~ literal 0 HcmV?d00001 diff --git a/po/nl.po b/po/nl.po new file mode 100644 index 0000000..d9d9886 --- /dev/null +++ b/po/nl.po @@ -0,0 +1,977 @@ +# Translation of cpio-2.7 to Dutch. +# Copyright (C) 1996, 2007 Free Software Foundation, Inc. +# Erick Branderhorst , 1996. +# Benno Schulenberg , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.7\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2007-02-08 14:28+0100\n" +"Last-Translator: Benno Schulenberg \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "Waarschuwing: %ld byte met rommel overgeslagen" +msgstr[1] "Waarschuwing: %ld bytes met rommel overgeslagen" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "hernoemen van %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: bestandsnaam is te lang" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: onjuiste controlesom (0x%lx, zou 0x%lx moeten zijn)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s is niet aangemaakt: nieuwere of even oude versie bestaat al" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "Kan huidige %s niet verwijderen" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "Kan geen harde koppeling maken van %s naar %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "Kan de halfwoorden in %s niet omwisselen: oneven aantal halfwoorden" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "Kan de bytes in %s niet omwisselen: oneven aantal bytes" + +#: src/copyin.c:642 +#, c-format +msgid "%s is not a directory" +msgstr "'%s' is geen map" + +#: src/copyin.c:755 +#, c-format +msgid "%s: Cannot symlink to %s" +msgstr "Kan geen symbolische koppeling maken van %s naar %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "Onbekend bestandstype: %s" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "Onjuist getal %.*s" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "Archiefwaarde %.*s valt buiten bereik" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "Voortijdig einde van archief" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "Waarschuwing: archiefkop gebruikt omgekeerde byte-volgorde" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "standaardinvoer is gesloten" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d blok\n" +msgstr[1] "%d blokken\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "Kan controlesom van %s niet lezen" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "%s: veldgrootte is te klein voor opslaan van %s" + +#: src/copyout.c:308 +#, c-format +msgid "%s: truncating %s" +msgstr "%s: %s wordt afgekapt" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +msgid "inode number" +msgstr "inode-nummer" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "bestandsmodus" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "UID" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "GID" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "aantal koppelingen" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "wijzigingstijd" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "bestandsgrootte" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "apparaat-hoofdnummer" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "apparaat-subnummer" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "rdev-hoofdnummer" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "rdev-subnummer" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "naamlengte" + +#: src/copyout.c:403 +msgid "device number" +msgstr "apparaatnummer" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "rdev" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: inode-nummer wordt afgekapt" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "standaarduitvoer is gesloten" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "lege regel genegeerd" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s is niet gearchiveerd: geen gewoon bestand" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: symbolische koppeling is te lang" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s is gekoppeld aan %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"GNU 'cpio' kopieert bestanden naar of uit archieven.\n" +"\n" +"Voorbeelden:\n" +" # De bestanden genoemd in de namenlijst naar het archief kopiëren:\n" +" cpio -o < namenlijst [> archief]\n" +" # Alle bestanden uit het archief kopiëren:\n" +" cpio -i [< archief]\n" +" # De bestanden genoemd in de namenlijst naar de doelmap kopiëren:\n" +" cpio -p doelmap < namenlijst\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "%s is betekenisloos samen met %s" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "Werkingsmodus:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "een archief aanmaken ('copy-out'-modus)" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "bestanden extraheren ('copy-in'-modus)" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "'copy-pass'-modus" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "een inhoudsopgave van de invoer weergeven" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "Opties die in alle modi geldig zijn:" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[GEBRUIKER@]HOST:]BESTANDSNAAM" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"te gebruiken bestandsnaam voor in- of uitvoer; optioneel op andere HOST en " +"van andere GEBRUIKER" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "het archiefbestand is lokaal, ook als de naam dubbele punten bevat" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "TYPE" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "dit archieftype gebruiken" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "de I/O-blokgrootte op 5120 bytes instellen" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "BLOKKEN" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "de I/O-blokgrootte op BLOKKEN*512 bytes instellen" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "oud, overdraagbaar archieftype gebruiken (ASCII)" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "een punt weergeven voor elk verwerkt bestand" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "AANTAL" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "de I/O-blokgrootte op dit aantal bytes instellen" + +#: src/main.c:119 +msgid "STRING" +msgstr "TEKENREEKS" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" +"deze tekenreeks weergeven wanneer het einde van een reservekopie-volumen " +"bereikt wordt" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" +"alleen de bestanden kopiëren die met geen enkele van de gegeven patronen " +"overeenkomen" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "UID's en GID's numeriek weergeven in uitgebreide inhoudsopgave" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "OPDRACHT" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "deze opdracht gebruiken in plaats van 'rsh'" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "niet het aantal gekopieerde blokken weergeven" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "namen van verwerkte bestanden weergeven" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "uitgebreide debuginformatie weergeven" + +#: src/main.c:137 +msgid "FLAG" +msgstr "VLAG" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"waarschuwingenweergave; VLAG kan 'none' (geen), 'truncate' (afkappingen), of " +"'all' (alle) zijn" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Opties die alleen geldig zijn in 'copy-in'-modus:" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "BESTAND" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "extra bestandsnaampatronen uit dit bestand lezen" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "alleen de controlesommen verifiëren; archief niet uitpakken" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "bestanden interactief hernoemen" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" +"zowel de halfwoorden in woorden als de bytes in halfwoorden omwisselen; " +"hetzelfde als '-sS'" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "de bytes in elk halfwoord omwisselen" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "de halfwoorden in elk vier-bytes woord omwisselen" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "bestanden naar standaaruitvoer uitpakken" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Opties die alleen geldig zijn in 'copy-out'-modus:" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "aan een bestaand archief toevoegen" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"te gebruiken bestandsnaam voor uitvoer; optioneel op een andere HOST en van " +"een andere GEBRUIKER" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Opties die alleen geldig zijn in 'copy-pass'-modus:" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "bestanden koppelen in plaats van kopiëren, indien mogelijk " + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "Opties die alleen geldig zijn in 'copy-in'- en 'copy-out'-modus:" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "padnaamelementen niet uit bestandsnamen verwijderen" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "alle bestanden relatief ten opzichte van huidige map aanmaken" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "Opties die alleen geldig zijn in 'copy-out'- en 'copy-pass'-modus:" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" +"lijst van bestandsnamen wordt afgesloten met NUL-teken in plaats van " +"regeleinde-teken" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"te gebruiken bestandsnaam voor invoer; optioneel op een andere HOST en van " +"een andere GEBRUIKER" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"symbolische koppelingen volgen; deze koppelingen zelf niet kopiëren maar de " +"bestanden waar ze naar wijzen" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[GEBRUIKER][:.][GROEP]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" +"de eigenaar van alle aangemaakte bestanden instellen op deze gebruiker en/of " +"groep" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "de toegangstijdsstempels van bestanden herstellen na het lezen" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "Opties die alleen geldig zijn in 'copy-in'- en 'copy-pass'-modus:" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" +"wijzigingstijdsstempels van aangemaakte bestanden instellen op waarden uit " +"archief" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "waar nodig mappen aanmaken" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "de eigenaar van bestaande bestanden niet wijzigen" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "alle bestanden onvoorwaardelijk vervangen" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" +"bestanden als luchtige bestanden aanmaken indien ze grote blokken met nullen " +"bevatten " + +#: src/main.c:228 +msgid "Informative options:" +msgstr "Informatieve opties:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "deze hulptekst tonen" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "een korte gebruikssamenvatting tonen" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "licentie tonen" + +#: src/main.c:233 +msgid "Print program version" +msgstr "programmaversie tonen" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "dit aantal seconden pauzeren (standaard 3600)" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +" GNU 'cpio' is vrije software; u mag het verder verspreiden en/of\n" +" wijzigen onder de voorwaarden van de GNU General Public License zoals\n" +" gepubliceerd door de Free Software Foundation, naar keuze ofwel onder\n" +" versie 2 ofwel onder een nieuwere versie van die licentie.\n" +"\n" +" Dit programma wordt uitgegeven in de hoop dat het nuttig is,\n" +" maar ZONDER ENIGE GARANTIE; zelfs zonder de impliciete garantie\n" +" van VERKOOPBAARHEID of GESCHIKTHEID VOOR EEN BEPAALD DOEL.\n" +" Zie de GNU General Public License voor meer details.\n" +"\n" +" Bij dit programma hoort u een kopie van de GNU General Public License\n" +" ontvangen te hebben; mocht dit niet het geval zijn, schrijf dan naar\n" +" Free Software Foundation, Inc., 51 Franklin Street, fifth floor,\n" +" Boston, MA 02110-1301, USA.\n" +"\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "Ongeldige blokgrootte" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "Archieftype is meerdere malen opgegeven" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"Ongeldig archieftype '%s';\n" +"geldige archieftypes zijn: crc, newc, odc, bin, ustar, tar, hpodc, hpbin" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "Werkingsmodus is al bepaald" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "Opties '--owner' en '--no-preserve-owner' gaan niet samen" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "Opties '--owner' en '--no-preserve-owner' gaan niet samen" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "Ongeldige waarde bij optie '--warning': %s" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[doelmap]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"U dient één van de opties '-i', '-o', '-p' of '-t' op te geven.\n" +"Probeer '%s --help' of '%s --usage' voor meer informatie.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "Zowel '-F' als '-I' werd opgegeven" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "Te veel argumenten" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"Optie '--append' werd opgegeven maar geen bestandsnaam;\n" +"gebruik optie '-F' of '-O'" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "Zowel '-F' als '-O' werd opgegeven" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "Te veel argumenten" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "Archieftype is niet gespecificeerd; gebruik de optie '--format'" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" +"Optie '-F' kan alleen samen met '--create' of '--extract' gebruikt worden" + +#: src/main.c:725 +#, c-format +msgid "Cannot open %s" +msgstr "Kan %s niet openen" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "fout bij sluiten van archief" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "kan map '%s' niet aanmaken" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "'%s' bestaat al maar is geen map" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "'%s' is geen byte-apparaat" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "%s: rmtioctl() is mislukt" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Gebruik: %s [-V] [-f apparaat] [--file=apparaat] [--rsh-command=opdracht]\n" +" [--help] [--version] actie [aantal]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "geen band-apparaat beschikbaar" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "%s: rmtopen() is mislukt" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "%s: rmtclose() is mislukt" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "Ongeldige kop: onjuiste controlesom" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "ongeldige gebruiker" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "kan de login-groep bij numeriek UID niet bepalen" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "ongeldige groep" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "fout bij schrijven" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "fout bij lezen" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "Voortijdig einde van bestand" + +#: src/util.c:493 src/util.c:543 +#, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Bestand %s is %s byte gekrompen; opgevuld met een nul" +msgstr[1] "Bestand %s is %s bytes gekrompen; opgevuld met nullen" + +#: src/util.c:499 src/util.c:549 +#, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Leesfout bij byte %lld in bestand %s; opgevuld met nullen" + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "Bestand %s is gegroeid; %ld nieuwe bytes niet gekopieerd" +msgstr[1] "Bestand %s is gegroeid; %ld nieuwe bytes niet gekopieerd" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "Bestand %s is veranderd terwijl het gekopieerd werd" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "onvoldoende virtueel geheugen" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "kan geen 'seek' doen op de uitvoer" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Einde van band gevonden. Laad de volgende band en druk op Enter. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "Einde van band gevonden. Typ apparaat/bestandsnaam om door te gaan.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "Typ apparaat/bestandsnaam om door te gaan.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "*Interne fout*: band-descriptor is veranderd van %d naar %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: optie '%s' is niet eenduidig\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: optie '--%s' staat geen argument toe\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: optie '%c%s' staat geen argument toe\n" + +# Als voorgaande groep maar dan met LF: +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: optie '%s' vereist een argument\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: onbekende optie '--%s'\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: onbekende optie '%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ongeldige optie -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ongeldige optie -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: optie vereist een argument -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: optie '-W %s' is niet eenduidig\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: optie '-W %s' staat geen argument toe\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: service is niet beschikbaar" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "standaardinvoer" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "standaarduitvoer" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "Kan gindse shell niet uitvoeren" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "%s: Functie %s() is mislukt" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "%s: Waarschuwing: functie %s() is mislukt" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "%s: Kan modus niet wijzigen naar %s" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "%s: Kan eigenaar niet wijzigen naar UID %lu, GID %lu" + +#: lib/paxerror.c:127 +#, c-format +msgid "%s: Cannot hard link to %s" +msgstr "Kan geen harde koppeling maken van %s naar %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: Leesfout bij byte %s, tijdens lezen van %lu byte" +msgstr[1] "%s: Leesfout bij byte %s, tijdens lezen van %lu bytes" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: Waarschuwing: leesfout bij byte %s, tijdens lezen van %lu byte" +msgstr[1] "%s: Waarschuwing: leesfout bij byte %s, tijdens lezen van %lu bytes" + +#: lib/paxerror.c:259 +#, c-format +msgid "%s: Cannot seek to %s" +msgstr "%s: Kan geen 'seek' doen naar %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "%s: Waarschuwing: kan geen 'seek' doen naar %s" + +#: lib/paxerror.c:284 +#, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "Kan geen symbolische koppeling maken van %s naar %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "%s: Slechts %lu van %lu byte geschreven" +msgstr[1] "%s: Slechts %lu van %lu bytes geschreven" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "Leidende '%s' wordt uit lidnamen weggelaten" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "Leidende '%s' wordt uit doelen van harde koppelingen weggelaten" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "Lege lidnaam wordt vervangen door '.'" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "Lege doelnaam van harde koppeling wordt vervangen door '.'" + +#~ msgid "error %d" +#~ msgstr "fout %d" + +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "%s: Leesfout bij byte %s, tijdens lezen van %lu byte" +#~ msgstr[1] "%s: Leesfout bij byte %s, tijdens lezen van %lu bytes" diff --git a/po/pl.gmo b/po/pl.gmo new file mode 100644 index 0000000000000000000000000000000000000000..f6c2bc2d86149144dd4a1c1f0dc73b42eaeed2d7 GIT binary patch literal 21430 zcmchfdypK*ecwkCMUf|wdQkF163Lcm5CD05xC8h+5EKuG19*7co$f)9fM9WMckXU( zAG6%q!E#r$Wce8?ksR5kV_Ozu%Ly&Xa%31X61x;3mFSOO`uFNz_wifrxbC@t&u>!ROZoa6gWv*Kdo%y= z8GUOI{L9w|!5H{Xe*fv)gW!9?>)sIr?+0%K-vv&9R0)oPqu?s|KJaJ3o50@&)&IW* zcYuEa-VVO&mLPaHcrU1a=D_a(SHKGRG4Q*18)UC2W|oXm4AK?RQp?KY`_WdPH-7y$lzIzp9LX3I0cICuY<58 z_^;r5zzZN<1vh=So8KKCC&6i+mqE?{*F3%qj;KD9J_tSpYMwt1-VeS2{wVk@@W;Rk zlR5zYFHrp31rb_@1#k#F32p^H4sHX#0KN(QT~PG>XYgk5&%hXbBM*0i38;3T1Gj@O zflq?}7gRq>ES~VAp!ohPpyqiF+y(wMXuwgJdmZ>ekB@=Z^ZPjXA#fSgIA_6o!T$kH zg10j1yI&UsAqZ)~Cz+i1{&{dO_*Ial4gMdf_wO`reRhDN|1nVSp9MwN^Zxf&K#l(* zxEuT(Q0w{@g!2J#7x*Ap1INJ^K&{Uof|BF6!`v}&FSrkEgLih2GVtK!}mG5?*c{F2~h2S4ivp#2Kg^I!#|?qzkuTNTM$~w z(IcSb{u7|+I0MduFM}Fyl!qGs1gQD^G$^_KI#>n&6NpF!lMp3(J_M@2kAj~7zX&q5 z;9eH}B=|U}{{91a0=ym}k=$26L^wF<@l&AMy#Q*w7eV#=O;GD|!(DFuZUqso-~mu{ zEP|SU9TfdP4Bi9&Iw(2#6OVrZ%AVXrr9aZvR;pyv4_p!)wAQ1t#H_*U?@{O=b*(ep>(b>N?aL*UnTuj@Hr3>3ce1CPv=2IAuue4 z>OBe?unVH{!Ow$V0RK6NXapgRRR0s;*TCNZ*TJU{9;yW21nDw(JH}1(ngS&U-w#TT zdLW__{3NJ#`zmO_KlIOE{{Xg~-@~BBISPvIkAa%^FL^u*ioTaY_4AkDP2lY)`}cq) zQ2f{rN`6jw`~mQT{QfMc`TwcMEf@#=J`PTRp9aJ)nPQDI;n22Bzd>8mM*a1HU!h+!Xhh4u9gIbR|SOcF2 z#fLXTjQCRm9|0c+Md#0fkQjUo6yN>=ybgTdBTnw_1SNOFpy=NPj)5K_z0+R&hB;mI}gtBduY<>>v8aQekUNNCin>umIP-&&FkCXyTKdiRPuNSsPXRu znM$w+l-+s;ghj!ZKv)p`Pyc@Fl(R=Gp!o7xkR=X&-{Z~u9iI+>8vi6{R1f@K@N3}X z;2(gR-`D}?S8Jf;?<=6@_bpKJdgG(cPwfHU%kPhaZvvkOwazbqqVM-X(R0gm5F7&! zf&3S|z&~2={{t?7?>*>#H^F=P{R<$f5&SMFe%yG7wO2jRfX{(jz%!ue`6l=o@NI`( zKVJfy{Qd(_{Y)Q07r`F{zZ?7`P;&p5p!&aM#_{D&Q16d`Tfqp_x_lBe;OD_@;EUjU zz;FBCH_tkL-w%p^O;G*(Dk%Q`8}M!5%b?`oe}m%N%?OF?>D}N>;2!V|;34pCaMnNn z2&naZ78D=;HTX_&H_CY?`was=)J-wb{c zd>yz*(K>#X@*5O=o}eW5o0Gl2@4riKv}XT+Ql~sl(Fayq+1mwbtp`6>NAmCw?YI6v$N36tZS1S3qWK?FU{mqAm2XRwU-nN{LCN;@{&yLyP@boVXP=>r zQGSr}0_8f&Cn(}m{yEJTt<%RTYm{H3oS@{NukhtJDYy6sTHBBK?;ikv%6}jB_#sgK zW!eAEL9#3P(dUztFHn9!KlprHYdh`pF1xkZ*BjtxEqm(Jiy%fo}KJTWSqD)X~lxHZCO-x|$Im!=H^tqez z^Ay4PlM9y!Os`{j{_dN;D;$cO4&g9 zl>D>Kmv>MOQc{ZS$KdB@`5~RYi?Txbe#*~KWDmZNa+Gq2a+30T%HN|jDZft9=kt{3 zDE~x1_}oG1P>xV;r|8q7{21jY^+O+H%z>FDQ*OqIiBq%EiXxLHEA39$igufBl9_VY zFs-N(r|nj}oV6npw@uin>_}Rso>bzM?ht+OENfJvmT9j=rX98FsYzDs5A}W^YDBHD zX6CZxT3j}V<8stUBNL{ksVC`LR58o8A2r`E8WubaW`9D*VLMJ5yG<1HzGY5Et(4zp zXFi7SaM&a*5wk69i}IF9nrgQla=WG$LRQ{%WJvV}C*Gf5#l#Iu`C8IsE^Bng>^gC+ zW|kw9rO`@O8&-3eVUA8OK03R!XeMT!Fh?im=O<j%W&!rVhkOQCVD5@tpH^flQ9F!lshjc>ENBXCwTf8_Pev?kIf_q0S!l{hQ*^z; zqG{BymNZuFBnuYqHt~vSB<*3-X~oD$JF)#-X(=uLrW@svVRP>o3m!JAHMqXeX6fl; zf4tIOGy7{v(i%2QhRu-)GrDtZY_v4CYjn&kEldmz1zV7tT2ij|zomRlCCT+D zY{ZS#T9l@a)Geuh1DTrcTG$H9l8Lk#m1CrHC9Xvqs#Idw(@t7lJ%zq1d}3m*BlS{l zMMza;+%%#N9l`N5tRvT}Q7&jEdK$&CBdb9rt2b?ZOF}DJ&1zvQA9&nMh7HxS0~Eg? zv_XgHnq}*zFOv=mmafH3(U-*)v!#{|n^pG(>ieBpicQ+BYd*zniuW+3VyAlft2Bx> zX>fT@^HEqaQL6Vp|DJNE)@Soi{qRVfsg}_}VouuSMl*n$a<%~ql`n87P(~{coH{cCK_3NIcnMQvPQLm zb+9(Zw7X4NxN&?nmMvLr#63(}u^L)Bw?Lb|x11gdN~N#~wYbSt-Vh6nr)wlEad{0_ z;zqJUMTJ$KG|V>YnbLk4$kMDIFWpX0jil6Mb)(kFsAO%Jq7BKd^R$v=1i9qiQU7Xn zF6%2`LM z8);h>k7m4!IxJWeOgIiph(q zmN0~B;KY7=e>(1QJ*&0jCZ@U)t+14p;ysox!6DJN-&ZJV{QJ7OlYRtqD{7cq@H z1os%PD5}7AUr!r?+_G%L@>$6gBXb6A5BAY&h0-WTMv;v(oYr!tYzAyxYX#krXd`;M z?V4s1;}@ZHKz~$QJkz+cz3KLmU|(WI%Lih5(~q~10X?u?=M|gySo-C$GsF@U8>UK; zo5*HfQCq5}Gni=?6|Nhs;Y$28)#^=Fq=6w=X(jby2&bLFR3lu*b629}Y;{%C#*LLE zm~wW^uY_%9y{0qE8<^*%aQh`~U`1g+oaP4mrw>mBl9qrS$&rc0V83F9Eh*s#t5KCn zZ~wgsU2`w>5dEq z+A}_>-SSpP3kzfgAJ)l)I<7nOo(>I7Jsq<1i_&qnO?Q|{WXo5V^|mHTUrN^R(1S$A z3p)+$p1hQphb$Sc((#A$3MXuro2>a}oy6w&LmL~uA}y6Dg)4UBUCNbITXaWN6ElAj{$Ft71D?%=na;xdu zk0ai}VeOUNI&W?&>e}BRC76^njnU2E2!0z97+5I?Ys$xYSQCA$yf+N;CczPfY+=nx zSmAYMmX7S5nh$2RX+Y?6xv|Ep;_MMlth~n5i(R`5wwhs^`4TP64vsEWYNf`7?~tZu z@-O38uco2pvn1R0dv12qYi(G#;aAmC!xUq_x~4X~gVdblSDM|1`uVi3HmeN{3Yx}) zIcx407U!pD4mdH83VP!dnv+QlNwtQG$ID^4nl;gbN*u}ov+C^cD!!A@ynp2VcBiJt zR^)IANg1sfsB^hycrRpQKHn9a2bW}H<%mGr{xQ9+w!(Uzp9tm^yUK1$ObHWn>B%ER z8C^-flqQw0^wF|HXKS{s#j{?*c6G_dzs7EqHBk>J(xx_lp6K$VhRH*MC$&Yh-40|U z*g!_)QLa+C9%<9#J>+~u#6vvLk4)G!C5?QVwJtrSk#o`nG;$N|STlr^PSL{^<%Xn` zqKy@;(?rp@eDukf-Kv|Fb5q)oq2{g+YYOZRBj+B34}>m->;z6|f(1{>^p05W81^F12{Y29i%_ES#CK0SYd>Kgfmvr_V$?Da@DmRsCQ)-(4sx zd|-ZdX)ajEma*3D%x+Yl9AQOy71f(0KQCR@tJNJ?)nK6$HqEjE>@^H&CuvpedbuyM z779b`qyBr=OS2_|9FCYNk_lKqoQY;oN*7$0s!%kwikG*S?CPx*iGJn$wH?bg5DjMA zJ+7PW8=Ea&V~DXxE~YN~oF`4vU`b9>uE-oOJ$8bBR(zPE?QP;1g;Y+OA0ce0^<%tah{S{I1r z3qD|akLEF;G&(es^OKTiZ6p1(ID3$*hOwN8Sec>D*1mvP3+Sb(Xi`aRlC0d$P_b@d zTKf`r)F#uNL9$Ub>0+WNznQ>R*(h5FDQPoou|7^vmF2HzZ04PU5+Jy3UMY#2`No$6 zfyGwWU~GwbBp6%8W%tv@YEEP830pF4FEm+993k*=Df@}z<0B`ITU9?19Jh}iIib|T z_=#dcgX5b9i6;VU;az6jW{;2p?cKwHZQ^o`GXd?u7=5(?5tYEFhVTQHzqN#|k6CRc zxKlWx#7q$o=5@7$lh&Z^gmJ!udRWCE!2RNlCY)QpA1GYYonZ${Vc8z;x+>OMx~a~!l64O6O4F4R=3U3dESe6vcaGdQ^5EzY0U{2n zbRta$VzQ=jiDDrP2FJqxYM! zd&bA^yL)uk=qMFS^Mr*Os9*2Cl8!5Pnz0ARcinUMC@qH$hiSXCNZK$ZQI;S{2g7Q% z%pvD$miEj;Pc0`&y7ox3R$;&2$etDv57Vfznh^n%7Nf8}Zss@{NY~6mq^)f?8j~D! zz0|BdA`h01q?~@2BNSsb8firBhlh?#ADQYiVr*n|XwvPfON-<@P)5S~9fZs=r|imY z6C3ZDUYIRC@W8zfmUi|lYeaHwr75Cm1;*p%fzoo^9-6CV9PpR+<0i0lji&vX?%B25 zxUYM*HTLWoGaoRchSyuhMjzg@)7*Kd{rb?Jd-Qdi9*;gWHfo-E#y(e_(e1Puqs`9k zyN3eKo{Ka4b@C5#(Av$AI3wp>PdeTDZg#b28=+Z6!IK{EJ7J|4o-^@|8f->2yDM>( zhv!ITuvbuy6zS4tYcA=ey{Np_h}PW=h4OmrZ!GlmOe1gG{IGqyI!o+b2KBAl%~mh! zUGXXd=>o%vamolghYgesb7W>Z-Q}c}*|YIV(n)HzpNn5@#L+sGtzU9!!7^ZAjs%P( zMVM_I#lz+->UCbv|qSH{-VYa#uuhhPx>rB54|K+TxPx1f89@ z!KyBI&oK*G{&J6PEte9)o_g<*;!~2qq*R5};P-W|*ScwfR z?GUW^R8PALX4vnlCuW@{`^!cKj&(WeP1_PY#RKR?XcxYdHZPurmQ*a2_=fpNzJ0IN z%ZLPMF4`@9y-v4!T1>CSRYwD-_uWo%n(G-hku1=S8VTZaGq_vjt&1!W{hiA$<@U9ULhMQl7==Yu3=~`KFT!F_qTLydIte%}$gqhi_ z0dq#|&Jh=JXJRvY{W4fN^OM6nk7`IQi7{t|2c1}=r*JX%RLIdcw4l3v77htnq6 z#&G>q*@}G6O#%7$(ul@aPG_sqqFx8fgZ4UR)7st+Vc4WuUJuzl7S}^Ob(cMN5B%K_ zI*@AfPaK^iJaiXBGFd#`{ZN-rDg$V(2bI^ON+Yp0un}HX31f#WUZEFvHRRQd=kJAF zL)BNJ?oz@A*;L#M(Ri1czT$?+mEPK8-c4WnMWff;%=0xr5yhuk7H4ISb?U`BN3CrA zyxTjQxYRk{J1wJb4LD54PjD!Qlh;m*@Gc8t;4uF1|~rX?M*E|Mq;Da~$vgG4=A`BD%-GtQ^w{!z(G z?~!b%nQW}N>1~orx^?PabncR)j<(`b$zlAcQzARFiyiM3anu)FY$B&E=RLD@*!04B z%mzU|ml%>AKpb;ceEO92|60}DEuSjO_1H}@Tp9`H;9Bw14M7|c))e)*z;4||I#!!| zVTWZx!#i2El{BkyFn4(RP`^Fnz&I{N76dT~d#wbz7#HI3vLsYzSr8o?kfmAr@)L`P zW{=L$PweiPB-IvUVq*NtYApy)8gZ4A4|~~!D8j}xoCLGxy^1;-nAWvY)&0&;HDk5b zimXdL42WyTv|HU}D%evfCHjM-7))4^D4a5mCqzga(uXWza5QYSWuo&nbvI3{nMqMM zEd~5cvtWMq*pcap`4UC`MOvvYh~rNq)s&E){1RT(m97z?s%?wn%!p7&8HgL_Ntj%i=u&Cxea75aBF1- zQeE)u7GNMUcHP<tBr7*mMFJP;A+4WWJ^Kz#X?SmX|(nid|<&)(D5a@n(#u%A}vX zVwLe)XtUE1wzflaY-1%tU3V>Jp_oLmcrF-FR;Fh=$?%1&W=Vsqzg*wg)Aw)53{=Ul z$zWLBJsBri1LBd>lhunp`j=#iX0L&?+?bRq9NTmI8HZMk(9Eq#{<6!3nLgP=NU^h$ z)^=4}7qMK#0RtKnqn%dyHdbxRZMLIo%GR-&)RS^IIEo}JMf5XIrz^ zZC6}xY_aW}Axfjk7s3t2YyHo9)Zsn;?o<+FWX92}mWJhpcN4Jr(8rz?9Ui|b}$^BK5v z5?IzNAcMAR%d1|}Dl^$5F1e_*E*8X-LN%MXz!kChXDehvT!g@FpjWD|iqe7nMoU~= z!FlbC6_Q+QYkU_nP((DZ*xbj(8$zMD@tT@3^lNJ8rg>D(&3eCIp7_S(5`SyOau9sP zr?~olz8q)RxeIK7$+c$O@h0t(5J6Q#lq+wj`#2I?t(}xi4$mja>`xiLf$Co8*liRl zb}A2-2ddf2Ir4xQMz<4?#t&5R$zh+V%z{~)7s47UP+!6XlF?PFPpay~&x^Bm^m^Lg zOyQ-G){b?p3hA|XvR)s?gec0!tP`PTSA=cR%^m!^=7%%f%tbAwndPFijL=K;h$T;I z^X{F0Cmje^TomIY6s0p=3XPipuh>s+P9ky<%GWazj7!_6xJ@f1y)4Xwl}dWJcty!G z%LRGBB0iBMSgyi{OtvLBhO*^>7g|eX(~!yW&AkVfeaVdib-LCnS&4v>EZBF2_)h{E zcqwGYZSBBBIh$q7W{bauVv~>|Dm&N%W3k-DA0iM8%d4pFHw7QIn}Yln(5r53P1z}9 z&EQKm?%6o%U{-a2)m{%IZn>4jzS~_N7Y-1G{+@8cxC592^GkCt1#?NI&jH;H$|KpP z4iDG8@D{>T9H$hr!|E%oOgQ(dda_c?@;V3A3tPAhRQclR6z74Ir>9wVX0aYt(MZL8 z_OY$t-rz-;CL7+0@--5Ss=Ysy_gS>@Hr_XtXjF8F3}~=2JaJ*LF7+Hk=(1^C{hydxO2L? zQKVdg_r($mcb{mfh~n}JMFJq-drlOBVQ&|?Zjc=QaMD>~*=v2z?-*UWAJ2QX@sTr~ zxv0_2lhL_ab0kRerjBYTsRUwMr7SFh zjq^;aM+QeGbWuBFI$=8J>^}Y!uE2+Ux_mS;)Ia;dQIL{zSC8bB+;4yPNIme^U+2pk z;$M6Fs7N&BcaWCmChQ%g;zfQFNh=;4_Yrv!bNl;8`2kly4{4JvzP664WQ`O%T3=;v zA;~+0f!JG5R@nuST&Ob9)mFw0Z67{c!#BOJl=bU*yLC>Ahc6~G;=0g5b#b{pGK+?}b-Q9qUm;j^fxEr6HL#xyn#nTZ1R?!pZ!UYV ztl$Mnv8Q8D(5+e#&V_s6a??`k4l^*_Y^d1>he3Xzmf}zzdE+iSIqLEhx+Sd>bsFbM7U@8gn@-hM*WPrpTXdhB;mnouaG1s2 zFxImY*fW&N(t}ngxJ;36CY+&T+mqNUPb7J{^TZv*3jc8HiEvG3lD}xty{9}OkMQcx zDyp2l;BRWx7)`G6*ZRt8Y|jVInPB6QfYSgg-C_Q^5o+C{>bTLXjptC31{W$2!(cFc zwl}cLGY~!%jJ83ll_9A+F1c_#q0M91fHLr#H?Kq&RG*Bf?lv$Xs}jn46pOz3YZn5z zHL{nbHi(~na*5#CXLcE#3TAVy-J|mj*5#_ zwyH}=*{VtoUbU{xw{P0s-ojcY8^q21y7n|It-X?ki3rHo>7X`Wvw}yuRghFVt&2LV zN2qj#fP-qU)4mmX1T5cqU7gfjEFu$g2IEkU^KLJ%(0#=k#8ti%%UOHum<9hIFKi, 1996. +# Jakub Bogusz , 2005-2006. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.6.90\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2006-10-12 19:34+0200\n" +"Last-Translator: Jakub Bogusz \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "uwaga: pominiêto %ld bajt ¶mieci" +msgstr[1] "uwaga: pominiêto %ld bajty ¶mieci" +msgstr[2] "uwaga: pominiêto %ld bajtów ¶mieci" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "przemianowanie %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: za d³uga nazwa pliku" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: b³êdna suma kontrolna (0x%lx, powinno byæ 0x%lx)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s nie zosta³ stworzony: istnieje nowsza lub wspó³czesna wersja" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "nie mogê usun±æ obecnego %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "nie mogê dowi±zaæ %s do %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "nie mogê zamieniæ pó³s³ów z %s: nieparzysta liczba pó³s³ów" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "nie mogê zamieniæ bajtów z %s: nieparzysta liczba bajtów" + +#: src/copyin.c:642 +#, c-format +msgid "%s is not a directory" +msgstr "%s nie jest katalogiem" + +#: src/copyin.c:755 +#, c-format +msgid "%s: Cannot symlink to %s" +msgstr "%s: Nie mo¿na dowi±zaæ do %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: nieznany typ pliku" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "B³êdnie podana liczba %.*s" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "Warto¶æ archiwum %.*s jest spoza zakresu" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "niespodziewany koniec archiwum" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "uwaga: nag³ówek archiwum ma odwrócony porz±dek bajtów" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "standardowe wej¶cie (stdin) jest zamkniête" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d blok\n" +msgstr[1] "%d bloki\n" +msgstr[2] "%d bloków\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "nie mogê odczytaæ sumy kontrolnej dla %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "%s: szeroko¶æ pola niewystarczaj±ca do zapisania %s" + +#: src/copyout.c:308 +#, c-format +msgid "%s: truncating %s" +msgstr "%s: ucinam %s" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +msgid "inode number" +msgstr "numer i-wêz³a" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "uprawnienia pliku" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "uid" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "gid" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "liczba dowi±zañ" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "czas modyfikacji" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "rozmiar pliku" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "g³ówny numer urz±dzenia" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "poboczny numer urz±dzenia" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "g³ówny numer rdev" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "poboczny numer rdev" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "rozmiar nazwy" + +#: src/copyout.c:403 +msgid "device number" +msgstr "numer urz±dzenia" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "numer rdev" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: zerujê numer i-wêz³a" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "standardowe wyj¶cie (stdout) jest zamkniête" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "pusta linia zignorowana" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s nie zosta³ zrzucony: nie jest zwyk³ym plikiem" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: za d³ugie dowi±zanie symboliczne" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s dowi±zany do %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"GNU `cpio' kopiuje pliki do i z archiwów\n" +"\n" +"Przyk³ady:\n" +" # Skopiowanie plików o nazwach z pliku lista-nazw do archiwum\n" +" cpio -o < lista-nazw [> archiwum]\n" +" # Wydobycie plików z archiwum\n" +" cpio -i [< archiwum]\n" +" # Skopiowanie plików o nazwach z pliku lista-nazw do katalogu-docelowego\n" +" cpio -p katalog-docelowy < lista-nazw\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "%s nie ma znaczenia przy %s" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "G³ówny tryb operacji:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "Tworzenie archiwum (dzia³anie w trybie copy-out)" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "Wydobywanie plików z archiwum (dzia³anie w trybie copy-in)" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "Dzia³anie w trybie copy-pass" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "Wypisanie tabeli z zawarto¶ci± wej¶cia" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "Modyfikatory operacji poprawne w ka¿dym trybie:" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[U¯YTKOWNIK@]HOST:]PLIK" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"U¿ycie tego PLIKU zamiast standardowego wej¶cia lub wyj¶cia. Opcjonalne " +"U¯YTKOWNIK i HOST okre¶laj± nazwy u¿ytkownika i hosta w przypadku zdalnego " +"archiwum" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "Plik archiwum jest lokalny, nawet je¶li nazwa zawiera dwukropki" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "FORMAT" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "U¿ycie podanego FORMATU archiwum" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "Ustawienie rozmiaru bloku we/wy na 5120 bajtów" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "ROZMIAR-BLOKU" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "Ustawienie rozmiaru bloku we/wy na ROZMIAR_BLOKU * 512 bajtów" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "U¿ycie starego przeno¶nego (ASCII) formatu archiwum" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "Wypisanie \".\" dla ka¿dego przetworzonego pliku" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "LICZBA" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "Ustawienie rozmiaru bloku we/wy na podan± LICZBÊ bajtów" + +#: src/main.c:119 +msgid "STRING" +msgstr "£AÑCUCH" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "Wypisanie £AÑCUCHA po osi±gniêciu koñca woluminu no¶nika" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "Kopiowanie wy³±cznie plików nie pasuj±cych do podanych wzorców" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" +"W tabeli szczegó³owej spisu zawarto¶ci pokazywanie liczbowych warto¶ci UID i " +"GID" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "POLECENIE" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "U¿ycie zdalnego POLECENIA zamiast rsh" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "Nie wypisywanie liczby skopiowanych bloków" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "Szczegó³owe podawanie przetworzonych plików" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "W³±czenie informacji diagnostycznych" + +#: src/main.c:137 +msgid "FLAG" +msgstr "FLAGA" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"Sterowanie wy¶wietlaniem ostrze¿eñ. Aktualnie FLAGA to jedno z 'none', " +"'truncate', 'all'. Opcje podane razem ³±cz± siê." + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Modyfikatory operacji poprawne tylko w trybie copy-in:" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "PLIK" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" +"Odczyt z PLIKU dodatkowych wzorców okre¶laj±cych nazwy plików do wydobycia " +"lub wypisania" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" +"Przy czytaniu archiwum w formacie CRC sprawdzanie tylko sum CRC ka¿dego " +"pliku w archiwum, bez wydobywania plików" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "Interaktywna zmiana nazw plików" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" +"Zamiana zarówno pó³s³ów w s³owach jak i bajtów w pó³s³owach danych. " +"Odpowiednik -sS" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "Zamiana bajtów w ka¿dym pó³s³owie w plikach" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "Zamiana pó³s³ów w ka¿dym s³owie (4 bajtach) w plikach" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "Wydobycie plików na standardowe wyj¶cie" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Modyfikatory operacji poprawne tylko w trybie copy-out:" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "Do³±czenie do istniej±cego archiwum." + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"PLIK archiwum do u¿ycia zamiast standardowego wyj¶cia. Opcjonalne U¯YTKOWNIK " +"i HOST okre¶laj± nazwy u¿ytkownika i hosta w przypadku zdalnego archiwum" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Modyfikatory operacji poprawne tylko w trybie copy-pass:" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "Dowi±zywanie plików zamiast kopiowania ich o ile to mo¿liwe" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "Modyfikatory operacji poprawne w trybach copy-in i copy-out:" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "Nie usuwanie sk³adników przedrostka systemu plików z nazw plików" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "Tworzenie wszystkich plików wzglêdem bie¿±cego katalogu" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "Modyfikatory operacji poprawne w trybach copy-out i copy-pass:" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "Lista nazw plików jest zakoñczona znakiem NUL zamiast nowej linii" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"PLIK archiwum do u¿ycia zamiast standardowego wej¶cia. Opcjonalne U¯YTKOWNIK " +"i HOST okre¶laj± nazwy u¿ytkownika i hosta w przypadku zdalnego archiwum" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"Rozwi±zywanie dowi±zañ symbolicznych (kopiowanie plików przez nie " +"wskazywanych zamiast kopiowania dowi±zañ)." + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[U¯YTKOWNIK][:.][GRUPA]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" +"Ustawienie w³a¶ciciela wszystkich tworzonych plików na okre¶lonego " +"U¯YTKOWNIKA i/lub GRUPÊ" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "Wyzerowanie czasów dostêpu plików po odczytaniu ich" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "Modyfikatory operacji poprawne w trybach copy-in i copy-pass:" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "Zachowanie poprzednich czasów modyfikacji plików przy ich tworzeniu" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "Tworzenie wiod±cych katalogów w razie potrzeby" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "Nie zmienianie w³a¶ciciela plików" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "Bezwarunkowe zast±pienie wszystkich plików" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "Zapis plików z du¿ymi blokami zer jako plików rzadkich" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "Opcje informacyjne:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "Wy¶wietlenie tego tekstu pomocy" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "Wy¶wietlenie krótkiej informacji i sk³adni" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "Wypisanie licencji i zakoñczenie" + +#: src/main.c:233 +msgid "Print program version" +msgstr "Wypisanie wersji programu" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "zawieszenie na SECS sekund (domy¶lnie 3600)" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +" GNU cpio jest programem darmowym; mo¿na go rozprowadzaæ i/lub " +"modyfikowaæ\n" +" na warunkach Powszechnej Licencji Publicznej GNU (General Public " +"License)\n" +" opublikowanej przez Free Software Foundation, w wersji 2, lub, do " +"wyboru,\n" +" dowolnej pó¼niejszej.\n" +"\n" +" GNU cpio jest rozprowadzany w nadziei, ¿e bêdzie przydatny, ale BEZ\n" +" ¯ADNEJ GWARANCJI, nawet bez domy¶lnej gwarancji JAKO¦CI lub PRZYDATNO¦CI\n" +" DO KONKRETNYCH ZASTOSOWAÑ. Szczegó³y znajduj± siê w Powszechnej Licencji\n" +" Publicznej GNU.\n" +"\n" +" Kopia Powszechnej Licencji Publicznej GNU powinna byæ dostarczona wraz\n" +" z tym programem. Je¶li nie, mo¿na napisaæ do Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "b³êdny rozmiar bloku" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "Wielokrotnie okre¶lony format archiwum" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"b³êdny format archiwum `%s'; poprawne formaty to:\n" +"crc, newc, odc, bin, ustar, tar (rozpoznawane tak¿e wielkimi literami)" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "Tryb ju¿ okre¶lony" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "--no-preserve-owner nie mo¿e byæ u¿yte wraz z --owner" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "--owner nie mo¿e byæ o¿yte wraz z --no-preserve-owner" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "B³êdna warto¶æ dla opcji --warning: %s" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[katalog-docelowy]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"Trzeba podaæ jedn± z opcji -oipt.\n" +"Wywo³anie `%s --help' lub `%s --usage' poda wiêcej informacji.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "U¿yto jednocze¶nie -I i -F w trybie copy-in" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "Za du¿o argumentów" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"U¿yto --append, ale nie podano nazwy pliku archiwum (nale¿y u¿yæ opcji -F " +"lub -O)" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "U¿yto jednocze¶nie -O i -F w trybie copy-out" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "Za du¿o argumentów" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "Nie podano formatu archiwum w trybie copy-pass" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "-F mo¿e byæ u¿yte tylko wraz z --create lub --extract" + +#: src/main.c:725 +#, c-format +msgid "Cannot open %s" +msgstr "Nie mo¿na otworzyæ %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "b³±d podczas zamykania archiwum" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "nie mo¿na utworzyæ katalogu `%s'" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s' istnieje, ale nie jest katalogiem" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s nie jest urz±dzeniem znakowym" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "%s: rmtioctl nie powiod³o siê" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Sk³adnia: %s [-V] [-f urz±dzenie] [--file=urz±dzenie] [--rsh-" +"command=polecenie]\n" +"\t[--help] [--version] operacja [liczba]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "nie podano urz±dzenia ta¶mowego" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "%s: rmtopen nie powiod³o siê" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "%s: rmtclose nie powiod³o siê" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "b³êdny nag³ówek: z³a suma kontrolna" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "niew³a¶ciwy u¿ytkownik" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "nie mogê uzyskaæ grupy liczbowego UID-u" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "z³a grupa" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "b³±d zapisu" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "b³±d odczytu" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "niespodziewany koniec pliku" + +#: src/util.c:493 src/util.c:543 +#, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Plik %s zmniejszony o %s bajt, uzupe³niam zerami" +msgstr[1] "Plik %s zmniejszony o %s bajty, uzupe³niam zerami" +msgstr[2] "Plik %s zmniejszony o %s bajtów, uzupe³niam zerami" + +#: src/util.c:499 src/util.c:549 +#, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "B³±d odczytu na pozycji %lld w pliku %s, uzupe³niam zerami" + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "Plik %s powiêkszy³ siê, %ld nowych bajtów nie skopiowanych" +msgstr[1] "Plik %s powiêkszy³ siê, %ld nowych bajtów nie skopiowanych" +msgstr[2] "Plik %s powiêkszy³ siê, %ld nowych bajtów nie skopiowanych" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "Plik %s zosta³ zmodyfikowany w trakcie kopiowania" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "brak pamiêci wirtualnej" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "nie mo¿na przesun±æ wska¼nika na wyj¶ciu" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Koniec ta¶my. Nale¿y za³adowaæ nastêpn± i wcisn±æ RETURN. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "Koniec ta¶my. Aby kontynuowaæ nale¿y wpisaæ nazwê urz±dzenia/pliku.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "Aby kontynuowaæ nale¿y wpisaæ nazwê urz±dzenia/pliku.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "b³±d wewnêtrzny: deskryptor ta¶my zmieni³ siê z %d na %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: opcja `%s' jest niejednoznaczna\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: opcja `--%s' nie mo¿e mieæ argumentu\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: opcja `%c%s' nie mo¿e mieæ argumentu\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: opcja `%s' wymaga argumentu\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: nierozpoznana opcja `--%s'\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: nierozpoznana opcja `%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: nielegalna opcja -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: b³êdna opcja -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opcja wymaga argumentu -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: opcja `-W %s' jest niejednoznaczna\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: opcja `-W %s' nie mo¿e mieæ argumentu\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: Us³uga niedostêpna" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "standardowe wej¶cie" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "standardowe wyj¶cie" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "Nie mo¿na uruchomiæ zdalnej pow³oki" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "%s: Wywo³anie %s nie powiod³o siê" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "%s: Uwaga: Wywo³anie %s nie powiod³o siê" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "%s: Nie mo¿na zmieniæ uprawnieñ na %s" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "%s: Nie mo¿na zmieniæ w³a¶ciciela na uid %lu, gid %lu" + +#: lib/paxerror.c:127 +#, c-format +msgid "%s: Cannot hard link to %s" +msgstr "%s: Nie mo¿na utworzyæ dowi±zania zwyk³ego do %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: B³±d odczytu na bajcie %s podczas odczytu %lu bajtu" +msgstr[1] "%s: B³±d odczytu na bajcie %s podczas odczytu %lu bajtów" +msgstr[2] "%s: B³±d odczytu na bajcie %s podczas odczytu %lu bajtów" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: Uwaga: B³±d odczytu na bajcie %s podczas odczytu %lu bajtu" +msgstr[1] "%s: Uwaga: B³±d odczytu na bajcie %s podczas odczytu %lu bajtów" +msgstr[2] "%s: Uwaga: B³±d odczytu na bajcie %s podczas odczytu %lu bajtów" + +#: lib/paxerror.c:259 +#, c-format +msgid "%s: Cannot seek to %s" +msgstr "%s: Nie mo¿na wykonaæ seek na %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "%s: Uwaga: Nie mo¿na wykonaæ seek na %s" + +#: lib/paxerror.c:284 +#, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "%s: Nie mo¿na utworzyæ dowi±zania do %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "%s: Zapisano tylko %lu z %lu bajtu" +msgstr[1] "%s: Zapisano tylko %lu z %lu bajtów" +msgstr[2] "%s: Zapisano tylko %lu z %lu bajtów" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "Usuniêcie pocz±tkowego `%s' z nazw plików" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" +"Usuniêcie pocz±tkowego `%s' z nazw wskazywanych przez dowi±zania zwyk³e" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "Podstawienie `.' zamiast pustej nazwy pliku" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" +"Podstawienie `.' zamiast pustej nazwy wskazywanej przez dowi±zanie zwyk³e" + +#~ msgid "error %d" +#~ msgstr "b³±d %d" + +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "%s: B³±d odczytu na bajcie %s, odczyt %lu bajtu" +#~ msgstr[1] "%s: B³±d odczytu na bajcie %s, odczyt %lu bajtów" +#~ msgstr[2] "%s: B³±d odczytu na bajcie %s, odczyt %lu bajtów" diff --git a/po/pt_BR.gmo b/po/pt_BR.gmo new file mode 100644 index 0000000000000000000000000000000000000000..474604b3d406ccd257d3183df6cd762c30c415d8 GIT binary patch literal 4516 zcmbW4O^h5z6~`N}16jgHJ|GDgQY35~uzNfkJFz`pf{9}*mh9MU)(9y=a!q&5OtIZn zE4frs46O?s#b13oWF;M(H11^J; z?)?wICwcxEDDnFfDDl~aa|(PMl=mk<@za2-;H%(Q!C!!9zz09t@_rE%zrG6|27e67 zxqjE-d*FjSKZJM$p91%StDwX)2akcTfwIo;LD}zbp!l=@<4M92$th6$xB&7m`4)dZ z4}Kq%_`V6s{9l7iP5#p1-$C(jHzW!lPk>_gWl;A0IwtzPMC(hg=gR6fc&H8kBtxw6CI1J?@c5)UBLFuKoNZ|HQ|A{N$22iI#*G;pIpKl?#D}f6dr_oLcX}Zz+K9Z^hv(RPjXq}o-9|&R?7KW zX_ZZM&{=JQs-`Bhx={syN{@}2nNV5p zl(}rHdNCny%4xKZn*}p&3LWNK4C0M)vPA8@D!d!B(?HpxFk_D5r?o7ZrfNA`YDe5m z7dF4cNN0O-Ia{vws@$8(?Zv^O@S93IrNg)>jjP*b7RH!Dg)WD7-1w&2IU3BR#s-7U z-PTCc|9-Pk8Eh0P-Qw{ud5#$~#;Zmg{HxlyhuhbBZ;8n@y6rfcb}uS_L= z1J$@-GCy|qDq&oBEcCQ)-f=v7vy`0jjmwqc=SQm6Q`1xGjMq7Vzg))`5R$7Y%v5Ua zY3#VV0+e$tt z@}NzKZh=y7;Lv<0C5M^Yi$kQB$u_E{R3mbQJnE(eQ~H@vSrY=9+%`}dv!Rf@Z|Z4N z&&{h%JypXiH8SLM5?h}WiYNei6Nhdyp6Ft<=|g^(35(&xguuzN!dId!9kPj?nZ!CO zf+GXt@SqKNZmKNUDU?dpaAQ<83cgg!ZIQ^C)h6e#@Y#l{(B0xyq;~N%ff^GATkOPb z7Q;=2uAQInDr#w~)5sD!G*{}n31%+O`Js0V#7Y*!(5?^HQfi1{`kYFt8U^c+E9;1)& zY|Zh7`s94@-$bYB={)^fTSDPwYQ1{8cd&PKWo2p2Ons=+v(?z<>GRFFO4t1WsgF}J zJ3e+z&xi5S`E%>(2`SH1%=87S^gun`?;lS4&!+vuYUR*i<=K7xgZ(~+=^7a*#k#Xw zIePSH+CQ4Etf-ZPgG2qae{g`|8C})sdeE*aG(jJzQ`d)_>qX;&z0??Ws;6GI#Y`); zI?{|xM%8iSi(cl--Y`7Jd^c`r4e7ekgaj=X~vC#l+_}iro(W2sITh4 zOa~QqrWb3RJ$?4%7B4Hk{?ZAG2|1IlQ%Vpf<>Cn;*&WRk{pS`-F$Wk4s_A``crf)^lx1TnM$$EX9QV_ASdg+Ry>naB?B2WCby}z1KBDOhGG}kwHD&jy38knrveEWT z-}Z~IER3nRH@c>&+p(>M7?Uo?*TK#e7FKP~{LkCXjqkA9b{A$hB{H6JQx0#@I=%XL zTH4O(AkO`Rst)ClBrPP3lWXndcBH4yqsDnB)nPwPXDngD zsZJHSt)^6Q(#Ic|J9DX_#u3xN#-8T-e=ma0OvTcKb+OpqMdvkWe_IwwKdf&B>l1qB z1jkD?BmoIcY`;3!iG+USt>VPh&6(j-Zz$iOo*vwgdeEXnZG(i07A&pq2JP6#c{jFZ zb!jQBwN1<@srO)9Qd8DjoCS^3n-}A;Q(-|eFW$9XdGYSH^HHmW-HfWqET{SKC6~75 z*1?m;%2!>V<_IxmJH@r-pYQGx$9Bwuys0kqEO2xC#G7I-@8;vNVJi)LMn2u~u#0s& z&^B&LQd?N)GjwZmKB`L`(gi$A9g}_dfD=_M=Si(g?ItlbqAJrHXE literal 0 HcmV?d00001 diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 0000000..5a0c8c9 --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,1160 @@ +# Arquivo de Mensagens do CPIO. +# Copyright (C) 1999 Free Software Foundation, Inc. +# Fábio Henrique F. Silva , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.3.911\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 1999-09-11 13:40-03:00\n" +"Last-Translator: Fábio Henrique F. Silva \n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/copyin.c:45 +#, fuzzy, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "aviso: %ld bytes ignorados" +msgstr[1] "aviso: %ld bytes ignorados" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "renomeia %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: nome do arquivo muito longo" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: erro de validação (0x%x, deveria ser 0x%x)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s não criado: ele é mais novo ou da mesma data da versão existente" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "não pôde remover %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "não é possível vincular %s a %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "não pôde trocar as palavras de %s: número ímpar de palavras" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "não pôde trocar os bytes de %s: número de bytes impar" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "'%s' existe mas não é um diretório" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "não é possível vincular %s a %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: tipo de arquivo desconhecido" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "Final de arquivo prematuro" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "aviso: o cabeçalho do arquivo tem os bytes em ordem reversa" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "a entrada padrão está fechada" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, fuzzy, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d blocos\n" +msgstr[1] "%d blocos\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "não pôde validar %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: truncando número do inode" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "número do arquivo = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "número do arquivo = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: truncando número do inode" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "a saida padrão está fechada" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "linha em branco ignorada" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s não descarregado: não é um arquivo regular" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: vínculo simbólico muito longo" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s vinculado a %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "" + +#: src/main.c:87 +#, fuzzy +msgid "Main operation mode:" +msgstr "operação de fita" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "" + +#: src/main.c:119 +msgid "STRING" +msgstr "" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "" + +#: src/main.c:137 +msgid "FLAG" +msgstr "" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "" + +#: src/main.c:233 +msgid "Print program version" +msgstr "" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "tamanho do bloco inválido" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "" + +#: src/main.c:389 +#, fuzzy, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"formato do arquivo inválido `%s'; os formatos válidos são:\n" +"crc, newc, odc, bin, ustar, tar, hpodc, hpbin" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "Não foi possível abrir o diretório %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "erro ao fechar o arquivo" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "não pôde criar o diretório '%s'" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "'%s' existe mas não é um diretório" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "O %s não é um arquivo tipo caracter" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, fuzzy, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Uso: %s [-V] [-f dispositivo] [--file=dispositivo] [--help] [--version] " +"operação [contador]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "dispositivo de fita não especificado" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "cabeçalho inválido: erro de validação" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "usuário inválido" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "não foi possível obter o grupo a partir do UID numérico" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "grupo inválido" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "erro de escrita" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "erro de leitura" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "fim de arquivo prematuro" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Arquivo %s reduzido em %ld bytes, preenchendo com zeros" +msgstr[1] "Arquivo %s reduzido em %ld bytes, preenchendo com zeros" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Erro de leitura no byte %ld do arquivo %s, preenchendo com zeros" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "a memória virtual encheu" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "não foi possível se posicionar na saida" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Fim de fita encontrado. Coloque a próxima fita e tecle ENTER" + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Fim da fita. Para continuar, digite o nome do dispositivo/arquivo quando " +"pronto.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "" +"Para continuar, digite o nome do dispositivo/arquivo quanto estiver pronto.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "erro interno: o descritor da fita foi alterado de %d para %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: A opção '%s' é ambigua\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: a opção '--%s' não permite um argumento\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: a opção '%c%s' não permite um argumento\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: a opção '%s' requer um argumento\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opção '--%s' desconhecida\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opção '%c%s' não reconhecida\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opção ilegal -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opção inválida -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: a opção requer um argumento -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, fuzzy, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: A opção '%s' é ambigua\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, fuzzy, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: a opção '--%s' não permite um argumento\n" + +#: lib/rtapelib.c:299 +#, fuzzy, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: serviço não disponível" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, fuzzy, c-format +msgid "Cannot execute remote shell" +msgstr "não pôde executar o interpretador (shell) remoto" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "não é possível vincular %s a %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "Erro de leitura no byte %ld do arquivo %s, preenchendo com zeros" +msgstr[1] "Erro de leitura no byte %ld do arquivo %s, preenchendo com zeros" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "não é possível vincular %s a %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "não é possível vincular %s a %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "Erro de leitura no byte %ld do arquivo %s, preenchendo com zeros" +#~ msgstr[1] "Erro de leitura no byte %ld do arquivo %s, preenchendo com zeros" + +#~ msgid "Memory exhausted" +#~ msgstr "Memória Cheia" + +#~ msgid "block size cannot be 0" +#~ msgstr "O tamanho do bloco não pode ser 0" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt versão %s\n" + +#~ msgid "Success" +#~ msgstr "Sucesso" + +#~ msgid "parse error in blocksize" +#~ msgstr "Erro na análise do tamanho do bloco" + +#~ msgid "Regular expression too big" +#~ msgstr "Expressão regular muito grande" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Uso: %s {-o|--create} [-0acvABLV] [-C bytes] [-H formato] [-M mensagem]\n" +#~ " [-O [[usuário@]máquina:]arquivo] [-F [[usuário@]máquina:]arquivo]\n" +#~ " [--file=[[usuário@]máquina:]arquivo] [--format=formato] [--" +#~ "message=mensagem]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocos] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < lista-de-nomes [> arquivo]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "Final prematuro de expressão regular" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f arquivo] [-s " +#~ "substituição]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=substituição] [padrão...] [< arquivo]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "número de bloco = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "Nome da classe de caracteres inválida" + +#~ msgid "drive type = %d\n" +#~ msgstr "tipo do drive = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "a opção '%c' não é reconhecida para -p; opções válidas são: 'aemop'" + +#~ msgid "ambiguous" +#~ msgstr "ambiguo" + +#~ msgid "missing regexp" +#~ msgstr "falta a expressão regular" + +#~ msgid "1 block\n" +#~ msgstr "1 bloco\n" + +#~ msgid "No match" +#~ msgstr "Não coincide" + +#~ msgid "residue count = %d\n" +#~ msgstr "contador residual = %d\n" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [usuário][:.][grupo]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[usuário][:.][grupo]] [--no-preserve-" +#~ "owner]\n" +#~ " [--sparse] [--help] [--version] diretório-de-destino < lista-de-" +#~ "nomes\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "estado do drive = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "[ ou [^ não coincidem" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E arquivo] [-H " +#~ "formato]\n" +#~ " [-M mensagem] [-R [usuário][:.][grupo]] [-I [[usuário@]máquina:]" +#~ "arquivo]\n" +#~ " [-F [[usuário@]máquina:]arquivo] [--file=[[usuário@]máquina:]" +#~ "arquivo]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=arquivo] [--format=formato]\n" +#~ " [--owner=[usuário][:.][grupo]] [--no-preserve-owner] [--" +#~ "message=mensagem]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [padrão...] [< arquivo]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f arquivo] [-s substituição]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=substituição] [padrão...] [< arquivo]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "estado do drive (baixo) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "Conjunto de caracteres inválido" + +#~ msgid "Unmatched \\{" +#~ msgstr "\\{ não coincide" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr ") ou \\) não coincide" + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "Expressão regular anterior inválida" + +#~ msgid "null regexp" +#~ msgstr "expressão regular nula" + +#~ msgid "%s already exists; not created" +#~ msgstr "%s já existe; não será criada" + +#~ msgid "Invalid back reference" +#~ msgstr "Referência atrás inválida" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Uso: %s [-cdnv] [-f arquivo] [-s substituição] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=substituição] [padrão...] [< arquivo]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "( ou \\( não coincidem" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio versão %s\n" + +#~ msgid "invalid" +#~ msgstr "inválido" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax versão %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "Conteúdo de \\{\\} inválido" + +#~ msgid "Invalid range end" +#~ msgstr "Fim de Faixa inválida" + +#~ msgid "sense key error = %d\n" +#~ msgstr "erro na chave = %d\n" + +#~ msgid "Trailing backslash" +#~ msgstr "Barra invertida no final" + +#~ msgid "can not omit both user and group" +#~ msgstr "não omita o usuário e o grupo simultâneamente" + +#~ msgid "Invalid regular expression" +#~ msgstr "expressão regular inválida" + +#~ msgid "No previous regular expression" +#~ msgstr "Não há expressão regular anterior" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f arquivo] [-s substituição]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=substituição] [padrão...] [< arquivo]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "estado do drive (alto) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "%s durante a compilação do padrão" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "modificador de expressão inválido '%c'" diff --git a/po/quot.sed b/po/quot.sed new file mode 100644 index 0000000..0122c46 --- /dev/null +++ b/po/quot.sed @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin new file mode 100644 index 0000000..2436c49 --- /dev/null +++ b/po/remove-potcdate.sin @@ -0,0 +1,19 @@ +# Sed script that remove the POT-Creation-Date line in the header entry +# from a POT file. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/po/ro.gmo b/po/ro.gmo new file mode 100644 index 0000000000000000000000000000000000000000..96278ebe5dba51ea86eaf73d72ff6c75f4cc9755 GIT binary patch literal 4631 zcmb_fO^h5z6)qqNWb;P?Au$+I{A|1%Z;xl~I9ZP!%d%q>3p=(pYlIY#Qqx`2Q`zpS zPW|k9SAr7~9CAYD0*BlX2M~fokoJ%ZCpZv`TByz(;^*fJ5MA;1_}4 z27U(k7Vr@8?Sy{-F5&%ez|RApxRfwa%hfuzrG zfX@QoPv7T1(d~B{NOIo*J_P(O@C(2n03QVY5=ipiN%&_V$$cL<2fXk8Zr!6mn)eit z{IrtZSAhe(uLB>+zCQuUzJCH2fe%1A z^501y$+-@s@83!IQy|6fk3f?1FCfMLVHip4jwbvX@MXNO0}XHocoq1}!;Ep@HjwuH zF_8TCYas3S_w@a7kmhN;F9S*bH-N;K06Y(T6ZlQwyJ>vslZ?H9_e;PhfZqc`HTD*e z;{3Dp{w{Ec_rCzi{)ZmzZ~=%<>;e!!wuV3CuSvo;fwcdxfTw}K1>(o~)AnhRToT58{k=_g|~jM)lmFKJZLL(Q);!1F!mOcdpa`@9FNw_v9Fq-3odb+3HPFr1I{lSQ6TU)eEa~1 z6ug0F9ACY-c765b0Y7lnn&G+8&^yQ_PP*|zZm3)yBc64!-<(R#!K`9yFvtGa`LB`p zJJRuS@Vm?|5VqVKyT!(p(Cg$<$yKS1l?BU%CO(%E#!MxcS1Qd*YeGW?3v#Zsh{N?u zFV5ytK5*ngmk>!nE!JVsY$s02%;u9pNH3YMyHN89as_#mmRVVw4axIhEjYPnz)88z zL3tB=6Z~wt+Y}8SZ+XxV+EHvxflx#O(3d#0Z}L=BlTBlbyDaF3nY0#~<&|;7EMfDh z+K^0XR0NF-jKiZY;DvO#RSjH9RYR9x)x?^b&v!+lz^X1e$Cb&~xdZR|Ptmpg+Z3*m zcC_oAxJ^GC9C)qGY*%7SSDhvbp#$e?;e(Ykdd`%-V<1+t7=}(hd`+bWG0e_#<~$fI zY{8X=tBE({1#Hj{bV1lNvZ1UG@JfyF*)6bcDuP2jWShcj_-{0GAnz>XQ{g~tDvdG* zDMLtL+on|>>XYl)HEUi6PqRx!_VuoW!Y_?7{P^I+;MDT++^TGh_1P6ysv;jc%RLtx}ROt~vJ{&%u4WG+~&-3MHN6XJ09iA8tF)>?3 z22!!!op&M|u4K!n`0&)|_=#@bW#N3bW`%Z@K+H${VknWPFByS4#Lq~2o1P1HEOb^{ zF}X3Y=Iq>M5F?-;WNT8?Bfe^Cp%rT98J{H4wjN`dHRmd76$592%_S0~lmjjO*|{s1 zu3X%8#`0h|cL5ayiIT0Met?arLC2a(D1AEiFDLyAmtMJ=t*o3pl^x%mOgm1b%`WQP z6frz2V--69a)(Pq4mA=*b4Q_<<$>oPXoU<+L2W=Q@(W!zTtxArY{dX12xPTOO>xxK zpq7hVO0lE5ei%@4oCv%Y3jH&*aiK(%Dzz;<+GtWE>5%#(X3-F+n!bbCf>$ARN7LL^ zBpCG*O|sqFKl-6A6Au~_C{nRSV(&)UnwZ$Y@LGDSX8kX2Kr^YflApQ`*&Z~mWiFla zE%|aLD12~Y*Cap0mIq4PYa)zpk^L>|OV=w~>O!4+$iLBZtwmN-lZ;(+s)UatUNscJ zq5Z8&E6?5JmfZnjC*(%aqILdW z=dI1fZN-B{@iKxmj)NRj5l!o8tnZ`$P24r)f+hZ?&MKBTm1YSUL>u(gLb=9lE3Y;} z6%=|cahx7`ehYou1>_TEgV_Q-_x~-g;|(1ITaFUj(|pz_8L~-9UK-GMA$I4*t}_eY zGLQt-vN0%Oylfqmw4n(VxwC82D8NC(67=S1F8cJoMH8eTWi8P}#Kc|XNLVB|GM6Zr z4zhjUhH%n&pO75B>-$rN8BOQ&PDHQZ4*DbxzfnB3@?L%$yug}SBcB806-rq; z9Doo=3mgy_g?09orGA+vp_q31kTvN9#pqPf&(|tPF6liyk8&y9P;5)I5tXAv(7!Yj zg<~^INtqQgi)O{D5zi5`Ari1#Z@ZyAYJd+`GMpVHQVfq2b2>)AE0)rEAs!YN%;<*Bek, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.3.911\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2003-08-19 09:23+0300\n" +"Last-Translator: Eugen Hoanca \n" +"Language-Team: Romanian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/copyin.c:45 +#, fuzzy, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "avertisment: se omit %ld octeþi de resturi(junk)" +msgstr[1] "avertisment: se omit %ld octeþi de resturi(junk)" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "redenumire %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: nume fiºier prea lung" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: eroare de checksum (0x%x, ar trebui sã fie 0x%x)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s nu a fost creat: existã aceeaºi versiune sau mai nouã" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "nu se poate ºterge %s curent" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "nu se poate face legãtura(link) %s cu %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "" +"nu se pot interschimba(swap) jumãtãþi de cuvinte(halfwords) ale %s: numãr " +"impar de halfwords" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "nu se pot interschimba(swap) octeþii din %s: numãr impar de octeþi" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "`%s' existã dar nu este director" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "nu se poate face legãtura(link) %s cu %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: tip de fiºier necunoscut" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "sfârºit-de-arhivã prematur" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "avertisment: header-ul arhivei are ordine inversã de octeþi" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "intrarea(input) standard este închisã" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, fuzzy, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d blocuri\n" +msgstr[1] "%d blocuri\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "nu se poate citi checksum-ul pentru %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: numãr inode trunchiat" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "numãr fiºier = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "numãr fiºier = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: numãr inode trunchiat" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "ieºirea(output) standard este închisã" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "linie goalã(blank) ignoratã" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s nerealizat: nu este fiºier regular" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: legãturã simbolicã prea lungã" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s e legat(linked) de %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "" + +#: src/main.c:87 +#, fuzzy +msgid "Main operation mode:" +msgstr "operaþie cu banda magneticã" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "" + +#: src/main.c:119 +msgid "STRING" +msgstr "" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "" + +#: src/main.c:137 +msgid "FLAG" +msgstr "" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "" + +#: src/main.c:233 +msgid "Print program version" +msgstr "" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "mãrime invalidã de bloc" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "" + +#: src/main.c:389 +#, fuzzy, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"format de arhivã invalid `%s'; formaturi valide sunt:\n" +"crc, newc, odc, bin, ustar, tar, hpodc, hpbin" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "nu pot deschide directorul %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "eroare în închiderea arhivei" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "nu pot crea directorul `%s'" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s' existã dar nu este director" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s nu este un fiºier cu caracter special" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, fuzzy, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Folosire: %s [-V] [-f dispozitiv] [--file=dispozitiv] [--help] [--version] " +"operaþie [repetãri]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "nici un dispozitiv de bandã magneticã specificat" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "header invalid: eroare de checksum" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "user invalid" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "nu se poate gãsi grupul de login al unui UID numeric" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "grup invalid" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "eroare de scriere" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "eroare de citire" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "sfârºit de fiºier prematur" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Fiºierul %s micºorat cu %ld octeþi, umplut(padding) cu zero-uri" +msgstr[1] "Fiºierul %s micºorat cu %ld octeþi, umplut(padding) cu zero-uri" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "" +"Eroare de citire la octetul %ld în fiºierul %s, umplere(pading) cu zero-uri" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "memorie virtualã plinã" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "nu pot cãuta pe output" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "" +"S-a întâlnit sfârºit de bandã. Încãrcaþi urmatoarea bandã ºi apãsaþi " +"RETURN. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"S-a întâlnit sfârºit de bandã. Pentru a continua, scrieþi numele " +"dispozitivului/fiºierului când sunteþi gata.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "" +"Pentru a continua, scrieþi numele dispozitivului/fiºierului când sunteþi " +"gata.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "eroare internã: descriptorul benzii s-a schimbat din %d în %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: opþiunea `%s' este ambiguã\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: opþiunea `--%s' nu permite parametri\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: opþiunea `%c%s' nu permite parametri\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: opþiunea `%s' necesitã un parametru\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opþiune necunoscutã `--%s'\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opþiune necunoscutã `%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opþiune ilegalã -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opþiune invalidã -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opþiunea necesitã un parametru -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, fuzzy, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: opþiunea `%s' este ambiguã\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, fuzzy, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: opþiunea `--%s' nu permite parametri\n" + +#: lib/rtapelib.c:299 +#, fuzzy, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: serviciu indisponibil" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, fuzzy, c-format +msgid "Cannot execute remote shell" +msgstr "nu se poate executa shellul de la distanþã (remote)" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "nu se poate face legãtura(link) %s cu %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +"Eroare de citire la octetul %ld în fiºierul %s, umplere(pading) cu zero-uri" +msgstr[1] "" +"Eroare de citire la octetul %ld în fiºierul %s, umplere(pading) cu zero-uri" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "nu se poate face legãtura(link) %s cu %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "nu se poate face legãtura(link) %s cu %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "" +#~ "Eroare de citire la octetul %ld în fiºierul %s, umplere(pading) cu zero-" +#~ "uri" +#~ msgstr[1] "" +#~ "Eroare de citire la octetul %ld în fiºierul %s, umplere(pading) cu zero-" +#~ "uri" + +#~ msgid "Memory exhausted" +#~ msgstr "Memorie plinã" + +#~ msgid "block size cannot be 0" +#~ msgstr "mãrimea blocului nu poate fi 0" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt versiunea %s\n" + +#~ msgid "Success" +#~ msgstr "Succes" + +#~ msgid "parse error in blocksize" +#~ msgstr "eroare de analizã(parse) în mãrimea blocului" + +#~ msgid "Regular expression too big" +#~ msgstr "Expresie regularã prea mare" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Folosire: %s {-o|--create} [-0acvABLV] [-C octeþi] [-H format] [-M " +#~ "mesaj]\n" +#~ " [-O [[user@]host:]arhivã] [-F [[user@]host:]arhivã]\n" +#~ " [--file=[[user@]host:]arhivã] [--format=format] [--message=mesaj]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocuri] [--dereference] [--io-size=octeþi] [--" +#~ "quiet]\n" +#~ " [--force-local] [--help] [--version] < listã-nume [> arhivã]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "Sfârºit prematur de expresie regulatã" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f arhivã] [-s înlocuitor]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=înlocuitor] [tipar...] [< arhivã]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "numãr bloc = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "Nume de clasã caracter invalid" + +#~ msgid "drive type = %d\n" +#~ msgstr "tip drive = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "" +#~ "marcaj(flag) necunoscut `%c' pentru -p; marcaje cunoscute sunt `aemop'" + +#~ msgid "ambiguous" +#~ msgstr "ambiguu" + +#~ msgid "missing regexp" +#~ msgstr "regexp lipsã" + +#~ msgid "1 block\n" +#~ msgstr "1 bloc\n" + +#~ msgid "No match" +#~ msgstr "Nici o potrivire" + +#~ msgid "residue count = %d\n" +#~ msgstr "repetãri rãmase = %d\n" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][grup]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][grup]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] director destinaþie < listã-nume\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "stare drive = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "[ sau [^ neînchise" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C octeþi] [-E fiºier] [-H " +#~ "format]\n" +#~ " [-M mesaj] [-R [user][:.][grup]] [-I [[user@]host:]arhivã]\n" +#~ " [-F [[user@]host:]arhivã] [--file=[[user@]host:]arhivã]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=octeþi] [--pattern-file=fiºier] [--format=format]\n" +#~ " [--owner=[user][:.][grup]] [--no-preserve-owner] [--" +#~ "message=mesaj]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [tipar...] [< arhivã]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f arhivã] [-s înlocuitor]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=înlocuitor] [tipar...] [< arhivã]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "stare drive (slab) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "Caracter de comparare(collation) invalid" + +#~ msgid "Unmatched \\{" +#~ msgstr "\\{ neînchisã" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr " ) or \\) nedeschise" + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "Expresie regularã precedentã invalidã" + +#~ msgid "null regexp" +#~ msgstr "regexp vidã" + +#~ msgid "%s already exists; not created" +#~ msgstr "%s existã deja; nu este creat" + +#~ msgid "Invalid back reference" +#~ msgstr "Referinþã precedentã(back) invalidã" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Folosire: %s [-cdnv] [-f arhivã] [-s înlocuitor] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=înlocuitor] [tipar...] [< arhivã]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr " ( or \\( neînchise" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio versiunea %s\n" + +#~ msgid "invalid" +#~ msgstr "invalid" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax versiunea %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "Conþinut invalid al \\{\\}" + +#~ msgid "Invalid range end" +#~ msgstr "Sfârºit de domeniu(range) invalid" + +#~ msgid "sense key error = %d\n" +#~ msgstr "eroare în înþelegerea tastei(sense key) = %d\n" + +#~ msgid "Trailing backslash" +#~ msgstr "Backslash de sfârºit(trailing)" + +#~ msgid "can not omit both user and group" +#~ msgstr "nu se pot omite ºi userul ºi grupul" + +#~ msgid "Invalid regular expression" +#~ msgstr "Expresie regularã invalidã" + +#~ msgid "No previous regular expression" +#~ msgstr "Nu a existat o expresie regularã precedentã" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f arhivã] [-s înlocuitor]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=înlocuitor] [tipar...] [< arhivã]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "stare drive (performantã) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "%s în timpul compilãrii tiparului" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "parametru(modifier) regexp invalid `%c'" diff --git a/po/ru.gmo b/po/ru.gmo new file mode 100644 index 0000000000000000000000000000000000000000..a5be1de3891aed9b299762e4d8b2d3aa09472c85 GIT binary patch literal 14713 zcmchdd5|2{ea9b;9nAW|*v3bEJY!^Ojb?RV5R4F@n+08#Rt8%rsCTBdJ7{)#m_tIu ziQ~jag-R+ZmtDk;V>^YDKN2UYT$PHeVyl-OORd?NUd^FlS78$wgROuNMi2;PJNf+H z>p51e0J+MZ(%Wwz@BIC~zvI2u>}9Y0vf}p{%6lnSzE-Kf1sA`bKm7iyPpP+qC&71v z{{y}Syz~u9Ed@3BLGWYXSA|S^?exeh&N- z@blp1EM_D4=b-fa7|0UU>n>GlA$Tdc2)quw7<53HPYO(dp97bJXF#cc#aor?2X6)U zfCW(6HzWKxDC<~wnNnASt3VCj10s6$#Rwk&f1UfUfzt1T;5A?wTnk?GHl?n*NU8Op z$mt%G#HIQ}a1HoPQ1tdFf8_lOpvd)Y489zUgYteX!rudBya&LQ;MYN^KLd(Z_K$+kDAfi#<0r!CwkgDo>7BAy(2d@GP;Qin?!7IS4 zP^R>=1>6mO4n#%jQIM&q=OTO)#v%0=fHKZ4p!By36ghqYq)YWRkS6M1K^eaeB0}{f zDD!>|M(|N^2`JB#pz!WK@EY)|pbJicGS0P-7YeIEPF9j2j1qH$$MdRhe1g<1mM1l|E|1pgGg@gn>*NK^FzNG7})1Vt}* zg2K-SKt!d!4NAQ!a1Hn(DE7K4X7xJ+zK;7*@K!JbO8tKWWxbDrvd+s{r11Dw@J8^{ zpw#*gMSTP%wpvIKY}99S@2%)!z@nt z_6<<<^d0c+;0!41JOc{P-_79HgDXJc*FB)r{}PC()IWn#?+4MnIGdH+4}hz|yFnS} z+o1T3!yy0Eqx?yM?}5Z3pU;AC0lyBSGWB=hJHQj5jQ0}|7o*;Ko$Y4;d=vM#f>Q4e z@SR`=d>8n6Q1tu_P~`rXptS!sDDw)yyTCWFIO%5}2+a()g@^6m4ebjMQLEpic$5sK zK#`xw>x~plMBPKtlu^njDT9>WpKxA&!d;QaEtF4C_ETO@ku@YK^7|M?=J-35iz%Xi z`R%k|{=SR9zePzz&tz?56yc!QoBYHMwopXByD0J#+2<*@%MHIB7SwCNw^9yL5Q+LY zWi!R02*2f*wP5T`E=9k>G5L*9wwo*a=UzbMe@FD}QgBan{b^9RdKqP9^lU3AJh+=8 ze0w)VejlWWo|~hoW(qVne7p(# zZOU%S0?L(?G$luIDbU66X9*}jvE3Es%K8zx{1jyqMeIR-LzFj|E6cG}(e-^`jIx1p z4drIaHp=f(}CzHyIq}_a8 zA4nBO^@6;-NvAUV+@vme(S61%=tRzS3T`s4GwuO5r@frcJ7cbPMqIt$&E->GM!WZ> z@&(g@G)NZ5vZg-Qj?TFw#k7;tdsAtbA>!sjXQYdQ=jpVU88MGj>9jlIq_vkVNSCpg zUXYO4#&s&Q-$|#E^Sp`b?pcsnkYA{io}14sWXyEhJD{D6c5)-dF*j4N-E=Bb6$vN&?S2QAtw>#e>9p&76im9ASo%8h(i(SBgvD@{9*FNtI=bK!wwDJeXhP`wuVRSiH z#D!cjlW+>?9hrJbS7(Z2!*0$9xtQ6P@eX9Hb_xfxR#(ML&P{kDnbdu-q9Z_&ww39; z?~QQ!R4kV9Vp+uK=JvZW`i49SCnF3Qc6BjNkA`_M`;PiASLY>tsn`bTuG5#7Ngr%? zXeldHjm6x13ppoIP^%G0zM#FmW{JW-V+aK|H!S(P#=$a{}(>gKgNE;@c%H#{K z!`k=CJNEzv;;PlzteY`b!uW>!B2p)p7)|YW2h?hNVMU1^F+nH2SiAe(j85&7e8I^iom`S<*RYz%7}EKy zn@H_Fs0*V;&^hyF)MNS4x-*E5p3SOq?wD7=p6#qJXck_v@JpYDmm6~mVz5FSyRa0> zO0fhldoY%D@L*#?=0zf_SZuFtV9DCwU5Za3b zEhNZ!X??)Si9^=OR6d(_4i4zG#as^G#Z)(JTD?&O;AM=)7G}6uxL7ZY%-LMy^A-;1 z&31KEGrYioB@#uJ47~@`TI0vXI~r!@nFlXmthjq&O2UrF6fpXNmpj;QlEwn;-0X`K zrgLD_MLrqVO(MjoYw0ASkzRza=_si!k$$y~R(mO#gsXMORT*EE*LsntRGZ02xX5#b z?&-nx}YlzVgD7<`z2^$~CS&uPP2I_7K* zNo^S1v|fq2)rPIxH?JO28;}CQ19ljar}hf<4~)vwVOQo7&2fWQ#P-E0$r_!kJD~L@ z55JYc{h0@bt>TUIdi(mJo!hqzXfN`YlwSfjmy~ z;6R_+xMio_lgOsLg?29aNFuCG+>sTGbuIb6zV-JyV_6g%@6-B2daY>NDq8%KF>1Mp z8Ba|QqOFKfG>}nr%+oiRY1m4;ZfsZBZMvLCE%SAf(z|Y$+wc|Vl63P(1%vT2v5tjw zW|c)u^Stk!E3y(}b98>x%N6kKl0gxL1nsNBC{~VF$eK{41~WzgBw52AuB~8bh<-&s zcm~PVWXO@l(&GW)ubU(8?;KobM89!x9bH&=C<8}6AbJdJ{AK1bXMj!&i>qzM9qky}KDcG06`{~KGHgfh z_tI#&z3O2nv9FkgL&=mQ0RlNDM)6p-6GvY$aD~yKJT_9)*_@YvaXocj%BsjqnhYcA zigeP=KtZu+@|{BTnBGQm&RBaJptie&E*yI|#E@@#nPf^-&clP$$h*d&OJovXR7go4 z#*o$xIC~}O5pW?$gqUlVEniADSa9<%Q>mLc=#NN?S8O1Pv^=#8msQUlWKN{&3eje> zCf}4kx;aog>05%GZrr|g=Qg$DfRok3lE;iX>AeTMT+#^FUWoS0fHHFTJ;If4lTN`I z(CgXxU@5p45kxG%!*(eZI!z6o+U+IA%UdgOGrrumUz_1g1DS(f^ikVQ|J-In7Z`Mg z*f@@f9k+LQd9_pAs5mFREB5i-{Mj1?F1e1$>{i)8X6|$O(OAM8qmSgO2zU2gLPhbu zrbe{2-QDA}b|r|ih24FO)z)M?+lj)pyoj>9DEI44R~XbZ75RASB)&0ct#8rl9cu>% z``ZCYY!(j})y1wQEr@Mdy?K3aZ=Kx17^>`bY!dNH*%W--#vnYh4b5$Z_c)Z>b18CL zYsO|@$EKeE7v)kg?mjo?k&)&hu#-bjmNB33ih8Wb&ZNC(iL%_7m&&qRvw7@5-%#$L z-h*X40y(~~6+ryatf>m%|>R`;-hh?_&aar=h_A7CcY*gLEzI<`atiRh#I7q~AC-mJH zdDq>?J|dz@yQ{qM8shI{c5>w6B}pC4;Xv0*MN=}B=a~0P8+2YPH_W^76m18kV5)1*?p8styk@tWQyFqxvh~PSbzQq6+(F_Zgl@yH)?f`mw>&Z3mDpYVZDa%y7PwM%ljm6)c#biP(%@9FbWfN?;UlJ678d` zFy7WFd8;fJ$1iz^cuyNKVz_-4+Nqx3m*Vs!sTbe?C87ww?&k36{51?IZ588U>@v6I zyt~<@#s-ryoRgeFB5BzmEFZYGk3mdhV{yH`NW#oc@`haT=5$J?d1K$^!OiQtt6Vm)v`DUImDGni%HMjXy%U5c9xhkVSxJoZu$w6RJk57i>&PCXg!$Dmw z>7Y_7HFUi)U7z%IUHn=-oSE>e+|;Kh%RWyQ>t@-XnQr-q9`TQ9-cZRlwpHW0-h8A~ zZ?u~9)GF2L0ky(biOwej-3Skd`glpV!kL<1Z}{z|drJbT~de zTb-`x@B2q5!wNO&dNMds4l8hw|F2&U#J7P3rzFPC1ZCAqMXt%dV*4Uu?a%j4?y8>ec-9zrPQ$al}!{Z05 zmglX-IxPFu*+2{|I6@b~Xsp0W81AD;d*gRa4R7F2K8&#~))PMFSweNXgsF;w)x(KW?Re186Roh+ z2xo(mI@OVz3?&BYcjndbs}p{$Q58#XwZaL1K%c=D!>Spfq@OE zc!^g%v*};?)SfCuwy(b*)+&CZt%a7Zm5#G)dw5~Cy^A6mHIFt*#@QT#n>H8fSC7wW z9f=P9R53nFx0*kro;msA>BpXl{ou(nPn=YzI3{0=962R#_k2i9aPH7#5memz$`vKi zc;d|IlTZEdq%(HD&Pw>a2-v5V%z@9f{0OhcLGuH1H3ss8K2t%ph{vZ}^kpVZYmE zsuqaLA3qXK1QqDXoj+?RexzMHY;~&}e)@Wmp{`K5SLevHUp+%qh5I2QA>@=I12--; zIAUBXj$%ux7u~>8>B`>0pLYk0DRd z3NxGZMF%#nvI1%tB?Z)gUNWCX3-{CMvpRjmq!ZMAzC3wo)_9+=K{p|h@Td-|hVBmq zfjTvVbFvjoP;W7K+Y08FOe)hqPbQ9d?ex<&a(~gk@7f zb4+hWw1@OBqqj~E=7hed%`Y&e$jI)h`jSNn2|K-K+cwqna_*G-)brv?w3vKZVoyB` z#~(3F4#(SG&lpY+)%=f!1WwU0k<&I7c@a-(Er;@f=13kfB{6ru*m=x-9zZb+#H_pH4BtP+c;-+rq1YMkH+ytAvCU@k(<0SXDni zb@s_Ks#k$g8q?^wNg2X=9MaBu*qZVue1bO-*<{Q}D9|Sm8&SU!sMGk!?+2(CA4P^y z5)){W-r!pF|AfGMO zkZc7vVFHJ2AczNttIbB_P#OfmsJR^RizR9zCBA+_TCaiAU zBUWS9(3~Q&*hvwhLwt#r*fAS4OpH3FaFJmpAT39g62hk^Y`7F3E1j6wVr($-_YyVj zK9T9#X9Pa7xpPCJh+G+2pH$C@vkzNrKS^wGdcKJ_w2%~TiSho@+O^ek>*=9~n0iEN91^vrWlKYbF@fEh+5 zRz}h$64GfKqs82@C^SumY?MhT3Ctu2Ceb5gVfitje_C#_laPRBz73qyi_D$iBH2$* zTSLMl>YTdm3P@V&3y0f`i`KXiHx)2GHJTlT6IXm`?27h zXBY6nAjCWSa#*mdKKo!}HYoGOV9wx1El~m&`8P3En`V$)&)Ez`sV|P!X2}2BPQv7C z!rZE&?WkL{ikXJG;-8R{jVgQOR=^g|I0cjMlRMh44(D`o>hxnzow`espOfv8I=PXw zHb!C+V{0hC(%qPis!`OG*_b56@9}zFhT}_u`oj_5@p|LzWljWeUCycu=gEAUlO^&! zyr)S+WhXd8=&;rmS<3U%_^!$0)oB}xNLz84Byc7@(DyW!8IGF`7Uwv` zTltc-&^{L)9DKERXpuLP zT>fyaIW^TJdL0gE2mi&T=qLf=ynqC#x217NG&4s#O^w6|ePkv*owut*^Rgd5dfqcH zB8Qx`kY+Pgc35Q9^=5_9M9QW&**cojA+aNwr`du9N98RiK!F@2bT&XZT8VcOd#6Z8 z%4F)Dwf4@8AT`&0TE}P43};L1_)2!=#+~7Ny4}$6Ic>X+aGv(mO2bvz@q)YX3Etn#AvKy0jP{l+z z$Q3OlWxiyRY=!2YEbQTca;0z?5a zTLX>e01XYZ4DIZkX8gmUWYuNPO|4Wq`j-S8{ZDrnfB@}z92;<+M)_oDmM;5Ap0qbn zp|S@CHrbHX+wEH<=J{WmFxA%1Y(sJrbxw9J-heML9WN?7OxamjJR pm, 2005. +# Const Kaplinsky , 1998. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.6\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2005-05-23 17:32+0300\n" +"Last-Translator: Pavel Maryanov \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=KOI8-R\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.9.1\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "ÐÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÐÒÏÐÕÝÅÎ ÍÕÓÏÒ ÏÂߣÍÏÍ %ld ÂÁÊÔ" +msgstr[1] "ÐÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÐÒÏÐÕÝÅÎ ÍÕÓÏÒ ÏÂߣÍÏÍ %ld ÂÁÊÔ" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "ÐÅÒÅÉÍÅÎÏ×ÁÎÉÅ %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: ÓÌÉÛËÏÍ ÄÌÉÎÎÏÅ ÉÍÑ ÆÁÊÌÁ" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: ÏÛÉÂËÁ ËÏÎÔÒÏÌØÎÏÊ ÓÕÍÍÙ (0x%x, ÄÏÌÖÎÏ ÂÙÔØ 0x%x)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s ÎÅ ÓÏÚÄÁÎ: ÓÕÝÅÓÔ×ÕÅÔ ×ÅÒÓÉÑ ÎÏ×ÅÅ ÉÌÉ ÔÏÇÏ ÖÅ ×ÏÚÒÁÓÔÁ" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "ÎÅ ÕÄÁÅÔÓÑ ÕÄÁÌÉÔØ ÔÅËÕÝÉÊ %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÓÓÙÌËÕ %s ÎÁ %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÐÏÍÅÎÑÔØ ÍÅÓÔÁÍÉ ÐÏÌÕÓÌÏ×Á %s: ÎÅÞÅÔÎÏÅ ÞÉÓÌÏ ÐÏÌÕÓÌÏ×" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÐÏÍÅÎÑÔØ ÍÅÓÔÁÍÉ ÂÁÊÔÙ %s: ÎÅÞÅÔÎÏÅ ÞÉÓÌÏ ÂÁÊÔÏ×" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "`%s' ÓÕÝÅÓÔ×ÕÅÔ, ÎÏ ÎÅ Ñ×ÌÑÅÔÓÑ ËÁÔÁÌÏÇÏÍ" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÓÓÙÌËÕ %s ÎÁ %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: ÎÅÉÚ×ÅÓÔÎÙÊ ÔÉÐ ÆÁÊÌÁ" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "ÐÒÅÖÄÅ×ÒÅÍÅÎÎÙÊ ËÏÎÅà ÁÒÈÉ×Á" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "ÐÒÅÄÕÐÒÅÖÄÅÎÉÅ: × ÚÁÇÏÌÏ×ËÅ ÁÒÈÉ×Á ÐÒÉÎÑÔ ÏÂÒÁÔÎÙÊ ÐÏÒÑÄÏË ÂÁÊÔÏ×" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "ÓÔÁÎÄÁÒÔÎÙÊ ××ÏÄ ÚÁËÒÙÔ" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d ÂÌÏË\n" +msgstr[1] "%d ÂÌÏËÏ×\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ËÏÎÔÒÏÌØÎÕÀ ÓÕÍÍÕ ÄÌÑ %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: ÏÂÒÅÚÁÅÔÓÑ ÎÏÍÅÒ inode" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "%s: ÏÂÒÅÚÁÅÔÓÑ ÎÏÍÅÒ inode" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +msgid "device number" +msgstr "" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: ÏÂÒÅÚÁÅÔÓÑ ÎÏÍÅÒ inode" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "ÓÔÁÎÄÁÒÔÎÙÊ ×Ù×ÏÄ ÚÁËÒÙÔ" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "ÐÕÓÔÁÑ ÓÔÒÏËÁ ÐÒÏÉÇÎÏÒÉÒÏ×ÁÎÁ" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s ÎÅ ÓÂÒÏÛÅÎ: ÎÅ Ñ×ÌÑÅÔÓÑ ÏÂÙÞÎÙÍ ÆÁÊÌÏÍ" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: ÓÉÍ×ÏÌÉÞÅÓËÁÑ ÓÓÙÌËÁ ÓÌÉÛËÏÍ ÄÌÉÎÎÁÑ" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "ÓÏÚÄÁÎÁ ÓÓÙÌËÁ %s, ÕËÁÚÙ×ÁÀÝÁÑ ÎÁ %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"GNU `cpio' ËÏÐÉÒÕÅÔ ÆÁÊÌÙ × ÁÒÈÉ×Ù É ÉÚ ÎÉÈ\n" +"\n" +"ðÒÉÍÅÒÙ:\n" +" # ëÏÐÉÒÏ×ÁÎÉÅ ÆÁÊÌÏ×, ÐÅÒÅÞÉÓÌÅÎÎÙÈ × ÓÐÉÓËÅ_ÉÍ£Î, × ÁÒÈÉ×\n" +" cpio -o < ÓÐÉÓÏË_ÉͣΠ[> ÁÒÈÉ×]\n" +" # éÚ×ÌÅÞÅÎÉÅ ÆÁÊÌÏ× ÉÚ ÁÒÈÉ×Á\n" +" cpio -i [< ÁÒÈÉ×]\n" +" # ëÏÐÉÒÏ×ÁÎÉÅ ÆÁÊÌÏ×, ÐÅÒÅÞÉÓÌÅÎÎÙÈ × ÓÐÉÓËÅ_ÉÍ£Î, × ËÁÔÁÌÏÇ_ÎÁÚÎÁÞÅÎÉÑ\n" +" cpio -p ËÁÔÁÌÏÇ_ÎÁÚÎÁÞÅÎÉÑ < ÓÐÉÓÏË_ÉÍ£Î\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "%s ÎÅ ÉÍÅÅÔ ÓÍÙÓÌÁ Ó %s" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "ïÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÒÁÂÏÔÙ:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "óÏÚÄÁÎÉÅ ÁÒÈÉ×Á (ÒÁÂÏÔÁ × ÒÅÖÉÍÅ copy-out)" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "éÚ×ÌÅÞÅÎÉÅ ÆÁÊÌÏ× ÉÚ ÁÒÈÉ×Á (ÒÁÂÏÔÁ × ÒÅÖÉÍÅ copy-in)" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "òÁÂÏÔÁ × ÒÅÖÉÍÅ copy-pass" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "÷Ù×ÏÄ ÔÁÂÌÉÃÙ Ó ÓÏÄÅÒÖÉÍÙÍ ×ÈÏÄÎÙÈ ÄÁÎÎÙÈ" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "íÏÄÉÆÉËÁÔÏÒÙ, ÄÅÊÓÔ×ÕÀÝÉÅ × ÌÀÂÏÍ ÒÅÖÉÍÅ:" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[ðïìøúï÷áôåìø@]èïóô:]éíñ_æáêìá" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"éÓÐÏÌØÚÏ×ÁÎÉÅ éíåîé_æáêìá ×ÍÅÓÔÏ ÓÔÁÎÄÁÒÔÎÏÇÏ ××ÏÄÁ ÉÌÉ ×Ù×ÏÄÁ. ïÐÃÉÏÎÁÌØÎÙÅ " +"ðïìøúï÷áôåìø É èïóô ÏÐÒÅÄÅÌÑÀÔ ÉÍÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÑ É ÈÏÓÔÁ × ÓÌÕÞÁÅ ÒÁÂÏÔÙ Ó " +"ÕÄÁÌ£ÎÎÙÍ ÁÒÈÉ×ÏÍ" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "æÁÊÌ ÁÒÈÉ×Á Ñ×ÌÑÅÔÓÑ ÌÏËÁÌØÎÙÍ, ÄÁÖÅ ÅÓÌÉ ÅÇÏ ÉÍÑ ÓÏÄÅÒÖÉÔ Ä×ÏÅÔÏÞÉÅ" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "æïòíáô" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "éÓÐÏÌØÚÏ×ÁÎÉÅ ÄÌÑ ÁÒÈÉ×Á ÕËÁÚÁÎÎÏÇÏ æïòíáôá" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "õÓÔÁÎÏ×ËÁ ÒÁÚÍÅÒÁ ÂÌÏËÁ ××ÏÄÁ/×Ù×ÏÄÁ × 5120 ÂÁÊÔ" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "òáúíåò-âìïëá" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "õÓÔÁÎÏ×ËÁ ÒÁÚÍÅÒÁ ÂÌÏËÁ ××ÏÄÁ/×Ù×ÏÄÁ × òáúíåò-âìïëá * 512 ÂÁÊÔ" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "éÓÐÏÌØÚÏ×ÁÎÉÅ ÄÌÑ ÁÒÈÉ×Á ÓÔÁÒÏÇÏ ÍÁÛÉÎÎÏÎÅÚÁ×ÉÓÉÍÏÇÏ ÆÏÒÍÁÔÁ (ASCII)" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "÷Ù×ÏÄ \".\" ÄÌÑ ËÁÖÄÏÇÏ ÏÂÒÁÂÏÔÁÎÎÏÇÏ ÆÁÊÌÁ" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "þéóìï" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "õÓÔÁÎÏ×ËÁ ÒÁÚÍÅÒÁ ÂÌÏËÁ ××ÏÄÁ/×Ù×ÏÄÁ × þéóìï ÂÁÊÔ" + +#: src/main.c:119 +msgid "STRING" +msgstr "óôòïëá" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "÷Ù×ÏÄ óôòïëé, ËÏÇÄÁ ÎÁ ÒÅÚÅÒ×ÎÏÍ ÎÏÓÉÔÅÌÅ ÄÏÓÔÉÇÎÕÔ ËÏÎÅà ÔÏÍÁ" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" +"ëÏÐÉÒÏ×ÁÎÉÅ ÔÏÌØËÏ ÔÅÈ ÆÁÊÌÏ×, ËÏÔÏÒÙÅ ÎÅ ÓÏ×ÐÁÄÁÀÔ Ó ÕËÁÚÁÎÎÙÍÉ ÛÁÂÌÏÎÁÍÉ" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "÷Ù×ÏÄ ÞÉÓÌÏ×ÏÇÏ UID É GID × ÔÁÂÌÉÃÅ Ó ÐÏÄÒÏÂÎÙÍ ÓÏÄÅÒÖÉÍÙÍ" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "ëïíáîäá" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "éÓÐÏÌØÚÏ×ÁÎÉÅ ÕÄÁÌ£ÎÎÏÊ ëïíáîäù ×ÍÅÓÔÏ rsh" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "îÅ ×Ù×ÏÄÉÔØ ËÏÌÉÞÅÓÔ×Ï ÓËÏÐÉÒÏ×ÁÎÎÙÈ ÂÌÏËÏ×" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "÷Ù×ÏÄ ÐÏÄÒÏÂÎÏÇÏ ÓÐÉÓËÁ ÏÂÒÁÂÏÔÁÎÎÙÈ ÆÁÊÌÏ×" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "÷ËÌÀÞÅÎÉÅ ÏÔÌÁÄÏÞÎÏÊ ÉÎÆÏÒÍÁÃÉÉ" + +#: src/main.c:137 +msgid "FLAG" +msgstr "æìáç" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"õÐÒÁ×ÌÅÎÉÅ ×Ù×ÏÄÏÍ ÐÒÅÄÕÐÒÅÖÄÅÎÉÊ. ÷ ÎÁÓÔÏÑÝÅÅ ×ÒÅÍÑ æìáçÏÍ ÍÏÖÅÔ ÂÙÔØ " +"'none', 'truncate' ÉÌÉ 'all'. íÎÏÇÏËÒÁÔÎÙÅ ÏÐÃÉÉ ÁËËÕÍÕÌÉÒÕÀÔÓÑ." + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "íÏÄÉÆÉËÁÔÏÒÙ, ÄÅÊÓÔ×ÕÀÝÉÅ ÔÏÌØËÏ × ÒÅÖÉÍÅ copy-in:" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "æáêì" + +#: src/main.c:146 +#, fuzzy +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" +"÷ ÒÅÖÉÍÅ copy-in, ÞÔÅÎÉÅ ÉÚ æáêìá ÄÏÐÏÌÎÉÔÅÌØÎÙÈ ÛÁÂÌÏÎÏ×, ÏÐÒÅÄÅÌÑÀÝÉÈ " +"ÉÍÅÎÁ ÉÚ×ÌÅËÁÅÍÙÈ ÆÁÊÌÏ× ÉÌÉ ÓÐÉÓËÁ" + +#: src/main.c:148 +#, fuzzy +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" +"ðÒÉ ÞÔÅÎÉÉ ÁÒÈÉ×Á × ÆÏÒÍÁÔÅ CRC × ÒÅÖÉÍÅ copy-in, ÔÏÌØËÏ ÐÒÏ×ÅÒÑÔØ CRC ×ÓÅÈ " +"ÆÁÊÌÏ×, Á ÎÅ ÉÚ×ÌÅËÁÔØ ÉÈ" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "éÎÔÅÒÁËÔÉ×ÎÏÅ ÐÅÒÅÉÍÅÎÏ×ÁÎÉÅ ÆÁÊÌÏ×" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "íÅÎÑÔØ ÍÅÓÔÁÍÉ É ÐÏÌÕÓÌÏ×Á, É ÂÁÊÔÙ ÐÏÌÕÓÌÏ× × ÄÁÎÎÙÈ. üË×É×ÁÌÅÎÔ -sS" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "íÅÎÑÔØ ÍÅÓÔÁÍÉ ÂÁÊÔÙ ×ÓÅÈ ÐÏÌÕÓÌÏ× × ÆÁÊÌÁÈ" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "íÅÎÑÔØ ÍÅÓÔÁÍÉ ÐÏÌÕÓÌÏ×Á ×ÓÅÈ ÓÌÏ× (4 ÂÁÊÔÁ) × ÆÁÊÌÁÈ" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "éÚ×ÌÅÞÅÎÉÅ ÆÁÊÌÏ× ÎÁ ÓÔÁÎÄÁÒÔÎÙÊ ×Ù×ÏÄ" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "íÏÄÉÆÉËÁÔÏÒÙ, ÄÅÊÓÔ×ÕÀÝÉÅ ÔÏÌØËÏ × ÒÅÖÉÍÅ copy-out:" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "äÏÂÁ×ÌÅÎÉÅ Ë ÓÕÝÅÓÔ×ÕÀÝÅÍÕ ÁÒÈÉ×Õ." + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"éÓÐÏÌØÚÏ×ÁÎÉÅ ÆÁÊÌÁ ×ÍÅÓÔÏ ÓÔÁÎÄÁÒÔÎÏÇÏ ×Ù×ÏÄÁ. ïÐÃÉÏÎÁÌØÎÙÅ ðïìøúï÷áôåìø É " +"èïóô ÏÐÒÅÄÅÌÑÀÔ ÉÍÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÑ É ÈÏÓÔÁ × ÓÌÕÞÁÅ ÒÁÂÏÔÙ Ó ÕÄÁÌ£ÎÎÙÍ " +"ÁÒÈÉ×ÏÍ" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "íÏÄÉÆÉËÁÔÏÒÙ, ÄÅÊÓÔ×ÕÀÝÉÅ ÔÏÌØËÏ × ÒÅÖÉÍÅ copy-pass:" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "óÏÚÄÁÎÉÅ ÓÓÙÌÏË ÎÁ ÆÁÊÌÙ ×ÍÅÓÔÏ ÉÈ ËÏÐÉÒÏ×ÁÎÉÑ, ËÏÇÄÁ ÜÔÏ ×ÏÚÍÏÖÎÏ" + +#: src/main.c:186 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "íÏÄÉÆÉËÁÔÏÒÙ, ÄÅÊÓÔ×ÕÀÝÉÅ × ÒÅÖÉÍÁÈ copy-in É copy-pass:" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "óÏÚÄÁÎÉÅ ×ÓÅÈ ÆÁÊÌÏ× ÏÔÎÏÓÉÔÅÌØÎÏ ÔÅËÕÝÅÇÏ ËÁÔÁÌÏÇÁ" + +#: src/main.c:196 +#, fuzzy +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "íÏÄÉÆÉËÁÔÏÒÙ, ÄÅÊÓÔ×ÕÀÝÉÅ × ÒÅÖÉÍÁÈ copy-out É copy-pass:" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" +"óÐÉÓÏË ÉͣΠÆÁÊÌÏ×, ÏËÁÎÞÉ×ÁÀÝÉÈÓÑ ÐÕÓÔÙÍ ÓÉÍ×ÏÌÏÍ ×ÍÅÓÔÏ ÓÉÍ×ÏÌÁ ÎÏ×ÏÊ " +"ÓÔÒÏËÉ" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"éÓÐÏÌØÚÏ×ÁÎÉÅ ÆÁÊÌÁ ×ÍÅÓÔÏ ÓÔÁÎÄÁÒÔÎÏÇÏ ××ÏÄÁ. ïÐÃÉÏÎÁÌØÎÙÅ ðïìøúï÷áôåìø É " +"èïóô ÏÐÒÅÄÅÌÑÀÔ ÉÍÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÑ É ÈÏÓÔÁ × ÓÌÕÞÁÅ ÒÁÂÏÔÙ Ó ÕÄÁÌ£ÎÎÙÍ " +"ÁÒÈÉ×ÏÍ" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"òÁÚÙÍÅÎÏ×Ù×ÁÎÉÅ ÓÉÍ×ÏÌÉÞÅÓËÉÈ ÓÓÙÌÏË (ËÏÐÉÒÏ×ÁÎÉÅ ÆÁÊÌÏ×, ÎÁ ËÏÔÏÒÙÅ ÏÎÉ " +"ÕËÁÚÙ×ÁÀÔ, ×ÍÅÓÔÏ ËÏÐÉÒÏ×ÁÎÉÑ ÓÁÍÉÈ ÓÓÙÌÏË)" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[ðïìøúï÷áôåìø][:.][çòõððá]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" +"îÁÚÎÁÞÅÎÉÅ ÐÒÁ× ×ÌÁÄÅÎÉÑ, ÏÐÒÅÄÅÌ£ÎÎÙÈ ÞÅÒÅÚ ðïìøúï÷áôåìø É/ÉÌÉ çòõððá, ÄÌÑ " +"×ÓÅÈ ÓÏÚÄÁÎÎÙÈ ÆÁÊÌÏ×" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "óÂÒÏÓ ×ÒÅÍÅÎÉ ÄÏÓÔÕÐÁ Ë ÆÁÊÌÁÍ ÐÏÓÌÅ ÉÈ ÓÞÉÔÙ×ÁÎÉÑ" + +#: src/main.c:212 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "íÏÄÉÆÉËÁÔÏÒÙ, ÄÅÊÓÔ×ÕÀÝÉÅ × ÒÅÖÉÍÁÈ copy-in É copy-pass:" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "úÁÐÏÍÉÎÁÎÉÅ ÐÒÅÄÙÄÕÝÅÇÏ ×ÒÅÍÅÎÉ ÉÚÍÅÎÅÎÉÑ ÆÁÊÌÏ× ÐÒÉ ÓÏÚÄÁÎÉÉ ÆÁÊÌÏ×" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "óÏÚÄÁÎÉÅ ÐÒÉ ÎÅÏÂÈÏÄÉÍÏÓÔÉ ÎÁÞÁÌØÎÙÈ ËÁÔÁÌÏÇÏ×" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "îÅ ÉÚÍÅÎÑÔØ ÐÒÁ×Á ×ÌÁÄÅÎÉÑ ÆÁÊÌÏ×" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "âÅÚÕÓÌÏ×ÎÁÑ ÚÁÍÅÎÁ ×ÓÅÈ ÆÁÊÌÏ×" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" +"úÁÐÉÓØ ÆÁÊÌÏ× Ó ÂÏÌØÛÉÍÉ ÂÌÏËÁÍÉ ÉÚ ÎÕÌÅÊ × ËÁÞÅÓÔ×Å ÒÁÚÒÅÖ£ÎÎÙÈ ÆÁÊÌÏ×" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "éÎÆÏÒÍÁÔÉ×ÎÙÅ ÏÐÃÉÉ:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "÷Ù×ÏÄ ÜÔÏÊ ÓÐÒÁ×ËÉ" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "÷Ù×ÏÄ ËÒÁÔËÏÇÏ ÓÏÏÂÝÅÎÉÑ Ï ÉÓÐÏÌØÚÏ×ÁÎÉÉ" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "÷Ù×ÏÄ ÌÉÃÅÎÚÉÉ É ×ÙÈÏÄ" + +#: src/main.c:233 +msgid "Print program version" +msgstr "÷Ù×ÏÄ ×ÅÒÓÉÉ ÐÒÏÇÒÁÍÍÙ" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, fuzzy, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +" GNU cpio Ñ×ÌÑÅÔÓÑ ÏÔËÒÙÔÙÍ ÐÒÏÇÒÁÍÍÎÙÍ ÏÂÅÓÐÅÞÅÎÉÅÍ; ×Ù ÍÏÖÅÔÅ\n" +" ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÅ ÄÁÌÅÅ É/ÉÌÉ ÉÚÍÅÎÑÔØ ÅÅ ÓÏÇÌÁÓÎÏ ÕÓÌÏ×ÉÑÍÉ GNU\n" +" General Public License, ÏÐÕÂÌÉËÏ×ÁÎÎÏÊ Free Software Foundation 2-Ê\n" +" ×ÅÒÓÉÉ ÉÌÉ (ÎÁ ×ÁÛÅ ÕÓÍÏÔÒÅÎÉÅ) ÌÀÂÏÊ ÄÒÕÇÏÊ ÂÏÌÅÅ ÐÏÚÄÎÅÊ ×ÅÒÓÉÉ.\n" +"\n" +" GNU cpio ÒÁÓÐÒÏÓÔÒÁÎÑÅÔÓÑ × ÎÁÄÅÖÄÅ, ÞÔÏ ÏÎÁ ÂÕÄÅÔ ÐÏÌÅÚÎÁ,\n" +" ÎÏ âåú ÷óñëïê çáòáîôéé; ÄÁÖÅ ÂÅÚ ÐÏÄÒÁÚÕÍÅ×ÁÅÍÏÊ ÇÁÒÁÎÔÉÉ\n" +" ðòéçïäîïóôé äìñ ðòïäáöé ÉÌÉ ðòéíåîéíïóôé äìñ ëïîëòåôîïê ãåìé. úÁ ÂÏÌÅÅ\n" +" ÐÏÄÒÏÂÎÏÊ ÉÎÆÏÒÍÁÃÉÅÊ ÏÂÒÁÝÁÊÔÅÓØ Ë GNU General Public License.\n" +"\n" +" ÷Ù ÄÏÌÖÎÙ ÂÙÌÉ ÐÏÌÕÞÉÔØ ËÏÐÉÀ GNU General Public License ×ÍÅÓÔÅ Ó ÜÔÏÊ\n" +" ÐÒÏÇÒÁÍÍÏÊ; ÅÓÌÉ ÜÔÏ ÎÅ ÔÁË, ÓÏÏÂÝÉÔÅ Ï ÜÔÏÍ Free Software Foundation,\n" +" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" +"\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "ÎÅÄÏÐÕÓÔÉÍÙÊ ÒÁÚÍÅÒ ÂÌÏËÁ" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "æÏÒÍÁÔ ÁÒÈÉ×Á ÏÐÒÅÄẠ̊ΠÎÅÓËÏÌØËÏ ÒÁÚ" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"ÎÅ×ÅÒÎÙÊ ÆÏÒÍÁÔ ÁÒÈÉ×Á `%s'; ÄÏÐÕÓÔÉÍÙÅ ÆÏÒÍÁÔÙ:\n" +"crc newc odc bin ustar tar (all-caps ÔÁËÖÅ ÒÁÓÐÏÚÎÁ£ÔÓÑ)" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "òÅÖÉÍ ÕÖÅ ÏÐÒÅÄÅÌ£Î" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "--no-preserve-owner ÎÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ Ó --owner" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "--owner ÎÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ Ó --no-preserve-owner" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "îÅ×ÅÒÎÏÅ ÚÎÁÞÅÎÉÅ ÄÌÑ ÏÐÃÉÉ --warning: %s" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[ËÁÔÁÌÏÇ_ÎÁÚÎÁÞÅÎÉÑ]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"÷Ù ÄÏÌÖÎÙ ÕËÁÚÁÔØ ÏÄÎÕ ÉÚ ÏÐÃÉÊ -oipt.\n" +"ðÏÐÒÏÂÕÊÔÅ `%s --help' ÉÌÉ `%s --usage' ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÄÏÐÏÌÎÉÔÅÌØÎÏÊ " +"ÉÎÆÏÒÍÁÃÉÉ.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "é -I, É -F ÉÓÐÏÌØÚÕÀÔÓÑ × ÒÅÖÉÍÅ copy-in" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "óÌÉÛËÏÍ ÍÎÏÇÏ ÁÒÇÕÍÅÎÔÏ×" + +#: src/main.c:677 +#, fuzzy, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"ÉÓÐÏÌØÚÕÅÔÓÑ --append, ÎÏ ÎÅ ÕËÁÚÁÎÏ ÉÍÑ ÆÁÊÌÁ ÁÒÈÉ×Á (ÉÓÐÏÌØÚÕÊÔÅ ÏÐÃÉÉ -F " +"ÉÌÉ -O" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "é -O, É -F ÉÓÐÏÌØÚÕÀÔÓÑ × ÒÅÖÉÍÅ copy-out" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "óÌÉÛËÏÍ ÍÎÏÇÏ ÁÒÇÕÍÅÎÔÏ×" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" +"îÅ ÕËÁÚÁÎ ÆÏÒÍÁÔ ÁÒÈÉ×Á × ÒÅÖÉÍÅ copy-pass (ÉÓÐÏÌØÚÕÊÔÅ ÏÐÃÉÀ --format)" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "-F ÍÏÖÅÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ ÔÏÌØËÏ Ó --create ÉÌÉ --extract" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "ÎÅ ÕÄÁÅÔÓÑ ÕÄÁÌÉÔØ ÔÅËÕÝÉÊ %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "ÏÛÉÂËÁ ÐÒÉ ÚÁËÒÙÔÉÉ ÁÒÈÉ×Á" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ËÁÔÁÌÏÇ `%s'" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s' ÓÕÝÅÓÔ×ÕÅÔ, ÎÏ ÎÅ Ñ×ÌÑÅÔÓÑ ËÁÔÁÌÏÇÏÍ" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"éÓÐÏÌØÚÏ×ÁÎÉÅ: %s [-V] [-f ÕÓÔÒÏÊÓÔ×Ï] [--file=ÕÓÔÒÏÊÓÔ×Ï] [--rsh-" +"command=command]\n" +"\t[--help] [--version] ÏÐÅÒÁÃÉÑ [ÓÞ£ÔÞÉË]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "ÎÅ ÕËÁÚÁÎÏ ÌÅÎÔÏÞÎÏÅ ÕÓÔÒÏÊÓÔ×Ï" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "ÎÅ×ÅÒÎÙÊ ÚÁÇÏÌÏ×ÏË: ÏÛÉÂËÁ ËÏÎÔÒÏÌØÎÏÊ ÓÕÍÍÙ" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "ÎÅ×ÅÒÎÙÊ ÐÏÌØÚÏ×ÁÔÅÌØ" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÏÐÒÅÄÅÌÉÔØ ÇÒÕÐÐÕ ÒÅÇÉÓÔÒÁÃÉÉ ÐÏ ÞÉÓÌÏ×ÏÍÕ UID" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "ÎÅ×ÅÒÎÁÑ ÇÒÕÐÐÁ" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "ÏÛÉÂËÁ ÚÁÐÉÓÉ" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "ÏÛÉÂËÁ ÞÔÅÎÉÑ" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "ÐÒÅÖÄÅ×ÒÅÍÅÎÎÙÊ ËÏÎÅà ÆÁÊÌÁ" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "òÁÚÍÅÒ ÆÁÊÌÁ %s ÍÅÎØÛÅ ÎÁ %ld ÂÁÊÔ, ÚÁÐÏÌÎÑÅÔÓÑ ÕÌÑÍÉ" +msgstr[1] "òÁÚÍÅÒ ÆÁÊÌÁ %s ÍÅÎØÛÅ ÎÁ %ld ÂÁÊÔ, ÚÁÐÏÌÎÑÅÔÓÑ ÕÌÑÍÉ" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "ïÛÉÂËÁ ÞÔÅÎÉÑ × ÐÏÚÉÃÉÉ %ld ÆÁÊÌÁ %s, ÚÁÐÏÌÎÑÅÔÓÑ ÎÕÌÑÍÉ" + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "æÁÊÌ %s Õ×ÅÌÉÞÉÌÓÑ, %ld ÎÏ×ÙÈ ÂÁÊÔ ÎÅ ÓËÏÐÉÒÏ×ÁÎÏ" +msgstr[1] "æÁÊÌ %s Õ×ÅÌÉÞÉÌÓÑ, %ld ÎÏ×ÙÈ ÂÁÊÔ ÎÅ ÓËÏÐÉÒÏ×ÁÎÏ" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "æÁÊÌ %s ÂÙÌ ÉÚÍÅΣΠ×Ï ×ÒÅÍÑ ËÏÐÉÒÏ×ÁÎÉÑ" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "×ÉÒÔÕÁÌØÎÁÑ ÐÁÍÑÔØ ÉÓÞÅÒÐÁÎÁ" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "ÐÏÚÉÃÉÏÎÉÒÏ×ÁÎÉÅ × ×ÙÈÏÄÎÏÍ ÐÏÔÏËÅ ÎÅ×ÏÚÍÏÖÎÏ" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "ïÂÎÁÒÕÖÅÎ ËÏÎÅà ÌÅÎÔÙ. úÁÐÒÁ×ØÔÅ ÎÏ×ÕÀ ÌÅÎÔÕ É ÎÁÖÍÉÔÅ RETURN. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"ïÂÎÁÒÕÖÅÎ ËÏÎÅà ÌÅÎÔÙ. ÷×ÅÄÉÔÅ ÉÍÑ ÆÁÊÌÁ/ÕÓÔÒÏÊÓÔ×Á, ÞÔÏÂÙ ÐÒÏÄÏÌÖÉÔØ.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "÷×ÅÄÉÔÅ ÉÍÑ ÆÁÊÌÁ/ÕÓÔÒÏÊÓÔ×Á, ÞÔÏÂÙ ÐÒÏÄÏÌÖÉÔØ.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "×ÎÕÔÒÅÎÎÑÑ ÏÛÉÂËÁ: ÄÅÓËÒÉÐÔÏÒ ÌÅÎÔÙ ÉÚÍÅÎÅÎ Ó %d ÎÁ %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: ÏÐÃÉÑ `%s' ×ÙÚÙ×ÁÅÔ ÎÅÏÄÎÏÚÎÁÞÎÏÓÔØ\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: ÏÐÃÉÑ `--%s' ÎÅ ÄÏÐÕÓËÁÅÔ ÕËÁÚÁÎÉÑ ÁÒÇÕÍÅÎÔÁ\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: ÏÐÃÉÑ `%c%s' ÎÅ ÄÏÐÕÓËÁÅÔ ÕËÁÚÁÎÉÑ ÁÒÇÕÍÅÎÔÁ\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: ÏÐÃÉÑ `%s' ÔÒÅÂÕÅÔ ÕËÁÚÁÎÉÑ ÁÒÇÕÍÅÎÔÁ\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ÎÅÒÁÓÐÏÚÎÁÎÎÁÑ ÏÐÃÉÑ `--%s'\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ÎÅÒÁÓÐÏÚÎÁÎÎÁÑ ÏÐÃÉÑ `%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ÎÅÄÏÐÕÓÔÉÍÁÑ ÏÐÃÉÑ -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ÎÅ×ÅÒÎÁÑ ÏÐÃÉÑ -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: ÏÐÃÉÑ ÔÒÅÂÕÅÔ ÕËÁÚÁÎÉÑ ÁÒÇÕÍÅÎÔÁ -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: ÏÐÃÉÑ `-W %s' ×ÙÚÙ×ÁÅÔ ÎÅÏÄÎÏÚÎÁÞÎÏÓÔØ\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: ÏÐÃÉÑ `-W %s' ÎÅ ÄÏÐÕÓËÁÅÔ ÕËÁÚÁÎÉÑ ÁÒÇÕÍÅÎÔÁ\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: óÌÕÖÂÁ ÎÅÄÏÓÔÕÐÎÁ" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "stdin" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "stdout" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "îÅ×ÏÚÍÏÖÎÏ ÚÁÐÕÓÔÉÔØ ÕÄÁÌ£ÎÎÙÊ ËÏÍÁÎÄÎÙÊ ÐÒÏÃÅÓÓÏÒ" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, fuzzy, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "îÅ ÉÚÍÅÎÑÔØ ÐÒÁ×Á ×ÌÁÄÅÎÉÑ ÆÁÊÌÏ×" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÓÓÙÌËÕ %s ÎÁ %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "ïÛÉÂËÁ ÞÔÅÎÉÑ × ÐÏÚÉÃÉÉ %ld ÆÁÊÌÁ %s, ÚÁÐÏÌÎÑÅÔÓÑ ÎÕÌÑÍÉ" +msgstr[1] "ïÛÉÂËÁ ÞÔÅÎÉÑ × ÐÏÚÉÃÉÉ %ld ÆÁÊÌÁ %s, ÚÁÐÏÌÎÑÅÔÓÑ ÎÕÌÑÍÉ" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÓÓÙÌËÕ %s ÎÁ %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÓÓÙÌËÕ %s ÎÁ %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#~ msgid "error %d" +#~ msgstr "ÏÛÉÂËÁ %d" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "ïÛÉÂËÁ ÞÔÅÎÉÑ × ÐÏÚÉÃÉÉ %ld ÆÁÊÌÁ %s, ÚÁÐÏÌÎÑÅÔÓÑ ÎÕÌÑÍÉ" +#~ msgstr[1] "ïÛÉÂËÁ ÞÔÅÎÉÑ × ÐÏÚÉÃÉÉ %ld ÆÁÊÌÁ %s, ÚÁÐÏÌÎÑÅÔÓÑ ÎÕÌÑÍÉ" diff --git a/po/rw.gmo b/po/rw.gmo new file mode 100644 index 0000000000000000000000000000000000000000..6aee1bb7eb5a8cffaaaa66a81faeaf25bbb6821b GIT binary patch literal 506 zcmYL_!A=`75QeuERi!=l%wc+K)z0D#kRT^PQ6Z65up+<~sYkP!EUq^8%Ju?z5Kg=s z55W^K3yA!hPaezvc*cJEw)GIPJ~P|QZ{`a#Vmi&4E#{ng{1io3ynbb#Ip_FLSO2P6 zb~=sb&i*sIe|!?kl~(KW*i)uoAA@3OmcBGHqgA70=HK zJaVK0SL3k?B%vq707W0g0Mb2~_J4_8A=ro)bgR2A8{a;PJq}2P+~<72zEkA`7ET#o zt6-gk%RskeAlK!Mq8jqnH8*P*ty;I75C&^&pOkiW$d#sQRYh2kT1hz3X06@m0N}D0@ zNX}Cj|1D;Cu<>=xmgI11O1sdel5lXXLp-lrr)r#8xAGE9^Sbrp-Vol>@ec#v$B_OU N#!+^BcA5Q~Mlb&-kIn!9 literal 0 HcmV?d00001 diff --git a/po/rw.po b/po/rw.po new file mode 100644 index 0000000..f55cfd3 --- /dev/null +++ b/po/rw.po @@ -0,0 +1,1012 @@ +# Kinyarwanda translations for cpio package. +# Copyright (C) 2005 Free Software Foundation, Inc. +# This file is distributed under the same license as the cpio package. +# Steve Murphy , 2005. +# Steve performed initial rough translation from compendium built from translations provided by the following translators: +# Philibert Ndandali , 2005. +# Viateur MUGENZI , 2005. +# Noëlla Mupole , 2005. +# Carole Karema , 2005. +# JEAN BAPTISTE NGENDAHAYO , 2005. +# Augustin KIBERWA , 2005. +# Donatien NSENGIYUMVA , 2005. +# Antoine Bigirimana , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.6\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2005-04-04 10:55-0700\n" +"Last-Translator: Steven Michael Murphy \n" +"Language-Team: Kinyarwanda \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/copyin.c:45 +#, fuzzy, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "Iburira Bayite Bya Umwanda" + +# basctl/source\basicide\basidesh.src:RID_POPUP_TABBAR.SID_BASICIDE_RENAMECURRENT.text +#: src/copyin.c:66 +#, fuzzy, c-format +msgid "rename %s -> " +msgstr "Guhindura izina" + +#: src/copyin.c:95 src/copyout.c:562 +#, fuzzy, c-format +msgid "%s: file name too long" +msgstr "%s:IDOSIYE Izina:" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s:Ikosa" + +#: src/copyin.c:208 src/copypass.c:129 +#, fuzzy, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%sOYA Byaremwe Cyangwa Verisiyo" + +#: src/copyin.c:218 src/copypass.c:137 +#, fuzzy, c-format +msgid "cannot remove current %s" +msgstr "Gukuraho... KIGEZWEHO" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, fuzzy, c-format +msgid "cannot link %s to %s" +msgstr "Ihuza Kuri" + +#: src/copyin.c:509 +#, fuzzy, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "Bya IGIHARWE Umubare Bya" + +#: src/copyin.c:517 +#, fuzzy, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "Bayite Bya IGIHARWE Umubare Bya Bayite" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "`%s'ni OYA a bushyinguro" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "Ihuza Kuri" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, fuzzy, c-format +msgid "%s: unknown file type" +msgstr "%s:Kitazwi IDOSIYE Ubwoko" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, fuzzy, c-format +msgid "premature end of archive" +msgstr "Impera Bya" + +#: src/copyin.c:1266 +#, fuzzy, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "Iburira Umutwempangano Ihindurakerekezo Bayite Itondekanya" + +#: src/copyin.c:1413 +#, fuzzy, c-format +msgid "standard input is closed" +msgstr "Bisanzwe Iyinjiza ni" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "" +msgstr[1] "" + +#: src/copyout.c:51 src/copyout.c:60 +#, fuzzy, c-format +msgid "cannot read checksum for %s" +msgstr "Gusoma kugirango" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s:Umubare" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "%s:Umubare" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +msgid "device number" +msgstr "" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, fuzzy, c-format +msgid "%s: truncating inode number" +msgstr "%s:Umubare" + +#: src/copyout.c:620 +#, fuzzy, c-format +msgid "standard output is closed" +msgstr "Bisanzwe Ibisohoka ni" + +#: src/copyout.c:641 src/copypass.c:86 +#, fuzzy, c-format +msgid "blank line ignored" +msgstr "Ahatanditseho Umurongo" + +#: src/copyout.c:776 +#, fuzzy, c-format +msgid "%s not dumped: not a regular file" +msgstr "%sOYA OYA a Ibisanzwe IDOSIYE" + +#: src/copyout.c:827 +#, fuzzy, c-format +msgid "%s: symbolic link too long" +msgstr "%s:Ihuza" + +#: src/copypass.c:422 +#, fuzzy, c-format +msgid "%s linked to %s" +msgstr "%sKuri" + +#: src/main.c:67 +#, fuzzy +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"Amakopi Idosiye Kuri Na Bivuye Idosiye in Izina: Urutonde Kuri i o Izina: " +"Urutonde Idosiye Bivuye i i Idosiye in Izina: Urutonde Kuri Ishyika P " +"Ishyika bushyinguro Izina:" + +#: src/main.c:81 +#, fuzzy, c-format +msgid "%s is meaningless with %s" +msgstr "%sni Na:" + +#: src/main.c:87 +#, fuzzy +msgid "Main operation mode:" +msgstr "Ubwoko" + +#: src/main.c:89 +#, fuzzy +msgid "Create the archive (run in copy-out mode)" +msgstr "i Gukoresha in Gukoporora Inyuma Ubwoko" + +#: src/main.c:91 +#, fuzzy +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "Idosiye Bivuye Gukoresha in Gukoporora in Ubwoko" + +#: src/main.c:93 +#, fuzzy +msgid "Run in copy-pass mode" +msgstr "in Gukoporora Ubwoko" + +#: src/main.c:95 +#, fuzzy +msgid "Print a table of contents of the input" +msgstr "a imbonerahamwe# Bya Ibigize Bya i Iyinjiza" + +#: src/main.c:101 +#, fuzzy +msgid "Operation modifiers valid in any mode:" +msgstr "Byemewe in Ubwoko" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +#, fuzzy +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"iyi Bya Bisanzwe Iyinjiza Cyangwa Ibisohoka Na i Ukoresha: Na Ubuturo " +"Amazina in Bya a" + +#: src/main.c:106 +#, fuzzy +msgid "Archive file is local, even if its name contains colons" +msgstr "IDOSIYE ni ATARIIGIHARWE NIBA Izina: Kirimo" + +#: src/main.c:107 +#, fuzzy +msgid "FORMAT" +msgstr "Imiterere" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +#, fuzzy +msgid "Set the I/O block size to 5120 bytes" +msgstr "i Funga Ingano Kuri Bayite" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +#, fuzzy +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "i Funga Ingano Kuri Bayite" + +#: src/main.c:114 +#, fuzzy +msgid "Use the old portable (ASCII) archive format" +msgstr "i ki/ bishaje Imiterere" + +#: src/main.c:116 +#, fuzzy +msgid "Print a \".\" for each file processed" +msgstr "a kugirango IDOSIYE" + +#: src/main.c:117 +#, fuzzy +msgid "NUMBER" +msgstr "Umubare" + +#: src/main.c:118 +#, fuzzy +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "i Funga Ingano Kuri i Bya Bayite" + +# svx/source\options\optcolor.src:RID_SVXPAGE_COLORCONFIG.CT_COLORCONFIG.WN_SCROLL.FT_BASICSTRING.text +#: src/main.c:119 +#, fuzzy +msgid "STRING" +msgstr "Ikurikiranyanyuguti" + +#: src/main.c:120 +#, fuzzy +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "Ryari: i Impera Bya a Igice Bya i Inyibutsa Ibitangazamakuru ni" + +#: src/main.c:123 +#, fuzzy +msgid "Only copy files that do not match any of the given patterns" +msgstr "Gukoporora Idosiye OYA BIHUYE Bya i" + +#: src/main.c:125 +#, fuzzy +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "i imbonerahamwe# Bya Ibigize Garagaza Bikurikije umubare Na" + +# padmin/source\rtsetup.src:RID_RTS_RTSDIALOG.RID_RTS_RTSDIALOG_TABCONTROL.RID_RTS_COMMANDPAGE.text +#: src/main.c:127 +#, fuzzy +msgid "COMMAND" +msgstr "Icyo wifuza" + +#: src/main.c:128 +#, fuzzy +msgid "Use remote COMMAND instead of rsh" +msgstr "Bya" + +#: src/main.c:130 +#, fuzzy +msgid "Do not print the number of blocks copied" +msgstr "OYA Gucapa i Umubare Bya" + +#: src/main.c:132 +#, fuzzy +msgid "Verbosely list the files processed" +msgstr "Urutonde i Idosiye" + +#: src/main.c:135 +#, fuzzy +msgid "Enable debugging info" +msgstr "Ibisobanuro" + +#: src/main.c:137 +#, fuzzy +msgid "FLAG" +msgstr "Ibendera" + +#: src/main.c:138 +#, fuzzy +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "Iburira Kugaragaza ni Bya Amahitamo" + +#: src/main.c:144 +#, fuzzy +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Byemewe in Gukoporora in Ubwoko" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "IDOSIYE" + +#: src/main.c:146 +#, fuzzy +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "Gukoporora in Ubwoko Gusoma Kuri Cyangwa Urutonde Bivuye" + +#: src/main.c:148 +#, fuzzy +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "a Imiterere in Gukoporora in Ubwoko i Bya IDOSIYE in i i Idosiye" + +#: src/main.c:150 +#, fuzzy +msgid "Interactively rename files" +msgstr "Guhindura izina Idosiye" + +#: src/main.c:154 +#, fuzzy +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "Byombi Bya Amagambo Na Bayite Bya in i Ibyatanzwe Kuri" + +#: src/main.c:156 +#, fuzzy +msgid "Swap the bytes of each halfword in the files" +msgstr "i Bayite Bya in i Idosiye" + +#: src/main.c:158 +#, fuzzy +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "i Bya ijambo 4. Bayite in i Idosiye" + +#: src/main.c:161 +#, fuzzy +msgid "Extract files to standard output" +msgstr "Idosiye Kuri Bisanzwe Ibisohoka" + +#: src/main.c:167 +#, fuzzy +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Byemewe in Gukoporora Inyuma Ubwoko" + +#: src/main.c:169 +#, fuzzy +msgid "Append to an existing archive." +msgstr "Kuri" + +#: src/main.c:171 +#, fuzzy +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Izina ry'idosiye: Kuri Gukoresha Bya Bisanzwe Ibisohoka Na i Ukoresha: Na " +"Ubuturo Amazina in Bya a" + +#: src/main.c:177 +#, fuzzy +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Byemewe in Gukoporora Ubwoko" + +#: src/main.c:179 +#, fuzzy +msgid "Link files instead of copying them, when possible" +msgstr "Idosiye Bya Ryari:" + +#: src/main.c:186 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "Byemewe kugirango Gukoporora in Na Gukoporora" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +#, fuzzy +msgid "Create all files relative to the current directory" +msgstr "Byose Idosiye Bifitanye isano Kuri i KIGEZWEHO bushyinguro" + +#: src/main.c:196 +#, fuzzy +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "Byemewe kugirango Gukoporora Inyuma Na Gukoporora" + +#: src/main.c:198 +#, fuzzy +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "A Urutonde Bya ni ku a NTAGIHARI Inyuguti Bya a" + +#: src/main.c:200 +#, fuzzy +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Izina ry'idosiye: Kuri Gukoresha Bya Bisanzwe Iyinjiza Na i Ukoresha: Na " +"Ubuturo Amazina in Bya a" + +#: src/main.c:202 +#, fuzzy +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "amahuza Gukoporora i Idosiye Akadomo Kuri Bya i amahuza" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +#, fuzzy +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "i Bya Byose Idosiye Byaremwe Kuri i Na Cyangwa" + +#: src/main.c:206 +#, fuzzy +msgid "Reset the access times of files after reading them" +msgstr "i Times Bya Idosiye Nyuma" + +#: src/main.c:212 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "Byemewe kugirango Gukoporora in Na Gukoporora" + +#: src/main.c:214 +#, fuzzy +msgid "Retain previous file modification times when creating files" +msgstr "Ibanjirije IDOSIYE Times Ryari: Idosiye" + +#: src/main.c:216 +#, fuzzy +msgid "Create leading directories where needed" +msgstr "Nyobora ububiko bw'amaderese" + +#: src/main.c:218 +#, fuzzy +msgid "Do not change the ownership of the files" +msgstr "OYA Guhindura>> i Bya i Idosiye" + +#: src/main.c:220 +#, fuzzy +msgid "Replace all files unconditionally" +msgstr "Byose Idosiye" + +#: src/main.c:222 +#, fuzzy +msgid "Write files with large blocks of zeros as sparse files" +msgstr "Idosiye Na: Binini Bya Nka Idosiye" + +#: src/main.c:228 +#, fuzzy +msgid "Informative options:" +msgstr "Amahitamo" + +#: src/main.c:230 +#, fuzzy +msgid "Give this help list" +msgstr "iyi Ifashayobora Urutonde" + +#: src/main.c:231 +#, fuzzy +msgid "Give a short usage message" +msgstr "a Ikoresha: Ubutumwa" + +#: src/main.c:232 +#, fuzzy +msgid "Print license and exit" +msgstr "Na Gusohoka" + +#: src/main.c:233 +#, fuzzy +msgid "Print program version" +msgstr "Porogaramu Verisiyo" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, fuzzy, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +"ni Kigenga Na Cyangwa i Bya i Nka i Verisiyo 2. Bya i ku Ihitamo Verisiyo ni " +"in i ATARIIGIHARWE i Cyangwa A kugirango Birenzeho Birambuye BYAKIRIWE a " +"Gukoporora Bya i Na: NIBA OYA Kwandika Kuri i" + +#: src/main.c:333 src/main.c:350 +#, fuzzy, c-format +msgid "invalid block size" +msgstr "Sibyo Funga Ingano" + +#: src/main.c:339 src/main.c:371 +#, fuzzy, c-format +msgid "Archive format multiply defined" +msgstr "Imiterere Gukuba" + +#: src/main.c:389 +#, fuzzy, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "Sibyo Imiterere Byemewe Imiterere Byose Inyuguti nkuru" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, fuzzy, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "--Oya Na:" + +#: src/main.c:483 +#, fuzzy, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "--Na: Oya" + +#: src/main.c:530 +#, fuzzy, c-format +msgid "Invalid value for --warning option: %s" +msgstr "Agaciro kugirango Iburira Ihitamo" + +#: src/main.c:583 +#, fuzzy +msgid "[destination-directory]" +msgstr "[Ishyika bushyinguro" + +#: src/main.c:602 src/main.c:618 +#, fuzzy, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "Bya Amahitamo Cyangwa kugirango Birenzeho Ibisobanuro" + +#: src/main.c:646 +#, fuzzy, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "Na in Gukoporora in Ubwoko" + +#: src/main.c:658 src/main.c:694 +#, fuzzy, c-format +msgid "Too many arguments" +msgstr "ingingo" + +#: src/main.c:677 +#, fuzzy, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "--Kongeraho... ni Oya IDOSIYE Izina: ni Gukoresha Cyangwa Amahitamo" + +#: src/main.c:683 +#, fuzzy, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "Na in Gukoporora Inyuma Ubwoko" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "ingingo" + +#: src/main.c:700 +#, fuzzy, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "Imiterere ni OYA in Gukoporora Ubwoko Gukoresha Imiterere Ihitamo" + +#: src/main.c:722 +#, fuzzy, c-format +msgid "-F can be used only with --create or --extract" +msgstr "-Na: Kurema Cyangwa" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "Gukuraho... KIGEZWEHO" + +#: src/main.c:797 +#, fuzzy, c-format +msgid "error closing archive" +msgstr "Ikosa" + +#: src/makepath.c:117 src/makepath.c:184 +#, fuzzy, c-format +msgid "cannot make directory `%s'" +msgstr "Ubwoko bushyinguro" + +#: src/makepath.c:159 src/makepath.c:237 +#, fuzzy, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s'ni OYA a bushyinguro" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, fuzzy, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"V F APAREYE IDOSIYE APAREYE Komandi: Komandi: Ifashayobora Verisiyo IBARA" + +#: src/mt.c:307 +#, fuzzy, c-format +msgid "no tape device specified" +msgstr "Oya APAREYE" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, fuzzy, c-format +msgid "invalid header: checksum error" +msgstr "Sibyo Umutwempangano Ikosa" + +#: src/userspec.c:142 +#, fuzzy +msgid "invalid user" +msgstr "Sibyo Ukoresha:" + +#: src/userspec.c:148 +#, fuzzy +msgid "cannot get the login group of a numeric UID" +msgstr "Kubona i Ifashayinjira Itsinda Bya a Bikurikije umubare" + +#: src/userspec.c:188 +#, fuzzy +msgid "invalid group" +msgstr "Sibyo Itsinda" + +# svtools/source\misc\errtxt.src:RID_ERRHDL.ERRCODE_CLASS_WRITE.text +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, fuzzy, c-format +msgid "write error" +msgstr "Kwandika ikosa" + +# 4952 +#: src/util.c:205 src/util.c:374 +#, fuzzy, c-format +msgid "read error" +msgstr "Ikosa ryo mu Isoma" + +#: src/util.c:208 +#, fuzzy, c-format +msgid "premature end of file" +msgstr "Impera Bya IDOSIYE" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Idosiye ku Bayite Wuzuza: Na:" +msgstr[1] "Idosiye ku Bayite Wuzuza: Na:" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Ikosa ku Bayite in IDOSIYE Wuzuza: Na:" + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "Idosiye Gishya Bayite OYA" +msgstr[1] "Idosiye Gishya Bayite OYA" + +#: src/util.c:590 +#, fuzzy, c-format +msgid "File %s was modified while being copied" +msgstr "Idosiye Byahinduwe" + +#: src/util.c:618 +#, fuzzy, c-format +msgid "virtual memory exhausted" +msgstr "Kitaboneka Ububiko" + +#: src/util.c:654 src/util.c:660 +#, fuzzy, c-format +msgid "cannot seek on output" +msgstr "ku Ibisohoka" + +#: src/util.c:832 +#, fuzzy, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Impera Bya Komeza>> Na Kanda" + +#: src/util.c:834 +#, fuzzy, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Impera Bya urifuzagukomeza Ubwoko APAREYE IDOSIYE Izina: Ryari: Cyiteguye" + +#: src/util.c:857 +#, fuzzy, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "urifuzagukomeza Ubwoko APAREYE IDOSIYE Izina: Ryari: Cyiteguye" + +#: src/util.c:882 +#, fuzzy, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "By'imbere Ikosa Byahinduwe Bivuye Kuri" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, fuzzy, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s:Ihitamo ni" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, fuzzy, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s:Ihitamo Kwemerera" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, fuzzy, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s:Ihitamo Kwemerera" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, fuzzy, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s:Ihitamo" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, fuzzy, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s:Ihitamo" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, fuzzy, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s:Ihitamo" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, fuzzy, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s:Ihitamo" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, fuzzy, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s:Sibyo Ihitamo" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, fuzzy, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s:Ihitamo" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, fuzzy, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s:Ihitamo ni" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, fuzzy, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s:Ihitamo Kwemerera" + +#: lib/rtapelib.c:299 +#, fuzzy, c-format +msgid "exec/tcp: Service not available" +msgstr "OYA Bihari" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, fuzzy, c-format +msgid "Cannot execute remote shell" +msgstr "Gukora Igikonoshwa" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, fuzzy, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "OYA Guhindura>> i Bya i Idosiye" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "Ihuza Kuri" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "Ikosa ku Bayite in IDOSIYE Wuzuza: Na:" +msgstr[1] "Ikosa ku Bayite in IDOSIYE Wuzuza: Na:" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "Ihuza Kuri" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "Ihuza Kuri" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +# starmath/source\smres.src:RID_ERR_IDENT.text +#, fuzzy +#~ msgid "error %d" +#~ msgstr "IKOSA" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "Ikosa ku Bayite in IDOSIYE Wuzuza: Na:" +#~ msgstr[1] "Ikosa ku Bayite in IDOSIYE Wuzuza: Na:" diff --git a/po/stamp-po b/po/stamp-po new file mode 100644 index 0000000..9788f70 --- /dev/null +++ b/po/stamp-po @@ -0,0 +1 @@ +timestamp diff --git a/po/sv.gmo b/po/sv.gmo new file mode 100644 index 0000000000000000000000000000000000000000..ad48ead547973f8046a80b65d517a0de69c6fc83 GIT binary patch literal 14329 zcmchddyHIHeaBBAgk*WY5}>6yF?DTY-}Tz$xv@jm_S#weSa)~rkhq)V?#$iU>zTQC za_^m8FA!cL2vN0_S`eb@gQ^IGTKZQhh&EJe1E^G0T2Zy4QfXD~3WS6TZRNIq6!r5x z=iHgucpYLS80qYH?me&H`Mu9?_FJ#M{$qyE2WUS_+jqS&p92rw$R9r6A2a5);19qz zfH%Cvm>r-6UjZHkC%}2|Ht>Vs&ETg&jejcOKZ5&s{sH(V@aJA?%uetSsP{`?1pXRm z!Kc7q0KWyk5q#0hjQJVRg0BM)fwzKl0SjfZ~BugAfIU>8*XCj)*S)P7$F?*;!3)cBVnRPpzA zZ~|p_jd;Iv9Z>r}3GM|y1AYYj1}J@g z1Yv5O_k)Yz7ePd3ZpJ7e(d-U*KdABV0JYD%K&|(yp!oPDkR{DCAWN9D}kRJHWpI6Yzy7t@cSlRN1^6lpcSCKbVI3EU5MWB;Yfk_W2Gd z{rw@Rc{j1R#@zzK8Z!aD2z)yzd7lma4}#-7_dv<@cR@_nY=D>0v+sk_uM}o#ohLw! zXg&^#Uw;hV1%4Hj9DfLkA8&?f;>UfU<~dpd z^8yxywPrUc{yhM~0`orbh2ZalH-MiB_(!1l^Lg+P_;27t;H_`LuC6m?9fSqu^DtTZ z@J(HC4T_#O9q{(E2(Izm11u@^S zZ!g#Ym%y9BuY!`>KZD}y|A4oFFGq=915SXG;4$zG;Cn%x`xBt#`2|q+@=u`j<-bAg z_X>#SNah|;>!+af=7S(xm_GnZ@L#~!g7XmfGH?ZyoL9kDfxiiA{XYb?&R>Dz_Xa3_ z{vRlRay?4+I`Ec&5%?0Gj|Q9#?=OJj>*L@rg1-aa2!0>D4iwFzzy8S9>JO|mkJ5Uy zoYtr5BYBE;=}|!w|5Dlo+S_TPAL*Vx_tJE(8QR0NHQG%yoh_m1Ge>)j_FkH3M8xiM zKA=D{c{i=82R_p2j3ypSPxU!Uo27|AzeLmLBCVpmLl1lwJeU`N;^#YQle7nEXJ|__ z>9;MO&mv{+DQ|ocmb*zR-VlI8Wg~OOuW+)9#^3?=eI7kuBaGzMl;E1bCVzf3D9t+DqLx>g)WN zbn*Q(eID>&Iss1wls=Dz@5cg~olU#c$s6sl!MBpHrA{H?eUm zv8zc@rg>(QOKDlTJv5=&@Alkyw^@<2`klC_x0rNaY^EiuJhz=ZYq9gBO*@^W1u1#2 z(vneRcQ$k&da~8HlQy^M31c7I+1Od`vdugxvt1mp)5+ItoY}Z&^}9({`DF%!848o) z?o!(7=Y7Yu$$Ig}v`~>e-cO5!F;`n7imqY9=s~#oyvYlruS(%|#Eo*RT<g#ci5#)gxU#aa- z6voY7bsSvr1CP$0K0S5jm^tdTKDm@M`fxfhyj)2-9di^VDDsY7iwpT|+f2(|Cte@7 zNBc#A?}F6hr>0Jb0eR*mwkzYyu6=e_FlYB2pSNq=p7y6>n9~a!SfkPB$f)f3hTL!o;w&771!(cjIdY zLaI5k#~fqUGA(N))(%{i^Hrs_yCqWVh*3l;`G)LScHQ>!G~;VNY7H7Ky0ot%SGi~0 z9Lt@e5aKcdlzN<3DOb{-)Lk#!()GYz;nwA~cZM3|;;PKDho+h7EMDp)D9lp7)zWrp zww#-3?^XgUmy5iMK5T#bpf`J-HHWhd%-I`~IX-i0+DP2y`0U*2sReT!E)YD>4yWX) zQ~k9Syf&ngaZ@YS@D>=)O(-$L{m$`d!&$H&ZxGw1AMjb57X^0btJBb-j|$TP;fmU3)t z`cmBOA=t?=Yu{{-O4?q~@=MOB^(AtiniV9ipioTEE;h>TAxDNEbm6{wz@l4n8?kJ+ zNNO(}+B)$^($Y*yxPrmtSv0Va0aZQNv`zmgt?)|57Tau(05fUSUFyy z=R%d4$s7YnvX*jOTjkUc`AR-`24!p7vb9euu1SBBg1CQf=9pvsiJ4<8;oYG&4nAR$ zmjpdRA}{eS*rIYVZxk~j)gs~Q^Uej(+B5n2lc=LPg|P*}jRYrju{Ouf;qgvJVoT(3>K z#aS}jiz`k>B%K}IM@CbW*5{BAp=o~ms}FO@1Y@;-1YXnl+S^S&2OV2B7{stibJn?| z`GvWeGbcO?rM|(iW4oGnkaB(MrMS`V_t2qc8Y@7+$HodC%P$h!9pgKk4E5S^(e{eG zfyRxDxl*fwmvk9MSc-Hq$xuOAH2F>yUb9-Oh`aSQz|19tE*$$X#E@_1Su>T$dAZJr zGI0)Fkx9O&N|lGPrFR4IvTh~Phv3({Oi_{q<+vfTb$<@zfmoHxa#iqaIDK=8pQd_s zo*Ril111~KT{9mjnb|+(<3~=AAibV?4cDo+ zZn7m(4Vmb(S(k5WjbRQ{Cw=>|(-U*E=gyk>wYX=Ol*g>Zo#nN>XgcQlFOr_yP&*I% zVXl^K##KCSr@8rHDYzFgA}Z(ok{U3W>eQ*8uNbdh&v3WD9_wzmy_+B!?C#tBGJCd8 zTe!xcv%tl%D?6@lc%?ZfH!A03FGS}T`Li4Xm%c}$?ywJJ?zt#eqDJ0jjppHii(@x2 zP~O*#2v^(15ubITL6of)$JncuWS#AVaIKDz-G$t5G+kj+H&y(}J579J;jM4?)cnzz znLTwtlFj1b!dUEDX+d;m>h$#JYJ=Rt8LI9&K8g5=Tnf(n7=%amp}7|Lh(md>NXc!z z8M}KOmwp0V$feM@cP2$nMp~l4aRH;e#yphwZMV=FV(4JlNq?Z*2?jkw3iPMKrVbrEFGU>B#@E@TW|IROuz zRuE89Ob%t_4m0THwpy5s9G7f8xT>LRH-tNsxQ{~Du|HhTujr5&8K(?>{gBVeR_?Rr zSzZF|l`PQEL5KGm((6GF!I%CfJ!Um6sy>3~qEVP&a%m-oOUw^h;bbjS@>U%e$FDp@ z-qS~n2)EBc2gA#DO7)~^cj5pQQKVlNDL!3&gi}gC#JL!M%(F#)ky~ms(~NLVszSnP zT@VhA-#JDif^UsZm#wrJ9qG5qXd$1(d|Q!*+~3Oj<9X2C+)$B ziMyhSJEMua?19@S58SzT;;j=C42M-{Q94GeN$E>W?CwfH-N!-OG*2w3|6?>>$y}y%+ z(EG+t&zznfp7X%?#F**^EEX+rMZ-Y2=Itl>O0#=i@ro?#a9ZZk-FM${Pjp~7Sfp|N zj;6`WlwwWVyO+{x>};oB#GU9ko)hEGdhW42eDGfDzaHM5+1n1=1AFeJ>~}@oS*1X` zQJ^ELV3eK9c=JAmD)}+r!)wy>3SUJU=}XS2tvWj!SsOoAQT+|W%XZvDlPJz{K!{n# zRxOnhbgPrLW7~=e+nqY+B#LAt{H&y^^T<5S#&)p#tdqKYkU_5a%ylQjFGKM1W!Bux zT9xa{MZ_jdwacBj)ryHVgAz3Uo4OIpT+!p-WOj#Y&^z2gSfhY?IsZC8@zv7dSVppc zwVG7x&9t>mZ@bvQhHO$@bq!TnpYMLIrhJWquS(xGq>ZvF6m?1>BC;K2v*WUgR&8#9 z;!xf!2{J@N&;Ry@3I;HGy*K*8v)uF7b1L^ELx*F;_T}a_O6U|J&Q@6**CZM9^96~Y zekN%`xJ$ZCU3`8%Gqx>7Ya*^12f!`qs+;*#KB)7sHa(rWyef7i!2zkLEmcxlEjyT! zr&Y?J^0c=jJa)B#SyWDq(b{aih@0lrMvH=&%qex+v!ps_g$YQJ+Ucsw(}1EzCgF7Q zwu;ke8(BeDl@%EWMwP5=I-_f=I6au;DC3%4A95=dgP@XTaK{^>bYC|c-uU=^|6ZL8kZjiOmoL0sf`x(PYjd4OWEVfo@lfevwyYo$z8 z^PehZE*ph%esimJkz1gC1W2(EIf=IFj71y~8XN6+HKo8$HQTc$cpUv6=5rTSv?agM zW#Oe?aTza(hs32}Q|^K~zc4#@YWk!(vPq?d+O{~X+O|{CD@h>m`;oIhY9zVANnhTc zH79E`YhPx2CmXzY$IMsj1v=mg+a=*s;bGh!$LnSr1@F0iC6cHro+qYkw%Jl(nfQU>trit`9;H|M-Udi`ox-G&PTHyHaE zM@|{!>?z9_g1y0jUeZQ2dYfBKNj6qba6u9qp}hTc)?{(#(>7Y@35AhOzo0pvmZ2x+ zcO^N7kfO3pSc%_gr`oFfNlZznyxevXd*sgKYt+>CYX&YCn>aQZybizp(bFu{wukdL zo^wJ2kAS{#*>c706H}w*ZKVko=Zy18N`7!u5?Q4Zms%j4F7rTIRgAInh#Zb{FG*zB z^QpMme=THkL!_g2|3r9#JmGGfJMu-?$Ak@JJldhE@1t(WeHK``7)1dC zFHom+Q8c*W?4&-ftTsq>OPC(D>SluZJ12wCyO%F2MwG^6S^8tm>Q_I`UZat7((49A-lr*{i@^hbfm%>NUsqaX%MG$n z%)Im-2AwEXN2e}>25go?)pSL4Bu%`!$dxvs^w8{ZWr5vckaEl`Rm`bJN=8`4ew;6& z>!t=BQr3{%`QA`VXM29C@E2M$UC7DUd=*E6g`gnJ90oUp!ayZ~Ue!vwS+(8p zC%Ia>G!DskaE_%p;*vVKR}2GLa|U@{9p2A@T|tc$@Je%Xn?N_pY}L|XGm&0Y;6y2= zN5168{kM~F-}7#8P*T78P(N@qYq4J#6xOdkt=>VYVy)kU07!vhICB^ z{r>VD!)06|uPBSW_WMg{tLW?BKb))J#*Mg$7!BpbyCUVt%F1N$b^v^J0*56OJ-eTjI+;i;G$F1B zxGc2ZXKQMuI{e5o6ck7aLoq(K!(u#9u}-t=@uV=+;m>ScZ;<1l|6WH1Z+?om4KL$5 z?5P4HyARe(P^dkZl38UuzDG(}VyYxg`e#C?lv&O{(D7e>Ow#`lhCpVHQK;Xf_9ydj zr4_tr2%LlzSFax*qb#@TudzEw>wL9-N8pNo;|litE-975OO527s@D&0ignTc+}X1# z+7I5}zo_e@tK3TxTk7_8lCfymiY-(cViR}Ibup2zAxkk8rz7PI6?>O_n!)9Nd6Tj% z|L6gATod^BHymWJdw<);sn*FyrQ~Bc)#d6+X`Mw%pgfnH~(G+}va8qTgsd8@zPtP(N|ISKdZ>5$2>@#aNGl=OLQF00nZL z97o}P!saY4=nz*Vbr+!dNsP=zG7V|}c3raK%%D8%Y>=|MF=&pgZ)^Qu40A$jQru^6 z{Tm_cZ}Zlb{|6)dZvgJz%zsL%IwZPGxYz3k034+|KV7PF4!EXT03sG0>J^z8FoR|*%|Mu7v4gdfE literal 0 HcmV?d00001 diff --git a/po/sv.po b/po/sv.po new file mode 100644 index 0000000..61cb71f --- /dev/null +++ b/po/sv.po @@ -0,0 +1,1248 @@ +# Swedish messages for cpio. +# Copyright (C) 2001, 2004 Free Software Foundation, Inc. +# Christian Rose , 2001, 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.6\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2004-12-26 20:49+0100\n" +"Last-Translator: Christian Rose \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "varning: hoppade över %ld byte med skräp" +msgstr[1] "varning: hoppade över %ld byte med skräp" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "byt namn på %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: filnamnet är för långt" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: fel i kontrollsumma (0x%x, borde vara 0x%x)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s skapades inte: nyare eller lika gammal version finns" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "kan inte ta bort aktuella %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "kan inte länka %s till %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "kan inte växla halvord i %s: udda antal halvord" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "kan inte växla byte i %s: udda antal byte" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "\"%s\" finns men är inte en katalog" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "kan inte länka %s till %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: okänd filtyp" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "för tidigt slut på arkivet" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "varning: arkivhuvudet har omvänd byteordning" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "standard in är stängd" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d block\n" +msgstr[1] "%d block\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "kan inte läsa kontrollsumma för %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, fuzzy, c-format +msgid "%s: truncating %s" +msgstr "%s: trunkerar inodsnummer" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "filnummer = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "filnummer = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: trunkerar inodsnummer" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "standard ut är stängd" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "tom rad ignorerades" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s dumpades inte: inte en vanlig fil" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: symbolisk länk är för lång" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s länkad till %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"GNU \"cpio\" kopierar filer till och från arkiv\n" +"\n" +"Exempel:\n" +" # Kopiera filer som är namngivna i namnlista till arkivet\n" +" cpio -o < namnlista [> arkiv]\n" +" # Extrahera filer från arkivet\n" +" cpio -i [< arkiv]\n" +" # Kopiera filer som är namngivna i namnlista till destinationskatalog\n" +" cpio -p destinationskatalog < namnlista\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "%s är meningslöst utan %s" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "Huvudåtgärdsläge:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "Skapa arkivet (kör i läget kopiera-ut)" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "Extrahera filer från ett arkiv (kör i läget kopiera-in)" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "Kör i läget kopiera-skickavidare" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "Visa en innehållsförteckning för indata" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "Åtgärdsmodifierare giltiga i alla lägen:" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[ANVÄNDARE@]VÄRD:]FILNAMN" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"Använd FILNAMN istället för standard in eller standard ut. De valfria " +"ANVÄNDARE och VÄRD anger användarnamnet och värdnamnet i det fall arkivet är " +"ett fjärrarkiv" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "Arkivfilen är lokal, även om namnet innehåller kolon" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "FORMAT" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "Använd det angivna arkivformatet" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "Ställ in I/O-blockstorleken till 5120 byte" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "BLOCKSTORLEK" + +# · (centered dot) is normally used as the multiplication sign in Swedish. +# See "Svenska skrivregler" §260. +# +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "Ställ in I/O-blockstorlek till BLOCKSTORLEK · 512 byte" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "Använd det gamla portabla (ASCII) arkivformatet" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "Visa ett \".\" för varje behandlad fil" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "ANTAL" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "Ställ in I/O-blockstorleken till det angivna antalet byte" + +#: src/main.c:119 +msgid "STRING" +msgstr "STRÄNG" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "Visa STRÄNG då slutet på en volym av säkerhetskopieringsmediumet nås" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "Kopiera endast filer som inte matchar något av de angivna mönstren" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "Visa numeriska UID och GID i den utförliga innehållsförteckningen" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "KOMMANDO" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "Använd fjärrkommando istället för rsh" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "Visa inte antalet block som kopierats" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "Skriv utförligt ut de filer som behandlas" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "Aktivera felsökningsinformation" + +#: src/main.c:137 +msgid "FLAG" +msgstr "FLAGGA" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"Styr varningsvisning. För närvarande är FLAGGA något av \"none\", \"truncate" +"\", \"all\". Flera flaggor kan ackumuleras." + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Åtgärdsmodifierare giltiga endast i läget kopiera-in:" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "FIL" + +#: src/main.c:146 +#, fuzzy +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" +"Läs ytterligare mönster som anger filnamn att extrahera eller lista från FIL " +"i läget kopiera-in" + +#: src/main.c:148 +#, fuzzy +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" +"Verifiera endast CRC för varje fil, extrahera inte filerna, då ett arkiv i " +"CRC-format läses i läget kopiera-in" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "Byt namn på filer interaktivt" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" +"Byt plats på halvord i ord och byte i halvord i data. Likvärdigt med -sS" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "Byt plats på byten i varje halvord i filerna" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "Byt plats på halvorden i varje ord (4 byte) i filerna" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "Extrahera filerna till standard ut" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Åtgärdsmodifierare giltiga endast i läget kopiera-ut:" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "Lägg till i ett befintligt arkiv." + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Arkivfilnamn att använda istället för standard ut. De valfria ANVÄNDARE och " +"VÄRD anger användarnamnet och värdnamnet i det fall arkivet är ett fjärrarkiv" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Åtgärdsmodifierare giltiga endast i läget kopiera-skickavidare:" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "Länka filer istället för att kopiera dem då så är möjligt" + +#: src/main.c:186 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" +"Åtgärdsmodifierare giltiga för lägena kopiera-in och kopiera-skickavidare:" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "Skapa alla filer relativt den aktuella katalogen" + +#: src/main.c:196 +#, fuzzy +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" +"Åtgärdsmodifierare giltiga för lägena kopiera-ut och kopiera-skickavidare:" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" +"En lista med filnamn som avslutas med ett nulltecken istället för en nyrad" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Arkivfilnamn att använda istället för standard in. De valfria ANVÄNDARE och " +"VÄRD anger användarnamnet och värdnamnet i det fall arkivet är ett fjärrarkiv" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"Dereferera symboliska länkar (kopiera filerna som de pekar på istället för " +"att kopiera länkarna)." + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[ANVÄNDARE][:.][GRUPP]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" +"Ställ in ägaren på alla filer som skapas till den angivna användaren och/" +"eller gruppen" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "Återställ filers åtkomsttider efter att de lästs" + +#: src/main.c:212 +#, fuzzy +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" +"Åtgärdsmodifierare giltiga för lägena kopiera-in och kopiera-skickavidare:" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "Behåll tidigare filändringstider då filer skapas" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "Skapa inledande kataloger då så behövs" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "Ändra inte ägaren på filer" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "Ersätt ovillkorligen alla filer" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "Skriv filer med stora block med nollor som glesa filer" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "Informativa flaggor:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "Visa denna hjälplista" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "Visa ett kort användningsmeddelande" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "Visa licenstexten och avsluta" + +#: src/main.c:233 +msgid "Print program version" +msgstr "Visa programmets version" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, fuzzy, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +" Följande text är en informell översättning som enbart tillhandahålls\n" +" i informativt syfte. För alla juridiska tolkningar gäller den\n" +" engelska originaltexten.\n" +"\n" +" GNU cpio är fri programvara. Du kan distribuera det och/eller\n" +" modifiera det under villkoren i GNU General Public License, publicerad\n" +" av Free Software Foundation, antingen version 2 eller (om du så vill)\n" +" någon senare version.\n" +"\n" +" GNU cpio distribueras i hopp om att det ska vara användbart, men UTAN\n" +" NÅGON GARANTI, även utan underförstådd garanti vid KÖP eller\n" +" LÄMPLIGHET FÖR NÅGOT SPECIELLT ÄNDAMÅL. Se GNU General Public License\n" +" för ytterligare information.\n" +"\n" +" Du bör ha fått en kopia av GNU General Public License tillsammans med\n" +" detta program. Om inte, skriv till Free Software Foundation, Inc.,\n" +" 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\n" +"\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "ogiltig blockstorlek" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "Arkivformatet har angivits flera gånger" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"arkivformatet \"%s\" är ogiltigt; giltiga format är:\n" +"crc, newc, odc, bin, ustar, tar (stora bokstäver fungerar också)" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "Läget redan angivet" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "--no-preserve-owner kan inte användas tillsammans med --owner" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "--owner kan inte användas tillsammans med --no-preserve-owner" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "Ogiltigt värde för flaggan --warning: %s" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[destinationskatalog]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"Du måste ange en av flaggorna -oipt.\n" +"Prova med \"%s --help\" eller \"%s --usage\" för mer information.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "Både -I och -F används i läget kopiera-in" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "För många argument" + +#: src/main.c:677 +#, fuzzy, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"--append används men inget arkivfilnamn har angivits (använd flaggorna -F " +"eller -O)" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "Både -O och -F används i läget kopiera-ut" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "För många argument" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" +"Arkivformatet har inte angivits i läget kopiera-skickavidare (använd flaggan " +"--format)" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "-F kan endast användas tillsammans med --create eller --extract" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "kan inte öppna katalogen %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "fel vid stängning av arkiv" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "kan inte skapa katalogen \"%s\"" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "\"%s\" finns men är inte en katalog" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s är ingen teckenspecialfil" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Användning: %s [-V] [-f enhet] [--file=enhet] [--rsh-command=kommando]\n" +" [--help] [--version] åtgärd [antal]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "ingen bandstation är angiven" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "ogiltigt huvud: fel i kontrollsumma" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "ogiltig användare" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "kan inte få tag i inloggningsgruppen för ett numeriskt UID" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "ogiltig grupp" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "skrivfel" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "läsfel" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "för tidigt slut på filen" + +#: src/util.c:493 src/util.c:543 +#, fuzzy, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Filen %s minskade med %ld byte, fyller ut med nollor" +msgstr[1] "Filen %s minskade med %ld byte, fyller ut med nollor" + +#: src/util.c:499 src/util.c:549 +#, fuzzy, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Läsfel vid byte %ld i filen %s, fyller ut med nollor" + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "Filen %s växte, %ld nya byte kopierades inte" +msgstr[1] "Filen %s växte, %ld nya byte kopierades inte" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "Filen %s ändrades under tiden den kopierades" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "virtuella minnet slut" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "kan inte söka på utdata" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Hittade slutet på bandet. Ladda nästa band och tryck RETUR. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Hittade slutet på bandet. Skriv in namnet på enheten/filen när du är redo\n" +"att fortsätta.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "Skriv in namnet på enheten/filen när du är redo att fortsätta.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "internt fel: bandhandtaget ändrades från %d till %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: flaggan \"%s\" är tvetydig\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: flaggan \"--%s\" tillåter inget argument\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: flaggan \"%c%s\" tillåter inget argument\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: flaggan \"%s\" kräver ett argument\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: okänd flagga \"--%s\"\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: okänd flagga \"%c%s\"\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: otillåten flagga -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ogiltig flagga -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flaggan kräver ett argument -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: flaggan \"-W %s\" är tvetydig\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: flaggan \"-W %s\" tillåter inget argument\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: Tjänsten är inte tillgänglig" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "standard in" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "standard ut" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "Kan inte köra fjärrskal" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, fuzzy, c-format +msgid "%s: Cannot change mode to %s" +msgstr "%s kan inte användas tillsammans med %s" + +#: lib/paxerror.c:101 +#, fuzzy, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "Ändra inte ägaren på filer" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "kan inte länka %s till %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, fuzzy, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "Läsfel vid byte %ld i filen %s, fyller ut med nollor" +msgstr[1] "Läsfel vid byte %ld i filen %s, fyller ut med nollor" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "%s kan inte användas tillsammans med %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "kan inte länka %s till %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#~ msgid "error %d" +#~ msgstr "fel %d" + +#, fuzzy +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "Läsfel vid byte %ld i filen %s, fyller ut med nollor" +#~ msgstr[1] "Läsfel vid byte %ld i filen %s, fyller ut med nollor" + +#~ msgid "USER" +#~ msgstr "ANVÄNDARE" + +#~ msgid "HOST" +#~ msgstr "VÄRD" + +#~ msgid "FILE-NAME" +#~ msgstr "FILNAMN" + +#~ msgid "Set the I/O block size to %d bytes" +#~ msgstr "Ställ in I/O-blockstorleken till %d byte" + +#~ msgid "Link files instead of copying them, when possible" +#~ msgstr "Länka filer istället för att kopiera dem då så är möjligt" + +#~ msgid "" +#~ "Dereference symbolic links (copy the files that they point to instead of " +#~ "copying the links)." +#~ msgstr "" +#~ "Dereferera symboliska länkar (kopiera filerna som de pekar på istället " +#~ "för att kopiera länkarna)." + +#~ msgid "--%s cannot be used with --%s" +#~ msgstr "--%s kan inte användas tillsammans med --%s" + +#~ msgid "Memory exhausted" +#~ msgstr "Minnet slut" + +#~ msgid "block size cannot be 0" +#~ msgstr "blockstorleken kan inte vara 0" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt version %s\n" + +#~ msgid "Success" +#~ msgstr "Lyckades" + +#~ msgid "parse error in blocksize" +#~ msgstr "tolkningsfel i blockstorlek" + +#~ msgid "Regular expression too big" +#~ msgstr "Reguljära uttrycket är för stort" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Användning: %s {-o|--create} [-0acvABLV] [-C byte] [-H format]\n" +#~ " [-M meddelande] [-O [[användare@]värd:]arkiv]\n" +#~ " [-F [[användare@]värd:]arkiv] [--file=[[användare@]värd:]" +#~ "arkiv]\n" +#~ " [--format=format] [--message=meddelande] [--null]\n" +#~ " [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=block] [--dereference] [--io-size=byte] [--" +#~ "quiet]\n" +#~ " [--force-local] [--help] [--version] < namnlista [> arkiv]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "För tidigt slut av reguljärt uttryck" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=ersättning] [mönster...] [< arkiv]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "blocknummer = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "Ogiltigt namn på teckenklass" + +#~ msgid "drive type = %d\n" +#~ msgstr "enhetstyp = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "okänd flagga \"%c\" för -p; kända flaggor är \"aemop\"" + +#~ msgid "ambiguous" +#~ msgstr "tvetydig" + +#~ msgid "missing regexp" +#~ msgstr "reguljärt uttryck saknas" + +#~ msgid "1 block\n" +#~ msgstr "1 block\n" + +#~ msgid "No match" +#~ msgstr "Ingen träff" + +#~ msgid "residue count = %d\n" +#~ msgstr "återstår = %d\n" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [användare][:.][grupp]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[användare][:.][grupp]] [--no-preserve-" +#~ "owner]\n" +#~ " [--sparse] [--help] [--version] målkatalog < namnlista\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "enhetsstatus = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "Ensamt [ eller [^" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C byte] [-E fil] [-H " +#~ "format]\n" +#~ " [-M meddelande] [-R [användare][:.][grupp]]\n" +#~ " [-I [[användare@]värd:]arkiv] [-F [[användare@]värd:]arkiv]\n" +#~ " [--file=[[användare@]värd:]arkiv] [--make-directories] [--" +#~ "nonmatching]\n" +#~ " [--preserve-modification-time] [--numeric-uid-gid] [--rename] [--" +#~ "list]\n" +#~ " [--swap-bytes] [--swap] [--dot] [--unconditional] [--verbose]\n" +#~ " [--block-size=block] [--swap-halfwords] [--io-size=byte]\n" +#~ " [--pattern-file=fil] [--format=format] [--owner=[användare][:.]" +#~ "[grupp]]\n" +#~ " [--no-preserve-owner] [--message=meddelande] [--force-local]\n" +#~ " [--no-absolute-filenames] [--sparse] [--only-verify-crc] [--" +#~ "quiet]\n" +#~ " [--help] [--version] [mönster...] [< arkiv]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f arkiv] [-s ersättning]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=ersättning] [mönster...] [< arkiv]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "enhetsstatus (låg) = %d\n" + +#~ msgid "Invalid collation character" +#~ msgstr "Ogiltigt kollationeringstecken" + +#~ msgid "Unmatched \\{" +#~ msgstr "Ensamt \\{" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr "Ensamt ) eller \\)" + +#~ msgid "Invalid preceding regular expression" +#~ msgstr "Ogiltigt föregående reguljärt uttryck" + +#~ msgid "null regexp" +#~ msgstr "tomt reguljärt uttryck" + +#~ msgid "%s already exists; not created" +#~ msgstr "%s finns redan; skapades inte" + +#~ msgid "Invalid back reference" +#~ msgstr "Ogiltig bakåtreferens" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Användning: %s [-cdnv] [-f arkiv] [-s ersättning] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=ersättning] [mönster...] [< arkiv]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "Ensamt ( eller \\(" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio version %s\n" + +#~ msgid "invalid" +#~ msgstr "ogiltig" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax version %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "Ogiltigt innehåll i \\{\\}" + +#~ msgid "Invalid range end" +#~ msgstr "Ogiltigt slut på intervall" + +#~ msgid "sense key error = %d\n" +#~ msgstr "sense-nyckelfel = %d\n" + +#~ msgid "Trailing backslash" +#~ msgstr "Avslutande omvänt snedstreck" + +#~ msgid "can not omit both user and group" +#~ msgstr "kan inte utelämna både användare och grupp" + +#~ msgid "Invalid regular expression" +#~ msgstr "Ogiltigt reguljärt uttryck" + +#~ msgid "No previous regular expression" +#~ msgstr "Det finns inget tidigare reguljärt uttryck" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f arkiv] [-s ersättning]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=ersättning] [mönster...] [< arkiv]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "enhetsstatus (hög) = %d\n" + +#~ msgid "%s while compiling pattern" +#~ msgstr "%s vid kompilering av mönster" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "Ogiltig modifierare av reguljärt uttryck \"%c\"" diff --git a/po/tr.gmo b/po/tr.gmo new file mode 100644 index 0000000000000000000000000000000000000000..e78a36907d5fa9ce6999b07d9bfe5964a44ff8a7 GIT binary patch literal 21534 zcmd6vdypK*ecwkisgNhpdQdX;R`US^AhC-(P<$Ooii^VmI01(P??DoR5Mge2?ryld zv#Xii1NTBnacl{qY)VlqE3z#M5)+ZK9ov8R&hc{2Q+Nxq#1aQQl73xH<^_6l}bj zKYT`C8wB5YWe|*kZ{+uXeSHwT1-$AFL2wiJPVh}&1*A&wFgOY>gExYo1Fr+W4yym( z1NVa81>Xg}>G~jeD|iQ}eolaI2A9AZ_!02Oz&`=s3H}gV1>XuW_k*7XZv+1jEP;Op zs{XBXCORt~Pl0>*-38wPJ_YUo|FM7mJy7khr?CMm;E#igAVUUEc>E<0(u0ej=-vQf zN$_vLw}F2O(p7NX4Q_rndz=8LcwPlH|6lX?ZLqBRO!~dxy`biK4!jF|8vH2uJoquN z#-t8|-v`CN+aW^hFb9r+tKd%XC%|3cFN1##{O6$P``6%)g8u`I!K-<=4{U*I_Y}Ar z{C)5Y_}@YGv%umBKMacR&w!fe_rTl1KLZUo3UjXlAN2ST_$q#%0^biVf*R*{!8^eJ z08W7KVA8j}A_zhd(t;YMYC-^uhx%(=pdH-9Gu7hiCadh7bimub3+W$N#dVd4tU+^q{M8~&4@%c3f zt>owdP;&nXP;@*C&Vt_tHQp!>HU4Q(^Z5)Yx!nNk;J*YBsbB)4M9=#{_4i@$6X36a zOf9&BMPCIU0oC6hfTzJ%AtaLf8i)u7s~$fIs@>C|#``9ye*YNM`do9XTfcXJh*oen zC_3gr&A$nX{+|Tj4PF2x2jBJhzd+fO>*&<-8$=|6G4NXOL64`vAK`ZdijOh)8t{|g z9pEp55%|wQ(Rmkxs^9m5(!WPQ)jtbro<9Yu|IdP=_lw|b!Qb}3zX^(-e+OO#{s0^S z|J>s>7#ID%9@IGR1l7+TPwr4=6We-}a|y6*!k;4}zJgHM5a|8-E~{Q)TZ^B+N$JTNQ< zq7_VmTDKOc=RXZL!LNasfZ!&Wi--sB0Y3y*!7BJ2P;xkl5W$k53u>IFKm+~`h$#sE z7!*DK+yCAH5vo4{B0@nM)caom4R{G;34`x}l7lzg?bdIf#|J^t+XmkV{tPJkzT}@@ z^1r_WN^Y;l7_5N1Ku8Ea?eX_K{slP4^E)vX2K)p_)8JRZr@%h}zYLy3sY9@Iuj}_y zASxI9CMY@jBT#nq--G-MZo1E}KX@a*Bk*7)=RnoJkw4+>j5|3EO-sSAMqH1AK~|-p!)mI-~sTp6=z>&g|A?a zpycWYynH8UCXik5J)rn~9+chs9Z-DyFQEFl8R6BumOP#Xujlv2!K=W}gOC_}3DmlN z2Ye8`ZqmgA9{`W@djsTEaQz`?CmsRC$0xyQ@b^K<$(s*5xt#z-SM2el;6wcW5;zO~ z02IAPk2wB34x(DY)1dnO7a&~*uZM|x{s{Og@MGXj;FJFO1^@ebkbl7|-s}4Xck%mi z@Ppu&L9O2nN8NlL1hrmY1m6xm4>rIbf@-&N%#HJDQ2hKF_!aQ`;H}_im~;#LT~KuH zg-Hpx3cd;aE@;3Xg4cm>pK*5QR`AXIJ_xd;!D;Xv;CYYV0Dqj{-vXsSuRP)O>;`a* z-*-0yU4X zfRd9NSgaofZv$@u$3e~S1EAh_!E3=Mz;}T^3u?Y!1>XYx6Y$5tZ-G~V{|&qb{GT4B z+^T;qD7tR|Rev9-_EVtRRl%#l6;Sjipy)_JOkMDC5R!v`1ggK+%_9pSVD0EHfxk)7 z=Om?Nzd70aY5!gFqqX@NN|W*kMIV;J#&oxX;@RM*&JW4?IZBuENy-N)`h=9fZNK&Z zoZ>4>V`W-TBg%P-XwN^AhXu;t^ADE6_faJO`cx@3$`>f&!7ozAD1VdkG)4US1Vwzx zKVRjG`0^8!70RzsPE+#F*ZA^VlNJ8qdcGfQa{nXI+cIUAs9T67$C;#RWXL^1DEvl^utzsJ3i3KfjuZ6HEC@tIb?i=#1H&jT;TK7@2MsEp;1v)Es7* zho|O`%q+~C%JGxt;mYi6<@o%`{Z#I(w0Ik>My{*4*>1#460W9U(&<6CdYGP^oj5|1 z%7Lk4Q}ZVw-yE8nKR!7(XAaHGnuPfVW4DivnT5H^$VjjQxoNbj_5QbvubCvd8HGulEH|PobENLb{2R#B zbXUSOtV$-bc2td#&ZW2!4OOYdu&2{XdwL3eb@;@@Tu17qnnp-fZQLZ$SvrE_S=dCb zm!n+JO!OFvV@FnlTDRG@^(_f$wA^ikX+H3{nFtfrvI7*qAT*&vbj`AL%a^UQC|I@< zw?$t!u9+Q;?jE!3zCeAyGfT0_dQHuzm`(8>rqt|IH^0iFXp07$dzy{Hnu*dBZlF4g zJ)~hrhFq+`UgRyTu_~g^zOuBvq!!}kxOq5CwYmk}o-3C>zKrJL^-CIYc)*v`)DxSw zU_vWt^z6LRv7zZdyzOh(yt)!q>shzynYwHAu^o-a_T*}eO|lPmTQZm82-Q9t*U%q{ zQr2BsimP#ybc_rFnv`1hyPhTSCXvW?S}h~3ww++=qGc4qnNL$HnH^QB)i{=MHEbYN zo8R~+XLeL~WIIi*6=lgz)U45HoyGi`FkS98p~7`jRHiDb8a5Z>i zAE8!@E%{2XrUR?fNxMlEhbS#_%Q)~PPGlyMZgVk8?Red!o?soUjWL~GTNZ8{UyWsJ zEhq6BCaqWvEuCASE#F&Cj|8Ps*oIo%WF~Kj1;*1QEta^tf-7+&S)roBGEWk-i+ZMX zNCvVrx1QnQ_b>sr27n*@}B#LI@M0OsFh2u!NL;`*95hqzk7LR7Ui_WrOQBZLl z!Wc8Ybpcu~&!KWq8Dte)!i9y6JuY0pkH($MX=SyQ;JcFy-;8o*L+!lUY6(!wf`+U^ zY$hWfC+%*hY-Vf-gfcJ8P0m71%^aDTn|D5Msb`%uJz%PNvx29!12gXg*3q+_RT?#A zz&!aci3*~izj88KX;U#8Jd?qbGsgNm~s?n{twd z*tXpWdu21xO;e08lRI>*a#$>DC3cN>CVbhs$L#c`#D2$k?<|{X#}BGmNx~9Wt6i9c zLX?9E{JA6pjgZb{ki`pG0UrQX-H4Eohf=;t!v_NSi zd$Zl;;9$#&mJh`ArXO!11A1V)&MUU@vGmJhXNV;zHcXWww~@`fqPA3RXE3uKD%>rAEm~?i`uY_%9y{0qEL(KD1 zxcjm;u%fUZPIH4pQ^zI)NlU{n{7{s)$F#$m4eqRsU5nCI zwta0P!Yfoi%hnL-cZ%#H$Hhn!_58D&LL(<6{)g>|ZPBq7Rye_!+Xq&$Z~wgsU2`w>y<|W?HSK#x4hHQ!U9>rhjlWc zj_c06XCot%kA>{~qHLUP)6HfA+49w8y{(DTmy-26^dOP(!cGIbCoi?ky_O7D>D2vs zh10gnE!KRiPGWQF-rle;L1WH4QDFCE2#$bF-Vh z)P{u{eo-woOflw*Yih$gNX%-lSha$x{`b;O(tLIqh*E8)@)ge zXT5~&>avZ0gWV`=q8?DBEp7fR(dDX!$wPuO+M?NR2eJ`tAS3c9SE$^KwCV94ayBC3 zAs*;QCTyBoNj}X+kDju~IcWkKxrt7!8Nx}Y=;4xbLsCl7#)>v+qG((`dNpRZ>SpEK zls06jx$DE40=vV=xd-6`p-Uk^bq7{8m^&M`&7uPA6%6UwR$8;`<-W*TC=9WW`tMmU&6W&uST>U+ z6R?0d6V0HM&ABdBp=fFqFK;i|)mtkP{mS`kJCkn~Zz&*SNlYpEz-Yisxn`so1= zb*f6Dy>ohmv2x+a<8B}M>4o2R_)Q7(EH<7DYMY8(EwsLk)3+XcS7mNuYKkO$zUj65 zEMFH3DBDpwUYVX8?5zkxtx1!yaq;M1$%ghJ7jfWeT_Bb(_<-qsIFA9P(V>}`osc|h z8|kOT*@Ij)jO9ec$_#aO_65XRKrc;2lUmCr$*P?$D%LAZYhU6Xw#js7kZe>7+Yc<3C2!w+5NP! zn$y^3i!GV97n&?4ju7~il>PLn@$%_YR@F}jr|hE#PAj!Ae!5uD;MA5u;_1Lzc$XQs z*(0Ptd-rf)o4DBEOh7v@Mqf@Kq89kn5Prb&x6xwjW0unv?i5ZaF;fJDd0p+`q%~+e zVVv)v8P+if`G!d^R2R2{bmw8+@N?JI910+JPLs>k}RH)0KEK}ui-qi5|UPioi+x_C+zK1+v8@A zEF3X|TZvV&lhWS6%B?~v_f38&;9Mclp@cQ*bCVNuCL^1eV2yW?Gzm!rQ>}W zv6CrYE0q>(iUib14+MNn_g&zf)tss zf1FhKuM&p9%CsZX?|r25_nY7{8;cU!Y;~>w!b!Bk)Zz`%5btZe2{>m8R^wF0i+C18 zAq%z=!f=$;@1n+Y`^Y{|oWpY~=9T|(KDUJ9gl9$dtR9m))d7}s=ThxQNi=LZ2@5q) zzuuiC9aru%WA}`Y`g+I0tW%mNZJ3cLYavO;$Mm>cgiW4rf{JW_H8)^_qo4}^hDUXc=94!||@{4h5)}LL28>#7qYa16E8yB0kjf-g+9`&DWT-^4$0J#dOeYmu7 zk&Jjkn;zeAE6t6Im(CNT@Jz#roQ63XHoII*$e16s_=lj-gus!1E1^2eT1gt#W2_1X zY0$O)T$8oZ+SOZ^&T}ddrjQdhI(9%FwtFFI*Kjdz#GGT-!j1DA7m11VQ~j+*dsicd zSbq*L9&>vFtFUoCzH~n3Fucy-ZC4k29j{$>W1+6$AoJ3B_@cScD@XY>H#Rv7q4|KY z4v*If9rG%j9o6me`%1k2jHYt9qFW0a7v?rDn3FR{$(8L#OFNy=%vI*6j#Un9TsXFI zVV1J-1*%w*k4(;TZ{aXMc{{7gRHiEv6|->i@WSz93macpF!YY~6 zS}U7_u+)S-_?5sdO@WHbu{vU7oHRLUcI~%YppcDp-7eGsXSQ2O&C;%hTiU*mi8x-u zZJWflf*~5!OfO1euN+|yDdan~$n@n}fj?N~m_j|&)}O7TDQvow^T0SL zlH@9l1|OtI0T0#Jp9v9%OXuxyv>!J|Ns;pcbwE-=)~JV5(~G%~3lGwi%P%}={j35w zb?U?^Olrn?J34d1m60*vkd-7h^W9>Aenr%aGs$gh)mymlZW8Lo#mg9K>=w=a_FEd= zGK2Jp(CggQK8<08<_khKnWyv$~dwa}BP+J@f)FSnkT9k;0U^2q*6 zHn+^OyppBPh%5+P;gxQcz(6aJ@)?NiAfH}r3s{t~*hpK!Zj)cTu$L{6FoYOUWB_;Z z0!zy#*Sd)n=`31*26t39b@@{|zl6(R ze^y+;C@L(gCUMQ$;9GzDf^gh+BQm6C>>1HOodrSlnmge?qa@p4y$G*FciX%j>}8p= zwz`xm^_ATfjKR(Zs}Bz9?_a#kszW6DK2YAl!TPif@};ht0_Ff+7XDsZ^$`Z@6mf&uyG%MG!JV5=b%OnhhHU>sZ^^u?CeXvMJ~r zFu%+LT;$LnMR2xpa8b6cQe5K51Br%W{>ODTX+&ox)(@-Gib>?u)8QpxVD5IsX)x!mcy#bKX{{ir zKPN($O^vmFWm9oocGnaSTJhgFuiLdY;@CLPz_NNQ_tAx8$12CCCZ>ql%+Zmk_=1iU{6009Hs>OpcZg z%$!^ZxLgA7(LG&-Mtl%dogdn6G?~q_D3~s}L|3~ zH7N>$-4D-9sHHC+IDc<@`w`!%_Xj<$qWfS_r(vR~Sw1ErwsGHu1@Jn)6e-JJCdM5ZFN zZleKjTg-f|6wV3KPJv=NBdJF=s^#eiLe= zW;ScVQKuCN3?e;N_tgv6wWwfJafP>{nRYJm`9R@P_TPfRxq2h&vB{b|KF<}w z4jVpIx9ggex9;L#w8|NB)G0RVd)Sr`a9af+!@xo=lk3=tbaB|u#gOQr$*k#UX78%mfOs2wD=&mKG=DocWSFo|BB5} zKlYZ5%(A;=lM4&$**CLZN;<<``HMFFwnP1HPoGs^?%Cjwwjr|ZRNU3!p3Pv#Bf(MP zNEf-~_PQxRlJ_=Y)Ie@7XI+10N zzBeq^mCPyQ^B0us}2y!h6KCHoDp7Ts@XP4|MbN-Cr;`e z9AQ3;NxsU>3buGk3a#f-l$LC~2rUXN!tvWhEkw+PI^w?;_GR=~@J&I572oaRDL=@_ ziycHJ;6?S=C!16g=~!H{-8EI$pR-)>9Cw<#*`y3adj)CRvGOv$4Kr(4fjVV`>*w(dSKIk<7*eTOHV4YyuQVq+!RNec>?hcNg7 z-8ph@ToQIzy9(|NJ5jk@|M47Q7N%T@Q>wh*OsnNhVld~@fO7uJmm46Qr+2POvF0>+ zb(deV+KcoPJb2A;7M$dlP69|k8tamGDyOf54#k3j@?@?v1w1vyWaP&hjoQ}9vlru_ z=lV%MYn{CS69wf_-x-@j(cawV7S})DL%;H=NDsEFIUIz#(}S$5gv6%2C3bG6-mP`n zu#xD}2}EI;6xN}+GLG09@;jDM!%;_JRfi0if&_G>if#8R;Dy(nJoG!m^l-~pk=F}~ z@<4bMIPnV(?_EDkauyvy;cZ6t|B0Ae({W&WH1i;>pY*FzD zenS^Uq+8_7pIyULS>LHcD&o%O;4|Dlb5PiR`5Vbsuj90XT}a4@q6jbRVw3eIHaD-7 zL?H!MF|=P^Y0Z93cB($nVJ=*AN?>>lpV#R0pxhi2am&=&mV0>?_8$SigrHruuo zt~J8os6P_JRNBmTaZ}30qWzmv1HT7vO4VD?u1im!uB#gADIj@{K`1 z`(+I;Bjl2xv8lLnKVc@rim)yutpg*K*tXG)PIhScRB1_W+%8pxVPYk~*z zE!I?)INY1&tZuOR|HEX^#sx(+{MQVHE&)ecWWKR)*!!pUS z^=Z~K`a=NSx{{^l&Bl55T2>`EeD%>>?xO~`tY{E1gfjQ}cCEkBwR)6AJu=??KD?RE zkEMx3?Y*iz-OzUwDu&; znAVTC2Xaa_c!dOiG-J~`sJlHc%d5GQM~#umGZR47;viQGf(Lu1Wm63K;Et}%w$%5? ztq^BsxgSyFmNb(g8|rLcZt9Aro9Ya860(nQ)=1a5@cjfY0Ve@lJhc1i!CEeDSm%-e z>Mm0wr>?WXfh%1{;CAN!t1|_Rv;I zKJ{#N5iAt@7=O2`IK=2v&hl6abd#jVe~K>MgE&bD_qk#b2-;H@yVPF0b7gnIFlSKv z`ysu1helobX4fKa7az*#=@OOYFZ0lvt>*4Pi7OX`6oUlCH%VzbP^`ve>%JjmY(4}W zXfq)G!BFtTm6LcS4ipF45rZRQi)DygYPgZ_{;X`;?Pc!J0>=~dNO3*)ks9P;+*!C= z!A+0*H@}c3ckc@c3Wm>$Ej0sVD$nP1F~97UpC(A4U_<|Lt~$s<{-$dMw+{}(IFeuH6R`&9jluqm6E)XPi W&HqmTdrm;};wxgKF+=&0`TqfrUx2Ov literal 0 HcmV?d00001 diff --git a/po/tr.po b/po/tr.po new file mode 100644 index 0000000..ba2549a --- /dev/null +++ b/po/tr.po @@ -0,0 +1,981 @@ +# Turkish translations for cpio messages. +# Copyright (C) 2006 Free Software Foundation, Inc. +# This file is distributed under the same license as the cpio package. +# Nilgün Belma Bugüner , 2004, 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.6.90\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2006-10-12 19:06+0300\n" +"Last-Translator: Nilgün Belma Bugüner \n" +"Language-Team: Turkish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: KBabel 1.9.1\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "uyarı: %ld baytlık döküntü atlandı" +msgstr[1] "uyarı: %ld baytlık döküntü atlandı" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "isim değişikliği %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: dosya ismi çok uzun" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: sağlama hatası (0x%lx, 0x%lx olmalıydı)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s oluşturulmadı: daha yeni ya da aynı yaşta sürümü mevcut" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "mevcut %s silinemedi" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "%s -> %s bağı yapılamıyor" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "%s yarımsözcükleri takaslanamıyor: yarımsözcükler tek sayıda" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "%s baytları takaslanamıyor: baytlar tek sayıda" + +#: src/copyin.c:642 +#, c-format +msgid "%s is not a directory" +msgstr "`%s'bir dizin değil" + +#: src/copyin.c:755 +#, c-format +msgid "%s: Cannot symlink to %s" +msgstr "%s: %s için sembolik bağ yapılamıyor" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: dosya türü bilinmiyor" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "Bozuk sayı %.*s" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "Arşiv değeri %.*s aralık dışında" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "arşivin sonu bulunamadı" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "uyarı: arşiv başlığının bayt sıralaması ters" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "standart girdi kapalı" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d blok\n" +msgstr[1] "%d blok\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "%s için sağlama toplamı okunamıyor" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "%s: alan genişliği %s için yeterli değil" + +#: src/copyout.c:308 +#, c-format +msgid "%s: truncating %s" +msgstr "%s: %s kırpılıyor" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +msgid "inode number" +msgstr "düğüm numarası" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "dosya kipi" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "uid" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "gid" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "bağ sayısı" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "değişiklik tarihi" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "dosya boyu" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "ana aygıt numarası" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "alt aygıt numarası" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "rdev ana" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "rdev alt" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "isim boyu" + +#: src/copyout.c:403 +msgid "device number" +msgstr "aygıt numarası" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "rdev" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: düğüm sayısı azaltılıyor" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "standart çıktı kapalı" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "boş satır yoksayıldı" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s dökümlenmedi: normal bir dosya değil" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: sembolik bağ çok uzun" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s -> %s bağı" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"GNU `cpio' dosyaları arşiv içine veya dışına kopyalar\n" +"\n" +"Örnekler:\n" +" # isim-listesi ile belirtilen dosyaları arşive kopyala:\n" +" cpio -o < isim-listesi [> arşiv]\n" +" # Dosyaları arşivden çıkart:\n" +" cpio -i [< arşiv]\n" +" # isim-listesi ile belirtilen dosyaları hedef-dizine kopyala:\n" +" cpio -p hedef-dizin < isim-listesi\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "%s, %s ile anlamsız" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "Ana işlem kipi:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "Arşiv oluşturur (arşive kopyalama kipinde çalışır)" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "Dosyaları arşivden çıkarır (arşivden kopyalama kipinde çalışır)" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "Dizinden dizine kopyalama kipinde çalışır" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "Girdinin içindekiler listesini basar" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "Her kipte geçerli işlem değiştiriciler:" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[KULLANICI@]KONAK:]DOSYA-Ä°SMÄ°" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"Standart girdi ya da çıktı yerine DOSYA-Ä°SMÄ° kullanılır. Arşiv uzakta " +"olduğunda isteğe bağlı KULLANICI ve KONAK ile kullanıcı ve konak isimleri " +"belirtilir" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "Ä°smi ikinokta imi içerse bile arşiv dosyası yereldir" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "BİÇİM" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "Belirtilen arşiv BİÇİMi kullanılır" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "G/Ç blok boyu 5120 bayt yapılır" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "BLOK-BOYU" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "G/Ç blok boyu BLOK-BOYU * 512 bayt yapılır" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "Eski taşınabilir (ASCII) arşiv biçimi kullanılır" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "Her dosya işlendiğinde bir \".\" basılır" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "SAYI" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "G/Ç blok boyu SAYI bayt yapılır" + +#: src/main.c:119 +msgid "STRING" +msgstr "DÄ°ZGE" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "Yedekleme ortamının bir bölümünün sonuna gelindiğinde DÄ°ZGE basılır" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "Sadece belirtilen şablon ile eşleşmeyen dosyalar kopyalanır" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" +"Ayrıntılı içindekiler listesinde kullanıcı ve grup kimlikleri sayısal olarak " +"gösterilir" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "KOMUT" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "rsh yerine uzak KOMUT kullanılır" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "Kopyalanan blokların sayısı basılmaz" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "İşlenen dosyalar ayrıntılı listelenir" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "Hata ayıklama bilgileri etkin olur" + +#: src/main.c:137 +msgid "FLAG" +msgstr "SEÇENEK" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"Uyarıların gösterimini denetler. SEÇENEK 'none', 'truncate' veya 'all' " +"dizgelerinden biri olabilir. Çok sayıda seçenek toplanır." + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Sadece arşiv dışına kopyalama kipinde geçerli değiştiriciler:" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "DOSYA" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" +"Çıkarılacak dosya isimlerini belirten ek şablonları okur ya da DOSYA'dan " +"listeler" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" +"bir CRC biçimi arşiv okunurken, arşivdeki her dosyanın sadece CRC'leri " +"doğrulanır, dosyalar çıkarılmaz" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "Dosyaların isimleri etkileşimli değiştirilir" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" +"Hem verideki sözcüklerin yarımsözcükleri hem de yarımsözcüklerin baytları " +"takaslanır. -sS ile aynıdır" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "Dosyalardaki her yarımsözcüğün baytları takaslanır" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "Dosyalardaki her sözcüğün (4 bayt) yarımsözcükleri (2 bayt) takaslanır" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "Dosyalar standart çıkıya çıkarılır" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Arşive kopyalama kipinde geçerli değiştiriciler:" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "Mevcut bir arşive ek yapılır." + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Standart çıktı yerine kullanılacak arşiv dosyası ismi. Arşiv uzakta " +"olduğunda isteğe bağlı KULLANICI ve KONAK ile kullanıcı ve konak isimleri " +"belirtilir" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Dizinden dizine kopyalama kipinde geçerli değiştiriciler:" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "Mümkün olduğunca, kopyalamak yerine dosyalara bağ oluşturulur" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" +"Arşiv dışına ve içine kopyalama kiplerinde geçerli işlem değiştiriciler:" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "Dosya sistemi önek bileşenleri dosya isimlerinden ayrılmaz" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "Tüm dosyalar çalışılan dizine göreli olarak oluşturulur" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "Arşive ve dizinden dizine kopyalama kiplerinde geçerli dönüştürücüler:" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" +"Dosya isimleri listesi satırsonu karakteri yerine boş karakterle " +"sonlandırılır" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Standart girdi yerine kullanılacak arşiv dosyası ismi. Arşiv uzakta " +"olduğunda isteğe bağlı KULLANICI ve KONAK ile kullanıcı ve konak isimleri " +"belirtilir" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"Sembolik bağlar kaldırılır (kopyalama bağın hedefi yerine bağ dosyasının " +"kendisine yapılır)" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[KULLANICI][:.][GRUP]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "Oluşturulan tüm dosyaların iyeliği KULLANICI ve/veya GRUPa ayarlanır" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "Okuduktan sonra dosyaların erişim zamanlarını sıfırlar" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" +"Arşiv dışına kopyalama ve dizinden dizine kopyalama kiplerinde\n" +"geçerli işlem değiştiriciler:" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "Dosyalar oluşturulurken önceki dosya değişiklik zamanları korunur" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "Gerektiğinde baştaki dizinler oluşturulur" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "Dosyaların iyeliği değiştirilmez" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "Tüm dosyalar koşulsuz olarak değiştirilir" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "Dosyalar geniş sıfır blokları ile seyrek dosyalar olarak yazılır" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "Bilgilendirme seçenekleri:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "Bu yardım iletisi gösterilir" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "Kısa bir kullanım iletisi gösterilir" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "Lisans basılır ve çıkar" + +#: src/main.c:233 +msgid "Print program version" +msgstr "Sürüm bilgisi gösterilir" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "SANÄ°YE süresince çökük kalır (öntanımlı 3600)" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +" GNU cpio bir özgür yazılımdır. Bu yazılımı Free Software Foundation\n" +" tarafından yayınlanmış olan GNU Genel Kamu Lisansının 2. ya da daha\n" +" sonraki bir sürümünün koşulları altında kopyalayabilir, dağıtabilir\n" +" ve/veya üzerinde değişiklik yapabilirsiniz.\n" +"\n" +" GNU cpio kullanışlı olabileceği umularak dağıtılmaktadır. Ancak,\n" +" hiçbir GARANTÄ°SÄ° YOKTUR; hatta SATILABÄ°LÄ°RLİĞİ veya HERHANGÄ° BÄ°R\n" +" AMACA UYGUNLUĞU için bile garanti verilmez. Daha ayrıntılı bilgi\n" +" edinmek için GNU Genel Kamu Lisansına bakınız.\n" +"\n" +" GNU Genel Kamu Lisansının bir kopyasını GNU cpio ile birlikte almış\n" +" olacaksınız; yoksa Free Software Foundation, Inc., 51 Franklin Street,\n" +" Fifth Floor, Boston, MA 02110-1301 USA. adresinden isteyebilirsiniz.\n" +"\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "blok boyu geçersiz" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "Arşiv biçimi defalarca tanımlı" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"`%s' arşiv biçimi geçersiz; geçerli biçimler:\n" +"crc newc odc bin ustar tar (büyük harfler de geçerlidir)" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "Kip zaten tanımlı" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "--no-preserve-owner ile --owner birlikte kullanılamaz" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "--owner ile --no-preserve-owner birlikte kullanılamaz" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "-warning seçeneğinde belirtilen değer geçersiz: %s" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[hedef-dizin]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"-oipt seçeneklerinden birini belirtmelisiniz.\n" +"Daha fazla bilgi için `%s --help' ya da `%s --usage' deneyin.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "-I ve -F her ikisi de arşivden kopyalama kipinde kullanılır" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "Argüman sayısı çok fazla" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"--append kullanılmış ama bir arşiv dosyası ismi belirtilmemiş (-F ya da -O " +"seçeneğini kullanın)" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "-O ve -F her ikisi de arşive kopyalama kipinde kullanılır" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "Argüman sayısı çok fazla" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" +"Dizinden dizine kopyalama kipinde arşiv biçimi belirtilmemiş (--format " +"seçeneğini kullanın)" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "-F sadece --create ya da --extract ile kullanılabilir" + +#: src/main.c:725 +#, c-format +msgid "Cannot open %s" +msgstr "%s açılamıyor" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "arşiv kapatılırken hata" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "`%s' dizini oluşturulamıyor" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s' var ama dizin değil" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s bir karakter özellikli dosya değil" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "%s: rmtioctl başarısız oldu" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Kullanımı: %s [-V] [-f aygıt] [--file=aygıt] [--rsh-command=komut]\n" +"\t[--help] [--version] işlem [sayı]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "Hiç teyp aygıtı belirtilmedi" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "%s: rmtopen başarısız oldu" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "%s: rmtclose başarısız oldu" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "başlık geçersiz: sağlama hatası" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "geçersiz kullanıcı" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "bir sayısal kullanıcı kimliğinin oturum açma grubu alınamaz" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "geçersiz grup" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "yazma hatası" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "okuma hatası" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "dosya sonu bulunamadı" + +#: src/util.c:493 src/util.c:543 +#, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "%s dosyası %s bayttan kesik, kalanı sıfırlarla dolduruluyor" +msgstr[1] "%s dosyası %s bayttan kesik, kalanı sıfırlarla dolduruluyor" + +#: src/util.c:499 src/util.c:549 +#, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "" +"%2$s dosyasındaki %1$lld. baytta okuma hatası, kalanı sıfırlarla dolduruluyor" + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "%s dosyası büyüdü, %ld yeni bayt kopyalandı" +msgstr[1] "%s dosyası büyüdü, %ld yeni bayt kopyalandı" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "%s dosyası kopyalanırken değişti" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "sanal bellek tükendi" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "çıktıda konumlama yapılamaz" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Band sonuna gelindi. Yeni bir band yükleyip ENTER tuşuna basın." + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Band sonuna gelindi. Devam etmek için, hazır olunca aygıt/dosya ismini " +"yazın.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "Devam etmek için, hazır olunca aygıt/dosya ismini yazın.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "iç hata: teyp tanıtıcı %d iken %d oldu" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: `%s' seçeneği belirsiz\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: `--%s' seçeneği bir argüman almaz\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: `%c%s' seçeneği bir argüman almaz\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: `%s' seçeneği bir argüman gerektirir\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: `--%s'seçeneği tanınmıyor\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: `%c%s' seçeneği tanınmıyor\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: seçenek kuraldışı -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: seçenek geçersiz -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: seçenek bir argüman gerektirir -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: `-W %s' seçeneği belirsiz\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: `-W %s' seçeneği bir argüman almaz\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: Hizmet yok" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "stdG" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "stdÇ" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "Uzak kabuk çalıştırılamıyor" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "%s: %s çalışmadı" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "%s: Uyarı: %s çalışmadı" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "%s: Kip %s yapılamıyor" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "%s: Sahiplik uid %lu, gid %lu olarak değiştirilemiyor" + +#: lib/paxerror.c:127 +#, c-format +msgid "%s: Cannot hard link to %s" +msgstr "%s: %s için sabit bağ yapılamıyor" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%1$s: %3$lu. bayt okunurken %2$s. baytta okuma hatası" +msgstr[1] "%1$s: %3$lu. bayt okunurken %2$s. baytta okuma hatası" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%1$s: Uyarı: %3$lu. bayt okunurken %2$s. baytta okuma hatası" +msgstr[1] "%1$s: Uyarı: %3$lu. bayt okunurken %2$s. baytta okuma hatası" + +#: lib/paxerror.c:259 +#, c-format +msgid "%s: Cannot seek to %s" +msgstr "%s: %s konumuna gidilemiyor" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "%s: Uyarı: %s konumuna gidilemiyor" + +#: lib/paxerror.c:284 +#, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "%s: %s için sembolik bağ yapılamıyor" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "%1$s: %3$lu baytın sadece %2$lu baytı yazıldı" +msgstr[1] "%1$s: %3$lu baytın sadece %2$lu baytı yazıldı" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "Üye isimlerinden baştaki `%s' siliniyor" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "Sabit bağ hedeflerinden baştaki `%s' siliniyor" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "Boş üye ismi yerine `.' kullanılıyor" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "Boş sabit bağ hedefi yerine `.' kullanılıyor" + +#~ msgid "error %d" +#~ msgstr "%d hatası" + +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "%s: %s. baytta okuma hatası, %lu bayt okunuyor" +#~ msgstr[1] "%s: %s. baytta okuma hatası, %lu bayt okunuyor" diff --git a/po/uk.gmo b/po/uk.gmo new file mode 100644 index 0000000000000000000000000000000000000000..06d0b602ea0975c005f14a9be27d6cd04a7eab29 GIT binary patch literal 29389 zcmds<3y@q_dFQXeICyyN8cf3bU@S|5>G4Pg+l(YzBU!R1NE&5kWMgE3db)dN8ufG! z{g5;Yo5+@JY;Y_ALIN9%Z1c~*(J5RNw%O; zyTAW;&b@uRXEc`lplY{ESO32Ep2v5-_xbMa`SE2Jf8nAiicWF#bNuD2qUaakf!9Ql zu7C0k9`6S4{v`^G4G z9k>a6J9r0pH8=~t3;Z_tR`B0|8t1RTUju&*=D{~I>6^jb;5)(n;7;&6;0@p+I=v6f zgBkDusP<<;(fNabKLdL?zm%Kr0IvlXfn%Vq?*Y~So1g=K0A2p;={Vep@WHSlfVJs?v>kAhm?>45(Z9OC>RL9Ks~MG8Lw_JNOrzYaD*t@CXVe;qgg z-UC*_d%^z=-VFXWlWY7x1|^680``DC5V07%99#mf0)GXZ0Qnb{`S11Mr@3P00q{4$wcs)EeJJ7IgW~JEo#*#Ta1H01K|~&X9@PDBfs)U^1V#VffV%&VcYC^) zgF3$j)co7Rc^+KB`7EgZC&BB%zW_f7UJf${z+q7G`7|hfei~c`{uI0ke8+pDh=0*I z|7o0iK~yFB15kYV9w>SK2)q_tbfwp`J3y`fevm1nW1#5&x1i{{1f^8}HK6GJFvzXw zW1#4`8x+4!g3_m-fYSeKAVPF}jQ>W!dqL^-zXvt{B}}UItO73sr@<8(T~BM;6*5h#@h{U1D^n;|F3&*6rtMDy8>PZs^2iE`KqACy$6(B zj)9WnzXnmk=s$s?NEqERH0q`cU0PX=r=U;*v_kV(@VssHs;kBRxwayHv@oxl0?-2L~a6Ft> zLDBOW@M7>$um}7`z+(ZQ0bj@UKL$0<4?s*i`tRVYz*plGE&*Q;ivG(%wR;Q5zi2uC z-2`UA*MQ#ue|!=C80=@_&!Q|WA^IbjC%*g)Tn)Z~MeBSsNYiKrtb<<#ZwB9la8ZTm z4)E8(yTM`b&%uv?@4_jq1NQ{{!+@7uA4RWV{te(D_lGeizDAz~H*@_@!5?z|Hk5o6 z{9mBvyJe-<%LAb3{Xb2ldz+1tKp+5(1=K2(aRl%n~t+N-UxbziK^mXvVoImj!UT&`*@$1NdS8@FS2y3F# z-~jk@a4+})l;Ex4DbRr}5EYF62iOBHVUf7D=o;`4cst0_qQ3(_39i_}*x(s(A2@U? zF&O+lC^-$@=IJ~RW;uT!L~aFt2NZvP0*an@-|qG94)9^l?+1(EBABXq_JdmAYw0`% z7C_mk=-itg`&3=#bh6dlW9ei?im+z(#%QGfk05Y|U;{8$w20=I)J z!5@N}@AB=Q-ZCgY{3&<>{5ufQM_*@AqT^?v^yWtX8@ecp9s?mQ`r90~1m1#j?Ex<> zpbOyLpyYDhgpW5L1s8Mv5V#!tBd{O*dk|4XSFuRx$sSPrdJaSdqo0TKwJ=3={1zxV z{26#ZI06%U!M^}C?xi31etspW@jnbM1@8yn0zL`;D)@cymEd24n*S%@uYs#}ct3qB z_$Qn{11~8z18V&3;0kaL_#W^S_GPLBNR9p+{1xQ00;PBx=W9RV zb8X1A_=EXGPjc+%csqwazsK=q`{sRi_-b()vgdp*IKceIJIeIzn zm&%GRd9H^D$iPDkJb9|dad_B%l=ZHVB(em1B!QJ8FUa%Iv z9|AwZ@jy5iEKYsL%uGIC2-hTYeWa7a_6?m4cw0ch9*%#(f%%#rel2)0NBp^+FVahW z?&mGLv%No<8T~*z;O%5qa0UoT*L8O90xcq=a}HQ zi=+GVaJX<7{4B>l4*6?+9`um>zm9KNj-woJ3RlJVkD&|?z{n#UlYAFX^%0N$51*&F zCfVzAhld2kSG9?pb2o3=;&L;^iYwOKM72eb?S zqh4^uy33aHS68ZTx{@zW%=Rz_*Ba$~q3Y^W1y?Urr)#b=0dqp&6eEe#(1fi za~q1eLb+CO*_xZtmD*Gx@5XH$bzd(UMgt9QeT9Lu^sXEcl^{(=(+ai-fDy zY`H!Q;TmD%x{;6uEEb1-+p(4B^rhl2+GCJ7P6D>k-N|oG>_O}{e zYtrQDLbhBiPnHU`nkRKpE!=@jEq5wg&E}*NwV6V$h;~jCONEXm`6BG8SE{qR3Vl1^ z6ASYLX_Q>GfL7%PT)D7|f#7&8JB?mX7Ggznh20pA&8!aj#`KJ}HxjCa$wnz#jVB&( zYqMpwvI&wi2rV-pwq|Ud_hw}m23DIY&WOH7G4B?Y8oh4Pe}Ve;U`Da4%}#4Q$!e1O zFePtGoqMZRD9qDg?nonrY~B^BRk(rajL)JCi)!e_6zoOcvU#K;`s|j`c0oPF%K>*= zwkqi+bO)|Lf$yYwPGb#$J=yVBh-}BmoTgGiehCj)0A}T)kZl-K$I1EF{Z8* z%W@Ot#`JihYV$S9JIZ(m^D(YIJ0lM_K&-~IRVK^DJ-D<)8WNos(7gAJ(>;`|vNKRi zn5-!p;(>{D?Euo#ute1n#42St@OBtzL$;=?#LUm^$V?IpT zhV<4)T4^$hobmT)zfhYwV@1rUosqcxk{PXU9J(EG0s{?zhJf!0cM%dP^*)h$%z-sGmUzm8@3b(W8N~lZUk!b z?v~-vF(30LW-UlF04X0l`e7CpThW^jb+;MIOt-rN;v$r$>_@G|GtDdCTU*)}-BdBv3W=ERwDT== zKo@N2xZw;jmT|f49kCR}(o`Ap47wRN)Rt<-JIvZFCOqx%h7-lzG@G75B4r%GM71)V zOyR9FT361F6S?z+@y6t&s4bQ!D$zRc$AToRpG8gYmOGdiv~X!xA6Sw24{y2A`k@W$ zB56y+j%4HDShQX_!=f7L2h!Lfm&l2-yk0kx&0BJ3K6X!`TB)78H5uUo&3CaiMEkuV z`^<5?poIqh*{0Ab2#NpMnF8CQ4Hdj_8E0-6%&-(&YHnoR*p`t^eJ+}>*I0!y%S6)# z3s8K7t2^1BUM-1wFN|7h2b|5%_Vq;CGj7*zd9kMj0h!{%I=N8Kb?@G5Jw5AoXW97` zY6EPW-s9GyTcNqUx49^N$ynTB1gT6=b~@OeJX3KijSSyt>kV;(Z8qdQGM{gdqT9N% zv*Yv9k}uTYifz0zv5{(v?x~uAP4nDO(+aQT2(n64tCR<7+7=O0h5lB33J-(>o3X$f z4f(w?yZdn^O?A_8Y(emC&5!rIIrQi`flh43rvUQk13Nf4}N%mE(IiJ%*uevGd3@qGCQ!9{3;q80u zi)$C!F^SFR)l<_XbDm#U%lRNRCi(eR*U>&+)C1;fvhIq$D{T9w%ch6KiAoMrO0}75E#8Yu-RGLdv;Q)5LkgcJ142*i?xElPFMJS)lQBK|7%kHb)Ai zK_m(7bcLN%r5rD_G|Nb}f{)x}If@R3gQycX|szK7#3@`34-PK)FiFV`owoPvxM1x!Mem~68&TeBDn0Jg(pqZ9` zZij&_ilmB9ZfoY&ZTvS8aulS8Y%!=i%?eImI_;2 zb5!5!+j^oc1Z1xqaWWp#LEQ*@k+4%?oyl&LNv*5cRl(|K$OJ5`FBu$NJ2XUPKHdr2 z<}0+t1Il+~HVtlEmmV$2P0gjr+4v;&W!dH4>eCP+ti`xof9x!NA(j{N9%2}@7z{F+~*V@*&+pNOw9g?Nm)R0N7 z!VUvPx71rtS86laD)RA)s?z^-gB`v%P!a^c_sdj@Gx2VirvziwS%tr=p zJGosLU^=@4hY;^lwdBR|ExCINKA{LJkJaub)hE}Cx4G>bR(Zzxdku|;s+qHrQx$cp z#8vW1GRPJ0Zv#ozxWlW=?U3A#ys6_OJ`RCCy-coA73{tiTKLGUDy8YLx5h|ChO6tj znE^LSX^x!1OJXM_OIdGZdaG2*e^XqFc-Ro>Nrk!e(RFJ_U5yfB8E?FVN=lY0g1hG0 z{{E#=M~RY+GHEF(h7mI0w{9p%j*T(3YSq~&u!McpBLDa$&k#Ok?ercdv=t$n^}0#5 zqFNZ}$yIYI&E?>B&W)oWm;ujSbS%NhGP&#wElafut}HH#icmj`8I}d#B>4c@z5!ivH!0mZOVL`0H-!8I_xIFSqjn{z`F zimK>@{pYnJe3ddprqiCxupyGk-{7JyABz!M2|M4u;Wb)mYI28ci2Hf&L_BXs*N+$LJ)27np7&?g6Cm($qziQPochyx+U;E#^YS}V( zqw9Ax=lq6M%i~)sSG`|ftw;aLW&Q4xpY&a5)4!BH%jmOw>586+N7Kn8{nkO(Jl;Cg z{BG-k=CjSStp{E6xz^t1+2)h{f3*3GF0G(R^NiC;^HlR>>#pWWXKhY5pX1W;)}5^f znu~F^YkjJD=4wulQVwy=)6Hj?=UJL|G-B4Hj-DD^H|}xJa;SB0 z^CWjp^X;$^JO9&r8~7{~?`s}Yx8~D+6kE#S1>TTgs*|m~5U%l;yVkvYImp-UxqBT< zIMzI?iI%X0qhiI;)_u)0&1W1pj>3?m%=T<+fAg88T!E4ktp_rkLW%}_4ysOb{}7$* zLTcu&*DL1dDRkY{dH_=Q!$T)_F@vamu-CQjZ=MxJXLUKuj&N-5z0EVNJB<-Eq|+T=0nX#nxAsb&o>V=k8pgY`B?Mb=BJRl=0Z6%zZQGa z&wrA|9k+oQ=1I6AMR}G+@X}_`cwc6gBh7Cx(3cp{#{Vi8zQ~*h7+;qj)jWZ}u6d5T z2b&K!pU~YeG(Q&)q_H1sezDIn*jd*4U9lvv*ssx47^zB8QNk8F*nEorIo-E_I(d0O z=21j;RuYEcbIhS_Jg@k(5WcJHXJH9KK(oC~m~x^H*qF>OXtX%i`M%Ez zC+#uO+6ovLy0wI-5u{}D980<{mdgoLpyT}!jc6rY%Q<`9i++DZuaC&S#B82>woh7z zx=x$N^;}d$qJ&!aL5B`v$*Au>ag)SP$(dggH}95UY~*LuQp}Pz2XBOSq23Yzs%+fE z8~Fq{9s#C`yHam_mV_3msYaoje27NiM1xCF%vPbpp)zMZJ%OCAZUYVuV?eEatp`ye zv;5d+?052;jBVy2!^Ur#qwtPVHZI#cV=_mNFp}0ic!FRzFd;B0xxqAvp|=@?9-?EK z9yVz_*p%X#XXaP6Y+D}8kcPMJ#tl7-4#}+@_KRf9uShD#SvPW#O$VRi{jyn!v>CQx z^;$0sGPdvIBGQwKiRE`*Lmd~x6FxAYMws`loB2sg2~s9ZR7q>dA-H0CHdneGq*|Nq zRnHlE9v$fzW!?o}@F*`0EuHdi9``QjG!l&Ejh|55IU(Y77{gnJk)W8dtLYY1>tV3C?Hg7stNIC*?StD8StrM4-gN0>aaH0KE{VFfxwmb7s*>e$Tl0eKk&u8vjgw%v_IhvdU9s{6^Q1Y7 zHN*~FX~YReCpzNh@%JQh=AbR&5Jf_iY3=iN9OhLdFt2B64LJ@M<`@r!$jioBp9>^;91H-z5kiAR{D*Cfy9mpAwkWVP&-tV$*&J4WiJEu2!vv+*P{ zY@!b-VuloOAGb+$&e{5;(nPZ}rD>Qedfj|3v9Z|I%f{LbZMfLFyom&@T&P`m`H;<$ z1u{&>QfE(n+h!g__~G?LZfUt*FOMsqju+eZ2i^*O28$C}Vw$B5Zalma;eBC?B{c~O z!kb+T$Nri38J9-s8}q!d} zXu%12dmPNIKB9yOcgL>AVvsz)X=KVmNFJr_3MSfgJS_+inqg*sPvltFbS# z-MBUv=C!rE(g?{0%D0!JjrFK6YJQE0*#DXTjV~L4w%O#S-wEQz!qzt~MaK%Sng@d-<+7WE4hSQc6u&9u!i+6Oy-c&?Uz2wp6W6j4Q_dxTTRs?XARt_}3 z#htG-4|p4igWXX!swS^P&1V=qRR&Vjga}1MLOW!pm!uG36)nxH)k-CvV<{$9PR)1u z9L+Y=epQ`?CfoA6S(?&-PIifx==s77e}OzjS0s!?6J=3% zo70uV5NVg$pq<(eokDyVfV;wU%L-165-J}VRKRbWPG4~WemuMkj1T`>n}E*gyC_9_ zPU05g)E%{x^-<7eXV^RtI|2AA|0ni}FpyoGe|Z=cl&6z5+oDvA#xCUfWX0b1t_@Qejk=*-BfyUsxydsDmle{$C=lciSn;vfZnyvym z5psc7uPyMXP^QA+{&a0C7>{>;G1Z-lc~(yxLi8my%iI<=|iPD3^B)XF(JdH3OAFoupLDQ!AC|V$N!qvsM^jUe%;eddEkS7}AiW ztsnhyv%_cLiE7n0v>K||t%7)}JZ5PR^4ZUgxNS18nB3{nUyKd~??_tU=L`9V$v0l9 zWgE7{&a_DhDNKO-Ebv4`$T`4Mq=)5e4=d}zA>szV#_17Dh91+2&m*a;qhWq$BAe70 zR#lR+s_3pqc2qrixFwB}mr_YS4m{$De26%H;e$5Myez{?$`?AYJ&2?*tj)*?WMEp> z)=)9Hqd+{LK@oVE8s@N>(pPfzo!nug9YJb3PZ%Yd$$f0);Y8r9}F>0()ks15m9 zvR#YGWEP(I(jsy4Jn3uy_@T37CMI0k4*+{x3@adR5-Oi1<_ zq@6eq)601iOoY3C?!ed;sg3Ee4QDCY#T(m4$Vp-@onCjqH^ZoD#*=4p!kQTa{0`zN`m^|s z>?*Bx7Dp{%f66i?x^`#!W*q*hRq~4x`zeXpjUJ=>N8rAw!Z|dY#R?P`yHhj?rYpTL zJxY@#3OY&~hZU?t4EHt)D@dsf5%U53iu9cyJsZ%6Y|=1UZ3IOrms?O(opZ8WNAiT=zIi2l9!wtI!Y; zF*zM{WW!b{^m{i`1<{30cfKuSdd@PF9W0!F1hPy$GF_o885JL@En#Zd_7JS&o^x!2 zn{0ofV*Wj{)aHuwo7}VXV2TJaN-C4yMJ_~$<~lbi@^iMJ)8|RhOV5oI3Fj%1b26o^ zo@wqZEQeqAoaf8vmuitI_EJJ6#oDL6Ic6pm$2^ZTpJ0PaNkfT@3aa7Jp6&dV$YU^J zKdueRv)Bu-r(knFZYc5PzFPAx$ha9I4 zDFt-%>Wim530d-Zdi%vcva*_JlEcjHM`u-z7-Y`tcp-sQ_|vNkp^lrHQeXGlQi-fS zPka)ht#(8J7X9#BK{Id{hZeRM&Bqma<+*fAYgZ^udpGYa=T_O%j#WuALDdP;w z1Q{|%dEOJ`E_k%TZF;4Z(CZOq(vK9*g{&&5{w__px2Mp9~5b5(D% z$eF4`#1a<+lN~C`v0XndQw(TF4|!)alAMD$VXXJOGa=6j$X-QWn#q&M1_1;eza2Tn z%CMO@hxU6s<^FAhG8@wFm$$kk;P!4*y5BqzD)DLYS!Zu#tU!&-DhS?H5;zW z&Qxr-H>TRQ6f2z{B$-soFT#D)4k{U5vd~9K<^)nb zTK7=vcuZOQDfQH_CwuMZj|{+YI8U8cxk2J9a9}T?6-0!xM zTZE@l3I({F2l(Np{nqr*7ufq7~JovN+G+06NkBz04w5!Ry9&h4pw7y3Mu zd8-vKt*94v3zqP~p9M*E;n$_lJB8ILLd=))CAMevfA3y`G)MvTK7KnfrUUVj zdy)dC=3``~Ft|vS5)|GUg=Y*Y`%%%sr#kj(XZlW(e}yzU_TVB*zdKP?SA`!HGmJ6f zr^*%#q8h1+qC6w>m6p>G%-e|EY_pE9zGNfrCfg7V9OA7Plw>9WX>ls6D6!>vpnmn+ z*VBB|ypl$UUvnZE<~<$%FvHnSjiQlRr#Es-w>x#hei>wYDa{M>;JJP& zOnK*#X4fkq{+GkeIP4$L&xhx0w|ZOpHIadB_SobwuH-so@UliV{7xgzAN=MK<%3V{XVF&YlMqr|^Wu5Z zMp9Z0H&3<>%J1OV|FzgL)!-AD=8|n6po@M@8B>>(O^m z>gOAzgO#>b3SE;m*?u&(TfeHgHmBGQ%dF<>HRzl)$kO1R-##P@i62DE1uxvyCN~8* z!Nbdl4QyYX>yp)L#E(>A|d zGB6R?OB)aqQmzg+o%*>tmMjaA`)Ai`QCeDuPU1M5Pen%he7^#U=+)leC2FzHe%3Au zP;ZJiL8%}lxLEI5=L%MY$oyf&3AaQxfg*^TXTz`Hxe@cT<6YZG92do~QV!HRmo!7r zD?LczX|Tk=imVK6$%^%{=a@>k&{UHINxy0#{JMZ&xJeNgy7&JdEfv^f|6aT%U>Ddijo2lLuL zdYETSI!IouHhE_;(ymvEI&TRCvx0=kMgNdBg27K!E> z>s)2k+R&%)JHpljn2E7i4}*+CKcBdw&d-`Hgi1@C<-o=l)+u2M`i^JsGKRJkp4X>z zcfDYz)IC6_#96c=KyX0q)z0^@P#M$>ktAa66=CPwKG>cJX_>vt1{df;0UG|CkX_5v z(w+Fr3!Q&|!P|rB88K8pfLG?BCt!Mgmg|;%>erVtBwfcDX+`mt62YT(q1cA*o5j*p z&k2JZq%z*wV;;#y9TNS!*_{@IBkb@f3(aN81X@cuhE=BX8~ybM5@jo=L6b7!J1wcc zizV@D%ZndX9_Hm3*VuB-k?~`A8rJHC8#3i+^T<$RqAPSB_ElOi=PFv_8 bEtbDAd1wQHnVN$!wSk~mCR*kHvt$2X?O)h` literal 0 HcmV?d00001 diff --git a/po/uk.po b/po/uk.po new file mode 100644 index 0000000..0133c20 --- /dev/null +++ b/po/uk.po @@ -0,0 +1,990 @@ +# Ukrainian messages for GNU cpio +# Copyright (C) 2006 Free Software Foundation, Inc. +# Sergey Poznyakoff , 2005, 2006. +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.6.90\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2007-06-08 12:07+0300\n" +"Last-Translator: Sergey Poznyakoff \n" +"Language-Team: Ukrainian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "попередження: пропускається %ld байт зі сміттям" +msgstr[1] "попередження: пропускається %ld байти зі сміттям" +msgstr[2] "попередження: пропускається %ld байтів зі сміттям" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "перейменування %s ->" + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: надто довга назва файлу" + +# FIXME: Should be %#х +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: помилка контрольної суми (0x%lx, мало бути 0x%lx)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "%s не створено: існуюча версія є новішою або ровесником архівної" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "не вдається видалити поточний %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "не вдається створити посилання %s на %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "" +"не вдається замінити містами півслова у назві %s: непарна кількість півслів" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "" +"не вдається замінити містами байти у назві %s: непарна кількість півслів" + +#: src/copyin.c:642 +#, c-format +msgid "%s is not a directory" +msgstr "`%s' не є каталогом" + +#: src/copyin.c:755 +#, c-format +msgid "%s: Cannot symlink to %s" +msgstr "%s: не вдається створити посилання на %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: невідомий тип файла" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "Недійсне число %.*s" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "Архівне значення %.*s поза межами діапазону" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "передчасне закінчення файла" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "попередження: зворотний порядок байтів у заголовку архіву" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "стандартний ввід замкнутий" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d блок\n" +msgstr[1] "%d блокі\n" +msgstr[2] "%d блоків\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "не можу прочитати контрольну суму для %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "%s: недостатній розмір поля для запису %s" + +#: src/copyout.c:308 +#, c-format +msgid "%s: truncating %s" +msgstr "%s: поле `%s' обрізано" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +msgid "inode number" +msgstr "номер і-вузла" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "права доступу" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "uid" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "gid" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "кількість посилань" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "час модифікації" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "розмір файлу" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "головний номер пристрою" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "другорядний номер пристрою" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "головний номер пристрою і-вузла" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "другорядний номер пристрою і-вузла" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "довжина назви" + +#: src/copyout.c:403 +msgid "device number" +msgstr "номер пристрою" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "пристрій і-вузла" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: номер і-вузла обрізано" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "стандартний вивід замкнутий" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "ігнорування пустого рядку" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s не архівується: не є звичайним файлом" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: надто довге символічне посилання" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "створено посилання %s до %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"GNU `cpio' копіює файли до або з архівів\n" +"\n" +"Приклади:\n" +" # Копіювати файли, вказані у переліку файлів, у архів\n" +" cpio -o < перелік-файлів [> архів]\n" +" # Витягувати файли з архіву\n" +" cpio -i [< архів]\n" +" # Копіювати файли, вказані у переліку файлів, до каталогу-призначення\n" +" cpio -p каталог-призначення < перелік-файлів\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "%s не має сенсу з %s" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "Режими роботи:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "Створити архів (виконання у режимі \"копіювання-з\")" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "Витягнути файли з архіву (виконання у режимі \"копіювання-до\")" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "(виконання у режимі \"копіювання-через\")" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "Вивести зміст вхідного архіву" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "Модифікатори дійсні у будь-якому режимі:" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[КОРИСТУВАЧ@]МАШИНА:]НАЗВА-ФАЙЛУ" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"Використовувати цю назву файлу як стандартний ввід або вивід. Необов'язкові " +"частини КОРИСТУВАЧ та МАШИНА визначають ім'я користувача та назву машини у " +"випадку віддаленого архіву." + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "Файл архіву є локальним, навіть якщо його назва містить двокрапки" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "ФОРМАТ" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "Використовувати вказаний формат архіву" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "Встановити розмір блоку вводу-виводу у 5120 байтів" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "РОЗМІР-БЛОКУ" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "Встановити розмір блоку вводу-виводу у РОЗМІР-БЛОКУ*512 байтів" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "Використовувати старий переносний формат архіву (ASCII)" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "Друкувати крапку після кожного обробленого файлу" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "ЧИСЛО" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "Встановити розмір блоку вводу-виводу у вказане ЧИСЛО байтів" + +#: src/main.c:119 +msgid "STRING" +msgstr "РЯДОК" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "Друкувати РЯДОК після досягнення кінця тому на носії" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" +"Копіювати лише такі файли, що їх назви не співпадають з жодним з вказаних " +"шаблонів" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "У детальному змісті виводити цифрові значення UID та GID" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "КОМАНДА" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "Використовувати вказану команду замість rsh" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "Не виводити кількість скопійованих блоків" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "Виводити докладну інформацію про оброблені файли" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "Увімкнути налагодження" + +#: src/main.c:137 +msgid "FLAG" +msgstr "ОЗНАКА" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"Управління відображенням попереджень. Наразі ознака має бути однією з " +"'none', 'truncate', 'all'. Дозволяється вказування декількох опцій -W" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Опції-модифікатори, що є дійсними лише у режимі \"копіювання-до\":" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "ФАЙЛ" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" +"Прочитати з ФАЙЛУ додаткові шаблони назв файлів, що їх треба витягти або " +"надрукувати" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" +"Під час читання архіву у форматі CRC, лише перевіряти контрольні суми файлів " +"з архіву, але не витягувати їх" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "Інтерактивне перейменування файлів" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "Міняти містами півслова у словах і байти у півсловах. Те ж саме, -sS" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "Міняти містами байти у півсловах" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "Міняти містами півслова у кожному слові (4 байти)" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "Витягувати файли у стандартний вивід" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Опції-модифікатори, що є дійсними лише у режимі \"копіювання-з\"" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "Додати до існуючого архіву." + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Використовувати вказану назву файлу замість стандартного виводу. " +"Необов'язкові частини МАШИНА та КОРИСТУВАЧ визначають назву машини та ім'я " +"користувача у випадку віддаленого архіву." + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Опції-модифікатори, що є дійсними лише у режимі \"копіювання-через\"" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "Коли це можливо, створювати посилання до файлів замість їх копіювання" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" +"Опції-модифікатори, дійсні у режимах \"копіювання-з\" і \"копіювання-до\"" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "Не видаляти префікс файлової системи з назв файлів" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "Створювати файли відносно поточного каталогу" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" +"Опції-модифікатори, дійсні у режимах \"копіювання-з\" і \"копіювання-через\":" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" +"Роздільником назв файлів у переліку є нульовий символ, замість символу " +"нового рядку" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Використовувати вказану назву файлу замість стандартного вводу. " +"Необов'язкові частини КОРИСТУВАЧ та МАШИНА визначають ім'я користувача та " +"назву машини у випадку віддаленого архіву." + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"Оброблювати файли на яки вказують символічні посилання (копіювати самі файли " +"замість копіювання посилань)" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[КОРИСТУВАЧ][:.][ГРУПА]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" +"Встановити вказаного користувача і/або ГРУПУ власником усіх створених файлів" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "Відновляти час доступу після читання файлу" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" +"Опції-модифікатори, що є дійсними у режимах \"копіювання-до\" і \"копіювання-" +"через\"" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "Залишати без змін час модифікації після створення файлу" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "Створювати початкові каталоги якщо необхідно" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "Не змінювати власників файлів" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "Завжди перезаписувати існуючі файли під час витягування" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "Записувати файли, що містять великі блоки нулів, як розсіяні файлі " + +#: src/main.c:228 +msgid "Informative options:" +msgstr "Інформативний вивід:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "Показати цю довідку" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "Показати коротке повідомлення про використання" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "Вивести текст ліцензії та вийти" + +#: src/main.c:233 +msgid "Print program version" +msgstr "Вивести версію програми" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "зачекати вказану кількість секунд (типово 3600)" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +" GNU cpio є вільною програмою; ви можете розповсюджувати її чи/та\n" +" змінювати її на умовах ліцензії GNU General Public License\n" +" опублікованої Free Software Foundation; версії 2 цієї ліцензії, або\n" +" (за вашим бажанням) будь-якої пізнішої версії.\n" +"\n" +" GNU cpio розповсюджується з надією, що вона буде корисною, але\n" +" БЕЗ БУДЬ-ЯКОЇ ГАРАНТІЇ; навіть без неявної гарантії\n" +" КОМЕРЦІЙНОЇ ПРИДАТНОСТІ або ПРИДАТНОСТІ ДЛЯ ПЕВНОЇ МЕТИ. Докладніше\n" +" про це читайте у GNU General Public License.\n" +"\n" +" Разом з програмою GNU cpio ви повинні були отримати копію GNU General\n" +" Public License; якщо це не так, напишіть до Free Software\n" +" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 " +"USA\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "невірний розмір блоку" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "Формат архіву вказано декілька разів" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"недійсний формат архіву `%s'; дійсними форматами є:\n" +"crc newx odc bin ustar tar (дозволяються також назви великими літерами)" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "Режим роботи вже встановлено" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" +"опцію --no-preserve-owner не можна використовувати разом з опцією --owner" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" +"опцію --owner не можна використовувати разом з опцією --no-preserve-owner" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "Недійсне значення опції --warning: %s" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[каталог-призначення]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"Необхідно вказати одну з опцій -oipt.\n" +"Спробуйте `%s --help' або `%s --usage' для отримання докладнішого опису.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "Опції -I та -F використані разом у режимі \"копіювання-до\")" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "Забагато аргументів" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"Використано опцію --append але не вказано назви архіву (використовуйте опцію " +"-F або -O)" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "Опції -O та -F використані разом у режимі \"копіювання-з\")" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "Забагато аргументів" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" +"Не вказано формату архіву у режимі \"копіювання-через\" (використовуйте " +"опцію --format)" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "-F можна використовувати лише з опціями --create або --extract" + +#: src/main.c:725 +#, c-format +msgid "Cannot open %s" +msgstr "не вдається відкрити %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "помилка закривання архіву" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "не вдається створити каталог `%s'" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "`%s' існує, але не є каталогом" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s: не є файлом символьного пристрою" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "%s: не вдалося виконати операцію rmtioctl" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Використання: %s [-V] [-f пристрій] [--file=пристрій] [--rsh-" +"command=команда]\n" +" [--help] [--version] операція [кількість]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "не вказано стрічкового пристрою" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "%s: не вдалося виконати операцію rmtopen" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "%s: не вдалося виконати операцію rmtclose" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "невірний заголовок: помилка контрольної суми" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "невірний користувач" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "не можу отримати групу реєстрації з її номера" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "невірна група" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "помилка запису" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "помилка читання" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "передчасне закінчення файла" + +#: src/util.c:493 src/util.c:543 +#, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Файл %s скоротився на %s байт; заповнення нулями" +msgstr[1] "Файл %s скоротився на %s байти; заповнення нулями" +msgstr[2] "Файл %s скоротився на %s байтів; заповнення нулями" + +#: src/util.c:499 src/util.c:549 +#, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Помилка читання файлу %2$s в позиції %1$lld; заповнення нулями" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "Розмір файлу %s збільшився, не скопійовано % байтів" +msgstr[1] "Розмір файлу %s збільшився, не скопійовано % байтів" +msgstr[2] "Розмір файлу %s збільшився, не скопійовано % байтів" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "Файл %s був модифікований під час копіювання" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "віртуальну пам'ять вичерпано" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "не вдається виконати lseek на вихідному файлі" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Кінець стрічки. Завантажте наступну стрічку та натисніть RETURN. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "Кінець стрічки. Щоб продовжити, введіть назву пристрою або файлу.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "Щоб продовжити, введіть назву пристрою або файлу.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "внутрішня помилка: дескриптор стрічки змінився з %d на %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: опція `%s' неоднозначна\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: опція `--%s' не може мати аргументу\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: опція `%c%s' не може мати аргументу\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: опція `%s' вимагає аргумент\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: невідома опція `--%s'\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: невідома опція `%c%s'\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: недопустима опція -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: невірна опція -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: опція вимагає аргумент -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: опція `-W %s' неоднозначна\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: опція `-W %s' не може мати аргументу\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: сервіс відсутній" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "stdin" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "stdout" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "Не вдалося запустити віддалену оболонку" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "%s: Помилка у функції %s" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "%s: Попередження: Помилка у функції %s" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "%s: Не вдається змінити права доступу на %s" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "%s: Не вдається змінити власника на uid %lu, gid %lu" + +#: lib/paxerror.c:127 +#, c-format +msgid "%s: Cannot hard link to %s" +msgstr "%s: не вдається створити посилання на %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: Помилка в позиції %s, під час читання %lu байта" +msgstr[1] "%s: Помилка в позиції %s, під час читання %lu байтів" +msgstr[2] "%s: Помилка в позиції %s, під час читання %lu байтів" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: Попередження: Помилка в позиції %s, під час читання %lu байта" +msgstr[1] "%s: Попередження: Помилка в позиції %s, під час читання %lu байтів" +msgstr[2] "%s: Попередження: Помилка в позиції %s, під час читання %lu байтів" + +#: lib/paxerror.c:259 +#, c-format +msgid "%s: Cannot seek to %s" +msgstr "%s: Не вдається створити посилання на %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "%s: Не вдається виконати lseek до %s" + +#: lib/paxerror.c:284 +#, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "%s: Не вдається створити символічне посилання на %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "%s: Вдалося записати тільки %lu з %lu байта" +msgstr[1] "%s: Вдалося записати тільки %lu з %lu байтів" +msgstr[2] "%s: Вдалося записати тільки %lu з %lu байтів" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "Видалення початкового префіксу `%s' з назв файлів" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "Видалення початкового префіксу `%s' з назви цілі жорсткого посилання" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "Підстановка `.' замість пустої назви файлу" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "Підстановка `.' замість пустої назви цілі жорсткого посилання" + +#~ msgid "error %d" +#~ msgstr "помилка %d" + +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "%s: Помилка в позиції %s, під час читання %lu байта" +#~ msgstr[1] "%s: Помилка в позиції %s, під час читання %lu байтів" +#~ msgstr[2] "%s: Помилка в позиції %s, під час читання %lu байтів" diff --git a/po/vi.gmo b/po/vi.gmo new file mode 100644 index 0000000000000000000000000000000000000000..0aac08091a938df7ca46426deb133b2fbfb465f2 GIT binary patch literal 23607 zcmd6vdvsk_ediA)Ko9|jcX$ML2*y(4D@zV}ASbD1`K82?9ZAju<2qOO9!WR8uiS@h zF$|Cz$b>WylMw0&0Xt3z&VwXPXeLrwu()no`bP(5W-X?j!i;7Hx@JvhF|2vE({|?b z{q243L$AcNtW_IdJ-^UvQDMehX9d25u&_;&C=f$s(XFE|Un3u3MTkAatfKLAtUUxTWDF`bFd z!GQb04LsMu3&4lKb>Mfy`=5bo{}viMa1i_;I0-UjbZ5W^K}e6D0YSB#$4tzKG z3y`j&*T2Kh@1lT1;4tqqpyvN%z#oIXs?Vga1+M}%&pW^?z^{X!0e=F17R)lKo#1}~ z#lK4-LhCRNc7e0tdhm9z8$1oZ2K<+x==)Rf4dDL*bKt9Zxd|+RYWEP>1O5?s3-~`k z^|Oz~6Mg~|-ya1v&!2&pf`1J*1708S2JqE9?*~5$PJ$ZeJK$yDpMyi-1x)&q zS42@7gtX{xCMUjs1KbM!9>~&0{}0snw>rN*8$r>31E}wJf}-oI;rTgG<9{FA4E_Mr zx}Jw{UI|_bei+Py1K`&|tbAetrzH1Fb$=$P{=Kb$Mx{l8MfT#OnP;?yt)&4jrdY=OMU-Y~DBRc*qC_bNu&`OTBfRg*q zfuiGg!7=d1pvLRtrN%!1YCiXYlG`)jA@D~aA{7lml<4^=sQx|yehz#LWNOi6Ecz^X z6R7_F1$Y2_H9{h}&w_|>G#l{qpxS*M)OgjUlwU&(U}ijO()Jn-}2W#9u~4E_)l zomViZ`n?vE{@nzs{$Wt_{4}Wk?*~Qi3Gj{J3*q_upy>Gz;5p#`0lUDz33x8XMbB>m zHO_lM^|Jw#o!Sn*3OoqD8jL~Fp9fX149ZU232p=bIruv8Z@`CM0d0KzA`PBku{F-G zBP?$RuLUJvX;6H65Om zK-q(Dg5vXk1*I=iuT^Q9m^hk&37#K-Jp^z7zZ;hzLc;LCNVEQ2O=f z0ncZ$pXGTNJO%zBV2#P%%JcaUUj>hXl9T@p?gig|HL?Uw2mCNhsq_50U-x{v9YoZk zZ-ZL5{|t_R{}a3p9NOa7{R^P@aXb_kfF_uU`hw=lS!X*7;HJ9Pp39>%o5o zLTa>b*xQ>N_!~U`0r*kygV%aGkAmXg4?)S>1w4pPw}K2AeFM}u{|$T}_*yExAM63M z;BN3E;4`4=pU31`l4t^CX`}lcnG|V z$wOLn64dv<0Bhhzn7Rdg7*xMM1tB5Y$mGSpkAr^--UnU?md3nZ9RoF91H1?POHg!v zZXBNh{sG9V=Epv@I3IZK(%|#eoy!L0k?qS*G#}qgQEXLczzhvI)4`wpI(Wuz7|Y@ zs7=Ijm_2+D{2hw^m_k&tU%t&<;kV|0KIOM41q!UNKSao6?^5t`|El?~WbWORJ1BL^ z=P9>Q^p~bcX4?NC)ATzPUP{NmMnUYFe;4ozF)@3nm(vv3V}44{8H#jCc1Uac0HvSu zDazL=;`8Sy;#2bXEI(dPxt%gYd6IH~lKef#k8e>VtNPPg{A2s&dcK1R8aawR24(ccx6%@oXF^aYCkc6%`S z#=Ka(pjTg^j8lq~*HV6y(nrBWo2_^gsK0kno}mm<@|2HLB>Ouk4^fU%^mhs6pHbFR zWJ|819HYFG(*E~Yc-R?m4m?Qt3}q{&MoIpj;D_{f6Xg-gh=0UdRV#*ZdHz@a0-cI=db z{9QyjOc|lbmg%oT`7Gs&deEP9Zs+Jemnr8;E?0F^l{j|Q(p2qmx)N`8bEUe=q>HW+ zXLHqBB{x~G#V%KK>0)+csp1NyY;J0rHW8YP-P|oL= zBwVeei?uljR}UlG$A)&%WN_>7?%|1>A>Zv7o*3OeKJIqx8FPbf@8Hw^No{d@9Oq`pAvb4*T z%A)Hf7EPn3^QGdnO|r?t%`P|Pily2Hces*6MrtMNXSJm?{tXv1y&K$R{VaI8cqk9o z$7?J-eeB3h)n?p|e5q8~;I@{kwNi0|8yR$coBI3vQvH|q^}BuJgI!(GI^-r_${cF_ zs`9fcNiM|cVy-xykE>Nr>bh$90-2ibOuCZJNG7V~IFmyKh4_c)FfXSCWAT z+)%oxS~fuQ2||l>h^`r1SNvEyjDl5Xa%It1&t=`Ze0_tP_CKJ$)tOQ3s&fU+r#YME zcbJm3sV@IijpG#>EbnP7PG?&&qR&1VZD-X&yc}>h zrYlLhjUrYkmd}?CV}4z_ zGF>k~h3}?WnX0I2x-glWu9xbjy8}t*x2U5^d|MqYq|R!6q*7-wVCqJ9_O(}~a3$i} zxm79DGWimYZVCe&XN`lr%at-UtWC!|Turh46>2qElCKPE+O|5iO1+rDAxewF0nmbJ1uscorhuVCZ@G=2RD7f+PY?~l>}pLePzxSVzw`t4dsu0Sn}x6%|B5zj884m4ae4cqW4< zXO0!LC{7_ws+=YQFz@NbFohvh126VHt?BsJg?hf0D`Tp&@f1s$ZGOk{)p2FL7n@Wl zyn{JJF4J+eb@!g3>r&&xAK4ylElFU9ji1OLQM6YQF;vumq9xSZvuZu{Zxx63jEoG9 zZi_-}5Fd#%3c|yh5IX1c$u~11*n}a(rc%l)+LV)Y#J1&pdal% zRw~*WuP^dr{RX!_m=gPq@m}BSMm#^LW|D*@&SdH^35Dp5hVbW-3^YPIQ-v%($O?o2 zFylvrgd~&-P4XcSNIv9fe3;-K;}yqQ*dFR>Ly%aOZY-ZkrWlzps3+P+t0_t`6FWsV z-f)`btg;!fxYh*SlV}k=-OjmkDTiN#(l-53ZShRw%Jx=!dZTS66Ri-4=}Rl#LI(80 zx=t#V@v-#FYj21pC>Ewlk;}+tQc+u~vNxF3IaIjdu!d8)BUCGtS&<@!V5(9oG>7oo z8Er47C-L0bc(Oh{EoyVcsZzAv+p(|`*3P`9H_IK&3sTs#qz$ZS+7GX}(T?HW+apO! z#ExWSa3b2Fm|g(;SNOVy2SpV&7x+Uuf~T1}MbvxqmXGXeQW zxH`-JbfZ?(TVcdfJK%J7uD2`Fp79p#me+e)SRfO8SSJ(ex$ez-wX19Uku*EMxH`bL z=^{6TY=!Ew-e#ioBV~Sv9wahB*lA#U@>I!PWn}nD`>#nV9I!4|So4)S$+`VkbvArS zTC#B!uGq#ql_;sU=$@)FY+B)aJFW0ah9Ip#wL*HJs%;TIRp>v}X0SjQu(CPcXxQ(S z+1*bnXsVfvv%Xp%Qw6aJA+XT*uyiY~5Fzaw-e#=dIlPT7ym8mS!CnpU5*Lnx=Ova8 zJE4HrE9`KHXT5D#gq%txR@1j1K)j>f+AH~WUfEO>w7)@0Fe%k)4&97K@Y|5Uz)C@w zDIefvUi7i@!7#|1L?a5>(s`4xrq>zWH?np6ShPo*282G58#7*6Z;x*h!C;)yZnl(1Qq55DdNQ3kR4=0k z*<4xa5xkJae4#5g4?fAp$`OIq!fSe) zuA~b|ej*xE>?*r0F(ph)q$i0GWppL^QktrKWr&s)I-A)ti)UWKx>~aF&$An4P1FO5 zw4%))Bf6Z`FiA*oi?(RiZCf^i4P;CnWsS;(Seu^UA;)4O9^!#kWWuJYR7|FspQER0 z?42|Ljod^nry0UYujuJ1<%Xn`qKy?T&_vO=eDrLN-Kw9JcT?Jsq2|61GX=K8NVo^# zZJ|q3b|Nn{(RiR_c;g-)D7Y#+GjaQ}{!M-6U8`$UYK5QfVzqe529i&2EWDYq00kG` z8l)q@X))0zh4~7;sugS}y9;H7caH7Zw>KKEPhzcWb=#=k(#wkSDK3;relA_swd%I5 zYBYX0U3QZSuxBu&hf9^Lt(X5HYoRd2UbVinUYac#V^aS zGZn%V{Z5Ixt9{sF&tw8qM3D56y*l85uGdmgzSe4l4EljK54Ar-qP=#Yi?I^nNaF4g z`RPO0c7#m{^K5QB8PuAJT_v=>jMFy{-aR-zG(1caKH2ozJ}cD40?KxzMh8c>xA)cz zL(Qbg*!Xz#SF)kK!ABf;S|5ld3*KgWZ%kr9X>{5RjSWejwT%qZ;_N}L8pd)WVlqRW z^(_H03mBxS*(6)CBw40bN5$rvrnMz;H(D~?8zhUWNf#4Eh0O%E%A#x?q*Tl43hUzq zRayQ*oz1*gPyz(M%}bSX;`KXtaODAn`zC7T#yZEqjC%Xz!kG+a^xtITO$h zjM1ly5Rr{SY6w4I{LPox`nc&z33m!7l$dD-gh^fP;G{KZJ7HYtppZU21!Y`QnnfQL9ZE{j>;WYWqE_< z=g6x%HsV$Y^pRxq9SOjt??MglnU#<<8TQ&3DW9;hmMIUoak6m441OhM$xcdpBa>T& zQvR3xQpCAJq(cca>Eqjn#$A z`D+`lZN3aYuH5%B=(Vg zo;Zi+R?I8^<9%)l#|h7x)vJec#LZx^i$niDc#E9U1~U+ z!o2Iam_^ee_om(}x`+<(PN|V9lAPLFpRT4RN&{G;>6EH$nJ(6QOO@%ay?Z87mWHBr zY8#2J0k^5I?}}94<*B|aT>pm#`Y*qv@6x_LDyGJW2{lTq-sP$OO{u<1UH=sWAL_rP zpNd_()74sPf}CNMELjOL8p_YravXN&vRMULS7q#ZONFg!1p}DvEylIpbp0Ay7N_gP z0I7*MT^MjTq| z1N|eC-$<04<6vFsY{KEI>$R!Wm92WBl+0RcJF&CE-~o5#WUkh=H(%#8KeYp&fLSY+ z?Xh}w|7PcZUfs93>!y@Hm$qq+q%&^s9=DzF8%2kdbbnu0G&J+#(=VP>a9wFUQRKX; zaRLwAIN{1Oi}R1NXI@;moz&Oj!ZVyFZFZB3^C#KeHJ-)#FD@LVR^w#N%`{HXG|#sj z9X#u18z(l-losco&$#O1!joxt=GfxGm%_Kjg$HuH$kB1#9Rlv4!^MS1({5*OasH7x zw|Ay-y6lD;&q3AD;=*x237;aA((c8l7Z*-t+>ttUIigscKgHp~;=9E` z{6l-(uEwWEce$O7--12!4{dN0yB6o47;!_p8h0;ilHTmF1&-^BRZ*AN@>UIs@-0^aE<5O+zZWvx%`0S9|wz%+(399XB+&@!EMhMiIV~tZxcX9qnlepu_!dBCS?Jq+%GL08t z)U1hCW(A4f?23$sxXnnaSlPxY!o-9q@7iRP!d^hy2K`A|}jChAG%qUnF%O_K7JmhDQnL*J{7a?mvW~M-Wsry}6n}sju>~(1E z4HCJzIZa*W29=%vjy)Wg=*dPwzj|7=$!+yHOh!>=>uV0GpQc|W~omY0N-Y>JXYM-txKQ@+Sb0XBE&h%)n($3C0U7c; zjecAnZlGf(?SsJGFKN;!&{14qCGC=1A4Rp3lWe>6A-)`U74NUK;E24j%>0 zib0bHnWo#P5_znt!oci1T_p+ z;4FO>qgxbS7>_{G_Kvz+C(h7-Xmtc-1$WlE3w+ILUS>_b@n{4<@ecc8^@el zPZE~f*W@5XWKDcnmv$<*mES(sT~ltsF}n(z0pLXIQCwa1yBEohF&$-g zZV&WC?D>|CV{+KkvLn)oq*)R9&|VzN^k|Vw0g1dDeRkDK>riwSM7};>?Qh=$?oiHHyhW{ zU7Z$Ew)~ll)6C_teC}hC-6lcbgi(co1U|pwO%3lze4vyIPazQPeDSxzn#L7X>1n?j#+9lz=Z;atW34BB zwcd4OCW$XaNKdaD6?H6bd)L*)c{YQ}F}VEipPn<*MC1-dcWY0PY#@EKfgmg4dol2UEW!_6Sslo{O3k#IwvQkijS^#;xt7+94dA~Nif!jg zd&p$uq(1v|MA;%Qzt{JUqN$+Gk&_0teS@9eoB7SGR8f4@3Iht`n7|$KB_xxy-%OU0 zvCI}X-$dkHo@@{J-1OqYNlbt?)nkeU{Xp$Kyqp!2w)glBnqz6E9X_bjVoM&L*y|>S zM`cgGV#e!p#%naOP-n8Z}ooi3HP04#xF{?BM)&e2S~A9pSy~ zqtQt&79u$X#|?&hrN~vdRXddZK1v6T$Jp#CNC+9L;Jp1(dTp{~$i^10rEci=w@6`- z@R;VLaKalmOsl2dv5wy8D5u&Kv!%-|2GT3GkX7&MnowAx5Zn1nbe_OfTYENUTQQhX zY>OfxQXfW(-K$fzgBGeCv})Y0qmsW_=f_cCx0FC+s`BJ__)`K+ zpfg6W38Ickia|Mpc5h>GdUBr+>67D1Tx5@~Q}lARPk~>OXH1NiMcbWb7)6{{{??od z##>B28Vz9wTX{Y?afLVDOb_THwl}m1JBXm|%3pi4)x)D`obX0NkThCVp27}Kru>0& zNZCr|<%Snd!^!!_{po-=^RTEHOLW?wnS}Z_hI(!C-Wde+ zB{=@ElKxfpPE7Il+C9dgMf%I>ocXhyfya%6f(Cj;P~h z1srGYQ6kQQEB4=CuzZ-MGdqH01lT4Lyh=y3X~zNZ;cWT|5rQ3g%*wcWJCC`pY&-BFsNuV{NqoR2u6+_)+I{$A^c_AW>(al0W$qcu0gC4Jje#Ghe=8 zr@c#d2|grg(WG8@Iw@Q3PlC+Kud!D^AEKdM`xY1OA5Q2!WG@6q_V@a6Izj~4A(0&|tuQt)@b5(&E7L>X+ZuGMP-e;4X#+ z@<(=whbk&8PnohNvVq>p%InTn2w~eQg^*KcDyHmpyQ`p_-qKj4I_?t;twEJjYwOip zy=8rSOOwbtF%xZU95v~&PJQLk7K__0u^b`(sb?vvyY*)AD zzqu=1k9Aked(h|RF8l9MsM89BH+Si}5_fy3)$TC3E9)}^5}+lyHIsS8TH|de1b&E+ za`Z0K6hYFCiNM-#_ib?b^sTf=su09I+&#HV54ttz%E@J!WE? zn#s(eB*;y4mpoiJIq-QfX@q51WihoQl4oxwRCfoz2U}5ROsdZWcZ#yN4b9ZUk;JWE z*Rtg5cnKSH`?kC7Y*eB6wAw$M01Ti?C)BX%qJ9p)})V@5BraCi5=J|{&j{Bad~VsSz63C7pJy9`esJAE8Th6WLidZh)c|pv zh;{pmygf?k&vU&Z2{wYKTs3E>t&ZL9{oX=vmkEP9BuFx`4!+-C^p%0_Zj|Ujr?3NeoViCilC=nHIp|m=P{Mm@+sAQC#K3E7OPu*Hg zrb1jnd{~@mJX>ILmO%-b4lf|u((S{E6vjn@7@NtmN4Q z8E!3@yLyTC%N)}3URqTm>)K{Pt{BvHEn70bjb8mbYrpWws-L6w3l%;zY&>g%Q);{Q zj7;8zcj8Rp5e$YDu`PuaX;aeN-Z%YkTX5IZ;z*aG`Mi>^LN{+hqn#p!V0C>te% z1qqfZ4I%>PlB7u@kK6*4&s@@`ts+)yV6E%bxFgtW`#6$EGM2hs3B5AJPjPmd?upu1 z7vkb&1VvsOm%sN)4Sn;ECfDhbeKZ;{z)q)ilL%gPUZ9B*D-;fKmUl0E$x+F4jzb65 zrJ0#+r&%@&p^%s)hPgvxEeGo*vTY+3B(XhxtEI4O6O8mgVTB4!!D_G8y5${ILoakJ zh8ke#n>VN;6AOy~WYf9p-9cqy;rv0Y*EOUG<>;)}nJizuUT1%6^)9m>-b7mN0JwIM&UZwk`>3hV~Mm*rzPyq_{doTL3_Wxr!q^rFfB=JKNqgTt?~+@ K9$3agM*kldHmK, 2005-2006. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.7\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2006-12-03 17:41+1030\n" +"Last-Translator: Clytie Siddall \n" +"Language-Team: Vietnamese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Mac PO Editor 1.0a10\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "cảnh báo : đã bỏ qua %ld byte rác" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "thay tên %s -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s: tên tập tin quá dài" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s: gặp lỗi tổng kiểm tra (0x%lx, nên là 0x%lx)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "chÆ°a tạo %s: một phiên bản mới hay cùng thời đã có" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "không thể gỡ bỏ %s hiện có" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "không thể liên kết %s tới %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "không thể trao đổi các ná»­a-từ của %s: có số lẻ ná»­a-từ" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "không thể trao đổi các byte của %s: có số lẻ byte" + +#: src/copyin.c:642 +#, c-format +msgid "%s is not a directory" +msgstr "%s không phải là thÆ° mục" + +#: src/copyin.c:755 +#, c-format +msgid "%s: Cannot symlink to %s" +msgstr "%s: không thể tạo liên kết tượng trÆ°ng tới %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s: không biết kiểu tập tin" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "Con số dạng sai %.*s" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "Giá trị kho %.*s ở ngoại phạm vị" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "gặp kết thúc kho quá sớm" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "cảnh báo : dòng đầu kho có thứ tá»± byte đảo ngược" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "thiết bị nhập chuẩn bị đóng" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d khối\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "không thể đọc tổng kiểm tra cho %s" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "%s: độ rộng trường không đủ để cất giữ %s" + +#: src/copyout.c:308 +#, c-format +msgid "%s: truncating %s" +msgstr "%s: đang cắt ngắn %s" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +msgid "inode number" +msgstr "số nút thông tin" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "chế độ tập tin" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "uid" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "gid" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "số liên kết" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "thời gian sá»­a đổi" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "kích cỡ tập tin" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "số hiệu thiết bị chính" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "số hiệu thiết bị phụ" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "rdev chính" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "rdev phụ" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "kích cỡ tên" + +#: src/copyout.c:403 +msgid "device number" +msgstr "số hiệu thiết bị" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "rdev" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "%s: đang cắt bớt số nút thông tin" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "thiết bị xuất chuẩn bị đóng" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "dòng trống bị bỏ qua" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "chÆ°a đổ %s: không phải là tâp tin chuẩn" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s: liên kết tượng trÆ°ng quá dài" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s được liên kết tới %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" +"Trình « cpio » của GNU sao chép các tập tin vào/từ kho\n" +"\n" +"Thí dụ :\n" +" # Để sao chép các tập tin trong danh sách tên vào kho :\n" +" cpio -o < danh_sách_tên [> kho]\n" +" # Để rút các tập tin ra kho :\n" +" cpio -i [< kho]\n" +" # Để sao chép các tập tin trong danh sách tên vào thÆ° mục đích\n" +" cpio -p thÆ°_mục_đích < danh_sách_tên\n" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "%s với %s vô nghÄ©a" + +#: src/main.c:87 +msgid "Main operation mode:" +msgstr "Chế độ thao tác chính:" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "Tạo kho (chạy trong chế độ chép ra)" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "Rút các tập tin ra kho (chạy trong chế độ chép vào)" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "Chạy trong chế độ chép qua" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "In ra mục lục nhập" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "Điều sá»­a đổi thao tác hợp lệ trong mọi chế độ :" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "[[người_dụng@]máy:]tên_tập_tin" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" +"Hãy sá»­ dụng tên tập tin này thay cho thiết bị nhập/xuất chuẩn. Có thể ghi rõ " +"người dùng và máy khi kho lÆ°u ở xa." + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "Tập tin kho là cục bộ, thậm chí nếu tên nó chứa dấu hai chấm" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "ĐỊNH DẠNG" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "Dùng định dạng kho đã cho" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "Đặt kích cỡ khối vào/xuất thành 5120 byte" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "Cá»  KHỐI" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "Đặt kích cỡ khối vào/xuất thành Cá»  KHỐI * 512 byte" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "Sá»­ dụng định dạng kho di động cÅ© (ASCII)" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "In ra một dấu chấm \".\" cho mỗi tập tin đã được xá»­ lý" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "SỐ" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "Đặt kích cỡ khối vào/xuất thành số byte này" + +#: src/main.c:119 +msgid "STRING" +msgstr "CHUỖI" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "In ra chuỗi này khi găp kết thúc vật chứa sao lÆ°u" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "Chỉ sao chép các tập tin không khớp với bất cứ mẫu nào đã cho" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "Trong mục lục chi tiết, hiển thị UID và GID dạng số" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "LỆNH" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "Sá»­ dụng lệnh ở xa này thay cho « rsh »" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "Không in ra số khối đã được sao chép" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "Liệt kệ chi tiết các tập tin đã được xá»­ lý" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "Bật thông tin gỡ lỗi" + +#: src/main.c:137 +msgid "FLAG" +msgstr "CỜ" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" +"Điều khiển cách hiển thị cảnh báo. Hiện thời cờ này là một của những tùy " +"chọn 'none' (không có), 'truncate' (cắt ngắn) hay 'all' (tất cả). Nhiều tùy " +"chọn sẽ tích lÅ©y." + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "Điều sá»­a đổi thao tác chỉ hợp lê trong chế độ chép vào :" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "TẬP TIN" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" +"Đọc các mẫu thêm ghi rõ các tên tập tin cần rút hoặc liệt kê từ tập tin này" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" +"Khi đọc kho định dạng CRC (kiểm tra thừa theo chu kỳ), chỉ thẩm tra những " +"CRC của mỗi tập tin nằm trong kho đó, không thật rút các tập tin" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "Thay đổi tên tập tin một cách tÆ°Æ¡ng tách" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" +"Trao đổi cả hai ná»­a-từ của từ và byte của ná»­a-từ trong dữ liệu; bằng tùy " +"chọn « -sS »" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "Trao đổi hai byte của mỗi ná»­a-từ trong các tập tin" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "Trao đổi hai ná»­a-từ của mỗi từ (4 byte) trong các tập tin" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "Rút tập tin ra thiết bị xuất chuẩn" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "Điều sá»­a đổi thao tác hợp lệ chỉ trong chế độ chép ra:" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "Phụ thêm vào kho đã có." + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Tên tập tin kho cần dùng thay cho thiết bị xuất chuẩn. USER (người dùng) và " +"HOST (máy) kiểu tùy chọn có ghi rõ tên người dùng và tên máy trong trường " +"hợp có kho ở xa." + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "Điều sá»­a đổi thao tác hợp lệ chỉ trong chế độ chép qua:" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "Liên kết tập tin thay vì sao chép chúng, khi có thể" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "Điều sá»­a đổi thao tác hợp lệ trong cả hai chế độ chép vào và chép ra:" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "Không tước các thành phần tiền tố hệ thống tập tin ra tên tập tin" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "Tạo mọi tập tin liên quan đến thÆ° mục hiện có" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "Điều sá»­a đổi thao tác hợp lệ trong cả hai chế độ chép ra và chép qua:" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" +"Danh sách các tên tập tin bị kết thúc bằng một ký tá»± vô giá trị, thay cho ký " +"tá»± dòng mới" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" +"Tên tập tin kho cần dùng thay cho thiết bị nhập chuẩn. USER (người dùng) và " +"HOST (máy) kiểu tùy chọn có ghi rõ tên người dùng và tên máy trong trường " +"hợp có kho ở xa." + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" +"Dùng tập tin tham chiếu đến liên kết tượng trÆ°ng (sao chép tập tin tới đó " +"liên kết chỉ, thay vì sao chép liên kết chính nó)." + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "[NGƯỜI_DÙNG][:.][NHÓM]" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" +"Đặt quyền sở hữu mọi tập tin đã được tạo cho NGƯỜI DÙNG và/hay NHÓM đã ghi rõ" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "Đặt lại giờ truy cập tập tin sau khi đọc nó" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "Điều sá»­a đổi thao tác hợp lệ trong cả hai chế độ chép vào và chép qua:" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "Còn giữ giờ sá»­a đổi trước của tập tin khi tạo tâp tin" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "Tạo thÆ° mục đi trước khi cần thiết" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "Không thay đổi quyền sở hữu tập tin" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "Thay thế mọi tập tin một cách không điều kiện" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "Ghi tập tin có khối số không lÆ¡n nhÆ° là tập tin thÆ°a thớt (sparse)" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "Tùy chọn chi tiết:" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "Hiển thị trợ giúp này" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "Hiển thị thông điệp cách sá»­ dụng ngắn" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "In ra giấy phép rồi thoát" + +#: src/main.c:233 +msgid "Print program version" +msgstr "In ra phiên bản chÆ°Æ¡ng trình" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "treo trong vòng SECS giây (mặc định 3600)" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" +"ChÆ°Æ¡ng trình này là phần mềm tá»± do; bạn có thể phát hành lại nó và/hoặc sá»­a " +"đổi nó với điều kiện của Giấy Phép Công Cộng GNU nhÆ° được xuất bản bởi Tổ " +"Chức Phần Mềm Tá»± Do; hoặc phiên bản 2 của Giấy Phép này, hoặc (tùy chọn) bất " +"kỳ phiên bản sau nào.\n" +"\n" +"ChÆ°Æ¡ng trình này được phát hành vì mong muốn nó có ích, nhÆ°ng KHÔNG CÓ BẢO " +"HÀNH GÌ CẢ, THẬM CHÍ KHÔNG CÓ BẢO ĐẢM ĐƯỢC NGỤ Ý KHẢ NĂNG BÁN HAY KHẢ NĂNG " +"LÀM ĐƯỢC VIỆC DỨT KHOÁT. Xem Giấy Phép Công Cộng GNU để biết thêm chi tiết.\n" +"\n" +"Bạn đã nhận một bản sao của Giấy Phép Công Cộng GNU cùng với chÆ°Æ¡ng trình " +"này; nếu không, hãy viết thÆ° cho Tổ Chức Phần Mềm Tá»± Do,\n" +"Free Software Foundation, Inc.,\n" +"51 Franklin Street, Fifth Floor,\n" +"Boston, MA 02110-1301, USA (Mỹ)\n" +"\n" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "kích cỡ khối không hợp lệ" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "Định dạng kho đã được xác định nhiều lần" + +#: src/main.c:389 +#, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"định dạng kho không hợp lệ « %s »; các định dạng hợp lệ là:crc newc odc bin " +"ustar tar (cÅ©ng chấp nhận cả chữ hoa)" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "Chế độ đã được xác định" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" +"Không thể sá»­ dụng tùy chọn « --no-preserve-owner » (không giữ lại người sở " +"hữu) cùng với tùy chọn « --owner » (người sở hữu)" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" +"Không thể sá»­ dụng tùy chọn « --owner » (người sở hữu) cùng với tùy chọn « --" +"no-preserve-owner » (không giữ lại người sở hữu)" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "Giá trị không hợp lệ cho tùy chọn « --warning » (cảnh báo): %s." + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "[thÆ° mục đích]" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" +"Phải ghi rõ một của những tùy chọn « -oipt ».\n" +"Hãy thá»­ lệnh « %s --help » (trợ giúp)\n" +"hay « %s --usage » (cách sá»­ dụng) để xem chi tiết.\n" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "Trong chế độ chép vào dùng cả hai tùy chọn « -I » và « -F »" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "Quá nhiều đôi số" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" +"« --append » (phụ thêm) được sá»­ dụng còn chÆ°a ghi rõ tên tập tin kho (hãy " +"dùng tùy chọn « -F » hay « -O »)" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "Trong chế độ chép ra dùng cả hai tùy chọn « -O » và « -F »" + +#: src/main.c:696 +#, fuzzy, c-format +msgid "Not enough arguments" +msgstr "Quá nhiều đôi số" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" +"ChÆ°a ghi rõ định dạng kho trong chế độ chép qua (hãy dùng tùy chọn « --" +"format » [định dạng])" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" +"Tùy chọn « -F » dùng được chỉ với « --create » (tạo) hoặc « --extract " +"» (rút) thôi" + +#: src/main.c:725 +#, c-format +msgid "Cannot open %s" +msgstr "Không thể mở %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "gặp lỗi khi đóng kho" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "không thể tạo thÆ° mục « %s »" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "« %s » tồn tại nhÆ°ng không phải là thÆ° mục" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s không phải là một tập tin đặc biệt ký tá»±" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "%s: rmtioctl bị lỗi" + +#: src/mt.c:225 +#, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Cách sá»­ dụng: %s [-V] [-f thiết_bị] [--file=thiết_bị] [--rsh-command=lệnh]\n" +"\t[--help] [--version] thao_tác [số_đếm]\n" +"\n" +"[file = tập tin;\n" +"command = lệnh;\n" +"help = trợ giúp;\n" +"version = phiên bản]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "chÆ°a ghi rõ thiết bị băng" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "%s: rmtopen bị lỗi" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "%s: rmtclose bị lỗi" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "dòng đầu không hợp lệ: gặp lỗi tổng kiểm tra" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "người dùng không hợp lệ" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "không thể lấy nhóm đăng nhập của UID dạng số" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "nhóm không hợp lệ" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "lỗi ghi" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "lỗi đọc" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "gặp kết thúc tập tin quá sớm" + +#: src/util.c:493 src/util.c:543 +#, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "Tập tin %s bị thu nhỏ theo %s byte nên đệm vào nhiều số không" + +#: src/util.c:499 src/util.c:549 +#, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "Gặp lỗi đọc tại byte %lld trong tập tin %s nên đệm vào nhiều số không" + +#: src/util.c:584 +#, fuzzy, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "Tập tin %s đã phóng ra, %ld byte mới chÆ°a được sao chép" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "Tập tin %s bị sá»­a đổi trong khi được sao chép" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "hết bộ nhớ ảo rồi" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "không thể tìm nÆ¡i trên kết xuất" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "Gặp kết thúc băng. Hãy nạp băng kế tiếp rồi bấm phím Return. " + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "" +"Gặp kết thúc băng. Để tiêp tục, hãy nhập tên thiết bị/tập tin khi sẵn sàng.\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "Để tiêp tục, hãy nhập tên thiết bị/tập tin khi sẵn sàng.\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "gặp lỗi nội bộ: mô tả băng đã thay đổi từ %d thành %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: tùy chọn « %s » là mÆ¡ hồ\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: tùy chọn « --%s » không cho phép đối số\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: tùy chọn « %c%s » không cho phép đối số\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: tùy chọn « %s » cần đến đối số\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: không nhận diện tùy chọn « --%s »\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: không nhận diện tùy chọn « %c%s »\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: không cho phép tùy chọn « -- %c »\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: tùy chọn không hợp lệ « -- %c »\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: tùy chọn cần đến đối số « -- %c »\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: tùy chọn « -W %s » là mÆ¡ hồ\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: tùy chọn « -W %s » không cho phép đối số\n" + +#: lib/rtapelib.c:299 +#, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp: dịch vụ chÆ°a sẵn sàng" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "thiết bị nhập chuẩn" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "thiết bị xuất chuẩn" + +#: lib/rtapelib.c:512 +#, c-format +msgid "Cannot execute remote shell" +msgstr "Không thể thá»±c hiện trình bao từ xa" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "%s: hàm %s bị lỗi" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "%s: cảnh báo : hàm %s bị lỗi" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "%s: không thể thay đổi chế độ thành %s" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "%s: không thể thay đổi quyền sở hữu thành UID %lu, GID %lu" + +#: lib/paxerror.c:127 +#, c-format +msgid "%s: Cannot hard link to %s" +msgstr "%s: không thể liên kết cứng tới %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: gặp lỗi đọc tại byte %s trong khi đọc %lu byte" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "%s: cảnh báo : gặp lỗi đọc tại byte %s trong khi đọc %lu byte" + +#: lib/paxerror.c:259 +#, c-format +msgid "%s: Cannot seek to %s" +msgstr "%s: không thể tìm nÆ¡i tới %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "%s: cảnh báo : không thể tìm nÆ¡i tới %s" + +#: lib/paxerror.c:284 +#, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "%s: không thể táo liên kết tượng trÆ°ng tới %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "%s: đã ghi chỉ %lu trên %lu byte" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "Đang gỡ bỏ « %s » đi trước ra các tên thành viên" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "Đang gỡ bỏ « %s » đi trước ra các đích liên kết cứng" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "Đang thay thế dấu chấm « . » cho tên thành viên rỗng" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "Đang thay thế dấu chấm « . » cho đích liên kết cứng rỗng" + +#~ msgid "error %d" +#~ msgstr "gặp lỗi %d" + +#~ msgid "%s: Read error at byte %s, reading %lu byte" +#~ msgid_plural "%s: Read error at byte %s, reading %lu bytes" +#~ msgstr[0] "%s: gặp lỗi đọc tại byte %s khi đọc %lu byte" diff --git a/po/zh_CN.gmo b/po/zh_CN.gmo new file mode 100644 index 0000000000000000000000000000000000000000..48dc1b5714626d96bf30cbd99ec07d547db5a140 GIT binary patch literal 3466 zcmb7_TWlOx8OIOM5?Bh9Ld&I;9xmIYB(vFdN}FuciwHqfN}4E`@`Tj!%<*{Q*)z*r z>^M(Iyi`bBUU=gnW-BFfBjL4ov-bLy*jtiV^=5nzRuyq6R!mxiQsf#rsrY|0<4aN_ zl_Sso=FIudcR$D19=PYX3}Yvruj27O!r0T`8z03FM&HL6`v%w#einQaOoMNOUk4w# zhp~si=fE$6FU8D*yDbVF_il^$Fi3hcAniB6PlG4HuYs?C z_kpKD+Fyz}0g|3YFah2IY2UU_L~;*;l!sJ2{{fi7Tm?S`{sy#>W=WTuE|<2)Rj#$Dj;eXW z;ci}NrfTtK(-I_NnX*;r+_QPor8&uKj!-?JXSo#Z*kWUsniE_#1aA|LYub{F6Q=8} zZ_xc*K9moQIl}NQ)mbx<4PUq<6`pN#%a#T#Ww~it!hkDw-XoQY!joDeT9Iw4W$Ih3 z#Ii3ZwWPb9>$Y&^b_8fyb~{%kR~^I83F$>@)`cO8RH(To)9`KI{otx2e(IZ!fXx5W zp(r2T;8xl;hv#p^E&cWqb&EOBQ)EP=1G)lJt|5;6v~$C zp~ngKecP8h7kKPu?x}f^;{1@U>L~6BFZ_U@b)HA`ERIYzj{c1rIsTYaTjAu|ZcYZ);_Ho-OD zanMVf7F;1(Ia<~By}a)+;W*f*S+;9R1HGrUm~DcY66Z{!ufyeRlww`Dnq%e>1f4}` zppMOso#V;q=;_!MwS1FhYpvWxrPn_hj_v2yXDx7CIN1%~Lo@5kzAGFi?KP`ZpXkgt zn@AR_oKrpD5o-;x=JW>^!uugiQluZ5paYByE6;M~dgvL|(YYy+2&xoi0S49=q7-df zX)_(qM^lYYF60guF#{(MojT2;S7;3B`60IBR!I5AIXy z*-^(nj?PeC(3O{>iwSwjn>KGq?Mdy+WD>_j-gZ3YuxpsQ@?GC>l}0;@<}wr#d)|GV@d`bj1I6wf@7%{;j?y(gW9pmGd7PgmfET!WI{ zr(_y;3(zR67Jj;KKn)5>@-%mHOCEVxHul|XY6kbY`&q7`r zKJHhgQK-2rKhS~>N7y@DGncnaD&6CJznR%96)#o_51<2gaOzG?hhI2+a3dL+R6210 zXBKU&G~&df8*%D)=PlKgPlx{%T;V-qG&StWG;9cxiDuy_2c>4~VQKa%O=fth@}7b5 zi}Q1p)yvn5ef8Sl`wSg%;q1_Kd5F$Qy;LdBg1Osex)hUweMvU5an+&cYpXQ(c2^1S^HJGYj*B#lGQ* z;JxwU_*<85Q1Nz0neHqk*oPE@pU4GOu>2a;tu`_`$g0buGb6J>z$m7n*Z7_7fN#_g zBpK}v#p+!ocJ9KZ8$n@msX7sUygb}{yIj23jiqotvp^j(7tED{fQJ`v&!6VsWBpf) zv;9luGI?Kmr~WRhE%c1gOQA}+7`r~cTv;tm)5Y3XBSSj0QNN5VmEH|HA4Hx_9*_jt7EsuR$-fN z%Hluf2Px%KljM0k?Ol$i!BXw7wT04RwKm+zhX2sFSg4YriAuezQo3?;er{+XxXFT2 GsQtet?yX?} literal 0 HcmV?d00001 diff --git a/po/zh_CN.po b/po/zh_CN.po new file mode 100644 index 0000000..eee47dc --- /dev/null +++ b/po/zh_CN.po @@ -0,0 +1,1122 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2002 Free Software Foundation, Inc. +# Wang Li , 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: cpio 2.3.911\n" +"Report-Msgid-Bugs-To: bug-cpio@gnu.org\n" +"POT-Creation-Date: 2007-06-07 14:16+0300\n" +"PO-Revision-Date: 2002-09-12 09:42+0800\n" +"Last-Translator: Wang Li \n" +"Language-Team: Chinese (simplified) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=gb2312\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/copyin.c:45 +#, c-format +msgid "warning: skipped %ld byte of junk" +msgid_plural "warning: skipped %ld bytes of junk" +msgstr[0] "" +msgstr[1] "" + +#: src/copyin.c:66 +#, c-format +msgid "rename %s -> " +msgstr "½« %s ÖØÃüÃûΪ -> " + +#: src/copyin.c:95 src/copyout.c:562 +#, c-format +msgid "%s: file name too long" +msgstr "%s£ºÎļþÃû¹ý³¤" + +#: src/copyin.c:181 src/copyin.c:528 src/copyin.c:553 src/copyin.c:1524 +#, fuzzy, c-format +msgid "%s: checksum error (0x%lx, should be 0x%lx)" +msgstr "%s£ºÐ£ÑéºÍ´íÎó (0x%x, ӦΪ 0x%x)" + +#: src/copyin.c:208 src/copypass.c:129 +#, c-format +msgid "%s not created: newer or same age version exists" +msgstr "δ´´½¨ %s£ºÒÑÓиüлòͬÑùеİ汾´æÔÚ" + +#: src/copyin.c:218 src/copypass.c:137 +#, c-format +msgid "cannot remove current %s" +msgstr "ÎÞ·¨É¾³ýµ±Ç° %s" + +#: src/copyin.c:279 src/copyin.c:476 src/copyin.c:683 src/copypass.c:427 +#, c-format +msgid "cannot link %s to %s" +msgstr "ÎÞ·¨½« %s Á¬½Óµ½ %s" + +#: src/copyin.c:509 +#, c-format +msgid "cannot swap halfwords of %s: odd number of halfwords" +msgstr "" + +#: src/copyin.c:517 +#, c-format +msgid "cannot swap bytes of %s: odd number of bytes" +msgstr "" + +#: src/copyin.c:642 +#, fuzzy, c-format +msgid "%s is not a directory" +msgstr "¡°%s¡±´æÔÚµ«²»ÊÇĿ¼" + +#: src/copyin.c:755 +#, fuzzy, c-format +msgid "%s: Cannot symlink to %s" +msgstr "ÎÞ·¨½« %s Á¬½Óµ½ %s" + +#: src/copyin.c:809 src/copyout.c:851 src/copypass.c:356 +#, c-format +msgid "%s: unknown file type" +msgstr "%s£ºÎ´ÖªµÄÎļþÀàÐÍ" + +#: src/copyin.c:994 src/copyin.c:1001 +#, c-format +msgid "Malformed number %.*s" +msgstr "" + +#: src/copyin.c:1011 +#, c-format +msgid "Archive value %.*s is out of range" +msgstr "" + +#: src/copyin.c:1046 +#, c-format +msgid "premature end of archive" +msgstr "¹éµµ·ÇÕý³£ÖÕÖ¹" + +#: src/copyin.c:1266 +#, c-format +msgid "warning: archive header has reverse byte-order" +msgstr "¾¯¸æ£º¹éµµÍ·Îª·´Ïò×Ö½ÚÐò" + +#: src/copyin.c:1413 +#, c-format +msgid "standard input is closed" +msgstr "±ê×¼ÊäÈëÒѹرÕ" + +#: src/copyin.c:1576 src/copyout.c:893 src/copypass.c:370 +#, fuzzy, c-format +msgid "%d block\n" +msgid_plural "%d blocks\n" +msgstr[0] "%d ¿é\n" +msgstr[1] "%d ¿é\n" + +#: src/copyout.c:51 src/copyout.c:60 +#, c-format +msgid "cannot read checksum for %s" +msgstr "ÎÞ·¨Îª %s ¶ÁÈëУÑéºÍ" + +#: src/copyout.c:300 +#, c-format +msgid "%s: field width not sufficient for storing %s" +msgstr "" + +#: src/copyout.c:308 +#, c-format +msgid "%s: truncating %s" +msgstr "" + +#: src/copyout.c:343 src/copyout.c:406 src/copyout.c:480 +#, fuzzy +msgid "inode number" +msgstr "ÎļþºÅ = %d\n" + +#: src/copyout.c:346 src/copyout.c:409 src/copyout.c:484 +msgid "file mode" +msgstr "" + +#: src/copyout.c:349 src/copyout.c:411 src/copyout.c:488 +msgid "uid" +msgstr "" + +#: src/copyout.c:352 src/copyout.c:413 src/copyout.c:492 +msgid "gid" +msgstr "" + +#: src/copyout.c:355 src/copyout.c:416 src/copyout.c:496 +msgid "number of links" +msgstr "" + +#: src/copyout.c:358 src/copyout.c:421 +msgid "modification time" +msgstr "" + +#: src/copyout.c:361 src/copyout.c:428 src/copyout.c:515 +msgid "file size" +msgstr "" + +#: src/copyout.c:365 +msgid "device major number" +msgstr "" + +#: src/copyout.c:369 +msgid "device minor number" +msgstr "" + +#: src/copyout.c:373 +msgid "rdev major" +msgstr "" + +#: src/copyout.c:377 +msgid "rdev minor" +msgstr "" + +#: src/copyout.c:381 src/copyout.c:424 src/copyout.c:505 +msgid "name size" +msgstr "" + +#: src/copyout.c:403 +#, fuzzy +msgid "device number" +msgstr "ÎļþºÅ = %d\n" + +#: src/copyout.c:418 +msgid "rdev" +msgstr "" + +#: src/copyout.c:476 +#, c-format +msgid "%s: truncating inode number" +msgstr "" + +#: src/copyout.c:620 +#, c-format +msgid "standard output is closed" +msgstr "±ê×¼Êä³öÒѹرÕ" + +#: src/copyout.c:641 src/copypass.c:86 +#, c-format +msgid "blank line ignored" +msgstr "ºöÂÔ¿ÕÐÐ" + +#: src/copyout.c:776 +#, c-format +msgid "%s not dumped: not a regular file" +msgstr "%s δÊä³ö£º²»ÊÇÆÕͨÎļþ" + +#: src/copyout.c:827 +#, c-format +msgid "%s: symbolic link too long" +msgstr "%s£º·ûºÅÁ¬½Ó¹ý³¤" + +#: src/copypass.c:422 +#, c-format +msgid "%s linked to %s" +msgstr "%s Á¬½Óµ½ %s" + +#: src/main.c:67 +msgid "" +"GNU `cpio' copies files to and from archives\n" +"\n" +"Examples:\n" +" # Copy files named in name-list to the archive\n" +" cpio -o < name-list [> archive]\n" +" # Extract files from the archive\n" +" cpio -i [< archive]\n" +" # Copy files named in name-list to destination-directory\n" +" cpio -p destination-directory < name-list\n" +msgstr "" + +#: src/main.c:81 +#, c-format +msgid "%s is meaningless with %s" +msgstr "" + +#: src/main.c:87 +#, fuzzy +msgid "Main operation mode:" +msgstr "´Å´ø²Ù×÷" + +#: src/main.c:89 +msgid "Create the archive (run in copy-out mode)" +msgstr "" + +#: src/main.c:91 +msgid "Extract files from an archive (run in copy-in mode)" +msgstr "" + +#: src/main.c:93 +msgid "Run in copy-pass mode" +msgstr "" + +#: src/main.c:95 +msgid "Print a table of contents of the input" +msgstr "" + +#: src/main.c:101 +msgid "Operation modifiers valid in any mode:" +msgstr "" + +#: src/main.c:103 src/main.c:170 src/main.c:199 +msgid "[[USER@]HOST:]FILE-NAME" +msgstr "" + +#: src/main.c:104 +msgid "" +"Use this FILE-NAME instead of standard input or output. Optional USER and " +"HOST specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:106 +msgid "Archive file is local, even if its name contains colons" +msgstr "" + +#: src/main.c:107 +msgid "FORMAT" +msgstr "" + +#: src/main.c:108 +msgid "Use given archive FORMAT" +msgstr "" + +#: src/main.c:110 +msgid "Set the I/O block size to 5120 bytes" +msgstr "" + +#: src/main.c:111 +msgid "BLOCK-SIZE" +msgstr "" + +#: src/main.c:112 +msgid "Set the I/O block size to BLOCK-SIZE * 512 bytes" +msgstr "" + +#: src/main.c:114 +msgid "Use the old portable (ASCII) archive format" +msgstr "" + +#: src/main.c:116 +msgid "Print a \".\" for each file processed" +msgstr "" + +#: src/main.c:117 +msgid "NUMBER" +msgstr "" + +#: src/main.c:118 +msgid "Set the I/O block size to the given NUMBER of bytes" +msgstr "" + +#: src/main.c:119 +msgid "STRING" +msgstr "" + +#: src/main.c:120 +msgid "Print STRING when the end of a volume of the backup media is reached" +msgstr "" + +#: src/main.c:123 +msgid "Only copy files that do not match any of the given patterns" +msgstr "" + +#: src/main.c:125 +msgid "In the verbose table of contents listing, show numeric UID and GID" +msgstr "" + +#: src/main.c:127 +msgid "COMMAND" +msgstr "" + +#: src/main.c:128 +msgid "Use remote COMMAND instead of rsh" +msgstr "" + +#: src/main.c:130 +msgid "Do not print the number of blocks copied" +msgstr "" + +#: src/main.c:132 +msgid "Verbosely list the files processed" +msgstr "" + +#: src/main.c:135 +msgid "Enable debugging info" +msgstr "" + +#: src/main.c:137 +msgid "FLAG" +msgstr "" + +#: src/main.c:138 +msgid "" +"Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. " +"Multiple options accumulate." +msgstr "" + +#: src/main.c:144 +msgid "Operation modifiers valid only in copy-in mode:" +msgstr "" + +#: src/main.c:145 src/main.c:151 +msgid "FILE" +msgstr "" + +#: src/main.c:146 +msgid "" +"Read additional patterns specifying filenames to extract or list from FILE" +msgstr "" + +#: src/main.c:148 +msgid "" +"When reading a CRC format archive, only verify the CRC's of each file in the " +"archive, don't actually extract the files" +msgstr "" + +#: src/main.c:150 +msgid "Interactively rename files" +msgstr "" + +#: src/main.c:154 +msgid "" +"Swap both halfwords of words and bytes of halfwords in the data. Equivalent " +"to -sS" +msgstr "" + +#: src/main.c:156 +msgid "Swap the bytes of each halfword in the files" +msgstr "" + +#: src/main.c:158 +msgid "Swap the halfwords of each word (4 bytes) in the files" +msgstr "" + +#: src/main.c:161 +msgid "Extract files to standard output" +msgstr "" + +#: src/main.c:167 +msgid "Operation modifiers valid only in copy-out mode:" +msgstr "" + +#: src/main.c:169 +msgid "Append to an existing archive." +msgstr "" + +#: src/main.c:171 +msgid "" +"Archive filename to use instead of standard output. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:177 +msgid "Operation modifiers valid only in copy-pass mode:" +msgstr "" + +#: src/main.c:179 +msgid "Link files instead of copying them, when possible" +msgstr "" + +#: src/main.c:186 +msgid "Operation modifiers valid in copy-in and copy-out modes:" +msgstr "" + +#: src/main.c:188 +msgid "Do not strip file system prefix components from the file names" +msgstr "" + +#: src/main.c:191 +msgid "Create all files relative to the current directory" +msgstr "" + +#: src/main.c:196 +msgid "Operation modifiers valid in copy-out and copy-pass modes:" +msgstr "" + +#: src/main.c:198 +msgid "" +"A list of filenames is terminated by a null character instead of a newline" +msgstr "" + +#: src/main.c:200 +msgid "" +"Archive filename to use instead of standard input. Optional USER and HOST " +"specify the user and host names in case of a remote archive" +msgstr "" + +#: src/main.c:202 +msgid "" +"Dereference symbolic links (copy the files that they point to instead of " +"copying the links)." +msgstr "" + +#: src/main.c:203 +msgid "[USER][:.][GROUP]" +msgstr "" + +#: src/main.c:204 +msgid "" +"Set the ownership of all files created to the specified USER and/or GROUP" +msgstr "" + +#: src/main.c:206 +msgid "Reset the access times of files after reading them" +msgstr "" + +#: src/main.c:212 +msgid "Operation modifiers valid in copy-in and copy-pass modes:" +msgstr "" + +#: src/main.c:214 +msgid "Retain previous file modification times when creating files" +msgstr "" + +#: src/main.c:216 +msgid "Create leading directories where needed" +msgstr "" + +#: src/main.c:218 +msgid "Do not change the ownership of the files" +msgstr "" + +#: src/main.c:220 +msgid "Replace all files unconditionally" +msgstr "" + +#: src/main.c:222 +msgid "Write files with large blocks of zeros as sparse files" +msgstr "" + +#: src/main.c:228 +msgid "Informative options:" +msgstr "" + +#: src/main.c:230 +msgid "Give this help list" +msgstr "" + +#: src/main.c:231 +msgid "Give a short usage message" +msgstr "" + +#: src/main.c:232 +msgid "Print license and exit" +msgstr "" + +#: src/main.c:233 +msgid "Print program version" +msgstr "" + +#: src/main.c:237 +msgid "hang for SECS seconds (default 3600)" +msgstr "" + +#: src/main.c:250 +#, c-format +msgid "" +" GNU cpio is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" GNU cpio is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with GNU cpio; if not, write to the Free Software Foundation,\n" +" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" +"\n" +msgstr "" + +#: src/main.c:333 src/main.c:350 +#, c-format +msgid "invalid block size" +msgstr "ÎÞЧµÄ¿é´óС" + +#: src/main.c:339 src/main.c:371 +#, c-format +msgid "Archive format multiply defined" +msgstr "" + +#: src/main.c:389 +#, fuzzy, c-format +msgid "" +"invalid archive format `%s'; valid formats are:\n" +"crc newc odc bin ustar tar (all-caps also recognized)" +msgstr "" +"ÎÞЧµÄ¹éµµ¸ñʽ¡°%s¡±£»ÓÐЧµÄ¸ñʽÓУº\n" +"crc¡¢newc¡¢odc¡¢bin¡¢ustar¡¢tar¡¢hpodc¡¢hpbin" + +#: src/main.c:396 src/main.c:446 src/main.c:460 +#, c-format +msgid "Mode already defined" +msgstr "" + +#: src/main.c:440 +#, c-format +msgid "--no-preserve-owner cannot be used with --owner" +msgstr "" + +#: src/main.c:483 +#, c-format +msgid "--owner cannot be used with --no-preserve-owner" +msgstr "" + +#: src/main.c:530 +#, c-format +msgid "Invalid value for --warning option: %s" +msgstr "" + +#: src/main.c:583 +msgid "[destination-directory]" +msgstr "" + +#: src/main.c:602 src/main.c:618 +#, c-format +msgid "" +"You must specify one of -oipt options.\n" +"Try `%s --help' or `%s --usage' for more information.\n" +msgstr "" + +#: src/main.c:646 +#, c-format +msgid "Both -I and -F are used in copy-in mode" +msgstr "" + +#: src/main.c:658 src/main.c:694 +#, c-format +msgid "Too many arguments" +msgstr "" + +#: src/main.c:677 +#, c-format +msgid "" +"--append is used but no archive file name is given (use -F or -O options)" +msgstr "" + +#: src/main.c:683 +#, c-format +msgid "Both -O and -F are used in copy-out mode" +msgstr "" + +#: src/main.c:696 +#, c-format +msgid "Not enough arguments" +msgstr "" + +#: src/main.c:700 +#, c-format +msgid "Archive format is not specified in copy-pass mode (use --format option)" +msgstr "" + +#: src/main.c:722 +#, c-format +msgid "-F can be used only with --create or --extract" +msgstr "" + +#: src/main.c:725 +#, fuzzy, c-format +msgid "Cannot open %s" +msgstr "ÎÞ·¨´ò¿ªÄ¿Â¼ %s" + +#: src/main.c:797 +#, c-format +msgid "error closing archive" +msgstr "¹Ø±Õ¹éµµÎļþ´íÎó" + +#: src/makepath.c:117 src/makepath.c:184 +#, c-format +msgid "cannot make directory `%s'" +msgstr "ÎÞ·¨´´½¨Ä¿Â¼¡°%s¡±" + +#: src/makepath.c:159 src/makepath.c:237 +#, c-format +msgid "`%s' exists but is not a directory" +msgstr "¡°%s¡±´æÔÚµ«²»ÊÇĿ¼" + +#: src/mt.c:183 +#, c-format +msgid "%s is not a character special file" +msgstr "%s ²»ÊÇ×Ö·ûÉ豸Îļþ" + +#: src/mt.c:196 src/mt.c:205 +#, c-format +msgid "%s: rmtioctl failed" +msgstr "" + +#: src/mt.c:225 +#, fuzzy, c-format +msgid "" +"Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n" +"\t[--help] [--version] operation [count]\n" +msgstr "" +"Ó÷¨£º%s [-V] [-f É豸] [--file=É豸] [--help] [--version] ²Ù×÷ [¼ÆÊý]\n" + +#: src/mt.c:307 +#, c-format +msgid "no tape device specified" +msgstr "δ¸ø³ö´Å´øÉ豸" + +#: src/mt.c:320 +#, c-format +msgid "%s: rmtopen failed" +msgstr "" + +#: src/mt.c:333 +#, c-format +msgid "%s: rmtclose failed" +msgstr "" + +#: src/tar.c:308 +#, c-format +msgid "invalid header: checksum error" +msgstr "ÎÞЧµÄÍ·£ºÐ£ÑéºÍ´íÎó" + +#: src/userspec.c:142 +msgid "invalid user" +msgstr "ÎÞЧµÄÓû§" + +#: src/userspec.c:148 +msgid "cannot get the login group of a numeric UID" +msgstr "" + +#: src/userspec.c:188 +msgid "invalid group" +msgstr "ÎÞЧµÄ×é" + +#: src/util.c:91 src/util.c:94 src/util.c:143 +#, c-format +msgid "write error" +msgstr "д´íÎó" + +#: src/util.c:205 src/util.c:374 +#, c-format +msgid "read error" +msgstr "¶Á´íÎó" + +#: src/util.c:208 +#, c-format +msgid "premature end of file" +msgstr "Îļþ·ÇÕý³£ÖÕÖ¹" + +#: src/util.c:493 src/util.c:543 +#, c-format +msgid "File %s shrunk by %s byte, padding with zeros" +msgid_plural "File %s shrunk by %s bytes, padding with zeros" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:499 src/util.c:549 +#, c-format +msgid "Read error at byte %lld in file %s, padding with zeros" +msgstr "" + +#: src/util.c:584 +#, c-format +msgid "File %s grew, % new byte not copied" +msgid_plural "File %s grew, % new bytes not copied" +msgstr[0] "" +msgstr[1] "" + +#: src/util.c:590 +#, c-format +msgid "File %s was modified while being copied" +msgstr "" + +#: src/util.c:618 +#, c-format +msgid "virtual memory exhausted" +msgstr "ÐéÄâÄÚ´æºÄ¾¡" + +#: src/util.c:654 src/util.c:660 +#, c-format +msgid "cannot seek on output" +msgstr "ÎÞ·¨ÔÚÊä³öÖÐÖ´ÐÐ seek ²Ù×÷" + +#: src/util.c:832 +#, c-format +msgid "Found end of tape. Load next tape and press RETURN. " +msgstr "´Å´øÒѽáÊø¡£×°ÈëÏÂÒ»ºÐ´Å´ø²¢°´ RETURN¡£" + +#: src/util.c:834 +#, c-format +msgid "Found end of tape. To continue, type device/file name when ready.\n" +msgstr "´Å´øÒѽáÊø¡£Òª¼ÌÐø£¬ÔÚ×¼±¸¾ÍÐ÷ʱÊäÈëÉ豸/ÎļþÃû¡£\n" + +#: src/util.c:857 +#, c-format +msgid "To continue, type device/file name when ready.\n" +msgstr "Òª¼ÌÐø£¬ÔÚ×¼±¸¾ÍÐ÷ʱÊäÈëÉ豸/ÎļþÃû¡£\n" + +#: src/util.c:882 +#, c-format +msgid "internal error: tape descriptor changed from %d to %d" +msgstr "ÄÚ²¿´íÎ󣺴ŴøÃèÊö·û´Ó %d ¸ÄΪ %d" + +#: lib/getopt.c:531 lib/getopt.c:547 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s£ºÑ¡Ïî¡°%s¡±ÓжþÒåÐÔ\n" + +#: lib/getopt.c:580 lib/getopt.c:584 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s£ºÑ¡Ïî¡°--%s¡±²»½ÓÊܲÎÊý\n" + +#: lib/getopt.c:593 lib/getopt.c:598 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s£ºÑ¡Ïî¡°%c%s¡±²»½ÓÊܲÎÊý\n" + +#: lib/getopt.c:641 lib/getopt.c:660 lib/getopt.c:976 lib/getopt.c:995 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s£ºÑ¡Ïî¡°%s¡±ÐèÒªÒ»¸ö²ÎÊý\n" + +#: lib/getopt.c:698 lib/getopt.c:701 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s£º²»¿Éʶ±ðµÄÑ¡Ïî¡°--%s¡±\n" + +#: lib/getopt.c:709 lib/getopt.c:712 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s£ºÎÞ·¨Ê¶±ðµÄÑ¡Ïî¡°%c%s¡±\n" + +#: lib/getopt.c:764 lib/getopt.c:767 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s£º·Ç·¨Ñ¡Ïî -- %c\n" + +#: lib/getopt.c:773 lib/getopt.c:776 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s£ºÎÞЧµÄÑ¡Ïî -- %c\n" + +#: lib/getopt.c:828 lib/getopt.c:844 lib/getopt.c:1048 lib/getopt.c:1066 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s£ºÑ¡ÏîÐèÒªÒ»¸ö²ÎÊý -- %c\n" + +#: lib/getopt.c:897 lib/getopt.c:913 +#, fuzzy, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s£ºÑ¡Ïî¡°%s¡±ÓжþÒåÐÔ\n" + +#: lib/getopt.c:937 lib/getopt.c:955 +#, fuzzy, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s£ºÑ¡Ïî¡°--%s¡±²»½ÓÊܲÎÊý\n" + +#: lib/rtapelib.c:299 +#, fuzzy, c-format +msgid "exec/tcp: Service not available" +msgstr "exec/tcp£º·þÎñ²»¿ÉÓÃ" + +#: lib/rtapelib.c:303 +#, c-format +msgid "stdin" +msgstr "" + +#: lib/rtapelib.c:306 +#, c-format +msgid "stdout" +msgstr "" + +#: lib/rtapelib.c:512 +#, fuzzy, c-format +msgid "Cannot execute remote shell" +msgstr "ÎÞ·¨Ö´ÐÐÔ¶³Ì shell" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:58 lib/paxerror.c:71 +#, c-format +msgid "%s: Cannot %s" +msgstr "" + +#. TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'. +#. Directly translating this to another language will not work, first because +#. %s itself is not translated. +#. Translate it as `%s: Function %s failed'. +#: lib/paxerror.c:84 +#, c-format +msgid "%s: Warning: Cannot %s" +msgstr "" + +#: lib/paxerror.c:93 +#, c-format +msgid "%s: Cannot change mode to %s" +msgstr "" + +#: lib/paxerror.c:101 +#, c-format +msgid "%s: Cannot change ownership to uid %lu, gid %lu" +msgstr "" + +#: lib/paxerror.c:127 +#, fuzzy, c-format +msgid "%s: Cannot hard link to %s" +msgstr "ÎÞ·¨½« %s Á¬½Óµ½ %s" + +#: lib/paxerror.c:179 lib/paxerror.c:211 +#, c-format +msgid "%s: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:192 +#, c-format +msgid "%s: Warning: Read error at byte %s, while reading %lu byte" +msgid_plural "%s: Warning: Read error at byte %s, while reading %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxerror.c:259 +#, fuzzy, c-format +msgid "%s: Cannot seek to %s" +msgstr "ÎÞ·¨½« %s Á¬½Óµ½ %s" + +#: lib/paxerror.c:275 +#, c-format +msgid "%s: Warning: Cannot seek to %s" +msgstr "" + +#: lib/paxerror.c:284 +#, fuzzy, c-format +msgid "%s: Cannot create symlink to %s" +msgstr "ÎÞ·¨½« %s Á¬½Óµ½ %s" + +#: lib/paxerror.c:349 +#, c-format +msgid "%s: Wrote only %lu of %lu byte" +msgid_plural "%s: Wrote only %lu of %lu bytes" +msgstr[0] "" +msgstr[1] "" + +#: lib/paxnames.c:132 +#, c-format +msgid "Removing leading `%s' from member names" +msgstr "" + +#: lib/paxnames.c:133 +#, c-format +msgid "Removing leading `%s' from hard link targets" +msgstr "" + +#: lib/paxnames.c:146 +msgid "Substituting `.' for empty member name" +msgstr "" + +#: lib/paxnames.c:147 +msgid "Substituting `.' for empty hard link target" +msgstr "" + +#~ msgid "Memory exhausted" +#~ msgstr "ÄÚ´æºÄ¾¡" + +#~ msgid "block size cannot be 0" +#~ msgstr "¿é´óС²»ÄÜΪ 0" + +#~ msgid "GNU mt version %s\n" +#~ msgstr "GNU mt °æ±¾ %s\n" + +#~ msgid "Success" +#~ msgstr "³É¹¦" + +#~ msgid "parse error in blocksize" +#~ msgstr "¿é´óСÓÐÓï·¨´íÎó" + +#~ msgid "Regular expression too big" +#~ msgstr "³£¹æ±í´ïʽ¹ý´ó" + +#~ msgid "" +#~ "Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n" +#~ " [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n" +#~ " [--file=[[user@]host:]archive] [--format=format] [--" +#~ "message=message]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < name-list [> archive]\n" +#~ msgstr "" +#~ "Ó÷¨£º%s {-o|--create} [-0acvABLV] [-C ×Ö½ÚÊý] [-H ¸ñʽ] [-M ÏûÏ¢]\n" +#~ " [-O [[Óû§Ãû@]Ö÷»úÃû:]¹éµµ] [-F [[Óû§Ãû@]Ö÷»úÃû:]¹éµµ]\n" +#~ " [--file=[[Óû§Ãû@]Ö÷»úÃû:]¹éµµ] [--format=¸ñʽ] [--message=ÏûÏ¢]\n" +#~ " [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n" +#~ " [--block-size=¿é] [--dereference] [--io-size=×Ö½ÚÊý] [--quiet]\n" +#~ " [--force-local] [--help] [--version] < ÎļþÃûÁбí [> ¹éµµ]\n" + +#~ msgid "Premature end of regular expression" +#~ msgstr "³£¹æ±í´ïʽ·ÇÕý³£ÖÕÖ¹" + +#~ msgid "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} {-w|--write} [-cdnv] [-f ¹éµµ] [-s Ìæ»»]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=Ìæ»»] [ģʽ...] [< ¹éµµ]\n" + +#~ msgid "block number = %d\n" +#~ msgstr "¿é±àºÅ = %d\n" + +#~ msgid "Invalid character class name" +#~ msgstr "ÎÞЧµÄ×Ö·ûÀàÃû" + +#~ msgid "drive type = %d\n" +#~ msgstr "Çý¶¯ÀàÐÍ = %d\n" + +#~ msgid "unrecognized flag `%c' for -p; recognized flags are `aemop'" +#~ msgstr "-p ÎÞ·¨Ê¶±ðµÄ±êÖ¾¡°¡±£»¿Éʶ±ðµÄ±ê־Ϊ¡°aemop¡±" + +#~ msgid "ambiguous" +#~ msgstr "¶þÒåÐÔ" + +#~ msgid "missing regexp" +#~ msgstr "ȱÉÙ³£¹æ±í´ïʽ" + +#~ msgid "1 block\n" +#~ msgstr "1 ¿é\n" + +#~ msgid "No match" +#~ msgstr "²»Æ¥Åä" + +#~ msgid "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] destination-directory < name-list\n" +#~ msgstr "" +#~ " %s {-p|--pass-through} [-0adlmuvLV] [-R [Óû§Ãû][:.][×é]]\n" +#~ " [--null] [--reset-access-time] [--make-directories] [--link] [--" +#~ "quiet]\n" +#~ " [--preserve-modification-time] [--unconditional] [--verbose] [--" +#~ "dot]\n" +#~ " [--dereference] [--owner=[Óû§Ãû][:.][×é]] [--no-preserve-owner]\n" +#~ " [--sparse] [--help] [--version] Ä¿±êĿ¼ < ÎļþÃûÁбí\n" + +#~ msgid "drive status = %d\n" +#~ msgstr "Çý¶¯Æ÷״̬ = %d\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "²»Æ¥ÅäµÄ [ »ò [^" + +#~ msgid "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H " +#~ "format]\n" +#~ " [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n" +#~ " [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=bytes] [--pattern-file=file] [--format=format]\n" +#~ " [--owner=[user][:.][group]] [--no-preserve-owner] [--" +#~ "message=message]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C ×Ö½ÚÊý] [-E Îļþ] [-H ¸ñ" +#~ "ʽ]\n" +#~ " [-M ÏûÏ¢] [-R [Óû§Ãû][:.][×é]] [-I [[Óû§Ãû@]Ö÷»úÃû:]¹éµµ]\n" +#~ " [-F [[Óû§Ãû@]Ö÷»úÃû:]¹éµµ] [--file=[[Óû§Ãû@]Ö÷»úÃû:]¹éµµ]\n" +#~ " [--make-directories] [--nonmatching] [--preserve-modification-" +#~ "time]\n" +#~ " [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--" +#~ "dot]\n" +#~ " [--unconditional] [--verbose] [--block-size=blocks] [--swap-" +#~ "halfwords]\n" +#~ " [--io-size=×Ö½ÚÊý] [--pattern-file=Îļþ] [--format=¸ñʽ]\n" +#~ " [--owner=[Óû§Ãû][:.][×é]] [--no-preserve-owner] [--message=ÏûÏ¢]\n" +#~ " [--force-local] [--no-absolute-filenames] [--sparse] [--only-" +#~ "verify-crc]\n" +#~ " [--quiet] [--help] [--version] [ģʽ...] [< ¹éµµ]\n" + +#~ msgid "" +#~ " %s {-r|--read} [-cdiknuv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-r|--read} [-cdiknuv] [-f ¹éµµ] [-s Ìæ»»]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=Ìæ»»] [ģʽ...] [< ¹éµµ]\n" + +#~ msgid "drive status (low) = %d\n" +#~ msgstr "Çý¶¯Æ÷״̬ (µÍ) = %d\n" + +#~ msgid "Unmatched \\{" +#~ msgstr "²»Æ¥ÅäµÄ \\{" + +#~ msgid "Unmatched ) or \\)" +#~ msgstr "²»Æ¥ÅäµÄ ) »ò \\)" + +#~ msgid "null regexp" +#~ msgstr "¿Õ³£¹æ±í´ïʽ" + +#~ msgid "%s already exists; not created" +#~ msgstr "%s ÒÑ´æÔÚ£»ÎÞ·¨´´½¨" + +#~ msgid "Invalid back reference" +#~ msgstr "ÎÞЧµÄÏòºóÒýÓÃ" + +#~ msgid "" +#~ "Usage: %s [-cdnv] [-f archive] [-s replacement] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ "Ó÷¨£º%s [-cdnv] [-f ¹éµµ] [-s Ìæ»»] [--nonmatching]\n" +#~ " [--directories-only] [--first-pattern] [--verbose]\n" +#~ " [--replace=Ìæ»»] [ģʽ...] [< ¹éµµ]\n" + +#~ msgid "Unmatched ( or \\(" +#~ msgstr "²»Æ¥ÅäµÄ ( »ò \\(" + +#~ msgid "GNU cpio version %s\n" +#~ msgstr "GNU cpio °æ±¾ %s\n" + +#~ msgid "invalid" +#~ msgstr "ÎÞЧ" + +#~ msgid "GNU pax version %s\n" +#~ msgstr "GNU pax °æ±¾ %s\n" + +#~ msgid "Invalid content of \\{\\}" +#~ msgstr "\\{\\} µÄÄÚÈÝÎÞЧ" + +#~ msgid "can not omit both user and group" +#~ msgstr "ÎÞ·¨Í¬Ê±ºöÂÔÓû§ºÍ×é" + +#~ msgid "Invalid regular expression" +#~ msgstr "ÎÞЧµÄ³£¹æ±í´ïʽ" + +#~ msgid "No previous regular expression" +#~ msgstr "ûÓÐÉÏÒ»¸ö³£¹æ±í´ïʽ" + +#~ msgid "" +#~ " %s {-w|--write} [-cdnv] [-f archive] [-s replacement]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=replacement] [pattern...] [< archive]\n" +#~ msgstr "" +#~ " %s {-w|--write} [-cdnv] [-f ¹éµµ] [-s Ìæ»»]\n" +#~ " [--nonmatching] [--directories-only] [--first-pattern] [--" +#~ "verbose]\n" +#~ " [--replace=Ìæ»»] [ģʽ...] [< ¹éµµ]\n" + +#~ msgid "drive status (high) = %d\n" +#~ msgstr "Çý¶¯Æ÷״̬ (¸ß) = %d\n" + +#~ msgid "invalid regexp modifier `%c'" +#~ msgstr "ÎÞЧµÄ³£¹æ±í´ïʽÐÞÊηû¡°%c¡±" diff --git a/rmt/Makefile.am b/rmt/Makefile.am new file mode 100644 index 0000000..b455212 --- /dev/null +++ b/rmt/Makefile.am @@ -0,0 +1,13 @@ +rmtdir=$(DEFAULT_RMT_DIR) +rmt_PROGRAMS = @PU_RMT_PROG@ +EXTRA_PROGRAMS = rmt + +rmt_SOURCES = rmt.c + +INCLUDES = -I$(top_srcdir)/lib -I../ -I../lib + +LDADD = ../lib/lib$(PACKAGE).a $(LIBINTL) + +rmt_LDADD = $(LDADD) $(LIB_SETSOCKOPT) + +rmt.o: ../lib/configmake.h diff --git a/rmt/Makefile.in b/rmt/Makefile.in new file mode 100644 index 0000000..902d966 --- /dev/null +++ b/rmt/Makefile.in @@ -0,0 +1,713 @@ +# Makefile.in generated by automake 1.10a from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@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 +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +EXTRA_PROGRAMS = rmt$(EXEEXT) +subdir = rmt +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/argp.m4 \ + $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/canonicalize-lgpl.m4 \ + $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \ + $(top_srcdir)/m4/clock_time.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/d-ino.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/exitfail.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/getcwd-abort-bug.m4 \ + $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \ + $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/hash.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/inline.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/lchown.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mempcpy.m4 \ + $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mktime.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ + $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/paxutils.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \ + $(top_srcdir)/m4/rmt.m4 $(top_srcdir)/m4/rtapelib.m4 \ + $(top_srcdir)/m4/safe-read.m4 $(top_srcdir)/m4/safe-write.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sysexits.m4 \ + $(top_srcdir)/m4/system.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/ulonglong.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vsnprintf.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(rmtdir)" +rmtPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(rmt_PROGRAMS) +am_rmt_OBJECTS = rmt.$(OBJEXT) +rmt_OBJECTS = $(am_rmt_OBJECTS) +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = ../lib/lib$(PACKAGE).a $(am__DEPENDENCIES_1) +rmt_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(rmt_SOURCES) +DIST_SOURCES = $(rmt_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ +ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ +ABSOLUTE_FLOAT_H = @ABSOLUTE_FLOAT_H@ +ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_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_SYSEXITS_H = @ABSOLUTE_SYSEXITS_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@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPIO_MT_PROG = @CPIO_MT_PROG@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_RMT_COMMAND = @DEFAULT_RMT_COMMAND@ +DEFAULT_RMT_DIR = @DEFAULT_RMT_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIRENT_H = @DIRENT_H@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXEEXT = @EXEEXT@ +FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_H = @GETOPT_H@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ +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_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_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYSEXITS_H = @HAVE_SYSEXITS_H@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE__BOOL = @HAVE__BOOL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTTYPES_H = @INTTYPES_H@ +LDFLAGS = @LDFLAGS@ +LIBCPIO_LIBDEPS = @LIBCPIO_LIBDEPS@ +LIBCPIO_LTLIBDEPS = @LIBCPIO_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_SETSOCKOPT = @LIB_SETSOCKOPT@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +PU_RMT_PROG = @PU_RMT_PROG@ +RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYSEXITS_H = @SYSEXITS_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@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +rmtdir = $(DEFAULT_RMT_DIR) +rmt_PROGRAMS = @PU_RMT_PROG@ +rmt_SOURCES = rmt.c +INCLUDES = -I$(top_srcdir)/lib -I../ -I../lib +LDADD = ../lib/lib$(PACKAGE).a $(LIBINTL) +rmt_LDADD = $(LDADD) $(LIB_SETSOCKOPT) +all: all-am + +.SUFFIXES: +.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; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits rmt/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits rmt/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(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-rmtPROGRAMS: $(rmt_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(rmtdir)" || $(MKDIR_P) "$(DESTDIR)$(rmtdir)" + @list='$(rmt_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) $(rmtPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(rmtdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(rmtPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(rmtdir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-rmtPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(rmt_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(rmtdir)/$$f'"; \ + rm -f "$(DESTDIR)$(rmtdir)/$$f"; \ + done + +clean-rmtPROGRAMS: + -test -z "$(rmt_PROGRAMS)" || rm -f $(rmt_PROGRAMS) + +installcheck-rmtPROGRAMS: $(rmt_PROGRAMS) + bad=0; pid=$$$$; list="$(rmt_PROGRAMS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | \ + sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + for opt in --help --version; do \ + if "$(DESTDIR)$(rmtdir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad +rmt$(EXEEXT): $(rmt_OBJECTS) $(rmt_DEPENDENCIES) + @rm -f rmt$(EXEEXT) + $(LINK) $(rmt_OBJECTS) $(rmt_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmt.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 +@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 +@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) '$<'` + +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; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + 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" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + 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; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(rmtdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-rmtPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-rmtPROGRAMS + +install-dvi: install-dvi-am + +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 + +installcheck-am: installcheck-rmtPROGRAMS + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-rmtPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-rmtPROGRAMS ctags distclean distclean-compile \ + distclean-generic 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-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-rmtPROGRAMS install-strip \ + installcheck installcheck-am installcheck-rmtPROGRAMS \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-rmtPROGRAMS + + +rmt.o: ../lib/configmake.h +# 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/rmt/rmt.c b/rmt/rmt.c new file mode 100644 index 0000000..a423018 --- /dev/null +++ b/rmt/rmt.c @@ -0,0 +1,676 @@ +/* Remote connection server. + + Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 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) any 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. */ + +/* Copyright (C) 1983 Regents of the University of California. + All rights reserved. + + Redistribution and use in source and binary forms are permitted provided + that the above copyright notice and this paragraph are duplicated in all + such forms and that any documentation, advertising materials, and other + materials related to such distribution and use acknowledge that the + software was developed by the University of California, Berkeley. The + name of the University may not be used to endorse or promote products + derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ + +#include "system.h" +#include "system-ioctl.h" +#include +#include +#include +#include +#include +#define obstack_chunk_alloc malloc +#define obstack_chunk_free free +#include +#include +#include + +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif + +/* Maximum size of a string from the requesting program. + It must hold enough for any integer, possibly with a sign. */ +#define STRING_SIZE (UINTMAX_STRSIZE_BOUND + 1) + +const char *program_name; + +/* File descriptor of the tape device, or negative if none open. */ +static int tape = -1; + +/* Buffer containing transferred data, and its allocated size. */ +static char *record_buffer; +static size_t allocated_size; + +/* Buffer for constructing the reply. */ +static char reply_buffer[BUFSIZ]; + +/* Obstack for arbitrary-sized strings */ +struct obstack string_stk; + +/* Debugging tools. */ + +static FILE *debug_file; + +#define DEBUG(File) \ + if (debug_file) fprintf(debug_file, File) + +#define DEBUG1(File, Arg) \ + if (debug_file) fprintf(debug_file, File, Arg) + +#define DEBUG2(File, Arg1, Arg2) \ + if (debug_file) fprintf(debug_file, File, Arg1, Arg2) + +static void +report_error_message (const char *string) +{ + DEBUG1 ("rmtd: E 0 (%s)\n", string); + + sprintf (reply_buffer, "E0\n%s\n", string); + full_write (STDOUT_FILENO, reply_buffer, strlen (reply_buffer)); +} + +static void +report_numbered_error (int num) +{ + DEBUG2 ("rmtd: E %d (%s)\n", num, strerror (num)); + + sprintf (reply_buffer, "E%d\n%s\n", num, strerror (num)); + full_write (STDOUT_FILENO, reply_buffer, strlen (reply_buffer)); +} + +static char * +get_string (void) +{ + for (;;) + { + char c; + if (safe_read (STDIN_FILENO, &c, 1) != 1) + exit (EXIT_SUCCESS); + + if (c == '\n') + break; + + obstack_1grow (&string_stk, c); + } + obstack_1grow (&string_stk, 0); + return obstack_finish (&string_stk); +} + +static void +free_string (char *string) +{ + obstack_free (&string_stk, string); +} + +static void +get_string_n (char *string) +{ + size_t counter; + + for (counter = 0; ; counter++) + { + if (safe_read (STDIN_FILENO, string + counter, 1) != 1) + exit (EXIT_SUCCESS); + + if (string[counter] == '\n') + break; + + if (counter == STRING_SIZE - 1) + report_error_message (N_("Input string too long")); + } + string[counter] = '\0'; +} + +static long int +get_long (char const *string) +{ + char *p; + long int n; + errno = 0; + n = strtol (string, &p, 10); + if (errno == ERANGE) + { + report_numbered_error (errno); + exit (EXIT_FAILURE); + } + if (!*string || *p) + { + report_error_message (N_("Number syntax error")); + exit (EXIT_FAILURE); + } + return n; +} + +static void +prepare_input_buffer (int fd, size_t size) +{ + if (size <= allocated_size) + return; + + if (record_buffer) + free (record_buffer); + + record_buffer = malloc (size); + + if (! record_buffer) + { + DEBUG (_("rmtd: Cannot allocate buffer space\n")); + + report_error_message (N_("Cannot allocate buffer space")); + exit (EXIT_FAILURE); /* exit status used to be 4 */ + } + + allocated_size = size; + +#ifdef SO_RCVBUF + if (0 <= fd) + { + int isize = size < INT_MAX ? size : INT_MAX; + while (setsockopt (fd, SOL_SOCKET, SO_RCVBUF, + (char *) &isize, sizeof isize) + && 1024 < isize) + isize >>= 1; + } +#endif +} + +/* Decode OFLAG_STRING, which represents the 2nd argument to `open'. + OFLAG_STRING should contain an optional integer, followed by an optional + symbolic representation of an open flag using only '|' to separate its + components (e.g. "O_WRONLY|O_CREAT|O_TRUNC"). Prefer the symbolic + representation if available, falling back on the numeric + representation, or to zero if both formats are absent. + + This function should be the inverse of encode_oflag. The numeric + representation is not portable from one host to another, but it is + for backward compatibility with old-fashioned clients that do not + emit symbolic open flags. */ + +static int +decode_oflag (char const *oflag_string) +{ + char *oflag_num_end; + int numeric_oflag = strtol (oflag_string, &oflag_num_end, 10); + int symbolic_oflag = 0; + + oflag_string = oflag_num_end; + while (ISSPACE ((unsigned char) *oflag_string)) + oflag_string++; + + do + { + struct name_value_pair { char const *name; int value; }; + static struct name_value_pair const table[] = + { +#ifdef O_APPEND + {"APPEND", O_APPEND}, +#endif + {"CREAT", O_CREAT}, +#ifdef O_DSYNC + {"DSYNC", O_DSYNC}, +#endif + {"EXCL", O_EXCL}, +#ifdef O_LARGEFILE + {"LARGEFILE", O_LARGEFILE}, /* LFS extension for opening large files */ +#endif +#ifdef O_NOCTTY + {"NOCTTY", O_NOCTTY}, +#endif +#if O_NONBLOCK + {"NONBLOCK", O_NONBLOCK}, +#endif + {"RDONLY", O_RDONLY}, + {"RDWR", O_RDWR}, +#ifdef O_RSYNC + {"RSYNC", O_RSYNC}, +#endif +#ifdef O_SYNC + {"SYNC", O_SYNC}, +#endif + {"TRUNC", O_TRUNC}, + {"WRONLY", O_WRONLY} + }; + struct name_value_pair const *t; + size_t s; + + if (*oflag_string++ != 'O' || *oflag_string++ != '_') + return numeric_oflag; + + for (t = table; + (strncmp (oflag_string, t->name, s = strlen (t->name)) != 0 + || (oflag_string[s] + && strchr ("ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789", + oflag_string[s]))); + t++) + if (t == table + sizeof table / sizeof *table - 1) + return numeric_oflag; + + symbolic_oflag |= t->value; + oflag_string += s; + } + while (*oflag_string++ == '|'); + + return symbolic_oflag; +} + +static struct option const long_opts[] = +{ + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'v'}, + {0, 0, 0, 0} +}; + +/* In-line localization is used only if --help or --version are + locally used. Otherwise, the localization burden lies with tar. */ +static void +i18n_setup () +{ + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); +} + +static void usage (int) __attribute__ ((noreturn)); + +static void +usage (int status) +{ + i18n_setup (); + + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("\ +Usage: %s [OPTION]\n\ +Manipulate a tape drive, accepting commands from a remote process.\n\ +\n\ + --version Output version info.\n\ + --help Output this help.\n"), + program_name); + printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + close_stdout (); + } + + exit (status); +} + +static void +respond (long int status) +{ + DEBUG1 ("rmtd: A %ld\n", status); + + sprintf (reply_buffer, "A%ld\n", status); + full_write (STDOUT_FILENO, reply_buffer, strlen (reply_buffer)); +} + + + +static void +open_device (void) +{ + char *device_string = get_string (); + char *oflag_string = get_string (); + + DEBUG2 ("rmtd: O %s %s\n", device_string, oflag_string); + + if (tape >= 0) + close (tape); + + tape = open (device_string, decode_oflag (oflag_string), MODE_RW); + if (tape < 0) + report_numbered_error (errno); + else + respond (0); + free_string (device_string); + free_string (oflag_string); +} + +static void +close_device (void) +{ + free_string (get_string ()); /* discard */ + DEBUG ("rmtd: C\n"); + + if (close (tape) < 0) + report_numbered_error (errno); + else + { + tape = -1; + respond (0); + } +} + +static void +lseek_device (void) +{ + char count_string[STRING_SIZE]; + char position_string[STRING_SIZE]; + off_t count = 0; + int negative; + int whence; + char *p; + + get_string_n (count_string); + get_string_n (position_string); + DEBUG2 ("rmtd: L %s %s\n", count_string, position_string); + + /* Parse count_string, taking care to check for overflow. + We can't use standard functions, + since off_t might be longer than long. */ + + for (p = count_string; *p == ' ' || *p == '\t'; p++) + ; + + negative = *p == '-'; + p += negative || *p == '+'; + + for (; *p; p++) + { + int digit = *p - '0'; + if (9 < (unsigned) digit) + { + report_error_message (N_("Seek offset error")); + exit (EXIT_FAILURE); + } + else + { + off_t c10 = 10 * count; + off_t nc = negative ? c10 - digit : c10 + digit; + if (c10 / 10 != count || (negative ? c10 < nc : nc < c10)) + { + report_error_message (N_("Seek offset out of range")); + exit (EXIT_FAILURE); + } + count = nc; + } + } + + switch (get_long (position_string)) + { + case 0: + whence = SEEK_SET; + break; + + case 1: + whence = SEEK_CUR; + break; + + case 2: + whence = SEEK_END; + break; + + default: + report_error_message (N_("Seek direction out of range")); + exit (EXIT_FAILURE); + } + + count = lseek (tape, count, whence); + if (count < 0) + report_numbered_error (errno); + else + { + /* Convert count back to string for reply. + We can't use sprintf, since off_t might be longer + than long. */ + p = count_string + sizeof count_string; + *--p = '\0'; + do + *--p = '0' + (int) (count % 10); + while ((count /= 10) != 0); + + DEBUG1 ("rmtd: A %s\n", p); + + sprintf (reply_buffer, "A%s\n", p); + full_write (STDOUT_FILENO, reply_buffer, strlen (reply_buffer)); + } +} + +static void +write_device (void) +{ + char count_string[STRING_SIZE]; + size_t size; + size_t counter; + size_t status = 0; + + get_string_n (count_string); + size = get_long (count_string); + DEBUG1 ("rmtd: W %s\n", count_string); + + prepare_input_buffer (STDIN_FILENO, size); + for (counter = 0; counter < size; counter += status) + { + status = safe_read (STDIN_FILENO, &record_buffer[counter], + size - counter); + if (status == SAFE_READ_ERROR || status == 0) + { + DEBUG (_("rmtd: Premature eof\n")); + + report_error_message (N_("Premature end of file")); + exit (EXIT_FAILURE); /* exit status used to be 2 */ + } + } + status = full_write (tape, record_buffer, size); + if (status != size) + report_numbered_error (errno); + else + respond (status); +} + +static void +read_device (void) +{ + char count_string[STRING_SIZE]; + size_t size; + size_t status; + + get_string_n (count_string); + DEBUG1 ("rmtd: R %s\n", count_string); + + size = get_long (count_string); + prepare_input_buffer (-1, size); + status = safe_read (tape, record_buffer, size); + if (status == SAFE_READ_ERROR) + report_numbered_error (errno); + else + { + sprintf (reply_buffer, "A%lu\n", (unsigned long int) status); + full_write (STDOUT_FILENO, reply_buffer, strlen (reply_buffer)); + full_write (STDOUT_FILENO, record_buffer, status); + } +} + +static void +mtioctop (void) +{ + char operation_string[STRING_SIZE]; + char count_string[STRING_SIZE]; + + get_string_n (operation_string); + get_string_n (count_string); + DEBUG2 ("rmtd: I %s %s\n", operation_string, count_string); + +#ifdef MTIOCTOP + { + struct mtop mtop; + const char *p; + off_t count = 0; + int negative; + + /* Parse count_string, taking care to check for overflow. + We can't use standard functions, + since off_t might be longer than long. */ + + for (p = count_string; *p == ' ' || *p == '\t'; p++) + ; + + negative = *p == '-'; + p += negative || *p == '+'; + + for (;;) + { + int digit = *p++ - '0'; + if (9 < (unsigned) digit) + break; + else + { + off_t c10 = 10 * count; + off_t nc = negative ? c10 - digit : c10 + digit; + if (c10 / 10 != count + || (negative ? c10 < nc : nc < c10)) + { + report_error_message (N_("Seek offset out of range")); + exit (EXIT_FAILURE); + } + count = nc; + } + } + + mtop.mt_count = count; + if (mtop.mt_count != count) + { + report_error_message (N_("Seek offset out of range")); + exit (EXIT_FAILURE); + } + mtop.mt_op = get_long (operation_string); + + if (ioctl (tape, MTIOCTOP, (char *) &mtop) < 0) + { + report_numbered_error (errno); + return; + } + } +#endif + respond (0); +} + +static void +status_device (void) +{ + DEBUG ("rmtd: S\n"); + +#ifdef MTIOCGET + { + struct mtget operation; + + if (ioctl (tape, MTIOCGET, (char *) &operation) < 0) + report_numbered_error (errno); + else + { + respond (sizeof operation); + full_write (STDOUT_FILENO, (char *) &operation, sizeof operation); + } + } +#endif +} + +int +main (int argc, char **argv) +{ + char command; + + program_name = argv[0]; + + obstack_init (&string_stk); + + switch (getopt_long (argc, argv, "", long_opts, NULL)) + { + default: + usage (EXIT_FAILURE); + + case 'h': + usage (EXIT_SUCCESS); + + case 'v': + i18n_setup (); + version_etc (stdout, "rmt", PACKAGE_NAME, PACKAGE_VERSION, + "John Gilmore", "Jay Fenlason", (char *) NULL); + close_stdout (); + return EXIT_SUCCESS; + + case -1: + break; + } + + if (optind < argc) + { + if (optind != argc - 1) + usage (EXIT_FAILURE); + debug_file = fopen (argv[optind], "w"); + if (debug_file == 0) + { + report_numbered_error (errno); + return EXIT_FAILURE; + } + setbuf (debug_file, 0); + } + + while (1) + { + errno = 0; + + if (safe_read (STDIN_FILENO, &command, 1) != 1) + return EXIT_SUCCESS; + + switch (command) + { + case 'O': + open_device (); + break; + + case 'C': + close_device (); + break; + + case 'L': + lseek_device (); + break; + + case 'W': + write_device (); + break; + + case 'R': + read_device (); + break; + + case 'I': + mtioctop (); + break; + + case 'S': + status_device (); + break; + + default: + DEBUG1 ("rmtd: Garbage command %c\n", command); + report_error_message (N_("Garbage command")); + return EXIT_FAILURE; /* exit status used to be 3 */ + } + } +} diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..4a8b392 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,55 @@ +# This file is part of GNU cpio +# Copyright (C) 2003, 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. + +INCLUDES=-I. -I.. -I$(top_srcdir)/lib + +bin_PROGRAMS=cpio @CPIO_MT_PROG@ +EXTRA_PROGRAMS=mt + +cpio_SOURCES = \ + copyin.c\ + copyout.c\ + copypass.c\ + defer.c\ + dstring.c\ + global.c\ + main.c\ + tar.c\ + util.c\ + filemode.c\ + idcache.c\ + makepath.c\ + userspec.c + +noinst_HEADERS =\ + cpio.h\ + cpiohdr.h\ + tar.h\ + tarhdr.h\ + defer.h\ + dstring.h\ + extern.h\ + filetypes.h\ + safe-stat.h + +cpio_LDADD = ../lib/libcpio.a $(INTLLIBS) + +mt_SOURCES = mt.c +mt_LDADD = ../lib/lib$(PACKAGE).a $(INTLLIBS) + +mt.o main.o: ../lib/rmt-command.h diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..4b3f3dd --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,781 @@ +# Makefile.in generated by automake 1.10a from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# This file is part of GNU cpio +# Copyright (C) 2003, 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. + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@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 +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = cpio$(EXEEXT) @CPIO_MT_PROG@ +EXTRA_PROGRAMS = mt$(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 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/argp.m4 \ + $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/canonicalize-lgpl.m4 \ + $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \ + $(top_srcdir)/m4/clock_time.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/d-ino.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/exitfail.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/getcwd-abort-bug.m4 \ + $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \ + $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/hash.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/inline.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/lchown.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mempcpy.m4 \ + $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mktime.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ + $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/paxutils.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \ + $(top_srcdir)/m4/rmt.m4 $(top_srcdir)/m4/rtapelib.m4 \ + $(top_srcdir)/m4/safe-read.m4 $(top_srcdir)/m4/safe-write.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sysexits.m4 \ + $(top_srcdir)/m4/system.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/ulonglong.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vsnprintf.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_cpio_OBJECTS = copyin.$(OBJEXT) copyout.$(OBJEXT) \ + copypass.$(OBJEXT) defer.$(OBJEXT) dstring.$(OBJEXT) \ + global.$(OBJEXT) main.$(OBJEXT) tar.$(OBJEXT) util.$(OBJEXT) \ + filemode.$(OBJEXT) idcache.$(OBJEXT) makepath.$(OBJEXT) \ + userspec.$(OBJEXT) +cpio_OBJECTS = $(am_cpio_OBJECTS) +am__DEPENDENCIES_1 = +cpio_DEPENDENCIES = ../lib/libcpio.a $(am__DEPENDENCIES_1) +am_mt_OBJECTS = mt.$(OBJEXT) +mt_OBJECTS = $(am_mt_OBJECTS) +mt_DEPENDENCIES = ../lib/lib$(PACKAGE).a $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(cpio_SOURCES) $(mt_SOURCES) +DIST_SOURCES = $(cpio_SOURCES) $(mt_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ +ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ +ABSOLUTE_FLOAT_H = @ABSOLUTE_FLOAT_H@ +ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_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_SYSEXITS_H = @ABSOLUTE_SYSEXITS_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@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPIO_MT_PROG = @CPIO_MT_PROG@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_RMT_COMMAND = @DEFAULT_RMT_COMMAND@ +DEFAULT_RMT_DIR = @DEFAULT_RMT_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIRENT_H = @DIRENT_H@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXEEXT = @EXEEXT@ +FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_H = @GETOPT_H@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ +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_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_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYSEXITS_H = @HAVE_SYSEXITS_H@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE__BOOL = @HAVE__BOOL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTTYPES_H = @INTTYPES_H@ +LDFLAGS = @LDFLAGS@ +LIBCPIO_LIBDEPS = @LIBCPIO_LIBDEPS@ +LIBCPIO_LTLIBDEPS = @LIBCPIO_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_SETSOCKOPT = @LIB_SETSOCKOPT@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +PU_RMT_PROG = @PU_RMT_PROG@ +RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYSEXITS_H = @SYSEXITS_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@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I. -I.. -I$(top_srcdir)/lib +cpio_SOURCES = \ + copyin.c\ + copyout.c\ + copypass.c\ + defer.c\ + dstring.c\ + global.c\ + main.c\ + tar.c\ + util.c\ + filemode.c\ + idcache.c\ + makepath.c\ + userspec.c + +noinst_HEADERS = \ + cpio.h\ + cpiohdr.h\ + tar.h\ + tarhdr.h\ + defer.h\ + dstring.h\ + extern.h\ + filetypes.h\ + safe-stat.h + +cpio_LDADD = ../lib/libcpio.a $(INTLLIBS) +mt_SOURCES = mt.c +mt_LDADD = ../lib/lib$(PACKAGE).a $(INTLLIBS) +all: all-am + +.SUFFIXES: +.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; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(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-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 + +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 + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +installcheck-binPROGRAMS: $(bin_PROGRAMS) + bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | \ + sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + for opt in --help --version; do \ + if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad +cpio$(EXEEXT): $(cpio_OBJECTS) $(cpio_DEPENDENCIES) + @rm -f cpio$(EXEEXT) + $(LINK) $(cpio_OBJECTS) $(cpio_LDADD) $(LIBS) +mt$(EXEEXT): $(mt_OBJECTS) $(mt_DEPENDENCIES) + @rm -f mt$(EXEEXT) + $(LINK) $(mt_OBJECTS) $(mt_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copyin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copyout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copypass.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dstring.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idcache.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makepath.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userspec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.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 +@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 +@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) '$<'` + +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; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + 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" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + 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; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: installcheck-binPROGRAMS + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic 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-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 installcheck-binPROGRAMS \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS + + +mt.o main.o: ../lib/rmt-command.h +# 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/copyin.c b/src/copyin.c new file mode 100644 index 0000000..819e2f4 --- /dev/null +++ b/src/copyin.c @@ -0,0 +1,1579 @@ +/* copyin.c - extract or list a cpio archive + Copyright (C) 1990,1991,1992,2001,2002,2003,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) + any 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 +#include +#include +#include "filetypes.h" +#include "cpiohdr.h" +#include "dstring.h" +#include "extern.h" +#include "defer.h" +#include +#ifndef FNM_PATHNAME +# include +#endif + +#ifndef HAVE_LCHOWN +# define lchown(f,u,g) 0 +#endif + +static void copyin_regular_file(struct cpio_file_stat* file_hdr, + int in_file_des); + +void +warn_junk_bytes (long bytes_skipped) +{ + error (0, 0, ngettext ("warning: skipped %ld byte of junk", + "warning: skipped %ld bytes of junk", bytes_skipped), + bytes_skipped); +} + + +static int +query_rename(struct cpio_file_stat* file_hdr, FILE *tty_in, FILE *tty_out, + FILE *rename_in) +{ + char *str_res; /* Result for string function. */ + static dynamic_string new_name; /* New file name for rename option. */ + static int initialized_new_name = false; + if (!initialized_new_name) + { + ds_init (&new_name, 128); + initialized_new_name = true; + } + + if (rename_flag) + { + fprintf (tty_out, _("rename %s -> "), file_hdr->c_name); + fflush (tty_out); + str_res = ds_fgets (tty_in, &new_name); + } + else + { + str_res = ds_fgetstr (rename_in, &new_name, '\n'); + } + if (str_res == NULL || str_res[0] == 0) + { + return -1; + } + else + /* Debian hack: file_hrd.c_name is sometimes set to + point to static memory by code in tar.c. This + causes a segfault. This has been fixed and an + additional check to ensure that the file name + is not too long has been added. (Reported by + Horst Knobloch.) This bug has been reported to + "bug-gnu-utils@prep.ai.mit.edu". (99/1/6) -BEM */ + { + if (archive_format != arf_tar && archive_format != arf_ustar) + { + free (file_hdr->c_name); + file_hdr->c_name = xstrdup (new_name.ds_string); + } + else + { + if (is_tar_filename_too_long (new_name.ds_string)) + error (0, 0, _("%s: file name too long"), + new_name.ds_string); + else + strcpy (file_hdr->c_name, new_name.ds_string); + } + } + return 0; +} + +/* Skip the padding on IN_FILE_DES after a header or file, + up to the next header. + The number of bytes skipped is based on OFFSET -- the current offset + from the last start of a header (or file) -- and the current + header type. */ + +static void +tape_skip_padding (int in_file_des, int offset) +{ + int pad; + + if (archive_format == arf_crcascii || archive_format == arf_newascii) + pad = (4 - (offset % 4)) % 4; + else if (archive_format == arf_binary || archive_format == arf_hpbinary) + pad = (2 - (offset % 2)) % 2; + else if (archive_format == arf_tar || archive_format == arf_ustar) + pad = (512 - (offset % 512)) % 512; + else + pad = 0; + + if (pad != 0) + tape_toss_input (in_file_des, pad); +} + + +static void +list_file(struct cpio_file_stat* file_hdr, int in_file_des) +{ + if (verbose_flag) + { +#ifdef CP_IFLNK + if ((file_hdr->c_mode & CP_IFMT) == CP_IFLNK) + { + if (archive_format != arf_tar && archive_format != arf_ustar) + { + char *link_name = NULL; /* Name of hard and symbolic links. */ + + link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1); + link_name[file_hdr->c_filesize] = '\0'; + tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize); + long_format (file_hdr, link_name); + free (link_name); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + return; + } + else + { + long_format (file_hdr, file_hdr->c_tar_linkname); + return; + } + } + else +#endif + long_format (file_hdr, (char *) 0); + } + else + { + /* Debian hack: Modified to print a list of filenames + terminiated by a null character when the -t and -0 + flags are used. This has been submitted as a + suggestion to "bug-gnu-utils@prep.ai.mit.edu". -BEM */ + printf ("%s%c", file_hdr->c_name, name_end); + } + + crc = 0; + tape_toss_input (in_file_des, file_hdr->c_filesize); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + if (only_verify_crc_flag) + { +#ifdef CP_IFLNK + if ((file_hdr->c_mode & CP_IFMT) == CP_IFLNK) + { + return; /* links don't have a checksum */ + } +#endif + if (crc != file_hdr->c_chksum) + { + error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), + file_hdr->c_name, crc, file_hdr->c_chksum); + } + } +} + +static int +try_existing_file (struct cpio_file_stat* file_hdr, int in_file_des, + int *existing_dir) +{ + struct stat file_stat; + + *existing_dir = false; + if (lstat (file_hdr->c_name, &file_stat) == 0) + { + if (S_ISDIR (file_stat.st_mode) + && ((file_hdr->c_mode & CP_IFMT) == CP_IFDIR)) + { + /* If there is already a directory there that + we are trying to create, don't complain about + it. */ + *existing_dir = true; + return 0; + } + else if (!unconditional_flag + && file_hdr->c_mtime <= file_stat.st_mtime) + { + error (0, 0, _("%s not created: newer or same age version exists"), + file_hdr->c_name); + tape_toss_input (in_file_des, file_hdr->c_filesize); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + return -1; /* Go to the next file. */ + } + else if (S_ISDIR (file_stat.st_mode) + ? rmdir (file_hdr->c_name) + : unlink (file_hdr->c_name)) + { + error (0, errno, _("cannot remove current %s"), + file_hdr->c_name); + tape_toss_input (in_file_des, file_hdr->c_filesize); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + return -1; /* Go to the next file. */ + } + } + return 0; +} + +/* The newc and crc formats store multiply linked copies of the same file + in the archive only once. The actual data is attached to the last link + in the archive, and the other links all have a filesize of 0. When a + file in the archive has multiple links and a filesize of 0, its data is + probably "attatched" to another file in the archive, so we can't create + it right away. We have to "defer" creating it until we have created + the file that has the data "attatched" to it. We keep a list of the + "defered" links on deferments. */ + +struct deferment *deferments = NULL; + +/* Add a file header to the deferments list. For now they all just + go on one list, although we could optimize this if necessary. */ + +static void +defer_copyin (struct cpio_file_stat *file_hdr) +{ + struct deferment *d; + d = create_deferment (file_hdr); + d->next = deferments; + deferments = d; + return; +} + +/* We just created a file that (probably) has some other links to it + which have been defered. Go through all of the links on the deferments + list and create any which are links to this file. */ + +static void +create_defered_links (struct cpio_file_stat *file_hdr) +{ + struct deferment *d; + struct deferment *d_prev; + int ino; + int maj; + int min; + int link_res; + ino = file_hdr->c_ino; + maj = file_hdr->c_dev_maj; + min = file_hdr->c_dev_min; + d = deferments; + d_prev = NULL; + while (d != NULL) + { + if ( (d->header.c_ino == ino) && (d->header.c_dev_maj == maj) + && (d->header.c_dev_min == min) ) + { + struct deferment *d_free; + link_res = link_to_name (d->header.c_name, file_hdr->c_name); + if (link_res < 0) + { + error (0, errno, _("cannot link %s to %s"), + d->header.c_name, file_hdr->c_name); + } + if (d_prev != NULL) + d_prev->next = d->next; + else + deferments = d->next; + d_free = d; + d = d->next; + free_deferment (d_free); + } + else + { + d_prev = d; + d = d->next; + } + } +} + +/* We are skipping a file but there might be other links to it that we + did not skip, so we have to copy its data for the other links. Find + the first link that we didn't skip and try to create that. That will + then create the other deferred links. */ + +static int +create_defered_links_to_skipped (struct cpio_file_stat *file_hdr, + int in_file_des) +{ + struct deferment *d; + struct deferment *d_prev; + int ino; + int maj; + int min; + if (file_hdr->c_filesize == 0) + { + /* The file doesn't have any data attached to it so we don't have + to bother. */ + return -1; + } + ino = file_hdr->c_ino; + maj = file_hdr->c_dev_maj; + min = file_hdr->c_dev_min; + d = deferments; + d_prev = NULL; + while (d != NULL) + { + if ( (d->header.c_ino == ino) && (d->header.c_dev_maj == maj) + && (d->header.c_dev_min == min) ) + { + if (d_prev != NULL) + d_prev->next = d->next; + else + deferments = d->next; + free (file_hdr->c_name); + file_hdr->c_name = xstrdup(d->header.c_name); + free_deferment (d); + copyin_regular_file(file_hdr, in_file_des); + return 0; + } + else + { + d_prev = d; + d = d->next; + } + } + return -1; +} + +/* If we had a multiply linked file that really was empty then we would + have defered all of its links, since we never found any with data + "attached", and they will still be on the deferment list even when + we are done reading the whole archive. Write out all of these + empty links that are still on the deferments list. */ + +static void +create_final_defers () +{ + struct deferment *d; + int link_res; + int out_file_des; + + for (d = deferments; d != NULL; d = d->next) + { + /* Debian hack: A line, which could cause an endless loop, was + removed (97/1/2). It was reported by Ronald F. Guilmette to + the upstream maintainers. -BEM */ + /* Debian hack: This was reported by Horst Knobloch. This bug has + been reported to "bug-gnu-utils@prep.ai.mit.edu". (99/1/6) -BEM + */ + link_res = link_to_maj_min_ino (d->header.c_name, + d->header.c_dev_maj, d->header.c_dev_min, + d->header.c_ino); + if (link_res == 0) + { + continue; + } + out_file_des = open (d->header.c_name, + O_CREAT | O_WRONLY | O_BINARY, 0600); + if (out_file_des < 0 && create_dir_flag) + { + create_all_directories (d->header.c_name); + out_file_des = open (d->header.c_name, + O_CREAT | O_WRONLY | O_BINARY, + 0600); + } + if (out_file_des < 0) + { + open_error (d->header.c_name); + continue; + } + + set_perms (out_file_des, &d->header); + + if (close (out_file_des) < 0) + close_error (d->header.c_name); + + } +} + +static void +copyin_regular_file (struct cpio_file_stat* file_hdr, int in_file_des) +{ + int out_file_des; /* Output file descriptor. */ + + if (to_stdout_option) + out_file_des = STDOUT_FILENO; + else + { + /* Can the current file be linked to a previously copied file? */ + if (file_hdr->c_nlink > 1 + && (archive_format == arf_newascii + || archive_format == arf_crcascii) ) + { + int link_res; + if (file_hdr->c_filesize == 0) + { + /* The newc and crc formats store multiply linked copies + of the same file in the archive only once. The + actual data is attached to the last link in the + archive, and the other links all have a filesize + of 0. Since this file has multiple links and a + filesize of 0, its data is probably attatched to + another file in the archive. Save the link, and + process it later when we get the actual data. We + can't just create it with length 0 and add the + data later, in case the file is readonly. We still + lose if its parent directory is readonly (and we aren't + running as root), but there's nothing we can do about + that. */ + defer_copyin (file_hdr); + tape_toss_input (in_file_des, file_hdr->c_filesize); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + return; + } + /* If the file has data (filesize != 0), then presumably + any other links have already been defer_copyin'ed(), + but GNU cpio version 2.0-2.2 didn't do that, so we + still have to check for links here (and also in case + the archive was created and later appeneded to). */ + /* Debian hack: (97/1/2) This was reported by Ronald + F. Guilmette to the upstream maintainers. -BEM */ + link_res = link_to_maj_min_ino (file_hdr->c_name, + file_hdr->c_dev_maj, file_hdr->c_dev_min, + file_hdr->c_ino); + if (link_res == 0) + { + tape_toss_input (in_file_des, file_hdr->c_filesize); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + return; + } + } + else if (file_hdr->c_nlink > 1 + && archive_format != arf_tar + && archive_format != arf_ustar) + { + int link_res; + /* Debian hack: (97/1/2) This was reported by Ronald + F. Guilmette to the upstream maintainers. -BEM */ + link_res = link_to_maj_min_ino (file_hdr->c_name, + file_hdr->c_dev_maj, + file_hdr->c_dev_min, + file_hdr->c_ino); + if (link_res == 0) + { + tape_toss_input (in_file_des, file_hdr->c_filesize); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + return; + } + } + else if ((archive_format == arf_tar || archive_format == arf_ustar) + && file_hdr->c_tar_linkname + && file_hdr->c_tar_linkname[0] != '\0') + { + int link_res; + link_res = link_to_name (file_hdr->c_name, file_hdr->c_tar_linkname); + if (link_res < 0) + { + error (0, errno, _("cannot link %s to %s"), + file_hdr->c_tar_linkname, file_hdr->c_name); + } + return; + } + + /* If not linked, copy the contents of the file. */ + out_file_des = open (file_hdr->c_name, + O_CREAT | O_WRONLY | O_BINARY, 0600); + + if (out_file_des < 0 && create_dir_flag) + { + create_all_directories (file_hdr->c_name); + out_file_des = open (file_hdr->c_name, + O_CREAT | O_WRONLY | O_BINARY, + 0600); + } + + if (out_file_des < 0) + { + open_error (file_hdr->c_name); + tape_toss_input (in_file_des, file_hdr->c_filesize); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + return; + } + } + + crc = 0; + if (swap_halfwords_flag) + { + if ((file_hdr->c_filesize % 4) == 0) + swapping_halfwords = true; + else + error (0, 0, _("cannot swap halfwords of %s: odd number of halfwords"), + file_hdr->c_name); + } + if (swap_bytes_flag) + { + if ((file_hdr->c_filesize % 2) == 0) + swapping_bytes = true; + else + error (0, 0, _("cannot swap bytes of %s: odd number of bytes"), + file_hdr->c_name); + } + copy_files_tape_to_disk (in_file_des, out_file_des, file_hdr->c_filesize); + disk_empty_output_buffer (out_file_des); + + if (to_stdout_option) + { + if (archive_format == arf_crcascii) + { + if (crc != file_hdr->c_chksum) + error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), + file_hdr->c_name, crc, file_hdr->c_chksum); + } + tape_skip_padding (in_file_des, file_hdr->c_filesize); + return; + } + + /* Debian hack to fix a bug in the --sparse option. + This bug has been reported to + "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */ + if (delayed_seek_count > 0) + { + lseek (out_file_des, delayed_seek_count-1, SEEK_CUR); + write (out_file_des, "", 1); + delayed_seek_count = 0; + } + + set_perms (out_file_des, file_hdr); + + if (close (out_file_des) < 0) + close_error (file_hdr->c_name); + + if (archive_format == arf_crcascii) + { + if (crc != file_hdr->c_chksum) + error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), + file_hdr->c_name, crc, file_hdr->c_chksum); + } + + tape_skip_padding (in_file_des, file_hdr->c_filesize); + if (file_hdr->c_nlink > 1 + && (archive_format == arf_newascii || archive_format == arf_crcascii) ) + { + /* (see comment above for how the newc and crc formats + store multiple links). Now that we have the data + for this file, create any other links to it which + we defered. */ + create_defered_links (file_hdr); + } +} + +static void +copyin_directory (struct cpio_file_stat *file_hdr, int existing_dir) +{ + int res; /* Result of various function calls. */ +#ifdef HPUX_CDF + int cdf_flag; /* True if file is a CDF. */ + int cdf_char; /* Index of `+' char indicating a CDF. */ +#endif + + if (to_stdout_option) + return; + + /* Strip any trailing `/'s off the filename; tar puts + them on. We might as well do it here in case anybody + else does too, since they cause strange things to happen. */ + strip_trailing_slashes (file_hdr->c_name); + + /* Ignore the current directory. It must already exist, + and we don't want to change its permission, ownership + or time. */ + if (file_hdr->c_name[0] == '.' && file_hdr->c_name[1] == '\0') + { + return; + } + +#ifdef HPUX_CDF + cdf_flag = 0; +#endif + if (!existing_dir) + + { +#ifdef HPUX_CDF + /* If the directory name ends in a + and is SUID, + then it is a CDF. Strip the trailing + from + the name before creating it. */ + cdf_char = strlen (file_hdr->c_name) - 1; + if ( (cdf_char > 0) && + (file_hdr->c_mode & 04000) && + (file_hdr->c_name [cdf_char] == '+') ) + { + file_hdr->c_name [cdf_char] = '\0'; + cdf_flag = 1; + } +#endif + res = mkdir (file_hdr->c_name, file_hdr->c_mode); + } + else + res = 0; + if (res < 0 && create_dir_flag) + { + create_all_directories (file_hdr->c_name); + res = mkdir (file_hdr->c_name, file_hdr->c_mode); + } + if (res < 0) + { + /* In some odd cases where the file_hdr->c_name includes `.', + the directory may have actually been created by + create_all_directories(), so the mkdir will fail + because the directory exists. If that's the case, + don't complain about it. */ + struct stat file_stat; + if (errno != EEXIST) + { + mkdir_error (file_hdr->c_name); + return; + } + if (lstat (file_hdr->c_name, &file_stat)) + { + stat_error (file_hdr->c_name); + return; + } + if (!(S_ISDIR (file_stat.st_mode))) + { + error (0, 0, _("%s is not a directory"), + quotearg_colon (file_hdr->c_name)); + return; + } + } + + set_perms (-1, file_hdr); +} + +static void +copyin_device (struct cpio_file_stat* file_hdr) +{ + int res; /* Result of various function calls. */ + + if (to_stdout_option) + return; + + if (file_hdr->c_nlink > 1 && archive_format != arf_tar + && archive_format != arf_ustar) + { + int link_res; + /* Debian hack: This was reported by Horst + Knobloch. This bug has been reported to + "bug-gnu-utils@prep.ai.mit.edu". (99/1/6) -BEM */ + link_res = link_to_maj_min_ino (file_hdr->c_name, + file_hdr->c_dev_maj, file_hdr->c_dev_min, + file_hdr->c_ino); + if (link_res == 0) + { + return; + } + } + else if (archive_format == arf_ustar && + file_hdr->c_tar_linkname && + file_hdr->c_tar_linkname [0] != '\0') + { + int link_res; + link_res = link_to_name (file_hdr->c_name, + file_hdr->c_tar_linkname); + if (link_res < 0) + { + error (0, errno, _("cannot link %s to %s"), + file_hdr->c_tar_linkname, file_hdr->c_name); + /* Something must be wrong, because we couldn't + find the file to link to. But can we assume + that the device maj/min numbers are correct + and fall through to the mknod? It's probably + safer to just return, rather than possibly + creating a bogus device file. */ + } + return; + } + + res = mknod (file_hdr->c_name, file_hdr->c_mode, + makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min)); + if (res < 0 && create_dir_flag) + { + create_all_directories (file_hdr->c_name); + res = mknod (file_hdr->c_name, file_hdr->c_mode, + makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min)); + } + if (res < 0) + { + mknod_error (file_hdr->c_name); + return; + } + if (!no_chown_flag) + { + uid_t uid = set_owner_flag ? set_owner : file_hdr->c_uid; + gid_t gid = set_group_flag ? set_group : file_hdr->c_gid; + if ((chown (file_hdr->c_name, uid, gid) < 0) + && errno != EPERM) + chown_error_details (file_hdr->c_name, uid, gid); + } + /* chown may have turned off some permissions we wanted. */ + if (chmod (file_hdr->c_name, file_hdr->c_mode) < 0) + chmod_error_details (file_hdr->c_name, file_hdr->c_mode); + if (retain_time_flag) + set_file_times (-1, file_hdr->c_name, file_hdr->c_mtime, + file_hdr->c_mtime); +} + +static void +copyin_link(struct cpio_file_stat *file_hdr, int in_file_des) +{ + char *link_name = NULL; /* Name of hard and symbolic links. */ + int res; /* Result of various function calls. */ + + if (to_stdout_option) + return; + + if (archive_format != arf_tar && archive_format != arf_ustar) + { + link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1); + link_name[file_hdr->c_filesize] = '\0'; + tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + } + else + { + link_name = xstrdup (file_hdr->c_tar_linkname); + } + + res = UMASKED_SYMLINK (link_name, file_hdr->c_name, + file_hdr->c_mode); + if (res < 0 && create_dir_flag) + { + create_all_directories (file_hdr->c_name); + res = UMASKED_SYMLINK (link_name, file_hdr->c_name, + file_hdr->c_mode); + } + if (res < 0) + { + error (0, errno, _("%s: Cannot symlink to %s"), + quotearg_colon (link_name), quote_n (1, file_hdr->c_name)); + free (link_name); + return; + } + if (!no_chown_flag) + { + uid_t uid = set_owner_flag ? set_owner : file_hdr->c_uid; + gid_t gid = set_group_flag ? set_group : file_hdr->c_gid; + if ((lchown (file_hdr->c_name, uid, gid) < 0) + && errno != EPERM) + chown_error_details (file_hdr->c_name, uid, gid); + } + free (link_name); +} + +static void +copyin_file (struct cpio_file_stat* file_hdr, int in_file_des) +{ + int existing_dir; + + if (!to_stdout_option + && try_existing_file (file_hdr, in_file_des, &existing_dir) < 0) + return; + + /* Do the real copy or link. */ + switch (file_hdr->c_mode & CP_IFMT) + { + case CP_IFREG: + copyin_regular_file (file_hdr, in_file_des); + break; + + case CP_IFDIR: + copyin_directory (file_hdr, existing_dir); + break; + + case CP_IFCHR: + case CP_IFBLK: +#ifdef CP_IFSOCK + case CP_IFSOCK: +#endif +#ifdef CP_IFIFO + case CP_IFIFO: +#endif + copyin_device (file_hdr); + break; + +#ifdef CP_IFLNK + case CP_IFLNK: + copyin_link (file_hdr, in_file_des); + break; +#endif + + default: + error (0, 0, _("%s: unknown file type"), file_hdr->c_name); + tape_toss_input (in_file_des, file_hdr->c_filesize); + tape_skip_padding (in_file_des, file_hdr->c_filesize); + } +} + + +/* Current time for verbose table. */ +static time_t current_time; + + +/* Print the file described by FILE_HDR in long format. + If LINK_NAME is nonzero, it is the name of the file that + this file is a symbolic link to. */ + +void +long_format (struct cpio_file_stat *file_hdr, char *link_name) +{ + char mbuf[11]; + char tbuf[40]; + time_t when; + + mode_string (file_hdr->c_mode, mbuf); + mbuf[10] = '\0'; + + /* Get time values ready to print. */ + when = file_hdr->c_mtime; + strcpy (tbuf, ctime (&when)); + if (current_time - when > 6L * 30L * 24L * 60L * 60L + || current_time - when < 0L) + { + /* The file is older than 6 months, or in the future. + Show the year instead of the time of day. */ + strcpy (tbuf + 11, tbuf + 19); + } + tbuf[16] = '\0'; + + printf ("%s %3lu ", mbuf, file_hdr->c_nlink); + + if (numeric_uid) + printf ("%-8u %-8u ", (unsigned int) file_hdr->c_uid, + (unsigned int) file_hdr->c_gid); + else + printf ("%-8.8s %-8.8s ", getuser (file_hdr->c_uid), + getgroup (file_hdr->c_gid)); + + if ((file_hdr->c_mode & CP_IFMT) == CP_IFCHR + || (file_hdr->c_mode & CP_IFMT) == CP_IFBLK) + printf ("%3lu, %3lu ", file_hdr->c_rdev_maj, + file_hdr->c_rdev_min); + else + printf ("%8"PRIuMAX" ", (uintmax_t) file_hdr->c_filesize); + + printf ("%s ", tbuf + 4); + + print_name_with_quoting (file_hdr->c_name); + if (link_name) + { + printf (" -> "); + print_name_with_quoting (link_name); + } + putc ('\n', stdout); +} + +void +print_name_with_quoting (register char *p) +{ + register unsigned char c; + + while ( (c = *p++) ) + { + switch (c) + { + case '\\': + printf ("\\\\"); + break; + + case '\n': + printf ("\\n"); + break; + + case '\b': + printf ("\\b"); + break; + + case '\r': + printf ("\\r"); + break; + + case '\t': + printf ("\\t"); + break; + + case '\f': + printf ("\\f"); + break; + + case ' ': + printf ("\\ "); + break; + + case '"': + printf ("\\\""); + break; + + default: + if (c > 040 && c < 0177) + putchar (c); + else + printf ("\\%03o", (unsigned int) c); + } + } +} + +/* Read a pattern file (for the -E option). Put a list of + `num_patterns' elements in `save_patterns'. Any patterns that were + already in `save_patterns' (from the command line) are preserved. */ + +static void +read_pattern_file () +{ + int max_new_patterns; + char **new_save_patterns; + int new_num_patterns; + int i; + dynamic_string pattern_name; + FILE *pattern_fp; + + if (num_patterns < 0) + num_patterns = 0; + max_new_patterns = 1 + num_patterns; + new_save_patterns = (char **) xmalloc (max_new_patterns * sizeof (char *)); + new_num_patterns = num_patterns; + ds_init (&pattern_name, 128); + + pattern_fp = fopen (pattern_file_name, "r"); + if (pattern_fp == NULL) + open_error (pattern_file_name); + while (ds_fgetstr (pattern_fp, &pattern_name, '\n') != NULL) + { + if (new_num_patterns >= max_new_patterns) + { + max_new_patterns += 1; + new_save_patterns = (char **) + xrealloc ((char *) new_save_patterns, + max_new_patterns * sizeof (char *)); + } + new_save_patterns[new_num_patterns] = xstrdup (pattern_name.ds_string); + ++new_num_patterns; + } + if (ferror (pattern_fp) || fclose (pattern_fp) == EOF) + close_error (pattern_file_name); + + for (i = 0; i < num_patterns; ++i) + new_save_patterns[i] = save_patterns[i]; + + save_patterns = new_save_patterns; + num_patterns = new_num_patterns; +} + + +uintmax_t +from_ascii (char const *where, size_t digs, unsigned logbase) +{ + uintmax_t value = 0; + char const *buf = where; + char const *end = buf + digs; + int overflow = 0; + static char codetab[] = "0123456789ABCDEF"; + + for (; *buf == ' '; buf++) + { + if (buf == end) + return 0; + } + + if (buf == end || *buf == 0) + return 0; + while (1) + { + unsigned d; + + char *p = strchr (codetab, toupper (*buf)); + if (!p) + { + error (0, 0, _("Malformed number %.*s"), digs, where); + break; + } + + d = p - codetab; + if ((d >> logbase) > 1) + { + error (0, 0, _("Malformed number %.*s"), digs, where); + break; + } + value += d; + if (++buf == end || *buf == 0) + break; + overflow |= value ^ (value << logbase >> logbase); + value <<= logbase; + } + if (overflow) + error (0, 0, _("Archive value %.*s is out of range"), + digs, where); + return value; +} + + + +/* Return 16-bit integer I with the bytes swapped. */ +#define swab_short(i) ((((i) << 8) & 0xff00) | (((i) >> 8) & 0x00ff)) + +/* Read the header, including the name of the file, from file + descriptor IN_DES into FILE_HDR. */ + +void +read_in_header (struct cpio_file_stat *file_hdr, int in_des) +{ + union { + char str[6]; + unsigned short num; + struct old_cpio_header old_header; + } magic; + long bytes_skipped = 0; /* Bytes of junk found before magic number. */ + + /* Search for a valid magic number. */ + + if (archive_format == arf_unknown) + { + char tmpbuf[512]; + int check_tar; + int peeked_bytes; + + while (archive_format == arf_unknown) + { + peeked_bytes = tape_buffered_peek (tmpbuf, in_des, 512); + if (peeked_bytes < 6) + error (1, 0, _("premature end of archive")); + + if (!strncmp (tmpbuf, "070701", 6)) + archive_format = arf_newascii; + else if (!strncmp (tmpbuf, "070707", 6)) + archive_format = arf_oldascii; + else if (!strncmp (tmpbuf, "070702", 6)) + { + archive_format = arf_crcascii; + crc_i_flag = true; + } + else if ((*((unsigned short *) tmpbuf) == 070707) || + (*((unsigned short *) tmpbuf) == swab_short ((unsigned short) 070707))) + archive_format = arf_binary; + else if (peeked_bytes >= 512 + && (check_tar = is_tar_header (tmpbuf))) + { + if (check_tar == 2) + archive_format = arf_ustar; + else + archive_format = arf_tar; + } + else + { + tape_buffered_read ((char *) tmpbuf, in_des, 1L); + ++bytes_skipped; + } + } + } + + if (archive_format == arf_tar || archive_format == arf_ustar) + { + if (append_flag) + last_header_start = input_bytes - io_block_size + + (in_buff - input_buffer); + if (bytes_skipped > 0) + warn_junk_bytes (bytes_skipped); + + read_in_tar_header (file_hdr, in_des); + return; + } + + file_hdr->c_tar_linkname = NULL; + + tape_buffered_read (magic.str, in_des, 6L); + while (1) + { + if (append_flag) + last_header_start = input_bytes - io_block_size + + (in_buff - input_buffer) - 6; + if (archive_format == arf_newascii + && !strncmp (magic.str, "070701", 6)) + { + if (bytes_skipped > 0) + warn_junk_bytes (bytes_skipped); + file_hdr->c_magic = 070701; + read_in_new_ascii (file_hdr, in_des); + break; + } + if (archive_format == arf_crcascii + && !strncmp (magic.str, "070702", 6)) + { + if (bytes_skipped > 0) + warn_junk_bytes (bytes_skipped); + file_hdr->c_magic = 070702; + read_in_new_ascii (file_hdr, in_des); + break; + } + if ( (archive_format == arf_oldascii || archive_format == arf_hpoldascii) + && !strncmp (magic.str, "070707", 6)) + { + if (bytes_skipped > 0) + warn_junk_bytes (bytes_skipped); + file_hdr->c_magic = 070707; + read_in_old_ascii (file_hdr, in_des); + break; + } + if ( (archive_format == arf_binary || archive_format == arf_hpbinary) + && (magic.num == 070707 + || magic.num == swab_short ((unsigned short) 070707))) + { + /* Having to skip 1 byte because of word alignment is normal. */ + if (bytes_skipped > 0) + warn_junk_bytes (bytes_skipped); + file_hdr->c_magic = 070707; + read_in_binary (file_hdr, &magic.old_header, in_des); + break; + } + bytes_skipped++; + memmove (magic.str, magic.str + 1, 5); + tape_buffered_read (magic.str, in_des, 1L); + } +} + +/* Fill in FILE_HDR by reading an old-format ASCII format cpio header from + file descriptor IN_DES, except for the magic number, which is + already filled in. */ + +void +read_in_old_ascii (struct cpio_file_stat *file_hdr, int in_des) +{ + struct old_ascii_header ascii_header; + unsigned long dev; + + tape_buffered_read (ascii_header.c_dev, in_des, + sizeof ascii_header - sizeof ascii_header.c_magic); + dev = FROM_OCTAL (ascii_header.c_dev); + file_hdr->c_dev_maj = major (dev); + file_hdr->c_dev_min = minor (dev); + + file_hdr->c_ino = FROM_OCTAL (ascii_header.c_ino); + file_hdr->c_mode = FROM_OCTAL (ascii_header.c_mode); + file_hdr->c_uid = FROM_OCTAL (ascii_header.c_uid); + file_hdr->c_gid = FROM_OCTAL (ascii_header.c_gid); + file_hdr->c_nlink = FROM_OCTAL (ascii_header.c_nlink); + dev = FROM_OCTAL (ascii_header.c_rdev); + file_hdr->c_rdev_maj = major (dev); + file_hdr->c_rdev_min = minor (dev); + + file_hdr->c_mtime = FROM_OCTAL (ascii_header.c_mtime); + file_hdr->c_namesize = FROM_OCTAL (ascii_header.c_namesize); + file_hdr->c_filesize = FROM_OCTAL (ascii_header.c_filesize); + + /* Read file name from input. */ + if (file_hdr->c_name != NULL) + free (file_hdr->c_name); + file_hdr->c_name = (char *) xmalloc (file_hdr->c_namesize + 1); + tape_buffered_read (file_hdr->c_name, in_des, (long) file_hdr->c_namesize); + + /* HP/UX cpio creates archives that look just like ordinary archives, + but for devices it sets major = 0, minor = 1, and puts the + actual major/minor number in the filesize field. See if this + is an HP/UX cpio archive, and if so fix it. We have to do this + here because process_copy_in() assumes filesize is always 0 + for devices. */ + switch (file_hdr->c_mode & CP_IFMT) + { + case CP_IFCHR: + case CP_IFBLK: +#ifdef CP_IFSOCK + case CP_IFSOCK: +#endif +#ifdef CP_IFIFO + case CP_IFIFO: +#endif + if (file_hdr->c_filesize != 0 + && file_hdr->c_rdev_maj == 0 + && file_hdr->c_rdev_min == 1) + { + file_hdr->c_rdev_maj = major (file_hdr->c_filesize); + file_hdr->c_rdev_min = minor (file_hdr->c_filesize); + file_hdr->c_filesize = 0; + } + break; + default: + break; + } +} + +/* Fill in FILE_HDR by reading a new-format ASCII format cpio header from + file descriptor IN_DES, except for the magic number, which is + already filled in. */ + +void +read_in_new_ascii (struct cpio_file_stat *file_hdr, int in_des) +{ + struct new_ascii_header ascii_header; + + tape_buffered_read (ascii_header.c_ino, in_des, + sizeof ascii_header - sizeof ascii_header.c_magic); + + file_hdr->c_ino = FROM_HEX (ascii_header.c_ino); + file_hdr->c_mode = FROM_HEX (ascii_header.c_mode); + file_hdr->c_uid = FROM_HEX (ascii_header.c_uid); + file_hdr->c_gid = FROM_HEX (ascii_header.c_gid); + file_hdr->c_nlink = FROM_HEX (ascii_header.c_nlink); + file_hdr->c_mtime = FROM_HEX (ascii_header.c_mtime); + file_hdr->c_filesize = FROM_HEX (ascii_header.c_filesize); + file_hdr->c_dev_maj = FROM_HEX (ascii_header.c_dev_maj); + file_hdr->c_dev_min = FROM_HEX (ascii_header.c_dev_min); + file_hdr->c_rdev_maj = FROM_HEX (ascii_header.c_rdev_maj); + file_hdr->c_rdev_min = FROM_HEX (ascii_header.c_rdev_min); + file_hdr->c_namesize = FROM_HEX (ascii_header.c_namesize); + file_hdr->c_chksum = FROM_HEX (ascii_header.c_chksum); + + /* Read file name from input. */ + if (file_hdr->c_name != NULL) + free (file_hdr->c_name); + file_hdr->c_name = (char *) xmalloc (file_hdr->c_namesize); + tape_buffered_read (file_hdr->c_name, in_des, (long) file_hdr->c_namesize); + + /* In SVR4 ASCII format, the amount of space allocated for the header + is rounded up to the next long-word, so we might need to drop + 1-3 bytes. */ + tape_skip_padding (in_des, file_hdr->c_namesize + 110); +} + +/* Fill in FILE_HDR by reading a binary format cpio header from + file descriptor IN_DES, except for the first 6 bytes (the magic + number, device, and inode number), which are already filled in. */ + +void +read_in_binary (struct cpio_file_stat *file_hdr, + struct old_cpio_header *short_hdr, + int in_des) +{ + file_hdr->c_magic = short_hdr->c_magic; + + tape_buffered_read (((char *) short_hdr) + 6, in_des, + sizeof *short_hdr - 6 /* = 20 */); + + /* If the magic number is byte swapped, fix the header. */ + if (file_hdr->c_magic == swab_short ((unsigned short) 070707)) + { + static int warned = 0; + + /* Alert the user that they might have to do byte swapping on + the file contents. */ + if (warned == 0) + { + error (0, 0, _("warning: archive header has reverse byte-order")); + warned = 1; + } + swab_array ((char *) &short_hdr, 13); + } + + file_hdr->c_dev_maj = major (short_hdr->c_dev); + file_hdr->c_dev_min = minor (short_hdr->c_dev); + file_hdr->c_ino = short_hdr->c_ino; + file_hdr->c_mode = short_hdr->c_mode; + file_hdr->c_uid = short_hdr->c_uid; + file_hdr->c_gid = short_hdr->c_gid; + file_hdr->c_nlink = short_hdr->c_nlink; + file_hdr->c_rdev_maj = major (short_hdr->c_rdev); + file_hdr->c_rdev_min = minor (short_hdr->c_rdev); + file_hdr->c_mtime = (unsigned long) short_hdr->c_mtimes[0] << 16 + | short_hdr->c_mtimes[1]; + + file_hdr->c_namesize = short_hdr->c_namesize; + file_hdr->c_filesize = (unsigned long) short_hdr->c_filesizes[0] << 16 + | short_hdr->c_filesizes[1]; + + /* Read file name from input. */ + if (file_hdr->c_name != NULL) + free (file_hdr->c_name); + file_hdr->c_name = (char *) xmalloc (file_hdr->c_namesize); + tape_buffered_read (file_hdr->c_name, in_des, (long) file_hdr->c_namesize); + + /* In binary mode, the amount of space allocated in the header for + the filename is `c_namesize' rounded up to the next short-word, + so we might need to drop a byte. */ + if (file_hdr->c_namesize % 2) + tape_toss_input (in_des, 1L); + + /* HP/UX cpio creates archives that look just like ordinary archives, + but for devices it sets major = 0, minor = 1, and puts the + actual major/minor number in the filesize field. See if this + is an HP/UX cpio archive, and if so fix it. We have to do this + here because process_copy_in() assumes filesize is always 0 + for devices. */ + switch (file_hdr->c_mode & CP_IFMT) + { + case CP_IFCHR: + case CP_IFBLK: +#ifdef CP_IFSOCK + case CP_IFSOCK: +#endif +#ifdef CP_IFIFO + case CP_IFIFO: +#endif + if (file_hdr->c_filesize != 0 + && file_hdr->c_rdev_maj == 0 + && file_hdr->c_rdev_min == 1) + { + file_hdr->c_rdev_maj = major (file_hdr->c_filesize); + file_hdr->c_rdev_min = minor (file_hdr->c_filesize); + file_hdr->c_filesize = 0; + } + break; + default: + break; + } +} + +/* Exchange the bytes of each element of the array of COUNT shorts + starting at PTR. */ + +void +swab_array (char *ptr, int count) +{ + char tmp; + + while (count-- > 0) + { + tmp = *ptr; + *ptr = *(ptr + 1); + ++ptr; + *ptr = tmp; + ++ptr; + } +} + +/* Read the collection from standard input and create files + in the file system. */ + +void +process_copy_in () +{ + char done = false; /* True if trailer reached. */ + FILE *tty_in = NULL; /* Interactive file for rename option. */ + FILE *tty_out = NULL; /* Interactive file for rename option. */ + FILE *rename_in = NULL; /* Batch file for rename option. */ + struct stat file_stat; /* Output file stat record. */ + struct cpio_file_stat file_hdr; /* Output header information. */ + int in_file_des; /* Input file descriptor. */ + char skip_file; /* Flag for use with patterns. */ + int i; /* Loop index variable. */ + + umask (0); /* Reset umask to preserve modes of + created files */ + + /* Initialize the copy in. */ + if (pattern_file_name) + { + read_pattern_file (); + } + file_hdr.c_name = NULL; + + if (rename_batch_file) + { + rename_in = fopen (rename_batch_file, "r"); + if (rename_in == NULL) + { + error (2, errno, TTY_NAME); + } + } + else if (rename_flag) + { + /* Open interactive file pair for rename operation. */ + tty_in = fopen (TTY_NAME, "r"); + if (tty_in == NULL) + { + error (2, errno, TTY_NAME); + } + tty_out = fopen (TTY_NAME, "w"); + if (tty_out == NULL) + { + error (2, errno, TTY_NAME); + } + } + + /* Get date and time if needed for processing the table option. */ + if (table_flag && verbose_flag) + { + time (¤t_time); + } + + /* Check whether the input file might be a tape. */ + in_file_des = archive_des; + if (_isrmt (in_file_des)) + { + input_is_special = 1; + input_is_seekable = 0; + } + else + { + if (fstat (in_file_des, &file_stat)) + error (1, errno, _("standard input is closed")); + input_is_special = +#ifdef S_ISBLK + S_ISBLK (file_stat.st_mode) || +#endif + S_ISCHR (file_stat.st_mode); + input_is_seekable = S_ISREG (file_stat.st_mode); + } + output_is_seekable = true; + + /* While there is more input in the collection, process the input. */ + while (!done) + { + swapping_halfwords = swapping_bytes = false; + + /* Start processing the next file by reading the header. */ + read_in_header (&file_hdr, in_file_des); + +#ifdef DEBUG_CPIO + if (debug_flag) + { + struct cpio_file_stat *h; + h = &file_hdr; + fprintf (stderr, + "magic = 0%o, ino = %d, mode = 0%o, uid = %d, gid = %d\n", + h->c_magic, h->c_ino, h->c_mode, h->c_uid, h->c_gid); + fprintf (stderr, + "nlink = %d, mtime = %d, filesize = %d, dev_maj = 0x%x\n", + h->c_nlink, h->c_mtime, h->c_filesize, h->c_dev_maj); + fprintf (stderr, + "dev_min = 0x%x, rdev_maj = 0x%x, rdev_min = 0x%x, namesize = %d\n", + h->c_dev_min, h->c_rdev_maj, h->c_rdev_min, h->c_namesize); + fprintf (stderr, + "chksum = %d, name = \"%s\", tar_linkname = \"%s\"\n", + h->c_chksum, h->c_name, + h->c_tar_linkname ? h->c_tar_linkname : "(null)" ); + + } +#endif + /* Is this the header for the TRAILER file? */ + if (strcmp (CPIO_TRAILER_NAME, file_hdr.c_name) == 0) + { + done = true; + break; + } + + cpio_safer_name_suffix (file_hdr.c_name, false, !no_abs_paths_flag, + false); + + /* Does the file name match one of the given patterns? */ + if (num_patterns <= 0) + skip_file = false; + else + { + skip_file = copy_matching_files; + for (i = 0; i < num_patterns + && skip_file == copy_matching_files; i++) + { + if (fnmatch (save_patterns[i], file_hdr.c_name, 0) == 0) + skip_file = !copy_matching_files; + } + } + + if (skip_file) + { + /* If we're skipping a file with links, there might be other + links that we didn't skip, and this file might have the + data for the links. If it does, we'll copy in the data + to the links, but not to this file. */ + if (file_hdr.c_nlink > 1 && (archive_format == arf_newascii + || archive_format == arf_crcascii) ) + { + if (create_defered_links_to_skipped(&file_hdr, in_file_des) < 0) + { + tape_toss_input (in_file_des, file_hdr.c_filesize); + tape_skip_padding (in_file_des, file_hdr.c_filesize); + } + } + else + { + tape_toss_input (in_file_des, file_hdr.c_filesize); + tape_skip_padding (in_file_des, file_hdr.c_filesize); + } + } + else if (table_flag) + { + list_file(&file_hdr, in_file_des); + } + else if (append_flag) + { + tape_toss_input (in_file_des, file_hdr.c_filesize); + tape_skip_padding (in_file_des, file_hdr.c_filesize); + } + else if (only_verify_crc_flag) + { +#ifdef CP_IFLNK + if ((file_hdr.c_mode & CP_IFMT) == CP_IFLNK) + { + if (archive_format != arf_tar && archive_format != arf_ustar) + { + tape_toss_input (in_file_des, file_hdr.c_filesize); + tape_skip_padding (in_file_des, file_hdr.c_filesize); + continue; + } + } +#endif + crc = 0; + tape_toss_input (in_file_des, file_hdr.c_filesize); + tape_skip_padding (in_file_des, file_hdr.c_filesize); + if (crc != file_hdr.c_chksum) + { + error (0, 0, _("%s: checksum error (0x%lx, should be 0x%lx)"), + file_hdr.c_name, crc, file_hdr.c_chksum); + } + /* Debian hack: -v and -V now work with --only-verify-crc. + (99/11/10) -BEM */ + if (verbose_flag) + { + fprintf (stderr, "%s\n", file_hdr.c_name); + } + if (dot_flag) + { + fputc ('.', stderr); + } + } + else + { + /* Copy the input file into the directory structure. */ + + /* Do we need to rename the file? */ + if (rename_flag || rename_batch_file) + { + if (query_rename(&file_hdr, tty_in, tty_out, rename_in) < 0) + { + tape_toss_input (in_file_des, file_hdr.c_filesize); + tape_skip_padding (in_file_des, file_hdr.c_filesize); + continue; + } + } + + copyin_file(&file_hdr, in_file_des); + + if (verbose_flag) + fprintf (stderr, "%s\n", file_hdr.c_name); + if (dot_flag) + fputc ('.', stderr); + } + } + + if (dot_flag) + fputc ('\n', stderr); + + if (append_flag) + return; + + if (archive_format == arf_newascii || archive_format == arf_crcascii) + { + create_final_defers (); + } + if (!quiet_flag) + { + int blocks; + blocks = (input_bytes + io_block_size - 1) / io_block_size; + fprintf (stderr, ngettext ("%d block\n", "%d blocks\n", blocks), blocks); + } +} + diff --git a/src/copyout.c b/src/copyout.c new file mode 100644 index 0000000..0ab294e --- /dev/null +++ b/src/copyout.c @@ -0,0 +1,897 @@ +/* copyout.c - create a cpio archive + Copyright (C) 1990, 1991, 1992, 2001, 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. */ + +#include + +#include +#include +#include +#include "filetypes.h" +#include "cpiohdr.h" +#include "dstring.h" +#include "extern.h" +#include "defer.h" +#include +#include + +/* Read FILE_SIZE bytes of FILE_NAME from IN_FILE_DES and + compute and return a checksum for them. */ + +static unsigned int +read_for_checksum (int in_file_des, int file_size, char *file_name) +{ + unsigned int crc; + char buf[BUFSIZ]; + int bytes_left; + int bytes_read; + int i; + + crc = 0; + + for (bytes_left = file_size; bytes_left > 0; bytes_left -= bytes_read) + { + bytes_read = read (in_file_des, buf, BUFSIZ); + if (bytes_read < 0) + error (1, errno, _("cannot read checksum for %s"), file_name); + if (bytes_read == 0) + break; + if (bytes_left < bytes_read) + bytes_read = bytes_left; + for (i = 0; i < bytes_read; ++i) + crc += buf[i] & 0xff; + } + if (lseek (in_file_des, 0L, SEEK_SET)) + error (1, errno, _("cannot read checksum for %s"), file_name); + + return crc; +} + +/* Write out NULs to fill out the rest of the current block on + OUT_FILE_DES. */ + +static void +tape_clear_rest_of_block (int out_file_des) +{ + write_nuls_to_file (io_block_size - output_size, out_file_des, + tape_buffered_write); +} + +/* Write NULs on OUT_FILE_DES to move from OFFSET (the current location) + to the end of the header. */ + +static void +tape_pad_output (int out_file_des, int offset) +{ + size_t pad; + + if (archive_format == arf_newascii || archive_format == arf_crcascii) + pad = (4 - (offset % 4)) % 4; + else if (archive_format == arf_tar || archive_format == arf_ustar) + pad = (512 - (offset % 512)) % 512; + else if (archive_format != arf_oldascii && archive_format != arf_hpoldascii) + pad = (2 - (offset % 2)) % 2; + else + pad = 0; + + if (pad != 0) + write_nuls_to_file (pad, out_file_des, tape_buffered_write); +} + + +/* When creating newc and crc archives if a file has multiple (hard) + links, we don't put any of them into the archive until we have seen + all of them (or until we get to the end of the list of files that + are going into the archive and know that we have seen all of the links + to the file that we will see). We keep these "defered" files on + this list. */ + +struct deferment *deferouts = NULL; + +/* Count the number of other (hard) links to this file that have + already been defered. */ + +static int +count_defered_links_to_dev_ino (struct cpio_file_stat *file_hdr) +{ + struct deferment *d; + int ino; + int maj; + int min; + int count; + ino = file_hdr->c_ino; + maj = file_hdr->c_dev_maj; + min = file_hdr->c_dev_min; + count = 0; + for (d = deferouts; d != NULL; d = d->next) + { + if ( (d->header.c_ino == ino) && (d->header.c_dev_maj == maj) + && (d->header.c_dev_min == min) ) + ++count; + } + return count; +} + +/* Is this file_hdr the last (hard) link to a file? I.e., have + we already seen and defered all of the other links? */ + +static int +last_link (struct cpio_file_stat *file_hdr) +{ + int other_files_sofar; + + other_files_sofar = count_defered_links_to_dev_ino (file_hdr); + if (file_hdr->c_nlink == (other_files_sofar + 1) ) + { + return 1; + } + return 0; +} + + +/* Add the file header for a link that is being defered to the deferouts + list. */ + +static void +add_link_defer (struct cpio_file_stat *file_hdr) +{ + struct deferment *d; + d = create_deferment (file_hdr); + d->next = deferouts; + deferouts = d; +} + +/* We are about to put a file into a newc or crc archive that is + multiply linked. We have already seen and deferred all of the + other links to the file but haven't written them into the archive. + Write the other links into the archive, and remove them from the + deferouts list. */ + +static void +writeout_other_defers (struct cpio_file_stat *file_hdr, int out_des) +{ + struct deferment *d; + struct deferment *d_prev; + int ino; + int maj; + int min; + ino = file_hdr->c_ino; + maj = file_hdr->c_dev_maj; + min = file_hdr->c_dev_min; + d_prev = NULL; + d = deferouts; + while (d != NULL) + { + if ( (d->header.c_ino == ino) && (d->header.c_dev_maj == maj) + && (d->header.c_dev_min == min) ) + { + struct deferment *d_free; + d->header.c_filesize = 0; + write_out_header (&d->header, out_des); + if (d_prev != NULL) + d_prev->next = d->next; + else + deferouts = d->next; + d_free = d; + d = d->next; + free_deferment (d_free); + } + else + { + d_prev = d; + d = d->next; + } + } + return; +} + +/* Write a file into the archive. This code is the same as + the code in process_copy_out(), but we need it here too + for writeout_final_defers() to call. */ + +static void +writeout_defered_file (struct cpio_file_stat *header, int out_file_des) +{ + int in_file_des; + struct cpio_file_stat file_hdr; + + file_hdr = *header; + + + in_file_des = open (header->c_name, + O_RDONLY | O_BINARY, 0); + if (in_file_des < 0) + { + open_error (header->c_name); + return; + } + + if (archive_format == arf_crcascii) + file_hdr.c_chksum = read_for_checksum (in_file_des, + file_hdr.c_filesize, + header->c_name); + + if (write_out_header (&file_hdr, out_file_des)) + return; + copy_files_disk_to_tape (in_file_des, out_file_des, file_hdr.c_filesize, + header->c_name); + warn_if_file_changed(header->c_name, file_hdr.c_filesize, file_hdr.c_mtime); + + if (archive_format == arf_tar || archive_format == arf_ustar) + add_inode (file_hdr.c_ino, file_hdr.c_name, file_hdr.c_dev_maj, + file_hdr.c_dev_min); + + tape_pad_output (out_file_des, file_hdr.c_filesize); + + if (reset_time_flag) + set_file_times (in_file_des, file_hdr.c_name, file_hdr.c_mtime, + file_hdr.c_mtime); + if (close (in_file_des) < 0) + close_error (header->c_name); +} + +/* When writing newc and crc format archives we defer multiply linked + files until we have seen all of the links to the file. If a file + has links to it that aren't going into the archive, then we will + never see the "last" link to the file, so at the end we just write + all of the leftover defered files into the archive. */ + +static void +writeout_final_defers (int out_des) +{ + struct deferment *d; + int other_count; + while (deferouts != NULL) + { + d = deferouts; + other_count = count_defered_links_to_dev_ino (&d->header); + if (other_count == 1) + { + writeout_defered_file (&d->header, out_des); + } + else + { + struct cpio_file_stat file_hdr; + file_hdr = d->header; + file_hdr.c_filesize = 0; + write_out_header (&file_hdr, out_des); + } + deferouts = deferouts->next; + } +} + +/* FIXME: to_ascii could be used instead of to_oct() and to_octal() from tar, + so it should be moved to paxutils too. + Allowed values for logbase are: 1 (binary), 2, 3 (octal), 4 (hex) */ +int +to_ascii (char *where, uintmax_t v, size_t digits, unsigned logbase) +{ + static char codetab[] = "0123456789ABCDEF"; + int i = digits; + + do + { + where[--i] = codetab[(v & ((1 << logbase) - 1))]; + v >>= logbase; + } + while (i); + + return v != 0; +} + +static void +field_width_error (const char *filename, const char *fieldname) +{ + error (0, 0, _("%s: field width not sufficient for storing %s"), + filename, fieldname); +} + +static void +field_width_warning (const char *filename, const char *fieldname) +{ + if (warn_option & CPIO_WARN_TRUNCATE) + error (0, 0, _("%s: truncating %s"), filename, fieldname); +} + +void +to_ascii_or_warn (char *where, uintmax_t n, size_t digits, + unsigned logbase, + const char *filename, const char *fieldname) +{ + if (to_ascii (where, n, digits, logbase)) + field_width_warning (filename, fieldname); +} + +int +to_ascii_or_error (char *where, uintmax_t n, size_t digits, + unsigned logbase, + const char *filename, const char *fieldname) +{ + if (to_ascii (where, n, digits, logbase)) + { + field_width_error (filename, fieldname); + return 1; + } + return 0; +} + + +int +write_out_new_ascii_header (const char *magic_string, + struct cpio_file_stat *file_hdr, int out_des) +{ + char ascii_header[110]; + char *p; + + p = stpcpy (ascii_header, magic_string); + to_ascii_or_warn (p, file_hdr->c_ino, 8, LG_16, + file_hdr->c_name, _("inode number")); + p += 8; + to_ascii_or_warn (p, file_hdr->c_mode, 8, LG_16, file_hdr->c_name, + _("file mode")); + p += 8; + to_ascii_or_warn (p, file_hdr->c_uid, 8, LG_16, file_hdr->c_name, + _("uid")); + p += 8; + to_ascii_or_warn (p, file_hdr->c_gid, 8, LG_16, file_hdr->c_name, + _("gid")); + p += 8; + to_ascii_or_warn (p, file_hdr->c_nlink, 8, LG_16, file_hdr->c_name, + _("number of links")); + p += 8; + to_ascii_or_warn (p, file_hdr->c_mtime, 8, LG_16, file_hdr->c_name, + _("modification time")); + p += 8; + if (to_ascii_or_error (p, file_hdr->c_filesize, 8, LG_16, file_hdr->c_name, + _("file size"))) + return 1; + p += 8; + if (to_ascii_or_error (p, file_hdr->c_dev_maj, 8, LG_16, file_hdr->c_name, + _("device major number"))) + return 1; + p += 8; + if (to_ascii_or_error (p, file_hdr->c_dev_min, 8, LG_16, file_hdr->c_name, + _("device minor number"))) + return 1; + p += 8; + if (to_ascii_or_error (p, file_hdr->c_rdev_maj, 8, LG_16, file_hdr->c_name, + _("rdev major"))) + return 1; + p += 8; + if (to_ascii_or_error (p, file_hdr->c_rdev_min, 8, LG_16, file_hdr->c_name, + _("rdev minor"))) + return 1; + p += 8; + if (to_ascii_or_error (p, file_hdr->c_namesize, 8, LG_16, file_hdr->c_name, + _("name size"))) + return 1; + p += 8; + to_ascii (p, file_hdr->c_chksum & 0xffffffff, 8, LG_16); + + tape_buffered_write (ascii_header, out_des, sizeof ascii_header); + + /* Write file name to output. */ + tape_buffered_write (file_hdr->c_name, out_des, (long) file_hdr->c_namesize); + tape_pad_output (out_des, file_hdr->c_namesize + sizeof ascii_header); + return 0; +} + +int +write_out_old_ascii_header (dev_t dev, dev_t rdev, + struct cpio_file_stat *file_hdr, int out_des) +{ + char ascii_header[76]; + char *p = ascii_header; + + to_ascii (p, file_hdr->c_magic, 6, LG_8); + p += 6; + to_ascii_or_warn (p, dev, 6, LG_8, file_hdr->c_name, _("device number")); + p += 6; + to_ascii_or_warn (p, file_hdr->c_ino, 6, LG_8, file_hdr->c_name, + _("inode number")); + p += 6; + to_ascii_or_warn (p, file_hdr->c_mode, 6, LG_8, file_hdr->c_name, + _("file mode")); + p += 6; + to_ascii_or_warn (p, file_hdr->c_uid, 6, LG_8, file_hdr->c_name, _("uid")); + p += 6; + to_ascii_or_warn (p, file_hdr->c_gid, 6, LG_8, file_hdr->c_name, _("gid")); + p += 6; + to_ascii_or_warn (p, file_hdr->c_nlink, 6, LG_8, file_hdr->c_name, + _("number of links")); + p += 6; + to_ascii_or_warn (p, rdev, 6, LG_8, file_hdr->c_name, _("rdev")); + p += 6; + to_ascii_or_warn (p, file_hdr->c_mtime, 11, LG_8, file_hdr->c_name, + _("modification time")); + p += 11; + if (to_ascii_or_error (p, file_hdr->c_namesize, 6, LG_8, file_hdr->c_name, + _("name size"))) + return 1; + p += 6; + if (to_ascii_or_error (p, file_hdr->c_filesize, 11, LG_8, file_hdr->c_name, + _("file size"))) + return 1; + + tape_buffered_write (ascii_header, out_des, sizeof ascii_header); + + /* Write file name to output. */ + tape_buffered_write (file_hdr->c_name, out_des, file_hdr->c_namesize); + return 0; +} + +void +hp_compute_dev (struct cpio_file_stat *file_hdr, dev_t *pdev, dev_t *prdev) +{ + /* HP/UX cpio creates archives that look just like ordinary archives, + but for devices it sets major = 0, minor = 1, and puts the + actual major/minor number in the filesize field. */ + switch (file_hdr->c_mode & CP_IFMT) + { + case CP_IFCHR: + case CP_IFBLK: +#ifdef CP_IFSOCK + case CP_IFSOCK: +#endif +#ifdef CP_IFIFO + case CP_IFIFO: +#endif + file_hdr->c_filesize = makedev (file_hdr->c_rdev_maj, + file_hdr->c_rdev_min); + *pdev = *prdev = makedev (0, 1); + break; + + default: + *pdev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min); + *prdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min); + break; + } +} + +int +write_out_binary_header (dev_t rdev, + struct cpio_file_stat *file_hdr, int out_des) +{ + struct old_cpio_header short_hdr; + + short_hdr.c_magic = 070707; + short_hdr.c_dev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min); + + if ((warn_option & CPIO_WARN_TRUNCATE) && (file_hdr->c_ino >> 16) != 0) + error (0, 0, _("%s: truncating inode number"), file_hdr->c_name); + + short_hdr.c_ino = file_hdr->c_ino & 0xFFFF; + if (short_hdr.c_ino != file_hdr->c_ino) + field_width_warning (file_hdr->c_name, _("inode number")); + + short_hdr.c_mode = file_hdr->c_mode & 0xFFFF; + if (short_hdr.c_mode != file_hdr->c_mode) + field_width_warning (file_hdr->c_name, _("file mode")); + + short_hdr.c_uid = file_hdr->c_uid & 0xFFFF; + if (short_hdr.c_uid != file_hdr->c_uid) + field_width_warning (file_hdr->c_name, _("uid")); + + short_hdr.c_gid = file_hdr->c_gid & 0xFFFF; + if (short_hdr.c_gid != file_hdr->c_gid) + field_width_warning (file_hdr->c_name, _("gid")); + + short_hdr.c_nlink = file_hdr->c_nlink & 0xFFFF; + if (short_hdr.c_nlink != file_hdr->c_nlink) + field_width_warning (file_hdr->c_name, _("number of links")); + + short_hdr.c_rdev = rdev; + short_hdr.c_mtimes[0] = file_hdr->c_mtime >> 16; + short_hdr.c_mtimes[1] = file_hdr->c_mtime & 0xFFFF; + + short_hdr.c_namesize = file_hdr->c_namesize & 0xFFFF; + if (short_hdr.c_namesize != file_hdr->c_namesize) + { + field_width_error (file_hdr->c_name, _("name size")); + return 1; + } + + short_hdr.c_filesizes[0] = file_hdr->c_filesize >> 16; + short_hdr.c_filesizes[1] = file_hdr->c_filesize & 0xFFFF; + + if (((off_t)short_hdr.c_filesizes[0] << 16) + short_hdr.c_filesizes[1] + != file_hdr->c_filesize) + { + field_width_error (file_hdr->c_name, _("file size")); + return 1; + } + + /* Output the file header. */ + tape_buffered_write ((char *) &short_hdr, out_des, 26); + + /* Write file name to output. */ + tape_buffered_write (file_hdr->c_name, out_des, file_hdr->c_namesize); + + tape_pad_output (out_des, file_hdr->c_namesize + 26); + return 0; +} + + +/* Write out header FILE_HDR, including the file name, to file + descriptor OUT_DES. */ + +int +write_out_header (struct cpio_file_stat *file_hdr, int out_des) +{ + dev_t dev; + dev_t rdev; + + switch (archive_format) + { + case arf_newascii: + return write_out_new_ascii_header ("070701", file_hdr, out_des); + + case arf_crcascii: + return write_out_new_ascii_header ("070702", file_hdr, out_des); + + case arf_oldascii: + return write_out_old_ascii_header (makedev (file_hdr->c_dev_maj, + file_hdr->c_dev_min), + makedev (file_hdr->c_rdev_maj, + file_hdr->c_rdev_min), + file_hdr, out_des); + + case arf_hpoldascii: + hp_compute_dev (file_hdr, &dev, &rdev); + return write_out_old_ascii_header (dev, rdev, file_hdr, out_des); + + case arf_tar: + case arf_ustar: + if (is_tar_filename_too_long (file_hdr->c_name)) + { + error (0, 0, _("%s: file name too long"), file_hdr->c_name); + return 1; + } + write_out_tar_header (file_hdr, out_des); /* FIXME: No error checking */ + return 0; + + case arf_binary: + return write_out_binary_header (makedev (file_hdr->c_rdev_maj, + file_hdr->c_rdev_min), + file_hdr, out_des); + + case arf_hpbinary: + hp_compute_dev (file_hdr, &dev, &rdev); + /* FIXME: dev ignored. Should it be? */ + return write_out_binary_header (rdev, file_hdr, out_des); + + default: + abort (); + } +} + +static void +assign_string (char **pvar, char *value) +{ + char *p = xrealloc (*pvar, strlen (value) + 1); + strcpy (p, value); + *pvar = p; +} + +/* Read a list of file names from the standard input + and write a cpio collection on the standard output. + The format of the header depends on the compatibility (-c) flag. */ + +void +process_copy_out () +{ + int res; /* Result of functions. */ + dynamic_string input_name; /* Name of file read from stdin. */ + struct stat file_stat; /* Stat record for file. */ + struct cpio_file_stat file_hdr; /* Output header information. */ + int in_file_des; /* Source file descriptor. */ + int out_file_des; /* Output file descriptor. */ + char *orig_file_name = NULL; + + /* Initialize the copy out. */ + ds_init (&input_name, 128); + file_hdr.c_magic = 070707; + + /* Check whether the output file might be a tape. */ + out_file_des = archive_des; + if (_isrmt (out_file_des)) + { + output_is_special = 1; + output_is_seekable = 0; + } + else + { + if (fstat (out_file_des, &file_stat)) + error (1, errno, _("standard output is closed")); + output_is_special = +#ifdef S_ISBLK + S_ISBLK (file_stat.st_mode) || +#endif + S_ISCHR (file_stat.st_mode); + output_is_seekable = S_ISREG (file_stat.st_mode); + } + + if (append_flag) + { + process_copy_in (); + prepare_append (out_file_des); + } + + /* Copy files with names read from stdin. */ + while (ds_fgetstr (stdin, &input_name, name_end) != NULL) + { + /* Check for blank line. */ + if (input_name.ds_string[0] == 0) + { + error (0, 0, _("blank line ignored")); + continue; + } + + /* Process next file. */ + if ((*xstat) (input_name.ds_string, &file_stat) < 0) + stat_error (input_name.ds_string); + else + { + /* Set values in output header. */ + stat_to_cpio (&file_hdr, &file_stat); + + if (archive_format == arf_tar || archive_format == arf_ustar) + { + if (file_hdr.c_mode & CP_IFDIR) + { + int len = strlen (input_name.ds_string); + /* Make sure the name ends with a slash */ + if (input_name.ds_string[len-1] != '/') + { + ds_resize (&input_name, len + 2); + input_name.ds_string[len] = '/'; + input_name.ds_string[len+1] = 0; + } + } + } + + assign_string (&orig_file_name, input_name.ds_string); + cpio_safer_name_suffix (input_name.ds_string, false, + !no_abs_paths_flag, true); +#ifndef HPUX_CDF + file_hdr.c_name = input_name.ds_string; + file_hdr.c_namesize = strlen (input_name.ds_string) + 1; +#else + if ( (archive_format != arf_tar) && (archive_format != arf_ustar) ) + { + /* We mark CDF's in cpio files by adding a 2nd `/' after the + "hidden" directory name. We need to do this so we can + properly recreate the directory as hidden (in case the + files of a directory go into the archive before the + directory itself (e.g from "find ... -depth ... | cpio")). */ + file_hdr.c_name = add_cdf_double_slashes (input_name.ds_string); + file_hdr.c_namesize = strlen (file_hdr.c_name) + 1; + } + else + { + /* We don't mark CDF's in tar files. We assume the "hidden" + directory will always go into the archive before any of + its files. */ + file_hdr.c_name = input_name.ds_string; + file_hdr.c_namesize = strlen (input_name.ds_string) + 1; + } +#endif + + /* Copy the named file to the output. */ + switch (file_hdr.c_mode & CP_IFMT) + { + case CP_IFREG: + if (archive_format == arf_tar || archive_format == arf_ustar) + { + char *otherfile; + if ((otherfile = find_inode_file (file_hdr.c_ino, + file_hdr.c_dev_maj, + file_hdr.c_dev_min))) + { + file_hdr.c_tar_linkname = otherfile; + if (write_out_header (&file_hdr, out_file_des)) + continue; + break; + } + } + if ( (archive_format == arf_newascii || archive_format == arf_crcascii) + && (file_hdr.c_nlink > 1) ) + { + if (last_link (&file_hdr) ) + { + writeout_other_defers (&file_hdr, out_file_des); + } + else + { + add_link_defer (&file_hdr); + break; + } + } + in_file_des = open (orig_file_name, + O_RDONLY | O_BINARY, 0); + if (in_file_des < 0) + { + open_error (orig_file_name); + continue; + } + + if (archive_format == arf_crcascii) + file_hdr.c_chksum = read_for_checksum (in_file_des, + file_hdr.c_filesize, + orig_file_name); + + if (write_out_header (&file_hdr, out_file_des)) + continue; + copy_files_disk_to_tape (in_file_des, + out_file_des, file_hdr.c_filesize, + orig_file_name); + warn_if_file_changed(orig_file_name, file_hdr.c_filesize, + file_hdr.c_mtime); + + if (archive_format == arf_tar || archive_format == arf_ustar) + add_inode (file_hdr.c_ino, orig_file_name, file_hdr.c_dev_maj, + file_hdr.c_dev_min); + + tape_pad_output (out_file_des, file_hdr.c_filesize); + + if (reset_time_flag) + set_file_times (in_file_des, + orig_file_name, + file_stat.st_atime, file_stat.st_mtime); + if (close (in_file_des) < 0) + close_error (orig_file_name); + break; + + case CP_IFDIR: + file_hdr.c_filesize = 0; + if (write_out_header (&file_hdr, out_file_des)) + continue; + break; + + case CP_IFCHR: + case CP_IFBLK: +#ifdef CP_IFSOCK + case CP_IFSOCK: +#endif +#ifdef CP_IFIFO + case CP_IFIFO: +#endif + if (archive_format == arf_tar) + { + error (0, 0, _("%s not dumped: not a regular file"), + orig_file_name); + continue; + } + else if (archive_format == arf_ustar) + { + char *otherfile; + if ((otherfile = find_inode_file (file_hdr.c_ino, + file_hdr.c_dev_maj, + file_hdr.c_dev_min))) + { + /* This file is linked to another file already in the + archive, so write it out as a hard link. */ + file_hdr.c_mode = (file_stat.st_mode & 07777); + file_hdr.c_mode |= CP_IFREG; + file_hdr.c_tar_linkname = otherfile; + if (write_out_header (&file_hdr, out_file_des)) + continue; + break; + } + add_inode (file_hdr.c_ino, orig_file_name, + file_hdr.c_dev_maj, file_hdr.c_dev_min); + } + file_hdr.c_filesize = 0; + if (write_out_header (&file_hdr, out_file_des)) + continue; + break; + +#ifdef CP_IFLNK + case CP_IFLNK: + { + char *link_name = (char *) xmalloc (file_stat.st_size + 1); + int link_size; + + link_size = readlink (orig_file_name, link_name, + file_stat.st_size); + if (link_size < 0) + { + readlink_warn (orig_file_name); + free (link_name); + continue; + } + link_name[link_size] = 0; + cpio_safer_name_suffix (link_name, false, + !no_abs_paths_flag, true); + link_size = strlen (link_name); + file_hdr.c_filesize = link_size; + if (archive_format == arf_tar || archive_format == arf_ustar) + { + if (link_size + 1 > 100) + { + error (0, 0, _("%s: symbolic link too long"), + file_hdr.c_name); + } + else + { + link_name[link_size] = '\0'; + file_hdr.c_tar_linkname = link_name; + if (write_out_header (&file_hdr, out_file_des)) + continue; + } + } + else + { + if (write_out_header (&file_hdr, out_file_des)) + continue; + tape_buffered_write (link_name, out_file_des, link_size); + tape_pad_output (out_file_des, link_size); + } + free (link_name); + } + break; +#endif + + default: + error (0, 0, _("%s: unknown file type"), orig_file_name); + } + + if (verbose_flag) + fprintf (stderr, "%s\n", orig_file_name); + if (dot_flag) + fputc ('.', stderr); + } + } + + free (orig_file_name); + + writeout_final_defers(out_file_des); + /* The collection is complete; append the trailer. */ + file_hdr.c_ino = 0; + file_hdr.c_mode = 0; + file_hdr.c_uid = 0; + file_hdr.c_gid = 0; + file_hdr.c_nlink = 1; /* Must be 1 for crc format. */ + file_hdr.c_dev_maj = 0; + file_hdr.c_dev_min = 0; + file_hdr.c_rdev_maj = 0; + file_hdr.c_rdev_min = 0; + file_hdr.c_mtime = 0; + file_hdr.c_chksum = 0; + + file_hdr.c_filesize = 0; + file_hdr.c_namesize = 11; + file_hdr.c_name = CPIO_TRAILER_NAME; + if (archive_format != arf_tar && archive_format != arf_ustar) + write_out_header (&file_hdr, out_file_des); + else + write_nuls_to_file (1024, out_file_des, tape_buffered_write); + + /* Fill up the output block. */ + tape_clear_rest_of_block (out_file_des); + tape_empty_output_buffer (out_file_des); + if (dot_flag) + fputc ('\n', stderr); + if (!quiet_flag) + { + res = (output_bytes + io_block_size - 1) / io_block_size; + fprintf (stderr, ngettext ("%d block\n", "%d blocks\n", res), res); + } +} + + diff --git a/src/copypass.c b/src/copypass.c new file mode 100644 index 0000000..78576c6 --- /dev/null +++ b/src/copypass.c @@ -0,0 +1,431 @@ +/* copypass.c - cpio copy pass sub-function. + Copyright (C) 1990, 1991, 1992, 2001, 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. */ + +#include + +#include +#include +#include +#include "filetypes.h" +#include "cpiohdr.h" +#include "dstring.h" +#include "extern.h" +#include "paxlib.h" + +#ifndef HAVE_LCHOWN +# define lchown chown +#endif + + +/* A wrapper around set_perms using another set of arguments */ +static void +set_copypass_perms (int fd, const char *name, struct stat *st) +{ + struct cpio_file_stat header; + header.c_name = name; + stat_to_cpio (&header, st); + set_perms (fd, &header); +} + +/* Copy files listed on the standard input into directory `directory_name'. + If `link_flag', link instead of copying. */ + +void +process_copy_pass () +{ + dynamic_string input_name; /* Name of file from stdin. */ + dynamic_string output_name; /* Name of new file. */ + int dirname_len; /* Length of `directory_name'. */ + int res; /* Result of functions. */ + char *slash; /* For moving past slashes in input name. */ + struct stat in_file_stat; /* Stat record for input file. */ + struct stat out_file_stat; /* Stat record for output file. */ + int in_file_des; /* Input file descriptor. */ + int out_file_des; /* Output file descriptor. */ + int existing_dir; /* True if file is a dir & already exists. */ +#ifdef HPUX_CDF + int cdf_flag; + int cdf_char; +#endif + + umask (0); /* Reset umask to preserve modes of + created files */ + + /* Initialize the copy pass. */ + dirname_len = strlen (directory_name); + ds_init (&input_name, 128); + ds_init (&output_name, dirname_len + 2); + strcpy (output_name.ds_string, directory_name); + output_name.ds_string[dirname_len] = '/'; + output_is_seekable = true; + + /* Copy files with names read from stdin. */ + while (ds_fgetstr (stdin, &input_name, name_end) != NULL) + { + int link_res = -1; + + /* Check for blank line and ignore it if found. */ + if (input_name.ds_string[0] == '\0') + { + error (0, 0, _("blank line ignored")); + continue; + } + + /* Check for current directory and ignore it if found. */ + if (input_name.ds_string[0] == '.' + && (input_name.ds_string[1] == '\0' + || (input_name.ds_string[1] == '/' + && input_name.ds_string[2] == '\0'))) + continue; + + if ((*xstat) (input_name.ds_string, &in_file_stat) < 0) + { + stat_error (input_name.ds_string); + continue; + } + + /* Make the name of the new file. */ + for (slash = input_name.ds_string; *slash == '/'; ++slash) + ; +#ifdef HPUX_CDF + /* For CDF's we add a 2nd `/' after all "hidden" directories. + This kind of a kludge, but it's what we do when creating + archives, and it's easier to do this than to separately + keep track of which directories in a path are "hidden". */ + slash = add_cdf_double_slashes (slash); +#endif + ds_resize (&output_name, dirname_len + strlen (slash) + 2); + strcpy (output_name.ds_string + dirname_len + 1, slash); + + existing_dir = false; + if (lstat (output_name.ds_string, &out_file_stat) == 0) + { + if (S_ISDIR (out_file_stat.st_mode) + && S_ISDIR (in_file_stat.st_mode)) + { + /* If there is already a directory there that + we are trying to create, don't complain about it. */ + existing_dir = true; + } + else if (!unconditional_flag + && in_file_stat.st_mtime <= out_file_stat.st_mtime) + { + error (0, 0, _("%s not created: newer or same age version exists"), + output_name.ds_string); + continue; /* Go to the next file. */ + } + else if (S_ISDIR (out_file_stat.st_mode) + ? rmdir (output_name.ds_string) + : unlink (output_name.ds_string)) + { + error (0, errno, _("cannot remove current %s"), + output_name.ds_string); + continue; /* Go to the next file. */ + } + } + + /* Do the real copy or link. */ + if (S_ISREG (in_file_stat.st_mode)) + { + /* Can the current file be linked to a another file? + Set link_name to the original file name. */ + if (link_flag) + /* User said to link it if possible. Try and link to + the original copy. If that fails we'll still try + and link to a copy we've already made. */ + link_res = link_to_name (output_name.ds_string, + input_name.ds_string); + if ( (link_res < 0) && (in_file_stat.st_nlink > 1) ) + link_res = link_to_maj_min_ino (output_name.ds_string, + major (in_file_stat.st_dev), + minor (in_file_stat.st_dev), + in_file_stat.st_ino); + + /* If the file was not linked, copy contents of file. */ + if (link_res < 0) + { + in_file_des = open (input_name.ds_string, + O_RDONLY | O_BINARY, 0); + if (in_file_des < 0) + { + open_error (input_name.ds_string); + continue; + } + out_file_des = open (output_name.ds_string, + O_CREAT | O_WRONLY | O_BINARY, 0600); + if (out_file_des < 0 && create_dir_flag) + { + create_all_directories (output_name.ds_string); + out_file_des = open (output_name.ds_string, + O_CREAT | O_WRONLY | O_BINARY, 0600); + } + if (out_file_des < 0) + { + open_error (output_name.ds_string); + close (in_file_des); + continue; + } + + copy_files_disk_to_disk (in_file_des, out_file_des, in_file_stat.st_size, input_name.ds_string); + disk_empty_output_buffer (out_file_des); + /* Debian hack to fix a bug in the --sparse option. + This bug has been reported to + "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */ + if (delayed_seek_count > 0) + { + lseek (out_file_des, delayed_seek_count-1, SEEK_CUR); + write (out_file_des, "", 1); + delayed_seek_count = 0; + } + + set_copypass_perms (out_file_des, + output_name.ds_string, &in_file_stat); + + if (reset_time_flag) + { + set_file_times (in_file_des, + input_name.ds_string, + in_file_stat.st_atime, + in_file_stat.st_mtime); + set_file_times (out_file_des, + output_name.ds_string, + in_file_stat.st_atime, + in_file_stat.st_mtime); + } + + if (close (in_file_des) < 0) + close_error (input_name.ds_string); + + if (close (out_file_des) < 0) + close_error (output_name.ds_string); + + warn_if_file_changed(input_name.ds_string, in_file_stat.st_size, + in_file_stat.st_mtime); + } + } + else if (S_ISDIR (in_file_stat.st_mode)) + { +#ifdef HPUX_CDF + cdf_flag = 0; +#endif + if (!existing_dir) + { +#ifdef HPUX_CDF + /* If the directory name ends in a + and is SUID, + then it is a CDF. Strip the trailing + from the name + before creating it. */ + cdf_char = strlen (output_name.ds_string) - 1; + if ( (cdf_char > 0) && + (in_file_stat.st_mode & 04000) && + (output_name.ds_string [cdf_char] == '+') ) + { + output_name.ds_string [cdf_char] = '\0'; + cdf_flag = 1; + } +#endif + res = mkdir (output_name.ds_string, in_file_stat.st_mode); + + } + else + res = 0; + if (res < 0 && create_dir_flag) + { + create_all_directories (output_name.ds_string); + res = mkdir (output_name.ds_string, in_file_stat.st_mode); + } + if (res < 0) + { + /* In some odd cases where the output_name includes `.', + the directory may have actually been created by + create_all_directories(), so the mkdir will fail + because the directory exists. If that's the case, + don't complain about it. */ + if ( (errno != EEXIST) || + (lstat (output_name.ds_string, &out_file_stat) != 0) || + !(S_ISDIR (out_file_stat.st_mode) ) ) + { + stat_error (output_name.ds_string); + continue; + } + } + set_copypass_perms (-1, output_name.ds_string, &in_file_stat); + } + else if (S_ISCHR (in_file_stat.st_mode) || + S_ISBLK (in_file_stat.st_mode) || +#ifdef S_ISFIFO + S_ISFIFO (in_file_stat.st_mode) || +#endif +#ifdef S_ISSOCK + S_ISSOCK (in_file_stat.st_mode) || +#endif + 0) + { + /* Can the current file be linked to a another file? + Set link_name to the original file name. */ + if (link_flag) + /* User said to link it if possible. */ + link_res = link_to_name (output_name.ds_string, + input_name.ds_string); + if ( (link_res < 0) && (in_file_stat.st_nlink > 1) ) + link_res = link_to_maj_min_ino (output_name.ds_string, + major (in_file_stat.st_dev), + minor (in_file_stat.st_dev), + in_file_stat.st_ino); + + if (link_res < 0) + { + res = mknod (output_name.ds_string, in_file_stat.st_mode, + in_file_stat.st_rdev); + if (res < 0 && create_dir_flag) + { + create_all_directories (output_name.ds_string); + res = mknod (output_name.ds_string, in_file_stat.st_mode, + in_file_stat.st_rdev); + } + if (res < 0) + { + mknod_error (output_name.ds_string); + continue; + } + set_copypass_perms (-1, output_name.ds_string, &in_file_stat); + } + } + +#ifdef S_ISLNK + else if (S_ISLNK (in_file_stat.st_mode)) + { + char *link_name; + int link_size; + link_name = (char *) xmalloc ((unsigned int) in_file_stat.st_size + 1); + + link_size = readlink (input_name.ds_string, link_name, + in_file_stat.st_size); + if (link_size < 0) + { + readlink_error (input_name.ds_string); + free (link_name); + continue; + } + link_name[link_size] = '\0'; + + res = UMASKED_SYMLINK (link_name, output_name.ds_string, + in_file_stat.st_mode); + if (res < 0 && create_dir_flag) + { + create_all_directories (output_name.ds_string); + res = UMASKED_SYMLINK (link_name, output_name.ds_string, + in_file_stat.st_mode); + } + if (res < 0) + { + symlink_error (output_name.ds_string, link_name); + free (link_name); + continue; + } + + /* Set the attributes of the new link. */ + if (!no_chown_flag) + { + uid_t uid = set_owner_flag ? set_owner : in_file_stat.st_uid; + gid_t gid = set_group_flag ? set_group : in_file_stat.st_gid; + if ((lchown (output_name.ds_string, uid, gid) < 0) + && errno != EPERM) + chown_error_details (output_name.ds_string, uid, gid); + } + free (link_name); + } +#endif + else + { + error (0, 0, _("%s: unknown file type"), input_name.ds_string); + } + + if (verbose_flag) + fprintf (stderr, "%s\n", output_name.ds_string); + if (dot_flag) + fputc ('.', stderr); + } + + if (dot_flag) + fputc ('\n', stderr); + if (!quiet_flag) + { + res = (output_bytes + io_block_size - 1) / io_block_size; + fprintf (stderr, ngettext ("%d block\n", "%d blocks\n", res), res); + } +} + +/* Try and create a hard link from FILE_NAME to another file + with the given major/minor device number and inode. If no other + file with the same major/minor/inode numbers is known, add this file + to the list of known files and associated major/minor/inode numbers + and return -1. If another file with the same major/minor/inode + numbers is found, try and create another link to it using + link_to_name, and return 0 for success and -1 for failure. */ + +int +link_to_maj_min_ino (char *file_name, int st_dev_maj, int st_dev_min, + int st_ino) +{ + int link_res; + char *link_name; + link_res = -1; + /* Is the file a link to a previously copied file? */ + link_name = find_inode_file (st_ino, + st_dev_maj, + st_dev_min); + if (link_name == NULL) + add_inode (st_ino, file_name, + st_dev_maj, + st_dev_min); + else + link_res = link_to_name (file_name, link_name); + return link_res; +} + +/* Try and create a hard link from LINK_NAME to LINK_TARGET. If + `create_dir_flag' is set, any non-existent (parent) directories + needed by LINK_NAME will be created. If the link is successfully + created and `verbose_flag' is set, print "LINK_TARGET linked to LINK_NAME\n". + If the link can not be created and `link_flag' is set, print + "cannot link LINK_TARGET to LINK_NAME\n". Return 0 if the link + is created, -1 otherwise. */ + +int +link_to_name (char *link_name, char *link_target) +{ + int res = link (link_target, link_name); + if (res < 0 && create_dir_flag) + { + create_all_directories (link_name); + res = link (link_target, link_name); + } + if (res == 0) + { + if (verbose_flag) + error (0, 0, _("%s linked to %s"), + link_target, link_name); + } + else if (link_flag) + { + error (0, errno, _("cannot link %s to %s"), + link_target, link_name); + } + return res; +} diff --git a/src/cpio.h b/src/cpio.h new file mode 100644 index 0000000..34d1cf1 --- /dev/null +++ b/src/cpio.h @@ -0,0 +1,72 @@ +/* Extended cpio format from POSIX.1. + Copyright (C) 1992, 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 _CPIO_H + +#define _CPIO_H 1 + +/* A cpio archive consists of a sequence of files. + Each file has a 76 byte header, + a variable length, NUL terminated filename, + and variable length file data. + A header for a filename "TRAILER!!!" indicates the end of the archive. */ + +#define CPIO_TRAILER_NAME "TRAILER!!!" + +/* All the fields in the header are ISO 646 (approximately ASCII) strings + of octal numbers, left padded, not NUL terminated. + + Field Name Length in Bytes Notes + c_magic 6 must be "070707" + c_dev 6 + c_ino 6 + c_mode 6 see below for value + c_uid 6 + c_gid 6 + c_nlink 6 + c_rdev 6 only valid for chr and blk special files + c_mtime 11 + c_namesize 6 count includes terminating NUL in pathname + c_filesize 11 must be 0 for FIFOs and directories */ + +/* Values for c_mode, OR'd together: */ + +#define C_IRUSR 000400 +#define C_IWUSR 000200 +#define C_IXUSR 000100 +#define C_IRGRP 000040 +#define C_IWGRP 000020 +#define C_IXGRP 000010 +#define C_IROTH 000004 +#define C_IWOTH 000002 +#define C_IXOTH 000001 + +#define C_ISUID 004000 +#define C_ISGID 002000 +#define C_ISVTX 001000 + +#define C_ISBLK 060000 +#define C_ISCHR 020000 +#define C_ISDIR 040000 +#define C_ISFIFO 010000 +#define C_ISSOCK 0140000 +#define C_ISLNK 0120000 +#define C_ISCTG 0110000 +#define C_ISREG 0100000 + +#endif /* cpio.h */ diff --git a/src/cpiohdr.h b/src/cpiohdr.h new file mode 100644 index 0000000..503563f --- /dev/null +++ b/src/cpiohdr.h @@ -0,0 +1,106 @@ +/* Extended cpio header from POSIX.1. + Copyright (C) 1992, 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. */ + +#ifndef _CPIOHDR_H + +#define _CPIOHDR_H 1 + +#include + +struct old_cpio_header +{ + unsigned short c_magic; + short c_dev; + unsigned short c_ino; + unsigned short c_mode; + unsigned short c_uid; + unsigned short c_gid; + unsigned short c_nlink; + short c_rdev; + unsigned short c_mtimes[2]; + unsigned short c_namesize; + unsigned short c_filesizes[2]; +}; + +struct old_ascii_header +{ + char c_magic[6]; + char c_dev[6]; + char c_ino[6]; + char c_mode[6]; + char c_uid[6]; + char c_gid[6]; + char c_nlink[6]; + char c_rdev[6]; + char c_mtime[11]; + char c_namesize[6]; + char c_filesize[11]; +}; + +/* "New" portable format and CRC format: + + Each file has a 110 byte header, + a variable length, NUL terminated filename, + and variable length file data. + A header for a filename "TRAILER!!!" indicates the end of the archive. */ + +/* All the fields in the header are ISO 646 (approximately ASCII) strings + of hexadecimal numbers, left padded, not NUL terminated: */ + +struct new_ascii_header +{ + char c_magic[6]; /* "070701" for "new" portable format + "070702" for CRC format */ + char c_ino[8]; + char c_mode[8]; + char c_uid[8]; + char c_gid[8]; + char c_nlink[8]; + char c_mtime[8]; + char c_filesize[8]; /* must be 0 for FIFOs and directories */ + char c_dev_maj[8]; + char c_dev_min[8]; + char c_rdev_maj[8]; /* only valid for chr and blk special files */ + char c_rdev_min[8]; /* only valid for chr and blk special files */ + char c_namesize[8]; /* count includes terminating NUL in pathname */ + char c_chksum[8]; /* 0 for "new" portable format; for CRC format + the sum of all the bytes in the file */ +}; + +struct cpio_file_stat /* Internal representation of a CPIO header */ +{ + unsigned short c_magic; + ino_t c_ino; + mode_t c_mode; + uid_t c_uid; + gid_t c_gid; + size_t c_nlink; + time_t c_mtime; + off_t c_filesize; + long c_dev_maj; + long c_dev_min; + long c_rdev_maj; + long c_rdev_min; + size_t c_namesize; + unsigned long c_chksum; + char *c_name; + char *c_tar_linkname; +}; + + +#endif /* cpiohdr.h */ diff --git a/src/defer.c b/src/defer.c new file mode 100644 index 0000000..83e15dd --- /dev/null +++ b/src/defer.c @@ -0,0 +1,43 @@ +/* defer.c - handle "defered" links in newc and crc archives + Copyright (C) 1993, 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. */ + +#include + +#include +#include +#include "cpiohdr.h" +#include "extern.h" +#include "defer.h" + +struct deferment * +create_deferment (struct cpio_file_stat *file_hdr) +{ + struct deferment *d; + d = (struct deferment *) xmalloc (sizeof (struct deferment) ); + d->header = *file_hdr; + d->header.c_name = (char *) xmalloc (strlen (file_hdr->c_name) + 1); + strcpy (d->header.c_name, file_hdr->c_name); + return d; +} + +void +free_deferment (struct deferment *d) +{ + free (d->header.c_name); + free (d); +} diff --git a/src/defer.h b/src/defer.h new file mode 100644 index 0000000..00aafec --- /dev/null +++ b/src/defer.h @@ -0,0 +1,26 @@ +/* defer.h + Copyright (C) 1993, 2001, 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. */ + +struct deferment + { + struct deferment *next; + struct cpio_file_stat header; + }; + +struct deferment *create_deferment (struct cpio_file_stat *file_hdr); +void free_deferment (struct deferment *d); diff --git a/src/dstring.c b/src/dstring.c new file mode 100644 index 0000000..aefeab8 --- /dev/null +++ b/src/dstring.c @@ -0,0 +1,103 @@ +/* dstring.c - The dynamic string handling routines used by cpio. + Copyright (C) 1990, 1991, 1992, 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. */ + +#if defined(HAVE_CONFIG_H) +# include +#endif + +#include +#if defined(HAVE_STRING_H) || defined(STDC_HEADERS) +#include +#else +#include +#endif +#include "dstring.h" + +char *xmalloc (unsigned n); +char *xrealloc (char *p, unsigned n); + +/* Initialiaze dynamic string STRING with space for SIZE characters. */ + +void +ds_init (dynamic_string *string, int size) +{ + string->ds_length = size; + string->ds_string = (char *) xmalloc (size); +} + +/* Expand dynamic string STRING, if necessary, to hold SIZE characters. */ + +void +ds_resize (dynamic_string *string, int size) +{ + if (size > string->ds_length) + { + string->ds_length = size; + string->ds_string = (char *) xrealloc ((char *) string->ds_string, size); + } +} + +/* Dynamic string S gets a string terminated by the EOS character + (which is removed) from file F. S will increase + in size during the function if the string from F is longer than + the current size of S. + Return NULL if end of file is detected. Otherwise, + Return a pointer to the null-terminated string in S. */ + +char * +ds_fgetstr (FILE *f, dynamic_string *s, char eos) +{ + int insize; /* Amount needed for line. */ + int strsize; /* Amount allocated for S. */ + int next_ch; + + /* Initialize. */ + insize = 0; + strsize = s->ds_length; + + /* Read the input string. */ + next_ch = getc (f); + while (next_ch != eos && next_ch != EOF) + { + if (insize >= strsize - 1) + { + ds_resize (s, strsize * 2 + 2); + strsize = s->ds_length; + } + s->ds_string[insize++] = next_ch; + next_ch = getc (f); + } + s->ds_string[insize++] = '\0'; + + if (insize == 1 && next_ch == EOF) + return NULL; + else + return s->ds_string; +} + +char * +ds_fgets (FILE *f, dynamic_string *s) +{ + return ds_fgetstr (f, s, '\n'); +} + +char * +ds_fgetname (FILE *f, dynamic_string *s) +{ + return ds_fgetstr (f, s, '\0'); +} diff --git a/src/dstring.h b/src/dstring.h new file mode 100644 index 0000000..3628b99 --- /dev/null +++ b/src/dstring.h @@ -0,0 +1,50 @@ +/* dstring.h - Dynamic string handling include file. Requires strings.h. + Copyright (C) 1990, 1991, 1992, 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. */ + +#ifndef NULL +#define NULL 0 +#endif + +/* A dynamic string consists of record that records the size of an + allocated string and the pointer to that string. The actual string + is a normal zero byte terminated string that can be used with the + usual string functions. The major difference is that the + dynamic_string routines know how to get more space if it is needed + by allocating new space and copying the current string. */ + +typedef struct +{ + int ds_length; /* Actual amount of storage allocated. */ + char *ds_string; /* String. */ +} dynamic_string; + + +/* Macros that look similar to the original string functions. + WARNING: These macros work only on pointers to dynamic string records. + If used with a real record, an "&" must be used to get the pointer. */ +#define ds_strlen(s) strlen ((s)->ds_string) +#define ds_strcmp(s1, s2) strcmp ((s1)->ds_string, (s2)->ds_string) +#define ds_strncmp(s1, s2, n) strncmp ((s1)->ds_string, (s2)->ds_string, n) +#define ds_index(s, c) index ((s)->ds_string, c) +#define ds_rindex(s, c) rindex ((s)->ds_string, c) + +void ds_init (dynamic_string *string, int size); +void ds_resize (dynamic_string *string, int size); +char *ds_fgetname (FILE *f, dynamic_string *s); +char *ds_fgets (FILE *f, dynamic_string *s); +char *ds_fgetstr (FILE *f, dynamic_string *s, char eos); diff --git a/src/extern.h b/src/extern.h new file mode 100644 index 0000000..2bed3ce --- /dev/null +++ b/src/extern.h @@ -0,0 +1,221 @@ +/* extern.h - External declarations for cpio. Requires system.h. + Copyright (C) 1990, 1991, 1992, 2001, 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. */ + +#include "paxlib.h" +#include "quotearg.h" +#include "quote.h" + +enum archive_format +{ + arf_unknown, arf_binary, arf_oldascii, arf_newascii, arf_crcascii, + arf_tar, arf_ustar, arf_hpoldascii, arf_hpbinary +}; + +extern enum archive_format archive_format; +extern int reset_time_flag; +extern int io_block_size; +extern int create_dir_flag; +extern int rename_flag; +extern char *rename_batch_file; +extern int table_flag; +extern int unconditional_flag; +extern int verbose_flag; +extern int dot_flag; +extern int link_flag; +extern int retain_time_flag; +extern int crc_i_flag; +extern int append_flag; +extern int swap_bytes_flag; +extern int swap_halfwords_flag; +extern int swapping_bytes; +extern int swapping_halfwords; +extern int set_owner_flag; +extern uid_t set_owner; +extern int set_group_flag; +extern gid_t set_group; +extern int no_chown_flag; +extern int sparse_flag; +extern int quiet_flag; +extern int only_verify_crc_flag; +extern int no_abs_paths_flag; +extern unsigned int warn_option; + +/* Values for warn_option */ +#define CPIO_WARN_NONE 0 +#define CPIO_WARN_TRUNCATE 0x01 +#define CPIO_WARN_ALL (unsigned int)-1 + +extern bool to_stdout_option; + +extern int last_header_start; +extern int copy_matching_files; +extern int numeric_uid; +extern char *pattern_file_name; +extern char *new_media_message; +extern char *new_media_message_with_number; +extern char *new_media_message_after_number; +extern int archive_des; +extern char *archive_name; +extern char *rsh_command_option; +extern unsigned int crc; +extern int delayed_seek_count; +#ifdef DEBUG_CPIO +extern int debug_flag; +#endif + +extern char *input_buffer, *output_buffer; +extern char *in_buff, *out_buff; +extern long input_buffer_size; +extern long input_size, output_size; +#ifdef __GNUC__ +extern long long input_bytes, output_bytes; +#else +extern long input_bytes, output_bytes; +#endif +extern char *directory_name; +extern char **save_patterns; +extern int num_patterns; +extern char name_end; +extern char input_is_special; +extern char output_is_special; +extern char input_is_seekable; +extern char output_is_seekable; +extern char *program_name; +extern int (*xstat) (); +extern void (*copy_function) (); + + +/* copyin.c */ +void warn_junk_bytes (long bytes_skipped); +/* FIXME: make read_* static in copyin.c */ +void read_in_header (struct cpio_file_stat *file_hdr, int in_des); +void read_in_old_ascii (struct cpio_file_stat *file_hdr, int in_des); +void read_in_new_ascii (struct cpio_file_stat *file_hdr, int in_des); +void read_in_binary (struct cpio_file_stat *file_hdr, + struct old_cpio_header *short_hdr, int in_des); +void swab_array (char *arg, int count); +void process_copy_in (void); +void long_format (struct cpio_file_stat *file_hdr, char *link_name); +void print_name_with_quoting (char *p); + +/* copyout.c */ +int write_out_header (struct cpio_file_stat *file_hdr, int out_des); +void process_copy_out (void); + +/* copypass.c */ +void process_copy_pass (void); +int link_to_maj_min_ino (char *file_name, int st_dev_maj, + int st_dev_min, int st_ino); +int link_to_name (char *link_name, char *link_target); + +/* dirname.c */ +char *dirname (char *path); + +/* filemode.c */ +void mode_string (unsigned int mode, char *str); + +/* idcache.c */ +#ifndef __MSDOS__ +char *getgroup (); +char *getuser (); +uid_t *getuidbyname (); +gid_t *getgidbyname (); +#endif + +/* main.c */ +void process_args (int argc, char *argv[]); +void initialize_buffers (void); + +/* makepath.c */ +int make_path (char *argpath, int mode, int parent_mode, + uid_t owner, gid_t group, char *verbose_fmt_string); + +/* tar.c */ +void write_out_tar_header (struct cpio_file_stat *file_hdr, int out_des); +int null_block (long *block, int size); +void read_in_tar_header (struct cpio_file_stat *file_hdr, int in_des); +int otoa (char *s, unsigned long *n); +int is_tar_header (char *buf); +int is_tar_filename_too_long (char *name); + +/* userspec.c */ +#ifndef __MSDOS__ +char *parse_user_spec (char *name, uid_t *uid, gid_t *gid, + char **username, char **groupname); +#endif + +/* util.c */ +void tape_empty_output_buffer (int out_des); +void disk_empty_output_buffer (int out_des); +void swahw_array (char *ptr, int count); +void tape_buffered_write (char *in_buf, int out_des, off_t num_bytes); +void tape_buffered_read (char *in_buf, int in_des, off_t num_bytes); +int tape_buffered_peek (char *peek_buf, int in_des, int num_bytes); +void tape_toss_input (int in_des, off_t num_bytes); +void copy_files_tape_to_disk (int in_des, int out_des, off_t num_bytes); +void copy_files_disk_to_tape (int in_des, int out_des, off_t num_bytes, char *filename); +void copy_files_disk_to_disk (int in_des, int out_des, off_t num_bytes, char *filename); +void warn_if_file_changed (char *file_name, unsigned long old_file_size, + off_t old_file_mtime); +void create_all_directories (char *name); +void prepare_append (int out_file_des); +char *find_inode_file (unsigned long node_num, + unsigned long major_num, unsigned long minor_num); +void add_inode (unsigned long node_num, char *file_name, + unsigned long major_num, unsigned long minor_num); +int open_archive (char *file); +void tape_offline (int tape_des); +void get_next_reel (int tape_des); +void set_new_media_message (char *message); +#if defined(__MSDOS__) && !defined(__GNUC__) +int chown (char *path, int owner, int group); +#endif +#ifdef __TURBOC__ +int utime (char *filename, struct utimbuf *utb); +#endif +#ifdef HPUX_CDF +char *add_cdf_double_slashes (char *filename); +#endif +void write_nuls_to_file (off_t num_bytes, int out_des, + void (*writer) (char *in_buf, + int out_des, off_t num_bytes)); +#define DISK_IO_BLOCK_SIZE 512 + +/* FIXME: Move to system.h? */ +#ifndef SYMLINK_USES_UMASK +# define UMASKED_SYMLINK(name1,name2,mode) symlink(name1,name2) +#else +# define UMASKED_SYMLINK(name1,name2,mode) umasked_symlink(name1,name2,mode) +#endif /* SYMLINK_USES_UMASK */ + +void set_perms (int fd, struct cpio_file_stat *header); +void set_file_times (int fd, const char *name, unsigned long atime, + unsigned long mtime); +void stat_to_cpio (struct cpio_file_stat *hdr, struct stat *st); +void cpio_safer_name_suffix (char *name, bool link_target, + bool absolute_names, bool strip_leading_dots); + +/* FIXME: These two defines should be defined in paxutils */ +#define LG_8 3 +#define LG_16 4 + +uintmax_t from_ascii (char const *where, size_t digs, unsigned logbase); + +#define FROM_OCTAL(f) from_ascii (f, sizeof f, LG_8) +#define FROM_HEX(f) from_ascii (f, sizeof f, LG_16) + diff --git a/src/filemode.c b/src/filemode.c new file mode 100644 index 0000000..98f2813 --- /dev/null +++ b/src/filemode.c @@ -0,0 +1,243 @@ +/* filemode.c -- make a string describing file modes + Copyright (C) 1985, 1990, 1993, 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. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#if !S_IRUSR +# if S_IREAD +# define S_IRUSR S_IREAD +# else +# define S_IRUSR 00400 +# endif +#endif + +#if !S_IWUSR +# if S_IWRITE +# define S_IWUSR S_IWRITE +# else +# define S_IWUSR 00200 +# endif +#endif + +#if !S_IXUSR +# if S_IEXEC +# define S_IXUSR S_IEXEC +# else +# define S_IXUSR 00100 +# endif +#endif + +#ifdef STAT_MACROS_BROKEN +#undef S_ISBLK +#undef S_ISCHR +#undef S_ISDIR +#undef S_ISFIFO +#undef S_ISLNK +#undef S_ISMPB +#undef S_ISMPC +#undef S_ISNWK +#undef S_ISREG +#undef S_ISSOCK +#endif /* STAT_MACROS_BROKEN. */ + +#if !defined(S_ISBLK) && defined(S_IFBLK) +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +#endif +#if !defined(S_ISCHR) && defined(S_IFCHR) +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +#endif +#if !defined(S_ISDIR) && defined(S_IFDIR) +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif +#if !defined(S_ISREG) && defined(S_IFREG) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif +#if !defined(S_ISFIFO) && defined(S_IFIFO) +#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +#endif +#if !defined(S_ISLNK) && defined(S_IFLNK) +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif +#if !defined(S_ISSOCK) && defined(S_IFSOCK) +#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +#endif +#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ +#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) +#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) +#endif +#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ +#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) +#endif + +/* Return a character indicating the type of file described by + file mode BITS: + 'd' for directories + 'b' for block special files + 'c' for character special files + 'm' for multiplexor files + 'l' for symbolic links + 's' for sockets + 'p' for fifos + '-' for regular files + '?' for any other file type. */ + +static char +ftypelet (long bits) +{ +#ifdef S_ISBLK + if (S_ISBLK (bits)) + return 'b'; +#endif + if (S_ISCHR (bits)) + return 'c'; + if (S_ISDIR (bits)) + return 'd'; + if (S_ISREG (bits)) + return '-'; +#ifdef S_ISFIFO + if (S_ISFIFO (bits)) + return 'p'; +#endif +#ifdef S_ISLNK + if (S_ISLNK (bits)) + return 'l'; +#endif +#ifdef S_ISSOCK + if (S_ISSOCK (bits)) + return 's'; +#endif +#ifdef S_ISMPC + if (S_ISMPC (bits)) + return 'm'; +#endif +#ifdef S_ISNWK + if (S_ISNWK (bits)) + return 'n'; +#endif + return '?'; +} + +/* Look at read, write, and execute bits in BITS and set + flags in CHARS accordingly. */ + +static void +rwx (unsigned short bits, char *chars) +{ + chars[0] = (bits & S_IRUSR) ? 'r' : '-'; + chars[1] = (bits & S_IWUSR) ? 'w' : '-'; + chars[2] = (bits & S_IXUSR) ? 'x' : '-'; +} + +/* Set the 's' and 't' flags in file attributes string CHARS, + according to the file mode BITS. */ + +static void +setst (unsigned short bits, char *chars) +{ +#ifdef S_ISUID + if (bits & S_ISUID) + { + if (chars[3] != 'x') + /* Set-uid, but not executable by owner. */ + chars[3] = 'S'; + else + chars[3] = 's'; + } +#endif +#ifdef S_ISGID + if (bits & S_ISGID) + { + if (chars[6] != 'x') + /* Set-gid, but not executable by group. */ + chars[6] = 'S'; + else + chars[6] = 's'; + } +#endif +#ifdef S_ISVTX + if (bits & S_ISVTX) + { + if (chars[9] != 'x') + /* Sticky, but not executable by others. */ + chars[9] = 'T'; + else + chars[9] = 't'; + } +#endif +} + +/* Like filemodestring (see below), but only the relevant part of the + `struct stat' is given as an argument. */ + +void +mode_string (unsigned short mode, char *str) +{ + str[0] = ftypelet ((long) mode); + rwx ((mode & 0700) << 0, &str[1]); + rwx ((mode & 0070) << 3, &str[4]); + rwx ((mode & 0007) << 6, &str[7]); + setst (mode, str); +} + +/* filemodestring - fill in string STR with an ls-style ASCII + representation of the st_mode field of file stats block STATP. + 10 characters are stored in STR; no terminating null is added. + The characters stored in STR are: + + 0 File type. 'd' for directory, 'c' for character + special, 'b' for block special, 'm' for multiplex, + 'l' for symbolic link, 's' for socket, 'p' for fifo, + '-' for regular, '?' for any other file type + + 1 'r' if the owner may read, '-' otherwise. + + 2 'w' if the owner may write, '-' otherwise. + + 3 'x' if the owner may execute, 's' if the file is + set-user-id, '-' otherwise. + 'S' if the file is set-user-id, but the execute + bit isn't set. + + 4 'r' if group members may read, '-' otherwise. + + 5 'w' if group members may write, '-' otherwise. + + 6 'x' if group members may execute, 's' if the file is + set-group-id, '-' otherwise. + 'S' if it is set-group-id but not executable. + + 7 'r' if any user may read, '-' otherwise. + + 8 'w' if any user may write, '-' otherwise. + + 9 'x' if any user may execute, 't' if the file is "sticky" + (will be retained in swap space after execution), '-' + otherwise. + 'T' if the file is sticky but not executable. */ + +void +filemodestring (struct stat *statp, char *str) +{ + mode_string (statp->st_mode, str); +} + diff --git a/src/filetypes.h b/src/filetypes.h new file mode 100644 index 0000000..de6d77f --- /dev/null +++ b/src/filetypes.h @@ -0,0 +1,85 @@ +/* filetypes.h - deal with POSIX annoyances + Copyright (C) 1991 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 sys/types.h and sys/stat.h before this file. */ + +#ifndef S_ISREG /* Doesn't have POSIX.1 stat stuff. */ +#define mode_t unsigned short +#endif + +/* Define the POSIX macros for systems that lack them. */ +#if !defined(S_ISBLK) && defined(S_IFBLK) +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +#endif +#if !defined(S_ISCHR) && defined(S_IFCHR) +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +#endif +#if !defined(S_ISDIR) && defined(S_IFDIR) +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif +#if !defined(S_ISREG) && defined(S_IFREG) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif +#if !defined(S_ISFIFO) && defined(S_IFIFO) +#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +#endif +#if !defined(S_ISLNK) && defined(S_IFLNK) +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif +#if !defined(S_ISSOCK) && defined(S_IFSOCK) +#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +#endif +#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX network special */ +#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) +#endif + +/* Define the file type bits used in cpio archives. + They have the same values as the S_IF bits in traditional Unix. */ + +#define CP_IFMT 0170000 /* Mask for all file type bits. */ + +#if defined(S_ISBLK) +#define CP_IFBLK 0060000 +#endif +#if defined(S_ISCHR) +#define CP_IFCHR 0020000 +#endif +#if defined(S_ISDIR) +#define CP_IFDIR 0040000 +#endif +#if defined(S_ISREG) +#define CP_IFREG 0100000 +#endif +#if defined(S_ISFIFO) +#define CP_IFIFO 0010000 +#endif +#if defined(S_ISLNK) +#define CP_IFLNK 0120000 +#endif +#if defined(S_ISSOCK) +#define CP_IFSOCK 0140000 +#endif +#if defined(S_ISNWK) +#define CP_IFNWK 0110000 +#endif + +#ifndef S_ISLNK +#define lstat stat +#endif +int lstat (); +int stat (); diff --git a/src/global.c b/src/global.c new file mode 100644 index 0000000..3341e8a --- /dev/null +++ b/src/global.c @@ -0,0 +1,201 @@ +/* global.c - global variables and initial values for cpio. + Copyright (C) 1990, 1991, 1992, 2001, 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. */ + +#include + +#include +#include "cpiohdr.h" +#include "dstring.h" +#include "extern.h" + +/* If true, reset access times after reading files (-a). */ +int reset_time_flag = false; + +/* Block size value, initially 512. -B sets to 5120. */ +int io_block_size = 512; + +/* The header format to recognize and produce. */ +enum archive_format archive_format = arf_unknown; + +/* If true, create directories as needed. (-d with -i or -p) */ +int create_dir_flag = false; + +/* If true, interactively rename files. (-r) */ +int rename_flag = false; + +/* If non-NULL, the name of a file that will be read to + rename all of the files in the archive. --rename-batch-file. */ +char *rename_batch_file = NULL; + +/* If true, print a table of contents of input. (-t) */ +int table_flag = false; + +/* If true, copy unconditionally (older replaces newer). (-u) */ +int unconditional_flag = false; + +/* If true, list the files processed, or ls -l style output with -t. (-v) */ +int verbose_flag = false; + +/* If true, print a . for each file processed. (-V) */ +int dot_flag = false; + +/* If true, link files whenever possible. Used with -p option. (-l) */ +int link_flag = false; + +/* If true, retain previous file modification time. (-m) */ +int retain_time_flag = false; + +/* Set true if crc_flag is true and we are doing a cpio -i. Used + by copy_files so it knows whether to compute the crc. */ +int crc_i_flag = false; + +/* If true, append to end of archive. (-A) */ +int append_flag = false; + +/* If true, swap bytes of each file during cpio -i. */ +int swap_bytes_flag = false; + +/* If true, swap halfwords of each file during cpio -i. */ +int swap_halfwords_flag = false; + +/* If true, we are swapping halfwords on the current file. */ +int swapping_halfwords = false; + +/* If true, we are swapping bytes on the current file. */ +int swapping_bytes = false; + +/* If true, set ownership of all files to UID `set_owner'. */ +int set_owner_flag = false; +uid_t set_owner; + +/* If true, set group ownership of all files to GID `set_group'. */ +int set_group_flag = false; +gid_t set_group; + +/* If true, do not chown the files. */ +int no_chown_flag = false; + +/* If true, try to write sparse ("holey") files. */ +int sparse_flag = false; + +/* If true, don't report number of blocks copied. */ +int quiet_flag = false; + +/* If true, only read the archive and verify the files' CRC's, don't + actually extract the files. */ +int only_verify_crc_flag = false; + +/* If true, don't use any absolute paths, prefix them by `./'. */ +int no_abs_paths_flag = false; + +#ifdef DEBUG_CPIO +/* If true, print debugging information. */ +int debug_flag = false; +#endif + +/* File position of last header read. Only used during -A to determine + where the old TRAILER!!! record started. */ +int last_header_start = 0; + +/* With -i; if true, copy only files that match any of the given patterns; + if false, copy only files that do not match any of the patterns. (-f) */ +int copy_matching_files = true; + +/* With -itv; if true, list numeric uid and gid instead of translating them + into names. */ +int numeric_uid = false; + +/* Name of file containing additional patterns (-E). */ +char *pattern_file_name = NULL; + +/* Message to print when end of medium is reached (-M). */ +char *new_media_message = NULL; + +/* With -M with %d, message to print when end of medium is reached. */ +char *new_media_message_with_number = NULL; +char *new_media_message_after_number = NULL; + +/* File descriptor containing the archive. */ +int archive_des; + +/* Name of file containing the archive, if known; NULL if stdin/out. */ +char *archive_name = NULL; + +/* Name of the remote shell command, if known; NULL otherwise. */ +char *rsh_command_option = NULL; + +/* CRC checksum. */ +unsigned int crc; + +/* Input and output buffers. */ +char *input_buffer, *output_buffer; + +/* The size of the input buffer. */ +long input_buffer_size; + +/* Current locations in `input_buffer' and `output_buffer'. */ +char *in_buff, *out_buff; + +/* Current number of bytes stored at `input_buff' and `output_buff'. */ +long input_size, output_size; + +/* Total number of bytes read and written for all files. + Now that many tape drives hold more than 4Gb we need more than 32 + bits to hold input_bytes and output_bytes. But it's not worth + the trouble of adding special multi-precision arithmetic if the + compiler doesn't support 64 bit ints since input_bytes and + output_bytes are only used to print the number of blocks copied. */ +#ifdef __GNUC__ +long long input_bytes, output_bytes; +#else +long input_bytes, output_bytes; +#endif + +/* Saving of argument values for later reference. */ +char *directory_name = NULL; +char **save_patterns; +int num_patterns; + +/* Character that terminates file names read from stdin. */ +char name_end = '\n'; + +/* true if input (cpio -i) or output (cpio -o) is a device node. */ +char input_is_special = false; +char output_is_special = false; + +/* true if lseek works on the input. */ +char input_is_seekable = false; + +/* true if lseek works on the output. */ +char output_is_seekable = false; + +/* Print extra warning messages */ +unsigned int warn_option = 0; + +/* Extract to standard output? */ +bool to_stdout_option = false; + +/* The name this program was run with. */ +char *program_name; + +/* A pointer to either lstat or stat, depending on whether + dereferencing of symlinks is done for input files. */ +int (*xstat) (); + +/* Which copy operation to perform. (-i, -o, -p) */ +void (*copy_function) () = 0; diff --git a/src/idcache.c b/src/idcache.c new file mode 100644 index 0000000..17fcc04 --- /dev/null +++ b/src/idcache.c @@ -0,0 +1,207 @@ +/* idcache.c -- map user and group IDs, cached for speed + Copyright (C) 1985, 1988, 1989, 1990, 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. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) +#include +#else +#include +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef _POSIX_VERSION +struct passwd *getpwuid (); +struct passwd *getpwnam (); +struct group *getgrgid (); +struct group *getgrnam (); +#endif + +char *xmalloc (); +char *xstrdup (); + +struct userid +{ + union + { + uid_t u; + gid_t g; + } id; + char *name; + struct userid *next; +}; + +static struct userid *user_alist; + +/* The members of this list have names not in the local passwd file. */ +static struct userid *nouser_alist; + +/* Translate UID to a login name or a stringified number, + with cache. */ + +char * +getuser (uid_t uid) +{ + register struct userid *tail; + struct passwd *pwent; + char usernum_string[20]; + + for (tail = user_alist; tail; tail = tail->next) + if (tail->id.u == uid) + return tail->name; + + pwent = getpwuid (uid); + tail = (struct userid *) xmalloc (sizeof (struct userid)); + tail->id.u = uid; + if (pwent == 0) + { + sprintf (usernum_string, "%u", (unsigned) uid); + tail->name = xstrdup (usernum_string); + } + else + tail->name = xstrdup (pwent->pw_name); + + /* Add to the head of the list, so most recently used is first. */ + tail->next = user_alist; + user_alist = tail; + return tail->name; +} + +/* Translate USER to a UID, with cache. + Return NULL if there is no such user. + (We also cache which user names have no passwd entry, + so we don't keep looking them up.) */ + +uid_t * +getuidbyname (char *user) +{ + register struct userid *tail; + struct passwd *pwent; + + for (tail = user_alist; tail; tail = tail->next) + /* Avoid a function call for the most common case. */ + if (*tail->name == *user && !strcmp (tail->name, user)) + return &tail->id.u; + + for (tail = nouser_alist; tail; tail = tail->next) + /* Avoid a function call for the most common case. */ + if (*tail->name == *user && !strcmp (tail->name, user)) + return 0; + + pwent = getpwnam (user); + + tail = (struct userid *) xmalloc (sizeof (struct userid)); + tail->name = xstrdup (user); + + /* Add to the head of the list, so most recently used is first. */ + if (pwent) + { + tail->id.u = pwent->pw_uid; + tail->next = user_alist; + user_alist = tail; + return &tail->id.u; + } + + tail->next = nouser_alist; + nouser_alist = tail; + return 0; +} + +/* Use the same struct as for userids. */ +static struct userid *group_alist; +static struct userid *nogroup_alist; + +/* Translate GID to a group name or a stringified number, + with cache. */ + +char * +getgroup (gid_t gid) +{ + register struct userid *tail; + struct group *grent; + char groupnum_string[20]; + + for (tail = group_alist; tail; tail = tail->next) + if (tail->id.g == gid) + return tail->name; + + grent = getgrgid (gid); + tail = (struct userid *) xmalloc (sizeof (struct userid)); + tail->id.g = gid; + if (grent == 0) + { + sprintf (groupnum_string, "%u", (unsigned int) gid); + tail->name = xstrdup (groupnum_string); + } + else + tail->name = xstrdup (grent->gr_name); + + /* Add to the head of the list, so most recently used is first. */ + tail->next = group_alist; + group_alist = tail; + return tail->name; +} + +/* Translate GROUP to a UID, with cache. + Return NULL if there is no such group. + (We also cache which group names have no group entry, + so we don't keep looking them up.) */ + +gid_t * +getgidbyname (char *group) +{ + register struct userid *tail; + struct group *grent; + + for (tail = group_alist; tail; tail = tail->next) + /* Avoid a function call for the most common case. */ + if (*tail->name == *group && !strcmp (tail->name, group)) + return &tail->id.g; + + for (tail = nogroup_alist; tail; tail = tail->next) + /* Avoid a function call for the most common case. */ + if (*tail->name == *group && !strcmp (tail->name, group)) + return 0; + + grent = getgrnam (group); + + tail = (struct userid *) xmalloc (sizeof (struct userid)); + tail->name = xstrdup (group); + + /* Add to the head of the list, so most recently used is first. */ + if (grent) + { + tail->id.g = grent->gr_gid; + tail->next = group_alist; + group_alist = tail; + return &tail->id.g; + } + + tail->next = nogroup_alist; + nogroup_alist = tail; + return 0; +} diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..7581b8f --- /dev/null +++ b/src/main.c @@ -0,0 +1,800 @@ +/* main.c - main program and argument processing for cpio. + Copyright (C) 1990, 1991, 1992, 2001, 2003, 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) + any 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 Phil Nelson , + David MacKenzie , + John Oleynick , + and Sergey Poznyakoff */ + +#include +#include + +#include +#include +#include +#include +#include + +#ifdef HAVE_LOCALE_H +# include +#endif + +#include "filetypes.h" +#include "cpiohdr.h" +#include "dstring.h" +#include "extern.h" +#include +#include + +enum cpio_options { + NO_ABSOLUTE_FILENAMES_OPTION=256, + ABSOLUTE_FILENAMES_OPTION, + NO_PRESERVE_OWNER_OPTION, + ONLY_VERIFY_CRC_OPTION, + RENAME_BATCH_FILE_OPTION, + RSH_COMMAND_OPTION, + QUIET_OPTION, + SPARSE_OPTION, + FORCE_LOCAL_OPTION, + DEBUG_OPTION, + BLOCK_SIZE_OPTION, + TO_STDOUT_OPTION, + + HANG_OPTION, + USAGE_OPTION, + LICENSE_OPTION, + VERSION_OPTION +}; + +const char *argp_program_version = "cpio (" PACKAGE_NAME ") " VERSION; +const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; +static char doc[] = N_("GNU `cpio' copies files to and from archives\n\ +\n\ +Examples:\n\ + # Copy files named in name-list to the archive\n\ + cpio -o < name-list [> archive]\n\ + # Extract files from the archive\n\ + cpio -i [< archive]\n\ + # Copy files named in name-list to destination-directory\n\ + cpio -p destination-directory < name-list\n"); + +/* Print usage error message and exit with error. */ + +#define CHECK_USAGE(cond, opt, mode_opt) \ + if (cond) \ + ERROR((PAXEXIT_FAILURE, 0, _("%s is meaningless with %s"), opt, mode_opt)); + +static struct argp_option options[] = { + /* ********** */ +#define GRID 10 + {NULL, 0, NULL, 0, + N_("Main operation mode:"), GRID }, + {"create", 'o', 0, 0, + N_("Create the archive (run in copy-out mode)"), GRID }, + {"extract", 'i', 0, 0, + N_("Extract files from an archive (run in copy-in mode)"), GRID }, + {"pass-through", 'p', 0, 0, + N_("Run in copy-pass mode"), GRID }, + {"list", 't', 0, 0, + N_("Print a table of contents of the input"), GRID }, +#undef GRID + + /* ********** */ +#define GRID 100 + {NULL, 0, NULL, 0, + N_("Operation modifiers valid in any mode:"), GRID }, + + {"file", 'F', N_("[[USER@]HOST:]FILE-NAME"), 0, + N_("Use this FILE-NAME instead of standard input or output. Optional USER and HOST specify the user and host names in case of a remote archive"), GRID+1 }, + {"force-local", FORCE_LOCAL_OPTION, 0, 0, + N_("Archive file is local, even if its name contains colons"), GRID+1 }, + {"format", 'H', N_("FORMAT"), 0, + N_("Use given archive FORMAT"), GRID+1 }, + {NULL, 'B', NULL, 0, + N_("Set the I/O block size to 5120 bytes"), GRID+1 }, + {"block-size", BLOCK_SIZE_OPTION, N_("BLOCK-SIZE"), 0, + N_("Set the I/O block size to BLOCK-SIZE * 512 bytes"), GRID+1 }, + {NULL, 'c', NULL, 0, + N_("Use the old portable (ASCII) archive format"), GRID+1 }, + {"dot", 'V', NULL, 0, + N_("Print a \".\" for each file processed"), GRID+1 }, + {"io-size", 'C', N_("NUMBER"), 0, + N_("Set the I/O block size to the given NUMBER of bytes"), GRID+1 }, + {"message", 'M', N_("STRING"), 0, + N_("Print STRING when the end of a volume of the backup media is reached"), + GRID+1 }, + {"nonmatching", 'f', 0, 0, + N_("Only copy files that do not match any of the given patterns"), GRID+1 }, + {"numeric-uid-gid", 'n', 0, 0, + N_("In the verbose table of contents listing, show numeric UID and GID"), + GRID+1 }, + {"rsh-command", RSH_COMMAND_OPTION, N_("COMMAND"), 0, + N_("Use remote COMMAND instead of rsh"), GRID+1 }, + {"quiet", QUIET_OPTION, NULL, 0, + N_("Do not print the number of blocks copied"), GRID+1 }, + {"verbose", 'v', NULL, 0, + N_("Verbosely list the files processed"), GRID+1 }, +#ifdef DEBUG_CPIO + {"debug", DEBUG_OPTION, NULL, 0, + N_("Enable debugging info"), GRID+1 }, +#endif + {"warning", 'W', N_("FLAG"), 0, + N_("Control warning display. Currently FLAG is one of 'none', 'truncate', 'all'. Multiple options accumulate."), GRID+1 }, +#undef GRID + + /* ********** */ +#define GRID 200 + {NULL, 0, NULL, 0, + N_("Operation modifiers valid only in copy-in mode:"), GRID }, + {"pattern-file", 'E', N_("FILE"), 0, + N_("Read additional patterns specifying filenames to extract or list from FILE"), 210}, + {"only-verify-crc", ONLY_VERIFY_CRC_OPTION, 0, 0, + N_("When reading a CRC format archive, only verify the CRC's of each file in the archive, don't actually extract the files"), 210}, + {"rename", 'r', 0, 0, + N_("Interactively rename files"), GRID+1 }, + {"rename-batch-file", RENAME_BATCH_FILE_OPTION, N_("FILE"), OPTION_HIDDEN, + "", GRID+1 }, + {"swap", 'b', NULL, 0, + N_("Swap both halfwords of words and bytes of halfwords in the data. Equivalent to -sS"), GRID+1 }, + {"swap-bytes", 's', NULL, 0, + N_("Swap the bytes of each halfword in the files"), GRID+1 }, + {"swap-halfwords", 'S', NULL, 0, + N_("Swap the halfwords of each word (4 bytes) in the files"), + GRID+1 }, + {"to-stdout", TO_STDOUT_OPTION, NULL, 0, + N_("Extract files to standard output"), GRID+1 }, +#undef GRID + + /* ********** */ +#define GRID 300 + {NULL, 0, NULL, 0, + N_("Operation modifiers valid only in copy-out mode:"), GRID }, + {"append", 'A', 0, 0, + N_("Append to an existing archive."), GRID+1 }, + {NULL, 'O', N_("[[USER@]HOST:]FILE-NAME"), 0, + N_("Archive filename to use instead of standard output. Optional USER and HOST specify the user and host names in case of a remote archive"), GRID+1 }, +#undef GRID + + /* ********** */ +#define GRID 400 + {NULL, 0, NULL, 0, + N_("Operation modifiers valid only in copy-pass mode:"), GRID}, + {"link", 'l', 0, 0, + N_("Link files instead of copying them, when possible"), GRID+1 }, + +#undef GRID + + /* ********** */ +#define GRID 500 + {NULL, 0, NULL, 0, + N_("Operation modifiers valid in copy-in and copy-out modes:"), GRID }, + {"absolute-filenames", ABSOLUTE_FILENAMES_OPTION, 0, 0, + N_("Do not strip file system prefix components from the file names"), + GRID+1 }, + {"no-absolute-filenames", NO_ABSOLUTE_FILENAMES_OPTION, 0, 0, + N_("Create all files relative to the current directory"), GRID+1 }, +#undef GRID + /* ********** */ +#define GRID 600 + {NULL, 0, NULL, 0, + N_("Operation modifiers valid in copy-out and copy-pass modes:"), GRID }, + {"null", '0', 0, 0, + N_("A list of filenames is terminated by a null character instead of a newline"), GRID+1 }, + {NULL, 'I', N_("[[USER@]HOST:]FILE-NAME"), 0, + N_("Archive filename to use instead of standard input. Optional USER and HOST specify the user and host names in case of a remote archive"), GRID+1 }, + {"dereference", 'L', 0, 0, + N_("Dereference symbolic links (copy the files that they point to instead of copying the links)."), GRID+1 }, + {"owner", 'R', N_("[USER][:.][GROUP]"), 0, + N_("Set the ownership of all files created to the specified USER and/or GROUP"), GRID+1 }, + {"reset-access-time", 'a', NULL, 0, + N_("Reset the access times of files after reading them"), GRID+1 }, + +#undef GRID + /* ********** */ +#define GRID 700 + {NULL, 0, NULL, 0, + N_("Operation modifiers valid in copy-in and copy-pass modes:"), GRID }, + {"preserve-modification-time", 'm', 0, 0, + N_("Retain previous file modification times when creating files"), GRID+1 }, + {"make-directories", 'd', 0, 0, + N_("Create leading directories where needed"), GRID+1 }, + {"no-preserve-owner", NO_PRESERVE_OWNER_OPTION, 0, 0, + N_("Do not change the ownership of the files"), GRID+1 }, + {"unconditional", 'u', NULL, 0, + N_("Replace all files unconditionally"), GRID+1 }, + {"sparse", SPARSE_OPTION, NULL, 0, + N_("Write files with large blocks of zeros as sparse files"), GRID+1 }, +#undef GRID + + /* ********** */ +#define GRID 800 + {NULL, 0, NULL, 0, + N_("Informative options:"), GRID }, + + {"help", '?', 0, 0, N_("Give this help list"), -1}, + {"usage", USAGE_OPTION, 0, 0, N_("Give a short usage message"), -1}, + {"license", LICENSE_OPTION, 0, 0, N_("Print license and exit"), -1}, + {"version", VERSION_OPTION, 0, 0, N_("Print program version"), -1}, + /* FIXME -V (--dot) conflicts with the default short option for + --version */ + {"HANG", HANG_OPTION, "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN, + N_("hang for SECS seconds (default 3600)"), 0}, +#undef GRID + {0, 0, 0, 0} +}; + +static char *input_archive_name = 0; +static char *output_archive_name = 0; + +static void +license () +{ + printf ("%s (%s) %s\n%s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION, + "Copyright (C) 2004 Free Software Foundation, Inc.\n"); + printf (_(" GNU cpio is free software; you can redistribute it and/or modify\n" + " it under the terms of the GNU General Public License as published by\n" + " the Free Software Foundation; either version 2 of the License, or\n" + " (at your option) any later version.\n" + "\n" + " GNU cpio is distributed in the hope that it will be useful,\n" + " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + " GNU General Public License for more details.\n" + "\n" + " You should have received a copy of the GNU General Public License\n" + " along with GNU cpio; if not, write to the Free Software Foundation,\n" + " Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n")); + exit (0); +} + +static int +warn_control (char *arg) +{ + static struct warn_tab { + char *name; + int flag; + } warn_tab[] = { + { "none", CPIO_WARN_ALL }, + { "truncate", CPIO_WARN_TRUNCATE }, + { "all", CPIO_WARN_ALL }, + { NULL } + }; + struct warn_tab *wt; + int offset = 0; + + if (strcmp (arg, "none") == 0) + { + warn_option = 0; + return 0; + } + + if (strlen (arg) > 2 && memcmp (arg, "no-", 3) == 0) + offset = 3; + + for (wt = warn_tab; wt->name; wt++) + if (strcmp (arg + offset, wt->name) == 0) + { + if (offset) + warn_option &= ~wt->flag; + else + warn_option |= wt->flag; + return 0; + } + + return 1; +} + +static error_t +parse_opt (int key, char *arg, struct argp_state *state) +{ + static volatile int _argp_hang; + switch (key) + { + case '0': /* Read null-terminated filenames. */ + name_end = '\0'; + break; + + case 'a': /* Reset access times. */ + reset_time_flag = true; + break; + + case 'A': /* Append to the archive. */ + append_flag = true; + break; + + case 'b': /* Swap bytes and halfwords. */ + swap_bytes_flag = true; + swap_halfwords_flag = true; + break; + + case 'B': /* Set block size to 5120. */ + io_block_size = 5120; + break; + + case BLOCK_SIZE_OPTION: /* --block-size */ + io_block_size = atoi (arg); + if (io_block_size < 1) + error (2, 0, _("invalid block size")); + io_block_size *= 512; + break; + + case 'c': /* Use the old portable ASCII format. */ + if (archive_format != arf_unknown) + error (0, EXIT_FAILURE, _("Archive format multiply defined")); +#ifdef SVR4_COMPAT + archive_format = arf_newascii; /* -H newc. */ +#else + archive_format = arf_oldascii; /* -H odc. */ +#endif + break; + + case 'C': /* Block size. */ + io_block_size = atoi (arg); + if (io_block_size < 1) + error (2, 0, _("invalid block size")); + break; + + case 'd': /* Create directories where needed. */ + create_dir_flag = true; + break; + + case 'f': /* Only copy files not matching patterns. */ + copy_matching_files = false; + break; + + case 'E': /* Pattern file name. */ + pattern_file_name = arg; + break; + + case 'F': /* Archive file name. */ + archive_name = arg; + break; + + case 'H': /* Header format name. */ + if (archive_format != arf_unknown) + error (PAXEXIT_FAILURE, 0, _("Archive format multiply defined")); + if (!strcasecmp (arg, "crc")) + archive_format = arf_crcascii; + else if (!strcasecmp (arg, "newc")) + archive_format = arf_newascii; + else if (!strcasecmp (arg, "odc")) + archive_format = arf_oldascii; + else if (!strcasecmp (arg, "bin")) + archive_format = arf_binary; + else if (!strcasecmp (arg, "ustar")) + archive_format = arf_ustar; + else if (!strcasecmp (arg, "tar")) + archive_format = arf_tar; + else if (!strcasecmp (arg, "hpodc")) + archive_format = arf_hpoldascii; + else if (!strcasecmp (arg, "hpbin")) + archive_format = arf_hpbinary; + else + error (2, 0, _("\ +invalid archive format `%s'; valid formats are:\n\ +crc newc odc bin ustar tar (all-caps also recognized)"), arg); + break; + + case 'i': /* Copy-in mode. */ + if (copy_function != 0) + error (PAXEXIT_FAILURE, 0, _("Mode already defined")); + copy_function = process_copy_in; + break; + + case 'I': /* Input archive file name. */ + input_archive_name = arg; + break; + + case 'k': /* Handle corrupted archives. We always handle + corrupted archives, but recognize this + option for compatability. */ + break; + + case 'l': /* Link files when possible. */ + link_flag = true; + break; + + case 'L': /* Dereference symbolic links. */ + xstat = stat; + break; + + case 'm': /* Retain previous file modify times. */ + retain_time_flag = true; + break; + + case 'M': /* New media message. */ + set_new_media_message (arg); + break; + + case 'n': /* Long list owner and group as numbers. */ + numeric_uid = true; + break; + + case NO_ABSOLUTE_FILENAMES_OPTION: /* --no-absolute-filenames */ + no_abs_paths_flag = true; + break; + + case ABSOLUTE_FILENAMES_OPTION: /* --absolute-filenames */ + no_abs_paths_flag = false; + break; + + case NO_PRESERVE_OWNER_OPTION: /* --no-preserve-owner */ + if (set_owner_flag || set_group_flag) + error (PAXEXIT_FAILURE, 0, + _("--no-preserve-owner cannot be used with --owner")); + no_chown_flag = true; + break; + + case 'o': /* Copy-out mode. */ + if (copy_function != 0) + error (PAXEXIT_FAILURE, 0, _("Mode already defined")); + copy_function = process_copy_out; + break; + + case 'O': /* Output archive file name. */ + output_archive_name = arg; + break; + + case ONLY_VERIFY_CRC_OPTION: + only_verify_crc_flag = true; + break; + + case 'p': /* Copy-pass mode. */ + if (copy_function != 0) + error (PAXEXIT_FAILURE, 0, _("Mode already defined")); + copy_function = process_copy_pass; + break; + + case RSH_COMMAND_OPTION: + rsh_command_option = arg; + break; + + case 'r': /* Interactively rename. */ + rename_flag = true; + break; + + case RENAME_BATCH_FILE_OPTION: + rename_batch_file = arg; + break; + + case QUIET_OPTION: + quiet_flag = true; + break; + + case 'R': /* Set the owner. */ + if (no_chown_flag) + error (PAXEXIT_FAILURE, 0, + _("--owner cannot be used with --no-preserve-owner")); + else + { + char *e, *u, *g; + + e = parse_user_spec (arg, &set_owner, &set_group, &u, &g); + if (e) + error (PAXEXIT_FAILURE, 0, "%s: %s", arg, e); + if (u) + { + free (u); + set_owner_flag = true; + } + if (g) + { + free (g); + set_group_flag = true; + } + } + break; + + case 's': /* Swap bytes. */ + swap_bytes_flag = true; + break; + + case 'S': /* Swap halfwords. */ + swap_halfwords_flag = true; + break; + + case 't': /* Only print a list. */ + table_flag = true; + break; + + case 'u': /* Replace all! Unconditionally! */ + unconditional_flag = true; + break; + + case 'v': /* Verbose! */ + verbose_flag = true; + break; + + case 'V': /* Print `.' for each file. */ + dot_flag = true; + break; + + case 'W': + if (warn_control (arg)) + argp_error (state, _("Invalid value for --warning option: %s"), arg); + break; + + case SPARSE_OPTION: + sparse_flag = true; + break; + + case FORCE_LOCAL_OPTION: + force_local_option = 1; + break; + +#ifdef DEBUG_CPIO + case DEBUG_OPTION: + debug_flag = true; + break; +#endif + + case TO_STDOUT_OPTION: + to_stdout_option = true; + break; + + case HANG_OPTION: + _argp_hang = atoi (arg ? arg : "3600"); + while (_argp_hang-- > 0) + sleep (1); + break; + + case '?': + argp_state_help (state, state->out_stream, ARGP_HELP_STD_HELP); + break; + + case USAGE_OPTION: + argp_state_help (state, state->out_stream, + ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK); + break; + + case VERSION_OPTION: + fprintf (state->out_stream, "%s\n", argp_program_version); + exit (0); + + case LICENSE_OPTION: + license (); + break; + + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +static struct argp argp = { + options, + parse_opt, + N_("[destination-directory]"), + doc, + NULL, + NULL, + NULL +}; + +/* Process the arguments. Set all options and set up the copy pass + directory or the copy in patterns. */ + +void +process_args (int argc, char *argv[]) +{ + void (*copy_in) (); /* Work around for pcc bug. */ + void (*copy_out) (); + int index; + + if (argc < 2) + error (PAXEXIT_FAILURE, 0, + _("You must specify one of -oipt options.\nTry `%s --help' or `%s --usage' for more information.\n"), + program_name, program_name); + + xstat = lstat; + + if (argp_parse (&argp, argc, argv, ARGP_IN_ORDER|ARGP_NO_HELP, &index, NULL)) + exit (1); + + /* Do error checking and look at other args. */ + + if (copy_function == 0) + { + if (table_flag) + copy_function = process_copy_in; + else + error (PAXEXIT_FAILURE, 0, + _("You must specify one of -oipt options.\nTry `%s --help' or `%s --usage' for more information.\n"), + program_name, program_name); + } + + /* Work around for pcc bug. */ + copy_in = process_copy_in; + copy_out = process_copy_out; + + if (copy_function == copy_in) + { + archive_des = 0; + CHECK_USAGE(link_flag, "--link", "--extract"); + CHECK_USAGE(reset_time_flag, "--reset", "--extract"); + CHECK_USAGE(xstat != lstat, "--dereference", "--extract"); + CHECK_USAGE(append_flag, "--append", "--extract"); + CHECK_USAGE(output_archive_name, "-O", "--extract"); + if (to_stdout_option) + { + CHECK_USAGE(create_dir_flag, "--make-directories", "--to-stdout"); + CHECK_USAGE(rename_flag, "--rename", "--to-stdout"); + CHECK_USAGE(no_chown_flag, "--no-preserve-owner", "--to-stdout"); + CHECK_USAGE(set_owner_flag||set_group_flag, "--owner", "--to-stdout"); + CHECK_USAGE(retain_time_flag, "--preserve-modification-time", + "--to-stdout"); + } + + if (archive_name && input_archive_name) + error (PAXEXIT_FAILURE, 0, + _("Both -I and -F are used in copy-in mode")); + + if (archive_format == arf_crcascii) + crc_i_flag = true; + num_patterns = argc - index; + save_patterns = &argv[index]; + if (input_archive_name) + archive_name = input_archive_name; + } + else if (copy_function == copy_out) + { + if (index != argc) + error (PAXEXIT_FAILURE, 0, _("Too many arguments")); + + archive_des = 1; + CHECK_USAGE(create_dir_flag, "--make-directories", "--create"); + CHECK_USAGE(rename_flag, "--rename", "--create"); + CHECK_USAGE(table_flag, "--list", "--create"); + CHECK_USAGE(unconditional_flag, "--unconditional", "--create"); + CHECK_USAGE(link_flag, "--link", "--create"); + CHECK_USAGE(sparse_flag, "--sparse", "--create"); + CHECK_USAGE(retain_time_flag, "--preserve-modification-time", + "--create"); + CHECK_USAGE(no_chown_flag, "--no-preserve-owner", "--create"); + CHECK_USAGE(swap_bytes_flag, "--swap-bytes (--swap)", "--create"); + CHECK_USAGE(swap_halfwords_flag, "--swap-halfwords (--swap)", + "--create"); + CHECK_USAGE(to_stdout_option, "--to-stdout", "--create"); + + if (append_flag && !(archive_name || output_archive_name)) + error (PAXEXIT_FAILURE, 0, + _("--append is used but no archive file name is given (use -F or -O options)")); + + CHECK_USAGE(rename_batch_file, "--rename-batch-file", "--create"); + CHECK_USAGE(input_archive_name, "-I", "--create"); + if (archive_name && output_archive_name) + error (PAXEXIT_FAILURE, 0, + _("Both -O and -F are used in copy-out mode")); + + if (archive_format == arf_unknown) + archive_format = arf_binary; + if (output_archive_name) + archive_name = output_archive_name; + } + else + { + /* Copy pass. */ + if (index < argc - 1) + error (PAXEXIT_FAILURE, 0, _("Too many arguments")); + else if (index > argc - 1) + error (PAXEXIT_FAILURE, 0, _("Not enough arguments")); + + if (archive_format != arf_unknown) + error (PAXEXIT_FAILURE, 0, + _("Archive format is not specified in copy-pass mode (use --format option)")); + + CHECK_USAGE(swap_bytes_flag, "--swap-bytes (--swap)", "--pass-through"); + CHECK_USAGE(swap_halfwords_flag, "--swap-halfwords (--swap)", + "--pass-through"); + CHECK_USAGE(table_flag, "--list", "--pass-through"); + CHECK_USAGE(rename_flag, "--rename", "--pass-through"); + CHECK_USAGE(append_flag, "--append", "--pass-through"); + CHECK_USAGE(rename_batch_file, "--rename-batch-file", "--pass-through"); + CHECK_USAGE(no_abs_paths_flag, "--no-absolute-pathnames", + "--pass-through"); + CHECK_USAGE(no_abs_paths_flag, "--absolute-pathnames", + "--pass-through"); + CHECK_USAGE(to_stdout_option, "--to-stdout", "--pass-through"); + + directory_name = argv[index]; + } + + if (archive_name) + { + if (copy_function != copy_in && copy_function != copy_out) + error (PAXEXIT_FAILURE, 0, + _("-F can be used only with --create or --extract")); + archive_des = open_archive (archive_name); + if (archive_des < 0) + error (PAXEXIT_FAILURE, errno, _("Cannot open %s"), + quotearg_colon (archive_name)); + } + + /* Prevent SysV non-root users from giving away files inadvertantly. + This happens automatically on BSD, where only root can give + away files. */ + if (set_owner_flag == false && set_group_flag == false && geteuid ()) + no_chown_flag = true; +} + +/* Initialize the input and output buffers to their proper size and + initialize all variables associated with the input and output + buffers. */ + +void +initialize_buffers () +{ + int in_buf_size, out_buf_size; + + if (copy_function == process_copy_in) + { + /* Make sure the input buffer can always hold 2 blocks and that it + is big enough to hold 1 tar record (512 bytes) even if it + is not aligned on a block boundary. The extra buffer space + is needed by process_copyin and peek_in_buf to automatically + figure out what kind of archive it is reading. */ + if (io_block_size >= 512) + in_buf_size = 2 * io_block_size; + else + in_buf_size = 1024; + out_buf_size = DISK_IO_BLOCK_SIZE; + } + else if (copy_function == process_copy_out) + { + in_buf_size = DISK_IO_BLOCK_SIZE; + out_buf_size = io_block_size; + } + else + { + in_buf_size = DISK_IO_BLOCK_SIZE; + out_buf_size = DISK_IO_BLOCK_SIZE; + } + + input_buffer = (char *) xmalloc (in_buf_size); + in_buff = input_buffer; + input_buffer_size = in_buf_size; + input_size = 0; + input_bytes = 0; + + output_buffer = (char *) xmalloc (out_buf_size); + out_buff = output_buffer; + output_size = 0; + output_bytes = 0; +} + +int +main (int argc, char *argv[]) +{ + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + program_name = argv[0]; + + process_args (argc, argv); + + initialize_buffers (); + + (*copy_function) (); + + if (archive_des >= 0 && rmtclose (archive_des) == -1) + error (1, errno, _("error closing archive")); + + exit (0); +} diff --git a/src/makepath.c b/src/makepath.c new file mode 100644 index 0000000..ff4c25f --- /dev/null +++ b/src/makepath.c @@ -0,0 +1,267 @@ +/* makepath.c -- Ensure that a directory path exists. + Copyright (C) 1990, 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 David MacKenzie and + Jim Meyering . */ + +/* This copy of makepath is almost like the fileutils one, but has + changes for HPUX CDF's. Maybe the 2 versions of makepath can + come together again in the future. */ + +#include +#include + +#include +#include +#include + +/* Ensure that the directory ARGPATH exists. + Remove any trailing slashes from ARGPATH before calling this function. + + Make any leading directories that don't already exist, with + permissions PARENT_MODE. + If the last element of ARGPATH does not exist, create it as + a new directory with permissions MODE. + If OWNER and GROUP are non-negative, make them the UID and GID of + created directories. + If VERBOSE_FMT_STRING is nonzero, use it as a printf format + string for printing a message after successfully making a directory, + with the name of the directory that was just made as an argument. + + Return 0 if ARGPATH exists as a directory with the proper + ownership and permissions when done, otherwise 1. */ + +int +make_path (char *argpath, + int mode, + int parent_mode, + uid_t owner, + gid_t group, + char *verbose_fmt_string) +{ + char *dirpath; /* A copy we can scribble NULs on. */ + struct stat stats; + int retval = 0; + int oldmask = umask (0); + dirpath = alloca (strlen (argpath) + 1); + strcpy (dirpath, argpath); + + if (stat (dirpath, &stats)) + { + char *slash; + int tmp_mode; /* Initial perms for leading dirs. */ + int re_protect; /* Should leading dirs be unwritable? */ + struct ptr_list + { + char *dirname_end; + struct ptr_list *next; + }; + struct ptr_list *p, *leading_dirs = NULL; + + /* If leading directories shouldn't be writable or executable, + or should have set[ug]id or sticky bits set and we are setting + their owners, we need to fix their permissions after making them. */ + if (((parent_mode & 0300) != 0300) + || (owner != (uid_t) -1 && group != (gid_t) -1 + && (parent_mode & 07000) != 0)) + { + tmp_mode = 0700; + re_protect = 1; + } + else + { + tmp_mode = parent_mode; + re_protect = 0; + } + + slash = dirpath; + while (*slash == '/') + slash++; + while ((slash = strchr (slash, '/'))) + { +#ifdef HPUX_CDF + int iscdf; + iscdf = 0; +#endif + *slash = '\0'; + if (stat (dirpath, &stats)) + { +#ifdef HPUX_CDF + /* If this component of the pathname ends in `+' and is + followed by 2 `/'s, then this is a CDF. We remove the + `+' from the name and create the directory. Later + we will "hide" the directory. */ + if ( (*(slash +1) == '/') && (*(slash -1) == '+') ) + { + iscdf = 1; + *(slash -1) = '\0'; + } +#endif + if (mkdir (dirpath, tmp_mode)) + { + error (0, errno, _("cannot make directory `%s'"), dirpath); + umask (oldmask); + return 1; + } + else + { + if (verbose_fmt_string != NULL) + error (0, 0, verbose_fmt_string, dirpath); + + if (owner != (uid_t) -1 && group != (gid_t) -1 + && chown (dirpath, owner, group) +#ifdef AFS + && errno != EPERM +#endif + ) + { + chown_error_details (dirpath, owner, group); + retval = 1; + } + if (re_protect) + { + struct ptr_list *new = (struct ptr_list *) + alloca (sizeof (struct ptr_list)); + new->dirname_end = slash; + new->next = leading_dirs; + leading_dirs = new; + } +#ifdef HPUX_CDF + if (iscdf) + { + /* If this is a CDF, "hide" the directory by setting + its hidden/setuid bit. Also add the `+' back to + its name (since once it's "hidden" we must refer + to as `name+' instead of `name'). */ + chmod (dirpath, 04700); + *(slash - 1) = '+'; + } +#endif + } + } + else if (!S_ISDIR (stats.st_mode)) + { + error (0, 0, _("`%s' exists but is not a directory"), dirpath); + umask (oldmask); + return 1; + } + + *slash++ = '/'; + + /* Avoid unnecessary calls to `stat' when given + pathnames containing multiple adjacent slashes. */ + while (*slash == '/') + slash++; + } + + /* We're done making leading directories. + Make the final component of the path. */ + + if (mkdir (dirpath, mode)) + { + /* In some cases, if the final component in dirpath was `.' then we + just got an EEXIST error from that last mkdir(). If that's + the case, ignore it. */ + if ( (errno != EEXIST) || + (stat (dirpath, &stats) != 0) || + (!S_ISDIR (stats.st_mode) ) ) + { + error (0, errno, _("cannot make directory `%s'"), dirpath); + umask (oldmask); + return 1; + } + } + if (verbose_fmt_string != NULL) + error (0, 0, verbose_fmt_string, dirpath); + + if (owner != (uid_t) -1 && group != (gid_t) -1) + { + if (chown (dirpath, owner, group) +#ifdef AFS + && errno != EPERM +#endif + ) + { + chown_error_details (dirpath, owner, group); + retval = 1; + } + } + /* chown may have turned off some permission bits we wanted. */ + if ((mode & 07000) != 0 && chmod (dirpath, mode)) + { + chmod_error_details (dirpath, mode); + retval = 1; + } + + /* If the mode for leading directories didn't include owner "wx" + privileges, we have to reset their protections to the correct + value. */ + for (p = leading_dirs; p != NULL; p = p->next) + { + *p->dirname_end = '\0'; +#if 0 + /* cpio always calls make_path with parent mode 0700, so + we don't have to do this. If we ever do have to do this, + we have to stat the directory first to get the setuid + bit so we don't break HP CDF's. */ + if (chmod (dirpath, parent_mode)) + { + chmod_error_details (dirpath, parent_mode); + retval = 1; + } +#endif + + } + } + else + { + /* We get here if the entire path already exists. */ + + if (!S_ISDIR (stats.st_mode)) + { + error (0, 0, _("`%s' exists but is not a directory"), dirpath); + umask (oldmask); + return 1; + } + + /* chown must precede chmod because on some systems, + chown clears the set[ug]id bits for non-superusers, + resulting in incorrect permissions. + On System V, users can give away files with chown and then not + be able to chmod them. So don't give files away. */ + + if (owner != (uid_t) -1 && group != (gid_t) -1 + && chown (dirpath, owner, group) +#ifdef AFS + && errno != EPERM +#endif + ) + { + chown_error_details (dirpath, owner, group); + retval = 1; + } + if (chmod (dirpath, mode)) + { + chmod_error_details (dirpath, mode); + retval = 1; + } + } + + umask (oldmask); + return retval; +} diff --git a/src/mt.c b/src/mt.c new file mode 100644 index 0000000..c07e235 --- /dev/null +++ b/src/mt.c @@ -0,0 +1,337 @@ +/* mt -- control magnetic tape drive operation + Copyright (C) 1991, 1992, 1995, 2001 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 -f is not given, the environment variable TAPE is used; + if that is not set, a default device defined in sys/mtio.h is used. + The device must be either a character special file or a remote + tape drive with the form "[user@]system:path". + The default count is 1. Some operations ignore it. + + Exit status: + 0 success + 1 invalid operation or device name + 2 operation failed + + Operations (unique abbreviations are accepted): + eof, weof Write COUNT EOF marks at current position on tape. + fsf Forward space COUNT files. + Tape is positioned on the first block of the file. + bsf Backward space COUNT files. + Tape is positioned on the first block of the file. + fsr Forward space COUNT records. + bsr Backward space COUNT records. + bsfm Backward space COUNT file marks. + Tape is positioned on the beginning-of-the-tape side of + the file mark. + asf Absolute space to file number COUNT. + Equivalent to rewind followed by fsf COUNT. + eom Space to the end of the recorded media on the tape + (for appending files onto tapes). + rewind Rewind the tape. + offline, rewoffl + Rewind the tape and, if applicable, unload the tape. + status Print status information about the tape unit. + retension Rewind the tape, then wind it to the end of the reel, + then rewind it again. + erase Erase the tape. + + David MacKenzie */ + +#include + +#include +#include +#include +#include +#ifdef HAVE_SYS_MTIO_H +# ifdef HAVE_SYS_IO_TRIOCTL_H +# include +# endif +# include +#endif +#include +#include +#include +#include +#include + +#ifdef HAVE_LOCALE_H +# include +#endif +#include + +#if defined(HAVE_UNISTD_H) +#include +#endif +#include + +#if defined(HAVE_STRING_H) || defined(STDC_HEADERS) +#include +#else +#include +#endif + +#if defined(HAVE_STDLIB_H) +# include +#endif + +#if !HAVE_DECL_ERRNO +extern int errno; +#endif +#if !HAVE_DECL_GETENV +char *getenv (); +#endif +#if !HAVE_DECL_ATOI +int atoi (); +#endif +#if !HAVE_DECL_EXIT +void exit (); +#endif + +char *opnames[] = +{ + "eof", "weof", "fsf", "bsf", "fsr", "bsr", + "rewind", "offline", "rewoffl", "eject", "status", +#ifdef MTBSFM + "bsfm", +#endif +#ifdef MTEOM + "eom", +#endif +#ifdef MTRETEN + "retension", +#endif +#ifdef MTERASE + "erase", +#endif + "asf", +#ifdef MTFSFM + "fsfm", +#endif +#ifdef MTSEEK + "seek", +#endif + NULL +}; + +#define MTASF 600 /* Random unused number. */ +short operations[] = +{ + MTWEOF, MTWEOF, MTFSF, MTBSF, MTFSR, MTBSR, + MTREW, MTOFFL, MTOFFL, MTOFFL, MTNOP, +#ifdef MTBSFM + MTBSFM, +#endif +#ifdef MTEOM + MTEOM, +#endif +#ifdef MTRETEN + MTRETEN, +#endif +#ifdef MTERASE + MTERASE, +#endif + MTASF, +#ifdef MTFSFM + MTFSFM, +#endif +#ifdef MTSEEK + MTSEEK, +#endif + 0 +}; + +struct option longopts[] = +{ + {"file", 1, NULL, 'f'}, + {"rsh-command", 1, NULL, 1}, + {"version", 0, NULL, 'V'}, + {"help", 0, NULL, 'H'}, + {NULL, 0, NULL, 0} +}; + +/* The name this program was run with. */ +char *program_name; + +void +check_type (char *dev, int desc) +{ + struct stat stats; + + if (_isrmt (desc)) + return; + if (fstat (desc, &stats) == -1) + stat_error (dev); + if ((stats.st_mode & S_IFMT) != S_IFCHR) + error (1, 0, _("%s is not a character special file"), dev); +} +void +perform_operation (char *dev, int desc, short op, int count) +{ + struct mtop control; + + control.mt_op = op; + control.mt_count = count; + /* Debian hack: The rmtioctl function returns -1 in case of an + error, not 0. This bug has been reported to + "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */ + if (rmtioctl (desc, MTIOCTOP, (char*)&control) == -1) + error (2, errno, _("%s: rmtioctl failed"), dev); +} + +void +print_status (char *dev, int desc) +{ + struct mtget status; + + if (rmtioctl (desc, MTIOCGET, (char*)&status) == -1) + error (2, errno, _("%s: rmtioctl failed"), dev); + + printf ("drive type = %d\n", (int) status.mt_type); +#if defined(hpux) || defined(__hpux) + printf ("drive status (high) = %d\n", (int) status.mt_dsreg1); + printf ("drive status (low) = %d\n", (int) status.mt_dsreg2); +#else + printf ("drive status = %d\n", (int) status.mt_dsreg); +#endif + printf ("sense key error = %d\n", (int) status.mt_erreg); + printf ("residue count = %d\n", (int) status.mt_resid); +#if !defined(ultrix) && !defined(__ultrix__) && !defined(hpux) && !defined(__hpux) && !defined(__osf__) + printf ("file number = %d\n", (int) status.mt_fileno); + printf ("block number = %d\n", (int) status.mt_blkno); +#endif +} + +void +usage (FILE *fp,int status) +{ + fprintf (fp, _("\ +Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n\ +\t[--help] [--version] operation [count]\n"), + program_name); + exit (status); +} + +int +main (int argc, char **argv) +{ + short operation; + int count; + char *tapedev; + int tapedesc; + int i; + char *rsh_command_option = NULL; + + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + program_name = argv[0]; + tapedev = NULL; + count = 1; + + /* Debian hack: Fixed a bug in the -V flag. This bug has been + reported to "bug-gnu-utils@prep.ai.mit.edu". -BEM */ + while ((i = getopt_long (argc, argv, "f:t:VH", longopts, (int *) 0)) != -1) + { + switch (i) + { + case 'f': + case 't': + tapedev = optarg; + break; + + case 1: + rsh_command_option = optarg; + break; + + case 'V': + printf ("mt (%s)\n", PACKAGE_STRING); + exit (0); + break; + + case 'H': + default: + usage (stdout, 0); + } + } + + if (optind == argc) + usage (stderr, 1); + + i = argmatch (argv[optind], opnames); + if (i < 0) + { + argmatch_invalid ("tape operation", argv[optind], i); + exit (1); + } + operation = operations[i]; + + if (++optind < argc) + /* Debian hack: Replaced the atoi function call with strtol so + that hexidecimal values can be used for the count parameter. + This bug has been reported to "bug-gnu-utils@prep.ai.mit.edu". + (97/12/5) -BEM */ +#if defined(STDC_HEADERS) + count = (int) strtol (argv[optind], NULL, 0); +#else + count = atoi (argv[optind]); +#endif + if (++optind < argc) + usage (stderr, 1); + + if (tapedev == NULL) + { + tapedev = getenv ("TAPE"); + if (tapedev == NULL) +#ifdef DEFTAPE /* From sys/mtio.h. */ + tapedev = DEFTAPE; +#else + error (1, 0, _("no tape device specified")); +#endif + } + + if ( (operation == MTWEOF) +#ifdef MTERASE + || (operation == MTERASE) +#endif + ) + tapedesc = rmtopen (tapedev, O_WRONLY, 0, rsh_command_option); + else + tapedesc = rmtopen (tapedev, O_RDONLY, 0, rsh_command_option); + if (tapedesc == -1) + error (1, errno, _("%s: rmtopen failed"), tapedev); + check_type (tapedev, tapedesc); + + if (operation == MTASF) + { + perform_operation (tapedev, tapedesc, MTREW, 1); + operation = MTFSF; + } + perform_operation (tapedev, tapedesc, operation, count); + if (operation == MTNOP) + print_status (tapedev, tapedesc); + + if (rmtclose (tapedesc) == -1) + error (2, errno, _("%s: rmtclose failed"), tapedev); + + exit (0); +} + diff --git a/src/safe-stat.h b/src/safe-stat.h new file mode 100644 index 0000000..3a37970 --- /dev/null +++ b/src/safe-stat.h @@ -0,0 +1 @@ +#define SAFE_STAT(path,pbuf) stat(path,pbuf) diff --git a/src/tar.c b/src/tar.c new file mode 100644 index 0000000..2a470c4 --- /dev/null +++ b/src/tar.c @@ -0,0 +1,479 @@ +/* tar.c - read in write tar headers for cpio + Copyright (C) 1992, 2001, 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. */ + +#include + +#include +#include +#include +#include "filetypes.h" +#include "cpiohdr.h" +#include "dstring.h" +#include "extern.h" +#include +#include "tarhdr.h" + +/* Stash the tar linkname in static storage. */ + +static char * +stash_tar_linkname (char *linkname) +{ + static char hold_tar_linkname[TARLINKNAMESIZE + 1]; + + strncpy (hold_tar_linkname, linkname, TARLINKNAMESIZE); + hold_tar_linkname[TARLINKNAMESIZE] = '\0'; + return hold_tar_linkname; +} + +/* Try to split a long file name into prefix and suffix parts separated + by a slash. Return the length of the prefix (not counting the slash). */ + +static size_t +split_long_name (const char *name, size_t length) +{ + size_t i; + + if (length > TARPREFIXSIZE) + length = TARPREFIXSIZE+2; + for (i = length - 1; i > 0; i--) + if (name[i] == '/') + break; + return i; +} + +/* Stash the tar filename and optional prefix in static storage. */ + +static char * +stash_tar_filename (char *prefix, char *filename) +{ + static char hold_tar_filename[TARNAMESIZE + TARPREFIXSIZE + 2]; + if (prefix == NULL || *prefix == '\0') + { + strncpy (hold_tar_filename, filename, TARNAMESIZE); + hold_tar_filename[TARNAMESIZE] = '\0'; + } + else + { + strncpy (hold_tar_filename, prefix, TARPREFIXSIZE); + hold_tar_filename[TARPREFIXSIZE] = '\0'; + strcat (hold_tar_filename, "/"); + strncat (hold_tar_filename, filename, TARNAMESIZE); + hold_tar_filename[TARPREFIXSIZE + TARNAMESIZE] = '\0'; + } + return hold_tar_filename; +} + +/* Convert a number into a string of octal digits. + Convert long VALUE into a DIGITS-digit field at WHERE, + including a trailing space and room for a NUL. DIGITS==3 means + 1 digit, a space, and room for a NUL. + + We assume the trailing NUL is already there and don't fill it in. + This fact is used by start_header and finish_header, so don't change it! + + This is be equivalent to: + sprintf (where, "%*lo ", digits - 2, value); + except that sprintf fills in the trailing NUL and we don't. */ + +static void +to_oct (register long value, register int digits, register char *where) +{ + --digits; /* Leave the trailing NUL slot alone. */ + + /* Produce the digits -- at least one. */ + do + { + where[--digits] = '0' + (char) (value & 7); /* One octal digit. */ + value >>= 3; + } + while (digits > 0 && value != 0); + + /* Add leading zeroes, if necessary. */ + while (digits > 0) + where[--digits] = '0'; +} + + + +/* Compute and return a checksum for TAR_HDR, + counting the checksum bytes as if they were spaces. */ + +unsigned int +tar_checksum (struct tar_header *tar_hdr) +{ + unsigned int sum = 0; + char *p = (char *) tar_hdr; + char *q = p + TARRECORDSIZE; + int i; + + while (p < tar_hdr->chksum) + sum += *p++ & 0xff; + for (i = 0; i < 8; ++i) + { + sum += ' '; + ++p; + } + while (p < q) + sum += *p++ & 0xff; + return sum; +} + +/* Write out header FILE_HDR, including the file name, to file + descriptor OUT_DES. */ + +void +write_out_tar_header (struct cpio_file_stat *file_hdr, int out_des) +{ + int name_len; + union tar_record tar_rec; + struct tar_header *tar_hdr = (struct tar_header *) &tar_rec; + + memset (&tar_rec, 0, sizeof tar_rec); + + /* process_copy_out must ensure that file_hdr->c_name is short enough, + or we will lose here. */ + + name_len = strlen (file_hdr->c_name); + if (name_len <= TARNAMESIZE) + { + strncpy (tar_hdr->name, file_hdr->c_name, name_len); + } + else + { + /* Fit as much as we can into `name', the rest into `prefix'. */ + int prefix_len = split_long_name (file_hdr->c_name, name_len); + + strncpy (tar_hdr->prefix, file_hdr->c_name, prefix_len); + strncpy (tar_hdr->name, file_hdr->c_name + prefix_len + 1, + name_len - prefix_len - 1); + } + + /* Ustar standard (POSIX.1-1988) requires the mode to contain only 3 octal + digits */ + to_oct (file_hdr->c_mode & MODE_ALL, 8, tar_hdr->mode); + to_oct (file_hdr->c_uid, 8, tar_hdr->uid); + to_oct (file_hdr->c_gid, 8, tar_hdr->gid); + to_oct (file_hdr->c_filesize, 12, tar_hdr->size); + to_oct (file_hdr->c_mtime, 12, tar_hdr->mtime); + + switch (file_hdr->c_mode & CP_IFMT) + { + case CP_IFREG: + if (file_hdr->c_tar_linkname) + { + /* process_copy_out makes sure that c_tar_linkname is shorter + than TARLINKNAMESIZE. */ + strncpy (tar_hdr->linkname, file_hdr->c_tar_linkname, + TARLINKNAMESIZE); + tar_hdr->typeflag = LNKTYPE; + to_oct (0, 12, tar_hdr->size); + } + else + tar_hdr->typeflag = REGTYPE; + break; + case CP_IFDIR: + tar_hdr->typeflag = DIRTYPE; + break; + case CP_IFCHR: + tar_hdr->typeflag = CHRTYPE; + break; + case CP_IFBLK: + tar_hdr->typeflag = BLKTYPE; + break; +#ifdef CP_IFIFO + case CP_IFIFO: + tar_hdr->typeflag = FIFOTYPE; + break; +#endif /* CP_IFIFO */ +#ifdef CP_IFLNK + case CP_IFLNK: + tar_hdr->typeflag = SYMTYPE; + /* process_copy_out makes sure that c_tar_linkname is shorter + than TARLINKNAMESIZE. */ + strncpy (tar_hdr->linkname, file_hdr->c_tar_linkname, + TARLINKNAMESIZE); + to_oct (0, 12, tar_hdr->size); + break; +#endif /* CP_IFLNK */ + } + + if (archive_format == arf_ustar) + { + char *name; + + strncpy (tar_hdr->magic, TMAGIC, TMAGLEN); + strncpy (tar_hdr->magic + TMAGLEN, TVERSION, TVERSLEN); + + name = getuser (file_hdr->c_uid); + if (name) + strcpy (tar_hdr->uname, name); + name = getgroup (file_hdr->c_gid); + if (name) + strcpy (tar_hdr->gname, name); + + to_oct (file_hdr->c_rdev_maj, 8, tar_hdr->devmajor); + to_oct (file_hdr->c_rdev_min, 8, tar_hdr->devminor); + } + + to_oct (tar_checksum (tar_hdr), 8, tar_hdr->chksum); + + tape_buffered_write ((char *) &tar_rec, out_des, TARRECORDSIZE); +} + +/* Return nonzero iff all the bytes in BLOCK are NUL. + SIZE is the number of bytes to check in BLOCK; it must be a + multiple of sizeof (long). */ + +int +null_block (long *block, int size) +{ + register long *p = block; + register int i = size / sizeof (long); + + while (i--) + if (*p++) + return 0; + return 1; +} + +/* Read a tar header, including the file name, from file descriptor IN_DES + into FILE_HDR. */ + +void +read_in_tar_header (struct cpio_file_stat *file_hdr, int in_des) +{ + long bytes_skipped = 0; + int warned = false; + union tar_record tar_rec; + struct tar_header *tar_hdr = (struct tar_header *) &tar_rec; + uid_t *uidp; + gid_t *gidp; + + tape_buffered_read ((char *) &tar_rec, in_des, TARRECORDSIZE); + + /* Check for a block of 0's. */ + if (null_block ((long *) &tar_rec, TARRECORDSIZE)) + { +#if 0 + /* Found one block of 512 0's. If the next block is also all 0's + then this is the end of the archive. If not, assume the + previous block was all corruption and continue reading + the archive. */ + /* Commented out because GNU tar sometimes creates archives with + only one block of 0's at the end. This happened for the + cpio 2.0 distribution! */ + tape_buffered_read ((char *) &tar_rec, in_des, TARRECORDSIZE); + if (null_block ((long *) &tar_rec, TARRECORDSIZE)) +#endif + { + file_hdr->c_name = CPIO_TRAILER_NAME; + return; + } +#if 0 + bytes_skipped = TARRECORDSIZE; +#endif + } + + while (1) + { + file_hdr->c_chksum = FROM_OCTAL (tar_hdr->chksum); + + if (file_hdr->c_chksum != tar_checksum (tar_hdr)) + { + /* If the checksum is bad, skip 1 byte and try again. When + we try again we do not look for an EOF record (all zeros), + because when we start skipping bytes in a corrupted archive + the chances are pretty good that we might stumble across + 2 blocks of 512 zeros (that probably is not really the last + record) and it is better to miss the EOF and give the user + a "premature EOF" error than to give up too soon on a corrupted + archive. */ + if (!warned) + { + error (0, 0, _("invalid header: checksum error")); + warned = true; + } + memmove (&tar_rec, ((char *) &tar_rec) + 1, TARRECORDSIZE - 1); + tape_buffered_read (((char *) &tar_rec) + (TARRECORDSIZE - 1), in_des, 1); + ++bytes_skipped; + continue; + } + + if (archive_format != arf_ustar) + file_hdr->c_name = stash_tar_filename (NULL, tar_hdr->name); + else + file_hdr->c_name = stash_tar_filename (tar_hdr->prefix, tar_hdr->name); + file_hdr->c_nlink = 1; + file_hdr->c_mode = FROM_OCTAL (tar_hdr->mode); + file_hdr->c_mode = file_hdr->c_mode & 07777; + /* Debian hack: This version of cpio uses the -n flag also to extract + tar archives using the numeric UID/GID instead of the user/group + names in /etc/passwd and /etc/groups. (98/10/15) -BEM */ + if (archive_format == arf_ustar && !numeric_uid + && (uidp = getuidbyname (tar_hdr->uname))) + file_hdr->c_uid = *uidp; + else + file_hdr->c_uid = FROM_OCTAL (tar_hdr->uid); + + if (archive_format == arf_ustar && !numeric_uid + && (gidp = getgidbyname (tar_hdr->gname))) + file_hdr->c_gid = *gidp; + else + file_hdr->c_gid = FROM_OCTAL (tar_hdr->gid); + file_hdr->c_filesize = FROM_OCTAL (tar_hdr->size); + file_hdr->c_mtime = FROM_OCTAL (tar_hdr->mtime); + file_hdr->c_rdev_maj = FROM_OCTAL (tar_hdr->devmajor); + file_hdr->c_rdev_min = FROM_OCTAL (tar_hdr->devminor); + file_hdr->c_tar_linkname = NULL; + + switch (tar_hdr->typeflag) + { + case REGTYPE: + case CONTTYPE: /* For now, punt. */ + default: + file_hdr->c_mode |= CP_IFREG; + break; + case DIRTYPE: + file_hdr->c_mode |= CP_IFDIR; + break; + case CHRTYPE: + file_hdr->c_mode |= CP_IFCHR; + /* If a POSIX tar header has a valid linkname it's always supposed + to set typeflag to be LNKTYPE. System V.4 tar seems to + be broken, and for device files with multiple links it + puts the name of the link into linkname, but leaves typeflag + as CHRTYPE, BLKTYPE, FIFOTYPE, etc. */ + file_hdr->c_tar_linkname = stash_tar_linkname (tar_hdr->linkname); + + /* Does POSIX say that the filesize must be 0 for devices? We + assume so, but HPUX's POSIX tar sets it to be 1 which causes + us problems (when reading an archive we assume we can always + skip to the next file by skipping filesize bytes). For + now at least, it's easier to clear filesize for devices, + rather than check everywhere we skip in copyin.c. */ + file_hdr->c_filesize = 0; + break; + case BLKTYPE: + file_hdr->c_mode |= CP_IFBLK; + file_hdr->c_tar_linkname = stash_tar_linkname (tar_hdr->linkname); + file_hdr->c_filesize = 0; + break; +#ifdef CP_IFIFO + case FIFOTYPE: + file_hdr->c_mode |= CP_IFIFO; + file_hdr->c_tar_linkname = stash_tar_linkname (tar_hdr->linkname); + file_hdr->c_filesize = 0; + break; +#endif + case SYMTYPE: +#ifdef CP_IFLNK + file_hdr->c_mode |= CP_IFLNK; + file_hdr->c_tar_linkname = stash_tar_linkname (tar_hdr->linkname); + file_hdr->c_filesize = 0; + break; + /* Else fall through. */ +#endif + case LNKTYPE: + file_hdr->c_mode |= CP_IFREG; + file_hdr->c_tar_linkname = stash_tar_linkname (tar_hdr->linkname); + file_hdr->c_filesize = 0; + break; + + case AREGTYPE: + /* Old tar format; if the last char in filename is '/' then it is + a directory, otherwise it's a regular file. */ + if (file_hdr->c_name[strlen (file_hdr->c_name) - 1] == '/') + file_hdr->c_mode |= CP_IFDIR; + else + file_hdr->c_mode |= CP_IFREG; + break; + } + break; + } + if (bytes_skipped > 0) + warn_junk_bytes (bytes_skipped); +} + +/* Return + 2 if BUF is a valid POSIX tar header (the checksum is correct + and it has the "ustar" magic string), + 1 if BUF is a valid old tar header (the checksum is correct), + 0 otherwise. */ + +int +is_tar_header (char *buf) +{ + struct tar_header *tar_hdr = (struct tar_header *) buf; + unsigned long chksum; + + chksum = FROM_OCTAL (tar_hdr->chksum); + + if (chksum != tar_checksum (tar_hdr)) + return 0; + + /* GNU tar 1.10 and previous set the magic field to be "ustar " instead + of "ustar\0". Only look at the first 5 characters of the magic + field so we can recognize old GNU tar ustar archives. */ + if (!strncmp (tar_hdr->magic, TMAGIC, TMAGLEN - 1)) + return 2; + return 1; +} + +/* Return true if the filename is too long to fit in a tar header. + For old tar headers, if the filename's length is less than or equal + to 100 then it will fit, otherwise it will not. For POSIX tar headers, + if the filename's length is less than or equal to 100 then it + will definitely fit, and if it is greater than 256 then it + will definitely not fit. If the length is between 100 and 256, + then the filename will fit only if it is possible to break it + into a 155 character "prefix" and 100 character "name". There + must be a slash between the "prefix" and the "name", although + the slash is not stored or counted in either the "prefix" or + the "name", and there must be at least one character in both + the "prefix" and the "name". If it is not possible to break down + the filename like this then it will not fit. */ + +int +is_tar_filename_too_long (char *name) +{ + int whole_name_len; + int prefix_name_len; + + whole_name_len = strlen (name); + if (whole_name_len <= TARNAMESIZE) + return false; + + if (archive_format != arf_ustar) + return true; + + if (whole_name_len > TARNAMESIZE + TARPREFIXSIZE + 1) + return true; + + /* See whether we can split up the name into acceptably-sized + `prefix' and `name' (`p') pieces. */ + prefix_name_len = split_long_name (name, whole_name_len); + + /* Interestingly, a name consisting of a slash followed by + TARNAMESIZE characters can't be stored, because the prefix + would be empty, and thus ignored. */ + if (prefix_name_len == 0 + || whole_name_len - prefix_name_len - 1 > TARNAMESIZE) + return true; + + return false; +} diff --git a/src/tar.h b/src/tar.h new file mode 100644 index 0000000..7b27e86 --- /dev/null +++ b/src/tar.h @@ -0,0 +1,112 @@ +/* Extended tar format from POSIX.1. + Copyright (C) 1992 Free Software Foundation, Inc. + Written by David J. MacKenzie. + +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General +Public License along with this library; see the file COPYING.LIB. +If not, write to the Free Software Foundation, Inc., 51 Franklin +Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + +#ifndef _TAR_H + +#define _TAR_H 1 + + +/* A tar archive consists of 512-byte blocks. + Each file in the archive has a header block followed by 0+ data blocks. + Two blocks of NUL bytes indicate the end of the archive. */ + +/* The fields of header blocks: + All strings are stored as ISO 646 (approximately ASCII) strings. + + Fields are numeric unless otherwise noted below; numbers are ISO 646 + representations of octal numbers, with leading zeros as needed. + + linkname is only valid when typeflag==LNKTYPE. It doesn't use prefix; + files that are links to pathnames >100 chars long can not be stored + in a tar archive. + + If typeflag=={LNKTYPE,SYMTYPE,DIRTYPE} then size must be 0. + + devmajor and devminor are only valid for typeflag=={BLKTYPE,CHRTYPE}. + + chksum contains the sum of all 512 bytes in the header block, + treating each byte as an 8-bit unsigned value and treating the + 8 bytes of chksum as blank characters. + + uname and gname are used in preference to uid and gid, if those + names exist locally. + + Field Name Byte Offset Length in Bytes Field Type + name 0 100 NUL-terminated if NUL fits + mode 100 8 + uid 108 8 + gid 116 8 + size 124 12 + mtime 136 12 + chksum 148 8 + typeflag 156 1 see below + linkname 157 100 NUL-terminated if NUL fits + magic 257 6 must be TMAGIC (NUL term.) + version 263 2 must be TVERSION + uname 265 32 NUL-terminated + gname 297 32 NUL-terminated + devmajor 329 8 + devminor 337 8 + prefix 345 155 NUL-terminated if NUL fits + + If the first character of prefix is '\0', the file name is name; + otherwise, it is prefix/name. Files whose pathnames don't fit in that + length can not be stored in a tar archive. */ + +/* The bits in mode: */ +#define TSUID 04000 +#define TSGID 02000 +#define TSVTX 01000 +#define TUREAD 00400 +#define TUWRITE 00200 +#define TUEXEC 00100 +#define TGREAD 00040 +#define TGWRITE 00020 +#define TGEXEC 00010 +#define TOREAD 00004 +#define TOWRITE 00002 +#define TOEXEC 00001 + +/* The values for typeflag: + Values 'A'-'Z' are reserved for custom implementations. + All other values are reserved for future POSIX.1 revisions. */ + +#define REGTYPE '0' /* Regular file (preferred code). */ +#define AREGTYPE '\0' /* Regular file (alternate code). */ +#define LNKTYPE '1' /* Hard link. */ +#define SYMTYPE '2' /* Symbolic link (hard if not supported). */ +#define CHRTYPE '3' /* Character special. */ +#define BLKTYPE '4' /* Block special. */ +#define DIRTYPE '5' /* Directory. */ +#define FIFOTYPE '6' /* Named pipe. */ +#define CONTTYPE '7' /* Contiguous file */ + /* (regular file if not supported). */ + +/* Contents of magic field and its length. */ +#define TMAGIC "ustar" +#define TMAGLEN 6 + +/* Contents of the version field and its length. */ +#define TVERSION "00" +#define TVERSLEN 2 + + +#endif /* tar.h */ diff --git a/src/tarhdr.h b/src/tarhdr.h new file mode 100644 index 0000000..b901739 --- /dev/null +++ b/src/tarhdr.h @@ -0,0 +1,63 @@ +/* Extended tar header from POSIX.1. + Copyright (C) 1992 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 _TARHDR_H + +#define _TARHDR_H 1 + +#include + +/* Size of `name' field. */ +#define TARNAMESIZE 100 + +/* Size of `linkname' field. */ +#define TARLINKNAMESIZE 100 + +/* Size of `prefix' field. */ +#define TARPREFIXSIZE 155 + +/* Size of entire tar header. */ +#define TARRECORDSIZE 512 + +struct tar_header +{ + char name[TARNAMESIZE]; + char mode[8]; + char uid[8]; + char gid[8]; + char size[12]; + char mtime[12]; + char chksum[8]; + char typeflag; + char linkname[TARLINKNAMESIZE]; + char magic[6]; + char version[2]; + char uname[32]; + char gname[32]; + char devmajor[8]; + char devminor[8]; + char prefix[TARPREFIXSIZE]; +}; + +union tar_record +{ + struct tar_header header; + char buffer[TARRECORDSIZE]; +}; + +#endif /* tarhdr.h */ diff --git a/src/userspec.c b/src/userspec.c new file mode 100644 index 0000000..d9be4f4 --- /dev/null +++ b/src/userspec.c @@ -0,0 +1,259 @@ +/* userspec.c -- Parse a user and group string. + Copyright (C) 1989, 1990, 1991, 1992, 2001, + 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. */ + +/* Written by David MacKenzie . */ + +#include + +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else +#ifdef HAVE_ALLOCA_H +#include +#else +#ifdef _AIX + #pragma alloca +#else +char *alloca (); +#endif +#endif +#endif + +#include +#include +#include +#include +#include + +#if !HAVE_DECL_GETPWNAM +extern struct passwd *getpwnam (const char *name); +#endif +#if !HAVE_DECL_GETGRNAM +extern struct group *getgrnam (const char *name); +#endif +#if !HAVE_DECL_GETGRGID +extern struct group *getgrgid (gid_t gid); +#endif + +#ifndef HAVE_ENDPWENT +# define endpwent() +#endif +#ifndef HAVE_ENDGRENT +# define endgrent() +#endif + +/* Perform the equivalent of the statement `dest = strdup (src);', + but obtaining storage via alloca instead of from the heap. */ + +#define V_STRDUP(dest, src) \ + do \ + { \ + int _len = strlen ((src)); \ + (dest) = (char *) alloca (_len + 1); \ + strcpy (dest, src); \ + } \ + while (0) + +/* Return nonzero if STR represents an unsigned decimal integer, + otherwise return 0. */ + +static int +isnumber_p (const char *str) +{ + for (; *str; str++) + if (!isdigit (*str)) + return 0; + return 1; +} + +/* Extract from NAME, which has the form "[user][:.][group]", + a USERNAME, UID U, GROUPNAME, and GID G. + Either user or group, or both, must be present. + If the group is omitted but the ":" or "." separator is given, + use the given user's login group. + + USERNAME and GROUPNAME will be in newly malloc'd memory. + Either one might be NULL instead, indicating that it was not + given and the corresponding numeric ID was left unchanged. + + Return NULL if successful, a static error message string if not. */ + +const char * +parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid, + char **username_arg, char **groupname_arg) +{ + static const char *tired = "virtual memory exhausted"; + const char *error_msg; + char *spec; /* A copy we can write on. */ + struct passwd *pwd; + struct group *grp; + char *g, *u, *separator; + char *groupname; + + error_msg = NULL; + *username_arg = *groupname_arg = NULL; + groupname = NULL; + + V_STRDUP (spec, spec_arg); + + /* Find the separator if there is one. */ + separator = strchr (spec, ':'); + if (separator == NULL) + separator = strchr (spec, '.'); + + /* Replace separator with a NUL. */ + if (separator != NULL) + *separator = '\0'; + + /* Set U and G to non-zero length strings corresponding to user and + group specifiers or to NULL. */ + u = (*spec == '\0' ? NULL : spec); + + g = (separator == NULL || *(separator + 1) == '\0' + ? NULL + : separator + 1); + + if (u == NULL && g == NULL) + return "can not omit both user and group"; + + if (u != NULL) + { + pwd = getpwnam (u); + if (pwd == NULL) + { + + if (!isnumber_p (u)) + error_msg = _("invalid user"); + else + { + int use_login_group; + use_login_group = (separator != NULL && g == NULL); + if (use_login_group) + error_msg = _("cannot get the login group of a numeric UID"); + else + *uid = atoi (u); + } + } + else + { + *uid = pwd->pw_uid; + if (g == NULL && separator != NULL) + { + /* A separator was given, but a group was not specified, + so get the login group. */ + *gid = pwd->pw_gid; + grp = getgrgid (pwd->pw_gid); + if (grp == NULL) + { + /* This is enough room to hold the unsigned decimal + representation of any 32-bit quantity and the trailing + zero byte. */ + char uint_buf[21]; + sprintf (uint_buf, "%u", (unsigned) (pwd->pw_gid)); + V_STRDUP (groupname, uint_buf); + } + else + { + V_STRDUP (groupname, grp->gr_name); + } + endgrent (); + } + } + endpwent (); + } + + if (g != NULL && error_msg == NULL) + { + /* Explicit group. */ + grp = getgrnam (g); + if (grp == NULL) + { + if (!isnumber_p (g)) + error_msg = _("invalid group"); + else + *gid = atoi (g); + } + else + *gid = grp->gr_gid; + endgrent (); /* Save a file descriptor. */ + + if (error_msg == NULL) + V_STRDUP (groupname, g); + } + + if (error_msg == NULL) + { + if (u != NULL) + { + *username_arg = strdup (u); + if (*username_arg == NULL) + error_msg = tired; + } + + if (groupname != NULL && error_msg == NULL) + { + *groupname_arg = strdup (groupname); + if (*groupname_arg == NULL) + { + if (*username_arg != NULL) + { + free (*username_arg); + *username_arg = NULL; + } + error_msg = tired; + } + } + } + + return error_msg; +} + +#ifdef TEST + +#define NULL_CHECK(s) ((s) == NULL ? "(null)" : (s)) + +int +main (int argc, char **argv) +{ + int i; + + for (i = 1; i < argc; i++) + { + const char *e; + char *username, *groupname; + uid_t uid; + gid_t gid; + char *tmp; + + tmp = strdup (argv[i]); + e = parse_user_spec (tmp, &uid, &gid, &username, &groupname); + free (tmp); + printf ("%s: %u %u %s %s %s\n", + argv[i], + (unsigned int) uid, + (unsigned int) gid, + NULL_CHECK (username), + NULL_CHECK (groupname), + NULL_CHECK (e)); + } + + exit (0); +} + +#endif diff --git a/src/util.c b/src/util.c new file mode 100644 index 0000000..5bcc40a --- /dev/null +++ b/src/util.c @@ -0,0 +1,1342 @@ +/* util.c - Several utility routines for cpio. + Copyright (C) 1990, 1991, 1992, 2001, 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. */ + +#include + +#include +#include +#include +#include "cpiohdr.h" +#include "dstring.h" +#include "extern.h" +#include +#include "filetypes.h" +#include +#include +#include +#include +#include + +#include + +#ifdef HAVE_SYS_MTIO_H +# ifdef HAVE_SYS_IO_TRIOCTL_H +# include +# endif +# include +#endif + +#if !HAVE_DECL_ERRNO +extern int errno; +#endif + +/* Write `output_size' bytes of `output_buffer' to file + descriptor OUT_DES and reset `output_size' and `out_buff'. */ + +void +tape_empty_output_buffer (int out_des) +{ + int bytes_written; + +#ifdef BROKEN_LONG_TAPE_DRIVER + static long output_bytes_before_lseek = 0; + + /* Some tape drivers seem to have a signed internal seek pointer and + they lose if it overflows and becomes negative (e.g. when writing + tapes > 2Gb). Doing an lseek (des, 0, SEEK_SET) seems to reset the + seek pointer and prevent it from overflowing. */ + if (output_is_special + && ( (output_bytes_before_lseek += output_size) >= 1073741824L) ) + { + lseek(out_des, 0L, SEEK_SET); + output_bytes_before_lseek = 0; + } +#endif + + bytes_written = rmtwrite (out_des, output_buffer, output_size); + if (bytes_written != output_size) + { + int rest_bytes_written; + int rest_output_size; + + if (output_is_special + && (bytes_written >= 0 + || (bytes_written < 0 + && (errno == ENOSPC || errno == EIO || errno == ENXIO)))) + { + get_next_reel (out_des); + if (bytes_written > 0) + rest_output_size = output_size - bytes_written; + else + rest_output_size = output_size; + rest_bytes_written = rmtwrite (out_des, output_buffer, + rest_output_size); + if (rest_bytes_written != rest_output_size) + error (1, errno, _("write error")); + } + else + error (1, errno, _("write error")); + } + output_bytes += output_size; + out_buff = output_buffer; + output_size = 0; +} + +static int sparse_write (int fildes, char *buf, unsigned int nbyte); + +/* Write `output_size' bytes of `output_buffer' to file + descriptor OUT_DES and reset `output_size' and `out_buff'. + If `swapping_halfwords' or `swapping_bytes' is set, + do the appropriate swapping first. Our callers have + to make sure to only set these flags if `output_size' + is appropriate (a multiple of 4 for `swapping_halfwords', + 2 for `swapping_bytes'). The fact that DISK_IO_BLOCK_SIZE + must always be a multiple of 4 helps us (and our callers) + insure this. */ + +void +disk_empty_output_buffer (int out_des) +{ + int bytes_written; + + if (swapping_halfwords || swapping_bytes) + { + if (swapping_halfwords) + { + int complete_words; + complete_words = output_size / 4; + swahw_array (output_buffer, complete_words); + if (swapping_bytes) + swab_array (output_buffer, 2 * complete_words); + } + else + { + int complete_halfwords; + complete_halfwords = output_size /2; + swab_array (output_buffer, complete_halfwords); + } + } + + if (sparse_flag) + bytes_written = sparse_write (out_des, output_buffer, output_size); + else + bytes_written = write (out_des, output_buffer, output_size); + + if (bytes_written != output_size) + { + error (1, errno, _("write error")); + } + output_bytes += output_size; + out_buff = output_buffer; + output_size = 0; +} + +/* Exchange the halfwords of each element of the array of COUNT longs + starting at PTR. PTR does not have to be aligned at a word + boundary. */ + +void +swahw_array (char *ptr, int count) +{ + char tmp; + + for (; count > 0; --count) + { + tmp = *ptr; + *ptr = *(ptr + 2); + *(ptr + 2) = tmp; + ++ptr; + tmp = *ptr; + *ptr = *(ptr + 2); + *(ptr + 2) = tmp; + ptr += 3; + } +} + +/* Read at most NUM_BYTES or `io_block_size' bytes, whichever is smaller, + into the start of `input_buffer' from file descriptor IN_DES. + Set `input_size' to the number of bytes read and reset `in_buff'. + Exit with an error if end of file is reached. */ + +#ifdef BROKEN_LONG_TAPE_DRIVER +static long input_bytes_before_lseek = 0; +#endif + +static void +tape_fill_input_buffer (int in_des, int num_bytes) +{ +#ifdef BROKEN_LONG_TAPE_DRIVER + /* Some tape drivers seem to have a signed internal seek pointer and + they lose if it overflows and becomes negative (e.g. when writing + tapes > 4Gb). Doing an lseek (des, 0, SEEK_SET) seems to reset the + seek pointer and prevent it from overflowing. */ + if (input_is_special + && ( (input_bytes_before_lseek += num_bytes) >= 1073741824L) ) + { + lseek(in_des, 0L, SEEK_SET); + input_bytes_before_lseek = 0; + } +#endif + in_buff = input_buffer; + num_bytes = (num_bytes < io_block_size) ? num_bytes : io_block_size; + input_size = rmtread (in_des, input_buffer, num_bytes); + if (input_size == 0 && input_is_special) + { + get_next_reel (in_des); + input_size = rmtread (in_des, input_buffer, num_bytes); + } + if (input_size < 0) + error (1, errno, _("read error")); + if (input_size == 0) + { + error (0, 0, _("premature end of file")); + exit (1); + } + input_bytes += input_size; +} + +/* Read at most NUM_BYTES or `DISK_IO_BLOCK_SIZE' bytes, whichever is smaller, + into the start of `input_buffer' from file descriptor IN_DES. + Set `input_size' to the number of bytes read and reset `in_buff'. + Exit with an error if end of file is reached. */ + +static int +disk_fill_input_buffer (int in_des, off_t num_bytes) +{ + in_buff = input_buffer; + num_bytes = (num_bytes < DISK_IO_BLOCK_SIZE) ? num_bytes : DISK_IO_BLOCK_SIZE; + input_size = read (in_des, input_buffer, num_bytes); + if (input_size < 0) + { + input_size = 0; + return (-1); + } + else if (input_size == 0) + return (1); + input_bytes += input_size; + return (0); +} + +/* Copy NUM_BYTES of buffer IN_BUF to `out_buff', which may be partly full. + When `out_buff' fills up, flush it to file descriptor OUT_DES. */ + +void +tape_buffered_write (char *in_buf, int out_des, off_t num_bytes) +{ + off_t bytes_left = num_bytes; /* Bytes needing to be copied. */ + off_t space_left; /* Room left in output buffer. */ + + while (bytes_left > 0) + { + space_left = io_block_size - output_size; + if (space_left == 0) + tape_empty_output_buffer (out_des); + else + { + if (bytes_left < space_left) + space_left = bytes_left; + memcpy (out_buff, in_buf, (unsigned) space_left); + out_buff += space_left; + output_size += space_left; + in_buf += space_left; + bytes_left -= space_left; + } + } +} + +/* Copy NUM_BYTES of buffer IN_BUF to `out_buff', which may be partly full. + When `out_buff' fills up, flush it to file descriptor OUT_DES. */ + +void +disk_buffered_write (char *in_buf, int out_des, off_t num_bytes) +{ + off_t bytes_left = num_bytes; /* Bytes needing to be copied. */ + off_t space_left; /* Room left in output buffer. */ + + while (bytes_left > 0) + { + space_left = DISK_IO_BLOCK_SIZE - output_size; + if (space_left == 0) + disk_empty_output_buffer (out_des); + else + { + if (bytes_left < space_left) + space_left = bytes_left; + memcpy (out_buff, in_buf, (unsigned) space_left); + out_buff += space_left; + output_size += space_left; + in_buf += space_left; + bytes_left -= space_left; + } + } +} + +/* Copy NUM_BYTES of buffer `in_buff' into IN_BUF. + `in_buff' may be partly full. + When `in_buff' is exhausted, refill it from file descriptor IN_DES. */ + +void +tape_buffered_read (char *in_buf, int in_des, off_t num_bytes) +{ + off_t bytes_left = num_bytes; /* Bytes needing to be copied. */ + off_t space_left; /* Bytes to copy from input buffer. */ + + while (bytes_left > 0) + { + if (input_size == 0) + tape_fill_input_buffer (in_des, io_block_size); + if (bytes_left < input_size) + space_left = bytes_left; + else + space_left = input_size; + memcpy (in_buf, in_buff, (unsigned) space_left); + in_buff += space_left; + in_buf += space_left; + input_size -= space_left; + bytes_left -= space_left; + } +} + +/* Copy the the next NUM_BYTES bytes of `input_buffer' into PEEK_BUF. + If NUM_BYTES bytes are not available, read the next `io_block_size' bytes + into the end of `input_buffer' and update `input_size'. + + Return the number of bytes copied into PEEK_BUF. + If the number of bytes returned is less than NUM_BYTES, + then EOF has been reached. */ + +int +tape_buffered_peek (char *peek_buf, int in_des, int num_bytes) +{ + long tmp_input_size; + long got_bytes; + char *append_buf; + +#ifdef BROKEN_LONG_TAPE_DRIVER + /* Some tape drivers seem to have a signed internal seek pointer and + they lose if it overflows and becomes negative (e.g. when writing + tapes > 4Gb). Doing an lseek (des, 0, SEEK_SET) seems to reset the + seek pointer and prevent it from overflowing. */ + if (input_is_special + && ( (input_bytes_before_lseek += num_bytes) >= 1073741824L) ) + { + lseek(in_des, 0L, SEEK_SET); + input_bytes_before_lseek = 0; + } +#endif + + while (input_size < num_bytes) + { + append_buf = in_buff + input_size; + if ( (append_buf - input_buffer) >= input_buffer_size) + { + /* We can keep up to 2 "blocks" (either the physical block size + or 512 bytes(the size of a tar record), which ever is + larger) in the input buffer when we are peeking. We + assume that our caller will never be interested in peeking + ahead at more than 512 bytes, so we know that by the time + we need a 3rd "block" in the buffer we can throw away the + first block to make room. */ + int half; + half = input_buffer_size / 2; + memmove (input_buffer, input_buffer + half, half); + in_buff = in_buff - half; + append_buf = append_buf - half; + } + tmp_input_size = rmtread (in_des, append_buf, io_block_size); + if (tmp_input_size == 0) + { + if (input_is_special) + { + get_next_reel (in_des); + tmp_input_size = rmtread (in_des, append_buf, io_block_size); + } + else + break; + } + if (tmp_input_size < 0) + error (1, errno, _("read error")); + input_bytes += tmp_input_size; + input_size += tmp_input_size; + } + if (num_bytes <= input_size) + got_bytes = num_bytes; + else + got_bytes = input_size; + memcpy (peek_buf, in_buff, (unsigned) got_bytes); + return got_bytes; +} + +/* Skip the next NUM_BYTES bytes of file descriptor IN_DES. */ + +void +tape_toss_input (int in_des, off_t num_bytes) +{ + off_t bytes_left = num_bytes; /* Bytes needing to be copied. */ + off_t space_left; /* Bytes to copy from input buffer. */ + + while (bytes_left > 0) + { + if (input_size == 0) + tape_fill_input_buffer (in_des, io_block_size); + if (bytes_left < input_size) + space_left = bytes_left; + else + space_left = input_size; + + if (crc_i_flag && only_verify_crc_flag) + { + int k; + for (k = 0; k < space_left; ++k) + crc += in_buff[k] & 0xff; + } + + in_buff += space_left; + input_size -= space_left; + bytes_left -= space_left; + } +} + +void +write_nuls_to_file (off_t num_bytes, int out_des, + void (*writer) (char *in_buf, int out_des, off_t num_bytes)) +{ + off_t blocks; + off_t extra_bytes; + off_t i; + static char zeros_512[512]; + + blocks = num_bytes / sizeof zeros_512; + extra_bytes = num_bytes % sizeof zeros_512; + for (i = 0; i < blocks; ++i) + writer (zeros_512, out_des, sizeof zeros_512); + if (extra_bytes) + writer (zeros_512, out_des, extra_bytes); +} + +/* Copy a file using the input and output buffers, which may start out + partly full. After the copy, the files are not closed nor the last + block flushed to output, and the input buffer may still be partly + full. If `crc_i_flag' is set, add each byte to `crc'. + IN_DES is the file descriptor for input; + OUT_DES is the file descriptor for output; + NUM_BYTES is the number of bytes to copy. */ + +void +copy_files_tape_to_disk (int in_des, int out_des, off_t num_bytes) +{ + long size; + long k; + + while (num_bytes > 0) + { + if (input_size == 0) + tape_fill_input_buffer (in_des, io_block_size); + size = (input_size < num_bytes) ? input_size : num_bytes; + if (crc_i_flag) + { + for (k = 0; k < size; ++k) + crc += in_buff[k] & 0xff; + } + disk_buffered_write (in_buff, out_des, size); + num_bytes -= size; + input_size -= size; + in_buff += size; + } +} +/* Copy a file using the input and output buffers, which may start out + partly full. After the copy, the files are not closed nor the last + block flushed to output, and the input buffer may still be partly + full. If `crc_i_flag' is set, add each byte to `crc'. + IN_DES is the file descriptor for input; + OUT_DES is the file descriptor for output; + NUM_BYTES is the number of bytes to copy. */ + +void +copy_files_disk_to_tape (int in_des, int out_des, off_t num_bytes, + char *filename) +{ + long size; + long k; + int rc; + off_t original_num_bytes; + + original_num_bytes = num_bytes; + + while (num_bytes > 0) + { + if (input_size == 0) + if (rc = disk_fill_input_buffer (in_des, + num_bytes < DISK_IO_BLOCK_SIZE ? + num_bytes : DISK_IO_BLOCK_SIZE)) + { + if (rc > 0) + { + char buf[UINTMAX_STRSIZE_BOUND]; + error (0, 0, + ngettext ("File %s shrunk by %s byte, padding with zeros", + "File %s shrunk by %s bytes, padding with zeros", + num_bytes), + filename, STRINGIFY_BIGINT (num_bytes, buf)); + } + else + error (0, 0, _("Read error at byte %lld in file %s, padding with zeros"), + original_num_bytes - num_bytes, filename); + write_nuls_to_file (num_bytes, out_des, tape_buffered_write); + break; + } + size = (input_size < num_bytes) ? input_size : num_bytes; + if (crc_i_flag) + { + for (k = 0; k < size; ++k) + crc += in_buff[k] & 0xff; + } + tape_buffered_write (in_buff, out_des, size); + num_bytes -= size; + input_size -= size; + in_buff += size; + } +} +/* Copy a file using the input and output buffers, which may start out + partly full. After the copy, the files are not closed nor the last + block flushed to output, and the input buffer may still be partly + full. If `crc_i_flag' is set, add each byte to `crc'. + IN_DES is the file descriptor for input; + OUT_DES is the file descriptor for output; + NUM_BYTES is the number of bytes to copy. */ + +void +copy_files_disk_to_disk (int in_des, int out_des, off_t num_bytes, + char *filename) +{ + long size; + long k; + off_t original_num_bytes; + int rc; + + original_num_bytes = num_bytes; + while (num_bytes > 0) + { + if (input_size == 0) + if (rc = disk_fill_input_buffer (in_des, num_bytes)) + { + if (rc > 0) + { + char buf[UINTMAX_STRSIZE_BOUND]; + error (0, 0, + ngettext ("File %s shrunk by %s byte, padding with zeros", + "File %s shrunk by %s bytes, padding with zeros", + num_bytes), + filename, STRINGIFY_BIGINT (num_bytes, buf)); + } + else + error (0, 0, _("Read error at byte %lld in file %s, padding with zeros"), + original_num_bytes - num_bytes, filename); + write_nuls_to_file (num_bytes, out_des, disk_buffered_write); + break; + } + size = (input_size < num_bytes) ? input_size : num_bytes; + if (crc_i_flag) + { + for (k = 0; k < size; ++k) + crc += in_buff[k] & 0xff; + } + disk_buffered_write (in_buff, out_des, size); + num_bytes -= size; + input_size -= size; + in_buff += size; + } +} + +/* Warn if file changed while it was being copied. */ + +void +warn_if_file_changed (char *file_name, unsigned long old_file_size, + off_t old_file_mtime) +{ + struct stat new_file_stat; + if ((*xstat) (file_name, &new_file_stat) < 0) + { + stat_error (file_name); + return; + } + + /* Only check growth, shrinkage detected in copy_files_disk_to_{disk,tape}() + */ + if (new_file_stat.st_size > old_file_size) + error (0, 0, + ngettext ("File %s grew, %"PRIuMAX" new byte not copied", + "File %s grew, %"PRIuMAX" new bytes not copied", + (long)(new_file_stat.st_size - old_file_size)), + file_name, (uintmax_t) (new_file_stat.st_size - old_file_size)); + + else if (new_file_stat.st_mtime != old_file_mtime) + error (0, 0, _("File %s was modified while being copied"), file_name); +} + +/* Create all directories up to but not including the last part of NAME. + Do not destroy any nondirectories while creating directories. */ + +void +create_all_directories (char *name) +{ + char *dir; + int mode; +#ifdef HPUX_CDF + int cdf; +#endif + + dir = dir_name (name); + mode = 0700; +#ifdef HPUX_CDF + cdf = islastparentcdf (name); + if (cdf) + { + dir [strlen (dir) - 1] = '\0'; /* remove final + */ + mode = 04700; + } + +#endif + + if (dir == NULL) + error (2, 0, _("virtual memory exhausted")); + + if (dir[0] != '.' || dir[1] != '\0') + make_path (dir, mode, 0700, -1, -1, (char *) NULL); + + free (dir); +} + +/* Prepare to append to an archive. We have been in + process_copy_in, keeping track of the position where + the last header started in `last_header_start'. Now we + have the starting position of the last header (the TRAILER!!! + header, or blank record for tar archives) and we want to start + writing (appending) over the last header. The last header may + be in the middle of a block, so to keep the buffering in sync + we lseek back to the start of the block, read everything up + to but not including the last header, lseek back to the start + of the block, and then do a copy_buf_out of what we read. + Actually, we probably don't have to worry so much about keeping the + buffering perfect since you can only append to archives that + are disk files. */ + +void +prepare_append (int out_file_des) +{ + int start_of_header; + int start_of_block; + int useful_bytes_in_block; + char *tmp_buf; + + start_of_header = last_header_start; + /* Figure out how many bytes we will rewrite, and where they start. */ + useful_bytes_in_block = start_of_header % io_block_size; + start_of_block = start_of_header - useful_bytes_in_block; + + if (lseek (out_file_des, start_of_block, SEEK_SET) < 0) + error (1, errno, _("cannot seek on output")); + if (useful_bytes_in_block > 0) + { + tmp_buf = (char *) xmalloc (useful_bytes_in_block); + read (out_file_des, tmp_buf, useful_bytes_in_block); + if (lseek (out_file_des, start_of_block, SEEK_SET) < 0) + error (1, errno, _("cannot seek on output")); + /* fix juo -- is this copy_tape_buf_out? or copy_disk? */ + tape_buffered_write (tmp_buf, out_file_des, useful_bytes_in_block); + free (tmp_buf); + } + + /* We are done reading the archive, so clear these since they + will now be used for reading in files that we are appending + to the archive. */ + input_size = 0; + input_bytes = 0; + in_buff = input_buffer; +} + +/* Support for remembering inodes with multiple links. Used in the + "copy in" and "copy pass" modes for making links instead of copying + the file. */ + +struct inode_val +{ + unsigned long inode; + unsigned long major_num; + unsigned long minor_num; + char *file_name; +}; + +/* Inode hash table. Allocated by first call to add_inode. */ +static Hash_table *hash_table = NULL; + +static size_t +inode_val_hasher (const void *val, size_t n_buckets) +{ + const struct inode_val *ival = val; + return ival->inode % n_buckets; +} + +static bool +inode_val_compare (const void *val1, const void *val2) +{ + const struct inode_val *ival1 = val1; + const struct inode_val *ival2 = val2; + return ival1->inode == ival2->inode + && ival1->major_num == ival2->major_num + && ival1->minor_num == ival2->minor_num; +} + +char * +find_inode_file (unsigned long node_num, unsigned long major_num, + unsigned long minor_num) +{ + struct inode_val sample; + struct inode_val *ival; + + if (!hash_table) + return NULL; + + sample.inode = node_num; + sample.major_num = major_num; + sample.minor_num = minor_num; + ival = hash_lookup (hash_table, &sample); + return ival ? ival->file_name : NULL; +} + +/* Associate FILE_NAME with the inode NODE_NUM. (Insert into hash table.) */ + +void +add_inode (unsigned long node_num, char *file_name, unsigned long major_num, + unsigned long minor_num) +{ + struct inode_val *temp; + struct inode_val *e; + + /* Create new inode record. */ + temp = (struct inode_val *) xmalloc (sizeof (struct inode_val)); + temp->inode = node_num; + temp->major_num = major_num; + temp->minor_num = minor_num; + temp->file_name = xstrdup (file_name); + + if (!((hash_table + || (hash_table = hash_initialize (0, 0, inode_val_hasher, + inode_val_compare, 0))) + && (e = hash_insert (hash_table, temp)))) + xalloc_die (); + /* FIXME: e is not used */ +} + + +/* Open FILE in the mode specified by the command line options + and return an open file descriptor for it, + or -1 if it can't be opened. */ + +int +open_archive (char *file) +{ + int fd; + void (*copy_in) (); /* Workaround for pcc bug. */ + + copy_in = process_copy_in; + + if (copy_function == copy_in) + fd = rmtopen (file, O_RDONLY | O_BINARY, MODE_RW, rsh_command_option); + else + { + if (!append_flag) + fd = rmtopen (file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, MODE_RW, + rsh_command_option); + else + fd = rmtopen (file, O_RDWR | O_BINARY, MODE_RW, rsh_command_option); + } + + return fd; +} + +/* Attempt to rewind the tape drive on file descriptor TAPE_DES + and take it offline. */ + +void +tape_offline (int tape_des) +{ +#if defined(MTIOCTOP) && defined(MTOFFL) + struct mtop control; + + control.mt_op = MTOFFL; + control.mt_count = 1; + rmtioctl (tape_des, MTIOCTOP, (char*) &control); /* Don't care if it fails. */ +#endif +} + +/* The file on file descriptor TAPE_DES is assumed to be magnetic tape + (or floppy disk or other device) and the end of the medium + has been reached. Ask the user for to mount a new "tape" to continue + the processing. If the user specified the device name on the + command line (with the -I, -O, -F or --file options), then we can + automatically re-open the same device to use the next medium. If the + user did not specify the device name, then we have to ask them which + device to use. */ + +void +get_next_reel (int tape_des) +{ + static int reel_number = 1; + FILE *tty_in; /* File for interacting with user. */ + FILE *tty_out; /* File for interacting with user. */ + int old_tape_des; + char *next_archive_name; + dynamic_string new_name; + char *str_res; + + ds_init (&new_name, 128); + + /* Open files for interactive communication. */ + tty_in = fopen (TTY_NAME, "r"); + if (tty_in == NULL) + error (2, errno, TTY_NAME); + tty_out = fopen (TTY_NAME, "w"); + if (tty_out == NULL) + error (2, errno, TTY_NAME); + + old_tape_des = tape_des; + tape_offline (tape_des); + rmtclose (tape_des); + + /* Give message and wait for carrage return. User should hit carrage return + only after loading the next tape. */ + ++reel_number; + if (new_media_message) + fprintf (tty_out, "%s", new_media_message); + else if (new_media_message_with_number) + fprintf (tty_out, "%s%d%s", new_media_message_with_number, reel_number, + new_media_message_after_number); + else if (archive_name) + fprintf (tty_out, _("Found end of tape. Load next tape and press RETURN. ")); + else + fprintf (tty_out, _("Found end of tape. To continue, type device/file name when ready.\n")); + + fflush (tty_out); + + if (archive_name) + { + int c; + + do + c = getc (tty_in); + while (c != EOF && c != '\n'); + + tape_des = open_archive (archive_name); + if (tape_des == -1) + open_error (archive_name); + } + else + { + do + { + if (tape_des < 0) + { + fprintf (tty_out, + _("To continue, type device/file name when ready.\n")); + fflush (tty_out); + } + + str_res = ds_fgets (tty_in, &new_name); + if (str_res == NULL || str_res[0] == '\0') + exit (1); + next_archive_name = str_res; + + tape_des = open_archive (next_archive_name); + if (tape_des == -1) + open_error (next_archive_name); + } + while (tape_des < 0); + } + + /* We have to make sure that `tape_des' has not changed its value even + though we closed it and reopened it, since there are local + copies of it in other routines. This works fine on Unix (even with + rmtread and rmtwrite) since open will always return the lowest + available file descriptor and we haven't closed any files (e.g., + stdin, stdout or stderr) that were opened before we originally opened + the archive. */ + + if (tape_des != old_tape_des) + error (1, 0, _("internal error: tape descriptor changed from %d to %d"), + old_tape_des, tape_des); + + free (new_name.ds_string); + fclose (tty_in); + fclose (tty_out); +} + +/* If MESSAGE does not contain the string "%d", make `new_media_message' + a copy of MESSAGE. If MESSAGES does contain the string "%d", make + `new_media_message_with_number' a copy of MESSAGE up to, but + not including, the string "%d", and make `new_media_message_after_number' + a copy of MESSAGE after the string "%d". */ + +void +set_new_media_message (char *message) +{ + char *p; + int prev_was_percent; + + p = message; + prev_was_percent = 0; + while (*p != '\0') + { + if (*p == 'd' && prev_was_percent) + break; + prev_was_percent = (*p == '%'); + ++p; + } + if (*p == '\0') + { + new_media_message = xstrdup (message); + } + else + { + int length = p - message - 1; + + new_media_message_with_number = xmalloc (length + 1); + strncpy (new_media_message_with_number, message, length); + new_media_message_with_number[length] = '\0'; + length = strlen (p + 1); + new_media_message_after_number = xmalloc (length + 1); + strcpy (new_media_message_after_number, p + 1); + } +} + +#ifdef SYMLINK_USES_UMASK +/* Most machines always create symlinks with rwxrwxrwx protection, + but some (HP/UX 8.07; maybe DEC's OSF on MIPS, too?) use the + umask when creating symlinks, so if your umask is 022 you end + up with rwxr-xr-x symlinks (although HP/UX seems to completely + ignore the protection). There doesn't seem to be any way to + manipulate the modes once the symlinks are created (e.g. + a hypothetical "lchmod"), so to create them with the right + modes we have to set the umask first. */ + +int +umasked_symlink (char *name1, char *name2, int mode) +{ + int old_umask; + int rc; + mode = ~(mode & 0777) & 0777; + old_umask = umask (mode); + rc = symlink (name1, name2); + umask (old_umask); + return rc; +} +#endif /* SYMLINK_USES_UMASK */ + +#ifdef HPUX_CDF +/* When we create a cpio archive we mark CDF's by putting an extra `/' + after their component name so we can distinguish the CDF's when we + extract the archive (in case the "hidden" directory's files appear + in the archive before the directory itself). E.g., in the path + "a/b+/c", if b+ is a CDF, we will write this path as "a/b+//c" in + the archive so when we extract the archive we will know that b+ + is actually a CDF, and not an ordinary directory whose name happens + to end in `+'. We also do the same thing internally in copypass.c. */ + + +/* Take an input pathname and check it for CDF's. Insert an extra + `/' in the pathname after each "hidden" directory. If we add + any `/'s, return a malloced string instead of the original input + string. + FIXME: This creates a memory leak. +*/ + +char * +add_cdf_double_slashes (char *input_name) +{ + static char *ret_name = NULL; /* re-usuable return buffer (malloc'ed) */ + static int ret_size = -1; /* size of return buffer. */ + char *p; + char *q; + int n; + struct stat dir_stat; + + /* Search for a `/' preceeded by a `+'. */ + + for (p = input_name; *p != '\0'; ++p) + { + if ( (*p == '+') && (*(p + 1) == '/') ) + break; + } + + /* If we didn't find a `/' preceeded by a `+' then there are + no CDF's in this pathname. Return the original pathname. */ + + if (*p == '\0') + return input_name; + + /* There was a `/' preceeded by a `+' in the pathname. If it is a CDF + then we will need to copy the input pathname to our return + buffer so we can insert the extra `/'s. Since we can't tell + yet whether or not it is a CDF we will just always copy the + string to the return buffer. First we have to make sure the + buffer is large enough to hold the string and any number of + extra `/'s we might add. */ + + n = 2 * (strlen (input_name) + 1); + if (n >= ret_size) + { + if (ret_size < 0) + ret_name = (char *) malloc (n); + else + ret_name = (char *)realloc (ret_name, n); + ret_size = n; + } + + /* Clear the `/' after this component, so we can stat the pathname + up to and including this component. */ + ++p; + *p = '\0'; + if ((*xstat) (input_name, &dir_stat) < 0) + { + stat_error (input_name); + return input_name; + } + + /* Now put back the `/' after this component and copy the pathname up to + and including this component and its trailing `/' to the return + buffer. */ + *p++ = '/'; + strncpy (ret_name, input_name, p - input_name); + q = ret_name + (p - input_name); + + /* If it was a CDF, add another `/'. */ + if (S_ISDIR (dir_stat.st_mode) && (dir_stat.st_mode & 04000) ) + *q++ = '/'; + + /* Go through the rest of the input pathname, copying it to the + return buffer, and adding an extra `/' after each CDF. */ + while (*p != '\0') + { + if ( (*p == '+') && (*(p + 1) == '/') ) + { + *q++ = *p++; + + *p = '\0'; + if ((*xstat) (input_name, &dir_stat) < 0) + { + stat_error (input_name); + return input_name; + } + *p = '/'; + + if (S_ISDIR (dir_stat.st_mode) && (dir_stat.st_mode & 04000) ) + *q++ = '/'; + } + *q++ = *p++; + } + *q = '\0'; + + return ret_name; +} + +/* Is the last parent directory (e.g., c in a/b/c/d) a CDF? If the + directory name ends in `+' and is followed by 2 `/'s instead of 1 + then it is. This is only the case for cpio archives, but we don't + have to worry about tar because tar always has the directory before + its files (or else we lose). */ +int +islastparentcdf (char *path) +{ + char *newpath; + char *slash; + int slash_count; + int length; /* Length of result, not including NUL. */ + + slash = strrchr (path, '/'); + if (slash == 0) + return 0; + else + { + slash_count = 0; + while (slash > path && *slash == '/') + { + ++slash_count; + --slash; + } + + + if ( (*slash == '+') && (slash_count >= 2) ) + return 1; + } + return 0; +} +#endif + +#define DISKBLOCKSIZE (512) + +static int +buf_all_zeros (char *buf, int bufsize) +{ + int i; + for (i = 0; i < bufsize; ++i) + { + if (*buf++ != '\0') + return 0; + } + return 1; +} + +int delayed_seek_count = 0; + +/* Write NBYTE bytes from BUF to remote tape connection FILDES. + Return the number of bytes written on success, -1 on error. */ + +static int +sparse_write (int fildes, char *buf, unsigned int nbyte) +{ + int complete_block_count; + int leftover_bytes_count; + int seek_count; + int write_count; + char *cur_write_start; + int lseek_rc; + int write_rc; + int i; + enum { begin, in_zeros, not_in_zeros } state; + + complete_block_count = nbyte / DISKBLOCKSIZE; + leftover_bytes_count = nbyte % DISKBLOCKSIZE; + + if (delayed_seek_count != 0) + state = in_zeros; + else + state = begin; + + seek_count = delayed_seek_count; + + for (i = 0; i < complete_block_count; ++i) + { + switch (state) + { + case begin : + if (buf_all_zeros (buf, DISKBLOCKSIZE)) + { + seek_count = DISKBLOCKSIZE; + state = in_zeros; + } + else + { + cur_write_start = buf; + write_count = DISKBLOCKSIZE; + state = not_in_zeros; + } + buf += DISKBLOCKSIZE; + break; + + case in_zeros : + if (buf_all_zeros (buf, DISKBLOCKSIZE)) + { + seek_count += DISKBLOCKSIZE; + } + else + { + lseek (fildes, seek_count, SEEK_CUR); + cur_write_start = buf; + write_count = DISKBLOCKSIZE; + state = not_in_zeros; + } + buf += DISKBLOCKSIZE; + break; + + case not_in_zeros : + if (buf_all_zeros (buf, DISKBLOCKSIZE)) + { + write_rc = write (fildes, cur_write_start, write_count); + seek_count = DISKBLOCKSIZE; + state = in_zeros; + } + else + { + write_count += DISKBLOCKSIZE; + } + buf += DISKBLOCKSIZE; + break; + } + } + + switch (state) + { + case begin : + case in_zeros : + delayed_seek_count = seek_count; + break; + + case not_in_zeros : + write_rc = write (fildes, cur_write_start, write_count); + delayed_seek_count = 0; + break; + } + + if (leftover_bytes_count != 0) + { + if (delayed_seek_count != 0) + { + lseek_rc = lseek (fildes, delayed_seek_count, SEEK_CUR); + delayed_seek_count = 0; + } + write_rc = write (fildes, buf, leftover_bytes_count); + } + return nbyte; +} + +#define CPIO_UID(uid) (set_owner_flag ? set_owner : (uid)) +#define CPIO_GID(gid) (set_group_flag ? set_group : (gid)) + +void +stat_to_cpio (struct cpio_file_stat *hdr, struct stat *st) +{ + hdr->c_dev_maj = major (st->st_dev); + hdr->c_dev_min = minor (st->st_dev); + hdr->c_ino = st->st_ino; + /* For POSIX systems that don't define the S_IF macros, + we can't assume that S_ISfoo means the standard Unix + S_IFfoo bit(s) are set. So do it manually, with a + different name. Bleah. */ + hdr->c_mode = (st->st_mode & 07777); + if (S_ISREG (st->st_mode)) + hdr->c_mode |= CP_IFREG; + else if (S_ISDIR (st->st_mode)) + hdr->c_mode |= CP_IFDIR; +#ifdef S_ISBLK + else if (S_ISBLK (st->st_mode)) + hdr->c_mode |= CP_IFBLK; +#endif +#ifdef S_ISCHR + else if (S_ISCHR (st->st_mode)) + hdr->c_mode |= CP_IFCHR; +#endif +#ifdef S_ISFIFO + else if (S_ISFIFO (st->st_mode)) + hdr->c_mode |= CP_IFIFO; +#endif +#ifdef S_ISLNK + else if (S_ISLNK (st->st_mode)) + hdr->c_mode |= CP_IFLNK; +#endif +#ifdef S_ISSOCK + else if (S_ISSOCK (st->st_mode)) + hdr->c_mode |= CP_IFSOCK; +#endif +#ifdef S_ISNWK + else if (S_ISNWK (st->st_mode)) + hdr->c_mode |= CP_IFNWK; +#endif + hdr->c_uid = CPIO_UID (st->st_uid); + hdr->c_gid = CPIO_GID (st->st_gid); + hdr->c_nlink = st->st_nlink; + hdr->c_rdev_maj = major (st->st_rdev); + hdr->c_rdev_min = minor (st->st_rdev); + hdr->c_mtime = st->st_mtime; + hdr->c_filesize = st->st_size; + hdr->c_chksum = 0; + hdr->c_tar_linkname = NULL; +} + +#ifndef HAVE_FCHOWN +# define fchown(fd, uid, gid) (-1) +#endif + +int +fchown_or_chown (int fd, const char *name, uid_t uid, uid_t gid) +{ + if (HAVE_FCHOWN && fd != -1) + return fchown (fd, uid, gid); + else + return chown (name, uid, gid); +} + +int +fchmod_or_chmod (int fd, const char *name, mode_t mode) +{ + if (HAVE_FCHMOD && fd != -1) + return fchmod (fd, mode); + else + return chmod(name, mode); +} + +void +set_perms (int fd, struct cpio_file_stat *header) +{ + if (!no_chown_flag) + { + uid_t uid = CPIO_UID (header->c_uid); + gid_t gid = CPIO_GID (header->c_gid); + if ((fchown_or_chown (fd, header->c_name, uid, gid) < 0) + && errno != EPERM) + chown_error_details (header->c_name, uid, gid); + } + /* chown may have turned off some permissions we wanted. */ + if (fchmod_or_chmod (fd, header->c_name, header->c_mode) < 0) + chmod_error_details (header->c_name, header->c_mode); +#ifdef HPUX_CDF + if ((header->c_mode & CP_IFMT) && cdf_flag) + /* Once we "hide" the directory with the chmod(), + we have to refer to it using name+ instead of name. */ + file_hdr->c_name [cdf_char] = '+'; +#endif + if (retain_time_flag) + set_file_times (fd, header->c_name, header->c_mtime, header->c_mtime); +} + +void +set_file_times (int fd, + const char *name, unsigned long atime, unsigned long mtime) +{ + struct timespec ts[2]; + + memset (&ts, 0, sizeof ts); + + ts[0].tv_sec = atime; + ts[1].tv_sec = mtime; + + /* Silently ignore EROFS because reading the file won't have upset its + timestamp if it's on a read-only filesystem. */ + if (gl_futimens (fd, name, ts) < 0 && errno != EROFS) + utime_error (name); +} + +/* Do we have to ignore absolute paths, and if so, does the filename + have an absolute path? */ +void +cpio_safer_name_suffix (char *name, bool link_target, bool absolute_names, + bool strip_leading_dots) +{ + char *p = safer_name_suffix (name, link_target, absolute_names); + if (strip_leading_dots && strcmp (p, "./")) + /* strip leading `./' from the filename. */ + while (*p == '.' && *(p + 1) == '/') + { + ++p; + while (*p == '/') + ++p; + } + if (p != name) + memmove (name, p, (size_t)(strlen (p) + 1)); +} + diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..e75103e --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,84 @@ +# Makefile for GNU cpio regression tests. + +# 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. + +EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 +DISTCLEANFILES = atconfig $(check_SCRIPTS) +MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) + +## ------------ ## +## package.m4. ## +## ------------ ## + +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + { \ + echo '# Signature of the current package.'; \ + echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ + echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ + echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ + echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ + echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ + } >$(srcdir)/package.m4 + +# + +## ------------ ## +## Test suite. ## +## ------------ ## + +TESTSUITE_AT = \ + testsuite.at\ + inout.at\ + symlink.at\ + version.at + +TESTSUITE = $(srcdir)/testsuite + +AUTOTEST = $(AUTOM4TE) --language=autotest +$(TESTSUITE): package.m4 $(TESTSUITE_AT) + $(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp + mv $@.tmp $@ + +atconfig: $(top_builddir)/config.status + cd $(top_builddir) && ./config.status tests/$@ + +clean-local: + $(SHELL) $(TESTSUITE) --clean + +check-local: atconfig atlocal $(TESTSUITE) + $(SHELL) $(TESTSUITE) + +# Run the test suite on the *installed* tree. +installcheck-local: + $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin + + +## ------------ ## +## genfile ## +## ------------ ## + +check_PROGRAMS = genfile + +genfile_SOURCES = genfile.c argcv.c argcv.h + +localedir = $(datadir)/locale +INCLUDES = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/src +AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" + +LDADD = ../lib/libcpio.a $(LIBINTL) $(LIB_CLOCK_GETTIME) + diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000..cd0b228 --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,718 @@ +# Makefile.in generated by automake 1.10a from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile for GNU cpio regression tests. + +# Copyright (C) 2004 Free Software Foundation, Inc. +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@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 +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +check_PROGRAMS = genfile$(EXEEXT) +subdir = tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/atlocal.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/argp.m4 \ + $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/canonicalize-lgpl.m4 \ + $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \ + $(top_srcdir)/m4/clock_time.m4 \ + $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/d-ino.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/exitfail.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/float_h.m4 \ + $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/getcwd-abort-bug.m4 \ + $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \ + $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/hash.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/inline.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/lchown.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mempcpy.m4 \ + $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mktime.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ + $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/paxutils.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \ + $(top_srcdir)/m4/rmt.m4 $(top_srcdir)/m4/rtapelib.m4 \ + $(top_srcdir)/m4/safe-read.m4 $(top_srcdir)/m4/safe-write.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sysexits.m4 \ + $(top_srcdir)/m4/system.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/ulonglong.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/utimbuf.m4 \ + $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vsnprintf.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = atlocal +am_genfile_OBJECTS = genfile.$(OBJEXT) argcv.$(OBJEXT) +genfile_OBJECTS = $(am_genfile_OBJECTS) +genfile_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +genfile_DEPENDENCIES = ../lib/libcpio.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(genfile_SOURCES) +DIST_SOURCES = $(genfile_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ +ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ +ABSOLUTE_FLOAT_H = @ABSOLUTE_FLOAT_H@ +ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_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_SYSEXITS_H = @ABSOLUTE_SYSEXITS_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@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOM4TE = @AUTOM4TE@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPIO_MT_PROG = @CPIO_MT_PROG@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_RMT_COMMAND = @DEFAULT_RMT_COMMAND@ +DEFAULT_RMT_DIR = @DEFAULT_RMT_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIRENT_H = @DIRENT_H@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXEEXT = @EXEEXT@ +FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ +FNMATCH_H = @FNMATCH_H@ +GETOPT_H = @GETOPT_H@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ +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_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_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYSEXITS_H = @HAVE_SYSEXITS_H@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE__BOOL = @HAVE__BOOL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTTYPES_H = @INTTYPES_H@ +LDFLAGS = @LDFLAGS@ +LIBCPIO_LIBDEPS = @LIBCPIO_LIBDEPS@ +LIBCPIO_LTLIBDEPS = @LIBCPIO_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_SETSOCKOPT = @LIB_SETSOCKOPT@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +PU_RMT_PROG = @PU_RMT_PROG@ +RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYSEXITS_H = @SYSEXITS_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@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = $(datadir)/locale +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 +DISTCLEANFILES = atconfig $(check_SCRIPTS) +MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) + +# +TESTSUITE_AT = \ + testsuite.at\ + inout.at\ + symlink.at\ + version.at + +TESTSUITE = $(srcdir)/testsuite +AUTOTEST = $(AUTOM4TE) --language=autotest +genfile_SOURCES = genfile.c argcv.c argcv.h +INCLUDES = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/src +AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" +LDADD = ../lib/libcpio.a $(LIBINTL) $(LIB_CLOCK_GETTIME) +all: all-am + +.SUFFIXES: +.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; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits tests/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(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 +atlocal: $(top_builddir)/config.status $(srcdir)/atlocal.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +genfile$(EXEEXT): $(genfile_OBJECTS) $(genfile_DEPENDENCIES) + @rm -f genfile$(EXEEXT) + $(LINK) $(genfile_OBJECTS) $(genfile_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argcv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genfile.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 +@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 +@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) '$<'` + +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; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + 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" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + 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; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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 "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-local mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +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 + +installcheck-am: installcheck-local + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-checkPROGRAMS clean-generic clean-local ctags distclean \ + distclean-compile distclean-generic 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-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 installcheck-local installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + { \ + echo '# Signature of the current package.'; \ + echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ + echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ + echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ + echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ + echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ + } >$(srcdir)/package.m4 +$(TESTSUITE): package.m4 $(TESTSUITE_AT) + $(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp + mv $@.tmp $@ + +atconfig: $(top_builddir)/config.status + cd $(top_builddir) && ./config.status tests/$@ + +clean-local: + $(SHELL) $(TESTSUITE) --clean + +check-local: atconfig atlocal $(TESTSUITE) + $(SHELL) $(TESTSUITE) + +# Run the test suite on the *installed* tree. +installcheck-local: + $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin +# 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/tests/argcv.c b/tests/argcv.c new file mode 100644 index 0000000..a9d4061 --- /dev/null +++ b/tests/argcv.c @@ -0,0 +1,396 @@ +/* argcv.c - simple functions for parsing input based on whitespace + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + + This library 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 of the License, or (at your option) any later version. + + This library 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 Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include + +#include + +/* + * takes a string and splits it into several strings, breaking at ' ' + * command is the string to split + * the number of strings is placed into argc + * the split strings are put into argv + * returns 0 on success, nonzero on failure + */ + +#define isws(c) ((c)==' '||(c)=='\t'||(c)=='\n') +#define isdelim(c,delim) ((c)=='"'||strchr(delim,(c))!=NULL) + +static int +argcv_scan (int len, const char *command, const char *delim, const char* cmnt, + int *start, int *end, int *save) +{ + int i = 0; + + for (;;) + { + i = *save; + + if (i >= len) + return i + 1; + + /* Skip initial whitespace */ + while (i < len && isws (command[i])) + i++; + *start = i; + + switch (command[i]) + { + case '"': + case '\'': + while (++i < len + && (command[i] != command[*start] + || command[i-1] == '\\')) + ; + if (i < len) /* found matching quote */ + break; + /*FALLTHRU*/ default: + if (isdelim (command[i], delim)) + break; + /* Skip until next whitespace character or end of line. Honor + escaped whitespace. */ + while (++i < len && + !((isws (command[i]) && command[i-1] != '\\') + || isdelim (command[i], delim))); + i--; + break; + } + + *end = i; + *save = i + 1; + + /* If we have a token, and it starts with a comment character, skip + to the newline and restart the token search. */ + if (*save <= len) + { + if (cmnt && strchr (cmnt, command[*start]) != NULL) + { + i = *save; + while (i < len && command[i] != '\n') + i++; + + *save = i; + continue; + } + } + break; + } + return *save; +} + +static char escape_transtab[] = "\\\\a\ab\bf\fn\nr\rt\t"; + +int +argcv_unescape_char (int c) +{ + char *p; + + for (p = escape_transtab; *p; p += 2) + { + if (*p == c) + return p[1]; + } + return c; +} + +int +argcv_escape_char (int c) +{ + char *p; + + for (p = escape_transtab + sizeof(escape_transtab) - 2; + p > escape_transtab; p -= 2) + { + if (*p == c) + return p[-1]; + } + return -1; +} + + +static int +xtonum (const char *src, int base, size_t cnt) +{ + int val; + char *p; + char tmp[4]; /* At most three characters + zero */ + + /* Notice: No use to check `cnt'. It should be either 2 or 3 */ + memcpy (tmp, src, cnt); + tmp[cnt] = 0; + val = strtoul (tmp, &p, base); + return (*p == 0) ? val : -1; +} + +static size_t +escaped_length (const char *str, int *quote) +{ + size_t len = 0; + + for (; *str; str++) + { + if (*str == ' ') + { + len++; + *quote = 1; + } + else if (*str == '"') + { + len += 2; + *quote = 1; + } + else if (isprint (*str)) + len++; + else if (argcv_escape_char (*str) != -1) + len += 2; + else + len += 4; + } + return len; +} + +static void +unescape_copy (char *dst, const char *src, size_t n) +{ + int c; + + while (n > 0) + { + n--; + if (*src == '\\') + { + switch (*++src) + { + case 'x': + case 'X': + ++src; + --n; + if (n == 0) + { + *dst++ = '\\'; + *dst++ = src[-1]; + } + else + { + c = xtonum(src, 16, 2); + if (c == -1) + { + *dst++ = '\\'; + *dst++ = src[-1]; + } + else + { + *dst++ = c; + src += 2; + n -= 2; + } + } + break; + + case '0': + ++src; + --n; + if (n == 0) + { + *dst++ = '\\'; + *dst++ = src[-1]; + } + else + { + c = xtonum(src, 8, 3); + if (c == -1) + { + *dst++ = '\\'; + *dst++ = src[-1]; + } + else + { + *dst++ = c; + src += 3; + n -= 3; + } + } + break; + + default: + *dst++ = argcv_unescape_char (*src++); + n--; + } + } + else + { + *dst++ = *src++; + } + } + *dst = 0; +} + +static void +escape_copy (char *dst, const char *src) +{ + for (; *src; src++) + { + if (*src == '"') + { + *dst++ = '\\'; + *dst++ = '"'; + } + else if (*src != '\t' && isprint(*src)) + *dst++ = *src; + else + { + int c = argcv_escape_char (*src); + *dst++ = '\\'; + if (c != -1) + *dst++ = c; + else + { + char tmp[4]; + snprintf (tmp, sizeof tmp, "%03o", *(unsigned char*)src); + memcpy (dst, tmp, 3); + dst += 3; + } + } + } +} + +int +argcv_get (const char *command, const char *delim, const char* cmnt, + int *argc, char ***argv) +{ + int len = strlen (command); + int i = 0; + int start, end, save; + + *argv = NULL; + + /* Count number of arguments */ + *argc = 0; + save = 0; + + while (argcv_scan (len, command, delim, cmnt, &start, &end, &save) <= len) + (*argc)++; + + *argv = calloc ((*argc + 1), sizeof (char *)); + + i = 0; + save = 0; + for (i = 0; i < *argc; i++) + { + int n; + argcv_scan (len, command, delim, cmnt, &start, &end, &save); + + if ((command[start] == '"' || command[end] == '\'') + && command[end] == command[start]) + { + start++; + end--; + } + n = end - start + 1; + (*argv)[i] = calloc (n+1, sizeof (char)); + if ((*argv)[i] == NULL) + return 1; + unescape_copy ((*argv)[i], &command[start], n); + (*argv)[i][n] = 0; + } + (*argv)[i] = NULL; + return 0; +} + +/* + * frees all elements of an argv array + * argc is the number of elements + * argv is the array + */ +int +argcv_free (int argc, char **argv) +{ + while (--argc >= 0) + if (argv[argc]) + free (argv[argc]); + free (argv); + return 1; +} + +/* Take a argv an make string separated by ' '. */ + +int +argcv_string (int argc, char **argv, char **pstring) +{ + size_t i, j, len; + char *buffer; + + /* No need. */ + if (pstring == NULL) + return 1; + + buffer = malloc (1); + if (buffer == NULL) + return 1; + *buffer = '\0'; + + for (len = i = j = 0; i < argc; i++) + { + int quote = 0; + int toklen; + + toklen = escaped_length (argv[i], "e); + + len += toklen + 2; + if (quote) + len += 2; + + buffer = realloc (buffer, len); + if (buffer == NULL) + return 1; + + if (i != 0) + buffer[j++] = ' '; + if (quote) + buffer[j++] = '"'; + escape_copy (buffer + j, argv[i]); + j += toklen; + if (quote) + buffer[j++] = '"'; + } + + for (; j > 0 && isspace (buffer[j-1]); j--) + ; + buffer[j] = 0; + if (pstring) + *pstring = buffer; + return 0; +} + +#if 0 +char *command = "set prompt=\"& \a\\\"\" \\x25\\0145\\098\\ta"; + +main(int xargc, char **xargv) +{ + int i, argc; + char **argv; + char *s; + + argcv_get (xargv[1] ? xargv[1]:command, "=", "#", &argc, &argv); + printf ("%d args:\n", argc); + for (i = 0; i < argc; i++) + printf ("%s\n", argv[i]); + printf ("===\n"); + argcv_string (argc, argv, &s); + printf ("%s\n", s); +} +#endif diff --git a/tests/argcv.h b/tests/argcv.h new file mode 100644 index 0000000..029b1f8 --- /dev/null +++ b/tests/argcv.h @@ -0,0 +1,50 @@ +/* GNU Mailutils -- a suite of utilities for electronic mail + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + + This library 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 of the License, or (at your option) any later version. + + This library 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 Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#ifndef _ARGCV_H +#define _ARGCV_H 1 + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __P +# if defined PROTOTYPES || (defined __STDC__ && __STDC__) +# define __P(args) args +# else +# define __P(args) () +# endif +#endif /*__P */ + +extern int argcv_get __P ((const char *command, const char *delim, + const char* cmnt, + int *argc, char ***argv)); +extern int argcv_string __P ((int argc, char **argv, char **string)); +extern int argcv_free __P ((int argc, char **argv)); +extern int argcv_unescape_char __P((int c)); +extern int argcv_escape_char __P((int c)); + +#ifdef __cplusplus +} +#endif + +#endif /* _ARGCV_H */ diff --git a/tests/atlocal.in b/tests/atlocal.in new file mode 100644 index 0000000..8fd5655 --- /dev/null +++ b/tests/atlocal.in @@ -0,0 +1,6 @@ +# @configure_input@ -*- shell-script -*- +# Configurable variable values for tar test suite. +# Copyright (C) 2004 Free Software Foundation, Inc. + +PATH=@abs_builddir@:@abs_top_builddir@/src:$top_srcdir:$srcdir:$PATH + diff --git a/tests/genfile.c b/tests/genfile.c new file mode 100644 index 0000000..8032dd3 --- /dev/null +++ b/tests/genfile.c @@ -0,0 +1,884 @@ +/* Generate a file containing some preset patterns. + Print statistics for existing files. + + Copyright (C) 1995, 1996, 1997, 2001, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + François Pinard , 1995. + Sergey Poznyakoff , 2004, 2005, 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 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define obstack_chunk_alloc malloc +#define obstack_chunk_free free +#include + +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + +#if ! defined SIGCHLD && defined SIGCLD +# define SIGCHLD SIGCLD +#endif + +enum pattern +{ + DEFAULT_PATTERN, + ZEROS_PATTERN +}; + +/* The name this program was run with. */ +const char *program_name; + +/* Name of file to generate */ +static char *file_name; + +/* Name of the file-list file: */ +static char *files_from; +static char filename_terminator = '\n'; + +/* Length of file to generate. */ +static off_t file_length = 0; +static off_t seek_offset = 0; + +/* Pattern to generate. */ +static enum pattern pattern = DEFAULT_PATTERN; + +/* Next checkpoint number */ +size_t checkpoint; + +enum genfile_mode + { + mode_generate, + mode_sparse, + mode_stat, + mode_exec + }; + +enum genfile_mode mode = mode_generate; + +#define DEFAULT_STAT_FORMAT \ + "name,dev,ino,mode,nlink,uid,gid,size,blksize,blocks,atime,mtime,ctime" + +/* Format for --stat option */ +static char *stat_format = DEFAULT_STAT_FORMAT; + +/* Size of a block for sparse file */ +size_t block_size = 512; + +/* Block buffer for sparse file */ +char *buffer; + +/* Number of arguments and argument vector for mode == mode_exec */ +int exec_argc; +char **exec_argv; + +/* Time for --touch option */ +struct timespec touch_time; + +/* Verbose mode */ +int verbose; + +const char *argp_program_version = "genfile (" PACKAGE ") " VERSION; +const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; +static char doc[] = N_("genfile manipulates data files for GNU paxutils test suite.\n" +"OPTIONS are:\n"); + +#define OPT_CHECKPOINT 256 +#define OPT_TOUCH 257 +#define OPT_APPEND 258 +#define OPT_TRUNCATE 259 +#define OPT_EXEC 260 +#define OPT_DATE 261 +#define OPT_VERBOSE 262 +#define OPT_SEEK 263 + +static struct argp_option options[] = { +#define GRP 0 + {NULL, 0, NULL, 0, + N_("File creation options:"), GRP}, + {"length", 'l', N_("SIZE"), 0, + N_("Create file of the given SIZE"), GRP+1 }, + {"file", 'f', N_("NAME"), 0, + N_("Write to file NAME, instead of standard output"), GRP+1}, + {"files-from", 'T', N_("FILE"), 0, + N_("Read file names from FILE"), GRP+1}, + {"null", '0', NULL, 0, + N_("-T reads null-terminated names"), GRP+1}, + {"pattern", 'p', N_("PATTERN"), 0, + N_("Fill the file with the given PATTERN. PATTERN is 'default' or 'zeros'"), + GRP+1 }, + {"block-size", 'b', N_("SIZE"), 0, + N_("Size of a block for sparse file"), GRP+1}, + {"sparse", 's', NULL, 0, + N_("Generate sparse file. Rest of the command line gives the file map."), + GRP+1 }, + {"seek", OPT_SEEK, N_("OFFSET"), 0, + N_("Seek to the given offset before writing data"), + GRP+1 }, + +#undef GRP +#define GRP 10 + {NULL, 0, NULL, 0, + N_("File statistics options:"), GRP}, + + {"stat", 'S', N_("FORMAT"), OPTION_ARG_OPTIONAL, + N_("Print contents of struct stat for each given file. Default FORMAT is: ") + DEFAULT_STAT_FORMAT, + GRP+1 }, + +#undef GRP +#define GRP 20 + {NULL, 0, NULL, 0, + N_("Synchronous execution options:"), GRP}, + + {"run", 'r', N_("COMMAND"), 0, + N_("Execute given COMMAND. Useful with --checkpoint and one of --cut, --append, --touch"), + GRP+1 }, + {"checkpoint", OPT_CHECKPOINT, N_("NUMBER"), 0, + N_("Perform given action (see below) upon reaching checkpoint NUMBER"), + GRP+1 }, + {"date", OPT_DATE, N_("STRING"), 0, + N_("Set date for next --touch option"), + GRP+1 }, + {"verbose", OPT_VERBOSE, NULL, 0, + N_("Display executed checkpoints and exit status of COMMAND"), + GRP+1 }, +#undef GRP +#define GRP 30 + {NULL, 0, NULL, 0, + N_("Synchronous execution actions. These are executed when checkpoint number given by --checkpoint option is reached."), GRP}, + + {"cut", OPT_TRUNCATE, N_("FILE"), 0, + N_("Truncate FILE to the size specified by previous --length option (or 0, if it is not given)"), + GRP+1 }, + {"truncate", 0, NULL, OPTION_ALIAS, NULL, GRP+1 }, + {"append", OPT_APPEND, N_("FILE"), 0, + N_("Append SIZE bytes to FILE. SIZE is given by previous --length option."), + GRP+1 }, + {"touch", OPT_TOUCH, N_("FILE"), 0, + N_("Update the access and modification times of FILE"), + GRP+1 }, + {"exec", OPT_EXEC, N_("COMMAND"), 0, + N_("Execute COMMAND"), + GRP+1 }, +#undef GRP + { NULL, } +}; + +static char const * const pattern_args[] = { "default", "zeros", 0 }; +static enum pattern const pattern_types[] = {DEFAULT_PATTERN, ZEROS_PATTERN}; + +static int +xlat_suffix (off_t *vp, const char *p) +{ + off_t val = *vp; + + if (p[1]) + return 1; + switch (p[0]) + { + case 'g': + case 'G': + *vp *= 1024; + + case 'm': + case 'M': + *vp *= 1024; + + case 'k': + case 'K': + *vp *= 1024; + break; + + default: + return 1; + } + return *vp <= val; +} + +static off_t +get_size (const char *str, int allow_zero) +{ + const char *p; + off_t v = 0; + + for (p = str; *p; p++) + { + int digit = *p - '0'; + off_t x = v * 10; + if (9 < (unsigned) digit) + { + if (xlat_suffix (&v, p)) + error (EXIT_FAILURE, 0, _("Invalid size: %s"), str); + else + break; + } + else if (x / 10 != v) + error (EXIT_FAILURE, 0, _("Number out of allowed range: %s"), str); + v = x + digit; + if (v < 0) + error (EXIT_FAILURE, 0, _("Negative size: %s"), str); + } + return v; +} + +void +verify_file (char *file_name) +{ + if (file_name) + { + struct stat st; + + if (stat (file_name, &st)) + error (0, errno, _("stat(%s) failed"), file_name); + + if (st.st_size != file_length + seek_offset) + { + printf ("%lu %lu\n", (unsigned long)st.st_size , (unsigned long)file_length); + exit (1); + } + + if (mode == mode_sparse && !ST_IS_SPARSE (st)) + exit (1); + } +} + +struct action +{ + struct action *next; + size_t checkpoint; + int action; + char *name; + off_t size; + enum pattern pattern; + struct timespec ts; +}; + +static struct action *action_list; + +void +reg_action (int action, char *arg) +{ + struct action *act = xmalloc (sizeof (*act)); + act->checkpoint = checkpoint; + act->action = action; + act->pattern = pattern; + act->ts = touch_time; + act->size = file_length; + act->name = arg; + act->next = action_list; + action_list = act; +} + +static error_t +parse_opt (int key, char *arg, struct argp_state *state) +{ + switch (key) + { + case '0': + filename_terminator = 0; + break; + + case 'f': + file_name = arg; + break; + + case 'l': + file_length = get_size (arg, 1); + break; + + case 'p': + pattern = XARGMATCH ("--pattern", arg, pattern_args, pattern_types); + break; + + case 'b': + block_size = get_size (arg, 0); + break; + + case 's': + mode = mode_sparse; + break; + + case 'S': + mode = mode_stat; + if (arg) + stat_format = arg; + break; + + case 'r': + mode = mode_exec; + argcv_get (arg, "", NULL, &exec_argc, &exec_argv); + break; + + case 'T': + files_from = arg; + break; + + case OPT_SEEK: + seek_offset = get_size (arg, 0); + break; + + case OPT_CHECKPOINT: + { + char *p; + + checkpoint = strtoul (arg, &p, 0); + if (*p) + argp_error (state, _("Error parsing number near `%s'"), p); + } + break; + + case OPT_DATE: + if (!get_date (&touch_time, arg, NULL)) + argp_error (state, _("Unknown date format")); + break; + + case OPT_APPEND: + case OPT_TRUNCATE: + case OPT_TOUCH: + case OPT_EXEC: + reg_action (key, arg); + break; + + case OPT_VERBOSE: + verbose++; + break; + + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +static struct argp argp = { + options, + parse_opt, + N_("[ARGS...]"), + doc, + NULL, + NULL, + NULL +}; + + +void +fill (FILE *fp, off_t length, enum pattern pattern) +{ + off_t i; + + switch (pattern) + { + case DEFAULT_PATTERN: + for (i = 0; i < length; i++) + fputc (i & 255, fp); + break; + + case ZEROS_PATTERN: + for (i = 0; i < length; i++) + fputc (0, fp); + break; + } +} + +/* Generate Mode: usual files */ +static void +generate_simple_file (char *filename) +{ + FILE *fp; + + if (filename) + { + fp = fopen (filename, seek_offset ? "r+" : "w"); + if (!fp) + error (EXIT_FAILURE, 0, _("cannot open `%s'"), filename); + } + else + fp = stdout; + + if (fseeko (fp, seek_offset, 0)) + error (EXIT_FAILURE, 0, _("cannot seek: %s"), strerror (errno)); + + fill (fp, file_length, pattern); + + fclose (fp); +} + +/* A simplified version of the same function from tar */ +int +read_name_from_file (FILE *fp, struct obstack *stk) +{ + int c; + size_t counter = 0; + + for (c = getc (fp); c != EOF && c != filename_terminator; c = getc (fp)) + { + if (c == 0) + error (EXIT_FAILURE, 0, _("file name contains null character")); + obstack_1grow (stk, c); + counter++; + } + + obstack_1grow (stk, 0); + + return (counter == 0 && c == EOF); +} + +void +generate_files_from_list () +{ + FILE *fp = strcmp (files_from, "-") ? fopen (files_from, "r") : stdin; + struct obstack stk; + + if (!fp) + error (EXIT_FAILURE, errno, _("cannot open `%s'"), files_from); + + obstack_init (&stk); + while (!read_name_from_file (fp, &stk)) + { + char *name = obstack_finish (&stk); + generate_simple_file (name); + verify_file (name); + obstack_free (&stk, name); + } + fclose (fp); + obstack_free (&stk, NULL); +} + + +/* Generate Mode: sparse files */ + +static void +mkhole (int fd, off_t displ) +{ + if (lseek (fd, displ, SEEK_CUR) == -1) + error (EXIT_FAILURE, errno, "lseek"); + ftruncate (fd, lseek (fd, 0, SEEK_CUR)); +} + +static void +mksparse (int fd, off_t displ, char *marks) +{ + if (lseek (fd, displ, SEEK_CUR) == -1) + error (EXIT_FAILURE, errno, "lseek"); + + for (; *marks; marks++) + { + memset (buffer, *marks, block_size); + if (write (fd, buffer, block_size) != block_size) + error (EXIT_FAILURE, errno, "write"); + } +} + +static void +generate_sparse_file (int argc, char **argv) +{ + int i; + int fd; + int flags = O_CREAT|O_RDWR; + + if (!file_name) + error (EXIT_FAILURE, 0, + _("cannot generate sparse files on standard output, use --file option")); + if (!seek_offset) + flags |= O_TRUNC; + fd = open (file_name, flags, 0644); + if (fd < 0) + error (EXIT_FAILURE, 0, _("cannot open `%s'"), file_name); + + buffer = xmalloc (block_size); + + file_length = 0; + + for (i = 0; i < argc; i += 2) + { + off_t displ = get_size (argv[i], 1); + file_length += displ; + + if (i == argc-1) + { + mkhole (fd, displ); + break; + } + else + { + file_length += block_size * strlen (argv[i+1]); + mksparse (fd, displ, argv[i+1]); + } + } + + close (fd); +} + + +/* Status Mode */ + +void +print_time (time_t t) +{ + char buf[20]; /* ccyy-mm-dd HH:MM:SS\0 */ + strftime (buf, sizeof buf, "%Y-%m-%d %H:%M:%S", gmtime (&t)); + printf ("%s ", buf); +} + +void +print_stat (const char *name) +{ + char *fmt, *p; + struct stat st; + char buf[UINTMAX_STRSIZE_BOUND]; + + if (stat (name, &st)) + { + error (0, errno, _("stat(%s) failed"), name); + return; + } + + fmt = strdup (stat_format); + for (p = strtok (fmt, ","); p; ) + { + if (memcmp (p, "st_", 3) == 0) + p += 3; + if (strcmp (p, "name") == 0) + printf ("%s", name); + else if (strcmp (p, "dev") == 0) + printf ("%lu", (unsigned long) st.st_dev); + else if (strcmp (p, "ino") == 0) + printf ("%lu", (unsigned long) st.st_ino); + else if (strncmp (p, "mode", 4) == 0) + { + mode_t mask = ~0; + + if (ispunct (p[4])) + { + char *q; + + mask = strtoul (p + 5, &q, 8); + if (*q) + { + printf ("\n"); + error (EXIT_FAILURE, 0, _("incorrect mask (near `%s')"), q); + } + } + else if (p[4]) + { + printf ("\n"); + error (EXIT_FAILURE, 0, _("Unknown field `%s'"), p); + } + printf ("%0o", st.st_mode & mask); + } + else if (strcmp (p, "nlink") == 0) + printf ("%lu", (unsigned long) st.st_nlink); + else if (strcmp (p, "uid") == 0) + printf ("%ld", (long unsigned) st.st_uid); + else if (strcmp (p, "gid") == 0) + printf ("%lu", (unsigned long) st.st_gid); + else if (strcmp (p, "size") == 0) + printf ("%s", umaxtostr (st.st_size, buf)); + else if (strcmp (p, "blksize") == 0) + printf ("%s", umaxtostr (st.st_blksize, buf)); + else if (strcmp (p, "blocks") == 0) + printf ("%s", umaxtostr (st.st_blocks, buf)); + else if (strcmp (p, "atime") == 0) + printf ("%lu", (unsigned long) st.st_atime); + else if (strcmp (p, "atimeH") == 0) + print_time (st.st_atime); + else if (strcmp (p, "mtime") == 0) + printf ("%lu", (unsigned long) st.st_mtime); + else if (strcmp (p, "mtimeH") == 0) + print_time (st.st_mtime); + else if (strcmp (p, "ctime") == 0) + printf ("%lu", (unsigned long) st.st_ctime); + else if (strcmp (p, "ctimeH") == 0) + print_time (st.st_ctime); + else if (strcmp (p, "sparse") == 0) + printf ("%d", ST_IS_SPARSE (st)); + else + { + printf ("\n"); + error (EXIT_FAILURE, 0, _("Unknown field `%s'"), p); + } + p = strtok (NULL, ","); + if (p) + printf (" "); + } + printf ("\n"); + free (fmt); +} + + +/* Exec Mode */ + +void +exec_checkpoint (struct action *p) +{ + if (verbose) + printf ("processing checkpoint %lu\n", (unsigned long) p->checkpoint); + switch (p->action) + { + case OPT_TOUCH: + { + struct timespec ts[2]; + + ts[0] = ts[1] = p->ts; + if (utimens (p->name, ts) != 0) + { + error (0, errno, _("cannot set time on `%s'"), p->name); + break; + } + } + break; + + case OPT_APPEND: + { + FILE *fp = fopen (p->name, "a"); + if (!fp) + { + error (0, errno, _("cannot open `%s'"), p->name); + break; + } + + fill (fp, p->size, p->pattern); + fclose (fp); + } + break; + + case OPT_TRUNCATE: + { + int fd = open (p->name, O_RDWR); + if (fd == -1) + { + error (0, errno, _("cannot open `%s'"), p->name); + break; + } + ftruncate (fd, p->size); + close (fd); + } + break; + + case OPT_EXEC: + system (p->name); + break; + + default: + abort (); + } +} + +void +process_checkpoint (size_t n) +{ + struct action *p, *prev = NULL; + + for (p = action_list; p; ) + { + struct action *next = p->next; + + if (p->checkpoint <= n) + { + exec_checkpoint (p); + /* Remove the item from the list */ + if (prev) + prev->next = next; + else + action_list = next; + free (p); + } + else + prev = p; + + p = next; + } +} + +#define CHECKPOINT_TEXT "Write checkpoint" + +void +exec_command (void) +{ + int status; + pid_t pid; + int fd[2]; + char *p; + FILE *fp; + char buf[128]; + + /* Insert --checkpoint option. + FIXME: This assumes that exec_argv does not use traditional tar options + (without dash) */ + exec_argc++; + exec_argv = xrealloc (exec_argv, (exec_argc + 1) * sizeof (*exec_argv)); + memmove (exec_argv+2, exec_argv+1, (exec_argc - 1) * sizeof (*exec_argv)); + exec_argv[1] = "--checkpoint"; + +#ifdef SIGCHLD + /* System V fork+wait does not work if SIGCHLD is ignored. */ + signal (SIGCHLD, SIG_DFL); +#endif + + pipe (fd); + + pid = fork (); + if (pid == -1) + error (EXIT_FAILURE, errno, "fork"); + + if (pid == 0) + { + /* Child */ + + /* Pipe stderr */ + if (fd[1] != 2) + dup2 (fd[1], 2); + close (fd[0]); + + /* Make sure POSIX locale is used */ + setenv ("LC_ALL", "POSIX", 1); + + execvp (exec_argv[0], exec_argv); + error (EXIT_FAILURE, errno, "execvp"); + } + + /* Master */ + close (fd[1]); + fp = fdopen (fd[0], "r"); + if (fp == NULL) + error (EXIT_FAILURE, errno, "fdopen"); + + while ((p = fgets (buf, sizeof buf, fp))) + { + while (*p && !isspace (*p) && *p != ':') + p++; + + if (*p == ':') + { + for (p++; *p && isspace (*p); p++) + ; + + if (*p + && memcmp (p, CHECKPOINT_TEXT, sizeof CHECKPOINT_TEXT - 1) == 0) + { + char *end; + size_t n = strtoul (p + sizeof CHECKPOINT_TEXT - 1, &end, 10); + if (!(*end && !isspace (*end))) + { + process_checkpoint (n); + continue; + } + } + } + fprintf (stderr, "%s", buf); + } + + /* Collect exit status */ + waitpid (pid, &status, 0); + + if (verbose) + { + if (WIFEXITED (status)) + { + if (WEXITSTATUS (status) == 0) + printf (_("Command exited successfully\n")); + else + printf (_("Command failed with status %d\n"), + WEXITSTATUS (status)); + } + else if (WIFSIGNALED (status)) + printf (_("Command terminated on signal %d\n"), WTERMSIG (status)); + else if (WIFSTOPPED (status)) + printf (_("Command stopped on signal %d\n"), WSTOPSIG (status)); +#ifdef WCOREDUMP + else if (WCOREDUMP (status)) + printf (_("Command dumped core\n")); +#endif + else + printf(_("Command terminated\n")); + } + + if (WIFEXITED (status)) + exit (WEXITSTATUS (status)); + exit (EXIT_FAILURE); +} + +int +main (int argc, char **argv) +{ + int index; + + program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + get_date (&touch_time, "now", NULL); + + /* Decode command options. */ + + if (argp_parse (&argp, argc, argv, 0, &index, NULL)) + exit (EXIT_FAILURE); + + argc -= index; + argv += index; + + switch (mode) + { + case mode_stat: + if (argc == 0) + error (EXIT_FAILURE, 0, _("--stat requires file names")); + + while (argc--) + print_stat (*argv++); + break; + + case mode_sparse: + generate_sparse_file (argc, argv); + verify_file (file_name); + break; + + case mode_generate: + if (argc) + error (EXIT_FAILURE, 0, _("too many arguments")); + if (files_from) + generate_files_from_list (); + else + { + generate_simple_file (file_name); + verify_file (file_name); + } + break; + + case mode_exec: + exec_command (); + break; + + default: + /* Just in case */ + abort (); + } + exit (EXIT_SUCCESS); +} diff --git a/tests/inout.at b/tests/inout.at new file mode 100644 index 0000000..88b6051 --- /dev/null +++ b/tests/inout.at @@ -0,0 +1,40 @@ +# Process this file with autom4te to create testsuite. -*- Autotest -*- +# Copyright (C) 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. + +AT_SETUP([basic functionality: copyin/copyout]) +AT_KEYWORDS([copyin copyout]) + +AT_DATA([filelist],[a 18 +b 1024 +c 356 +d 20000 +e 3 +f 0 +g 10658 +h 45 +]) + +AT_CHECK([ +while read NAME LENGTH +do + genfile --length $LENGTH > $NAME + echo $NAME +done < filelist | + cpio --quiet -o > archive]) + +AT_CLEANUP diff --git a/tests/package.m4 b/tests/package.m4 new file mode 100644 index 0000000..c8f8874 --- /dev/null +++ b/tests/package.m4 @@ -0,0 +1,6 @@ +# Signature of the current package. +m4_define([AT_PACKAGE_NAME], [GNU cpio]) +m4_define([AT_PACKAGE_TARNAME], [cpio]) +m4_define([AT_PACKAGE_VERSION], [2.8]) +m4_define([AT_PACKAGE_STRING], [GNU cpio 2.8]) +m4_define([AT_PACKAGE_BUGREPORT], [bug-cpio@gnu.org]) diff --git a/tests/symlink.at b/tests/symlink.at new file mode 100644 index 0000000..89d2ccc --- /dev/null +++ b/tests/symlink.at @@ -0,0 +1,48 @@ +# Process this file with autom4te to create testsuite. -*- Autotest -*- +# 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. + +# Cpio 2.7 failed to properly terminate symbolic link target names. +# Reference: http://savannah.gnu.org/bugs/?18094 + +AT_SETUP([symlink]) +AT_KEYWORDS([symlink copyout]) + +AT_DATA([filelist],[file +symlink +]) + +AT_CHECK([ +genfile --file file +ln -s file symlink || AT_SKIP_TEST +echo Creating the archive +cpio --quiet -o < filelist > archive +echo Extracting the archive +mkdir dir +cd dir +cpio --quiet -i < ../archive +find . | sort +], +[0], +[Creating the archive +Extracting the archive +. +./file +./symlink +],[]) + +AT_CLEANUP \ No newline at end of file diff --git a/tests/testsuite b/tests/testsuite new file mode 100755 index 0000000..e22dcf7 --- /dev/null +++ b/tests/testsuite @@ -0,0 +1,1742 @@ +#! /bin/sh +# +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. +# This test suite is free software; the Free Software Foundation gives +# unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# 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 + +# 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 +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (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 +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 + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +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 /usr/bin/posix$PATH_SEPARATOR/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 +# Be Bourne compatible +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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(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. :-) + 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" || + { 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + 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 +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 || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +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=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +SHELL=${CONFIG_SHELL-/bin/sh} + +# How were we run? +at_cli_args="$@" + +# Load the config file. +for at_file in atconfig atlocal +do + test -r $at_file || continue + . ./$at_file || { echo "$as_me: error: invalid content: $at_file" >&2 + { (exit 1); exit 1; }; } +done + +# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: +: ${at_top_build_prefix=$at_top_builddir} + +# atconfig delivers names relative to the directory the test suite is +# in, but the groups themselves are run in testsuite-dir/group-dir. +if test -n "$at_top_srcdir"; then + builddir=../.. + for at_dir in srcdir top_srcdir top_build_prefix + do + at_val=`eval echo '${'at_$at_dir'}'` + eval "$at_dir=\$at_val/../.." + done +fi + +# Not all shells have the 'times' builtin; the subshell is needed to make +# sure we discard the 'times: not found' message from the shell. +at_times_p=false +(times) >/dev/null 2>&1 && at_times_p=: + +# CLI Arguments to pass to the debugging scripts. +at_debug_args= +# -e sets to true +at_errexit_p=false +# Shall we be verbose? +at_verbose=: +at_quiet=echo + +# Shall we keep the debug scripts? Must be `:' when the suite is +# run by a debug script, so that the script doesn't remove itself. +at_debug_p=false +# Display help message? +at_help_p=false +# Display the version message? +at_version_p=false +# List test groups? +at_list_p=false +# Test groups to run +at_groups= + +# The directory we are in. +at_dir=`pwd` +# The directory the whole suite works in. +# Should be absolutely to let the user `cd' at will. +at_suite_dir=$at_dir/$as_me.dir +# The file containing the suite. +at_suite_log=$at_dir/$as_me.log +# The file containing the location of the last AT_CHECK. +at_check_line_file=$at_suite_dir/at-check-line +# The file containing the exit status of the last command. +at_status_file=$at_suite_dir/at-status +# The files containing the output of the tested commands. +at_stdout=$at_suite_dir/at-stdout +at_stder1=$at_suite_dir/at-stder1 +at_stderr=$at_suite_dir/at-stderr +# The file containing dates. +at_times_file=$at_suite_dir/at-times + +# List of the tested programs. +at_tested='cpio' +# List of the all the test groups. +at_groups_all=' 1 2 3' +# As many question marks as there are digits in the last test group number. +# Used to normalize the test group numbers so that `ls' lists them in +# numerical order. +at_format='?' +# Description of all the test groups. +at_help_all='1;version.at:19;cpio version;; +2;inout.at:19;basic functionality: copyin/copyout;copyin copyout; +3;symlink.at:22;symlink;symlink copyout; +' + +at_prev= +for at_option +do + # If the previous option needs an argument, assign it. + if test -n "$at_prev"; then + at_option=$at_prev=$at_option + at_prev= + fi + + case $at_option in + *=*) at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` ;; + *) at_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $at_option in + --help | -h ) + at_help_p=: + ;; + + --list | -l ) + at_list_p=: + ;; + + --version | -V ) + at_version_p=: + ;; + + --clean | -c ) + test -d "$at_suite_dir" && + find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; + rm -f -r "$at_suite_dir" "$at_suite_log" + exit 0 + ;; + + --debug | -d ) + at_debug_p=: + ;; + + --errexit | -e ) + at_debug_p=: + at_errexit_p=: + ;; + + --verbose | -v ) + at_verbose=echo; at_quiet=: + ;; + + --trace | -x ) + at_traceon='set -x'; at_traceoff='set +x' + ;; + + [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) + at_groups="$at_groups$at_option " + ;; + + # Ranges + [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) + at_range_start=`echo $at_option |tr -d X-` + at_range=`echo " $at_groups_all " | \ + sed -e 's/^.* \('$at_range_start' \)/\1/'` + at_groups="$at_groups$at_range " + ;; + + -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) + at_range_end=`echo $at_option |tr -d X-` + at_range=`echo " $at_groups_all " | \ + sed -e 's/\( '$at_range_end'\) .*$/\1/'` + at_groups="$at_groups$at_range " + ;; + + [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ + [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \ + [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \ + [0-9][0-9][0-9]-[0-9][0-9][0-9] | \ + [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \ + [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ) + at_range_start=`expr $at_option : '\(.*\)-'` + at_range_end=`expr $at_option : '.*-\(.*\)'` + if test $at_range_start -gt $at_range_end; then + at_tmp=$at_range_end + at_range_end=$at_range_start + at_range_start=$at_tmp + fi + at_range=`echo " $at_groups_all " | \ + sed -e 's/^.*\( '$at_range_start' \)/\1/' \ + -e 's/\( '$at_range_end'\) .*$/\1/'` + at_groups="$at_groups$at_range " + ;; + + # Keywords. + --keywords | -k ) + at_prev=--keywords + ;; + --keywords=* ) + at_groups_selected=$at_help_all + at_save_IFS=$IFS + IFS=, + set X $at_optarg + shift + IFS=$at_save_IFS + for at_keyword + do + at_invert= + case $at_keyword in + '!'*) + at_invert="-v" + at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'` + ;; + esac + # It is on purpose that we match the test group titles too. + at_groups_selected=`echo "$at_groups_selected" | + grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"` + done + at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'` + # Smash the newlines. + at_groups="$at_groups`echo $at_groups_selected` " + ;; + + *=*) + at_envvar=`expr "x$at_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$at_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $at_envvar" >&2 + { (exit 1); exit 1; }; } + at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$at_envvar='$at_value'" + export $at_envvar + # Propagate to debug scripts. + at_debug_args="$at_debug_args $at_envvar='$at_value'" + ;; + + *) echo "$as_me: invalid option: $at_option" >&2 + echo "Try \`$0 --help' for more information." >&2 + exit 1 + ;; + esac +done + +# Selected test groups. +if test -z "$at_groups"; then + at_groups=$at_groups_all +else + # Sort the tests, removing duplicates: + at_groups=`echo $at_groups | tr ' ' "$as_nl" | sort -nu` + # and add banners. (Passing at_groups_all is tricky--see the comment + # starting with "Passing at_groups is tricky.") + at_groups=`echo "$at_groups$as_nl $at_groups_all" | + awk 'BEGIN { FS = "@" } # Effectively switch off field splitting. + /^$/ { next } # Ignore the empty line. + !/ / { groups++; selected[$ 0] = 1; next } + # The last line, containing at_groups_all. + { + n = split($ 0, a, " ") + # If there are several tests, select their banners: + if (groups > 1) { + for (i = 1; i <= n; i++) { + if (a[i] ~ /^banner-/) + banner = a[i] + else if (banner != "" && selected[a[i]] == 1) + selected[banner] = 1 + } + } + for (i = 1; i <= n; i++) + if (selected[a[i]] == 1) + list = list " " a[i] + print list + }'` +fi + +# Help message. +if $at_help_p; then + cat <<_ATEOF +Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS] + +Run all the tests, or the selected TESTS, given by numeric ranges, and +save a detailed log file. Upon failure, create debugging scripts. + +You should not change environment variables unless explicitly passed +as command line arguments. Set \`AUTOTEST_PATH' to select the executables +to exercise. Each relative directory is expanded as build and source +directories relatively to the top level of this distribution. E.g., + + $ $0 AUTOTEST_PATH=bin + +possibly amounts into + + PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH +_ATEOF +cat <<_ATEOF + +Operation modes: + -h, --help print the help message, then exit + -V, --version print version number, then exit + -c, --clean remove all the files this test suite might create and exit + -l, --list describes all the tests, or the selected TESTS +_ATEOF +cat <<_ATEOF + +Execution tuning: + -k, --keywords=KEYWORDS + select the tests matching all the comma-separated KEYWORDS + multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD + -e, --errexit abort as soon as a test fails; implies --debug + -v, --verbose force more detailed output + default for debugging scripts + -d, --debug inhibit clean up and top-level logging + default for debugging scripts + -x, --trace enable tests shell tracing +_ATEOF +cat <<_ATEOF + +Report bugs to . +_ATEOF + exit 0 +fi + +# List of tests. +if $at_list_p; then + cat <<_ATEOF +GNU cpio 2.8 test suite test groups: + + NUM: FILE-NAME:LINE TEST-GROUP-NAME + KEYWORDS + +_ATEOF + # Passing at_groups is tricky. We cannot use it to form a literal string + # or regexp because of the limitation of AIX awk. And Solaris' awk + # doesn't grok more than 99 fields in a record, so we have to use `split'. + echo "$at_groups$as_nl$at_help_all" | + awk 'BEGIN { FS = ";" } + NR == 1 { + for (n = split($ 0, a, " "); n; n--) selected[a[n]] = 1 + next + } + { + if (selected[$ 1]) { + printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 + if ($ 4) printf " %s\n", $ 4 + } + }' + exit 0 +fi +if $at_version_p; then + echo "$as_me (GNU cpio 2.8)" + cat <<\_ACEOF + +Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software +Foundation, Inc. +This test suite is free software; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi + +# Don't take risks: use only absolute directories in PATH. +# +# For stand-alone test suites, AUTOTEST_PATH is relative to `.'. +# +# For embedded test suites, AUTOTEST_PATH is relative to the top level +# of the package. Then expand it into build/src parts, since users +# may create executables in both places. +AUTOTEST_PATH=`echo $AUTOTEST_PATH | sed "s&:&$PATH_SEPARATOR&g"` +at_path= +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $AUTOTEST_PATH $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -n "$at_path" && at_path=$at_path$PATH_SEPARATOR +case $as_dir in + [\\/]* | ?:[\\/]* ) + at_path=$at_path$as_dir + ;; + * ) + if test -z "$at_top_build_prefix"; then + # Stand-alone test suite. + at_path=$at_path$as_dir + else + # Embedded test suite. + at_path=$at_path$at_top_build_prefix$as_dir$PATH_SEPARATOR + at_path=$at_path$at_top_srcdir/$as_dir + fi + ;; +esac +done +IFS=$as_save_IFS + + +# Now build and simplify PATH. +# +# There might be directories that don't exist, but don't redirect +# builtins' (eg., cd) stderr directly: Ultrix's sh hates that. +PATH= +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $at_path +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` +test -d "$as_dir" || continue +case $PATH in + $as_dir | \ + $as_dir$PATH_SEPARATOR* | \ + *$PATH_SEPARATOR$as_dir | \ + *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;; + + '') PATH=$as_dir ;; + *) PATH=$PATH$PATH_SEPARATOR$as_dir ;; +esac +done +IFS=$as_save_IFS + +export PATH + +# Setting up the FDs. +# 5 is the log file. Not to be overwritten if `-d'. + +if $at_debug_p; then + at_suite_log=/dev/null +else + : >"$at_suite_log" +fi +exec 5>>"$at_suite_log" + +# Banners and logs. +cat <<\_ASBOX +## ------------------------ ## +## GNU cpio 2.8 test suite. ## +## ------------------------ ## +_ASBOX +{ + cat <<\_ASBOX +## ------------------------ ## +## GNU cpio 2.8 test suite. ## +## ------------------------ ## +_ASBOX + echo + + echo "$as_me: command line was:" + echo " $ $0 $at_cli_args" + echo + + # Try to find a few ChangeLogs in case it might help determining the + # exact version. Use the relative dir: if the top dir is a symlink, + # find will not follow it (and options to follow the links are not + # portable), which would result in no output here. + if test -n "$at_top_srcdir"; then + cat <<\_ASBOX +## ----------- ## +## ChangeLogs. ## +## ----------- ## +_ASBOX + echo + for at_file in `find "$at_top_srcdir" -name ChangeLog -print` + do + echo "$as_me: $at_file:" + sed 's/^/| /;10q' $at_file + echo + done + + { +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} + echo + fi + + # Contents of the config files. + for at_file in atconfig atlocal + do + test -r $at_file || continue + echo "$as_me: $at_file:" + sed 's/^/| /' $at_file + echo + done + + cat <<\_ASBOX +## ---------------- ## +## Tested programs. ## +## ---------------- ## +_ASBOX + echo +} >&5 + +# Report what programs are being tested. +for at_program in : $at_tested +do + test "$at_program" = : && continue + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -f "$as_dir/$at_program" && break +done +IFS=$as_save_IFS + + if test -f "$as_dir/$at_program"; then + { + echo "$at_srcdir/testsuite.at:26: $as_dir/$at_program --version" + "$as_dir/$at_program" --version + echo + } >&5 2>&1 + else + { { echo "$as_me:$LINENO: error: cannot find $at_program" >&5 +echo "$as_me: error: cannot find $at_program" >&2;} + { (exit 1); exit 1; }; } + fi +done + +{ + cat <<\_ASBOX +## ------------------ ## +## Running the tests. ## +## ------------------ ## +_ASBOX +} >&5 + +at_start_date=`date` +at_start_time=`date +%s 2>/dev/null` +echo "$as_me: starting at: $at_start_date" >&5 +at_xpass_list= +at_xfail_list= +at_pass_list= +at_fail_list= +at_skip_list= +at_group_count=0 + +# Create the master directory if it doesn't already exist. +test -d "$at_suite_dir" || + mkdir "$at_suite_dir" || + { { echo "$as_me:$LINENO: error: cannot create '$at_suite_dir'" >&5 +echo "$as_me: error: cannot create '$at_suite_dir'" >&2;} + { (exit 1); exit 1; }; } + +# Can we diff with `/dev/null'? DU 5.0 refuses. +if diff /dev/null /dev/null >/dev/null 2>&1; then + at_devnull=/dev/null +else + at_devnull=$at_suite_dir/devnull + >"$at_devnull" +fi + +# Use `diff -u' when possible. +if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff" +then + at_diff='diff -u' +else + at_diff=diff +fi + + +for at_group in $at_groups +do + # Be sure to come back to the top test directory. + cd "$at_suite_dir" + + case $at_group in + banner-*) + at_group_log=$at_suite_log + ;; + + *) + at_group_normalized=$at_group + + while :; do + case $at_group_normalized in #( + $at_format*) break;; + esac + at_group_normalized=0$at_group_normalized + done + + + # Create a fresh directory for the next test group, and enter. + at_group_dir=$at_suite_dir/$at_group_normalized + at_group_log=$at_group_dir/$as_me.log + if test -d "$at_group_dir"; then + find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; + rm -fr "$at_group_dir" + fi + # Be tolerant if the above `rm' was not able to remove the directory. + { as_dir=$at_group_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=`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 || +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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + cd $at_group_dir + ;; + esac + + echo 0 > "$at_status_file" + + # Clearly separate the test groups when verbose. + test $at_group_count != 0 && $at_verbose + + # In verbose mode, append to the log file *and* show on + # the standard output; in quiet mode only write to the log + if test $at_verbose = echo; then + at_tee_pipe='tee -a "$at_group_log"' + else + at_tee_pipe='cat >> "$at_group_log"' + fi + + case $at_group in + 1 ) # 1. version.at:19: cpio version + at_setup_line='version.at:19' + at_desc='cpio version' + $at_quiet $ECHO_N " 1: cpio version $ECHO_C" + at_xfail=no + echo "# -*- compilation -*-" >> "$at_group_log" + ( + echo "1. version.at:19: testing ..." + $at_traceon + + +$at_traceoff +echo "$at_srcdir/version.at:21: cpio --version" +echo version.at:21 >"$at_check_line_file" + +at_trace_this= +if test -n "$at_traceon"; then + at_trace_this=yes +fi + +if test -n "$at_trace_this"; then + ( $at_traceon; cpio --version ) >"$at_stdout" 2>"$at_stder1" + at_status=$? + grep '^ *+' "$at_stder1" >&2 + grep -v '^ *+' "$at_stder1" >"$at_stderr" +else + ( :; cpio --version ) >"$at_stdout" 2>"$at_stderr" + at_status=$? +fi + +at_failed=false +$at_diff "$at_devnull" "$at_stderr" || at_failed=: +echo >>"$at_stdout"; echo "cpio (GNU cpio) 2.8 +" | $at_diff - "$at_stdout" || at_failed=: +case $at_status in + 77) echo 77 > "$at_status_file"; exit 77;; + 0) ;; + *) echo "$at_srcdir/version.at:21: exit code was $at_status, expected 0" + at_failed=:;; +esac +if $at_failed; then + + + echo 1 > "$at_status_file" + exit 1 +else + +echo '==============================================================' +echo 'WARNING: Not using the proper version, *all* checks dubious...' +echo '==============================================================' + +fi + +$at_traceon + + + $at_traceoff + $at_times_p && times >"$at_times_file" + ) 5>&1 2>&1 | eval $at_tee_pipe + at_status=`cat "$at_status_file"` + ;; + + 2 ) # 2. inout.at:19: basic functionality: copyin/copyout + at_setup_line='inout.at:19' + at_desc='basic functionality: copyin/copyout' + $at_quiet $ECHO_N " 2: basic functionality: copyin/copyout $ECHO_C" + at_xfail=no + echo "# -*- compilation -*-" >> "$at_group_log" + ( + echo "2. inout.at:19: testing ..." + $at_traceon + + + +cat >filelist <<'_ATEOF' +a 18 +b 1024 +c 356 +d 20000 +e 3 +f 0 +g 10658 +h 45 +_ATEOF + + +$at_traceoff +echo "$at_srcdir/inout.at:32: +while read NAME LENGTH +do + genfile --length \$LENGTH > \$NAME + echo \$NAME +done < filelist | + cpio --quiet -o > archive" +echo inout.at:32 >"$at_check_line_file" + +at_trace_this= +if test -n "$at_traceon"; then + echo 'Not enabling shell tracing (command contains an embedded newline)' +fi + +if test -n "$at_trace_this"; then + ( $at_traceon; +while read NAME LENGTH +do + genfile --length $LENGTH > $NAME + echo $NAME +done < filelist | + cpio --quiet -o > archive ) >"$at_stdout" 2>"$at_stder1" + at_status=$? + grep '^ *+' "$at_stder1" >&2 + grep -v '^ *+' "$at_stder1" >"$at_stderr" +else + ( :; +while read NAME LENGTH +do + genfile --length $LENGTH > $NAME + echo $NAME +done < filelist | + cpio --quiet -o > archive ) >"$at_stdout" 2>"$at_stderr" + at_status=$? +fi + +at_failed=false +$at_diff "$at_devnull" "$at_stderr" || at_failed=: +$at_diff "$at_devnull" "$at_stdout" || at_failed=: +case $at_status in + 77) echo 77 > "$at_status_file"; exit 77;; + 0) ;; + *) echo "$at_srcdir/inout.at:32: exit code was $at_status, expected 0" + at_failed=:;; +esac +if $at_failed; then + + + echo 1 > "$at_status_file" + exit 1 +fi + +$at_traceon + + + $at_traceoff + $at_times_p && times >"$at_times_file" + ) 5>&1 2>&1 | eval $at_tee_pipe + at_status=`cat "$at_status_file"` + ;; + + 3 ) # 3. symlink.at:22: symlink + at_setup_line='symlink.at:22' + at_desc='symlink' + $at_quiet $ECHO_N " 3: symlink $ECHO_C" + at_xfail=no + echo "# -*- compilation -*-" >> "$at_group_log" + ( + echo "3. symlink.at:22: testing ..." + $at_traceon + + + +cat >filelist <<'_ATEOF' +file +symlink +_ATEOF + + +$at_traceoff +echo "$at_srcdir/symlink.at:29: +genfile --file file +ln -s file symlink || exit 77 +echo Creating the archive +cpio --quiet -o < filelist > archive +echo Extracting the archive +mkdir dir +cd dir +cpio --quiet -i < ../archive +find . | sort +" +echo symlink.at:29 >"$at_check_line_file" + +at_trace_this= +if test -n "$at_traceon"; then + echo 'Not enabling shell tracing (command contains an embedded newline)' +fi + +if test -n "$at_trace_this"; then + ( $at_traceon; +genfile --file file +ln -s file symlink || exit 77 +echo Creating the archive +cpio --quiet -o < filelist > archive +echo Extracting the archive +mkdir dir +cd dir +cpio --quiet -i < ../archive +find . | sort + ) >"$at_stdout" 2>"$at_stder1" + at_status=$? + grep '^ *+' "$at_stder1" >&2 + grep -v '^ *+' "$at_stder1" >"$at_stderr" +else + ( :; +genfile --file file +ln -s file symlink || exit 77 +echo Creating the archive +cpio --quiet -o < filelist > archive +echo Extracting the archive +mkdir dir +cd dir +cpio --quiet -i < ../archive +find . | sort + ) >"$at_stdout" 2>"$at_stderr" + at_status=$? +fi + +at_failed=false +$at_diff "$at_devnull" "$at_stderr" || at_failed=: +echo >>"$at_stdout"; echo "Creating the archive +Extracting the archive +. +./file +./symlink +" | $at_diff - "$at_stdout" || at_failed=: +case $at_status in + 77) echo 77 > "$at_status_file"; exit 77;; + 0) ;; + *) echo "$at_srcdir/symlink.at:29: exit code was $at_status, expected 0" + at_failed=:;; +esac +if $at_failed; then + + + echo 1 > "$at_status_file" + exit 1 +fi + +$at_traceon + + + $at_traceoff + $at_times_p && times >"$at_times_file" + ) 5>&1 2>&1 | eval $at_tee_pipe + at_status=`cat "$at_status_file"` + ;; + + + * ) + echo "$as_me: no such test group: $at_group" >&2 + continue + ;; + esac + + # Be sure to come back to the suite directory, in particular + # since below we might `rm' the group directory we are in currently. + cd "$at_suite_dir" + + case $at_group in + banner-*) ;; + *) + if test ! -f "$at_check_line_file"; then + sed "s/^ */$as_me: warning: /" <<_ATEOF + A failure happened in a test group before any test could be + run. This means that test suite is improperly designed. Please + report this failure to . +_ATEOF + echo "$at_setup_line" >"$at_check_line_file" + fi + at_group_count=`expr 1 + $at_group_count` + $at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C" + echo $ECHO_N "$at_group. $at_setup_line: $ECHO_C" >> "$at_group_log" + case $at_xfail:$at_status in + yes:0) + at_msg="UNEXPECTED PASS" + at_xpass_list="$at_xpass_list $at_group" + at_errexit=$at_errexit_p + ;; + no:0) + at_msg="ok" + at_pass_list="$at_pass_list $at_group" + at_errexit=false + ;; + *:77) + at_msg='skipped ('`cat "$at_check_line_file"`')' + at_skip_list="$at_skip_list $at_group" + at_errexit=false + ;; + yes:*) + at_msg='expected failure ('`cat "$at_check_line_file"`')' + at_xfail_list="$at_xfail_list $at_group" + at_errexit=false + ;; + no:*) + at_msg='FAILED ('`cat "$at_check_line_file"`')' + at_fail_list="$at_fail_list $at_group" + at_errexit=$at_errexit_p + ;; + esac + # Make sure there is a separator even with long titles. + echo " $at_msg" + at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" + case $at_status in + 0|77) + # $at_times_file is only available if the group succeeded. + # We're not including the group log, so the success message + # is written in the global log separately. But we also + # write to the group log in case they're using -d. + if test -f "$at_times_file"; then + at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')' + rm -f "$at_times_file" + fi + echo "$at_log_msg" >> "$at_group_log" + echo "$at_log_msg" >&5 + + # Cleanup the group directory, unless the user wants the files. + if $at_debug_p ; then + { + echo "#! /bin/sh" + echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' + echo "cd '$at_dir'" + echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$0" \ + '-v -d' "$at_debug_args" "$at_group" '${1+"$@"}' + echo 'exit 1' + } >$at_group_dir/run + chmod +x $at_group_dir/run + + elif test -d "$at_group_dir"; then + find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; + rm -fr "$at_group_dir" + fi + ;; + *) + # Upon failure, include the log into the testsuite's global + # log. The failure message is written in the group log. It + # is later included in the global log. + echo "$at_log_msg" >> "$at_group_log" + + # Upon failure, keep the group directory for autopsy, and + # create the debugging script. + { + echo "#! /bin/sh" + echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' + echo "cd '$at_dir'" + echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$0" \ + '-v -d' "$at_debug_args" "$at_group" '${1+"$@"}' + echo 'exit 1' + } >$at_group_dir/run + chmod +x $at_group_dir/run + + $at_errexit && break + ;; + esac + ;; + esac +done + +# Back to the top directory. +cd "$at_dir" + +# Compute the duration of the suite. +at_stop_date=`date` +at_stop_time=`date +%s 2>/dev/null` +echo "$as_me: ending at: $at_stop_date" >&5 +case $at_start_time,$at_stop_time in + [0-9]*,[0-9]*) + at_duration_s=`expr $at_stop_time - $at_start_time` + at_duration_m=`expr $at_duration_s / 60` + at_duration_h=`expr $at_duration_m / 60` + at_duration_s=`expr $at_duration_s % 60` + at_duration_m=`expr $at_duration_m % 60` + at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" + echo "$as_me: test suite duration: $at_duration" >&5 + ;; +esac + +# Wrap up the test suite with summary statistics. +at_skip_count=`set dummy $at_skip_list; shift; echo $#` +at_fail_count=`set dummy $at_fail_list; shift; echo $#` +at_xpass_count=`set dummy $at_xpass_list; shift; echo $#` +at_xfail_count=`set dummy $at_xfail_list; shift; echo $#` + +at_run_count=`expr $at_group_count - $at_skip_count` +at_unexpected_count=`expr $at_xpass_count + $at_fail_count` +at_total_fail_count=`expr $at_xfail_count + $at_fail_count` + +echo +cat <<\_ASBOX +## ------------- ## +## Test results. ## +## ------------- ## +_ASBOX +echo +{ + echo + cat <<\_ASBOX +## ------------- ## +## Test results. ## +## ------------- ## +_ASBOX + echo +} >&5 + +if test $at_run_count = 1; then + at_result="1 test" + at_were=was +else + at_result="$at_run_count tests" + at_were=were +fi +if $at_errexit_p && test $at_unexpected_count != 0; then + if test $at_xpass_count = 1; then + at_result="$at_result $at_were run, one passed" + else + at_result="$at_result $at_were run, one failed" + fi + at_result="$at_result unexpectedly and inhibited subsequent tests." +else + # Don't you just love exponential explosion of the number of cases? + case $at_xpass_count:$at_fail_count:$at_xfail_count in + # So far, so good. + 0:0:0) at_result="$at_result $at_were successful." ;; + 0:0:*) at_result="$at_result behaved as expected." ;; + + # Some unexpected failures + 0:*:0) at_result="$at_result $at_were run, +$at_fail_count failed unexpectedly." ;; + + # Some failures, both expected and unexpected + 0:*:1) at_result="$at_result $at_were run, +$at_total_fail_count failed ($at_xfail_count expected failure)." ;; + 0:*:*) at_result="$at_result $at_were run, +$at_total_fail_count failed ($at_xfail_count expected failures)." ;; + + # No unexpected failures, but some xpasses + *:0:*) at_result="$at_result $at_were run, +$at_xpass_count passed unexpectedly." ;; + + # No expected failures, but failures and xpasses + *:1:0) at_result="$at_result $at_were run, +$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; + *:*:0) at_result="$at_result $at_were run, +$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; + + # All of them. + *:*:1) at_result="$at_result $at_were run, +$at_xpass_count passed unexpectedly, +$at_total_fail_count failed ($at_xfail_count expected failure)." ;; + *:*:*) at_result="$at_result $at_were run, +$at_xpass_count passed unexpectedly, +$at_total_fail_count failed ($at_xfail_count expected failures)." ;; + esac + + if test $at_skip_count = 0 && test $at_run_count -gt 1; then + at_result="All $at_result" + fi +fi + +# Now put skips in the mix. +case $at_skip_count in + 0) ;; + 1) at_result="$at_result +1 test was skipped." ;; + *) at_result="$at_result +$at_skip_count tests were skipped." ;; +esac + +if test $at_unexpected_count = 0; then + echo "$at_result" + echo "$at_result" >&5 +else + echo "ERROR: $at_result" >&2 + echo "ERROR: $at_result" >&5 + { + echo + cat <<\_ASBOX +## ------------------------ ## +## Summary of the failures. ## +## ------------------------ ## +_ASBOX + + # Summary of failed and skipped tests. + if test $at_fail_count != 0; then + echo "Failed tests:" + $SHELL "$0" $at_fail_list --list + echo + fi + if test $at_skip_count != 0; then + echo "Skipped tests:" + $SHELL "$0" $at_skip_list --list + echo + fi + if test $at_xpass_count != 0; then + echo "Unexpected passes:" + $SHELL "$0" $at_xpass_list --list + echo + fi + if test $at_fail_count != 0; then + cat <<\_ASBOX +## ---------------------- ## +## Detailed failed tests. ## +## ---------------------- ## +_ASBOX + echo + for at_group in $at_fail_list + do + at_group_normalized=$at_group + + while :; do + case $at_group_normalized in #( + $at_format*) break;; + esac + at_group_normalized=0$at_group_normalized + done + + cat "$at_suite_dir/$at_group_normalized/$as_me.log" + echo + done + echo + fi + if test -n "$at_top_srcdir"; then + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## ${at_top_build_prefix}config.log ## +_ASBOX + sed 's/^/| /' ${at_top_build_prefix}config.log + echo + fi + } >&5 + + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## $as_me.log was created. ## +_ASBOX + + echo + echo "Please send \`${at_testdir+${at_testdir}/}$as_me.log' and all information you think might help:" + echo + echo " To: " + echo " Subject: [GNU cpio 2.8] $as_me:$at_fail_list${at_fail_list:+ failed${at_xpass_list:+,}}$at_xpass_list${at_xpass_list:+ passed unexpectedly}" + echo + if test $at_debug_p = false; then + echo + echo 'You may investigate any problem if you feel able to do so, in which' + echo 'case the test suite provides a good starting point. Its output may' + echo "be found below \`${at_testdir+${at_testdir}/}$as_me.dir'." + echo + fi + exit 1 +fi + +exit 0 + + + diff --git a/tests/testsuite.at b/tests/testsuite.at new file mode 100644 index 0000000..f8db452 --- /dev/null +++ b/tests/testsuite.at @@ -0,0 +1,33 @@ +# Process this file with autom4te to create testsuite. -*- Autotest -*- + +# Test suite for GNU cpio +# Copyright (C) 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. + +# We need a recent Autotest. +m4_version_prereq([2.52g]) + +m4_define([AT_SKIP_TEST],[exit 77]) + +AT_INIT + +AT_TESTED([cpio]) + +m4_include([version.at]) + +m4_include([inout.at]) +m4_include([symlink.at]) diff --git a/tests/version.at b/tests/version.at new file mode 100644 index 0000000..bc771de --- /dev/null +++ b/tests/version.at @@ -0,0 +1,34 @@ +# Checking cpio version -*- Autotest -*- +# 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. + +AT_SETUP([cpio version]) + +AT_CHECK([cpio --version], + [0], + [AT_PACKAGE_TARNAME (AT_PACKAGE_NAME) AT_PACKAGE_VERSION +], +[], +[], +[ +echo '==============================================================' +echo 'WARNING: Not using the proper version, *all* checks dubious...' +echo '==============================================================' +]) + +AT_CLEANUP + -- 2.7.4