diff -ruNp m4-1.4.12/.tarball-version m4-1.4.13/.tarball-version --- m4-1.4.12/.tarball-version 2008-10-10 22:26:53.000000000 -0600 +++ m4-1.4.13/.tarball-version 2009-04-01 02:52:48.000000000 -0600 @@ -1 +1 @@ -1.4.12 +1.4.13 diff -ruNp m4-1.4.12/.version m4-1.4.13/.version --- m4-1.4.12/.version 2008-10-10 21:20:39.000000000 -0600 +++ m4-1.4.13/.version 2009-03-31 20:08:41.000000000 -0600 @@ -1 +1 @@ -1.4.12 +1.4.13 diff -ruNp m4-1.4.12/ChangeLog m4-1.4.13/ChangeLog --- m4-1.4.12/ChangeLog 2008-10-10 20:44:31.000000000 -0600 +++ m4-1.4.13/ChangeLog 2009-04-01 02:06:35.000000000 -0600 @@ -1,3 +1,298 @@ +2009-04-01 Eric Blake + + Release Version 1.4.13. + * NEWS: Mention the release. + +2009-03-31 Eric Blake + + Tweak submodule instructions. + * HACKING: Improve directions. + * gnulib: Update to latest version. + +2009-03-23 Eric Blake + + Don't force file overwrites during bootstrap. + * bootstrap: Ensure that rerunning bootstrap doesn't alter tree. + + Drop dist-lzma, now that xz replaces lzma. + * configure.ac (AM_INIT_AUTOMAKE): Drop dist-lzma. Until a stable + automake release includes dist-xz, the release process will just + manually create a .xz tarball. + * gnulib: Update to latest gnulib. + +2009-03-19 Eric Blake + + Exploit git submodule by adding appropriate symlinks. + * bootstrap: No longer copy files from gnulib. + * COPYING: Change to symlink pointing into gnulib. + * INSTALL: Likewise. + * build-aux/compile: Likewise. + * build-aux/config.guess: Likewise. + * build-aux/config.sub: Likewise. + * build-aux/depcomp: Likewise. + * build-aux/install-sh: Likewise. + * build-aux/mdate-sh: Likewise. + * build-aux/missing: Likewise. + * build-aux/texinfo.tex: Likewise. + * .cvsignore: Reflect these changes. + * .gitignore: Likewise. + * build-aux/.cvsignore: New file. + * build-aux/.gitignore: Likewise. + +2009-03-18 Eric Blake + + Make gnulib a git submodule. + * .gitmodules: New file. + * gnulib: Record which version of gnulib has been tested. + * bootstrap: Aid in submodule usage. + * cfg.mk (gnulib_dir): Alter default location of gnulib. + * HACKING: Mention how to use submodule. + + Use latest compile script, even with stable automake. + * bootstrap: Also sync build-aux/compile. + +2009-03-12 Eric Blake + + Fix awk script portability. + * checks/get-them: In gsub, properly escape {. Close all files + before exiting. + Reported by Gary V. Vaughan. + +2009-03-05 Eric Blake + + Allow configuration choice in syscmd shell. + * configure.ac (SYSCMD_SHELL): New test. + * src/builtin.c (m4_syscmd, m4_esyscmd): Use it to avoid + hard-coding the shell location. + * doc/m4.texinfo (Syscmd, Esyscmd): Document this. + * README: Document new configure option. + * NEWS: Likewise. + + Remove cruft now that gnulib modules do the work. + * configure.ac (M4_cv_func_system_consistent): Delete. + * src/builtin.c (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): + Delete. + + Use gnulib pipe module instead of popen(3). + * m4/gnulib-cache.m4: Import pipe and wait-process modules. + * src/builtin.c (m4_esyscmd): Rewrite with pipe module. + Resolves a failure on AIX, reported by Gary V. Vaughan. + + Use gnulib execute module instead of system(3). + * m4/gnulib-cache.m4: Import execute module. + * src/builtin.c (m4_sysval): Move computation... + (m4_esyscmd): ...into caller. + (m4_syscmd): Rewrite with execute module. + Resolves a failure on AIX, reported by Gary V. Vaughan. + +2009-03-03 Eric Blake + + Try to tolerate spaces in directory names in testsuite. + * doc/m4.texinfo (Diversions, Using frozen files): Provide shell + quoting, in case __program__ contains spaces. + + Improve web-manual maintainer rule. + * maint.mk (web-manual): Work with VPATH builds. Factor + package-specific detail... + * cfg.mk (manual_title): ...to new variable. + +2009-02-26 Eric Blake + + Make bootstrap easier on Solaris. + * bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script + gnulib-tool exists earlier on the path to work around /bin/sh + failure in parsing $GNULIB_SRCDIR/gnulib-tool. + +2009-02-19 Eric Blake + + Fix regression in translit. + * src/builtin.c (m4_translit): Use correct comparison. + * doc/m4.texinfo (Translit): Enhance test. + + Speed up input engine, by searching for quotes by buffer. + * src/input.c (struct input_block): Add end pointer to string. + (push_string_finish, push_wrapup): Populate it. + (next_token): For quotes, attempt a buffer search. + * NEWS: Document this. + +2009-02-18 Eric Blake + + Speed up translit when from argument is short. + * m4/gnulib-cache.m4: Import memchr2 module. + * src/builtin.c (m4_translit): Use memchr2 when possible. + * doc/m4.texinfo (Translit): Add tests. + * NEWS: Document this. + + Update copyright year. + * THANKS: Mention 2009 in copyright year. + + Prefer buffer over byte operations. + * src/format.c (expand_format): Use strchr for speed. + * src/builtin.c (substitute, expand_user_macro): Likewise. + + Speed up esyscmd with buffer reads. + * src/builtin.c (m4_esyscmd): Read blocks directly into obstack, + rather than repeatedly reading bytes. Detect read errors. + + Avoid risk of stack overflow. + * src/output.c (insert_file): Avoid stack allocation of large + buffer. + (freeze_diversions): Avoid spurious semicolon. + +2009-02-16 Eric Blake + + Avoid test failure due to different errno. + * doc/m4.texinfo (Using frozen files): Ignore stdout, since + hardened systems can prevent attempts to read /. + * THANKS: Update. + Reported by Ronny Peine, in Gentoo bug 259184. + + Avoid tests that make no sense, because m4 is single-threaded. + * m4/gnulib-cache.m4: Avoid lock-tests and tls-tests. + +2009-02-12 Eric Blake + + Avoid quadratic code when walking definition stack. + * examples/stack_sep.m4: Use linear, not quadratic + implementation. + * doc/m4.texinfo (Improved copy): Fix documentation and add test, + based on recent autoconf bug fix. + +2009-01-24 Eric Blake + + Add URLs to --help output. + * src/m4.c (usage): Use enhanced version-etc features. + +2009-01-02 Eric Blake + + Use nicer email address in web manual. + * maint.mk (web-manual): Use new option in gendocs.sh. + + Nuke xdelta diffs at release time; no one reported using them. + * maint.mk (got-xdelta, delta-xdelta): Delete. + * HACKING: Likewise. + +2009-01-01 Eric Blake + + Update copyright year. + * NEWS: M4 1.4.13 will occur in 2009. + * doc/m4.texinfo (History): Likewise. + +2008-12-24 Eric Blake + + Prepare for eventual release. + * doc/m4.texinfo (History): Mention 1.4.13. + +2008-12-22 Eric Blake + + Make --debugfile argument optional. + * src/builtin.c (m4_debugfile): Make error message consistent. + * src/m4.c (long_options): Make the argument optional, to allow + setting debug file back to stderr. + (main): Make --debugfile order-dependent. + (usage): Document this. + * doc/m4.texinfo (Debugging options): Likewise. + * NEWS: Likewise. + + Use @var correctly. + * doc/m4.texinfo (Operation modes, Preprocessor features) + (Limits control, Frozen state, Debugging options): Use lower case + names in @var. + (Improved copy): Use @code, not @var, as appropriate. + +2008-12-18 Eric Blake + + Document optimized forloop. + * doc/m4.texinfo (Improved forloop): Mention alternate style that + avoids define overhead. + * examples/forloop3.m4: New file. + * examples/Makefile.am (EXTRA_DIST): Distribute it. + + Deal with M4 1.4.x limitation on builtin tokens. + * doc/m4.texinfo (Composition): Mention limitation on curry. + (Improved copy): New node. + * examples/stack_sep.m4: New file. + * examples/Makefile.am (EXTRA_DIST): Distribute it. + + Document copy composite using stack_foreach and curry. + * doc/m4.texinfo (Stacks): New node, to document pushdef stack + manipulation. + (Ifelse): Move define_blind... + (Composition): ...to this new node. Document currying, then use + it to implement copy and rename. + * examples/curry.m4: New file. + * examples/stack.m4: Likewise. + * examples/Makefile.am (EXTRA_DIST): Distribute them. + +2008-12-17 Eric Blake + + Don't override signal handlers installed by c-stack. + * src/m4.c (main): Reorder installation of signal handlers, so we + don't trash a SIGBUS handler installed by c-stack. Also provide a + SIGSEGV fallback, for platforms where c-stack combined with + libsigsegv uses something lower level than SIGSEGV. + +2008-12-12 Eric Blake + + Double size of temp file cache. + * src/output.c (tmp_file, tmp_file_owner): Split... + (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into + two variables. + (tmp_file2_recent): New variable. + (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename) + (output_exit): Adjust callers. + + Use fewer seeks on cached files. + * src/output.c (m4_tmpfile): Use write, not append mode. + (m4_tmpopen): Add parameter to decide when to skip seeks. + (m4_tmprename, make_diversion, insert_diversion_helper) + (freeze_diversions): Adjust callers. + + Cache most recently spilled diversion. + * src/output.c (tmp_file, tmp_file_owner): New variables, for + 1-deep cache of spilled diversions. + (m4_tmpfile): Open in append mode, since we might revisit + diversion without closing it now. + (m4_tmpopen): Check cache first. + (m4_tmpclose): Update cache, rather than closing. Add parameter. + (m4_tmpremove): Close cache before removing. + (m4_tmprename): Deal with open files when renaming. + (output_exit): Close cache before exiting. + (make_room_for, make_diversion, insert_diversion_helper): Adjust + callers. + * configure.ac (RENAME_OPEN_FILE_WORKS): New configure test. + + Correctly track size of in-memory diversions. + * src/output.c (insert_diversion_helper): Correctly track total + in-memory diversion size after undivert. + + Avoid quadratic behavior for some cases of divert/undivert. + * src/output.c (struct m4_diversion): Improve comments. + (m4_tmpname, make_diversion): Strengthen preconditions. + (m4_tmprename): New function. + (output_init, output_exit): Move after internal functions. + (make_room_for): Don't bother copying uninitialized bytes. + (insert_diversion_helper): Transfer metadata, rather than copying + contents, when undiverting into a previously unused diversion. + * src/m4.h (includes): Add assert.h. + * doc/m4.texinfo (Diversions): Add test. + (Undivert): Enhance test. + * NEWS: Document the speedup. + +2008-12-12 Eric Blake + + Upgrade to FDL 1.3, keep COPYING in repository. + * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING. + * .cvsignore: Don't ignore it. + * .gitignore: Likewise. + * COPYING: Store in repository, per automake 1.10.2 + recommendation. + * m4/gnulib-cache.m4: Replace fdl module with fdl-1.3. + * doc/m4.texinfo (GNU Free Documentation License): Upgrade + license. + * doc/Makefile.am (m4_TEXINFOS): Likewise. + * NEWS: Mention the documentation license change. + 2008-10-10 Eric Blake Release Version 1.4.12. @@ -4520,7 +4815,7 @@ Mon Jan 22 21:08:52 1990 Rene' Seindal End: Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice diff -ruNp m4-1.4.12/GNUmakefile m4-1.4.13/GNUmakefile --- m4-1.4.12/GNUmakefile 2008-10-09 21:04:15.000000000 -0600 +++ m4-1.4.13/GNUmakefile 2009-03-21 18:05:30.000000000 -0600 @@ -5,7 +5,7 @@ # It is necessary if you want to build targets usually of interest # only to the maintainer. -# Copyright (C) 2001, 2003, 2006-2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2006-2009 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -38,6 +38,9 @@ ifeq ($(_have-Makefile),yes) # Make tar archive easier to reproduce. export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner +# Allow the user to add to this in the Makefile. +ALL_RECURSIVE_TARGETS = + include Makefile # Some projects override e.g., _autoreconf here. @@ -61,7 +64,7 @@ ifeq ($(_have-git-version-gen)0,yes$(MAK && $(_build-aux)/git-version-gen .tarball-version) ifneq ($(_curr-ver),$(VERSION)) ifeq ($(_curr-ver),UNKNOWN) - $(info WARNING: unable to verify if $(VERSION) is correct version) + $(info WARNING: unable to verify if $(VERSION) is the correct version) else ifneq (,$(_is-install-target)) # GNU Coding Standards state that 'make install' should not cause @@ -107,6 +110,18 @@ abort-due-to-no-makefile: endif # Tell version 3.79 and up of GNU make to not build goals in this -# directory in parallel. This is necessary in case someone tries to -# build multiple targets on one command line. +# directory in parallel, in case someone tries to build multiple +# targets, and one of them can cause a recursive target to be invoked. + +# Only set this if Automake doesn't provide it. +AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) \ + dist distcheck tags ctags + +ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS) + +ifneq ($(word 2, $(MAKECMDGOALS)), ) +ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), ) .NOTPARALLEL: +endif +endif diff -ruNp m4-1.4.12/INSTALL m4-1.4.13/INSTALL --- m4-1.4.12/INSTALL 2008-10-10 21:03:11.000000000 -0600 +++ m4-1.4.13/INSTALL 2009-03-18 20:12:35.000000000 -0600 @@ -2,7 +2,7 @@ Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008 Free Software Foundation, Inc. +2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -159,7 +159,7 @@ Particular systems CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: - ./configure CC="cc -Ae" + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. @@ -174,6 +174,16 @@ and if that doesn't work, try ./configure CC="cc -nodtk" + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + Specifying the System Type ========================== @@ -189,7 +199,8 @@ type, such as `sun4', or a canonical nam where SYSTEM can have one of these forms: - OS KERNEL-OS + OS + KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't diff -ruNp m4-1.4.12/Makefile.am m4-1.4.13/Makefile.am --- m4-1.4.12/Makefile.am 2008-08-11 20:48:22.000000000 -0600 +++ m4-1.4.13/Makefile.am 2008-12-11 21:59:27.000000000 -0700 @@ -26,7 +26,7 @@ EXTRA_DIST = bootstrap c-boxes.el cfg.mk DISTCLEANFILES = stamp-h ## maintainer-clean should remove as much as possible that ./bootstrap can ## recreate. In the m4 directory, keep only gnulib-cache.m4. -MAINTAINERCLEANFILES = COPYING INSTALL Makefile.in aclocal.m4 \ +MAINTAINERCLEANFILES = INSTALL Makefile.in aclocal.m4 \ config-h.in configure depcomp doc/fdl.texi gendocs.sh install-sh \ lib/[a-z]* m4/[a-fh-z]* m4/g[a-mo-z]* m4/gnulib-comp.m4 \ m4/gnulib-tool.m4 missing stamp-h.in diff -ruNp m4-1.4.12/Makefile.in m4-1.4.13/Makefile.in --- m4-1.4.12/Makefile.in 2008-10-10 21:03:10.000000000 -0600 +++ m4-1.4.13/Makefile.in 2009-03-31 20:11:45.000000000 -0600 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10b from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,8 +16,9 @@ @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -40,15 +42,17 @@ DIST_COMMON = README $(am__configure_dep build-aux/config.sub build-aux/depcomp build-aux/install-sh \ build-aux/mdate-sh build-aux/missing build-aux/texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/autobuild.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/assert.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/cloexec.m4 \ $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/dirname.m4 \ $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \ $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl_h.m4 \ @@ -58,7 +62,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \ $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ $(top_srcdir)/m4/fseeko.m4 $(top_srcdir)/m4/ftello.m4 \ - $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/glibc21.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ @@ -68,42 +73,49 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/lock.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lseek.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memset.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ - $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/open.m4 \ - $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/posix_spawn.m4 \ + $(top_srcdir)/m4/printf-frexp.m4 \ $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ - $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/regex.m4 \ - $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \ - $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sched_h.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/snprintf.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-safer.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib-safer.m4 \ - $(top_srcdir)/m4/stdlib_h.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/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \ - $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ - $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/thread.m4 \ - $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/tls.m4 \ - $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/spawn_h.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-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strchrnul.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/strsignal.m4 \ + $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtod.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \ + $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \ + $(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/tmpdir.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unistd-safer.m4 \ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \ $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf-posix.m4 \ - $(top_srcdir)/m4/vasprintf.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/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yield.m4 \ + $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wait-process.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -112,6 +124,13 @@ am__CONFIG_DISTCLEAN_FILES = config.stat mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = checks/Makefile +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = @ +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -123,6 +142,9 @@ RECURSIVE_TARGETS = all-recursive check- ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -130,11 +152,35 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCE 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 \ - $(distdir).tar.lzma + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print @@ -142,6 +188,7 @@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -175,14 +222,19 @@ FCNTL_H = @FCNTL_H@ FLOAT_H = @FLOAT_H@ GETOPT_H = @GETOPT_H@ GLIBC21 = @GLIBC21@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ @@ -203,29 +255,44 @@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ GNULIB_ISINF = @GNULIB_ISINF@ GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -239,12 +306,34 @@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ +GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ +GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ +GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ +GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ +GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ +GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ +GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -275,6 +364,8 @@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ @@ -282,15 +373,22 @@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ @@ -301,6 +399,7 @@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ @@ -320,28 +419,48 @@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCHED_H = @HAVE_SCHED_H@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ @@ -350,6 +469,7 @@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_SPAWN_H = @HAVE_SPAWN_H@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ @@ -359,23 +479,34 @@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -395,6 +526,10 @@ LIBSIGSEGV = @LIBSIGSEGV@ LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIBTHREAD = @LIBTHREAD@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBCSTACK = @LTLIBCSTACK@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -412,7 +547,9 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_SCHED_H = @NEXT_SCHED_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_SPAWN_H = @NEXT_SPAWN_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ @@ -420,6 +557,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -429,17 +567,21 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -464,6 +606,13 @@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ @@ -471,6 +620,7 @@ REPLACE_NAN = @REPLACE_NAN@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -489,22 +639,29 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TRUNCL = @REPLACE_TRUNCL@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ +SCHED_H = @SCHED_H@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SPAWN_H = @SPAWN_H@ STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +SYS_WAIT_H = @SYS_WAIT_H@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ @@ -512,7 +669,6 @@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ -YIELD_LIB = @YIELD_LIB@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -568,7 +724,7 @@ EXTRA_DIST = bootstrap c-boxes.el cfg.mk .version m4/gnulib-cache.m4 DISTCLEANFILES = stamp-h -MAINTAINERCLEANFILES = COPYING INSTALL Makefile.in aclocal.m4 \ +MAINTAINERCLEANFILES = INSTALL Makefile.in aclocal.m4 \ config-h.in configure depcomp doc/fdl.texi gendocs.sh install-sh \ lib/[a-z]* m4/[a-fh-z]* m4/g[a-mo-z]* m4/gnulib-comp.m4 \ m4/gnulib-tool.m4 missing stamp-h.in @@ -586,15 +742,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ - cd $(srcdir) && $(AUTOMAKE) --gnu \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu --silent-rules'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu --silent-rules \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --silent-rules Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu --silent-rules Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -610,9 +766,10 @@ $(top_builddir)/config.status: $(top_src $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): checks/Makefile: $(top_builddir)/config.status $(top_srcdir)/checks/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -640,7 +797,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -674,16 +831,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -691,14 +848,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -710,7 +867,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -719,36 +876,41 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) - test -d $(distdir) || mkdir $(distdir) + test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -764,27 +926,41 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ @@ -794,21 +970,26 @@ distdir: $(DISTFILES) $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + -find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) + || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) + dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -825,7 +1006,6 @@ dist-zip: distdir dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then @@ -839,6 +1019,8 @@ distcheck: dist bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -850,9 +1032,10 @@ distcheck: dist mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ + && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -880,7 +1063,7 @@ distcheck: dist list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @cd $(distuninstallcheck_dir) \ + @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -924,6 +1107,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @@ -946,6 +1130,8 @@ dvi-am: html: html-recursive +html-am: + info: info-recursive info-am: @@ -954,18 +1140,28 @@ install-data-am: install-dvi: install-dvi-recursive +install-dvi-am: + install-exec-am: install-html: install-html-recursive +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: install-pdf: install-pdf-recursive +install-pdf-am: + install-ps: install-ps-recursive +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -988,21 +1184,22 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + ctags-recursive install install-am install-strip \ + tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-hook dist-lzma dist-shar dist-tarZ dist-zip distcheck \ - distclean distclean-generic distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ + dist-hook dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am @@ -1013,6 +1210,7 @@ $(top_srcdir)/.version: # tarball, and never in a checked-out repository. dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + # 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 -ruNp m4-1.4.12/NEWS m4-1.4.13/NEWS --- m4-1.4.12/NEWS 2008-10-10 20:44:08.000000000 -0600 +++ m4-1.4.13/NEWS 2009-04-01 02:06:43.000000000 -0600 @@ -1,6 +1,31 @@ GNU M4 NEWS - User visible changes. -Copyright (C) 1992, 1993, 1994, 2004, 2005, 2006, 2007, 2008 Free Software -Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 2004, 2005, 2006, 2007, 2008, 2009 Free +Software Foundation, Inc. + +* Noteworthy changes in Version 1.4.13 (2009-04-01) [stable] + Released by Eric Blake, based on git version 1.4.12.* + +** The manual is now distributed under the terms of FDL 1.3. + +** The `divert' and `undivert' builtins have been made more efficient + when using temporary files for large diversions. + +** The `translit' builtin has been made more efficient when the second + argument is short. + +** The input engine has been optimized for faster processing. + +** The command line option `--debugfile', introduced in 1.4.7, now + treats its argument as optional, in order to allow setting the debug + output back to stderr when used without an argument; and order is now + significant with respect to command line files. You must therefore use + `m4 --debugfile=trace file', not `m4 file --debugfile trace'. This + change does not affect the deprecated `-o'/`--error-output' option. + +** The `syscmd' and `esyscmd' builtins can be configured to use an + alternate shell, via the new `configure' option `--with-syscmd-shell'. + +** A number of portability improvements inherited from gnulib. * Noteworthy changes in Version 1.4.12 (2008-10-10) [stable] Released by Eric Blake, based on git version 1.4.11.* diff -ruNp m4-1.4.12/README m4-1.4.13/README --- m4-1.4.12/README 2008-08-25 21:01:51.000000000 -0600 +++ m4-1.4.13/README 2009-03-05 05:46:01.000000000 -0700 @@ -44,6 +44,12 @@ See file `INSTALL' for compilation and i See file `NEWS' for a list of major changes in the current release. See file `THANKS' for a list of contributors. +By default, the `syscmd' and `esyscmd' macros try to use the first +instance of `sh' found by `command -p getconf PATH' at configure time, +with a default of `/bin/sh'. If that default is inappropriate, you +can use `./configure --with-syscmd-shell=location' to specify the +shell to use. + By using `./configure --enable-changeword', you get an experimental feature which allows for changing the syntax of what is a "word" in `m4'. This feature will not be present in m4 2.0, but will be @@ -57,8 +63,8 @@ solution, from which the problem might b ======================================================================== -Copyright (C) 2000, 2005, 2006, 2007, 2008 Free Software Foundation, -Inc. +Copyright (C) 2000, 2005, 2006, 2007, 2008, 2009 Free Software +Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or diff -ruNp m4-1.4.12/THANKS m4-1.4.13/THANKS --- m4-1.4.12/THANKS 2008-08-15 20:59:30.000000000 -0600 +++ m4-1.4.13/THANKS 2009-02-18 19:48:17.000000000 -0700 @@ -97,6 +97,7 @@ Robert Bernstein rocky@panix.com Robert Bihlmeyer robbe@orcus.priv.at Roland H. Pesch roland@wrs.com Roland McGrath roland@gnu.org +Ronny Peine RonnyPeine@gmx.de Sami Liedes sliedes@cc.hut.fi Santiago Vila sanvila@debian.org Scott Bartram deneb!scottb @@ -125,7 +126,8 @@ Local Variables: coding: utf-8 End: -Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc. +Copyright (C) 2000, 2006, 2007, 2008, 2009 Free Software Foundation, +Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or diff -ruNp m4-1.4.12/aclocal.m4 m4-1.4.13/aclocal.m4 --- m4-1.4.12/aclocal.m4 2008-10-10 21:01:48.000000000 -0600 +++ m4-1.4.13/aclocal.m4 2009-03-31 19:15:43.000000000 -0600 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.10b -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,13 +13,13 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.63],, -[m4_warning([this file was generated for autoconf 2.63. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63b],, +[m4_warning([this file was generated for autoconf 2.63b. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -31,10 +31,10 @@ To do so, use the procedure documented b # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.10' +[am__api_version='1.10b' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.1], [], +m4_if([$1], [1.10b], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -48,12 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl +[AM_AUTOMAKE_VERSION([1.10b])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -110,14 +110,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 +# serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -130,6 +130,7 @@ AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -143,14 +144,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 +# serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -224,6 +225,12 @@ AC_CACHE_CHECK([dependency style of $dep done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll @@ -234,19 +241,23 @@ AC_CACHE_CHECK([dependency style of $dep break fi ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; none) break ;; esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message @@ -303,57 +314,68 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 3 +#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -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" +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done done -done +} ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -373,13 +395,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS] # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008 Free Software Foundation, Inc. +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 13 +# serial 15 # 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. @@ -396,7 +418,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS] # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.60])dnl +[AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -447,8 +469,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -456,22 +478,25 @@ AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) @@ -496,7 +521,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -507,7 +532,14 @@ echo "timestamp for $_am_arg" >`AS_DIRNA # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -583,14 +615,14 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 6 # AM_PROG_CC_C_O # -------------- @@ -602,8 +634,9 @@ AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC -ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. @@ -619,14 +652,14 @@ m4_define([AC_PROG_CC], # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -643,7 +676,14 @@ AC_SUBST($1)]) AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " @@ -681,13 +721,13 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -704,7 +744,7 @@ AC_DEFUN([_AM_SET_OPTION], # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- @@ -714,14 +754,14 @@ AC_DEFUN([_AM_IF_OPTION], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # AM_SANITY_CHECK # --------------- @@ -730,16 +770,29 @@ AC_DEFUN([AM_SANITY_CHECK], # Just in case sleep 1 echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` + set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ @@ -792,18 +845,25 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 2 + # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. @@ -900,9 +960,11 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([m4/00gnulib.m4]) m4_include([m4/alloca.m4]) m4_include([m4/assert.m4]) m4_include([m4/autobuild.m4]) +m4_include([m4/btowc.m4]) m4_include([m4/c-stack.m4]) m4_include([m4/cloexec.m4]) m4_include([m4/close-stream.m4]) @@ -914,8 +976,10 @@ m4_include([m4/dirname.m4]) m4_include([m4/dos.m4]) m4_include([m4/double-slash-root.m4]) m4_include([m4/eealloc.m4]) +m4_include([m4/environ.m4]) m4_include([m4/errno_h.m4]) m4_include([m4/error.m4]) +m4_include([m4/execute.m4]) m4_include([m4/exitfail.m4]) m4_include([m4/exponentd.m4]) m4_include([m4/exponentf.m4]) @@ -935,7 +999,9 @@ m4_include([m4/frexp.m4]) m4_include([m4/frexpl.m4]) m4_include([m4/fseeko.m4]) m4_include([m4/ftello.m4]) +m4_include([m4/getdtablesize.m4]) m4_include([m4/getopt.m4]) +m4_include([m4/gettext.m4]) m4_include([m4/gettimeofday.m4]) m4_include([m4/gl_list.m4]) m4_include([m4/glibc21.m4]) @@ -954,27 +1020,36 @@ m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/libsigsegv.m4]) m4_include([m4/localcharset.m4]) +m4_include([m4/locale-fr.m4]) +m4_include([m4/locale-ja.m4]) +m4_include([m4/locale-zh.m4]) m4_include([m4/lock.m4]) m4_include([m4/longlong.m4]) m4_include([m4/lseek.m4]) +m4_include([m4/lstat.m4]) m4_include([m4/malloc.m4]) m4_include([m4/malloca.m4]) m4_include([m4/math_h.m4]) m4_include([m4/mbrtowc.m4]) +m4_include([m4/mbsinit.m4]) m4_include([m4/mbstate_t.m4]) -m4_include([m4/memchr.m4]) -m4_include([m4/memcmp.m4]) -m4_include([m4/memset.m4]) m4_include([m4/mkdtemp.m4]) m4_include([m4/mkstemp.m4]) +m4_include([m4/multiarch.m4]) m4_include([m4/nocrash.m4]) m4_include([m4/open.m4]) m4_include([m4/pathmax.m4]) +m4_include([m4/pipe.m4]) +m4_include([m4/po.m4]) +m4_include([m4/posix_spawn.m4]) m4_include([m4/printf-frexp.m4]) m4_include([m4/printf-frexpl.m4]) m4_include([m4/printf.m4]) m4_include([m4/quotearg.m4]) +m4_include([m4/rawmemchr.m4]) m4_include([m4/regex.m4]) +m4_include([m4/sched_h.m4]) +m4_include([m4/setenv.m4]) m4_include([m4/sig_atomic_t.m4]) m4_include([m4/sigaction.m4]) m4_include([m4/signal_h.m4]) @@ -982,6 +1057,7 @@ m4_include([m4/signalblocking.m4]) m4_include([m4/signbit.m4]) m4_include([m4/size_max.m4]) m4_include([m4/snprintf.m4]) +m4_include([m4/spawn_h.m4]) m4_include([m4/ssize_t.m4]) m4_include([m4/stdarg.m4]) m4_include([m4/stdbool.m4]) @@ -991,7 +1067,7 @@ m4_include([m4/stdio-safer.m4]) m4_include([m4/stdio_h.m4]) m4_include([m4/stdlib-safer.m4]) m4_include([m4/stdlib_h.m4]) -m4_include([m4/strdup.m4]) +m4_include([m4/strchrnul.m4]) m4_include([m4/strerror.m4]) m4_include([m4/string_h.m4]) m4_include([m4/strndup.m4]) @@ -1002,24 +1078,27 @@ m4_include([m4/strtod.m4]) m4_include([m4/strtol.m4]) m4_include([m4/sys_stat_h.m4]) m4_include([m4/sys_time_h.m4]) +m4_include([m4/sys_wait_h.m4]) m4_include([m4/tempname.m4]) -m4_include([m4/thread.m4]) m4_include([m4/threadlib.m4]) m4_include([m4/tls.m4]) m4_include([m4/tmpdir.m4]) +m4_include([m4/ungetc.m4]) m4_include([m4/unistd-safer.m4]) m4_include([m4/unistd_h.m4]) m4_include([m4/unlocked-io.m4]) m4_include([m4/vasnprintf.m4]) m4_include([m4/vasprintf-posix.m4]) m4_include([m4/vasprintf.m4]) +m4_include([m4/wait-process.m4]) m4_include([m4/wchar.m4]) m4_include([m4/wchar_t.m4]) +m4_include([m4/wcrtomb.m4]) +m4_include([m4/wctob.m4]) m4_include([m4/wctype.m4]) m4_include([m4/wint_t.m4]) m4_include([m4/xalloc.m4]) m4_include([m4/xsize.m4]) m4_include([m4/xstrndup.m4]) m4_include([m4/xvasprintf.m4]) -m4_include([m4/yield.m4]) m4_include([acinclude.m4]) diff -ruNp m4-1.4.12/bootstrap m4-1.4.13/bootstrap --- m4-1.4.12/bootstrap 2008-09-16 05:49:28.000000000 -0600 +++ m4-1.4.13/bootstrap 2009-03-23 13:16:44.000000000 -0600 @@ -1,10 +1,10 @@ #! /bin/sh -# bootstrap (GNU M4) version 2008-09-16 +# bootstrap (GNU M4) version 2009-03-23 # Written by Gary V. Vaughan -# Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, -# Inc. +# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software +# Foundation, Inc. # This file is part of GNU M4. # @@ -29,7 +29,7 @@ # You can also set the following variables to help $progname # locate the right tools: -# AUTORECONF, GNULIB_TOOL, M4, RM, SED +# AUTORECONF, CONFIG_SHELL, GNULIB_SRCDIR, M4, RM, SED # This script bootstraps a git or CVS checkout of GNU M4 by correctly # calling out to parts of the GNU Build Platform. Currently this @@ -39,7 +39,7 @@ # Report bugs to : ${AUTORECONF=autoreconf} -: ${GNULIB_TOOL=gnulib-tool} +: ${CONFIG_SHELL=/bin/sh} : ${RM='rm -f'} : ${SED=sed} @@ -250,61 +250,49 @@ if test -d .git && (git --version) >/dev fi fi -## ---------------------------- ## -## Find the gnulib module tree. ## -## ---------------------------- ## - -case $GNULIB_TOOL in - /* ) gnulibdir=$GNULIB_TOOL ;; # absolute - */* ) gnulibdir=`pwd`/$GNULIB_TOOL ;; # relative - * ) gnulibdir=`which "$GNULIB_TOOL"` ;; # PATH search -esac - -# Follow symlinks -while test -h "$gnulibdir"; do - - # Resolve symbolic link. - sedexpr1='s, -> ,#%%#,' - sedexpr2='s,^.*#%%#\(.*\)$,\1,p' - linkval=`ls -l "$gnulibdir" | $SED "$sedexpr1" | $SED -n "$sedexpr2"` - test -n "$linkval" || break - - case "$linkval" in - /* ) gnulibdir="$linkval" ;; - * ) gnulibdir=`echo "$gnulibdir" | sed -e 's,/[^/]*$,,'`/"$linkval" ;; - esac - -done +## ------------------------------ ## +## Update the gnulib module tree. ## +## ------------------------------ ## -gnulibdir=`echo "$gnulibdir" | $SED "$dirname"` +if test -d .git && (git --version) >/dev/null 2>/dev/null ; then + if test -f gnulib/gnulib-tool ; then + func_echo "updating gnulib submodule" + git submodule update \ + || func_fatal_error "Unable to update gnulib" + else + # A fresh checkout creates an empty subdirectory gnulib. However, + # older git didn't know how to clone into an empty subdir. If the + # user provided GNULIB_SRCDIR, then make the initial clone refer + # to the existing checkout, to save network traffic. + func_echo "importing gnulib submodule" + if test -d "$GNULIB_SRCDIR" ; then + rmdir gnulib 2>/dev/null + git clone --reference "$GNULIB_SRCDIR" git://git.sv.gnu.org/gnulib.git \ + && git submodule init && git submodule update \ + || func_fatal_error "Unable to update gnulib" + else + git submodule update --init \ + || func_fatal_error "Unable to update gnulib" + fi + fi +else + func_echo "git not detected. If needed, update gnulib subdirectory manually" +fi ## ---------------------- ## ## Import Gnulib modules. ## ## ---------------------- ## -func_echo "running: $GNULIB_TOOL --update" -$GNULIB_TOOL --update || func_fatal_error "gnulib-tool failed" +func_echo "running: $CONFIG_SHELL gnulib/gnulib-tool --update" +$CONFIG_SHELL gnulib/gnulib-tool --update \ + || func_fatal_error "gnulib-tool failed" ## ----------- ## ## Autoreconf. ## ## ----------- ## -func_echo "running: $AUTORECONF --force --verbose --install" -$AUTORECONF --force --verbose --install || func_fatal_error "autoreconf failed" - -## ---------------------------------------- ## -## Gnulib is more up-to-date than automake. ## -## ---------------------------------------- ## - -func_update "$gnulibdir"/build-aux/config.guess build-aux/config.guess -func_update "$gnulibdir"/build-aux/config.sub build-aux/config.sub -func_update "$gnulibdir"/build-aux/depcomp build-aux/depcomp -func_update "$gnulibdir"/build-aux/install-sh build-aux/install-sh -func_update "$gnulibdir"/build-aux/mdate-sh build-aux/mdate-sh -func_update "$gnulibdir"/build-aux/missing build-aux/missing -func_update "$gnulibdir"/build-aux/texinfo.tex build-aux/texinfo.tex -func_update "$gnulibdir"/doc/COPYINGv3 COPYING -func_update "$gnulibdir"/doc/INSTALL INSTALL +func_echo "running: $AUTORECONF --verbose --install" +$AUTORECONF --verbose --install || func_fatal_error "autoreconf failed" exit 0 diff -ruNp m4-1.4.12/build-aux/announce-gen m4-1.4.13/build-aux/announce-gen --- m4-1.4.12/build-aux/announce-gen 2008-10-10 20:52:46.000000000 -0600 +++ m4-1.4.13/build-aux/announce-gen 2009-03-08 20:14:28.000000000 -0600 @@ -1,13 +1,13 @@ #!/usr/bin/perl -w # Generate a release announcement message. -my $VERSION = '2008-10-10 05:12'; # UTC +my $VERSION = '2009-03-05 09:52'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2002-2008 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ use POSIX qw(strftime); (my $ME = $0) =~ s|.*/||; my %valid_release_types = map {$_ => 1} qw (alpha beta major); +my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz'); END { @@ -96,6 +97,8 @@ The following are optional: VERSION is the result of running git describe in the gnulib source directory. required if gnulib is in TOOL_LIST. + --no-print-checksums do not emit MD5 or SHA1 checksums + --archive-suffix=SUF add SUF to the list of archive suffixes --help display this help and exit --version output version information and exit @@ -185,8 +188,7 @@ sub print_checksums (@) print "$dig $f\n"; } } - - + print "\n"; } =item C \@news_file, 'bootstrap-tools=s' => \$bootstrap_tools, 'gnulib-version=s' => \$gnulib_version, + 'print-checksums!' => \$print_checksums_p, + 'archive-suffix=s' => \@archive_suffixes, help => sub { usage 0 }, version => sub { print "$ME version $VERSION\n"; exit }, @@ -426,14 +431,14 @@ sub get_tool_versions ($$) and usage 1; my $my_distdir = "$package_name-$curr_version"; - my $tgz = "$my_distdir.tar.gz"; - my $tbz = "$my_distdir.tar.bz2"; - my $lzma = "$my_distdir.tar.lzma"; + my $xd = "$package_name-$prev_version-$curr_version.xdelta"; - my @tarballs = grep {-f $_} ($tgz, $tbz, $lzma); + my @candidates = map { "$my_distdir.$_" } @archive_suffixes; + my @tarballs = grep {-f $_} @candidates; + @tarballs - or die "$ME: none of $tgz, $tbz, or $lzma were found\n"; + or die "$ME: none of " . join(', ', @candidates) . " were found\n"; my @sizable = @tarballs; -f $xd and push @sizable, $xd; @@ -462,16 +467,16 @@ EOF print_locations ("GPG detached signatures[*]", @url_dir_list, %size, @sig_files); - print_checksums (@sizable); + $print_checksums_p + and print_checksums (@sizable); print <. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, @@ -17,8 +18,7 @@ scriptversion=2005-05-14.22 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -103,13 +103,13 @@ if test -z "$ofile" || test -z "$cfile"; fi # Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. -# Note: use `[/.-]' here to ensure that we don't use the same name +# Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break diff -ruNp m4-1.4.12/build-aux/config.guess m4-1.4.13/build-aux/config.guess --- m4-1.4.12/build-aux/config.guess 2008-10-10 21:03:10.000000000 -0600 +++ m4-1.4.13/build-aux/config.guess 2009-03-16 09:26:44.000000000 -0600 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-09-28' +timestamp='2009-02-03' # 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 @@ -331,7 +331,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -1141,6 +1154,16 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + 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; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1327,6 +1350,9 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -ruNp m4-1.4.12/build-aux/config.sub m4-1.4.13/build-aux/config.sub --- m4-1.4.12/build-aux/config.sub 2008-10-10 21:03:10.000000000 -0600 +++ m4-1.4.13/build-aux/config.sub 2009-03-16 09:26:44.000000000 -0600 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-09-08' +timestamp='2009-02-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -122,6 +122,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^- case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -249,6 +250,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ @@ -279,7 +281,7 @@ case $basic_machine in | 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 \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | 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 \ @@ -331,6 +333,7 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ @@ -362,7 +365,7 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ @@ -443,6 +446,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -1182,7 +1189,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1254,8 +1261,9 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ diff -ruNp m4-1.4.12/build-aux/depcomp m4-1.4.13/build-aux/depcomp --- m4-1.4.12/build-aux/depcomp 2008-10-10 21:03:10.000000000 -0600 +++ m4-1.4.13/build-aux/depcomp 2009-03-16 09:26:44.000000000 -0600 @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2007-03-29.01 +scriptversion=2009-03-04.20 -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software -# Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -85,6 +85,15 @@ if test "$depmode" = dashXmstdout; then depmode=dashmstdout fi +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -190,14 +199,14 @@ sgi) ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' -' ' ' >> $depfile - echo >> $depfile +' ' ' >> "$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 + >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -326,7 +335,12 @@ hp2) 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" + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi @@ -402,7 +416,7 @@ dashmstdout) # Remove the call to Libtool. if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift @@ -453,7 +467,7 @@ makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift @@ -461,7 +475,8 @@ makedepend) # X makedepend shift cleared=no - for arg in "$@"; do + for arg + do case $cleared in no) set ""; shift @@ -478,7 +493,7 @@ makedepend) set fnord "$@" "$arg"; shift ;; esac done - obj_suffix="`echo $object | sed 's/^.*\././'`" + obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" @@ -498,7 +513,7 @@ cpp) # Remove the call to Libtool. if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift @@ -536,13 +551,27 @@ cpp) 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. + # always write the preprocessed file to stdout. "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + IFS=" " for arg do case "$arg" in + -o) + shift + ;; + $object) + shift + ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift @@ -555,16 +584,23 @@ msvisualcpp) ;; esac done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; +msvcmsys) + # 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 + ;; + none) exec "$@" ;; diff -ruNp m4-1.4.12/build-aux/gendocs.sh m4-1.4.13/build-aux/gendocs.sh --- m4-1.4.12/build-aux/gendocs.sh 2008-08-05 07:16:36.000000000 -0600 +++ m4-1.4.13/build-aux/gendocs.sh 2009-01-04 19:07:47.000000000 -0700 @@ -2,9 +2,9 @@ # gendocs.sh -- generate a GNU manual in many formats. This script is # mentioned in maintain.texi. See the help message below for usage details. -scriptversion=2008-03-05.14 +scriptversion=2009-01-02.08 -# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 +# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -44,7 +44,7 @@ unset use_texi2html version="gendocs.sh $scriptversion -Copyright (C) 2007 Free Software Foundation, Inc. +Copyright 2009 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." @@ -57,24 +57,28 @@ See the GNU Maintainers document for a m Options: -o OUTDIR write files into OUTDIR, instead of manual/. + --email ADR use ADR as contact in generated web pages. --docbook convert to DocBook too (xml, txt, html, pdf and ps). --html ARG pass indicated ARG to makeinfo or texi2html for HTML targets. --texi2html use texi2html to generate HTML targets. --help display this help and exit successfully. --version display version information and exit successfully. -Simple example: $prog emacs \"GNU Emacs Manual\" +Simple example: $prog --email bug-gnu-emacs@gnu.org emacs \"GNU Emacs Manual\" Typical sequence: - cd YOURPACKAGESOURCE/doc + cd PACKAGESOURCE/doc wget \"$scripturl\" wget \"$templateurl\" - $prog YOURMANUAL \"GNU YOURMANUAL - One-line description\" + $prog --email BUGLIST MANUAL \"GNU MANUAL - One-line description\" Output will be in a new subdirectory \"manual\" (by default, use -o OUTDIR to override). Move all the new files into your web CVS tree, as explained in the Web Pages node of maintain.texi. +Please use the --email ADDRESS option to specify your bug-reporting +address in the generated HTML pages. + MANUAL-TITLE is included as part of the HTML of the overall manual/index.html file. It should include the name of the package being documented. manual/index.html is created by substitution from the file @@ -82,11 +86,11 @@ $GENDOCS_TEMPLATE_DIR/gendocs_template. generic template for your own purposes.) If you have several manuals, you'll need to run this script several -times with different YOURMANUAL values, specifying a different output +times with different MANUAL values, specifying a different output directory with -o each time. Then write (by hand) an overall index.html with links to them all. -If a manual's texinfo sources are spread across several directories, +If a manual's Texinfo sources are spread across several directories, first copy or symlink all Texinfo sources into a single directory. (Part of the script's work is to make a tar.gz of the sources.) @@ -98,7 +102,7 @@ DOCBOOK2TXT are also respected.) By default, makeinfo is run in the default (English) locale, since that's the language of most Texinfo manuals. If you happen to have a -non-English manual and non-English web site, check the SETLANG setting +non-English manual and non-English web site, see the SETLANG setting in the source. Email bug reports or enhancement requests to bug-texinfo@gnu.org. @@ -110,21 +114,23 @@ calcsize() echo $size } -outdir=manual -html= -PACKAGE= MANUAL_TITLE= +PACKAGE= +EMAIL=webmasters@gnu.org # please override with --email +htmlarg= +outdir=manual while test $# -gt 0; do case $1 in + --email) shift; EMAIL=$1;; --help) echo "$usage"; exit 0;; --version) echo "$version"; exit 0;; -o) shift; outdir=$1;; --docbook) docbook=yes;; - --html) shift; html=$1;; + --html) shift; htmlarg=$1;; --texi2html) use_texi2html=1;; -*) - echo "$0: Unknown or ambiguous option \`$1'." >&2 + echo "$0: Unknown option \`$1'." >&2 echo "$0: Try \`--help' for more information." >&2 exit 1;; *) @@ -203,8 +209,10 @@ gzip -f -9 -c $PACKAGE.txt >$outdir/$PAC ascii_gz_size=`calcsize $outdir/$PACKAGE.txt.gz` mv $PACKAGE.txt $outdir/ -html_split() { - cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html --split=$1 $html --node-files \"$srcfile\"" +html_split() +{ + opt="--split=$1 $htmlarg --node-files" + cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\"" echo "Generating html by $1... ($cmd)" eval "$cmd" split_html_dir=$PACKAGE.html @@ -221,7 +229,8 @@ html_split() { } if test -z "$use_texi2html"; then - cmd="$SETLANG $MAKEINFO --no-split --html -o $PACKAGE.html $html \"$srcfile\"" + opt="--no-split --html -o $PACKAGE.html $htmlarg" + cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" echo "Generating monolithic html... ($cmd)" rm -rf $PACKAGE.html # in case a directory is left over eval "$cmd" @@ -230,7 +239,7 @@ if test -z "$use_texi2html"; then html_mono_gz_size=`calcsize $outdir/$PACKAGE.html.gz` mv $PACKAGE.html $outdir/ - cmd="$SETLANG $MAKEINFO --html -o $PACKAGE.html $html \"$srcfile\"" + cmd="$SETLANG $MAKEINFO --html -o $PACKAGE.html $htmlarg \"$srcfile\"" echo "Generating html by node... ($cmd)" eval "$cmd" split_html_dir=$PACKAGE.html @@ -244,7 +253,7 @@ if test -z "$use_texi2html"; then mv ${split_html_dir}/*.html $outdir/html_node/ rmdir ${split_html_dir} else - cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $html \"$srcfile\"" + cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $htmlarg \"$srcfile\"" echo "Generating monolithic html... ($cmd)" rm -rf $PACKAGE.html # in case a directory is left over eval "$cmd" @@ -306,7 +315,7 @@ if test -n "$docbook"; then mv $PACKAGE-db.pdf $outdir/ fi -echo Writing index file... +echo "Writing index file..." if test -z "$use_texi2html"; then CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\ /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d" @@ -316,8 +325,9 @@ fi curdate=`$SETLANG date '+%B %d, %Y'` sed \ -e "s!%%TITLE%%!$MANUAL_TITLE!g" \ - -e "s!%%DATE%%!$curdate!g" \ + -e "s!%%EMAIL%%!$EMAIL!g" \ -e "s!%%PACKAGE%%!$PACKAGE!g" \ + -e "s!%%DATE%%!$curdate!g" \ -e "s!%%HTML_MONO_SIZE%%!$html_mono_size!g" \ -e "s!%%HTML_MONO_GZ_SIZE%%!$html_mono_gz_size!g" \ -e "s!%%HTML_NODE_TGZ_SIZE%%!$html_node_tgz_size!g" \ @@ -341,7 +351,7 @@ sed \ -e "$CONDS" \ $GENDOCS_TEMPLATE_DIR/gendocs_template >$outdir/index.html -echo "Done! See $outdir/ subdirectory for new files." +echo "Done, see $outdir/ subdirectory for new files." # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -ruNp m4-1.4.12/build-aux/gnupload m4-1.4.13/build-aux/gnupload --- m4-1.4.12/build-aux/gnupload 2008-08-05 07:16:37.000000000 -0600 +++ m4-1.4.13/build-aux/gnupload 2009-03-08 20:14:29.000000000 -0600 @@ -1,9 +1,9 @@ #!/bin/sh # Sign files and upload them. -scriptversion=2008-04-02.19 +scriptversion=2009-03-05.20 -# Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation +# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,96 +23,212 @@ scriptversion=2008-04-02.19 set -e GPG='gpg --batch --no-tty' +conffile=.gnuploadrc to= +dry_run=false +symlink_files= +delete_files= +delete_symlinks= +collect_var= +dbg= -usage="Usage: $0 [OPTIONS]... FILES... +usage="Usage: $0 [OPTIONS]... [COMMAND] FILES... [[COMMAND] FILES...] Sign all FILES, and upload them to selected destinations, according to <http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>. +Commands: + --delete delete FILES from destination + --symlink create symbolic links + --rmsymlink remove symbolic links + -- treat the remaining arguments as files to upload + Options: --help print this help text and exit --to DEST specify one destination for FILES (multiple --to options are allowed) --user NAME sign with key NAME + --symlink-regex[=EXPR] use sed script EXPR to compute symbolic link names + --dry-run do nothing, show what would have been done --version output version information and exit +If --symlink-regex is given without EXPR, then the link target name +is created by replacing the version information with \`-latest', e.g.: + + foo-1.3.4.tar.gz -> foo-latest.tar.gz + Recognized destinations are: alpha.gnu.org:DIRECTORY savannah.gnu.org:DIRECTORY savannah.nongnu.org:DIRECTORY ftp.gnu.org:DIRECTORY build directive files and upload files by FTP + download.gnu.org.ua:{alpha|ftp}/DIRECTORY + build directive files and upload files by SFTP [user@]host:DIRECTORY upload files with scp -Simple single-target single-file examples: - gnupload --to alpha.gnu.org:automake automake-1.8.2b.tar.gz - gnupload --to ftp.gnu.org:automake automake-1.8.3.tar.gz +Options and commands are applied in order. If the file $conffile exists +in the current working directory, its contents are prepended to the +actual command line options. Use this to keep your defaults. Comments +(#) and empty lines in $conffile are allowed. + +Examples: +1. Upload automake-1.8.2b.tar.gz and automake-1.8.2b.tar.bz2 to two sites: + gnupload --to sources.redhat.com:~ftp/pub/automake \\ + --to alpha.gnu.org:automake \\ + automake-1.8.2b.tar.gz automake-1.8.2b.tar.bz2 + +2. Same as above, but also create symbolic links to automake-latest.tar.*: + gnupload --to sources.redhat.com:~ftp/pub/automake \\ + --to alpha.gnu.org:automake \\ + --symlink-regex \\ + automake-1.8.2b.tar.gz automake-1.8.2b.tar.bz2 + +3. Symlink automake-1.8.2b.tar.gz to automake-latest.tar.gz and +automake-1.8.2b.tar.bz2 to automake-latest.tar.bz2 on both sites: -Multiple-target multiple-file example: gnupload --to sources.redhat.com:~ftp/pub/automake \\ --to alpha.gnu.org:automake \\ + --symlink automake-1.8.2b.tar.gz automake-latest.tar.gz \\ + automake-1.8.2b.tar.bz2 automake-latest.tar.bz2 + +4. Delete automake-1.8.2a.tar.gz and .bz2, remove symlink +automake-latest.tar.gz and upload automake-1.8.2b.tar.gz: + + gnupload --to sources.redhat.com:~ftp/pub/automake \\ + --to alpha.gnu.org:automake \\ + --delete automake-1.8.2a.tar.gz automake-1.8.2a.tar.bz2 \\ + --rmsymlink automake-latest.tar.gz \\ + -- \\ automake-1.8.2b.tar.gz automake-1.8.2b.tar.bz2 Report bugs to <bug-automake@gnu.org>. Send patches to <automake-patches@gnu.org>." +# Read local configuration file +if test -r "$conffile"; then + echo "$0: Reading configuration file $conffile" + eval set x "`sed 's/#.*$//;/^$/d' \"$conffile\" | tr '\012\015' ' '` \"\$@\"" + shift +fi + while test -n "$1"; do case $1 in + -*) + collect_var= + case $1 in --help) echo "$usage" exit $? ;; --to) if test -z "$2"; then - echo "$0: Missing argument for --to" 1>&2 + echo "$0: Missing argument for --to" 1>&2 exit 1 else to="$to $2" - shift 2 + shift fi ;; --user) if test -z "$2"; then - echo "$0: Missing argument for --user" 1>&2 + echo "$0: Missing argument for --user" 1>&2 exit 1 else GPG="$GPG --local-user $2" - shift 2 + shift fi ;; + --delete) + collect_var=delete_files + ;; + --rmsymlink) + collect_var=delete_symlinks + ;; + --symlink-regex=*) + symlink_expr=`expr "$1" : '[^=]*=\(.*\)'` + ;; + --symlink-regex) + symlink_expr='s|-[0-9][0-9\.]*\(-[0-9][0-9]*\)\{0,1\}\.|-latest.|' + ;; + --symlink) + collect_var=symlink_files + ;; + --dry-run|-n) + dry_run=: + ;; --version) echo "gnupload $scriptversion" exit $? ;; + --) + shift + break + ;; -*) echo "$0: Unknown option \`$1', try \`$0 --help'" 1>&2 exit 1 ;; - *) + esac + ;; + *) + if test -z "$collect_var"; then break - ;; + else + eval "$collect_var=\"\$$collect_var $1\"" + fi + ;; esac + shift done -if test $# = 0; then - echo "$0: No file to upload" 1>&2 +dprint() +{ + echo "Running $*..." +} + +if $dry_run; then + dbg=dprint +fi + +if test -z "$to"; then + echo "$0: Missing destination sites" >&2 exit 1 -else - : fi -# Make sure all files exist. We don't want to ask -# for the passphrase if the script will fail. -for file -do - if test ! -f $file; then - echo "$0: Cannot find \`$file'" 1>&2 +if test -n "$symlink_files"; then + x=`echo "$symlink_files" | sed 's/[^ ]//g;s/ //g'` + if test -n "$x"; then + echo "$0: Odd number of symlink arguments" >&2 exit 1 - else - : fi -done +fi + +if test $# = 0; then + if test -z "${symlink_files}${delete_files}${delete_symlinks}"; then + echo "$0: No file to upload" 1>&2 + exit 1 + fi +else + # Make sure all files exist. We don't want to ask + # for the passphrase if the script will fail. + for file + do + if test ! -f $file; then + echo "$0: Cannot find \`$file'" 1>&2 + exit 1 + elif test -n "$symlink_expr"; then + linkname=`echo $file | sed "$symlink_expr"` + if test -z "$linkname"; then + echo "$0: symlink expression produces empty results" >&2 + exit 1 + elif test "$linkname" = $file; then + echo "$0: symlink expression does not alter file name" >&2 + exit 1 + fi + fi + done +fi # Make sure passphrase is not exported in the environment. unset passphrase @@ -129,56 +245,164 @@ read -r passphrase stty echo echo -for file +if test $# -ne 0; then + for file + do + echo "Signing $file..." + rm -f $file.sig + echo "$passphrase" | $dbg $GPG --passphrase-fd 0 -ba -o $file.sig $file + done +fi + + +# mkdirective DESTDIR BASE FILE STMT +# Arguments: See upload, below +mkdirective () +{ + stmt="$4" + if test -n "$3"; then + stmt=" +filename: $3$stmt" + fi + + cat >${2}.directive<<EOF +version: 1.1 +directory: $1 +comment: gnupload v. $scriptversion$stmt +EOF + if $dry_run; then + echo "File ${2}.directive:" + cat ${2}.directive + echo "File ${2}.directive:" | sed 's/./-/g' + fi +} + +mksymlink () +{ + while test $# -ne 0 + do + echo "symlink: $1 $2" + shift + shift + done +} + +# upload DEST DESTDIR BASE FILE STMT FILES +# Arguments: +# DEST Destination site; +# DESTDIR Destination directory; +# BASE Base name for the directive file; +# FILE Name of the file to distribute (may be empty); +# STMT Additional statements for the directive file; +# FILES List of files to upload. +upload () +{ + dest=$1 + destdir=$2 + base=$3 + file=$4 + stmt=$5 + files=$6 + + rm -f $base.directive $base.directive.asc + case $dest in + alpha.gnu.org:*) + mkdirective "$destdir" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG --passphrase-fd 0 --clearsign $base.directive + $dbg ncftpput ftp-upload.gnu.org /incoming/alpha $files $base.directive.asc + ;; + ftp.gnu.org:*) + mkdirective "$destdir" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG --passphrase-fd 0 --clearsign $base.directive + $dbg ncftpput ftp-upload.gnu.org /incoming/ftp $files $base.directive.asc + ;; + savannah.gnu.org:*) + if test -z "$files"; then + echo "$0: warning: standalone directives not applicable for $dest" >&2 + fi + $dbg ncftpput savannah.gnu.org /incoming/savannah/$destdir $files + ;; + savannah.nongnu.org:*) + if test -z "$files"; then + echo "$0: warning: standalone directives not applicable for $dest" >&2 + fi + $dbg ncftpput savannah.nongnu.org /incoming/savannah/$destdir $files + ;; + download.gnu.org.ua:alpha/*|download.gnu.org.ua:ftp/*) + destdir_p1=`echo "$destdir" | sed 's,^[^/]*/,,'` + destdir_topdir=`echo "$destdir" | sed 's,/.*,,'` + mkdirective "$destdir_p1" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG --passphrase-fd 0 --clearsign $base.directive + for f in $files $base.directive.asc + do + echo put $f + done | $dbg sftp -b - puszcza.gnu.org.ua:/incoming/$destdir_topdir + ;; + /*) + dest_host=`echo "$dest" | sed 's,:.*,,'` + mkdirective "$destdir" "$base" "$file" "$stmt" + echo "$passphrase" | $dbg $GPG --passphrase-fd 0 --clearsign $base.directive + $dbg cp $files $base.directive.asc $dest_host + ;; + *) + if test -z "$files"; then + echo "$0: warning: standalone directives not applicable for $dest" >&2 + fi + $dbg scp $files $dest + ;; + esac + rm -f $base.directive $base.directive.asc +} + +##### +# Process any standalone directives +stmt= +if test -n "$symlink_files"; then + stmt="$stmt +`mksymlink $symlink_files`" +fi + +for file in $delete_files +do + stmt="$stmt +archive: $file" +done + +for file in $delete_symlinks do - echo "Signing $file..." - rm -f $file.sig - echo $passphrase | $GPG --passphrase-fd 0 -ba -o $file.sig $file + stmt="$stmt +rmsymlink: $file" done +if test -n "$stmt"; then + for dest in $to + do + destdir=`echo $dest | sed 's/[^:]*://'` + upload "$dest" "$destdir" "`hostname`-$$" "" "$stmt" + done +fi + +# Process actual uploads for dest in $to do for file do echo "Uploading $file to $dest..." + stmt= files="$file $file.sig" destdir=`echo $dest | sed 's/[^:]*://'` - case $dest in - alpha.gnu.org:*) - rm -f $file.directive $file.directive.asc - cat >$file.directive<<EOF -version: 1.1 -directory: $destdir -filename: `basename -- "$file"` -EOF - echo "$passphrase" | $GPG --passphrase-fd 0 --clearsign $file.directive - ncftpput ftp-upload.gnu.org /incoming/alpha $files $file.directive.asc - rm -f $file.directive $file.directive.asc - ;; - ftp.gnu.org:*) - rm -f $file.directive $file.directive.asc - cat >$file.directive<<EOF -version: 1.1 -directory: $destdir -filename: `basename -- "$file"` -EOF - echo "$passphrase" | $GPG --passphrase-fd 0 --clearsign $file.directive - ncftpput ftp-upload.gnu.org /incoming/ftp $files $file.directive.asc - rm -f $file.directive $file.directive.asc - ;; - savannah.gnu.org:*) - ncftpput savannah.gnu.org /incoming/savannah/$destdir $files - ;; - savannah.nongnu.org:*) - ncftpput savannah.nongnu.org /incoming/savannah/$destdir $files - ;; - *) - scp $files $dest - ;; - esac + if test -n "$symlink_expr"; then + linkname=`echo $file | sed "$symlink_expr"` + stmt="$stmt +symlink: $file $linkname +symlink: $file.sig $linkname.sig" + fi + upload "$dest" "$destdir" "$file" "$file" "$stmt" "$files" done done +exit 0 + # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" diff -ruNp m4-1.4.12/build-aux/missing m4-1.4.13/build-aux/missing --- m4-1.4.12/build-aux/missing 2008-10-10 21:03:10.000000000 -0600 +++ m4-1.4.13/build-aux/missing 2009-03-16 09:26:44.000000000 -0600 @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2006-05-10.23 +scriptversion=2008-12-21.33 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -87,6 +87,9 @@ Supported PROGRAM values: tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + Send bug reports to <bug-automake@gnu.org>." exit $? ;; @@ -104,15 +107,22 @@ Send bug reports to <bug-automake@gnu.or esac +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + # 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). +# the program). This is about non-GNU programs, so use $1 not +# $program. case $1 in - lex|yacc) + lex*|yacc*) # Not GNU programs, they don't have --version. ;; - tar) + tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 @@ -136,7 +146,7 @@ esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case $1 in +case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -146,7 +156,7 @@ WARNING: \`$1' is $msg. You should only touch aclocal.m4 ;; - autoconf) + autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the @@ -155,7 +165,7 @@ WARNING: \`$1' is $msg. You should only touch configure ;; - autoheader) + autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want @@ -185,7 +195,7 @@ WARNING: \`$1' is $msg. You should only while read f; do touch "$f"; done ;; - autom4te) + autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the @@ -208,7 +218,7 @@ WARNING: \`$1' is needed, but is $msg. fi ;; - bison|yacc) + 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 @@ -238,7 +248,7 @@ WARNING: \`$1' $msg. You should only ne fi ;; - lex|flex) + 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 @@ -261,7 +271,7 @@ WARNING: \`$1' is $msg. You should only fi ;; - help2man) + 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 @@ -275,11 +285,11 @@ WARNING: \`$1' is $msg. You should only else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" - exit 1 + exit $? fi ;; - makeinfo) + 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 @@ -308,7 +318,7 @@ WARNING: \`$1' is $msg. You should only touch $file ;; - tar) + tar*) shift # We have already tried tar in the generic part. diff -ruNp m4-1.4.12/build-aux/texinfo.tex m4-1.4.13/build-aux/texinfo.tex --- m4-1.4.12/build-aux/texinfo.tex 2008-10-10 21:03:10.000000000 -0600 +++ m4-1.4.13/build-aux/texinfo.tex 2009-03-29 21:14:30.000000000 -0600 @@ -3,11 +3,11 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2008-04-18.10} +\def\texinfoversion{2009-03-28.05} % -% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008 Free Software Foundation, Inc. +% 2007, 2008, 2009 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 @@ -98,6 +98,9 @@ \let\ptexstar=\* \let\ptext=\t \let\ptextop=\top +{\catcode`\'=\active +\global\let\ptexquoteright'}% Math-mode def from plain.tex. +\let\ptexraggedright=\raggedright % If this character appears in an error message or help string, it % starts a new line in the output. @@ -355,7 +358,7 @@ % 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 + % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. @@ -706,7 +709,7 @@ \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. -% +% \def\onword{on} \def\offword{off} % @@ -926,6 +929,7 @@ where each line of input produces a line {% \makevalueexpandable % we want to expand any @value in FILE. \turnoffactive % and allow special characters in the expansion + \indexnofonts % Allow `@@' and other weird things in file names. \edef\temp{\noexpand\input #1 }% % % This trickery is to read FILE outside of a group, in case it makes @@ -944,6 +948,8 @@ where each line of input produces a line \catcode`>=\other \catcode`+=\other \catcode`-=\other + \catcode`\`=\other + \catcode`\'=\other } \def\pushthisfilestack{% @@ -1142,11 +1148,13 @@ where each line of input produces a line \catcode`< = \active \catcode`> = \active \catcode`+ = \active + \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus + \let' = \ptexquoteright } } @@ -1277,7 +1285,7 @@ where each line of input produces a line % that's what we do). % double active backslashes. -% +% {\catcode`\@=0 \catcode`\\=\active @gdef@activebackslashdouble{% @catcode`@\=@active @@ -1289,11 +1297,11 @@ where each line of input produces a line % 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% @@ -1328,7 +1336,10 @@ output) for that.)} \def\cmykDarkRed{0.28 1 1 0.35} \def\cmykBlack{0 0 0 1} % - \def\pdfsetcolor#1{\pdfliteral{#1 k}} + % k sets the color for filling (usual text, etc.); + % K sets the color for stroking (thin rules, e.g., normal _'s). + \def\pdfsetcolor#1{\pdfliteral{#1 k #1 K}} + % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% @@ -1562,11 +1573,15 @@ output) for that.)} % 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 + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% @@ -1597,6 +1612,7 @@ output) for that.)} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else + % non-pdf mode \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax @@ -1627,6 +1643,10 @@ output) for that.)} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} +% Unfortunately, we have to override this for titles and the like, since +% in those cases "rm" is bold. Sigh. +\def\rmisbold{\rm\def\curfontstyle{bf}} + % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam @@ -1961,7 +1981,7 @@ end % Definitions for a main text size of 11pt. This is the default in % Texinfo. -% +% \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} @@ -2024,8 +2044,6 @@ end \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 -\def\authorrm{\secrm} -\def\authortt{\sectt} \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). @@ -2094,7 +2112,7 @@ end % 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} @@ -2157,8 +2175,6 @@ end \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 -\def\authorrm{\secrm} -\def\authortt{\sectt} \def\titleecsize{2074} % Chapter fonts (14.4pt). @@ -2185,7 +2201,7 @@ end \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} -\font\seci=cmmi12 +\font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} @@ -2229,7 +2245,7 @@ end % 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} % @@ -2239,7 +2255,7 @@ end % % 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 @@ -2290,7 +2306,7 @@ end \def\curfontsize{title}% \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{25pt}} -\def\titlefont#1{{\titlefonts\rm #1}} +\def\titlefont#1{{\titlefonts\rmisbold #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc @@ -2341,6 +2357,16 @@ end \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} +% 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} + +% Define these just so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts @@ -2354,28 +2380,128 @@ end % % 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$} + +\message{markup,} + +% 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 } + +% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will +% define and register \INITMACRO to be called on markup style changes. +% \INITMACRO can check \currentmarkupstyle for the innermost +% style and the set of \ifmarkupSTYLE switches for all styles +% currently in effect. +\newif\ifmarkupvar +\newif\ifmarkupsamp +\newif\ifmarkupkey +%\newif\ifmarkupfile % @file == @samp. +%\newif\ifmarkupoption % @option == @samp. +\newif\ifmarkupcode +\newif\ifmarkupkbd +%\newif\ifmarkupenv % @env == @code. +%\newif\ifmarkupcommand % @command == @code. +\newif\ifmarkuptex % @tex (and part of @math, for now). +\newif\ifmarkupexample +\newif\ifmarkupverb +\newif\ifmarkupverbatim + +\let\currentmarkupstyle\empty + +\def\setupmarkupstyle#1{% + \csname markup#1true\endcsname + \def\currentmarkupstyle{#1}% + \markupstylesetup +} + +\let\markupstylesetup\empty + +\def\defmarkupstylesetup#1{% + \expandafter\def\expandafter\markupstylesetup + \expandafter{\markupstylesetup #1}% + \def#1% +} + +% Markup style setup for left and right quotes. +\defmarkupstylesetup\markupsetuplq{% + \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuplqdefault \else \temp \fi +} + +\defmarkupstylesetup\markupsetuprq{% + \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuprqdefault \else \temp \fi +} + +{ +\catcode`\'=\active +\catcode`\`=\active + +\gdef\markupsetuplqdefault{\let`\lq} +\gdef\markupsetuprqdefault{\let'\rq} + +\gdef\markupsetcodequoteleft{\let`\codequoteleft} +\gdef\markupsetcodequoteright{\let'\codequoteright} + +\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft} +} + +\let\markupsetuplqcode \markupsetcodequoteleft +\let\markupsetuprqcode \markupsetcodequoteright +\let\markupsetuplqexample \markupsetcodequoteleft +\let\markupsetuprqexample \markupsetcodequoteright +\let\markupsetuplqverb \markupsetcodequoteleft +\let\markupsetuprqverb \markupsetcodequoteright +\let\markupsetuplqverbatim \markupsetcodequoteleft +\let\markupsetuprqverbatim \markupsetcodequoteright + +\let\markupsetuplqsamp \markupsetnoligaturesquoteleft +\let\markupsetuplqkbd \markupsetnoligaturesquoteleft + +% 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 SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \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 SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% + \else \char'22 \fi + \else \char'22 \fi +} + +% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. +\def\noligaturesquoteleft{\relax\lq} % 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 @@ -2390,17 +2516,22 @@ end % @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 +% @cite is 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 +\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}} \let\dfn=\smartslanted \let\emph=\smartitalic -% @b, explicit bold. +% 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 + +% @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b @@ -2432,22 +2563,35 @@ end \catcode`@=\other \def\endofsentencespacefactor{3000}% default +% @t, explicit typewriter. \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} + +% @samp. +\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} + +% definition of @key that produces a lozenge. Doesn't adjust to text size. +%\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}}}} + +% definition of @key with no lozenge. If the current font is already +% monospace, don't change it; that way, we respect @kbdinputstyle. But +% if it isn't monospace, then use \tt. +% +\def\key#1{{\setupmarkupstyle{key}% + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} + +% ctrl is no longer a Texinfo command. \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @file, @option are the same as @samp. @@ -2489,11 +2633,11 @@ end { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active + \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup - \catcode\rquoteChar=\active \catcode\lquoteChar=\active - \let'\codequoteright \let`\codequoteleft - % + \setupmarkupstyle{code}% + % The following should really be moved into \setupmarkupstyle handlers. \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash @@ -2525,7 +2669,7 @@ end % 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} @@ -2545,6 +2689,7 @@ end % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. +\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), @@ -2566,14 +2711,14 @@ end \def\wordexample{example} \def\wordcode{code} -% Default is `distinct.' +% 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} +\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} % For @indicateurl, @env, @command quotes seem unnecessary, so use \code. \let\indicateurl=\code @@ -2636,34 +2781,20 @@ end \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}% @@ -2675,7 +2806,7 @@ end % @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}% @@ -2685,6 +2816,44 @@ end \fi } + +\message{glyphs,} + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, they should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} +\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\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} + % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} @@ -2694,52 +2863,59 @@ end % 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 + \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize - \else + \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } -% Hacks for glyphs from the EC fonts similar to \euro. We don't -% use \let for the aliases, because sometimes we redefine the original -% macro, and the alias should reflect the redefinition. +% Glyphs from the EC fonts. We don't use \let for the aliases, because +% sometimes we redefine the original macro, and the alias should reflect +% the redefinition. +% +% Use LaTeX names for the Icelandic letters. +\def\DH{{\ecfont \char"D0}} % Eth +\def\dh{{\ecfont \char"F0}} % eth +\def\TH{{\ecfont \char"DE}} % Thorn +\def\th{{\ecfont \char"FE}} % thorn +% \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} @@ -2749,8 +2925,36 @@ end \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % +% This positioning is not perfect (see the ogonek LaTeX package), but +% we have the precomposed glyphs for the most common cases. We put the +% tests to use those glyphs in the single \ogonek macro so we have fewer +% dummy definitions to worry about for index entries, etc. +% +% ogonek is also used with other letters in Lithuanian (IOU), but using +% the precomposed glyphs for those is not so easy since they aren't in +% the same EC font. +\def\ogonek#1{{% + \def\temp{#1}% + \ifx\temp\macrocharA\Aogonek + \else\ifx\temp\macrochara\aogonek + \else\ifx\temp\macrocharE\Eogonek + \else\ifx\temp\macrochare\eogonek + \else + \ecfont \setbox0=\hbox{#1}% + \ifdim\ht0=1ex\accent"0C #1% + \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% + \fi + \fi\fi\fi\fi + }% +} +\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} +\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} +\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} +\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} +% +% Use the ec* fonts (cm-super in outline format) for non-CM glyphs. \def\ecfont{% - % We can't distinguish serif/sanserif and italic/slanted, but this + % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. @@ -2783,7 +2987,7 @@ end % 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 @@ -2878,12 +3082,9 @@ end \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} + \leftline{\titlefonts\rmisbold #1} % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt @@ -2904,7 +3105,7 @@ end \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi - {\authorfont \leftline{#1}}% + {\secfonts\rmisbold \leftline{#1}}% \fi } @@ -3132,7 +3333,7 @@ end % 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 @@ -3226,9 +3427,18 @@ end \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi + % + % Try typesetting the item mark that if the document erroneously says + % something like @itemize @samp (intending @table), there's an error + % right away at the @itemize. It's not the best error message in the + % world, but it's better than leaving it to the @item. This means if + % the user wants an empty mark, they have to say @w{} not just @w. \def\itemcontents{#1}% + \setbox0 = \hbox{\itemcontents}% + % % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + % \let\item=\itemizeitem } @@ -3249,6 +3459,7 @@ end \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 } @@ -3470,12 +3681,19 @@ end % % @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}% +% of an alignment entry. \everycr resets \everytab so we don't have to +% undo it ourselves. +\def\headitemfont{\b}% for people to use in the template row; not changeable +\def\headitem{% + \checkenv\multitable + \crcr + \global\everytab={\bf}% can't use \headitemfont since the parsing differs + \the\everytab % for the first item +}% % % 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. +% we again encounter the problem the 1sp was intended to solve. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% @@ -3874,11 +4092,11 @@ end \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 + \expandafter \ifx\csname donesynindex#2\endcsname \relax % 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 + \expandafter\let\csname donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname @@ -3928,7 +4146,7 @@ end % 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} @@ -3936,12 +4154,12 @@ end % @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 % @@ -3993,19 +4211,23 @@ end % Non-English letters. \definedummyword\AA \definedummyword\AE + \definedummyword\DH \definedummyword\L - \definedummyword\OE \definedummyword\O + \definedummyword\OE + \definedummyword\TH \definedummyword\aa \definedummyword\ae + \definedummyword\dh + \definedummyword\exclamdown \definedummyword\l - \definedummyword\oe \definedummyword\o - \definedummyword\ss - \definedummyword\exclamdown - \definedummyword\questiondown + \definedummyword\oe \definedummyword\ordf \definedummyword\ordm + \definedummyword\questiondown + \definedummyword\ss + \definedummyword\th % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf @@ -4036,6 +4258,7 @@ end \definedummyword\guilsinglright \definedummyword\expansion \definedummyword\minus + \definedummyword\ogonek \definedummyword\pounds \definedummyword\point \definedummyword\print @@ -4079,6 +4302,7 @@ end \definedummyword\v \definedummyword\H \definedummyword\dotaccent + \definedummyword\ogonek \definedummyword\ringaccent \definedummyword\tieaccent \definedummyword\ubaraccent @@ -4146,19 +4370,23 @@ end % Non-English letters. \def\AA{AA}% \def\AE{AE}% + \def\DH{DZZ}% \def\L{L}% \def\OE{OE}% \def\O{O}% + \def\TH{ZZZ}% \def\aa{aa}% \def\ae{ae}% + \def\dh{dzz}% + \def\exclamdown{!}% \def\l{l}% \def\oe{oe}% - \def\o{o}% - \def\ss{ss}% - \def\exclamdown{!}% - \def\questiondown{?}% \def\ordf{a}% \def\ordm{o}% + \def\o{o}% + \def\questiondown{?}% + \def\ss{ss}% + \def\th{zzz}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% @@ -4197,11 +4425,11 @@ end % 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 } @@ -4329,7 +4557,7 @@ end % 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. @@ -4910,7 +5138,9 @@ end \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % - \message{\putwordChapter\space \the\chapno}% + % \putwordChapter can contain complex things in translations. + \toks0=\expandafter{\putwordChapter}% + \message{\the\toks0 \space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% @@ -4921,15 +5151,17 @@ end \global\let\subsubsection = \numberedsubsubsec } -\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz +\outer\parseargdef\appendix{\apphead0{#1}} % normally 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}% + % \putwordAppendix can contain complex things in translations. + \toks0=\expandafter{\putwordAppendix}% + \message{\the\toks0 \space \appendixletter}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % @@ -5061,7 +5293,6 @@ end % 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 @@ -5070,8 +5301,8 @@ end \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% + \parindent=0pt\ptexraggedright + \rmisbold #1\hfill}}% \bigskip \par\penalty 200\relax \suppressfirstparagraphindent } @@ -5163,7 +5394,10 @@ end \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% - \gdef\noexpand\thischapter{\putwordAppendix{} \noexpand\thischapternum: + % \noexpand\putwordAppendix avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} + \noexpand\thischapternum: \noexpand\thischaptername}% }% \else @@ -5171,7 +5405,10 @@ end \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% - \gdef\noexpand\thischapter{\putwordChapter{} \noexpand\thischapternum: + % \noexpand\putwordChapter avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordChapter{} + \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi @@ -5190,7 +5427,7 @@ end \domark % {% - \chapfonts \rm + \chapfonts \rmisbold % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called @@ -5227,7 +5464,7 @@ end % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% @@ -5251,8 +5488,8 @@ end % \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\nobreak + \parindent=0pt\ptexraggedright + \rmisbold #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}}% @@ -5261,7 +5498,7 @@ end \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt - \hfill {\rm #1}\hfill}}\bigskip \par\nobreak + \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen @@ -5294,7 +5531,7 @@ end \def\sectionheading#1#2#3#4{% {% % Switch to the right set of fonts. - \csname #2fonts\endcsname \rm + \csname #2fonts\endcsname \rmisbold % \def\sectionlevel{#2}% \def\temptype{#3}% @@ -5314,7 +5551,10 @@ end \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% - \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi @@ -5324,12 +5564,20 @@ end \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% - \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % + % Go into vertical mode. Usually we'll already be there, but we + % don't want the following whatsit to end up in a preceding paragraph + % if the document didn't happen to have a blank line. + \par + % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark @@ -5379,7 +5627,7 @@ end \nobreak % % Output the actual section heading. - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% @@ -5395,11 +5643,11 @@ end % 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 @@ -5457,7 +5705,7 @@ end % 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 @@ -5507,7 +5755,7 @@ end % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. -% +% \def\tocreadfilename{\jobname.toc} % Normal (long) toc. @@ -5677,46 +5925,12 @@ end \message{environments,} % @foo ... @end foo. -% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. -% -% Since these characters are used in examples, they should be an even number of -% \tt widths. Each \tt character is 1en, so two makes it 1em. -% -\def\point{$\star$} -\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} -\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} -\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} -\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} -\def\equiv{\leavevmode\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{% + \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie @@ -5726,6 +5940,8 @@ end \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other + \catcode`\`=\other + \catcode`\'=\other \escapechar=`\\ % \let\b=\ptexb @@ -5861,6 +6077,7 @@ end % This macro is called at the beginning of all the @example variants, % inside a group. +\newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak \hfuzz = 12pt % Don't be fussy @@ -5868,7 +6085,12 @@ end \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt + % Turn off paragraph indentation but redefine \indent to emulate + % the normal \indent. + \nonfillparindent=\parindent \parindent = 0pt + \let\indent\nonfillindent + % \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing @@ -5879,6 +6101,24 @@ end \let\exdent=\nofillexdent } +\begingroup +\obeyspaces +% We want to swallow spaces (but not other tokens) after the fake +% @indent in our nonfill-environments, where spaces are normally +% active and set to @tie, resulting in them not being ignored after +% @indent. +\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% +\gdef\nonfillindentcheck{% +\ifx\temp % +\expandafter\nonfillindentgobble% +\else% +\leavevmode\nonfillindentbox% +\fi% +}% +\endgroup +\def\nonfillindentgobble#1{\nonfillindent} +\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} + % 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: @@ -5927,7 +6167,7 @@ end % \maketwodispenvs {lisp}{example}{% \nonfillstart - \tt\quoteexpand + \tt\setupmarkupstyle{example}% \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } @@ -5965,12 +6205,36 @@ end \let\Eflushright = \afterenvbreak +% @raggedright does more-or-less normal line breaking but no right +% justification. From plain.tex. +\envdef\raggedright{% + \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax +} +\let\Eraggedright\par + +\envdef\raggedleft{% + \parindent=0pt \leftskip0pt plus2em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedleft\par + +\envdef\raggedcenter{% + \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedcenter\par + + % @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{% +\def\quotationstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % @@ -5985,6 +6249,17 @@ end \parsearg\quotationlabel } +\envdef\quotation{% + \setnormaldispenv + \quotationstart +} + +\envdef\smallquotation{% + \setsmalldispenv + \quotationstart +} +\let\Esmallquotation = \Equotation + % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % @@ -6020,18 +6295,16 @@ end \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% + % Don't do the quotes -- if we do, @set txicodequoteundirected and + % @set txicodequotebacktick will not have effect on @verb and + % @verbatim, and ?` and !` ligatures won't get disabled. + %\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 @@ -6043,7 +6316,7 @@ end \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% - \catcode`\`=\active + \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and @@ -6058,33 +6331,6 @@ end \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 SETtxicodequoteundirected\endcsname\relax - \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax - '% - \else \char'15 \fi - \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 SETtxicodequotebacktick\endcsname\relax - \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax - `% - \else \char'22 \fi - \else \char'22 \fi -} % \begingroup \catcode`\^^I=\active @@ -6098,13 +6344,6 @@ end \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. @@ -6114,9 +6353,8 @@ end % Easiest (and conventionally used) font for verbatim \tt \def\par{\leavevmode\egroup\box0\endgraf}% - \catcode`\`=\active \tabexpand - \quoteexpand + \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count @@ -6176,6 +6414,7 @@ end {% \makevalueexpandable \setupverbatim + \indexnofonts % Allow `@@' and other weird things in file names. \input #1 \afterenvbreak }% @@ -6454,7 +6693,7 @@ end % % 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 + \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } @@ -6608,7 +6847,7 @@ end % 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 @@ -7747,10 +7986,9 @@ end \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 (de) or locale (de_DE) -% abbreviation. It would be nice if we could set up a hyphenation file. +% For single-language documents, @documentlanguage is usually given very +% early, just after @documentencoding. Single argument is the language +% (de) or locale (de_DE) abbreviation. % { \catcode`\_ = \active @@ -7763,31 +8001,60 @@ end \ifeof 1 \documentlanguagetrywithoutunderscore{#1_\finish}% \else + \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 - \endgroup + \endgroup % end raw TeX \endgroup} -} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. -% -\def\documentlanguagetrywithoutunderscore#1_#2\finish{% +% +\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else + \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 } +}% end of special _ catcode % \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.} +is empty. Maybe you need to install it? Putting it in the current +directory should work if nowhere else does.} +% This macro is called from txi-??.tex files; the first argument is the +% \language name to set (without the "\lang@" prefix), the second and +% third args are \{left,right}hyphenmin. +% +% The language names to pass are determined when the format is built. +% See the etex.log file created at that time, e.g., +% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. +% +% With TeX Live 2008, etex now includes hyphenation patterns for all +% available languages. This means we can support hyphenation in +% Texinfo, at least to some extent. (This still doesn't solve the +% accented characters problem.) +% +\catcode`@=11 +\def\txisetlanguage#1#2#3{% + % do not set the language if the name is undefined in the current TeX. + \expandafter\ifx\csname lang@#1\endcsname \relax + \message{no patterns for #1}% + \else + \global\language = \csname lang@#1\endcsname + \fi + % but there is no harm in adjusting the hyphenmin values regardless. + \global\lefthyphenmin = #2\relax + \global\righthyphenmin = #3\relax +} + +% Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% @@ -7828,7 +8095,7 @@ should work if nowhere else does.} \setnonasciicharscatcode\active \lattwochardefs % - \else \ifx \declaredencoding \latone + \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % @@ -7840,7 +8107,7 @@ should work if nowhere else does.} \setnonasciicharscatcode\active \utfeightchardefs % - \else + \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight @@ -7852,7 +8119,7 @@ should work if nowhere else does.} % 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. @@ -7865,21 +8132,21 @@ should work if nowhere else does.} % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% - \gdef^^a0{~} + \gdef^^a0{~} \gdef^^a1{\exclamdown} - \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} - \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} - \gdef^^a8{\"{}} - \gdef^^a9{\copyright} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} \gdef^^aa{\ordf} - \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^ab{\guillemetleft} \gdef^^ac{$\lnot$} - \gdef^^ad{\-} - \gdef^^ae{\registeredsymbol} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} @@ -7895,7 +8162,7 @@ should work if nowhere else does.} \gdef^^b9{$^1$} \gdef^^ba{\ordm} % - \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^bb{\guilletright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} \gdef^^be{$3\over4$} @@ -7906,7 +8173,7 @@ should work if nowhere else does.} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} - \gdef^^c5{\ringaccent A} + \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} @@ -7918,7 +8185,7 @@ should work if nowhere else does.} \gdef^^ce{\^I} \gdef^^cf{\"I} % - \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}} + \gdef^^d0{\DH} \gdef^^d1{\~N} \gdef^^d2{\`O} \gdef^^d3{\'O} @@ -7932,7 +8199,7 @@ should work if nowhere else does.} \gdef^^db{\^U} \gdef^^dc{\"U} \gdef^^dd{\'Y} - \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}} + \gdef^^de{\TH} \gdef^^df{\ss} % \gdef^^e0{\`a} @@ -7952,7 +8219,7 @@ should work if nowhere else does.} \gdef^^ee{\^{\dotless i}} \gdef^^ef{\"{\dotless i}} % - \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}} + \gdef^^f0{\dh} \gdef^^f1{\~n} \gdef^^f2{\`o} \gdef^^f3{\'o} @@ -7966,7 +8233,7 @@ should work if nowhere else does.} \gdef^^fb{\^u} \gdef^^fc{\"u} \gdef^^fd{\'y} - \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}} + \gdef^^fe{\th} \gdef^^ff{\"y} } @@ -7988,7 +8255,7 @@ should work if nowhere else does.} % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdef^^a0{~} - \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}} + \gdef^^a1{\ogonek{A}} \gdef^^a2{\u{}} \gdef^^a3{\L} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} @@ -8005,8 +8272,8 @@ should work if nowhere else does.} \gdef^^af{\dotaccent Z} % \gdef^^b0{\textdegree} - \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}} - \gdef^^b2{\missingcharmsg{OGONEK}} + \gdef^^b1{\ogonek{a}} + \gdef^^b2{\ogonek{ }} \gdef^^b3{\l} \gdef^^b4{\'{}} \gdef^^b5{\v l} @@ -8031,14 +8298,14 @@ should work if nowhere else does.} \gdef^^c7{\cedilla C} \gdef^^c8{\v C} \gdef^^c9{\'E} - \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}} + \gdef^^ca{\ogonek{E}} \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^^d0{\DH} \gdef^^d1{\'N} \gdef^^d2{\v N} \gdef^^d3{\'O} @@ -8047,7 +8314,7 @@ should work if nowhere else does.} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} - \gdef^^d9{\ringaccent U} + \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} @@ -8065,14 +8332,14 @@ should work if nowhere else does.} \gdef^^e7{\cedilla c} \gdef^^e8{\v c} \gdef^^e9{\'e} - \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}} + \gdef^^ea{\ogonek{e}} \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^^f0{\dh} \gdef^^f1{\'n} \gdef^^f2{\v n} \gdef^^f3{\'o} @@ -8091,11 +8358,11 @@ should work if nowhere else does.} } % 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 @@ -8245,6 +8512,7 @@ should work if nowhere else does.} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} + \DeclareUnicodeCharacter{00D0}{\DH} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} \DeclareUnicodeCharacter{00D3}{\'O} @@ -8257,6 +8525,7 @@ should work if nowhere else does.} \DeclareUnicodeCharacter{00DB}{\^U} \DeclareUnicodeCharacter{00DC}{\"U} \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DE}{\TH} \DeclareUnicodeCharacter{00DF}{\ss} \DeclareUnicodeCharacter{00E0}{\`a} @@ -8276,6 +8545,7 @@ should work if nowhere else does.} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + \DeclareUnicodeCharacter{00F0}{\dh} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} \DeclareUnicodeCharacter{00F3}{\'o} @@ -8288,16 +8558,21 @@ should work if nowhere else does.} \DeclareUnicodeCharacter{00FB}{\^u} \DeclareUnicodeCharacter{00FC}{\"u} \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FE}{\th} \DeclareUnicodeCharacter{00FF}{\"y} \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0104}{\ogonek{A}} + \DeclareUnicodeCharacter{0105}{\ogonek{a}} \DeclareUnicodeCharacter{0106}{\'C} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{0118}{\ogonek{E}} + \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} @@ -8445,6 +8720,8 @@ should work if nowhere else does.} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} + \DeclareUnicodeCharacter{02DB}{\ogonek{ }} + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} @@ -8826,6 +9103,9 @@ should work if nowhere else does.} \message{and turning on texinfo input format.} +% DEL is a comment character, in case @c does not suffice. +\catcode`\^^? = 14 + % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \catcode`\~=\other @@ -8935,7 +9215,7 @@ should work if nowhere else does.} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. -% +% @def@normalturnoffactive{% @let\=@normalbackslash @let"=@normaldoublequote @@ -8947,6 +9227,8 @@ should work if nowhere else does.} @let>=@normalgreater @let+=@normalplus @let$=@normaldollar %$ font-lock fix + @markupsetuplqdefault + @markupsetuprqdefault @unsepspaces } @@ -8981,9 +9263,21 @@ should work if nowhere else does.} @catcode`@# = @other @catcode`@% = @other +@c Finally, make ` and ' active, so that txicodequoteundirected and +@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we +@c don't make ` and ' active, @code will not get them as active chars. +@c Do this last of all since we use ` in the previous @catcode assignments. +@catcode`@'=@active +@catcode`@`=@active +@markupsetuplqdefault +@markupsetuprqdefault + +@c Gnulib now utterly and painfully insists on no trailing whitespace. +@c So we have to nuke it. @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) +@c eval: (add-hook 'write-file-hooks 'nuke-trailing-whitespace) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" diff -ruNp m4-1.4.12/cfg.mk m4-1.4.13/cfg.mk --- m4-1.4.12/cfg.mk 2008-08-06 23:24:44.000000000 -0600 +++ m4-1.4.13/cfg.mk 2009-03-18 20:13:58.000000000 -0600 @@ -1,5 +1,5 @@ # Customize maint.mk. -*- makefile -*- -# Copyright (C) 2003-2008 Free Software Foundation, Inc. +# Copyright (C) 2003-2009 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,6 +21,9 @@ gnu_ftp_host-beta = alpha.gnu.org gnu_ftp_host-major = ftp.gnu.org gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE)) +# Used in maint.mk's web-manual rule +manual_title = GNU macro processor + url_dir_list = \ ftp://$(gnu_rel_host)/gnu/m4 @@ -35,4 +38,4 @@ local-checks-to-skip = changelog-check # The local directory containing the checked-out copy of gnulib used in this # release. Used solely to get gnulib's SHA1 for the "announcement" target. -gnulib_dir = $(srcdir)/../gnulib +gnulib_dir = $(srcdir)/gnulib diff -ruNp m4-1.4.12/checks/001.preprocess m4-1.4.13/checks/001.preprocess --- m4-1.4.12/checks/001.preprocess 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/001.preprocess 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:691: Origin of test +dnl @ ../doc/m4.texinfo:695: Origin of test dnl @ expected status: 0 dnl @ extra options: -s -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/002.command_li m4-1.4.13/checks/002.command_li --- m4-1.4.12/checks/002.command_li 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/002.command_li 1969-12-31 17:00:00.000000000 -0700 @@ -1,11 +0,0 @@ -dnl @ ../doc/m4.texinfo:913: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -Dbar=hello foo -Dbar=world foo -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -dnl @result{}hello -dnl @result{}world diff -ruNp m4-1.4.12/checks/002.debugging_ m4-1.4.13/checks/002.debugging_ --- m4-1.4.12/checks/002.debugging_ 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/002.debugging_ 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:878: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -Dbar=hello -tbar --debugfile= foo --debugfile - +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +dnl @result{}hello +errprint(`hi +')dnl +dnl @error{}hi +bar +dnl @error{}m4trace: -1- bar -> `hello' +dnl @result{}hello diff -ruNp m4-1.4.12/checks/003.command_li m4-1.4.13/checks/003.command_li --- m4-1.4.12/checks/003.command_li 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/003.command_li 2009-03-21 18:13:11.000000000 -0600 @@ -1,11 +1,11 @@ -dnl @ ../doc/m4.texinfo:936: Origin of test -dnl @ expected status: 1 -dnl @ extra options: Makefile/ -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ ../doc/m4.texinfo:937: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -Dbar=hello foo -Dbar=world foo +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -dnl @ expected error: ignore -dnl @error{}m4: cannot open `Makefile/': Not a directory +dnl @result{}hello +dnl @result{}world diff -ruNp m4-1.4.12/checks/004.command_li m4-1.4.13/checks/004.command_li --- m4-1.4.12/checks/004.command_li 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/004.command_li 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:960: Origin of test +dnl @ expected status: 1 +dnl @ extra options: Makefile/ +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +dnl @ expected error: ignore +dnl @error{}m4: cannot open `Makefile/': Not a directory diff -ruNp m4-1.4.12/checks/004.comments m4-1.4.13/checks/004.comments --- m4-1.4.12/checks/004.comments 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/004.comments 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:1021: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -`quoted text' # `commented text' -dnl @result{}quoted text # `commented text' -`quoting inhibits' `#' `comments' -dnl @result{}quoting inhibits # comments diff -ruNp m4-1.4.12/checks/005.comments m4-1.4.13/checks/005.comments --- m4-1.4.12/checks/005.comments 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/005.comments 2009-03-21 18:13:11.000000000 -0600 @@ -1,23 +1,13 @@ -dnl @ ../doc/m4.texinfo:1036: Origin of test +dnl @ ../doc/m4.texinfo:1045: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`e', `$@')define(`q', ``$@'')define(`foo', `bar') -dnl @result{} -q(e(`one -',#two ' foo -)) -dnl @result{}`one -dnl @result{}',`#two bar -dnl @result{}'' -changecom(`<', `>')define(`n', `$#') -dnl @result{} -n(e(<`>, <'>)) -dnl @result{}1 -len(e(<`>, ,<'>)) -dnl @result{}12 +`quoted text' # `commented text' +dnl @result{}quoted text # `commented text' +`quoting inhibits' `#' `comments' +dnl @result{}quoting inhibits # comments diff -ruNp m4-1.4.12/checks/006.comments m4-1.4.13/checks/006.comments --- m4-1.4.12/checks/006.comments 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/006.comments 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,23 @@ +dnl @ ../doc/m4.texinfo:1060: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`e', `$@')define(`q', ``$@'')define(`foo', `bar') +dnl @result{} +q(e(`one +',#two ' foo +)) +dnl @result{}`one +dnl @result{}',`#two bar +dnl @result{}'' +changecom(`<', `>')define(`n', `$#') +dnl @result{} +n(e(<`>, <'>)) +dnl @result{}1 +len(e(<`>, ,<'>)) +dnl @result{}12 diff -ruNp m4-1.4.12/checks/006.input_proc m4-1.4.13/checks/006.input_proc --- m4-1.4.12/checks/006.input_proc 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/006.input_proc 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:1128: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -changequote([,])dnl -define([gl_STRING_MODULE_INDICATOR], - [ - dnl comment - GNULIB_]translit([$1],[a-z],[A-Z])[=1 - ])dnl - gl_STRING_MODULE_INDICATOR([strcase]) -dnl @result{} -dnl @result{} GNULIB_strcase=1 -dnl @result{} diff -ruNp m4-1.4.12/checks/007.input_proc m4-1.4.13/checks/007.input_proc --- m4-1.4.12/checks/007.input_proc 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/007.input_proc 2009-03-21 18:13:11.000000000 -0600 @@ -1,16 +1,19 @@ -dnl @ ../doc/m4.texinfo:1204: Origin of test +dnl @ ../doc/m4.texinfo:1152: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. changequote([,])dnl define([gl_STRING_MODULE_INDICATOR], - [dnl comment - GNULIB_[]translit([$1], [a-z], [A-Z])=1dnl -])dnl + [ + dnl comment + GNULIB_]translit([$1],[a-z],[A-Z])[=1 + ])dnl gl_STRING_MODULE_INDICATOR([strcase]) -dnl @result{} GNULIB_STRCASE=1 +dnl @result{} +dnl @result{} GNULIB_strcase=1 +dnl @result{} diff -ruNp m4-1.4.12/checks/008.inhibiting m4-1.4.13/checks/008.inhibiting --- m4-1.4.12/checks/008.inhibiting 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/008.inhibiting 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:1329: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -eval -dnl @result{}eval -eval(`1') -dnl @result{}1 diff -ruNp m4-1.4.12/checks/008.input_proc m4-1.4.13/checks/008.input_proc --- m4-1.4.12/checks/008.input_proc 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/008.input_proc 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:1228: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +changequote([,])dnl +define([gl_STRING_MODULE_INDICATOR], + [dnl comment + GNULIB_[]translit([$1], [a-z], [A-Z])=1dnl +])dnl + gl_STRING_MODULE_INDICATOR([strcase]) +dnl @result{} GNULIB_STRCASE=1 diff -ruNp m4-1.4.12/checks/009.inhibiting m4-1.4.13/checks/009.inhibiting --- m4-1.4.12/checks/009.inhibiting 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/009.inhibiting 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:1345: Origin of test +dnl @ ../doc/m4.texinfo:1353: Origin of test dnl @ expected status: 0 -dnl @ extra options: -P -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 @@ -10,8 +10,4 @@ dnl @ is preserved. eval dnl @result{}eval eval(`1') -dnl @result{}eval(1) -m4_eval -dnl @result{}m4_eval -m4_eval(`1') dnl @result{}1 diff -ruNp m4-1.4.12/checks/010.inhibiting m4-1.4.13/checks/010.inhibiting --- m4-1.4.12/checks/010.inhibiting 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/010.inhibiting 2009-03-21 18:13:11.000000000 -0600 @@ -1,17 +1,17 @@ -dnl @ ../doc/m4.texinfo:1376: Origin of test +dnl @ ../doc/m4.texinfo:1369: Origin of test dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: -P +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -`divert' -dnl @result{}divert -`d'ivert -dnl @result{}divert -di`ver't -dnl @result{}divert -div`'ert -dnl @result{}divert +eval +dnl @result{}eval +eval(`1') +dnl @result{}eval(1) +m4_eval +dnl @result{}m4_eval +m4_eval(`1') +dnl @result{}1 diff -ruNp m4-1.4.12/checks/011.inhibiting m4-1.4.13/checks/011.inhibiting --- m4-1.4.12/checks/011.inhibiting 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/011.inhibiting 2009-03-21 18:13:11.000000000 -0600 @@ -1,13 +1,17 @@ -dnl @ ../doc/m4.texinfo:1390: Origin of test +dnl @ ../doc/m4.texinfo:1400: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -`'divert -dnl @result{} -divert`' -dnl @result{} +`divert' +dnl @result{}divert +`d'ivert +dnl @result{}divert +di`ver't +dnl @result{}divert +div`'ert +dnl @result{}divert diff -ruNp m4-1.4.12/checks/012.inhibiting m4-1.4.13/checks/012.inhibiting --- m4-1.4.12/checks/012.inhibiting 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/012.inhibiting 2009-03-21 18:13:11.000000000 -0600 @@ -1,17 +1,13 @@ -dnl @ ../doc/m4.texinfo:1407: Origin of test +dnl @ ../doc/m4.texinfo:1414: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`cde', `CDE') +`'divert dnl @result{} -define(`x', `substr(ab') +divert`' dnl @result{} -define(`y', `cde, `1', `3')') -dnl @result{} -x`'y -dnl @result{}bCD diff -ruNp m4-1.4.12/checks/013.inhibiting m4-1.4.13/checks/013.inhibiting --- m4-1.4.12/checks/013.inhibiting 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/013.inhibiting 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,17 @@ -dnl @ ../doc/m4.texinfo:1421: Origin of test +dnl @ ../doc/m4.texinfo:1431: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`x1', `len(`$1'') +define(`cde', `CDE') dnl @result{} -define(`y1', ``$1')') +define(`x', `substr(ab') dnl @result{} -x1(`01234567890123456789')y1(`98765432109876543210') -dnl @result{}40 +define(`y', `cde, `1', `3')') +dnl @result{} +x`'y +dnl @result{}bCD diff -ruNp m4-1.4.12/checks/014.inhibiting m4-1.4.13/checks/014.inhibiting --- m4-1.4.12/checks/014.inhibiting 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/014.inhibiting 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,15 @@ -dnl @ ../doc/m4.texinfo:1435: Origin of test +dnl @ ../doc/m4.texinfo:1445: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`macro', `m') +define(`x1', `len(`$1'') dnl @result{} -macro(`m')macro -dnl @result{}mmacro -macro(`m')`'macro -dnl @result{}mm +define(`y1', ``$1')') +dnl @result{} +x1(`01234567890123456789')y1(`98765432109876543210') +dnl @result{}40 diff -ruNp m4-1.4.12/checks/015.inhibiting m4-1.4.13/checks/015.inhibiting --- m4-1.4.12/checks/015.inhibiting 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/015.inhibiting 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,15 @@ -dnl @ ../doc/m4.texinfo:1447: Origin of test +dnl @ ../doc/m4.texinfo:1459: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`macro', `di$1') -dnl @result{} -macro(`v')`ert' -dnl @result{}divert -macro(`v')ert +define(`macro', `m') dnl @result{} +macro(`m')macro +dnl @result{}mmacro +macro(`m')`'macro +dnl @result{}mm diff -ruNp m4-1.4.12/checks/016.inhibiting m4-1.4.13/checks/016.inhibiting --- m4-1.4.12/checks/016.inhibiting 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/016.inhibiting 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:1471: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`macro', `di$1') +dnl @result{} +macro(`v')`ert' +dnl @result{}divert +macro(`v')ert +dnl @result{} diff -ruNp m4-1.4.12/checks/016.macro_argu m4-1.4.13/checks/016.macro_argu --- m4-1.4.12/checks/016.macro_argu 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/016.macro_argu 1969-12-31 17:00:00.000000000 -0700 @@ -1,26 +0,0 @@ -dnl @ ../doc/m4.texinfo:1479: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`macro', `$1') -dnl @result{} -macro( unquoted leading space lost) -dnl @result{}unquoted leading space lost -macro(` quoted leading space kept') -dnl @result{} quoted leading space kept -macro( - divert `unquoted space kept after expansion') -dnl @result{} unquoted space kept after expansion -macro(macro(` -')`whitespace from expansion kept') -dnl @result{} -dnl @result{}whitespace from expansion kept -macro(`unquoted trailing whitespace kept' -) -dnl @result{}unquoted trailing whitespace kept -dnl @result{} diff -ruNp m4-1.4.12/checks/017.macro_argu m4-1.4.13/checks/017.macro_argu --- m4-1.4.12/checks/017.macro_argu 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/017.macro_argu 2009-03-21 18:13:11.000000000 -0600 @@ -1,17 +1,26 @@ -dnl @ ../doc/m4.texinfo:1507: Origin of test +dnl @ ../doc/m4.texinfo:1503: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -index(`abc') -dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `index' -dnl @result{}0 -index(`abc',) -dnl @result{}0 -index(`abc', `b', `ignored') -dnl @error{}m4:stdin:3: Warning: excess arguments to builtin `index' ignored -dnl @result{}1 +define(`macro', `$1') +dnl @result{} +macro( unquoted leading space lost) +dnl @result{}unquoted leading space lost +macro(` quoted leading space kept') +dnl @result{} quoted leading space kept +macro( + divert `unquoted space kept after expansion') +dnl @result{} unquoted space kept after expansion +macro(macro(` +')`whitespace from expansion kept') +dnl @result{} +dnl @result{}whitespace from expansion kept +macro(`unquoted trailing whitespace kept' +) +dnl @result{}unquoted trailing whitespace kept +dnl @result{} diff -ruNp m4-1.4.12/checks/018.macro_argu m4-1.4.13/checks/018.macro_argu --- m4-1.4.12/checks/018.macro_argu 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/018.macro_argu 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,17 @@ -dnl @ ../doc/m4.texinfo:1520: Origin of test +dnl @ ../doc/m4.texinfo:1531: Origin of test dnl @ expected status: 0 -dnl @ extra options: -Q -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. index(`abc') +dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `index' dnl @result{}0 index(`abc',) dnl @result{}0 index(`abc', `b', `ignored') +dnl @error{}m4:stdin:3: Warning: excess arguments to builtin `index' ignored dnl @result{}1 diff -ruNp m4-1.4.12/checks/019.macro_argu m4-1.4.13/checks/019.macro_argu --- m4-1.4.12/checks/019.macro_argu 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/019.macro_argu 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,15 @@ -dnl @ ../doc/m4.texinfo:1550: Origin of test +dnl @ ../doc/m4.texinfo:1544: Origin of test dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: -Q +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`f', `1') -dnl @result{} -f(define(`f', `2')) +index(`abc') +dnl @result{}0 +index(`abc',) +dnl @result{}0 +index(`abc', `b', `ignored') dnl @result{}1 -f -dnl @result{}2 diff -ruNp m4-1.4.12/checks/020.macro_argu m4-1.4.13/checks/020.macro_argu --- m4-1.4.12/checks/020.macro_argu 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/020.macro_argu 2009-03-21 18:13:11.000000000 -0600 @@ -1,13 +1,15 @@ -dnl @ ../doc/m4.texinfo:1562: Origin of test -dnl @ expected status: 1 +dnl @ ../doc/m4.texinfo:1574: Origin of test +dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -hello world -dnl @result{}hello world -define( -dnl @error{}m4:stdin:2: ERROR: end of file in argument list +define(`f', `1') +dnl @result{} +f(define(`f', `2')) +dnl @result{}1 +f +dnl @result{}2 diff -ruNp m4-1.4.12/checks/021.macro_argu m4-1.4.13/checks/021.macro_argu --- m4-1.4.12/checks/021.macro_argu 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/021.macro_argu 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1586: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +hello world +dnl @result{}hello world +define( +dnl @error{}m4:stdin:2: ERROR: end of file in argument list diff -ruNp m4-1.4.12/checks/021.quoting_ar m4-1.4.13/checks/021.quoting_ar --- m4-1.4.12/checks/021.quoting_ar 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/021.quoting_ar 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:1621: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`active', `ACT, IVE') -dnl @result{} -define(`show', `$1 $1') -dnl @result{} -show(active) -dnl @result{}ACT ACT -show(`active') -dnl @result{}ACT, IVE ACT, IVE -show(``active'') -dnl @result{}active active diff -ruNp m4-1.4.12/checks/022.macro_expa m4-1.4.13/checks/022.macro_expa --- m4-1.4.12/checks/022.macro_expa 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/022.macro_expa 1969-12-31 17:00:00.000000000 -0700 @@ -1,11 +0,0 @@ -dnl @ ../doc/m4.texinfo:1649: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -Dbar=Hello -Dfoo=bar -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -foo -dnl @result{}Hello diff -ruNp m4-1.4.12/checks/022.quoting_ar m4-1.4.13/checks/022.quoting_ar --- m4-1.4.12/checks/022.quoting_ar 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/022.quoting_ar 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:1645: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`active', `ACT, IVE') +dnl @result{} +define(`show', `$1 $1') +dnl @result{} +show(active) +dnl @result{}ACT ACT +show(`active') +dnl @result{}ACT, IVE ACT, IVE +show(``active'') +dnl @result{}active active diff -ruNp m4-1.4.12/checks/023.macro_expa m4-1.4.13/checks/023.macro_expa --- m4-1.4.12/checks/023.macro_expa 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/023.macro_expa 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,11 @@ -dnl @ ../doc/m4.texinfo:1664: Origin of test +dnl @ ../doc/m4.texinfo:1673: Origin of test dnl @ expected status: 0 -dnl @ extra options: -Dfoo -Decho=$@ -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: -Dbar=Hello -Dfoo=bar +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. foo -dnl @result{} -foo(`silently ignored') -dnl @result{} -echo(`1', `2') -dnl @result{}1,2 +dnl @result{}Hello diff -ruNp m4-1.4.12/checks/024.define m4-1.4.13/checks/024.define --- m4-1.4.12/checks/024.define 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/024.define 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:1713: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `Hello world.') -dnl @result{} -foo -dnl @result{}Hello world. diff -ruNp m4-1.4.12/checks/024.macro_expa m4-1.4.13/checks/024.macro_expa --- m4-1.4.12/checks/024.macro_expa 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/024.macro_expa 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:1688: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -Dfoo -Decho=$@ +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +foo +dnl @result{} +foo(`silently ignored') +dnl @result{} +echo(`1', `2') +dnl @result{}1,2 diff -ruNp m4-1.4.12/checks/025.define m4-1.4.13/checks/025.define --- m4-1.4.12/checks/025.define 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/025.define 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,13 @@ -dnl @ ../doc/m4.texinfo:1730: Origin of test +dnl @ ../doc/m4.texinfo:1737: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(foo, one) +define(`foo', `Hello world.') dnl @result{} -define(foo, two) -dnl @result{} -one -dnl @result{}two +foo +dnl @result{}Hello world. diff -ruNp m4-1.4.12/checks/026.define m4-1.4.13/checks/026.define --- m4-1.4.12/checks/026.define 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/026.define 2009-03-21 18:13:11.000000000 -0600 @@ -1,21 +1,15 @@ -dnl @ ../doc/m4.texinfo:1764: Origin of test +dnl @ ../doc/m4.texinfo:1754: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`array', `defn(format(``array[%d]'', `$1'))') +define(foo, one) dnl @result{} -define(`array_set', `define(format(``array[%d]'', `$1'), `$2')') +define(foo, two) dnl @result{} -array_set(`4', `array element no. 4') -dnl @result{} -array_set(`17', `array element no. 17') -dnl @result{} -array(`4') -dnl @result{}array element no. 4 -array(eval(`10 + 7')) -dnl @result{}array element no. 17 +one +dnl @result{}two diff -ruNp m4-1.4.12/checks/027.arguments m4-1.4.13/checks/027.arguments --- m4-1.4.12/checks/027.arguments 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/027.arguments 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:1798: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`exch', `$2, $1') -dnl @result{} -exch(`arg1', `arg2') -dnl @result{}arg2, arg1 diff -ruNp m4-1.4.12/checks/027.define m4-1.4.13/checks/027.define --- m4-1.4.12/checks/027.define 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/027.define 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:1788: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`array', `defn(format(``array[%d]'', `$1'))') +dnl @result{} +define(`array_set', `define(format(``array[%d]'', `$1'), `$2')') +dnl @result{} +array_set(`4', `array element no. 4') +dnl @result{} +array_set(`17', `array element no. 17') +dnl @result{} +array(`4') +dnl @result{}array element no. 4 +array(eval(`10 + 7')) +dnl @result{}array element no. 17 diff -ruNp m4-1.4.12/checks/028.arguments m4-1.4.13/checks/028.arguments --- m4-1.4.12/checks/028.arguments 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/028.arguments 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,13 @@ -dnl @ ../doc/m4.texinfo:1808: Origin of test +dnl @ ../doc/m4.texinfo:1822: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. define(`exch', `$2, $1') dnl @result{} -define(exch(``expansion text'', ``macro'')) -dnl @result{} -macro -dnl @result{}expansion text +exch(`arg1', `arg2') +dnl @result{}arg2, arg1 diff -ruNp m4-1.4.12/checks/029.arguments m4-1.4.13/checks/029.arguments --- m4-1.4.12/checks/029.arguments 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/029.arguments 2009-03-21 18:13:11.000000000 -0600 @@ -1,13 +1,15 @@ -dnl @ ../doc/m4.texinfo:1824: Origin of test +dnl @ ../doc/m4.texinfo:1832: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`test', ``Macro name: $0'') +define(`exch', `$2, $1') dnl @result{} -test -dnl @result{}Macro name: test +define(exch(``expansion text'', ``macro'')) +dnl @result{} +macro +dnl @result{}expansion text diff -ruNp m4-1.4.12/checks/030.arguments m4-1.4.13/checks/030.arguments --- m4-1.4.12/checks/030.arguments 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/030.arguments 2009-03-21 18:13:11.000000000 -0600 @@ -1,13 +1,13 @@ -dnl @ ../doc/m4.texinfo:1834: Origin of test +dnl @ ../doc/m4.texinfo:1848: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`foo', `This is macro `foo'.') +define(`test', ``Macro name: $0'') dnl @result{} -foo -dnl @result{}This is macro foo. +test +dnl @result{}Macro name: test diff -ruNp m4-1.4.12/checks/031.arguments m4-1.4.13/checks/031.arguments --- m4-1.4.12/checks/031.arguments 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/031.arguments 2009-03-21 18:13:11.000000000 -0600 @@ -1,17 +1,13 @@ -dnl @ ../doc/m4.texinfo:1869: Origin of test +dnl @ ../doc/m4.texinfo:1858: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`foo', `single quoted $`'{1} output') +define(`foo', `This is macro `foo'.') dnl @result{} -define(`bar', ``double quoted $'`{2} output'') -dnl @result{} -foo(`a', `b') -dnl @result{}single quoted ${1} output -bar(`a', `b') -dnl @result{}double quoted ${2} output +foo +dnl @result{}This is macro foo. diff -ruNp m4-1.4.12/checks/032.arguments m4-1.4.13/checks/032.arguments --- m4-1.4.12/checks/032.arguments 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/032.arguments 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,17 @@ -dnl @ ../doc/m4.texinfo:1891: Origin of test +dnl @ ../doc/m4.texinfo:1893: Origin of test dnl @ expected status: 0 -dnl @ extra options: --warn-macro-sequence -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`foo', `$001 ${1} $1') -dnl @error{}m4:stdin:1: Warning: definition of `foo' contains sequence `$001' -dnl @error{}m4:stdin:1: Warning: definition of `foo' contains sequence `${1}' +define(`foo', `single quoted $`'{1} output') dnl @result{} -foo(`bar') -dnl @result{}bar ${1} bar +define(`bar', ``double quoted $'`{2} output'') +dnl @result{} +foo(`a', `b') +dnl @result{}single quoted ${1} output +bar(`a', `b') +dnl @result{}double quoted ${2} output diff -ruNp m4-1.4.12/checks/033.arguments m4-1.4.13/checks/033.arguments --- m4-1.4.12/checks/033.arguments 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/033.arguments 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:1915: Origin of test +dnl @ expected status: 0 +dnl @ extra options: --warn-macro-sequence +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `$001 ${1} $1') +dnl @error{}m4:stdin:1: Warning: definition of `foo' contains sequence `$001' +dnl @error{}m4:stdin:1: Warning: definition of `foo' contains sequence `${1}' +dnl @result{} +foo(`bar') +dnl @result{}bar ${1} bar diff -ruNp m4-1.4.12/checks/033.pseudo_arg m4-1.4.13/checks/033.pseudo_arg --- m4-1.4.12/checks/033.pseudo_arg 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/033.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 @@ -1,24 +0,0 @@ -dnl @ ../doc/m4.texinfo:1917: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`nargs', `$#') -dnl @result{} -nargs -dnl @result{}0 -nargs() -dnl @result{}1 -nargs(`arg1', `arg2', `arg3') -dnl @result{}3 -nargs(`commas can be quoted, like this') -dnl @result{}1 -nargs(arg1#inside comments, commas do not separate arguments -still arg1) -dnl @result{}1 -nargs((unquoted parentheses, like this, group arguments)) -dnl @result{}1 diff -ruNp m4-1.4.12/checks/034.pseudo_arg m4-1.4.13/checks/034.pseudo_arg --- m4-1.4.12/checks/034.pseudo_arg 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/034.pseudo_arg 2009-03-21 18:13:11.000000000 -0600 @@ -1,16 +1,24 @@ -dnl @ ../doc/m4.texinfo:1939: Origin of test +dnl @ ../doc/m4.texinfo:1941: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -dnl Attempt to define a macro to just `$#' -define(underquoted, $#) -oops) +define(`nargs', `$#') dnl @result{} -underquoted -dnl @result{}0) -dnl @result{}oops +nargs +dnl @result{}0 +nargs() +dnl @result{}1 +nargs(`arg1', `arg2', `arg3') +dnl @result{}3 +nargs(`commas can be quoted, like this') +dnl @result{}1 +nargs(arg1#inside comments, commas do not separate arguments +still arg1) +dnl @result{}1 +nargs((unquoted parentheses, like this, group arguments)) +dnl @result{}1 diff -ruNp m4-1.4.12/checks/035.pseudo_arg m4-1.4.13/checks/035.pseudo_arg --- m4-1.4.12/checks/035.pseudo_arg 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/035.pseudo_arg 2009-03-21 18:13:11.000000000 -0600 @@ -1,13 +1,16 @@ -dnl @ ../doc/m4.texinfo:1952: Origin of test +dnl @ ../doc/m4.texinfo:1963: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`echo', `$*') +dnl Attempt to define a macro to just `$#' +define(underquoted, $#) +oops) dnl @result{} -echo(arg1, arg2, arg3 , arg4) -dnl @result{}arg1,arg2,arg3 ,arg4 +underquoted +dnl @result{}0) +dnl @result{}oops diff -ruNp m4-1.4.12/checks/036.pseudo_arg m4-1.4.13/checks/036.pseudo_arg --- m4-1.4.12/checks/036.pseudo_arg 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/036.pseudo_arg 2009-03-21 18:13:11.000000000 -0600 @@ -1,13 +1,13 @@ -dnl @ ../doc/m4.texinfo:1963: Origin of test +dnl @ ../doc/m4.texinfo:1976: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`echo', `$@') +define(`echo', `$*') dnl @result{} echo(arg1, arg2, arg3 , arg4) dnl @result{}arg1,arg2,arg3 ,arg4 diff -ruNp m4-1.4.12/checks/037.pseudo_arg m4-1.4.13/checks/037.pseudo_arg --- m4-1.4.12/checks/037.pseudo_arg 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/037.pseudo_arg 2009-03-21 18:13:11.000000000 -0600 @@ -1,23 +1,13 @@ -dnl @ ../doc/m4.texinfo:1973: Origin of test +dnl @ ../doc/m4.texinfo:1987: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`echo1', `$*') +define(`echo', `$@') dnl @result{} -define(`echo2', `$@') -dnl @result{} -define(`foo', `This is macro `foo'.') -dnl @result{} -echo1(foo) -dnl @result{}This is macro This is macro foo.. -echo1(`foo') -dnl @result{}This is macro foo. -echo2(foo) -dnl @result{}This is macro foo. -echo2(`foo') -dnl @result{}foo +echo(arg1, arg2, arg3 , arg4) +dnl @result{}arg1,arg2,arg3 ,arg4 diff -ruNp m4-1.4.12/checks/038.pseudo_arg m4-1.4.13/checks/038.pseudo_arg --- m4-1.4.12/checks/038.pseudo_arg 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/038.pseudo_arg 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:1995: Origin of test +dnl @ ../doc/m4.texinfo:1997: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 @@ -11,13 +11,13 @@ define(`echo1', `$*') dnl @result{} define(`echo2', `$@') dnl @result{} -define(`foo', `bar') +define(`foo', `This is macro `foo'.') dnl @result{} -echo1(#foo'foo -foo) -dnl @result{}#foo'foo -dnl @result{}bar -echo2(#foo'foo -foo) -dnl @result{}#foobar -dnl @result{}bar' +echo1(foo) +dnl @result{}This is macro This is macro foo.. +echo1(`foo') +dnl @result{}This is macro foo. +echo2(foo) +dnl @result{}This is macro foo. +echo2(`foo') +dnl @result{}foo diff -ruNp m4-1.4.12/checks/039.pseudo_arg m4-1.4.13/checks/039.pseudo_arg --- m4-1.4.12/checks/039.pseudo_arg 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/039.pseudo_arg 2009-03-21 18:13:11.000000000 -0600 @@ -1,29 +1,23 @@ -dnl @ ../doc/m4.texinfo:2017: Origin of test +dnl @ ../doc/m4.texinfo:2019: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`echo', `$@')dnl -echo(echo(`01234567890123456789', `01234567890123456789') -echo(`98765432109876543210', `98765432109876543210')) -dnl @result{}01234567890123456789,01234567890123456789 -dnl @result{}98765432109876543210,98765432109876543210 -len((echo(`01234567890123456789', - `01234567890123456789')echo(`98765432109876543210', - `98765432109876543210'))) -dnl @result{}84 -indir(`echo', indir(`echo', `01234567890123456789', - `01234567890123456789') -indir(`echo', `98765432109876543210', `98765432109876543210')) -dnl @result{}01234567890123456789,01234567890123456789 -dnl @result{}98765432109876543210,98765432109876543210 -define(`argn', `$#')dnl -define(`echo1', `-$@-')define(`echo2', `,$@,')dnl -echo1(`1', `2', `3') argn(echo1(`1', `2', `3')) -dnl @result{}-1,2,3- 3 -echo2(`1', `2', `3') argn(echo2(`1', `2', `3')) -dnl @result{},1,2,3, 5 +define(`echo1', `$*') +dnl @result{} +define(`echo2', `$@') +dnl @result{} +define(`foo', `bar') +dnl @result{} +echo1(#foo'foo +foo) +dnl @result{}#foo'foo +dnl @result{}bar +echo2(#foo'foo +foo) +dnl @result{}#foobar +dnl @result{}bar' diff -ruNp m4-1.4.12/checks/040.pseudo_arg m4-1.4.13/checks/040.pseudo_arg --- m4-1.4.12/checks/040.pseudo_arg 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/040.pseudo_arg 2009-03-21 18:13:11.000000000 -0600 @@ -1,13 +1,29 @@ -dnl @ ../doc/m4.texinfo:2045: Origin of test +dnl @ ../doc/m4.texinfo:2041: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`foo', `$$$ hello $$$') -dnl @result{} -foo -dnl @result{}$$$ hello $$$ +define(`echo', `$@')dnl +echo(echo(`01234567890123456789', `01234567890123456789') +echo(`98765432109876543210', `98765432109876543210')) +dnl @result{}01234567890123456789,01234567890123456789 +dnl @result{}98765432109876543210,98765432109876543210 +len((echo(`01234567890123456789', + `01234567890123456789')echo(`98765432109876543210', + `98765432109876543210'))) +dnl @result{}84 +indir(`echo', indir(`echo', `01234567890123456789', + `01234567890123456789') +indir(`echo', `98765432109876543210', `98765432109876543210')) +dnl @result{}01234567890123456789,01234567890123456789 +dnl @result{}98765432109876543210,98765432109876543210 +define(`argn', `$#')dnl +define(`echo1', `-$@-')define(`echo2', `,$@,')dnl +echo1(`1', `2', `3') argn(echo1(`1', `2', `3')) +dnl @result{}-1,2,3- 3 +echo2(`1', `2', `3') argn(echo2(`1', `2', `3')) +dnl @result{},1,2,3, 5 diff -ruNp m4-1.4.12/checks/041.pseudo_arg m4-1.4.13/checks/041.pseudo_arg --- m4-1.4.12/checks/041.pseudo_arg 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/041.pseudo_arg 2009-03-21 18:13:11.000000000 -0600 @@ -1,29 +1,13 @@ -dnl @ ../doc/m4.texinfo:2061: Origin of test +dnl @ ../doc/m4.texinfo:2069: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`foo', `no nested quote: $1') +define(`foo', `$$$ hello $$$') dnl @result{} -foo(`arg') -dnl @result{}no nested quote: arg -define(`foo', `nested quote around $: `$'1') -dnl @result{} -foo(`arg') -dnl @result{}nested quote around $: $1 -define(`foo', `nested empty quote after $: $`'1') -dnl @result{} -foo(`arg') -dnl @result{}nested empty quote after $: $1 -define(`foo', `nested quote around next character: $`1'') -dnl @result{} -foo(`arg') -dnl @result{}nested quote around next character: $1 -define(`foo', `nested quote around both: `$1'') -dnl @result{} -foo(`arg') -dnl @result{}nested quote around both: arg +foo +dnl @result{}$$$ hello $$$ diff -ruNp m4-1.4.12/checks/042.pseudo_arg m4-1.4.13/checks/042.pseudo_arg --- m4-1.4.12/checks/042.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/042.pseudo_arg 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,29 @@ +dnl @ ../doc/m4.texinfo:2085: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `no nested quote: $1') +dnl @result{} +foo(`arg') +dnl @result{}no nested quote: arg +define(`foo', `nested quote around $: `$'1') +dnl @result{} +foo(`arg') +dnl @result{}nested quote around $: $1 +define(`foo', `nested empty quote after $: $`'1') +dnl @result{} +foo(`arg') +dnl @result{}nested empty quote after $: $1 +define(`foo', `nested quote around next character: $`1'') +dnl @result{} +foo(`arg') +dnl @result{}nested quote around next character: $1 +define(`foo', `nested quote around both: `$1'') +dnl @result{} +foo(`arg') +dnl @result{}nested quote around both: arg diff -ruNp m4-1.4.12/checks/042.undefine m4-1.4.13/checks/042.undefine --- m4-1.4.12/checks/042.undefine 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/042.undefine 1969-12-31 17:00:00.000000000 -0700 @@ -1,23 +0,0 @@ -dnl @ ../doc/m4.texinfo:2100: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -foo bar blah -dnl @result{}foo bar blah -define(`foo', `some')define(`bar', `other')define(`blah', `text') -dnl @result{} -foo bar blah -dnl @result{}some other text -undefine(`foo') -dnl @result{} -foo bar blah -dnl @result{}foo other text -undefine(`bar', `blah') -dnl @result{} -foo bar blah -dnl @result{}foo bar blah diff -ruNp m4-1.4.12/checks/043.undefine m4-1.4.13/checks/043.undefine --- m4-1.4.12/checks/043.undefine 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/043.undefine 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,23 @@ -dnl @ ../doc/m4.texinfo:2120: Origin of test +dnl @ ../doc/m4.texinfo:2124: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`f', ``$0':$1') +foo bar blah +dnl @result{}foo bar blah +define(`foo', `some')define(`bar', `other')define(`blah', `text') dnl @result{} -f(f(f(undefine(`f')`hello world'))) -dnl @result{}f:f:f:hello world -f(`bye') -dnl @result{}f(bye) +foo bar blah +dnl @result{}some other text +undefine(`foo') +dnl @result{} +foo bar blah +dnl @result{}foo other text +undefine(`bar', `blah') +dnl @result{} +foo bar blah +dnl @result{}foo bar blah diff -ruNp m4-1.4.12/checks/044.defn m4-1.4.13/checks/044.defn --- m4-1.4.12/checks/044.defn 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/044.defn 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:2163: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`zap', defn(`undefine')) -dnl @result{} -zap(`undefine') -dnl @result{} -undefine(`zap') -dnl @result{}undefine(zap) diff -ruNp m4-1.4.12/checks/044.undefine m4-1.4.13/checks/044.undefine --- m4-1.4.12/checks/044.undefine 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/044.undefine 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:2144: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`f', ``$0':$1') +dnl @result{} +f(f(f(undefine(`f')`hello world'))) +dnl @result{}f:f:f:hello world +f(`bye') +dnl @result{}f(bye) diff -ruNp m4-1.4.12/checks/045.defn m4-1.4.13/checks/045.defn --- m4-1.4.12/checks/045.defn 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/045.defn 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,15 @@ -dnl @ ../doc/m4.texinfo:2180: Origin of test +dnl @ ../doc/m4.texinfo:2187: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`foo', `This is `$0'') +define(`zap', defn(`undefine')) dnl @result{} -define(`bar', defn(`foo')) +zap(`undefine') dnl @result{} -bar -dnl @result{}This is bar +undefine(`zap') +dnl @result{}undefine(zap) diff -ruNp m4-1.4.12/checks/046.defn m4-1.4.13/checks/046.defn --- m4-1.4.12/checks/046.defn 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/046.defn 2009-03-21 18:13:11.000000000 -0600 @@ -1,17 +1,15 @@ -dnl @ ../doc/m4.texinfo:2192: Origin of test +dnl @ ../doc/m4.texinfo:2204: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`string', `The macro dnl is very useful -') +define(`foo', `This is `$0'') dnl @result{} -string -dnl @result{}The macro -defn(`string') -dnl @result{}The macro dnl is very useful +define(`bar', defn(`foo')) dnl @result{} +bar +dnl @result{}This is bar diff -ruNp m4-1.4.12/checks/047.defn m4-1.4.13/checks/047.defn --- m4-1.4.12/checks/047.defn 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/047.defn 2009-03-21 18:13:11.000000000 -0600 @@ -1,21 +1,17 @@ -dnl @ ../doc/m4.texinfo:2211: Origin of test +dnl @ ../doc/m4.texinfo:2216: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`foo', a'a) +define(`string', `The macro dnl is very useful +') dnl @result{} -define(`a', `A') +string +dnl @result{}The macro +defn(`string') +dnl @result{}The macro dnl is very useful dnl @result{} -define(`echo', `$@') -dnl @result{} -foo -dnl @result{}A'A -defn(`foo') -dnl @result{}aA' -echo(foo) -dnl @result{}AA' diff -ruNp m4-1.4.12/checks/048.defn m4-1.4.13/checks/048.defn --- m4-1.4.12/checks/048.defn 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/048.defn 2009-03-21 18:13:11.000000000 -0600 @@ -1,19 +1,21 @@ dnl @ ../doc/m4.texinfo:2235: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`l', `<[>')define(`r', `<]>') +define(`foo', a'a) dnl @result{} -changequote(`[', `]') +define(`a', `A') dnl @result{} -defn([l])defn([r]) -]) -dnl @result{}<[>]defn([r]) -dnl @result{}) -defn([l], [r]) -dnl @result{}<[>][<]> +define(`echo', `$@') +dnl @result{} +foo +dnl @result{}A'A +defn(`foo') +dnl @result{}aA' +echo(foo) +dnl @result{}AA' diff -ruNp m4-1.4.12/checks/049.defn m4-1.4.13/checks/049.defn --- m4-1.4.12/checks/049.defn 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/049.defn 2009-03-21 18:13:11.000000000 -0600 @@ -1,18 +1,19 @@ -dnl @ ../doc/m4.texinfo:2254: Origin of test +dnl @ ../doc/m4.texinfo:2259: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -defn(`defn') +define(`l', `<[>')define(`r', `<]>') dnl @result{} -define(defn(`divnum'), `cannot redefine a builtin token') -dnl @error{}m4:stdin:2: Warning: define: invalid macro name ignored +changequote(`[', `]') dnl @result{} -divnum -dnl @result{}0 -len(defn(`divnum')) -dnl @result{}0 +defn([l])defn([r]) +]) +dnl @result{}<[>]defn([r]) +dnl @result{}) +defn([l], [r]) +dnl @result{}<[>][<]> diff -ruNp m4-1.4.12/checks/050.defn m4-1.4.13/checks/050.defn --- m4-1.4.12/checks/050.defn 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/050.defn 2009-03-21 18:13:11.000000000 -0600 @@ -1,25 +1,18 @@ -dnl @ ../doc/m4.texinfo:2271: Origin of test +dnl @ ../doc/m4.texinfo:2278: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`a', `A')define(`AA', `b') +defn(`defn') dnl @result{} -traceon(`defn', `define') -dnl @result{} -defn(`a', `divnum', `a') -dnl @error{}m4:stdin:3: Warning: cannot concatenate builtin `divnum' -dnl @error{}m4trace: -1- defn(`a', `divnum', `a') -> ``A'`A'' -dnl @result{}AA -define(`mydivnum', defn(`divnum', `divnum'))mydivnum -dnl @error{}m4:stdin:4: Warning: cannot concatenate builtin `divnum' -dnl @error{}m4:stdin:4: Warning: cannot concatenate builtin `divnum' -dnl @error{}m4trace: -2- defn(`divnum', `divnum') -dnl @error{}m4trace: -1- define(`mydivnum', `') -dnl @result{} -traceoff(`defn', `define') +define(defn(`divnum'), `cannot redefine a builtin token') +dnl @error{}m4:stdin:2: Warning: define: invalid macro name ignored dnl @result{} +divnum +dnl @result{}0 +len(defn(`divnum')) +dnl @result{}0 diff -ruNp m4-1.4.12/checks/051.defn m4-1.4.13/checks/051.defn --- m4-1.4.12/checks/051.defn 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/051.defn 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,25 @@ +dnl @ ../doc/m4.texinfo:2295: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`a', `A')define(`AA', `b') +dnl @result{} +traceon(`defn', `define') +dnl @result{} +defn(`a', `divnum', `a') +dnl @error{}m4:stdin:3: Warning: cannot concatenate builtin `divnum' +dnl @error{}m4trace: -1- defn(`a', `divnum', `a') -> ``A'`A'' +dnl @result{}AA +define(`mydivnum', defn(`divnum', `divnum'))mydivnum +dnl @error{}m4:stdin:4: Warning: cannot concatenate builtin `divnum' +dnl @error{}m4:stdin:4: Warning: cannot concatenate builtin `divnum' +dnl @error{}m4trace: -2- defn(`divnum', `divnum') +dnl @error{}m4trace: -1- define(`mydivnum', `') +dnl @result{} +traceoff(`defn', `define') +dnl @result{} diff -ruNp m4-1.4.12/checks/051.pushdef m4-1.4.13/checks/051.pushdef --- m4-1.4.12/checks/051.pushdef 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/051.pushdef 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:2322: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `Expansion one.') -dnl @result{} -foo -dnl @result{}Expansion one. -pushdef(`foo', `Expansion two.') -dnl @result{} -foo -dnl @result{}Expansion two. -pushdef(`foo', `Expansion three.') -dnl @result{} -pushdef(`foo', `Expansion four.') -dnl @result{} -popdef(`foo') -dnl @result{} -foo -dnl @result{}Expansion three. -popdef(`foo', `foo') -dnl @result{} -foo -dnl @result{}Expansion one. -popdef(`foo') -dnl @result{} -foo -dnl @result{}foo diff -ruNp m4-1.4.12/checks/052.pushdef m4-1.4.13/checks/052.pushdef --- m4-1.4.12/checks/052.pushdef 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/052.pushdef 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:2359: Origin of test +dnl @ ../doc/m4.texinfo:2347: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 @@ -15,11 +15,19 @@ pushdef(`foo', `Expansion two.') dnl @result{} foo dnl @result{}Expansion two. -define(`foo', `Second expansion two.') +pushdef(`foo', `Expansion three.') +dnl @result{} +pushdef(`foo', `Expansion four.') +dnl @result{} +popdef(`foo') dnl @result{} foo -dnl @result{}Second expansion two. -undefine(`foo') +dnl @result{}Expansion three. +popdef(`foo', `foo') +dnl @result{} +foo +dnl @result{}Expansion one. +popdef(`foo') dnl @result{} foo dnl @result{}foo diff -ruNp m4-1.4.12/checks/053.indir m4-1.4.13/checks/053.indir --- m4-1.4.12/checks/053.indir 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/053.indir 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:2408: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`$$internal$macro', `Internal macro (name `$0')') -dnl @result{} -$$internal$macro -dnl @result{}$$internal$macro -indir(`$$internal$macro') -dnl @result{}Internal macro (name $$internal$macro) diff -ruNp m4-1.4.12/checks/053.pushdef m4-1.4.13/checks/053.pushdef --- m4-1.4.12/checks/053.pushdef 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/053.pushdef 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,25 @@ +dnl @ ../doc/m4.texinfo:2384: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `Expansion one.') +dnl @result{} +foo +dnl @result{}Expansion one. +pushdef(`foo', `Expansion two.') +dnl @result{} +foo +dnl @result{}Expansion two. +define(`foo', `Second expansion two.') +dnl @result{} +foo +dnl @result{}Second expansion two. +undefine(`foo') +dnl @result{} +foo +dnl @result{}foo diff -ruNp m4-1.4.12/checks/054.indir m4-1.4.13/checks/054.indir --- m4-1.4.12/checks/054.indir 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/054.indir 2009-03-21 18:13:11.000000000 -0600 @@ -1,18 +1,15 @@ -dnl @ ../doc/m4.texinfo:2428: Origin of test +dnl @ ../doc/m4.texinfo:2433: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`f', `1') -dnl @result{} -f(define(`f', `2')) -dnl @result{}1 -indir(`f', define(`f', `3')) -dnl @result{}3 -indir(`f', undefine(`f')) -dnl @error{}m4:stdin:4: undefined macro `f' +define(`$$internal$macro', `Internal macro (name `$0')') dnl @result{} +$$internal$macro +dnl @result{}$$internal$macro +indir(`$$internal$macro') +dnl @result{}Internal macro (name $$internal$macro) diff -ruNp m4-1.4.12/checks/055.indir m4-1.4.13/checks/055.indir --- m4-1.4.12/checks/055.indir 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/055.indir 2009-03-21 18:13:11.000000000 -0600 @@ -1,22 +1,18 @@ -dnl @ ../doc/m4.texinfo:2446: Origin of test +dnl @ ../doc/m4.texinfo:2453: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -indir(defn(`defn'), `divnum') -dnl @error{}m4:stdin:1: Warning: indir: invalid macro name ignored +define(`f', `1') dnl @result{} -indir(`define', defn(`defn'), `divnum') -dnl @error{}m4:stdin:2: Warning: define: invalid macro name ignored -dnl @result{} -indir(`define', `foo', defn(`divnum')) -dnl @result{} -foo -dnl @result{}0 -indir(`divert', defn(`foo')) -dnl @error{}m4:stdin:5: empty string treated as 0 in builtin `divert' +f(define(`f', `2')) +dnl @result{}1 +indir(`f', define(`f', `3')) +dnl @result{}3 +indir(`f', undefine(`f')) +dnl @error{}m4:stdin:4: undefined macro `f' dnl @result{} diff -ruNp m4-1.4.12/checks/056.builtin m4-1.4.13/checks/056.builtin --- m4-1.4.12/checks/056.builtin 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/056.builtin 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:2484: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -pushdef(`define', `hidden') -dnl @result{} -undefine(`undefine') -dnl @result{} -define(`foo', `bar') -dnl @result{}hidden -foo -dnl @result{}foo -builtin(`define', `foo', defn(`divnum')) -dnl @result{} -foo -dnl @result{}0 -builtin(`define', `foo', `BAR') -dnl @result{} -foo -dnl @result{}BAR -undefine(`foo') -dnl @result{}undefine(foo) -foo -dnl @result{}BAR -builtin(`undefine', `foo') -dnl @result{} -foo -dnl @result{}foo diff -ruNp m4-1.4.12/checks/056.indir m4-1.4.13/checks/056.indir --- m4-1.4.12/checks/056.indir 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/056.indir 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,22 @@ +dnl @ ../doc/m4.texinfo:2471: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +indir(defn(`defn'), `divnum') +dnl @error{}m4:stdin:1: Warning: indir: invalid macro name ignored +dnl @result{} +indir(`define', defn(`defn'), `divnum') +dnl @error{}m4:stdin:2: Warning: define: invalid macro name ignored +dnl @result{} +indir(`define', `foo', defn(`divnum')) +dnl @result{} +foo +dnl @result{}0 +indir(`divert', defn(`foo')) +dnl @error{}m4:stdin:5: empty string treated as 0 in builtin `divert' +dnl @result{} diff -ruNp m4-1.4.12/checks/057.builtin m4-1.4.13/checks/057.builtin --- m4-1.4.12/checks/057.builtin 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/057.builtin 2009-03-21 18:13:11.000000000 -0600 @@ -1,19 +1,33 @@ -dnl @ ../doc/m4.texinfo:2517: Origin of test +dnl @ ../doc/m4.texinfo:2509: Origin of test dnl @ expected status: 0 -dnl @ extra options: -P -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -m4_builtin(`divnum') -dnl @result{}0 -m4_builtin(`m4_divnum') -dnl @error{}m4:stdin:2: undefined builtin `m4_divnum' +pushdef(`define', `hidden') +dnl @result{} +undefine(`undefine') dnl @result{} -m4_indir(`divnum') -dnl @error{}m4:stdin:3: undefined macro `divnum' +define(`foo', `bar') +dnl @result{}hidden +foo +dnl @result{}foo +builtin(`define', `foo', defn(`divnum')) dnl @result{} -m4_indir(`m4_divnum') +foo dnl @result{}0 +builtin(`define', `foo', `BAR') +dnl @result{} +foo +dnl @result{}BAR +undefine(`foo') +dnl @result{}undefine(foo) +foo +dnl @result{}BAR +builtin(`undefine', `foo') +dnl @result{} +foo +dnl @result{}foo diff -ruNp m4-1.4.12/checks/058.builtin m4-1.4.13/checks/058.builtin --- m4-1.4.12/checks/058.builtin 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/058.builtin 2009-03-21 18:13:11.000000000 -0600 @@ -1,28 +1,19 @@ -dnl @ ../doc/m4.texinfo:2535: Origin of test +dnl @ ../doc/m4.texinfo:2542: Origin of test dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: -P +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -builtin -dnl @result{}builtin -builtin() -dnl @error{}m4:stdin:2: undefined builtin `' +m4_builtin(`divnum') +dnl @result{}0 +m4_builtin(`m4_divnum') +dnl @error{}m4:stdin:2: undefined builtin `m4_divnum' dnl @result{} -builtin(`builtin') -dnl @error{}m4:stdin:3: Warning: too few arguments to builtin `builtin' -dnl @result{} -builtin(`builtin',) -dnl @error{}m4:stdin:4: undefined builtin `' -dnl @result{} -builtin(`builtin', ``' -') -dnl @error{}m4:stdin:5: undefined builtin ``' -dnl @error{}' -dnl @result{} -indir(`index') -dnl @error{}m4:stdin:7: Warning: too few arguments to builtin `index' +m4_indir(`divnum') +dnl @error{}m4:stdin:3: undefined macro `divnum' dnl @result{} +m4_indir(`m4_divnum') +dnl @result{}0 diff -ruNp m4-1.4.12/checks/059.builtin m4-1.4.13/checks/059.builtin --- m4-1.4.12/checks/059.builtin 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/059.builtin 2009-03-21 18:13:11.000000000 -0600 @@ -1,11 +1,28 @@ -dnl @ ../doc/m4.texinfo:2562: Origin of test +dnl @ ../doc/m4.texinfo:2560: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -builtin(`include', `foo')dnl -dnl @result{}bar +builtin +dnl @result{}builtin +builtin() +dnl @error{}m4:stdin:2: undefined builtin `' +dnl @result{} +builtin(`builtin') +dnl @error{}m4:stdin:3: Warning: too few arguments to builtin `builtin' +dnl @result{} +builtin(`builtin',) +dnl @error{}m4:stdin:4: undefined builtin `' +dnl @result{} +builtin(`builtin', ``' +') +dnl @error{}m4:stdin:5: undefined builtin ``' +dnl @error{}' +dnl @result{} +indir(`index') +dnl @error{}m4:stdin:7: Warning: too few arguments to builtin `index' +dnl @result{} diff -ruNp m4-1.4.12/checks/060.builtin m4-1.4.13/checks/060.builtin --- m4-1.4.12/checks/060.builtin 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/060.builtin 2009-03-21 18:13:11.000000000 -0600 @@ -1,21 +1,11 @@ -dnl @ ../doc/m4.texinfo:2569: Origin of test +dnl @ ../doc/m4.texinfo:2587: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`s', `builtin(`shift', $@)')dnl -define(`loop', `ifelse(`$2', `', `-', `$1$2: $0(`$1', s(s($@)))')')dnl -loop(`1') -dnl @result{}- -loop(`1', `2') -dnl @result{}12: - -loop(`1', `2', `3') -dnl @result{}12: 13: - -loop(`1', `2', `3', `4') -dnl @result{}12: 13: 14: - -loop(`1', `2', `3', `4', `5') -dnl @result{}12: 13: 14: 15: - +builtin(`include', `foo')dnl +dnl @result{}bar diff -ruNp m4-1.4.12/checks/061.builtin m4-1.4.13/checks/061.builtin --- m4-1.4.12/checks/061.builtin 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/061.builtin 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:2594: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`s', `builtin(`shift', $@)')dnl +define(`loop', `ifelse(`$2', `', `-', `$1$2: $0(`$1', s(s($@)))')')dnl +loop(`1') +dnl @result{}- +loop(`1', `2') +dnl @result{}12: - +loop(`1', `2', `3') +dnl @result{}12: 13: - +loop(`1', `2', `3', `4') +dnl @result{}12: 13: 14: - +loop(`1', `2', `3', `4', `5') +dnl @result{}12: 13: 14: 15: - diff -ruNp m4-1.4.12/checks/061.ifdef m4-1.4.13/checks/061.ifdef --- m4-1.4.12/checks/061.ifdef 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/061.ifdef 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:2618: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifdef(`foo', ``foo' is defined', ``foo' is not defined') -dnl @result{}foo is not defined -define(`foo', `') -dnl @result{} -ifdef(`foo', ``foo' is defined', ``foo' is not defined') -dnl @result{}foo is defined -ifdef(`no_such_macro', `yes', `no', `extra argument') -dnl @error{}m4:stdin:4: Warning: excess arguments to builtin `ifdef' ignored -dnl @result{}no diff -ruNp m4-1.4.12/checks/062.ifdef m4-1.4.13/checks/062.ifdef --- m4-1.4.12/checks/062.ifdef 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/062.ifdef 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:2645: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifdef(`foo', ``foo' is defined', ``foo' is not defined') +dnl @result{}foo is not defined +define(`foo', `') +dnl @result{} +ifdef(`foo', ``foo' is defined', ``foo' is not defined') +dnl @result{}foo is defined +ifdef(`no_such_macro', `yes', `no', `extra argument') +dnl @error{}m4:stdin:4: Warning: excess arguments to builtin `ifdef' ignored +dnl @result{}no diff -ruNp m4-1.4.12/checks/062.ifelse m4-1.4.13/checks/062.ifelse --- m4-1.4.12/checks/062.ifelse 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/062.ifelse 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:2666: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifelse(`some comments') -dnl @result{} -ifelse(`foo', `bar') -dnl @error{}m4:stdin:2: Warning: too few arguments to builtin `ifelse' -dnl @result{} diff -ruNp m4-1.4.12/checks/063.ifelse m4-1.4.13/checks/063.ifelse --- m4-1.4.12/checks/063.ifelse 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/063.ifelse 2009-03-21 18:13:11.000000000 -0600 @@ -1,19 +1,14 @@ -dnl @ ../doc/m4.texinfo:2676: Origin of test +dnl @ ../doc/m4.texinfo:2693: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -ifelse(`foo', `bar', `true') +ifelse(`some comments') dnl @result{} -ifelse(`foo', `foo', `true') -dnl @result{}true -define(`foo', `bar') +ifelse(`foo', `bar') +dnl @error{}m4:stdin:2: Warning: too few arguments to builtin `ifelse' dnl @result{} -ifelse(foo, `bar', `true', `false') -dnl @result{}true -ifelse(foo, `foo', `true', `false') -dnl @result{}false diff -ruNp m4-1.4.12/checks/064.ifelse m4-1.4.13/checks/064.ifelse --- m4-1.4.12/checks/064.ifelse 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/064.ifelse 2009-03-21 18:13:11.000000000 -0600 @@ -1,17 +1,19 @@ -dnl @ ../doc/m4.texinfo:2696: Origin of test +dnl @ ../doc/m4.texinfo:2703: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`foo', `ifelse(`$#', `0', ``$0'', `arguments:$#')') +ifelse(`foo', `bar', `true') dnl @result{} -foo -dnl @result{}foo -foo() -dnl @result{}arguments:1 -foo(`a', `b', `c') -dnl @result{}arguments:3 +ifelse(`foo', `foo', `true') +dnl @result{}true +define(`foo', `bar') +dnl @result{} +ifelse(foo, `bar', `true', `false') +dnl @result{}true +ifelse(foo, `foo', `true', `false') +dnl @result{}false diff -ruNp m4-1.4.12/checks/065.ifelse m4-1.4.13/checks/065.ifelse --- m4-1.4.12/checks/065.ifelse 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/065.ifelse 2009-03-21 18:13:11.000000000 -0600 @@ -1,31 +1,17 @@ -dnl @ ../doc/m4.texinfo:2738: Origin of test +dnl @ ../doc/m4.texinfo:2723: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`define_blind', `ifelse(`$#', `0', ``$0'', -`_$0(`$1', `$2', `$'`#', `$'`0')')') -dnl @result{} -define(`_define_blind', `define(`$1', -`ifelse(`$3', `0', ``$4'', `$2')')') -dnl @result{} -define_blind -dnl @result{}define_blind -define_blind(`foo', `arguments were $*') +define(`foo', `ifelse(`$#', `0', ``$0'', `arguments:$#')') dnl @result{} foo dnl @result{}foo -foo(`bar') -dnl @result{}arguments were bar -define(`blah', defn(`foo')) -dnl @result{} -blah -dnl @result{}blah -blah(`a', `b') -dnl @result{}arguments were a,b -defn(`blah') -dnl @result{}ifelse(`$#', `0', ``$0'', `arguments were $*') +foo() +dnl @result{}arguments:1 +foo(`a', `b', `c') +dnl @result{}arguments:3 diff -ruNp m4-1.4.12/checks/066.ifelse m4-1.4.13/checks/066.ifelse --- m4-1.4.12/checks/066.ifelse 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/066.ifelse 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:2774: Origin of test +dnl @ ../doc/m4.texinfo:2747: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/067.ifelse m4-1.4.13/checks/067.ifelse --- m4-1.4.12/checks/067.ifelse 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/067.ifelse 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:2792: Origin of test +dnl @ ../doc/m4.texinfo:2765: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/068.shift m4-1.4.13/checks/068.shift --- m4-1.4.12/checks/068.shift 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/068.shift 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:2873: Origin of test +dnl @ ../doc/m4.texinfo:2846: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/069.shift m4-1.4.13/checks/069.shift --- m4-1.4.12/checks/069.shift 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/069.shift 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:2892: Origin of test +dnl @ ../doc/m4.texinfo:2865: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/070.shift m4-1.4.13/checks/070.shift --- m4-1.4.12/checks/070.shift 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/070.shift 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:2927: Origin of test +dnl @ ../doc/m4.texinfo:2900: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/071.shift m4-1.4.13/checks/071.shift --- m4-1.4.12/checks/071.shift 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/071.shift 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:2982: Origin of test +dnl @ ../doc/m4.texinfo:2955: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/072.shift m4-1.4.13/checks/072.shift --- m4-1.4.12/checks/072.shift 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/072.shift 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3011: Origin of test +dnl @ ../doc/m4.texinfo:2984: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/073.shift m4-1.4.13/checks/073.shift --- m4-1.4.12/checks/073.shift 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/073.shift 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3089: Origin of test +dnl @ ../doc/m4.texinfo:3062: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/074.shift m4-1.4.13/checks/074.shift --- m4-1.4.12/checks/074.shift 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/074.shift 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3122: Origin of test +dnl @ ../doc/m4.texinfo:3095: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/075.shift m4-1.4.13/checks/075.shift --- m4-1.4.12/checks/075.shift 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/075.shift 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3155: Origin of test +dnl @ ../doc/m4.texinfo:3128: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/076.forloop m4-1.4.13/checks/076.forloop --- m4-1.4.12/checks/076.forloop 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/076.forloop 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3187: Origin of test +dnl @ ../doc/m4.texinfo:3160: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/077.forloop m4-1.4.13/checks/077.forloop --- m4-1.4.12/checks/077.forloop 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/077.forloop 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3198: Origin of test +dnl @ ../doc/m4.texinfo:3171: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/078.forloop m4-1.4.13/checks/078.forloop --- m4-1.4.12/checks/078.forloop 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/078.forloop 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3226: Origin of test +dnl @ ../doc/m4.texinfo:3199: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/079.foreach m4-1.4.13/checks/079.foreach --- m4-1.4.12/checks/079.foreach 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/079.foreach 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3273: Origin of test +dnl @ ../doc/m4.texinfo:3246: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/080.foreach m4-1.4.13/checks/080.foreach --- m4-1.4.12/checks/080.foreach 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/080.foreach 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3296: Origin of test +dnl @ ../doc/m4.texinfo:3269: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/081.foreach m4-1.4.13/checks/081.foreach --- m4-1.4.12/checks/081.foreach 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/081.foreach 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3326: Origin of test +dnl @ ../doc/m4.texinfo:3299: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/082.foreach m4-1.4.13/checks/082.foreach --- m4-1.4.12/checks/082.foreach 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/082.foreach 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3353: Origin of test +dnl @ ../doc/m4.texinfo:3326: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/083.foreach m4-1.4.13/checks/083.foreach --- m4-1.4.12/checks/083.foreach 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/083.foreach 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3378: Origin of test +dnl @ ../doc/m4.texinfo:3351: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/084.foreach m4-1.4.13/checks/084.foreach --- m4-1.4.12/checks/084.foreach 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/084.foreach 2009-03-21 18:13:11.000000000 -0600 @@ -1,8 +1,8 @@ -dnl @ ../doc/m4.texinfo:3405: Origin of test +dnl @ ../doc/m4.texinfo:3378: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 diff -ruNp m4-1.4.12/checks/085.dumpdef m4-1.4.13/checks/085.dumpdef --- m4-1.4.12/checks/085.dumpdef 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/085.dumpdef 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:3456: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `Hello world.') -dnl @result{} -dumpdef(`foo') -dnl @error{}foo: `Hello world.' -dnl @result{} -dumpdef(`define') -dnl @error{}define: <define> -dnl @result{} diff -ruNp m4-1.4.12/checks/085.stacks m4-1.4.13/checks/085.stacks --- m4-1.4.12/checks/085.stacks 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/085.stacks 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,24 @@ +dnl @ ../doc/m4.texinfo:3419: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`stack.m4') +dnl @result{} +pushdef(`a', `1')pushdef(`a', `2')pushdef(`a', `3') +dnl @result{} +define(`show', ``$1' +') +dnl @result{} +stack_foreach(`a', `show')dnl +dnl @result{}1 +dnl @result{}2 +dnl @result{}3 +stack_foreach_lifo(`a', `show')dnl +dnl @result{}3 +dnl @result{}2 +dnl @result{}1 diff -ruNp m4-1.4.12/checks/086.dumpdef m4-1.4.13/checks/086.dumpdef --- m4-1.4.12/checks/086.dumpdef 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/086.dumpdef 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:3473: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -pushdef(`f', ``$0'1')pushdef(`f', ``$0'2') -dnl @result{} -f(popdef(`f')dumpdef(`f')) -dnl @error{}f: ``$0'1' -dnl @result{}f2 -f(popdef(`f')dumpdef(`f')) -dnl @error{}m4:stdin:3: undefined macro `f' -dnl @result{}f1 diff -ruNp m4-1.4.12/checks/086.stacks m4-1.4.13/checks/086.stacks --- m4-1.4.12/checks/086.stacks 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/086.stacks 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,26 @@ +dnl @ ../doc/m4.texinfo:3455: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +undivert(`stack.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# stack_foreach(macro, action) +dnl @result{}# Invoke ACTION with a single argument of each definition +dnl @result{}# from the definition stack of MACRO, starting with the oldest. +dnl @result{}define(`stack_foreach', +dnl @result{}`_stack_reverse(`$1', `tmp-$1')'dnl +dnl @result{}`_stack_reverse(`tmp-$1', `$1', `$2(defn(`$1'))')') +dnl @result{}# stack_foreach_lifo(macro, action) +dnl @result{}# Invoke ACTION with a single argument of each definition +dnl @result{}# from the definition stack of MACRO, starting with the newest. +dnl @result{}define(`stack_foreach_lifo', +dnl @result{}`_stack_reverse(`$1', `tmp-$1', `$2(defn(`$1'))')'dnl +dnl @result{}`_stack_reverse(`tmp-$1', `$1')') +dnl @result{}define(`_stack_reverse', +dnl @result{}`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0($@)')') +dnl @result{}divert`'dnl diff -ruNp m4-1.4.12/checks/087.compositio m4-1.4.13/checks/087.compositio --- m4-1.4.12/checks/087.compositio 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/087.compositio 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:3518: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`define_blind', `ifelse(`$#', `0', ``$0'', +`_$0(`$1', `$2', `$'`#', `$'`0')')') +dnl @result{} +define(`_define_blind', `define(`$1', +`ifelse(`$3', `0', ``$4'', `$2')')') +dnl @result{} +define_blind +dnl @result{}define_blind +define_blind(`foo', `arguments were $*') +dnl @result{} +foo +dnl @result{}foo +foo(`bar') +dnl @result{}arguments were bar +define(`blah', defn(`foo')) +dnl @result{} +blah +dnl @result{}blah +blah(`a', `b') +dnl @result{}arguments were a,b +defn(`blah') +dnl @result{}ifelse(`$#', `0', ``$0'', `arguments were $*') diff -ruNp m4-1.4.12/checks/087.trace m4-1.4.13/checks/087.trace --- m4-1.4.12/checks/087.trace 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/087.trace 1969-12-31 17:00:00.000000000 -0700 @@ -1,21 +0,0 @@ -dnl @ ../doc/m4.texinfo:3516: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `Hello World.') -dnl @result{} -define(`echo', `$@') -dnl @result{} -traceon(`foo', `echo') -dnl @result{} -foo -dnl @error{}m4trace: -1- foo -> `Hello World.' -dnl @result{}Hello World. -echo(`gnus', `and gnats') -dnl @error{}m4trace: -1- echo(`gnus', `and gnats') -> ``gnus',`and gnats'' -dnl @result{}gnus,and gnats diff -ruNp m4-1.4.12/checks/088.compositio m4-1.4.13/checks/088.compositio --- m4-1.4.12/checks/088.compositio 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/088.compositio 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,20 @@ +dnl @ ../doc/m4.texinfo:3565: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`curry.m4')include(`stack.m4') +dnl @result{} +define(`reverse', `ifelse(`$#', `0', , `$#', `1', ``$1'', + `reverse(shift($@)), `$1'')') +dnl @result{} +pushdef(`a', `1')pushdef(`a', `2')pushdef(`a', `3') +dnl @result{} +stack_foreach(`a', `:curry(`reverse', `4')') +dnl @result{}:1, 4:2, 4:3, 4 +curry(`curry', `reverse', `1')(`2')(`3') +dnl @result{}3, 2, 1 diff -ruNp m4-1.4.12/checks/088.trace m4-1.4.13/checks/088.trace --- m4-1.4.12/checks/088.trace 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/088.trace 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:3544: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -dp -L3 -tifelse -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifelse(`one level') -dnl @error{}m4trace: -1- ifelse -dnl @result{} -ifelse(ifelse(ifelse(`three levels'))) -dnl @error{}m4trace: -3- ifelse -dnl @error{}m4trace: -2- ifelse -dnl @error{}m4trace: -1- ifelse -dnl @result{} -ifelse(ifelse(ifelse(ifelse(`four levels')))) -dnl @error{}m4:stdin:3: recursion limit of 3 exceeded, use -L<N> to change it diff -ruNp m4-1.4.12/checks/089.compositio m4-1.4.13/checks/089.compositio --- m4-1.4.12/checks/089.compositio 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/089.compositio 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:3590: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +undivert(`curry.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# curry(macro, args) +dnl @result{}# Expand to a macro call that takes one argument, then invoke +dnl @result{}# macro(args, extra). +dnl @result{}define(`curry', `$1(shift($@,)_$0') +dnl @result{}define(`_curry', ``$1')') +dnl @result{}divert`'dnl diff -ruNp m4-1.4.12/checks/089.trace m4-1.4.13/checks/089.trace --- m4-1.4.12/checks/089.trace 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/089.trace 1969-12-31 17:00:00.000000000 -0700 @@ -1,38 +0,0 @@ -dnl @ ../doc/m4.texinfo:3562: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -traceoff(`foo') -dnl @result{} -traceon(`foo') -dnl @result{} -foo -dnl @result{}foo -defn(`foo') -dnl @result{} -define(`foo', `bar') -dnl @result{} -foo -dnl @error{}m4trace: -1- foo -> `bar' -dnl @result{}bar -undefine(`foo') -dnl @result{} -ifdef(`foo', `yes', `no') -dnl @result{}no -indir(`foo') -dnl @error{}m4:stdin:9: undefined macro `foo' -dnl @result{} -define(`foo', `blah') -dnl @result{} -foo -dnl @error{}m4trace: -1- foo -> `blah' -dnl @result{}blah -traceoff -dnl @result{} -foo -dnl @result{}blah diff -ruNp m4-1.4.12/checks/090.compositio m4-1.4.13/checks/090.compositio --- m4-1.4.12/checks/090.compositio 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/090.compositio 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,27 @@ +dnl @ ../doc/m4.texinfo:3629: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`curry.m4')include(`stack.m4') +dnl @result{} +define(`rename', `copy($@)undefine(`$1')')dnl +define(`copy', `ifdef(`$2', `errprint(`$2 already defined +')m4exit(`1')', + `stack_foreach(`$1', `curry(`pushdef', `$2')')')')dnl +pushdef(`a', `1')pushdef(`a', defn(`divnum'))pushdef(`a', `2') +dnl @result{} +copy(`a', `b') +dnl @result{} +rename(`b', `c') +dnl @result{} +a b c +dnl @result{}2 b 2 +popdef(`a', `c')c a +dnl @result{} 0 +popdef(`a', `c')a c +dnl @result{}1 1 diff -ruNp m4-1.4.12/checks/090.trace m4-1.4.13/checks/090.trace --- m4-1.4.12/checks/090.trace 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/090.trace 1969-12-31 17:00:00.000000000 -0700 @@ -1,31 +0,0 @@ -dnl @ ../doc/m4.texinfo:3598: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -traceon(`traceon') -dnl @result{} -traceon(`traceoff') -dnl @error{}m4trace: -1- traceon(`traceoff') -dnl @result{} -traceoff(`traceoff') -dnl @error{}m4trace: -1- traceoff(`traceoff') -dnl @result{} -traceoff(`traceon') -dnl @result{} -traceon(`eval', `m4_divnum') -dnl @result{} -define(`m4_eval', defn(`eval')) -dnl @result{} -define(`m4_divnum', defn(`divnum')) -dnl @result{} -eval(divnum) -dnl @error{}m4trace: -1- eval(`0') -> `0' -dnl @result{}0 -m4_eval(m4_divnum) -dnl @error{}m4trace: -2- m4_divnum -> `0' -dnl @result{}0 diff -ruNp m4-1.4.12/checks/091.dumpdef m4-1.4.13/checks/091.dumpdef --- m4-1.4.12/checks/091.dumpdef 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/091.dumpdef 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:3687: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `Hello world.') +dnl @result{} +dumpdef(`foo') +dnl @error{}foo: `Hello world.' +dnl @result{} +dumpdef(`define') +dnl @error{}define: <define> +dnl @result{} diff -ruNp m4-1.4.12/checks/091.trace m4-1.4.13/checks/091.trace --- m4-1.4.12/checks/091.trace 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/091.trace 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3632: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -de --trace ifelse -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`e', `ifelse(`$1', `$2', `ifelse(`$1', `$2', `e(shift($@))')')') -dnl @result{} -e(`1', `1') -dnl @error{}m4trace: -1- ifelse -> ifelse(`1', `1', `e(shift(`1',`1'))') -dnl @error{}m4trace: -1- ifelse -> e(shift(`1',`1')) -dnl @error{}m4trace: -1- ifelse -dnl @result{} diff -ruNp m4-1.4.12/checks/092.debug_leve m4-1.4.13/checks/092.debug_leve --- m4-1.4.12/checks/092.debug_leve 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/092.debug_leve 1969-12-31 17:00:00.000000000 -0700 @@ -1,28 +0,0 @@ -dnl @ ../doc/m4.texinfo:3738: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dp -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `FOO') -dnl @result{} -traceon(`foo') -dnl @result{} -debugmode() -dnl @result{} -foo -dnl @error{}m4trace: -1- foo -> `FOO' -dnl @result{}FOO -debugmode -dnl @result{} -foo -dnl @error{}m4trace: -1- foo -dnl @result{}FOO -debugmode(`+l') -dnl @result{} -foo -dnl @error{}m4trace:8: -1- foo -dnl @result{}FOO diff -ruNp m4-1.4.12/checks/092.dumpdef m4-1.4.13/checks/092.dumpdef --- m4-1.4.12/checks/092.dumpdef 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/092.dumpdef 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:3704: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +pushdef(`f', ``$0'1')pushdef(`f', ``$0'2') +dnl @result{} +f(popdef(`f')dumpdef(`f')) +dnl @error{}f: ``$0'1' +dnl @result{}f2 +f(popdef(`f')dumpdef(`f')) +dnl @error{}m4:stdin:3: undefined macro `f' +dnl @result{}f1 diff -ruNp m4-1.4.12/checks/093.debug_leve m4-1.4.13/checks/093.debug_leve --- m4-1.4.12/checks/093.debug_leve 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/093.debug_leve 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:3767: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -l6 -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`echo', `$@')debugmode(`+t') -dnl @result{} -echo(`1', `long string') -dnl @error{}m4trace: -1- echo(`1', `long s...') -> ``1',`l...' -dnl @result{}1,long string -indir(`echo', defn(`changequote')) -dnl @error{}m4trace: -2- defn(`change...') -dnl @error{}m4trace: -1- indir(`echo', <changequote>) -> ``'' -dnl @result{} diff -ruNp m4-1.4.12/checks/093.trace m4-1.4.13/checks/093.trace --- m4-1.4.12/checks/093.trace 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/093.trace 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:3747: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `Hello World.') +dnl @result{} +define(`echo', `$@') +dnl @result{} +traceon(`foo', `echo') +dnl @result{} +foo +dnl @error{}m4trace: -1- foo -> `Hello World.' +dnl @result{}Hello World. +echo(`gnus', `and gnats') +dnl @error{}m4trace: -1- echo(`gnus', `and gnats') -> ``gnus',`and gnats'' +dnl @result{}gnus,and gnats diff -ruNp m4-1.4.12/checks/094.debug_leve m4-1.4.13/checks/094.debug_leve --- m4-1.4.12/checks/094.debug_leve 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/094.debug_leve 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3785: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dip -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -dnl @error{}m4debug: input read from stdin -include(`foo')dnl -dnl @error{}m4debug: path search for `foo' found `examples/foo' -dnl @error{}m4debug: input read from examples/foo -dnl @result{}bar -dnl @error{}m4debug: input reverted to stdin, line 1 -dnl @error{}m4debug: input exhausted diff -ruNp m4-1.4.12/checks/094.trace m4-1.4.13/checks/094.trace --- m4-1.4.12/checks/094.trace 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/094.trace 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:3775: Origin of test +dnl @ expected status: 1 +dnl @ extra options: -dp -L3 -tifelse +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifelse(`one level') +dnl @error{}m4trace: -1- ifelse +dnl @result{} +ifelse(ifelse(ifelse(`three levels'))) +dnl @error{}m4trace: -3- ifelse +dnl @error{}m4trace: -2- ifelse +dnl @error{}m4trace: -1- ifelse +dnl @result{} +ifelse(ifelse(ifelse(ifelse(`four levels')))) +dnl @error{}m4:stdin:3: recursion limit of 3 exceeded, use -L<N> to change it diff -ruNp m4-1.4.12/checks/095.debug_outp m4-1.4.13/checks/095.debug_outp --- m4-1.4.12/checks/095.debug_outp 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/095.debug_outp 1969-12-31 17:00:00.000000000 -0700 @@ -1,25 +0,0 @@ -dnl @ ../doc/m4.texinfo:3820: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -traceon(`divnum') -dnl @result{} -divnum(`extra') -dnl @error{}m4:stdin:2: Warning: excess arguments to builtin `divnum' ignored -dnl @error{}m4trace: -1- divnum(`extra') -> `0' -dnl @result{}0 -debugfile() -dnl @result{} -divnum(`extra') -dnl @error{}m4:stdin:4: Warning: excess arguments to builtin `divnum' ignored -dnl @result{}0 -debugfile -dnl @result{} -divnum -dnl @error{}m4trace: -1- divnum -> `0' -dnl @result{}0 diff -ruNp m4-1.4.12/checks/095.trace m4-1.4.13/checks/095.trace --- m4-1.4.12/checks/095.trace 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/095.trace 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,38 @@ +dnl @ ../doc/m4.texinfo:3793: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +traceoff(`foo') +dnl @result{} +traceon(`foo') +dnl @result{} +foo +dnl @result{}foo +defn(`foo') +dnl @result{} +define(`foo', `bar') +dnl @result{} +foo +dnl @error{}m4trace: -1- foo -> `bar' +dnl @result{}bar +undefine(`foo') +dnl @result{} +ifdef(`foo', `yes', `no') +dnl @result{}no +indir(`foo') +dnl @error{}m4:stdin:9: undefined macro `foo' +dnl @result{} +define(`foo', `blah') +dnl @result{} +foo +dnl @error{}m4trace: -1- foo -> `blah' +dnl @result{}blah +traceoff +dnl @result{} +foo +dnl @result{}blah diff -ruNp m4-1.4.12/checks/096.dnl m4-1.4.13/checks/096.dnl --- m4-1.4.12/checks/096.dnl 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/096.dnl 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:3873: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `Macro `foo'.')dnl A very simple macro, indeed. -foo -dnl @result{}Macro foo. diff -ruNp m4-1.4.12/checks/096.trace m4-1.4.13/checks/096.trace --- m4-1.4.12/checks/096.trace 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/096.trace 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:3829: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +traceon(`traceon') +dnl @result{} +traceon(`traceoff') +dnl @error{}m4trace: -1- traceon(`traceoff') +dnl @result{} +traceoff(`traceoff') +dnl @error{}m4trace: -1- traceoff(`traceoff') +dnl @result{} +traceoff(`traceon') +dnl @result{} +traceon(`eval', `m4_divnum') +dnl @result{} +define(`m4_eval', defn(`eval')) +dnl @result{} +define(`m4_divnum', defn(`divnum')) +dnl @result{} +eval(divnum) +dnl @error{}m4trace: -1- eval(`0') -> `0' +dnl @result{}0 +m4_eval(m4_divnum) +dnl @error{}m4trace: -2- m4_divnum -> `0' +dnl @result{}0 diff -ruNp m4-1.4.12/checks/097.dnl m4-1.4.13/checks/097.dnl --- m4-1.4.12/checks/097.dnl 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/097.dnl 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:3891: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -dnl(`args are ignored, but side effects occur', -define(`foo', `like this')) while this text is ignored: undefine(`foo') -dnl @error{}m4:stdin:1: Warning: excess arguments to builtin `dnl' ignored -See how `foo' was defined, foo? -dnl @result{}See how foo was defined, like this? diff -ruNp m4-1.4.12/checks/097.trace m4-1.4.13/checks/097.trace --- m4-1.4.12/checks/097.trace 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/097.trace 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:3863: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -de --trace ifelse +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`e', `ifelse(`$1', `$2', `ifelse(`$1', `$2', `e(shift($@))')')') +dnl @result{} +e(`1', `1') +dnl @error{}m4trace: -1- ifelse -> ifelse(`1', `1', `e(shift(`1',`1'))') +dnl @error{}m4trace: -1- ifelse -> e(shift(`1',`1')) +dnl @error{}m4trace: -1- ifelse +dnl @result{} diff -ruNp m4-1.4.12/checks/098.debug_leve m4-1.4.13/checks/098.debug_leve --- m4-1.4.12/checks/098.debug_leve 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/098.debug_leve 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,28 @@ +dnl @ ../doc/m4.texinfo:3969: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -dp +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `FOO') +dnl @result{} +traceon(`foo') +dnl @result{} +debugmode() +dnl @result{} +foo +dnl @error{}m4trace: -1- foo -> `FOO' +dnl @result{}FOO +debugmode +dnl @result{} +foo +dnl @error{}m4trace: -1- foo +dnl @result{}FOO +debugmode(`+l') +dnl @result{} +foo +dnl @error{}m4trace:8: -1- foo +dnl @result{}FOO diff -ruNp m4-1.4.12/checks/098.dnl m4-1.4.13/checks/098.dnl --- m4-1.4.12/checks/098.dnl 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/098.dnl 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3902: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -m4wrap(`m4wrap(`2 hi -')0 hi dnl 1 hi') -dnl @result{} -define(`hi', `HI') -dnl @result{} -dnl @error{}m4:stdin:1: Warning: end of file treated as newline -dnl @result{}0 HI 2 HI diff -ruNp m4-1.4.12/checks/099.changequot m4-1.4.13/checks/099.changequot --- m4-1.4.12/checks/099.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/099.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:3933: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -changequote(`[', `]') -dnl @result{} -define([foo], [Macro [foo].]) -dnl @result{} -foo -dnl @result{}Macro foo. diff -ruNp m4-1.4.12/checks/099.debug_leve m4-1.4.13/checks/099.debug_leve --- m4-1.4.12/checks/099.debug_leve 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/099.debug_leve 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:3998: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -l6 +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`echo', `$@')debugmode(`+t') +dnl @result{} +echo(`1', `long string') +dnl @error{}m4trace: -1- echo(`1', `long s...') -> ``1',`l...' +dnl @result{}1,long string +indir(`echo', defn(`changequote')) +dnl @error{}m4trace: -2- defn(`change...') +dnl @error{}m4trace: -1- indir(`echo', <changequote>) -> ``'' +dnl @result{} diff -ruNp m4-1.4.12/checks/100.changequot m4-1.4.13/checks/100.changequot --- m4-1.4.12/checks/100.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/100.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:3948: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`a', `b') -dnl @result{} -«a» -dnl @result{}«b» -changequote(`«', `»') -dnl @result{} -«a» -dnl @result{}a diff -ruNp m4-1.4.12/checks/100.debug_leve m4-1.4.13/checks/100.debug_leve --- m4-1.4.12/checks/100.debug_leve 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/100.debug_leve 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:4016: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -dip +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +dnl @error{}m4debug: input read from stdin +include(`foo')dnl +dnl @error{}m4debug: path search for `foo' found `examples/foo' +dnl @error{}m4debug: input read from examples/foo +dnl @result{}bar +dnl @error{}m4debug: input reverted to stdin, line 1 +dnl @error{}m4debug: input exhausted diff -ruNp m4-1.4.12/checks/101.changequot m4-1.4.13/checks/101.changequot --- m4-1.4.12/checks/101.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/101.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:3963: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -changequote(`[[[', `]]]') -dnl @result{} -define([[[foo]]], [[[Macro [[[[[foo]]]]].]]]) -dnl @result{} -foo -dnl @result{}Macro [[foo]]. diff -ruNp m4-1.4.12/checks/101.debug_outp m4-1.4.13/checks/101.debug_outp --- m4-1.4.12/checks/101.debug_outp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/101.debug_outp 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,25 @@ +dnl @ ../doc/m4.texinfo:4051: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +traceon(`divnum') +dnl @result{} +divnum(`extra') +dnl @error{}m4:stdin:2: Warning: excess arguments to builtin `divnum' ignored +dnl @error{}m4trace: -1- divnum(`extra') -> `0' +dnl @result{}0 +debugfile() +dnl @result{} +divnum(`extra') +dnl @error{}m4:stdin:4: Warning: excess arguments to builtin `divnum' ignored +dnl @result{}0 +debugfile +dnl @result{} +divnum +dnl @error{}m4trace: -1- divnum -> `0' +dnl @result{}0 diff -ruNp m4-1.4.12/checks/102.changequot m4-1.4.13/checks/102.changequot --- m4-1.4.12/checks/102.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/102.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,21 +0,0 @@ -dnl @ ../doc/m4.texinfo:3985: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `Macro `FOO'.') -dnl @result{} -changequote(`', `') -dnl @result{} -foo -dnl @result{}Macro `FOO'. -`foo' -dnl @result{}`Macro `FOO'.' -changequote(`,) -dnl @result{} -foo -dnl @result{}Macro FOO. diff -ruNp m4-1.4.12/checks/102.dnl m4-1.4.13/checks/102.dnl --- m4-1.4.12/checks/102.dnl 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/102.dnl 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:4104: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `Macro `foo'.')dnl A very simple macro, indeed. +foo +dnl @result{}Macro foo. diff -ruNp m4-1.4.12/checks/103.changequot m4-1.4.13/checks/103.changequot --- m4-1.4.12/checks/103.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/103.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:4018: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`echo', `$@') -dnl @result{} -define(`hi', `HI') -dnl @result{} -changequote(`q', `Q') -dnl @result{} -q hi Q hi -dnl @result{}q HI Q HI -echo(hi) -dnl @result{}qHIQ -changequote -dnl @result{} -changequote(`-', `EOF') -dnl @result{} -- hi EOF hi -dnl @result{} hi HI -changequote -dnl @result{} -changequote(`1', `2') -dnl @result{} -hi1hi2 -dnl @result{}hi1hi2 -hi 1hi2 -dnl @result{}HI hi diff -ruNp m4-1.4.12/checks/103.dnl m4-1.4.13/checks/103.dnl --- m4-1.4.12/checks/103.dnl 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/103.dnl 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:4122: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +dnl(`args are ignored, but side effects occur', +define(`foo', `like this')) while this text is ignored: undefine(`foo') +dnl @error{}m4:stdin:1: Warning: excess arguments to builtin `dnl' ignored +See how `foo' was defined, foo? +dnl @result{}See how foo was defined, like this? diff -ruNp m4-1.4.12/checks/104.changequot m4-1.4.13/checks/104.changequot --- m4-1.4.12/checks/104.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/104.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,31 +0,0 @@ -dnl @ ../doc/m4.texinfo:4051: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`echo', `$#:$@:') -dnl @result{} -define(`hi', `HI') -dnl @result{} -changequote(`(',`)') -dnl @result{} -echo(hi) -dnl @result{}0::hi -changequote -dnl @result{} -changequote(`((', `))') -dnl @result{} -echo(hi) -dnl @result{}1:HI: -echo((hi)) -dnl @result{}0::hi -changequote -dnl @result{} -changequote(`,', `)') -dnl @result{} -echo(hi,hi)bye) -dnl @result{}1:HIhibye: diff -ruNp m4-1.4.12/checks/104.dnl m4-1.4.13/checks/104.dnl --- m4-1.4.12/checks/104.dnl 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/104.dnl 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:4133: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +m4wrap(`m4wrap(`2 hi +')0 hi dnl 1 hi') +dnl @result{} +define(`hi', `HI') +dnl @result{} +dnl @error{}m4:stdin:1: Warning: end of file treated as newline +dnl @result{}0 HI 2 HI diff -ruNp m4-1.4.12/checks/105.changequot m4-1.4.13/checks/105.changequot --- m4-1.4.12/checks/105.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/105.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -1,20 +1,15 @@ -dnl @ ../doc/m4.texinfo:4090: Origin of test +dnl @ ../doc/m4.texinfo:4164: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -changequote(`[', `]')dnl -define([a], [1, (b)])dnl -define([b], [2])dnl -define([quote], [[$*]])dnl -define([expand], [_$0(($1))])dnl -define([_expand], - [changequote([(], [)])$1changequote`'changequote(`[', `]')])dnl -expand([a, a, [a, a], [[a, a]]]) -dnl @result{}1, (2), 1, (2), a, a, [a, a] -quote(a, a, [a, a], [[a, a]]) -dnl @result{}1,(2),1,(2),a, a,[a, a] +changequote(`[', `]') +dnl @result{} +define([foo], [Macro [foo].]) +dnl @result{} +foo +dnl @result{}Macro foo. diff -ruNp m4-1.4.12/checks/106.changequot m4-1.4.13/checks/106.changequot --- m4-1.4.12/checks/106.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/106.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -1,27 +1,17 @@ -dnl @ ../doc/m4.texinfo:4111: Origin of test +dnl @ ../doc/m4.texinfo:4179: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`hi', `HI') +define(`a', `b') dnl @result{} -changequote(`""', `"') +«a» +dnl @result{}«b» +changequote(`«', `»') dnl @result{} -""hi"""hi" -dnl @result{}hihi -""hi" ""hi" -dnl @result{}hi hi -""hi"" "hi" -dnl @result{}hi" "HI" -changequote -dnl @result{} -`hi`hi'hi' -dnl @result{}hi`hi'hi -changequote(`"', `"') -dnl @result{} -"hi"hi"hi" -dnl @result{}hiHIhi +«a» +dnl @result{}a diff -ruNp m4-1.4.12/checks/107.changequot m4-1.4.13/checks/107.changequot --- m4-1.4.12/checks/107.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/107.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -1,15 +1,15 @@ -dnl @ ../doc/m4.texinfo:4134: Origin of test +dnl @ ../doc/m4.texinfo:4194: Origin of test dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`aaaaaaaaaaaaaaaaaaaa', `A')define(`q', `"$@"') +changequote(`[[[', `]]]') dnl @result{} -changequote(`"', `"') +define([[[foo]]], [[[Macro [[[[[foo]]]]].]]]) dnl @result{} -q(q("aaaaaaaaaaaaaaaaaaaa", "a")) -dnl @result{}A,a +foo +dnl @result{}Macro [[foo]]. diff -ruNp m4-1.4.12/checks/108.changequot m4-1.4.13/checks/108.changequot --- m4-1.4.12/checks/108.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/108.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -1,13 +1,21 @@ -dnl @ ../doc/m4.texinfo:4147: Origin of test -dnl @ expected status: 1 +dnl @ ../doc/m4.texinfo:4216: Origin of test +dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -`hello world' -dnl @result{}hello world -`dangling quote -dnl @error{}m4:stdin:2: ERROR: end of file in string +define(`foo', `Macro `FOO'.') +dnl @result{} +changequote(`', `') +dnl @result{} +foo +dnl @result{}Macro `FOO'. +`foo' +dnl @result{}`Macro `FOO'.' +changequote(`,) +dnl @result{} +foo +dnl @result{}Macro FOO. diff -ruNp m4-1.4.12/checks/109.changequot m4-1.4.13/checks/109.changequot --- m4-1.4.12/checks/109.changequot 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/109.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -1,11 +1,33 @@ -dnl @ ../doc/m4.texinfo:4156: Origin of test -dnl @ expected status: 1 +dnl @ ../doc/m4.texinfo:4249: Origin of test +dnl @ expected status: 0 dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -ifelse(`dangling quote -dnl @error{}m4:stdin:1: ERROR: end of file in string +define(`echo', `$@') +dnl @result{} +define(`hi', `HI') +dnl @result{} +changequote(`q', `Q') +dnl @result{} +q hi Q hi +dnl @result{}q HI Q HI +echo(hi) +dnl @result{}qHIQ +changequote +dnl @result{} +changequote(`-', `EOF') +dnl @result{} +- hi EOF hi +dnl @result{} hi HI +changequote +dnl @result{} +changequote(`1', `2') +dnl @result{} +hi1hi2 +dnl @result{}hi1hi2 +hi 1hi2 +dnl @result{}HI hi diff -ruNp m4-1.4.12/checks/110.changecom m4-1.4.13/checks/110.changecom --- m4-1.4.12/checks/110.changecom 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/110.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:4181: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`comment', `COMMENT') -dnl @result{} -# A normal comment -dnl @result{}# A normal comment -changecom(`/*', `*/') -dnl @result{} -# Not a comment anymore -dnl @result{}# Not a COMMENT anymore -But: /* this is a comment now */ while this is not a comment -dnl @result{}But: /* this is a comment now */ while this is not a COMMENT diff -ruNp m4-1.4.12/checks/110.changequot m4-1.4.13/checks/110.changequot --- m4-1.4.12/checks/110.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/110.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:4282: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`echo', `$#:$@:') +dnl @result{} +define(`hi', `HI') +dnl @result{} +changequote(`(',`)') +dnl @result{} +echo(hi) +dnl @result{}0::hi +changequote +dnl @result{} +changequote(`((', `))') +dnl @result{} +echo(hi) +dnl @result{}1:HI: +echo((hi)) +dnl @result{}0::hi +changequote +dnl @result{} +changequote(`,', `)') +dnl @result{} +echo(hi,hi)bye) +dnl @result{}1:HIhibye: diff -ruNp m4-1.4.12/checks/111.changecom m4-1.4.13/checks/111.changecom --- m4-1.4.12/checks/111.changecom 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/111.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:4208: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`comment', `COMMENT') -dnl @result{} -changecom -dnl @result{} -# Not a comment anymore -dnl @result{}# Not a COMMENT anymore -changecom(`#', `') -dnl @result{} -# comment again -dnl @result{}# comment again diff -ruNp m4-1.4.12/checks/111.changequot m4-1.4.13/checks/111.changequot --- m4-1.4.12/checks/111.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/111.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,20 @@ +dnl @ ../doc/m4.texinfo:4321: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +changequote(`[', `]')dnl +define([a], [1, (b)])dnl +define([b], [2])dnl +define([quote], [[$*]])dnl +define([expand], [_$0(($1))])dnl +define([_expand], + [changequote([(], [)])$1changequote`'changequote(`[', `]')])dnl +expand([a, a, [a, a], [[a, a]]]) +dnl @result{}1, (2), 1, (2), a, a, [a, a] +quote(a, a, [a, a], [[a, a]]) +dnl @result{}1,(2),1,(2),a, a,[a, a] diff -ruNp m4-1.4.12/checks/112.changecom m4-1.4.13/checks/112.changecom --- m4-1.4.12/checks/112.changecom 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/112.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:4227: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`a', `b') -dnl @result{} -«a» -dnl @result{}«b» -changecom(`«', `»') -dnl @result{} -«a» -dnl @result{}«a» diff -ruNp m4-1.4.12/checks/112.changequot m4-1.4.13/checks/112.changequot --- m4-1.4.12/checks/112.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/112.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,27 @@ +dnl @ ../doc/m4.texinfo:4342: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`hi', `HI') +dnl @result{} +changequote(`""', `"') +dnl @result{} +""hi"""hi" +dnl @result{}hihi +""hi" ""hi" +dnl @result{}hi hi +""hi"" "hi" +dnl @result{}hi" "HI" +changequote +dnl @result{} +`hi`hi'hi' +dnl @result{}hi`hi'hi +changequote(`"', `"') +dnl @result{} +"hi"hi"hi" +dnl @result{}hiHIhi diff -ruNp m4-1.4.12/checks/113.changecom m4-1.4.13/checks/113.changecom --- m4-1.4.12/checks/113.changecom 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/113.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,23 +0,0 @@ -dnl @ ../doc/m4.texinfo:4250: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`hi', `HI') -dnl @result{} -define(`hi1hi2', `hello') -dnl @result{} -changecom(`q', `Q') -dnl @result{} -q hi Q hi -dnl @result{}q hi Q HI -changecom(`1', `2') -dnl @result{} -hi1hi2 -dnl @result{}hello -hi 1hi2 -dnl @result{}HI 1hi2 diff -ruNp m4-1.4.12/checks/113.changequot m4-1.4.13/checks/113.changequot --- m4-1.4.12/checks/113.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/113.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:4365: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`aaaaaaaaaaaaaaaaaaaa', `A')define(`q', `"$@"') +dnl @result{} +changequote(`"', `"') +dnl @result{} +q(q("aaaaaaaaaaaaaaaaaaaa", "a")) +dnl @result{}A,a diff -ruNp m4-1.4.12/checks/114.changecom m4-1.4.13/checks/114.changecom --- m4-1.4.12/checks/114.changecom 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/114.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,35 +0,0 @@ -dnl @ ../doc/m4.texinfo:4273: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`echo', `$#:$*:$@:') -dnl @result{} -define(`hi', `HI') -dnl @result{} -changecom(`(',`)') -dnl @result{} -echo(hi) -dnl @result{}0:::(hi) -changecom -dnl @result{} -changecom(`((', `))') -dnl @result{} -echo(hi) -dnl @result{}1:HI:HI: -echo((hi)) -dnl @result{}0:::((hi)) -changecom(`,', `)') -dnl @result{} -echo(hi,hi)bye) -dnl @result{}1:HI,hi)bye:HI,hi)bye: -changecom -dnl @result{} -echo(hi,`,`'hi',hi) -dnl @result{}3:HI,,HI,HI:HI,,`'hi,HI: -echo(hi,`,`'hi',hi`'changecom(`,,', `hi')) -dnl @result{}3:HI,,`'hi,HI:HI,,`'hi,HI: diff -ruNp m4-1.4.12/checks/114.changequot m4-1.4.13/checks/114.changequot --- m4-1.4.12/checks/114.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/114.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:4378: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +`hello world' +dnl @result{}hello world +`dangling quote +dnl @error{}m4:stdin:2: ERROR: end of file in string diff -ruNp m4-1.4.12/checks/115.changecom m4-1.4.13/checks/115.changecom --- m4-1.4.12/checks/115.changecom 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/115.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:4305: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -changecom(`/*', `*/') -dnl @result{} -/*dangling comment -dnl @error{}m4:stdin:2: ERROR: end of file in comment diff -ruNp m4-1.4.12/checks/115.changequot m4-1.4.13/checks/115.changequot --- m4-1.4.12/checks/115.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/115.changequot 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:4387: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifelse(`dangling quote +dnl @error{}m4:stdin:1: ERROR: end of file in string diff -ruNp m4-1.4.12/checks/116.changecom m4-1.4.13/checks/116.changecom --- m4-1.4.12/checks/116.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/116.changecom 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:4412: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`comment', `COMMENT') +dnl @result{} +# A normal comment +dnl @result{}# A normal comment +changecom(`/*', `*/') +dnl @result{} +# Not a comment anymore +dnl @result{}# Not a COMMENT anymore +But: /* this is a comment now */ while this is not a comment +dnl @result{}But: /* this is a comment now */ while this is not a COMMENT diff -ruNp m4-1.4.12/checks/116.changeword m4-1.4.13/checks/116.changeword --- m4-1.4.12/checks/116.changeword 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/116.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:4358: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifdef(`changeword', `', `errprint(` skipping: no changeword support -')m4exit(`77')')dnl -changeword(`[_a-zA-Z0-9]+') -dnl @result{} -define(`1', `0')1 -dnl @result{}0 diff -ruNp m4-1.4.12/checks/117.changecom m4-1.4.13/checks/117.changecom --- m4-1.4.12/checks/117.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/117.changecom 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:4439: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`comment', `COMMENT') +dnl @result{} +changecom +dnl @result{} +# Not a comment anymore +dnl @result{}# Not a COMMENT anymore +changecom(`#', `') +dnl @result{} +# comment again +dnl @result{}# comment again diff -ruNp m4-1.4.12/checks/117.changeword m4-1.4.13/checks/117.changeword --- m4-1.4.12/checks/117.changeword 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/117.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,20 +0,0 @@ -dnl @ ../doc/m4.texinfo:4371: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifdef(`changeword', `', `errprint(` skipping: no changeword support -')m4exit(`77')')dnl -define(`_indir', defn(`indir')) -dnl @result{} -changeword(`_[_a-zA-Z0-9]*') -dnl @result{} -esyscmd(`foo') -dnl @result{}esyscmd(foo) -_indir(`esyscmd', `echo hi') -dnl @result{}hi -dnl @result{} diff -ruNp m4-1.4.12/checks/118.changecom m4-1.4.13/checks/118.changecom --- m4-1.4.12/checks/118.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/118.changecom 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:4458: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`a', `b') +dnl @result{} +«a» +dnl @result{}«b» +changecom(`«', `»') +dnl @result{} +«a» +dnl @result{}«a» diff -ruNp m4-1.4.12/checks/118.changeword m4-1.4.13/checks/118.changeword --- m4-1.4.12/checks/118.changeword 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/118.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,41 +0,0 @@ -dnl @ ../doc/m4.texinfo:4390: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifdef(`changeword', `', `errprint(` skipping: no changeword support -')m4exit(`77')')dnl -define(`foo -', `bar -') -dnl @result{} -dnl This example wants to recognize changeword, dnl, and `foo\n'. -dnl First, we check that our regexp will match. -regexp(`changeword', `[cd][a-z]*\|foo[ -]') -dnl @result{}0 -regexp(`foo -', `[cd][a-z]*\|foo[ -]') -dnl @result{}0 -regexp(`f', `[cd][a-z]*\|foo[ -]') -dnl @result{}-1 -foo -dnl @result{}foo -changeword(`[cd][a-z]*\|foo[ -]') -dnl @result{} -dnl Even though `foo\n' matches, we forgot to allow `f'. -foo -dnl @result{}foo -changeword(`[cd][a-z]*\|fo*[ -]?') -dnl @result{} -dnl Now we can call `foo\n'. -foo -dnl @result{}bar diff -ruNp m4-1.4.12/checks/119.changecom m4-1.4.13/checks/119.changecom --- m4-1.4.12/checks/119.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/119.changecom 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,23 @@ +dnl @ ../doc/m4.texinfo:4481: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`hi', `HI') +dnl @result{} +define(`hi1hi2', `hello') +dnl @result{} +changecom(`q', `Q') +dnl @result{} +q hi Q hi +dnl @result{}q hi Q HI +changecom(`1', `2') +dnl @result{} +hi1hi2 +dnl @result{}hello +hi 1hi2 +dnl @result{}HI 1hi2 diff -ruNp m4-1.4.12/checks/119.changeword m4-1.4.13/checks/119.changeword --- m4-1.4.12/checks/119.changeword 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/119.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,39 +0,0 @@ -dnl @ ../doc/m4.texinfo:4432: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifdef(`changeword', `', `errprint(` skipping: no changeword support -')m4exit(`77')')dnl -define(`bar -', defn(`dnl'))dnl -define(`baz', `dnl -include(`foo') ignored -dnl')dnl -changeword(`\([_a-zA-Z][_a-zA-Z0-9]*\|bar -\)') -dnl @result{} -__file__:__line__ -dnl @result{}stdin:10 -include(`foo') ignored -__file__:__line__ -dnl @result{}stdin:12 -baz ignored -__file__:__line__ -dnl @result{}stdin:14 -define(`bar -', defn(`__file__')) -dnl @result{} -include(`foo') -dnl @result{}examples/foo -define(`bar -', defn(`__line__')) -dnl @result{} -include(`foo') -dnl @result{}1 -__file__:__line__ -dnl @result{}stdin:21 diff -ruNp m4-1.4.12/checks/120.changecom m4-1.4.13/checks/120.changecom --- m4-1.4.12/checks/120.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/120.changecom 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,35 @@ +dnl @ ../doc/m4.texinfo:4504: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`echo', `$#:$*:$@:') +dnl @result{} +define(`hi', `HI') +dnl @result{} +changecom(`(',`)') +dnl @result{} +echo(hi) +dnl @result{}0:::(hi) +changecom +dnl @result{} +changecom(`((', `))') +dnl @result{} +echo(hi) +dnl @result{}1:HI:HI: +echo((hi)) +dnl @result{}0:::((hi)) +changecom(`,', `)') +dnl @result{} +echo(hi,hi)bye) +dnl @result{}1:HI,hi)bye:HI,hi)bye: +changecom +dnl @result{} +echo(hi,`,`'hi',hi) +dnl @result{}3:HI,,HI,HI:HI,,`'hi,HI: +echo(hi,`,`'hi',hi`'changecom(`,,', `hi')) +dnl @result{}3:HI,,`'hi,HI:HI,,`'hi,HI: diff -ruNp m4-1.4.12/checks/120.changeword m4-1.4.13/checks/120.changeword --- m4-1.4.12/checks/120.changeword 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/120.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,21 +0,0 @@ -dnl @ ../doc/m4.texinfo:4470: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifdef(`changeword', `', `errprint(` skipping: no changeword support -')m4exit(`77')')dnl -ifdef(`__unix__', , - `errprint(` skipping: syscmd does not have unix semantics -')m4exit(`77')')dnl -changecom(`/*', `*/')dnl -define(`foo', `bar')dnl -changeword(`#\([_a-zA-Z0-9]*\)') -dnl @result{} -#esyscmd(`echo foo \#foo') -dnl @result{}foo bar -dnl @result{} diff -ruNp m4-1.4.12/checks/121.changecom m4-1.4.13/checks/121.changecom --- m4-1.4.12/checks/121.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/121.changecom 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:4536: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +changecom(`/*', `*/') +dnl @result{} +/*dangling comment +dnl @error{}m4:stdin:2: ERROR: end of file in comment diff -ruNp m4-1.4.12/checks/121.changeword m4-1.4.13/checks/121.changeword --- m4-1.4.12/checks/121.changeword 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/121.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:4507: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifdef(`changeword', `', `errprint(` skipping: no changeword support -')m4exit(`77')')dnl -define(`a', `errprint(`Hello')')dnl -changeword(`@\([_a-zA-Z0-9]*\)') -dnl @result{} -@a -dnl @result{}errprint(Hello) diff -ruNp m4-1.4.12/checks/122.changeword m4-1.4.13/checks/122.changeword --- m4-1.4.12/checks/122.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/122.changeword 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:4590: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifdef(`changeword', `', `errprint(` skipping: no changeword support +')m4exit(`77')')dnl +changeword(`[_a-zA-Z0-9]+') +dnl @result{} +define(`1', `0')1 +dnl @result{}0 diff -ruNp m4-1.4.12/checks/122.m4wrap m4-1.4.13/checks/122.m4wrap --- m4-1.4.12/checks/122.m4wrap 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/122.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:4560: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`cleanup', `This is the `cleanup' action. -') -dnl @result{} -m4wrap(`cleanup') -dnl @result{} -This is the first and last normal input line. -dnl @result{}This is the first and last normal input line. -dnl @result{}This is the cleanup action. diff -ruNp m4-1.4.12/checks/123.changeword m4-1.4.13/checks/123.changeword --- m4-1.4.12/checks/123.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/123.changeword 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,20 @@ +dnl @ ../doc/m4.texinfo:4603: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifdef(`changeword', `', `errprint(` skipping: no changeword support +')m4exit(`77')')dnl +define(`_indir', defn(`indir')) +dnl @result{} +changeword(`_[_a-zA-Z0-9]*') +dnl @result{} +esyscmd(`foo') +dnl @result{}esyscmd(foo) +_indir(`esyscmd', `echo hi') +dnl @result{}hi +dnl @result{} diff -ruNp m4-1.4.12/checks/123.m4wrap m4-1.4.13/checks/123.m4wrap --- m4-1.4.12/checks/123.m4wrap 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/123.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,26 +0,0 @@ -dnl @ ../doc/m4.texinfo:4592: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -undivert(`wrapfifo.m4')dnl -dnl @result{}dnl Redefine m4wrap to have FIFO semantics. -dnl @result{}define(`_m4wrap_level', `0')dnl -dnl @result{}define(`m4wrap', -dnl @result{}`ifdef(`m4wrap'_m4wrap_level, -dnl @result{} `define(`m4wrap'_m4wrap_level, -dnl @result{} defn(`m4wrap'_m4wrap_level)`$1')', -dnl @result{} `builtin(`m4wrap', `define(`_m4wrap_level', -dnl @result{} incr(_m4wrap_level))dnl -dnl @result{}m4wrap'_m4wrap_level)dnl -dnl @result{}define(`m4wrap'_m4wrap_level, `$1')')')dnl -include(`wrapfifo.m4') -dnl @result{} -m4wrap(`a`'m4wrap(`c -', `d')')m4wrap(`b') -dnl @result{} -dnl @result{}abc diff -ruNp m4-1.4.12/checks/124.changeword m4-1.4.13/checks/124.changeword --- m4-1.4.12/checks/124.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/124.changeword 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,41 @@ +dnl @ ../doc/m4.texinfo:4622: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifdef(`changeword', `', `errprint(` skipping: no changeword support +')m4exit(`77')')dnl +define(`foo +', `bar +') +dnl @result{} +dnl This example wants to recognize changeword, dnl, and `foo\n'. +dnl First, we check that our regexp will match. +regexp(`changeword', `[cd][a-z]*\|foo[ +]') +dnl @result{}0 +regexp(`foo +', `[cd][a-z]*\|foo[ +]') +dnl @result{}0 +regexp(`f', `[cd][a-z]*\|foo[ +]') +dnl @result{}-1 +foo +dnl @result{}foo +changeword(`[cd][a-z]*\|foo[ +]') +dnl @result{} +dnl Even though `foo\n' matches, we forgot to allow `f'. +foo +dnl @result{}foo +changeword(`[cd][a-z]*\|fo*[ +]?') +dnl @result{} +dnl Now we can call `foo\n'. +foo +dnl @result{}bar diff -ruNp m4-1.4.12/checks/124.m4wrap m4-1.4.13/checks/124.m4wrap --- m4-1.4.12/checks/124.m4wrap 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/124.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,26 +0,0 @@ -dnl @ ../doc/m4.texinfo:4622: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -undivert(`wraplifo.m4')dnl -dnl @result{}dnl Redefine m4wrap to have LIFO semantics. -dnl @result{}define(`_m4wrap_level', `0')dnl -dnl @result{}define(`_m4wrap', defn(`m4wrap'))dnl -dnl @result{}define(`m4wrap', -dnl @result{}`ifdef(`m4wrap'_m4wrap_level, -dnl @result{} `define(`m4wrap'_m4wrap_level, -dnl @result{} `$1'defn(`m4wrap'_m4wrap_level))', -dnl @result{} `_m4wrap(`define(`_m4wrap_level', incr(_m4wrap_level))dnl -dnl @result{}m4wrap'_m4wrap_level)dnl -dnl @result{}define(`m4wrap'_m4wrap_level, `$1')')')dnl -include(`wraplifo.m4') -dnl @result{} -m4wrap(`a`'m4wrap(`c -', `d')')m4wrap(`b') -dnl @result{} -dnl @result{}bac diff -ruNp m4-1.4.12/checks/125.changeword m4-1.4.13/checks/125.changeword --- m4-1.4.12/checks/125.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/125.changeword 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,39 @@ +dnl @ ../doc/m4.texinfo:4664: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifdef(`changeword', `', `errprint(` skipping: no changeword support +')m4exit(`77')')dnl +define(`bar +', defn(`dnl'))dnl +define(`baz', `dnl +include(`foo') ignored +dnl')dnl +changeword(`\([_a-zA-Z][_a-zA-Z0-9]*\|bar +\)') +dnl @result{} +__file__:__line__ +dnl @result{}stdin:10 +include(`foo') ignored +__file__:__line__ +dnl @result{}stdin:12 +baz ignored +__file__:__line__ +dnl @result{}stdin:14 +define(`bar +', defn(`__file__')) +dnl @result{} +include(`foo') +dnl @result{}examples/foo +define(`bar +', defn(`__line__')) +dnl @result{} +include(`foo') +dnl @result{}1 +__file__:__line__ +dnl @result{}stdin:21 diff -ruNp m4-1.4.12/checks/125.m4wrap m4-1.4.13/checks/125.m4wrap --- m4-1.4.12/checks/125.m4wrap 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/125.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:4647: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`f', `ifelse(`$1', `0', `Answer: 0!=1 -', eval(`$1>1'), `0', `Answer: $2$1=eval(`$2$1') -', `m4wrap(`f(decr(`$1'), `$2$1*')')')') -dnl @result{} -f(`10') -dnl @result{} -dnl @result{}Answer: 10*9*8*7*6*5*4*3*2*1=3628800 diff -ruNp m4-1.4.12/checks/126.changeword m4-1.4.13/checks/126.changeword --- m4-1.4.12/checks/126.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/126.changeword 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:4702: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifdef(`changeword', `', `errprint(` skipping: no changeword support +')m4exit(`77')')dnl +ifdef(`__unix__', , + `errprint(` skipping: syscmd does not have unix semantics +')m4exit(`77')')dnl +changecom(`/*', `*/')dnl +define(`foo', `bar')dnl +changeword(`#\([_a-zA-Z0-9]*\)') +dnl @result{} +#esyscmd(`echo foo \#foo') +dnl @result{}foo bar +dnl @result{} diff -ruNp m4-1.4.12/checks/126.m4wrap m4-1.4.13/checks/126.m4wrap --- m4-1.4.12/checks/126.m4wrap 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/126.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:4661: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`aa', `AA -') -dnl @result{} -m4wrap(`a')m4wrap(`a') -dnl @result{} -dnl @result{}AA diff -ruNp m4-1.4.12/checks/127.changeword m4-1.4.13/checks/127.changeword --- m4-1.4.12/checks/127.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/127.changeword 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:4739: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifdef(`changeword', `', `errprint(` skipping: no changeword support +')m4exit(`77')')dnl +define(`a', `errprint(`Hello')')dnl +changeword(`@\([_a-zA-Z0-9]*\)') +dnl @result{} +@a +dnl @result{}errprint(Hello) diff -ruNp m4-1.4.12/checks/127.m4wrap m4-1.4.13/checks/127.m4wrap --- m4-1.4.12/checks/127.m4wrap 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/127.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:4676: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -m4wrap(`m4wrap(`)')len(abc') -dnl @result{} -dnl @error{}m4:stdin:1: ERROR: end of file in argument list diff -ruNp m4-1.4.12/checks/128.include m4-1.4.13/checks/128.include --- m4-1.4.12/checks/128.include 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/128.include 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:4719: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`none') -dnl @error{}m4:stdin:1: cannot open `none': No such file or directory -dnl @result{} -include() -dnl @error{}m4:stdin:2: cannot open `': No such file or directory -dnl @result{} -sinclude(`none') -dnl @result{} -sinclude() -dnl @result{} diff -ruNp m4-1.4.12/checks/128.m4wrap m4-1.4.13/checks/128.m4wrap --- m4-1.4.12/checks/128.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/128.m4wrap 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:4792: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`cleanup', `This is the `cleanup' action. +') +dnl @result{} +m4wrap(`cleanup') +dnl @result{} +This is the first and last normal input line. +dnl @result{}This is the first and last normal input line. +dnl @result{}This is the cleanup action. diff -ruNp m4-1.4.12/checks/129.include m4-1.4.13/checks/129.include --- m4-1.4.12/checks/129.include 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/129.include 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:4752: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `FOO') -dnl @result{} -include(`incl.m4') -dnl @result{}Include file start -dnl @result{}FOO -dnl @result{}Include file end -dnl @result{} diff -ruNp m4-1.4.12/checks/129.m4wrap m4-1.4.13/checks/129.m4wrap --- m4-1.4.12/checks/129.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/129.m4wrap 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,26 @@ +dnl @ ../doc/m4.texinfo:4824: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +undivert(`wrapfifo.m4')dnl +dnl @result{}dnl Redefine m4wrap to have FIFO semantics. +dnl @result{}define(`_m4wrap_level', `0')dnl +dnl @result{}define(`m4wrap', +dnl @result{}`ifdef(`m4wrap'_m4wrap_level, +dnl @result{} `define(`m4wrap'_m4wrap_level, +dnl @result{} defn(`m4wrap'_m4wrap_level)`$1')', +dnl @result{} `builtin(`m4wrap', `define(`_m4wrap_level', +dnl @result{} incr(_m4wrap_level))dnl +dnl @result{}m4wrap'_m4wrap_level)dnl +dnl @result{}define(`m4wrap'_m4wrap_level, `$1')')')dnl +include(`wrapfifo.m4') +dnl @result{} +m4wrap(`a`'m4wrap(`c +', `d')')m4wrap(`b') +dnl @result{} +dnl @result{}abc diff -ruNp m4-1.4.12/checks/130.include m4-1.4.13/checks/130.include --- m4-1.4.12/checks/130.include 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/130.include 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:4769: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`bar', include(`incl.m4')) -dnl @result{} -This is `bar': >>bar<< -dnl @result{}This is bar: >>Include file start -dnl @result{}foo -dnl @result{}Include file end -dnl @result{}<< diff -ruNp m4-1.4.12/checks/130.m4wrap m4-1.4.13/checks/130.m4wrap --- m4-1.4.12/checks/130.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/130.m4wrap 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,26 @@ +dnl @ ../doc/m4.texinfo:4854: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +undivert(`wraplifo.m4')dnl +dnl @result{}dnl Redefine m4wrap to have LIFO semantics. +dnl @result{}define(`_m4wrap_level', `0')dnl +dnl @result{}define(`_m4wrap', defn(`m4wrap'))dnl +dnl @result{}define(`m4wrap', +dnl @result{}`ifdef(`m4wrap'_m4wrap_level, +dnl @result{} `define(`m4wrap'_m4wrap_level, +dnl @result{} `$1'defn(`m4wrap'_m4wrap_level))', +dnl @result{} `_m4wrap(`define(`_m4wrap_level', incr(_m4wrap_level))dnl +dnl @result{}m4wrap'_m4wrap_level)dnl +dnl @result{}define(`m4wrap'_m4wrap_level, `$1')')')dnl +include(`wraplifo.m4') +dnl @result{} +m4wrap(`a`'m4wrap(`c +', `d')')m4wrap(`b') +dnl @result{} +dnl @result{}bac diff -ruNp m4-1.4.12/checks/131.include m4-1.4.13/checks/131.include --- m4-1.4.12/checks/131.include 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/131.include 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:4798: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -dnl @ expected error: ignore -include(`Makefile/') -dnl @error{}m4:stdin:1: cannot open `Makefile/': Not a directory -dnl @result{} diff -ruNp m4-1.4.12/checks/131.m4wrap m4-1.4.13/checks/131.m4wrap --- m4-1.4.12/checks/131.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/131.m4wrap 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:4879: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`f', `ifelse(`$1', `0', `Answer: 0!=1 +', eval(`$1>1'), `0', `Answer: $2$1=eval(`$2$1') +', `m4wrap(`f(decr(`$1'), `$2$1*')')')') +dnl @result{} +f(`10') +dnl @result{} +dnl @result{}Answer: 10*9*8*7*6*5*4*3*2*1=3628800 diff -ruNp m4-1.4.12/checks/132.include m4-1.4.13/checks/132.include --- m4-1.4.12/checks/132.include 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/132.include 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:4811: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -dnl @ expected error: ignore -include(`.') -dnl @error{}m4:stdin:1: cannot open `.': Is a directory -dnl @result{} diff -ruNp m4-1.4.12/checks/132.m4wrap m4-1.4.13/checks/132.m4wrap --- m4-1.4.12/checks/132.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/132.m4wrap 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:4893: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`aa', `AA +') +dnl @result{} +m4wrap(`a')m4wrap(`a') +dnl @result{} +dnl @result{}AA diff -ruNp m4-1.4.12/checks/133.include m4-1.4.13/checks/133.include --- m4-1.4.12/checks/133.include 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/133.include 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:4819: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -sinclude(`Makefile/') -dnl @result{} -sinclude(`.') -dnl @result{} diff -ruNp m4-1.4.12/checks/133.m4wrap m4-1.4.13/checks/133.m4wrap --- m4-1.4.12/checks/133.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/133.m4wrap 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:4908: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +m4wrap(`m4wrap(`)')len(abc') +dnl @result{} +dnl @error{}m4:stdin:1: ERROR: end of file in argument list diff -ruNp m4-1.4.12/checks/134.diversions m4-1.4.13/checks/134.diversions --- m4-1.4.12/checks/134.diversions 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/134.diversions 1969-12-31 17:00:00.000000000 -0700 @@ -1,36 +0,0 @@ -dnl @ ../doc/m4.texinfo:4877: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`-1')define(`f', `.') -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -divert`'dnl -len(f) -dnl @result{}1048576 -divert(`1') -f -divert(`-1')undivert diff -ruNp m4-1.4.12/checks/134.include m4-1.4.13/checks/134.include --- m4-1.4.12/checks/134.include 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/134.include 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:4951: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`none') +dnl @error{}m4:stdin:1: cannot open `none': No such file or directory +dnl @result{} +include() +dnl @error{}m4:stdin:2: cannot open `': No such file or directory +dnl @result{} +sinclude(`none') +dnl @result{} +sinclude() +dnl @result{} diff -ruNp m4-1.4.12/checks/135.diversions m4-1.4.13/checks/135.diversions --- m4-1.4.12/checks/135.diversions 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/135.diversions 1969-12-31 17:00:00.000000000 -0700 @@ -1,36 +0,0 @@ -dnl @ ../doc/m4.texinfo:4909: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`-1')define(`f', `.') -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -define(`f', defn(`f')defn(`f')) -divert`'dnl -len(f) -dnl @result{}1048576 -divert(`1') -f -m4exit diff -ruNp m4-1.4.12/checks/135.include m4-1.4.13/checks/135.include --- m4-1.4.12/checks/135.include 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/135.include 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:4984: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `FOO') +dnl @result{} +include(`incl.m4') +dnl @result{}Include file start +dnl @result{}FOO +dnl @result{}Include file end +dnl @result{} diff -ruNp m4-1.4.12/checks/136.diversions m4-1.4.13/checks/136.diversions --- m4-1.4.12/checks/136.diversions 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/136.diversions 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:4941: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifdef(`__unix__', , - `errprint(` skipping: syscmd does not have unix semantics -')m4exit(`77')')dnl -changequote(`[', `]')dnl -syscmd([echo 'divert(1)hi -format(%1000000d, 1)' | ]__program__[ | sed -n 1p])dnl -dnl @result{}hi -sysval -dnl @result{}0 diff -ruNp m4-1.4.12/checks/136.include m4-1.4.13/checks/136.include --- m4-1.4.12/checks/136.include 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/136.include 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:5001: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`bar', include(`incl.m4')) +dnl @result{} +This is `bar': >>bar<< +dnl @result{}This is bar: >>Include file start +dnl @result{}foo +dnl @result{}Include file end +dnl @result{}<< diff -ruNp m4-1.4.12/checks/137.divert m4-1.4.13/checks/137.divert --- m4-1.4.12/checks/137.divert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/137.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:4988: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`1') -This text is diverted. -divert -dnl @result{} -This text is not diverted. -dnl @result{}This text is not diverted. -dnl @result{} -dnl @result{}This text is diverted. diff -ruNp m4-1.4.12/checks/137.include m4-1.4.13/checks/137.include --- m4-1.4.12/checks/137.include 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/137.include 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:5030: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +dnl @ expected error: ignore +include(`Makefile/') +dnl @error{}m4:stdin:1: cannot open `Makefile/': Not a directory +dnl @result{} diff -ruNp m4-1.4.12/checks/138.divert m4-1.4.13/checks/138.divert --- m4-1.4.12/checks/138.divert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/138.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:5004: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`text', `TEXT') -dnl @result{} -divert(`1')`diverted text.' -divert -dnl @result{} -m4wrap(`Wrapped text precedes ') -dnl @result{} -dnl @result{}Wrapped TEXT precedes diverted text. diff -ruNp m4-1.4.12/checks/138.include m4-1.4.13/checks/138.include --- m4-1.4.12/checks/138.include 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/138.include 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:5043: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +dnl @ expected error: ignore +include(`.') +dnl @error{}m4:stdin:1: cannot open `.': Is a directory +dnl @result{} diff -ruNp m4-1.4.12/checks/139.divert m4-1.4.13/checks/139.divert --- m4-1.4.12/checks/139.divert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/139.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:5023: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`-1') -define(`foo', `Macro `foo'.') -define(`bar', `Macro `bar'.') -divert -dnl @result{} diff -ruNp m4-1.4.12/checks/139.include m4-1.4.13/checks/139.include --- m4-1.4.12/checks/139.include 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/139.include 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:5051: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +sinclude(`Makefile/') +dnl @result{} +sinclude(`.') +dnl @result{} diff -ruNp m4-1.4.12/checks/140.diversions m4-1.4.13/checks/140.diversions --- m4-1.4.12/checks/140.diversions 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/140.diversions 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,40 @@ +dnl @ ../doc/m4.texinfo:5109: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`-1')define(`f', `.') +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +divert`'dnl +len(f) +dnl @result{}1048576 +divert(`1') +f +divert(`2') +f +divert(`-1')undivert +divert(`1')bye +dnl @result{}bye diff -ruNp m4-1.4.12/checks/140.divert m4-1.4.13/checks/140.divert --- m4-1.4.12/checks/140.divert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/140.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:5037: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(eval(`1<<28'))world -divert(`2')hello -dnl @result{}hello -dnl @result{}world diff -ruNp m4-1.4.12/checks/141.diversions m4-1.4.13/checks/141.diversions --- m4-1.4.12/checks/141.diversions 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/141.diversions 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,36 @@ +dnl @ ../doc/m4.texinfo:5146: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`-1')define(`f', `.') +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +define(`f', defn(`f')defn(`f')) +divert`'dnl +len(f) +dnl @result{}1048576 +divert(`1') +f +m4exit diff -ruNp m4-1.4.12/checks/141.divert m4-1.4.13/checks/141.divert --- m4-1.4.12/checks/141.divert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/141.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:5052: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -We decided to divert the stream for irrigation. -dnl @result{}We decided to the stream for irrigation. -define(`divert', `ifelse(`$#', `0', ``$0'', `builtin(`$0', $@)')') -dnl @result{} -divert(`-1') -Ignored text. -divert(`0') -dnl @result{} -We decided to divert the stream for irrigation. -dnl @result{}We decided to divert the stream for irrigation. diff -ruNp m4-1.4.12/checks/142.diversions m4-1.4.13/checks/142.diversions --- m4-1.4.12/checks/142.diversions 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/142.diversions 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:5178: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifdef(`__unix__', , + `errprint(` skipping: syscmd does not have unix semantics +')m4exit(`77')')dnl +changequote(`[', `]')dnl +syscmd([echo 'divert(1)hi +format(%1000000d, 1)' | ']__program__[' | sed -n 1p])dnl +dnl @result{}hi +sysval +dnl @result{}0 diff -ruNp m4-1.4.12/checks/142.undivert m4-1.4.13/checks/142.undivert --- m4-1.4.12/checks/142.undivert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/142.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:5086: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`1') -This text is diverted. -divert -dnl @result{} -This text is not diverted. -dnl @result{}This text is not diverted. -undivert(`1') -dnl @result{} -dnl @result{}This text is diverted. -dnl @result{} diff -ruNp m4-1.4.12/checks/143.diversions m4-1.4.13/checks/143.diversions --- m4-1.4.12/checks/143.diversions 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/143.diversions 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:5194: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`forloop2.m4')dnl +divert(`1')format(`%10000s', `')dnl +forloop(`i', `1', `10000', + `divert(incr(i))undivert(i)')dnl +divert(`9001')format(`%1000000s', `')dnl +forloop(`i', `9001', `10000', + `divert(incr(i))undivert(i)')dnl +divert(`-1')undivert diff -ruNp m4-1.4.12/checks/143.undivert m4-1.4.13/checks/143.undivert --- m4-1.4.12/checks/143.undivert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/143.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:5109: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`1')diverted text -divert -dnl @result{} -undivert() -dnl @result{} -undivert(`0') -dnl @result{} -undivert -dnl @result{}diverted text -dnl @result{} diff -ruNp m4-1.4.12/checks/144.divert m4-1.4.13/checks/144.divert --- m4-1.4.12/checks/144.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/144.divert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:5241: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`1') +This text is diverted. +divert +dnl @result{} +This text is not diverted. +dnl @result{}This text is not diverted. +dnl @result{} +dnl @result{}This text is diverted. diff -ruNp m4-1.4.12/checks/144.undivert m4-1.4.13/checks/144.undivert --- m4-1.4.12/checks/144.undivert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/144.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,21 +0,0 @@ -dnl @ ../doc/m4.texinfo:5125: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`1') -This text is diverted first. -divert(`0')undivert(`1')dnl -dnl @result{} -dnl @result{}This text is diverted first. -undivert(`1') -dnl @result{} -divert(`1') -This text is also diverted but not appended. -divert(`0')undivert(`1')dnl -dnl @result{} -dnl @result{}This text is also diverted but not appended. diff -ruNp m4-1.4.12/checks/145.divert m4-1.4.13/checks/145.divert --- m4-1.4.12/checks/145.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/145.divert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:5257: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`text', `TEXT') +dnl @result{} +divert(`1')`diverted text.' +divert +dnl @result{} +m4wrap(`Wrapped text precedes ') +dnl @result{} +dnl @result{}Wrapped TEXT precedes diverted text. diff -ruNp m4-1.4.12/checks/145.undivert m4-1.4.13/checks/145.undivert --- m4-1.4.12/checks/145.undivert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/145.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:5144: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`1')one -divert(`2')two -divert(`3')three -divert(`2')undivert`'dnl -divert`'undivert`'dnl -dnl @result{}two -dnl @result{}one -dnl @result{}three diff -ruNp m4-1.4.12/checks/146.divert m4-1.4.13/checks/146.divert --- m4-1.4.12/checks/146.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/146.divert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:5276: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`-1') +define(`foo', `Macro `foo'.') +define(`bar', `Macro `bar'.') +divert +dnl @result{} diff -ruNp m4-1.4.12/checks/146.undivert m4-1.4.13/checks/146.undivert --- m4-1.4.12/checks/146.undivert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/146.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:5173: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`bar', `BAR') -dnl @result{} -undivert(`foo') -dnl @result{}bar -dnl @result{} -include(`foo') -dnl @result{}BAR -dnl @result{} diff -ruNp m4-1.4.12/checks/147.divert m4-1.4.13/checks/147.divert --- m4-1.4.12/checks/147.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/147.divert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:5290: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(eval(`1<<28'))world +divert(`2')hello +dnl @result{}hello +dnl @result{}world diff -ruNp m4-1.4.12/checks/147.undivert m4-1.4.13/checks/147.undivert --- m4-1.4.12/checks/147.undivert 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/147.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:5188: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`1')diversion one -divert(`2')undivert(`foo')dnl -divert(`3')diversion three -divert`'dnl -undivert(`1', `2', `foo', `3')dnl -dnl @result{}diversion one -dnl @result{}bar -dnl @result{}bar -dnl @result{}diversion three diff -ruNp m4-1.4.12/checks/148.divert m4-1.4.13/checks/148.divert --- m4-1.4.12/checks/148.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/148.divert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:5305: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +We decided to divert the stream for irrigation. +dnl @result{}We decided to the stream for irrigation. +define(`divert', `ifelse(`$#', `0', ``$0'', `builtin(`$0', $@)')') +dnl @result{} +divert(`-1') +Ignored text. +divert(`0') +dnl @result{} +We decided to divert the stream for irrigation. +dnl @result{}We decided to divert the stream for irrigation. diff -ruNp m4-1.4.12/checks/148.divnum m4-1.4.13/checks/148.divnum --- m4-1.4.12/checks/148.divnum 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/148.divnum 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:5210: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -Initial divnum -dnl @result{}Initial 0 -divert(`1') -Diversion one: divnum -divert(`2') -Diversion two: divnum -dnl @result{} -dnl @result{}Diversion one: 1 -dnl @result{} -dnl @result{}Diversion two: 2 diff -ruNp m4-1.4.12/checks/149.cleardiver m4-1.4.13/checks/149.cleardiver --- m4-1.4.12/checks/149.cleardiver 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/149.cleardiver 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:5236: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(`1') -Diversion one: divnum -divert(`2') -Diversion two: divnum -divert(`-1') -undivert diff -ruNp m4-1.4.12/checks/149.undivert m4-1.4.13/checks/149.undivert --- m4-1.4.12/checks/149.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/149.undivert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:5339: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`1') +This text is diverted. +divert +dnl @result{} +This text is not diverted. +dnl @result{}This text is not diverted. +undivert(`1') +dnl @result{} +dnl @result{}This text is diverted. +dnl @result{} diff -ruNp m4-1.4.12/checks/150.cleardiver m4-1.4.13/checks/150.cleardiver --- m4-1.4.12/checks/150.cleardiver 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/150.cleardiver 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:5255: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`cleardivert', -`pushdef(`_n', divnum)divert(`-1')undivert($@)divert(_n)popdef(`_n')') -dnl @result{} diff -ruNp m4-1.4.12/checks/150.undivert m4-1.4.13/checks/150.undivert --- m4-1.4.12/checks/150.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/150.undivert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,27 @@ +dnl @ ../doc/m4.texinfo:5362: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`1')diverted text +divert +dnl @result{} +undivert() +dnl @result{} +undivert(`0') +dnl @result{} +undivert +dnl @result{}diverted text +dnl @result{} +divert(`1')more +divert(`2')undivert(`1')diverted text`'divert +dnl @result{} +undivert(`1') +dnl @result{} +undivert(`2') +dnl @result{}more +dnl @result{}diverted text diff -ruNp m4-1.4.12/checks/151.len m4-1.4.13/checks/151.len --- m4-1.4.12/checks/151.len 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/151.len 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:5295: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -len() -dnl @result{}0 -len(`abcdef') -dnl @result{}6 diff -ruNp m4-1.4.12/checks/151.undivert m4-1.4.13/checks/151.undivert --- m4-1.4.12/checks/151.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/151.undivert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:5386: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`1') +This text is diverted first. +divert(`0')undivert(`1')dnl +dnl @result{} +dnl @result{}This text is diverted first. +undivert(`1') +dnl @result{} +divert(`1') +This text is also diverted but not appended. +divert(`0')undivert(`1')dnl +dnl @result{} +dnl @result{}This text is also diverted but not appended. diff -ruNp m4-1.4.12/checks/152.index_macr m4-1.4.13/checks/152.index_macr --- m4-1.4.12/checks/152.index_macr 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/152.index_macr 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:5317: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -index(`gnus, gnats, and armadillos', `nat') -dnl @result{}7 -index(`gnus, gnats, and armadillos', `dag') -dnl @result{}-1 diff -ruNp m4-1.4.12/checks/152.undivert m4-1.4.13/checks/152.undivert --- m4-1.4.12/checks/152.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/152.undivert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:5405: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`1')one +divert(`2')two +divert(`3')three +divert(`2')undivert`'dnl +divert`'undivert`'dnl +dnl @result{}two +dnl @result{}one +dnl @result{}three diff -ruNp m4-1.4.12/checks/153.index_macr m4-1.4.13/checks/153.index_macr --- m4-1.4.12/checks/153.index_macr 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/153.index_macr 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:5327: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -index(`abc') -dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `index' -dnl @result{}0 -index(`abc', `') -dnl @result{}0 -index(`abc', `b') -dnl @result{}1 diff -ruNp m4-1.4.12/checks/153.undivert m4-1.4.13/checks/153.undivert --- m4-1.4.12/checks/153.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/153.undivert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:5434: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`bar', `BAR') +dnl @result{} +undivert(`foo') +dnl @result{}bar +dnl @result{} +include(`foo') +dnl @result{}BAR +dnl @result{} diff -ruNp m4-1.4.12/checks/154.regexp m4-1.4.13/checks/154.regexp --- m4-1.4.12/checks/154.regexp 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/154.regexp 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:5380: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -regexp(`GNUs not Unix', `\<[a-z]\w+') -dnl @result{}5 -regexp(`GNUs not Unix', `\<Q\w*') -dnl @result{}-1 -regexp(`GNUs not Unix', `\w\(\w+\)$', `*** \& *** \1 ***') -dnl @result{}*** Unix *** nix *** -regexp(`GNUs not Unix', `\<Q\w*', `*** \& *** \1 ***') -dnl @result{} diff -ruNp m4-1.4.12/checks/154.undivert m4-1.4.13/checks/154.undivert --- m4-1.4.12/checks/154.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/154.undivert 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:5449: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`1')diversion one +divert(`2')undivert(`foo')dnl +divert(`3')diversion three +divert`'dnl +undivert(`1', `2', `foo', `3')dnl +dnl @result{}diversion one +dnl @result{}bar +dnl @result{}bar +dnl @result{}diversion three diff -ruNp m4-1.4.12/checks/155.divnum m4-1.4.13/checks/155.divnum --- m4-1.4.12/checks/155.divnum 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/155.divnum 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:5471: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +Initial divnum +dnl @result{}Initial 0 +divert(`1') +Diversion one: divnum +divert(`2') +Diversion two: divnum +dnl @result{} +dnl @result{}Diversion one: 1 +dnl @result{} +dnl @result{}Diversion two: 2 diff -ruNp m4-1.4.12/checks/155.regexp m4-1.4.13/checks/155.regexp --- m4-1.4.12/checks/155.regexp 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/155.regexp 1969-12-31 17:00:00.000000000 -0700 @@ -1,20 +0,0 @@ -dnl @ ../doc/m4.texinfo:5393: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -regexp(`abc', `\(b\)', `\\\10\a') -dnl @result{}\b0a -regexp(`abc', `b', `\1\') -dnl @error{}m4:stdin:2: Warning: sub-expression 1 not present -dnl @error{}m4:stdin:2: Warning: trailing \ ignored in replacement -dnl @result{} -regexp(`abc', `\(\(d\)?\)\(c\)', `\1\2\3\4\5\6') -dnl @error{}m4:stdin:3: Warning: sub-expression 4 not present -dnl @error{}m4:stdin:3: Warning: sub-expression 5 not present -dnl @error{}m4:stdin:3: Warning: sub-expression 6 not present -dnl @result{}c diff -ruNp m4-1.4.12/checks/156.cleardiver m4-1.4.13/checks/156.cleardiver --- m4-1.4.12/checks/156.cleardiver 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/156.cleardiver 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:5497: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(`1') +Diversion one: divnum +divert(`2') +Diversion two: divnum +divert(`-1') +undivert diff -ruNp m4-1.4.12/checks/156.regexp m4-1.4.13/checks/156.regexp --- m4-1.4.12/checks/156.regexp 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/156.regexp 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:5410: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -regexp(`abc') -dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `regexp' -dnl @result{}0 -regexp(`abc', `') -dnl @result{}0 -regexp(`abc', `', `\\def') -dnl @result{}\def diff -ruNp m4-1.4.12/checks/157.cleardiver m4-1.4.13/checks/157.cleardiver --- m4-1.4.12/checks/157.cleardiver 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/157.cleardiver 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:5516: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`cleardivert', +`pushdef(`_n', divnum)divert(`-1')undivert($@)divert(_n)popdef(`_n')') +dnl @result{} diff -ruNp m4-1.4.12/checks/157.substr m4-1.4.13/checks/157.substr --- m4-1.4.12/checks/157.substr 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/157.substr 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:5438: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -substr(`gnus, gnats, and armadillos', `6') -dnl @result{}gnats, and armadillos -substr(`gnus, gnats, and armadillos', `6', `5') -dnl @result{}gnats diff -ruNp m4-1.4.12/checks/158.len m4-1.4.13/checks/158.len --- m4-1.4.12/checks/158.len 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/158.len 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:5556: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +len() +dnl @result{}0 +len(`abcdef') +dnl @result{}6 diff -ruNp m4-1.4.12/checks/158.substr m4-1.4.13/checks/158.substr --- m4-1.4.12/checks/158.substr 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/158.substr 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:5447: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -substr(`abc') -dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `substr' -dnl @result{}abc -substr(`abc',) -dnl @error{}m4:stdin:2: empty string treated as 0 in builtin `substr' -dnl @result{}abc diff -ruNp m4-1.4.12/checks/159.index_macr m4-1.4.13/checks/159.index_macr --- m4-1.4.12/checks/159.index_macr 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/159.index_macr 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:5578: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +index(`gnus, gnats, and armadillos', `nat') +dnl @result{}7 +index(`gnus, gnats, and armadillos', `dag') +dnl @result{}-1 diff -ruNp m4-1.4.12/checks/159.translit m4-1.4.13/checks/159.translit --- m4-1.4.12/checks/159.translit 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/159.translit 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:5492: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -translit(`GNUs not Unix', `A-Z') -dnl @result{}s not nix -translit(`GNUs not Unix', `a-z', `A-Z') -dnl @result{}GNUS NOT UNIX -translit(`GNUs not Unix', `A-Z', `z-a') -dnl @result{}tmfs not fnix -translit(`+,-12345', `+--1-5', `<;>a-c-a') -dnl @result{}<;>abcba -translit(`abcdef', `aabdef', `bcged') -dnl @result{}bgced diff -ruNp m4-1.4.12/checks/160.index_macr m4-1.4.13/checks/160.index_macr --- m4-1.4.12/checks/160.index_macr 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/160.index_macr 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:5588: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +index(`abc') +dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `index' +dnl @result{}0 +index(`abc', `') +dnl @result{}0 +index(`abc', `b') +dnl @result{}1 diff -ruNp m4-1.4.12/checks/160.translit m4-1.4.13/checks/160.translit --- m4-1.4.12/checks/160.translit 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/160.translit 1969-12-31 17:00:00.000000000 -0700 @@ -1,11 +0,0 @@ -dnl @ ../doc/m4.texinfo:5519: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -translit(`«abc~', `~-»') -dnl @result{}abc diff -ruNp m4-1.4.12/checks/161.regexp m4-1.4.13/checks/161.regexp --- m4-1.4.12/checks/161.regexp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/161.regexp 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:5641: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +regexp(`GNUs not Unix', `\<[a-z]\w+') +dnl @result{}5 +regexp(`GNUs not Unix', `\<Q\w*') +dnl @result{}-1 +regexp(`GNUs not Unix', `\w\(\w+\)$', `*** \& *** \1 ***') +dnl @result{}*** Unix *** nix *** +regexp(`GNUs not Unix', `\<Q\w*', `*** \& *** \1 ***') +dnl @result{} diff -ruNp m4-1.4.12/checks/161.translit m4-1.4.13/checks/161.translit --- m4-1.4.12/checks/161.translit 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/161.translit 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:5527: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -translit(`abc') -dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `translit' -dnl @result{}abc diff -ruNp m4-1.4.12/checks/162.patsubst m4-1.4.13/checks/162.patsubst --- m4-1.4.12/checks/162.patsubst 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/162.patsubst 1969-12-31 17:00:00.000000000 -0700 @@ -1,22 +0,0 @@ -dnl @ ../doc/m4.texinfo:5571: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -patsubst(`GNUs not Unix', `^', `OBS: ') -dnl @result{}OBS: GNUs not Unix -patsubst(`GNUs not Unix', `\<', `OBS: ') -dnl @result{}OBS: GNUs OBS: not OBS: Unix -patsubst(`GNUs not Unix', `\w*', `(\&)') -dnl @result{}(GNUs)() (not)() (Unix)() -patsubst(`GNUs not Unix', `\w+', `(\&)') -dnl @result{}(GNUs) (not) (Unix) -patsubst(`GNUs not Unix', `[A-Z][a-z]+') -dnl @result{}GN not -patsubst(`GNUs not Unix', `not', `NOT\') -dnl @error{}m4:stdin:6: Warning: trailing \ ignored in replacement -dnl @result{}GNUs NOT Unix diff -ruNp m4-1.4.12/checks/162.regexp m4-1.4.13/checks/162.regexp --- m4-1.4.12/checks/162.regexp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/162.regexp 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,20 @@ +dnl @ ../doc/m4.texinfo:5654: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +regexp(`abc', `\(b\)', `\\\10\a') +dnl @result{}\b0a +regexp(`abc', `b', `\1\') +dnl @error{}m4:stdin:2: Warning: sub-expression 1 not present +dnl @error{}m4:stdin:2: Warning: trailing \ ignored in replacement +dnl @result{} +regexp(`abc', `\(\(d\)?\)\(c\)', `\1\2\3\4\5\6') +dnl @error{}m4:stdin:3: Warning: sub-expression 4 not present +dnl @error{}m4:stdin:3: Warning: sub-expression 5 not present +dnl @error{}m4:stdin:3: Warning: sub-expression 6 not present +dnl @result{}c diff -ruNp m4-1.4.12/checks/163.patsubst m4-1.4.13/checks/163.patsubst --- m4-1.4.12/checks/163.patsubst 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/163.patsubst 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:5604: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`capitalize.m4') -dnl @result{} -upcase(`GNUs not Unix') -dnl @result{}GNUS NOT UNIX -downcase(`GNUs not Unix') -dnl @result{}gnus not unix -capitalize(`GNUs not Unix') -dnl @result{}Gnus Not Unix diff -ruNp m4-1.4.12/checks/163.regexp m4-1.4.13/checks/163.regexp --- m4-1.4.12/checks/163.regexp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/163.regexp 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:5671: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +regexp(`abc') +dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `regexp' +dnl @result{}0 +regexp(`abc', `') +dnl @result{}0 +regexp(`abc', `', `\\def') +dnl @result{}\def diff -ruNp m4-1.4.12/checks/164.patsubst m4-1.4.13/checks/164.patsubst --- m4-1.4.12/checks/164.patsubst 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/164.patsubst 1969-12-31 17:00:00.000000000 -0700 @@ -1,22 +0,0 @@ -dnl @ ../doc/m4.texinfo:5624: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -undivert(`capitalize.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# upcase(text) -dnl @result{}# downcase(text) -dnl @result{}# capitalize(text) -dnl @result{}# change case of text, simple version -dnl @result{}define(`upcase', `translit(`$*', `a-z', `A-Z')') -dnl @result{}define(`downcase', `translit(`$*', `A-Z', `a-z')') -dnl @result{}define(`_capitalize', -dnl @result{} `regexp(`$1', `^\(\w\)\(\w*\)', -dnl @result{} `upcase(`\1')`'downcase(`\2')')') -dnl @result{}define(`capitalize', `patsubst(`$1', `\w+', `_$0(`\&')')') -dnl @result{}divert`'dnl diff -ruNp m4-1.4.12/checks/164.substr m4-1.4.13/checks/164.substr --- m4-1.4.12/checks/164.substr 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/164.substr 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:5699: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +substr(`gnus, gnats, and armadillos', `6') +dnl @result{}gnats, and armadillos +substr(`gnus, gnats, and armadillos', `6', `5') +dnl @result{}gnats diff -ruNp m4-1.4.12/checks/165.patsubst m4-1.4.13/checks/165.patsubst --- m4-1.4.12/checks/165.patsubst 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/165.patsubst 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:5645: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`patreg', -`patsubst($@) -regexp($@)')dnl -patreg(`bar foo baz Foo', `foo\|Foo', `FOO') -dnl @result{}bar FOO baz FOO -dnl @result{}FOO -patreg(`aba abb 121', `\(.\)\(.\)\1', `\2\1\2') -dnl @result{}bab abb 212 -dnl @result{}bab diff -ruNp m4-1.4.12/checks/165.substr m4-1.4.13/checks/165.substr --- m4-1.4.12/checks/165.substr 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/165.substr 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:5708: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +substr(`abc') +dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `substr' +dnl @result{}abc +substr(`abc',) +dnl @error{}m4:stdin:2: empty string treated as 0 in builtin `substr' +dnl @result{}abc diff -ruNp m4-1.4.12/checks/166.patsubst m4-1.4.13/checks/166.patsubst --- m4-1.4.12/checks/166.patsubst 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/166.patsubst 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:5660: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -patsubst(`abc') -dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `patsubst' -dnl @result{}abc -patsubst(`abc', `') -dnl @result{}abc -patsubst(`abc', `', `\\-') -dnl @result{}\-a\-b\-c\- diff -ruNp m4-1.4.12/checks/166.translit m4-1.4.13/checks/166.translit --- m4-1.4.12/checks/166.translit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/166.translit 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:5753: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +translit(`GNUs not Unix', `A-Z') +dnl @result{}s not nix +translit(`GNUs not Unix', `a-z', `A-Z') +dnl @result{}GNUS NOT UNIX +translit(`GNUs not Unix', `A-Z', `z-a') +dnl @result{}tmfs not fnix +translit(`+,-12345', `+--1-5', `<;>a-c-a') +dnl @result{}<;>abcba +translit(`abcdef', `aabdef', `bcged') +dnl @result{}bgced diff -ruNp m4-1.4.12/checks/167.format m4-1.4.13/checks/167.format --- m4-1.4.12/checks/167.format 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/167.format 1969-12-31 17:00:00.000000000 -0700 @@ -1,29 +0,0 @@ -dnl @ ../doc/m4.texinfo:5691: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `The brown fox jumped over the lazy dog') -dnl @result{} -format(`The string "%s" uses %d characters', foo, len(foo)) -dnl @result{}The string "The brown fox jumped over the lazy dog" uses 38 characters -format(`%*.*d', `-1', `-1', `1') -dnl @result{}1 -format(`%.0f', `56789.9876') -dnl @result{}56790 -len(format(`%-*X', `5000', `1')) -dnl @result{}5000 -ifelse(format(`%010F', `infinity'), ` INF', `success', - format(`%010F', `infinity'), ` INFINITY', `success', - format(`%010F', `infinity')) -dnl @result{}success -ifelse(format(`%.1A', `1.999'), `0X1.0P+1', `success', - format(`%.1A', `1.999'), `0X2.0P+0', `success', - format(`%.1A', `1.999')) -dnl @result{}success -format(`%g', `0xa.P+1') -dnl @result{}20 diff -ruNp m4-1.4.12/checks/167.translit m4-1.4.13/checks/167.translit --- m4-1.4.12/checks/167.translit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/167.translit 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:5780: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +translit(`«abc~', `~-»') +dnl @result{}abc diff -ruNp m4-1.4.12/checks/168.format m4-1.4.13/checks/168.format --- m4-1.4.12/checks/168.format 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/168.format 1969-12-31 17:00:00.000000000 -0700 @@ -1,24 +0,0 @@ -dnl @ ../doc/m4.texinfo:5718: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`forloop.m4') -dnl @result{} -forloop(`i', `1', `10', `format(`%6d squared is %10d -', i, eval(i**2))') -dnl @result{} 1 squared is 1 -dnl @result{} 2 squared is 4 -dnl @result{} 3 squared is 9 -dnl @result{} 4 squared is 16 -dnl @result{} 5 squared is 25 -dnl @result{} 6 squared is 36 -dnl @result{} 7 squared is 49 -dnl @result{} 8 squared is 64 -dnl @result{} 9 squared is 81 -dnl @result{} 10 squared is 100 -dnl @result{} diff -ruNp m4-1.4.12/checks/168.translit m4-1.4.13/checks/168.translit --- m4-1.4.12/checks/168.translit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/168.translit 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:5787: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +translit(`abcdeabcde', `a') +dnl @result{}bcdebcde +translit(`abcdeabcde', `ab') +dnl @result{}cdecde +translit(`abcdeabcde', `a', `f') +dnl @result{}fbcdefbcde +translit(`abcdeabcde', `a', `f') +dnl @result{}fbcdefbcde +translit(`abcdeabcde', `a', `fg') +dnl @result{}fbcdefbcde +translit(`abcdeabcde', `ab', `f') +dnl @result{}fcdefcde +translit(`abcdeabcde', `ab', `fg') +dnl @result{}fgcdefgcde +translit(`abcdeabcde', `ab', `ba') +dnl @result{}bacdebacde +translit(`abcdeabcde', `e', `f') +dnl @result{}abcdfabcdf +translit(`abc', `', `cde') +dnl @result{}abc +translit(`', `a', `bc') +dnl @result{} diff -ruNp m4-1.4.12/checks/169.format m4-1.4.13/checks/169.format --- m4-1.4.12/checks/169.format 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/169.format 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:5759: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -format(`%p', `0') -dnl @error{}m4:stdin:1: Warning: unrecognized specifier in `%p' -dnl @result{} diff -ruNp m4-1.4.12/checks/169.translit m4-1.4.13/checks/169.translit --- m4-1.4.12/checks/169.translit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/169.translit 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:5815: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +translit(`abc') +dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `translit' +dnl @result{}abc diff -ruNp m4-1.4.12/checks/170.incr m4-1.4.13/checks/170.incr --- m4-1.4.12/checks/170.incr 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/170.incr 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:5797: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -incr(`4') -dnl @result{}5 -decr(`7') -dnl @result{}6 -incr() -dnl @error{}m4:stdin:3: empty string treated as 0 in builtin `incr' -dnl @result{}1 -decr() -dnl @error{}m4:stdin:4: empty string treated as 0 in builtin `decr' -dnl @result{}-1 diff -ruNp m4-1.4.12/checks/170.patsubst m4-1.4.13/checks/170.patsubst --- m4-1.4.12/checks/170.patsubst 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/170.patsubst 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,22 @@ +dnl @ ../doc/m4.texinfo:5859: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +patsubst(`GNUs not Unix', `^', `OBS: ') +dnl @result{}OBS: GNUs not Unix +patsubst(`GNUs not Unix', `\<', `OBS: ') +dnl @result{}OBS: GNUs OBS: not OBS: Unix +patsubst(`GNUs not Unix', `\w*', `(\&)') +dnl @result{}(GNUs)() (not)() (Unix)() +patsubst(`GNUs not Unix', `\w+', `(\&)') +dnl @result{}(GNUs) (not) (Unix) +patsubst(`GNUs not Unix', `[A-Z][a-z]+') +dnl @result{}GN not +patsubst(`GNUs not Unix', `not', `NOT\') +dnl @error{}m4:stdin:6: Warning: trailing \ ignored in replacement +dnl @result{}GNUs NOT Unix diff -ruNp m4-1.4.12/checks/171.eval m4-1.4.13/checks/171.eval --- m4-1.4.12/checks/171.eval 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/171.eval 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:5874: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -eval(`2 = 2') -dnl @error{}m4:stdin:1: Warning: recommend ==, not =, for equality operator -dnl @result{}1 -eval(`++0') -dnl @error{}m4:stdin:2: invalid operator in eval: ++0 -dnl @result{} -eval(`0 |= 1') -dnl @error{}m4:stdin:3: invalid operator in eval: 0 |= 1 -dnl @result{} diff -ruNp m4-1.4.12/checks/171.patsubst m4-1.4.13/checks/171.patsubst --- m4-1.4.12/checks/171.patsubst 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/171.patsubst 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:5892: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`capitalize.m4') +dnl @result{} +upcase(`GNUs not Unix') +dnl @result{}GNUS NOT UNIX +downcase(`GNUs not Unix') +dnl @result{}gnus not unix +capitalize(`GNUs not Unix') +dnl @result{}Gnus Not Unix diff -ruNp m4-1.4.12/checks/172.eval m4-1.4.13/checks/172.eval --- m4-1.4.12/checks/172.eval 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/172.eval 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:5907: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -eval(`1 == 2 > 0') -dnl @result{}1 -eval(`(1 == 2) > 0') -dnl @result{}0 -eval(`! 0 * 2') -dnl @result{}2 -eval(`! (0 * 2)') -dnl @result{}1 -eval(`1 | 1 ^ 1') -dnl @result{}1 -eval(`(1 | 1) ^ 1') -dnl @result{}0 -eval(`+ + - ~ ! ~ 0') -dnl @result{}1 -eval(`2 || 1 / 0') -dnl @result{}1 -eval(`0 || 1 / 0') -dnl @error{}m4:stdin:9: divide by zero in eval: 0 || 1 / 0 -dnl @result{} -eval(`0 && 1 % 0') -dnl @result{}0 -eval(`2 && 1 % 0') -dnl @error{}m4:stdin:11: modulo by zero in eval: 2 && 1 % 0 -dnl @result{} diff -ruNp m4-1.4.12/checks/172.patsubst m4-1.4.13/checks/172.patsubst --- m4-1.4.12/checks/172.patsubst 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/172.patsubst 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,22 @@ +dnl @ ../doc/m4.texinfo:5912: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +undivert(`capitalize.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# upcase(text) +dnl @result{}# downcase(text) +dnl @result{}# capitalize(text) +dnl @result{}# change case of text, simple version +dnl @result{}define(`upcase', `translit(`$*', `a-z', `A-Z')') +dnl @result{}define(`downcase', `translit(`$*', `A-Z', `a-z')') +dnl @result{}define(`_capitalize', +dnl @result{} `regexp(`$1', `^\(\w\)\(\w*\)', +dnl @result{} `upcase(`\1')`'downcase(`\2')')') +dnl @result{}define(`capitalize', `patsubst(`$1', `\w+', `_$0(`\&')')') +dnl @result{}divert`'dnl diff -ruNp m4-1.4.12/checks/173.eval m4-1.4.13/checks/173.eval --- m4-1.4.12/checks/173.eval 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/173.eval 1969-12-31 17:00:00.000000000 -0700 @@ -1,23 +0,0 @@ -dnl @ ../doc/m4.texinfo:5940: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -eval(`2 ** 3 ** 2') -dnl @result{}512 -eval(`(2 ** 3) ** 2') -dnl @result{}64 -eval(`0 ** 1') -dnl @result{}0 -eval(`2 ** 0') -dnl @result{}1 -eval(`0 ** 0') -dnl @result{} -dnl @error{}m4:stdin:5: divide by zero in eval: 0 ** 0 -eval(`4 ** -2') -dnl @error{}m4:stdin:6: negative exponent in eval: 4 ** -2 -dnl @result{} diff -ruNp m4-1.4.12/checks/173.patsubst m4-1.4.13/checks/173.patsubst --- m4-1.4.12/checks/173.patsubst 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/173.patsubst 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:5933: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`patreg', +`patsubst($@) +regexp($@)')dnl +patreg(`bar foo baz Foo', `foo\|Foo', `FOO') +dnl @result{}bar FOO baz FOO +dnl @result{}FOO +patreg(`aba abb 121', `\(.\)\(.\)\1', `\2\1\2') +dnl @result{}bab abb 212 +dnl @result{}bab diff -ruNp m4-1.4.12/checks/174.eval m4-1.4.13/checks/174.eval --- m4-1.4.12/checks/174.eval 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/174.eval 1969-12-31 17:00:00.000000000 -0700 @@ -1,34 +0,0 @@ -dnl @ ../doc/m4.texinfo:5976: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -eval(`-3 * 5') -dnl @result{}-15 -eval(`-99 / 10') -dnl @result{}-9 -eval(`-99 % 10') -dnl @result{}-9 -eval(`99 % -10') -dnl @result{}9 -eval(index(`Hello world', `llo') >= 0) -dnl @result{}1 -eval(`0r1:0111 + 0b100 + 0r3:12') -dnl @result{}12 -define(`square', `eval(`($1) ** 2')') -dnl @result{} -square(`9') -dnl @result{}81 -square(square(`5')` + 1') -dnl @result{}676 -define(`foo', `666') -dnl @result{} -eval(`foo / 6') -dnl @error{}m4:stdin:11: bad expression in eval: foo / 6 -dnl @result{} -eval(foo / 6) -dnl @result{}111 diff -ruNp m4-1.4.12/checks/174.patsubst m4-1.4.13/checks/174.patsubst --- m4-1.4.12/checks/174.patsubst 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/174.patsubst 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:5948: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +patsubst(`abc') +dnl @error{}m4:stdin:1: Warning: too few arguments to builtin `patsubst' +dnl @result{}abc +patsubst(`abc', `') +dnl @result{}abc +patsubst(`abc', `', `\\-') +dnl @result{}\-a\-b\-c\- diff -ruNp m4-1.4.12/checks/175.eval m4-1.4.13/checks/175.eval --- m4-1.4.12/checks/175.eval 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/175.eval 1969-12-31 17:00:00.000000000 -0700 @@ -1,27 +0,0 @@ -dnl @ ../doc/m4.texinfo:6015: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`max_int', eval(`0x7fffffff')) -dnl @result{} -define(`min_int', incr(max_int)) -dnl @result{} -eval(min_int` < 0') -dnl @result{}1 -eval(max_int` > 0') -dnl @result{}1 -ifelse(eval(min_int` / -1'), min_int, `overflow occurred') -dnl @result{}overflow occurred -min_int -dnl @result{}-2147483648 -eval(`0x80000000 % -1') -dnl @result{}0 -eval(`-4 >> 1') -dnl @result{}-2 -eval(`-4 >> 33') -dnl @result{}-2 diff -ruNp m4-1.4.12/checks/175.format m4-1.4.13/checks/175.format --- m4-1.4.12/checks/175.format 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/175.format 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,29 @@ +dnl @ ../doc/m4.texinfo:5979: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `The brown fox jumped over the lazy dog') +dnl @result{} +format(`The string "%s" uses %d characters', foo, len(foo)) +dnl @result{}The string "The brown fox jumped over the lazy dog" uses 38 characters +format(`%*.*d', `-1', `-1', `1') +dnl @result{}1 +format(`%.0f', `56789.9876') +dnl @result{}56790 +len(format(`%-*X', `5000', `1')) +dnl @result{}5000 +ifelse(format(`%010F', `infinity'), ` INF', `success', + format(`%010F', `infinity'), ` INFINITY', `success', + format(`%010F', `infinity')) +dnl @result{}success +ifelse(format(`%.1A', `1.999'), `0X1.0P+1', `success', + format(`%.1A', `1.999'), `0X2.0P+0', `success', + format(`%.1A', `1.999')) +dnl @result{}success +format(`%g', `0xa.P+1') +dnl @result{}20 diff -ruNp m4-1.4.12/checks/176.eval m4-1.4.13/checks/176.eval --- m4-1.4.12/checks/176.eval 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/176.eval 1969-12-31 17:00:00.000000000 -0700 @@ -1,34 +0,0 @@ -dnl @ ../doc/m4.texinfo:6048: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -eval(`666', `10') -dnl @result{}666 -eval(`666', `11') -dnl @result{}556 -eval(`666', `6') -dnl @result{}3030 -eval(`666', `6', `10') -dnl @result{}0000003030 -eval(`-666', `6', `10') -dnl @result{}-0000003030 -eval(`10', `', `0') -dnl @result{}10 -`0r1:'eval(`10', `1', `11') -dnl @result{}0r1:01111111111 -eval(`10', `16') -dnl @result{}a -eval(`1', `37') -dnl @error{}m4:stdin:9: radix 37 in builtin `eval' out of range -dnl @result{} -eval(`1', , `-1') -dnl @error{}m4:stdin:10: negative width to builtin `eval' -dnl @result{} -eval() -dnl @error{}m4:stdin:11: empty string treated as 0 in builtin `eval' -dnl @result{}0 diff -ruNp m4-1.4.12/checks/176.format m4-1.4.13/checks/176.format --- m4-1.4.12/checks/176.format 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/176.format 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,24 @@ +dnl @ ../doc/m4.texinfo:6006: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`forloop.m4') +dnl @result{} +forloop(`i', `1', `10', `format(`%6d squared is %10d +', i, eval(i**2))') +dnl @result{} 1 squared is 1 +dnl @result{} 2 squared is 4 +dnl @result{} 3 squared is 9 +dnl @result{} 4 squared is 16 +dnl @result{} 5 squared is 25 +dnl @result{} 6 squared is 36 +dnl @result{} 7 squared is 49 +dnl @result{} 8 squared is 64 +dnl @result{} 9 squared is 81 +dnl @result{} 10 squared is 100 +dnl @result{} diff -ruNp m4-1.4.12/checks/177.format m4-1.4.13/checks/177.format --- m4-1.4.12/checks/177.format 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/177.format 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:6047: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +format(`%p', `0') +dnl @error{}m4:stdin:1: Warning: unrecognized specifier in `%p' +dnl @result{} diff -ruNp m4-1.4.12/checks/177.platform_m m4-1.4.13/checks/177.platform_m --- m4-1.4.12/checks/177.platform_m 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/177.platform_m 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:6129: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -__gnu__ -dnl @result{} -__gnu__(`ignored') -dnl @result{} -Extensions are ifdef(`__gnu__', `active', `inactive') -dnl @result{}Extensions are active diff -ruNp m4-1.4.12/checks/178.incr m4-1.4.13/checks/178.incr --- m4-1.4.12/checks/178.incr 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/178.incr 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:6085: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +incr(`4') +dnl @result{}5 +decr(`7') +dnl @result{}6 +incr() +dnl @error{}m4:stdin:3: empty string treated as 0 in builtin `incr' +dnl @result{}1 +decr() +dnl @error{}m4:stdin:4: empty string treated as 0 in builtin `decr' +dnl @result{}-1 diff -ruNp m4-1.4.12/checks/178.platform_m m4-1.4.13/checks/178.platform_m --- m4-1.4.12/checks/178.platform_m 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/178.platform_m 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:6140: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -G -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -__gnu__ -dnl @result{}__gnu__ -__gnu__(`ignored') -dnl @result{}__gnu__(ignored) -Extensions are ifdef(`__gnu__', `active', `inactive') -dnl @result{}Extensions are inactive diff -ruNp m4-1.4.12/checks/179.eval m4-1.4.13/checks/179.eval --- m4-1.4.12/checks/179.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/179.eval 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:6162: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +eval(`2 = 2') +dnl @error{}m4:stdin:1: Warning: recommend ==, not =, for equality operator +dnl @result{}1 +eval(`++0') +dnl @error{}m4:stdin:2: invalid operator in eval: ++0 +dnl @result{} +eval(`0 |= 1') +dnl @error{}m4:stdin:3: invalid operator in eval: 0 |= 1 +dnl @result{} diff -ruNp m4-1.4.12/checks/179.platform_m m4-1.4.13/checks/179.platform_m --- m4-1.4.12/checks/179.platform_m 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/179.platform_m 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:6163: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`provided', `0') -dnl @result{} -ifdef(`__unix__', `define(`provided', incr(provided))') -dnl @result{} -ifdef(`__windows__', `define(`provided', incr(provided))') -dnl @result{} -ifdef(`__os2__', `define(`provided', incr(provided))') -dnl @result{} -provided -dnl @result{}1 diff -ruNp m4-1.4.12/checks/180.eval m4-1.4.13/checks/180.eval --- m4-1.4.12/checks/180.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/180.eval 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,33 @@ +dnl @ ../doc/m4.texinfo:6195: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +eval(`1 == 2 > 0') +dnl @result{}1 +eval(`(1 == 2) > 0') +dnl @result{}0 +eval(`! 0 * 2') +dnl @result{}2 +eval(`! (0 * 2)') +dnl @result{}1 +eval(`1 | 1 ^ 1') +dnl @result{}1 +eval(`(1 | 1) ^ 1') +dnl @result{}0 +eval(`+ + - ~ ! ~ 0') +dnl @result{}1 +eval(`2 || 1 / 0') +dnl @result{}1 +eval(`0 || 1 / 0') +dnl @error{}m4:stdin:9: divide by zero in eval: 0 || 1 / 0 +dnl @result{} +eval(`0 && 1 % 0') +dnl @result{}0 +eval(`2 && 1 % 0') +dnl @error{}m4:stdin:11: modulo by zero in eval: 2 && 1 % 0 +dnl @result{} diff -ruNp m4-1.4.12/checks/180.syscmd m4-1.4.13/checks/180.syscmd --- m4-1.4.12/checks/180.syscmd 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/180.syscmd 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:6196: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `FOO') -dnl @result{} -syscmd(`echo foo') -dnl @result{}foo -dnl @result{} diff -ruNp m4-1.4.12/checks/181.eval m4-1.4.13/checks/181.eval --- m4-1.4.12/checks/181.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/181.eval 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,23 @@ +dnl @ ../doc/m4.texinfo:6228: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +eval(`2 ** 3 ** 2') +dnl @result{}512 +eval(`(2 ** 3) ** 2') +dnl @result{}64 +eval(`0 ** 1') +dnl @result{}0 +eval(`2 ** 0') +dnl @result{}1 +eval(`0 ** 0') +dnl @result{} +dnl @error{}m4:stdin:5: divide by zero in eval: 0 ** 0 +eval(`4 ** -2') +dnl @error{}m4:stdin:6: negative exponent in eval: 4 ** -2 +dnl @result{} diff -ruNp m4-1.4.12/checks/181.syscmd m4-1.4.13/checks/181.syscmd --- m4-1.4.12/checks/181.syscmd 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/181.syscmd 1969-12-31 17:00:00.000000000 -0700 @@ -1,11 +0,0 @@ -dnl @ ../doc/m4.texinfo:6225: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -m4wrap(`syscmd(`cat')') -dnl @result{} diff -ruNp m4-1.4.12/checks/182.esyscmd m4-1.4.13/checks/182.esyscmd --- m4-1.4.12/checks/182.esyscmd 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/182.esyscmd 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:6264: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `FOO') -dnl @result{} -esyscmd(`echo foo') -dnl @result{}FOO -dnl @result{} diff -ruNp m4-1.4.12/checks/182.eval m4-1.4.13/checks/182.eval --- m4-1.4.12/checks/182.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/182.eval 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,34 @@ +dnl @ ../doc/m4.texinfo:6264: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +eval(`-3 * 5') +dnl @result{}-15 +eval(`-99 / 10') +dnl @result{}-9 +eval(`-99 % 10') +dnl @result{}-9 +eval(`99 % -10') +dnl @result{}9 +eval(index(`Hello world', `llo') >= 0) +dnl @result{}1 +eval(`0r1:0111 + 0b100 + 0r3:12') +dnl @result{}12 +define(`square', `eval(`($1) ** 2')') +dnl @result{} +square(`9') +dnl @result{}81 +square(square(`5')` + 1') +dnl @result{}676 +define(`foo', `666') +dnl @result{} +eval(`foo / 6') +dnl @error{}m4:stdin:11: bad expression in eval: foo / 6 +dnl @result{} +eval(foo / 6) +dnl @result{}111 diff -ruNp m4-1.4.12/checks/183.eval m4-1.4.13/checks/183.eval --- m4-1.4.12/checks/183.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/183.eval 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,27 @@ +dnl @ ../doc/m4.texinfo:6303: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`max_int', eval(`0x7fffffff')) +dnl @result{} +define(`min_int', incr(max_int)) +dnl @result{} +eval(min_int` < 0') +dnl @result{}1 +eval(max_int` > 0') +dnl @result{}1 +ifelse(eval(min_int` / -1'), min_int, `overflow occurred') +dnl @result{}overflow occurred +min_int +dnl @result{}-2147483648 +eval(`0x80000000 % -1') +dnl @result{}0 +eval(`-4 >> 1') +dnl @result{}-2 +eval(`-4 >> 33') +dnl @result{}-2 diff -ruNp m4-1.4.12/checks/183.sysval m4-1.4.13/checks/183.sysval --- m4-1.4.12/checks/183.sysval 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/183.sysval 1969-12-31 17:00:00.000000000 -0700 @@ -1,35 +0,0 @@ -dnl @ ../doc/m4.texinfo:6294: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -sysval -dnl @result{}0 -syscmd(`false') -dnl @result{} -ifelse(sysval, `0', `zero', `non-zero') -dnl @result{}non-zero -syscmd(`exit 2') -dnl @result{} -sysval -dnl @result{}2 -syscmd(`true') -dnl @result{} -sysval -dnl @result{}0 -esyscmd(`false') -dnl @result{} -ifelse(sysval, `0', `zero', `non-zero') -dnl @result{}non-zero -esyscmd(`exit 2') -dnl @result{} -sysval -dnl @result{}2 -esyscmd(`true') -dnl @result{} -sysval -dnl @result{}0 diff -ruNp m4-1.4.12/checks/184.eval m4-1.4.13/checks/184.eval --- m4-1.4.12/checks/184.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/184.eval 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,34 @@ +dnl @ ../doc/m4.texinfo:6336: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +eval(`666', `10') +dnl @result{}666 +eval(`666', `11') +dnl @result{}556 +eval(`666', `6') +dnl @result{}3030 +eval(`666', `6', `10') +dnl @result{}0000003030 +eval(`-666', `6', `10') +dnl @result{}-0000003030 +eval(`10', `', `0') +dnl @result{}10 +`0r1:'eval(`10', `1', `11') +dnl @result{}0r1:01111111111 +eval(`10', `16') +dnl @result{}a +eval(`1', `37') +dnl @error{}m4:stdin:9: radix 37 in builtin `eval' out of range +dnl @result{} +eval(`1', , `-1') +dnl @error{}m4:stdin:10: negative width to builtin `eval' +dnl @result{} +eval() +dnl @error{}m4:stdin:11: empty string treated as 0 in builtin `eval' +dnl @result{}0 diff -ruNp m4-1.4.12/checks/184.sysval m4-1.4.13/checks/184.sysval --- m4-1.4.12/checks/184.sysval 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/184.sysval 1969-12-31 17:00:00.000000000 -0700 @@ -1,26 +0,0 @@ -dnl @ ../doc/m4.texinfo:6344: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -dnl This test assumes kill is a shell builtin, and that signals are -dnl recognizable. -ifdef(`__unix__', , - `errprint(` skipping: syscmd does not have unix semantics -')m4exit(`77')')dnl -syscmd(`kill -9 $$') -dnl @result{} -sysval -dnl @result{}2304 -syscmd() -dnl @result{} -sysval -dnl @result{}0 -esyscmd(`kill -9 $$') -dnl @result{} -sysval -dnl @result{}2304 diff -ruNp m4-1.4.12/checks/185.mkstemp m4-1.4.13/checks/185.mkstemp --- m4-1.4.12/checks/185.mkstemp 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/185.mkstemp 1969-12-31 17:00:00.000000000 -0700 @@ -1,32 +0,0 @@ -dnl @ ../doc/m4.texinfo:6438: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', `errprint(`oops')') -dnl @result{} -syscmd(`rm -f foo-??????')sysval -dnl @result{}0 -define(`file1', maketemp(`foo-XXXXXX'))dnl -ifelse(esyscmd(`echo \` foo-?????? \''), ` foo-?????? ', - `no file', `created') -dnl @result{}created -define(`file2', maketemp(`foo-XX'))dnl -define(`file3', mkstemp(`foo-XXXXXX'))dnl -ifelse(len(defn(`file1')), len(defn(`file2')), - `same length', `different') -dnl @result{}same length -ifelse(defn(`file1'), defn(`file2'), `same', `different file') -dnl @result{}different file -ifelse(defn(`file2'), defn(`file3'), `same', `different file') -dnl @result{}different file -ifelse(defn(`file1'), defn(`file3'), `same', `different file') -dnl @result{}different file -syscmd(`rm 'defn(`file1') defn(`file2') defn(`file3')) -dnl @result{} -sysval -dnl @result{}0 diff -ruNp m4-1.4.12/checks/185.platform_m m4-1.4.13/checks/185.platform_m --- m4-1.4.12/checks/185.platform_m 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/185.platform_m 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:6417: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +__gnu__ +dnl @result{} +__gnu__(`ignored') +dnl @result{} +Extensions are ifdef(`__gnu__', `active', `inactive') +dnl @result{}Extensions are active diff -ruNp m4-1.4.12/checks/186.mkstemp m4-1.4.13/checks/186.mkstemp --- m4-1.4.12/checks/186.mkstemp 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/186.mkstemp 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:6469: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -syscmd(`rm -rf foodir')sysval -dnl @result{}0 -syscmd(`mkdir foodir')sysval -dnl @result{}0 -len(mkstemp(`foodir/fooXXXXX')) -dnl @result{}16 -syscmd(`rm -r foodir')sysval -dnl @result{}0 diff -ruNp m4-1.4.12/checks/186.platform_m m4-1.4.13/checks/186.platform_m --- m4-1.4.12/checks/186.platform_m 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/186.platform_m 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:6428: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -G +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +__gnu__ +dnl @result{}__gnu__ +__gnu__(`ignored') +dnl @result{}__gnu__(ignored) +Extensions are ifdef(`__gnu__', `active', `inactive') +dnl @result{}Extensions are inactive diff -ruNp m4-1.4.12/checks/187.mkstemp m4-1.4.13/checks/187.mkstemp --- m4-1.4.12/checks/187.mkstemp 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/187.mkstemp 1969-12-31 17:00:00.000000000 -0700 @@ -1,21 +0,0 @@ -dnl @ ../doc/m4.texinfo:6484: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -G -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -syscmd(`rm -f foo-*')sysval -dnl @result{}0 -len(maketemp(`foo-XXXXX')) -dnl @error{}m4:stdin:2: recommend using mkstemp instead -dnl @result{}9 -define(`abc', `def') -dnl @result{} -maketemp(`foo-abc') -dnl @result{}foo-def -dnl @error{}m4:stdin:4: recommend using mkstemp instead -syscmd(`test -f foo-*')ifelse(sysval, `0', `0', `1') -dnl @result{}1 diff -ruNp m4-1.4.12/checks/187.platform_m m4-1.4.13/checks/187.platform_m --- m4-1.4.12/checks/187.platform_m 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/187.platform_m 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:6451: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`provided', `0') +dnl @result{} +ifdef(`__unix__', `define(`provided', incr(provided))') +dnl @result{} +ifdef(`__windows__', `define(`provided', incr(provided))') +dnl @result{} +ifdef(`__os2__', `define(`provided', incr(provided))') +dnl @result{} +provided +dnl @result{}1 diff -ruNp m4-1.4.12/checks/188.errprint m4-1.4.13/checks/188.errprint --- m4-1.4.12/checks/188.errprint 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/188.errprint 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:6530: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -errprint(`Invalid arguments to forloop -') -dnl @error{}Invalid arguments to forloop -dnl @result{} -errprint(`1')errprint(`2',`3 -') -dnl @error{}12 3 -dnl @result{} diff -ruNp m4-1.4.12/checks/188.syscmd m4-1.4.13/checks/188.syscmd --- m4-1.4.12/checks/188.syscmd 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/188.syscmd 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:6493: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `FOO') +dnl @result{} +syscmd(`echo foo') +dnl @result{}foo +dnl @result{} diff -ruNp m4-1.4.12/checks/189.location m4-1.4.13/checks/189.location --- m4-1.4.12/checks/189.location 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/189.location 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:6567: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -errprint(__program__:__file__:__line__: `input error -') -dnl @error{}m4:stdin:1: input error -dnl @result{} diff -ruNp m4-1.4.12/checks/189.syscmd m4-1.4.13/checks/189.syscmd --- m4-1.4.12/checks/189.syscmd 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/189.syscmd 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:6522: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +m4wrap(`syscmd(`cat')') +dnl @result{} diff -ruNp m4-1.4.12/checks/190.esyscmd m4-1.4.13/checks/190.esyscmd --- m4-1.4.12/checks/190.esyscmd 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/190.esyscmd 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:6570: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `FOO') +dnl @result{} +esyscmd(`echo foo') +dnl @result{}FOO +dnl @result{} diff -ruNp m4-1.4.12/checks/190.location m4-1.4.13/checks/190.location --- m4-1.4.12/checks/190.location 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/190.location 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:6587: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`foo', ``$0' called at __file__:__line__') -dnl @result{} -foo -dnl @result{}foo called at stdin:2 -include(`incl.m4') -dnl @result{}Include file start -dnl @result{}foo called at examples/incl.m4:2 -dnl @result{}Include file end -dnl @result{} diff -ruNp m4-1.4.12/checks/191.location m4-1.4.13/checks/191.location --- m4-1.4.12/checks/191.location 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/191.location 1969-12-31 17:00:00.000000000 -0700 @@ -1,36 +0,0 @@ -dnl @ ../doc/m4.texinfo:6608: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`echo', `$@') -dnl @result{} -define(`foo', `echo(__line__ -__line__)') -dnl @result{} -echo(__line__ -__line__) -dnl @result{}4 -dnl @result{}5 -m4wrap(`foo -') -dnl @result{} -foo(errprint(__line__ -__line__ -)) -dnl @error{}8 -dnl @error{}9 -dnl @result{}8 -dnl @result{}8 -__line__ -dnl @result{}11 -m4wrap(`__line__ -') -dnl @result{} -dnl @result{}12 -dnl @result{}6 -dnl @result{}6 diff -ruNp m4-1.4.12/checks/191.sysval m4-1.4.13/checks/191.sysval --- m4-1.4.12/checks/191.sysval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/191.sysval 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,35 @@ +dnl @ ../doc/m4.texinfo:6600: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +sysval +dnl @result{}0 +syscmd(`false') +dnl @result{} +ifelse(sysval, `0', `zero', `non-zero') +dnl @result{}non-zero +syscmd(`exit 2') +dnl @result{} +sysval +dnl @result{}2 +syscmd(`true') +dnl @result{} +sysval +dnl @result{}0 +esyscmd(`false') +dnl @result{} +ifelse(sysval, `0', `zero', `non-zero') +dnl @result{}non-zero +esyscmd(`exit 2') +dnl @result{} +sysval +dnl @result{}2 +esyscmd(`true') +dnl @result{} +sysval +dnl @result{}0 diff -ruNp m4-1.4.12/checks/192.m4exit m4-1.4.13/checks/192.m4exit --- m4-1.4.12/checks/192.m4exit 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/192.m4exit 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:6665: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -m4wrap(`This text is lost due to `m4exit'.') -dnl @result{} -divert(`1') So is this. -divert -dnl @result{} -m4exit And this is never read. diff -ruNp m4-1.4.12/checks/192.sysval m4-1.4.13/checks/192.sysval --- m4-1.4.12/checks/192.sysval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/192.sysval 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,26 @@ +dnl @ ../doc/m4.texinfo:6650: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +dnl This test assumes kill is a shell builtin, and that signals are +dnl recognizable. +ifdef(`__unix__', , + `errprint(` skipping: syscmd does not have unix semantics +')m4exit(`77')')dnl +syscmd(`kill -9 $$') +dnl @result{} +sysval +dnl @result{}2304 +syscmd() +dnl @result{} +sysval +dnl @result{}0 +esyscmd(`kill -9 $$') +dnl @result{} +sysval +dnl @result{}2304 diff -ruNp m4-1.4.12/checks/193.m4exit m4-1.4.13/checks/193.m4exit --- m4-1.4.12/checks/193.m4exit 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/193.m4exit 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:6683: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`fatal_error', - `errprint(__program__:__file__:__line__`: fatal error: $* -')m4exit(`1')') -dnl @result{} -fatal_error(`this is a BAD one, buster') -dnl @error{}m4:stdin:4: fatal error: this is a BAD one, buster diff -ruNp m4-1.4.12/checks/193.mkstemp m4-1.4.13/checks/193.mkstemp --- m4-1.4.12/checks/193.mkstemp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/193.mkstemp 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,32 @@ +dnl @ ../doc/m4.texinfo:6744: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `errprint(`oops')') +dnl @result{} +syscmd(`rm -f foo-??????')sysval +dnl @result{}0 +define(`file1', maketemp(`foo-XXXXXX'))dnl +ifelse(esyscmd(`echo \` foo-?????? \''), ` foo-?????? ', + `no file', `created') +dnl @result{}created +define(`file2', maketemp(`foo-XX'))dnl +define(`file3', mkstemp(`foo-XXXXXX'))dnl +ifelse(len(defn(`file1')), len(defn(`file2')), + `same length', `different') +dnl @result{}same length +ifelse(defn(`file1'), defn(`file2'), `same', `different file') +dnl @result{}different file +ifelse(defn(`file2'), defn(`file3'), `same', `different file') +dnl @result{}different file +ifelse(defn(`file1'), defn(`file3'), `same', `different file') +dnl @result{}different file +syscmd(`rm 'defn(`file1') defn(`file2') defn(`file3')) +dnl @result{} +sysval +dnl @result{}0 diff -ruNp m4-1.4.12/checks/194.mkstemp m4-1.4.13/checks/194.mkstemp --- m4-1.4.12/checks/194.mkstemp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/194.mkstemp 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:6775: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +syscmd(`rm -rf foodir')sysval +dnl @result{}0 +syscmd(`mkdir foodir')sysval +dnl @result{}0 +len(mkstemp(`foodir/fooXXXXX')) +dnl @result{}16 +syscmd(`rm -r foodir')sysval +dnl @result{}0 diff -ruNp m4-1.4.12/checks/194.using_froz m4-1.4.13/checks/194.using_froz --- m4-1.4.12/checks/194.using_froz 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/194.using_froz 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:6819: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -F /dev/null -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -traceon(`undefined')dnl diff -ruNp m4-1.4.12/checks/195.mkstemp m4-1.4.13/checks/195.mkstemp --- m4-1.4.12/checks/195.mkstemp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/195.mkstemp 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:6790: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -G +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +syscmd(`rm -f foo-*')sysval +dnl @result{}0 +len(maketemp(`foo-XXXXX')) +dnl @error{}m4:stdin:2: recommend using mkstemp instead +dnl @result{}9 +define(`abc', `def') +dnl @result{} +maketemp(`foo-abc') +dnl @result{}foo-def +dnl @error{}m4:stdin:4: recommend using mkstemp instead +syscmd(`test -f foo-*')ifelse(sysval, `0', `0', `1') +dnl @result{}1 diff -ruNp m4-1.4.12/checks/195.using_froz m4-1.4.13/checks/195.using_froz --- m4-1.4.12/checks/195.using_froz 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/195.using_froz 1969-12-31 17:00:00.000000000 -0700 @@ -1,20 +0,0 @@ -dnl @ ../doc/m4.texinfo:6825: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -ifdef(`__unix__', , - `errprint(` skipping: syscmd does not have unix semantics -')m4exit(`77')')dnl -changequote(`[', `]')dnl -syscmd([echo 'changequote([,])pushdef([divnum],[hi])dnl' \ - | ]__program__[ -F in.m4f \ - && echo 'divnum popdef([divnum])divnum' \ - | ]__program__[ -R in.m4f \ - && rm in.m4f])status sysval -dnl @result{}hi 0 -dnl @result{}status 0 diff -ruNp m4-1.4.12/checks/196.errprint m4-1.4.13/checks/196.errprint --- m4-1.4.12/checks/196.errprint 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/196.errprint 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:6836: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +errprint(`Invalid arguments to forloop +') +dnl @error{}Invalid arguments to forloop +dnl @result{} +errprint(`1')errprint(`2',`3 +') +dnl @error{}12 3 +dnl @result{} diff -ruNp m4-1.4.12/checks/196.using_froz m4-1.4.13/checks/196.using_froz --- m4-1.4.12/checks/196.using_froz 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/196.using_froz 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:6843: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -F /none/such -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -dnl @error{}m4: cannot open `/none/such': No such file or directory diff -ruNp m4-1.4.12/checks/197.extensions m4-1.4.13/checks/197.extensions --- m4-1.4.12/checks/197.extensions 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/197.extensions 1969-12-31 17:00:00.000000000 -0700 @@ -1,26 +0,0 @@ -dnl @ ../doc/m4.texinfo:6979: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`a1', `A1') -dnl @result{} -dnl First argument, concatenated with 1 -define(`_1', `$1')define(`first1', `_1($@)1') -dnl @result{} -dnl Eleventh argument, portable -define(`_9', `$9')define(`eleventh', `_9(shift(shift($@)))') -dnl @result{} -dnl Eleventh argument, GNU style -define(`Eleventh', `$11') -dnl @result{} -first1(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k') -dnl @result{}A1 -eleventh(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k') -dnl @result{}k -Eleventh(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k') -dnl @result{}k diff -ruNp m4-1.4.12/checks/197.location m4-1.4.13/checks/197.location --- m4-1.4.12/checks/197.location 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/197.location 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:6873: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +errprint(__program__:__file__:__line__: `input error +') +dnl @error{}m4:stdin:1: input error +dnl @result{} diff -ruNp m4-1.4.12/checks/198.location m4-1.4.13/checks/198.location --- m4-1.4.12/checks/198.location 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/198.location 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:6893: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', ``$0' called at __file__:__line__') +dnl @result{} +foo +dnl @result{}foo called at stdin:2 +include(`incl.m4') +dnl @result{}Include file start +dnl @result{}foo called at examples/incl.m4:2 +dnl @result{}Include file end +dnl @result{} diff -ruNp m4-1.4.12/checks/198.other_inco m4-1.4.13/checks/198.other_inco --- m4-1.4.12/checks/198.other_inco 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/198.other_inco 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:7273: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -s -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -divert(2)2 -divert(1)1 -divert`'0 -dnl @result{}#line 3 "stdin" -dnl @result{}0 -dnl @result{}#line 2 "stdin" -dnl @result{}1 -dnl @result{}#line 1 "stdin" -dnl @result{}2 diff -ruNp m4-1.4.12/checks/199.location m4-1.4.13/checks/199.location --- m4-1.4.12/checks/199.location 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/199.location 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,36 @@ +dnl @ ../doc/m4.texinfo:6914: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`echo', `$@') +dnl @result{} +define(`foo', `echo(__line__ +__line__)') +dnl @result{} +echo(__line__ +__line__) +dnl @result{}4 +dnl @result{}5 +m4wrap(`foo +') +dnl @result{} +foo(errprint(__line__ +__line__ +)) +dnl @error{}8 +dnl @error{}9 +dnl @result{}8 +dnl @result{}8 +__line__ +dnl @result{}11 +m4wrap(`__line__ +') +dnl @result{} +dnl @result{}12 +dnl @result{}6 +dnl @result{}6 diff -ruNp m4-1.4.12/checks/199.other_inco m4-1.4.13/checks/199.other_inco --- m4-1.4.12/checks/199.other_inco 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/199.other_inco 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:7298: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`x', `x') -dnl @result{} -define(`x', `x ') -dnl @result{} diff -ruNp m4-1.4.12/checks/200.improved_e m4-1.4.13/checks/200.improved_e --- m4-1.4.12/checks/200.improved_e 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/200.improved_e 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:7351: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`exch', ``$2', `$1'') -dnl @result{} -define(exch(`expansion text', `macro')) -dnl @result{} -macro -dnl @result{}expansion text diff -ruNp m4-1.4.12/checks/200.m4exit m4-1.4.13/checks/200.m4exit --- m4-1.4.12/checks/200.m4exit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/200.m4exit 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:6971: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +m4wrap(`This text is lost due to `m4exit'.') +dnl @result{} +divert(`1') So is this. +divert +dnl @result{} +m4exit And this is never read. diff -ruNp m4-1.4.12/checks/201.improved_f m4-1.4.13/checks/201.improved_f --- m4-1.4.12/checks/201.improved_f 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/201.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:7373: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -undivert(`forloop2.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# forloop(var, from, to, stmt) - improved version: -dnl @result{}# works even if VAR is not a strict macro name -dnl @result{}# performs sanity check that FROM is larger than TO -dnl @result{}# allows complex numerical expressions in TO and FROM -dnl @result{}define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', -dnl @result{} `pushdef(`$1')_$0(`$1', eval(`$2'), -dnl @result{} eval(`$3'), `$4')popdef(`$1')')') -dnl @result{}define(`_forloop', -dnl @result{} `define(`$1', `$2')$4`'ifelse(`$2', `$3', `', -dnl @result{} `$0(`$1', incr(`$2'), `$3', `$4')')') -dnl @result{}divert`'dnl -include(`forloop2.m4') -dnl @result{} -forloop(`i', `2', `1', `no iteration occurs') -dnl @result{} -forloop(`', `1', `2', ` odd iterator name') -dnl @result{} odd iterator name odd iterator name -forloop(`i', `5 + 5', `0xc', ` 0x`'eval(i, `16')') -dnl @result{} 0xa 0xb 0xc -forloop(`i', `a', `b', `non-numeric bounds') -dnl @error{}m4:stdin:6: bad expression in eval (bad input): (a) <= (b) -dnl @result{} diff -ruNp m4-1.4.12/checks/201.m4exit m4-1.4.13/checks/201.m4exit --- m4-1.4.12/checks/201.m4exit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/201.m4exit 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:6989: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`fatal_error', + `errprint(__program__:__file__:__line__`: fatal error: $* +')m4exit(`1')') +dnl @result{} +fatal_error(`this is a BAD one, buster') +dnl @error{}m4:stdin:4: fatal error: this is a BAD one, buster diff -ruNp m4-1.4.12/checks/202.improved_f m4-1.4.13/checks/202.improved_f --- m4-1.4.12/checks/202.improved_f 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/202.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,34 +0,0 @@ -dnl @ ../doc/m4.texinfo:7414: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -L9 -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`arg1', `$1')include(`forloop2.m4')include(`quote.m4') -dnl @result{} -define(`double', `define(`$1'`2', - arg1(patsubst(dquote(defn(`$1')), `[`']', `\&\&')))') -dnl @result{} -double(`forloop')double(`_forloop')defn(`forloop2') -dnl @result{}ifelse(eval(``($2) <= ($3)''), ``1'', -dnl @result{} ``pushdef(``$1'')_$0(``$1'', eval(``$2''), -dnl @result{} eval(``$3''), ``$4'')popdef(``$1'')'') -forloop(i, 1, 5, `ifelse(')forloop(i, 1, 5, `)') -dnl @result{} -changequote(`[', `]')changequote([``], ['']) -dnl @result{} -forloop2(i, 1, 5, ``ifelse('')forloop2(i, 1, 5, ``)'') -dnl @result{} -changequote`'include(`forloop.m4') -dnl @result{} -double(`forloop')double(`_forloop')defn(`forloop2') -dnl @result{}pushdef(``$1'', ``$2'')_forloop($@)popdef(``$1'') -forloop(i, 1, 5, `ifelse(')forloop(i, 1, 5, `)') -dnl @result{} -changequote(`[', `]')changequote([``], ['']) -dnl @result{} -forloop2(i, 1, 5, ``ifelse('')forloop2(i, 1, 5, ``)'') -dnl @error{}m4:stdin:12: recursion limit of 9 exceeded, use -L<N> to change it diff -ruNp m4-1.4.12/checks/202.using_froz m4-1.4.13/checks/202.using_froz --- m4-1.4.12/checks/202.using_froz 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/202.using_froz 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,10 @@ +dnl @ ../doc/m4.texinfo:7125: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -F /dev/null +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +traceon(`undefined')dnl diff -ruNp m4-1.4.12/checks/203.improved_f m4-1.4.13/checks/203.improved_f --- m4-1.4.12/checks/203.improved_f 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/203.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,35 +0,0 @@ -dnl @ ../doc/m4.texinfo:7456: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`foreachq.m4') -dnl @result{} -traceon(`shift')debugmode(`aq') -dnl @result{} -foreachq(`x', ``1', `2', `3', `4'', `x -')dnl -dnl @result{}1 -dnl @error{}m4trace: -3- shift(`1', `2', `3', `4') -dnl @error{}m4trace: -2- shift(`1', `2', `3', `4') -dnl @result{}2 -dnl @error{}m4trace: -4- shift(`1', `2', `3', `4') -dnl @error{}m4trace: -3- shift(`2', `3', `4') -dnl @error{}m4trace: -3- shift(`1', `2', `3', `4') -dnl @error{}m4trace: -2- shift(`2', `3', `4') -dnl @result{}3 -dnl @error{}m4trace: -5- shift(`1', `2', `3', `4') -dnl @error{}m4trace: -4- shift(`2', `3', `4') -dnl @error{}m4trace: -3- shift(`3', `4') -dnl @error{}m4trace: -4- shift(`1', `2', `3', `4') -dnl @error{}m4trace: -3- shift(`2', `3', `4') -dnl @error{}m4trace: -2- shift(`3', `4') -dnl @result{}4 -dnl @error{}m4trace: -6- shift(`1', `2', `3', `4') -dnl @error{}m4trace: -5- shift(`2', `3', `4') -dnl @error{}m4trace: -4- shift(`3', `4') -dnl @error{}m4trace: -3- shift(`4') diff -ruNp m4-1.4.12/checks/203.using_froz m4-1.4.13/checks/203.using_froz --- m4-1.4.12/checks/203.using_froz 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/203.using_froz 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,20 @@ +dnl @ ../doc/m4.texinfo:7131: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +ifdef(`__unix__', , + `errprint(` skipping: syscmd does not have unix semantics +')m4exit(`77')')dnl +changequote(`[', `]')dnl +syscmd([echo 'changequote([,])pushdef([divnum],[hi])dnl' \ + | ']__program__[' -F in.m4f \ + && echo 'divnum popdef([divnum])divnum' \ + | ']__program__[' -R in.m4f \ + && rm in.m4f])status sysval +dnl @result{}hi 0 +dnl @result{}status 0 diff -ruNp m4-1.4.12/checks/204.improved_f m4-1.4.13/checks/204.improved_f --- m4-1.4.12/checks/204.improved_f 2008-09-26 06:47:16.000000000 -0600 +++ m4-1.4.13/checks/204.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:7498: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`foreachq2.m4') -dnl @result{} -undivert(`foreachq2.m4')dnl -dnl @result{}include(`quote.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# foreachq(x, `item_1, item_2, ..., item_n', stmt) -dnl @result{}# quoted list, improved version -dnl @result{}define(`foreachq', `pushdef(`$1')_$0($@)popdef(`$1')') -dnl @result{}define(`_arg1q', ``$1'') -dnl @result{}define(`_rest', `ifelse(`$#', `1', `', `dquote(shift($@))')') -dnl @result{}define(`_foreachq', `ifelse(`$2', `', `', -dnl @result{} `define(`$1', _arg1q($2))$3`'$0(`$1', _rest($2), `$3')')') -dnl @result{}divert`'dnl -traceon(`shift')debugmode(`aq') -dnl @result{} -foreachq(`x', ``1', `2', `3', `4'', `x -')dnl -dnl @result{}1 -dnl @error{}m4trace: -3- shift(`1', `2', `3', `4') -dnl @result{}2 -dnl @error{}m4trace: -3- shift(`2', `3', `4') -dnl @result{}3 -dnl @error{}m4trace: -3- shift(`3', `4') -dnl @result{}4 diff -ruNp m4-1.4.12/checks/204.using_froz m4-1.4.13/checks/204.using_froz --- m4-1.4.12/checks/204.using_froz 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/204.using_froz 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:7151: Origin of test +dnl @ expected status: 1 +dnl @ extra options: -F /none/such +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +dnl @ expected error: ignore +dnl @error{}m4: cannot open `/none/such': No such file or directory diff -ruNp m4-1.4.12/checks/205.extensions m4-1.4.13/checks/205.extensions --- m4-1.4.12/checks/205.extensions 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/205.extensions 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,26 @@ +dnl @ ../doc/m4.texinfo:7287: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`a1', `A1') +dnl @result{} +dnl First argument, concatenated with 1 +define(`_1', `$1')define(`first1', `_1($@)1') +dnl @result{} +dnl Eleventh argument, portable +define(`_9', `$9')define(`eleventh', `_9(shift(shift($@)))') +dnl @result{} +dnl Eleventh argument, GNU style +define(`Eleventh', `$11') +dnl @result{} +first1(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k') +dnl @result{}A1 +eleventh(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k') +dnl @result{}k +Eleventh(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k') +dnl @result{}k diff -ruNp m4-1.4.12/checks/205.improved_f m4-1.4.13/checks/205.improved_f --- m4-1.4.12/checks/205.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/205.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,49 +0,0 @@ -dnl @ ../doc/m4.texinfo:7551: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`foreachq3.m4') -dnl @result{} -undivert(`foreachq3.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# foreachq(x, `item_1, item_2, ..., item_n', stmt) -dnl @result{}# quoted list, alternate improved version -dnl @result{}define(`foreachq', `ifelse(`$2', `', `', -dnl @result{} `pushdef(`$1')_$0(`$1', `$3', `', $2)popdef(`$1')')') -dnl @result{}define(`_foreachq', `ifelse(`$#', `3', `', -dnl @result{} `define(`$1', `$4')$2`'$0(`$1', `$2', -dnl @result{} shift(shift(shift($@))))')') -dnl @result{}divert`'dnl -traceon(`shift')debugmode(`aq') -dnl @result{} -foreachq(`x', ``1', `2', `3', `4'', `x -')dnl -dnl @result{}1 -dnl @error{}m4trace: -4- shift(`x', `x -dnl @error{}', `', `1', `2', `3', `4') -dnl @error{}m4trace: -3- shift(`x -dnl @error{}', `', `1', `2', `3', `4') -dnl @error{}m4trace: -2- shift(`', `1', `2', `3', `4') -dnl @result{}2 -dnl @error{}m4trace: -4- shift(`x', `x -dnl @error{}', `1', `2', `3', `4') -dnl @error{}m4trace: -3- shift(`x -dnl @error{}', `1', `2', `3', `4') -dnl @error{}m4trace: -2- shift(`1', `2', `3', `4') -dnl @result{}3 -dnl @error{}m4trace: -4- shift(`x', `x -dnl @error{}', `2', `3', `4') -dnl @error{}m4trace: -3- shift(`x -dnl @error{}', `2', `3', `4') -dnl @error{}m4trace: -2- shift(`2', `3', `4') -dnl @result{}4 -dnl @error{}m4trace: -4- shift(`x', `x -dnl @error{}', `3', `4') -dnl @error{}m4trace: -3- shift(`x -dnl @error{}', `3', `4') -dnl @error{}m4trace: -2- shift(`3', `4') diff -ruNp m4-1.4.12/checks/206.improved_f m4-1.4.13/checks/206.improved_f --- m4-1.4.12/checks/206.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/206.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:7638: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`foreachq4.m4') -dnl @result{} -undivert(`foreachq4.m4')dnl -dnl @result{}include(`forloop2.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# foreachq(x, `item_1, item_2, ..., item_n', stmt) -dnl @result{}# quoted list, version based on forloop -dnl @result{}define(`foreachq', -dnl @result{}`ifelse(`$2', `', `', `_$0(`$1', `$3', $2)')') -dnl @result{}define(`_foreachq', -dnl @result{}`pushdef(`$1', forloop(`$1', `3', `$#', -dnl @result{} `$0_(`1', `2', indir(`$1'))')`popdef( -dnl @result{} `$1')')indir(`$1', $@)') -dnl @result{}define(`_foreachq_', -dnl @result{}``define(`$$1', `$$3')$$2`''') -dnl @result{}divert`'dnl -traceon(`shift')debugmode(`aq') -dnl @result{} -foreachq(`x', ``1', `2', `3', `4'', `x -')dnl -dnl @result{}1 -dnl @result{}2 -dnl @result{}3 -dnl @result{}4 diff -ruNp m4-1.4.12/checks/206.other_inco m4-1.4.13/checks/206.other_inco --- m4-1.4.12/checks/206.other_inco 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/206.other_inco 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:7581: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -s +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +divert(2)2 +divert(1)1 +divert`'0 +dnl @result{}#line 3 "stdin" +dnl @result{}0 +dnl @result{}#line 2 "stdin" +dnl @result{}1 +dnl @result{}#line 1 "stdin" +dnl @result{}2 diff -ruNp m4-1.4.12/checks/207.improved_f m4-1.4.13/checks/207.improved_f --- m4-1.4.12/checks/207.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/207.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,37 +0,0 @@ -dnl @ ../doc/m4.texinfo:7674: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`foreach2.m4') -dnl @result{} -undivert(`foreach2.m4')dnl -dnl @result{}include(`quote.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# foreach(x, (item_1, item_2, ..., item_n), stmt) -dnl @result{}# parenthesized list, improved version -dnl @result{}define(`foreach', `pushdef(`$1')_$0(`$1', -dnl @result{} (dquote(dquote_elt$2)), `$3')popdef(`$1')') -dnl @result{}define(`_arg1', `$1') -dnl @result{}define(`_foreach', `ifelse(`$2', `(`')', `', -dnl @result{} `define(`$1', _arg1$2)$3`'$0(`$1', (dquote(shift$2)), `$3')')') -dnl @result{}divert`'dnl -traceon(`shift')debugmode(`aq') -dnl @result{} -foreach(`x', `(`1', `2', `3', `4')', `x -')dnl -dnl @error{}m4trace: -4- shift(`1', `2', `3', `4') -dnl @error{}m4trace: -4- shift(`2', `3', `4') -dnl @error{}m4trace: -4- shift(`3', `4') -dnl @result{}1 -dnl @error{}m4trace: -3- shift(``1'', ``2'', ``3'', ``4'') -dnl @result{}2 -dnl @error{}m4trace: -3- shift(``2'', ``3'', ``4'') -dnl @result{}3 -dnl @error{}m4trace: -3- shift(``3'', ``4'') -dnl @result{}4 -dnl @error{}m4trace: -3- shift(``4'') diff -ruNp m4-1.4.12/checks/207.other_inco m4-1.4.13/checks/207.other_inco --- m4-1.4.12/checks/207.other_inco 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/207.other_inco 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:7606: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`x', `x') +dnl @result{} +define(`x', `x ') +dnl @result{} diff -ruNp m4-1.4.12/checks/208.improved_e m4-1.4.13/checks/208.improved_e --- m4-1.4.12/checks/208.improved_e 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/208.improved_e 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:7660: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`exch', ``$2', `$1'') +dnl @result{} +define(exch(`expansion text', `macro')) +dnl @result{} +macro +dnl @result{}expansion text diff -ruNp m4-1.4.12/checks/208.improved_f m4-1.4.13/checks/208.improved_f --- m4-1.4.12/checks/208.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/208.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,77 +0,0 @@ -dnl @ ../doc/m4.texinfo:7728: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`foreach2.m4') -dnl @result{} -include(`foreachq2.m4') -dnl @result{} -dnl 0-element list: -foreach(`x', `', `<x>') / foreachq(`x', `', `<x>') -dnl @result{} / -dnl 1-element list of empty element -foreach(`x', `()', `<x>') / foreachq(`x', ``'', `<x>') -dnl @result{}<> / <> -dnl 2-element list of empty elements -foreach(`x', `(`',`')', `<x>') / foreachq(`x', ``',`'', `<x>') -dnl @result{}<><> / <><> -dnl 1-element list of a comma -foreach(`x', `(`,')', `<x>') / foreachq(`x', ``,'', `<x>') -dnl @result{}<,> / <,> -dnl 2-element list of unbalanced parentheses -foreach(`x', `(`(', `)')', `<x>') / foreachq(`x', ``(', `)'', `<x>') -dnl @result{}<(><)> / <(><)> -define(`ab', `oops')dnl using defn(`iterator') -foreach(`x', `(`a', `b')', `defn(`x')') /dnl - foreachq(`x', ``a', `b'', `defn(`x')') -dnl @result{}ab / ab -define(`active', `ACT, IVE') -dnl @result{} -traceon(`active') -dnl @result{} -dnl list of unquoted macros; expansion occurs before recursion -foreach(`x', `(active, active)', `<x> -')dnl -dnl @error{}m4trace: -4- active -> `ACT, IVE' -dnl @error{}m4trace: -4- active -> `ACT, IVE' -dnl @result{}<ACT> -dnl @result{}<IVE> -dnl @result{}<ACT> -dnl @result{}<IVE> -foreachq(`x', `active, active', `<x> -')dnl -dnl @error{}m4trace: -3- active -> `ACT, IVE' -dnl @error{}m4trace: -3- active -> `ACT, IVE' -dnl @result{}<ACT> -dnl @error{}m4trace: -3- active -> `ACT, IVE' -dnl @error{}m4trace: -3- active -> `ACT, IVE' -dnl @result{}<IVE> -dnl @result{}<ACT> -dnl @result{}<IVE> -dnl list of quoted macros; expansion occurs during recursion -foreach(`x', `(`active', `active')', `<x> -')dnl -dnl @error{}m4trace: -1- active -> `ACT, IVE' -dnl @result{}<ACT, IVE> -dnl @error{}m4trace: -1- active -> `ACT, IVE' -dnl @result{}<ACT, IVE> -foreachq(`x', ``active', `active'', `<x> -')dnl -dnl @error{}m4trace: -1- active -> `ACT, IVE' -dnl @result{}<ACT, IVE> -dnl @error{}m4trace: -1- active -> `ACT, IVE' -dnl @result{}<ACT, IVE> -dnl list of double-quoted macro names; no expansion -foreach(`x', `(``active'', ``active'')', `<x> -')dnl -dnl @result{}<active> -dnl @result{}<active> -foreachq(`x', ```active'', ``active''', `<x> -')dnl -dnl @result{}<active> -dnl @result{}<active> diff -ruNp m4-1.4.12/checks/209.improved_f m4-1.4.13/checks/209.improved_f --- m4-1.4.12/checks/209.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/209.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -1,11 +1,33 @@ -dnl @ ../doc/m4.texinfo:7809: Origin of test +dnl @ ../doc/m4.texinfo:7682: Origin of test dnl @ expected status: 0 -dnl @ extra options: -Dlimit=10 -Dverbose -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -include(`loop.m4')dnl -dnl @result{} 1 2 3 4 5 6 7 8 9 10 +undivert(`forloop2.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# forloop(var, from, to, stmt) - improved version: +dnl @result{}# works even if VAR is not a strict macro name +dnl @result{}# performs sanity check that FROM is larger than TO +dnl @result{}# allows complex numerical expressions in TO and FROM +dnl @result{}define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', +dnl @result{} `pushdef(`$1')_$0(`$1', eval(`$2'), +dnl @result{} eval(`$3'), `$4')popdef(`$1')')') +dnl @result{}define(`_forloop', +dnl @result{} `define(`$1', `$2')$4`'ifelse(`$2', `$3', `', +dnl @result{} `$0(`$1', incr(`$2'), `$3', `$4')')') +dnl @result{}divert`'dnl +include(`forloop2.m4') +dnl @result{} +forloop(`i', `2', `1', `no iteration occurs') +dnl @result{} +forloop(`', `1', `2', ` odd iterator name') +dnl @result{} odd iterator name odd iterator name +forloop(`i', `5 + 5', `0xc', ` 0x`'eval(i, `16')') +dnl @result{} 0xa 0xb 0xc +forloop(`i', `a', `b', `non-numeric bounds') +dnl @error{}m4:stdin:6: bad expression in eval (bad input): (a) <= (b) +dnl @result{} diff -ruNp m4-1.4.12/checks/210.improved_f m4-1.4.13/checks/210.improved_f --- m4-1.4.12/checks/210.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/210.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -1,11 +1,34 @@ -dnl @ ../doc/m4.texinfo:7819: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -Dlimit=10 -Dverbose -Dalt -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ ../doc/m4.texinfo:7723: Origin of test +dnl @ expected status: 1 +dnl @ extra options: -L9 +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -include(`loop.m4')dnl -dnl @result{} 1 2 3 4 5 6 7 8 9 10 +define(`arg1', `$1')include(`forloop2.m4')include(`quote.m4') +dnl @result{} +define(`double', `define(`$1'`2', + arg1(patsubst(dquote(defn(`$1')), `[`']', `\&\&')))') +dnl @result{} +double(`forloop')double(`_forloop')defn(`forloop2') +dnl @result{}ifelse(eval(``($2) <= ($3)''), ``1'', +dnl @result{} ``pushdef(``$1'')_$0(``$1'', eval(``$2''), +dnl @result{} eval(``$3''), ``$4'')popdef(``$1'')'') +forloop(i, 1, 5, `ifelse(')forloop(i, 1, 5, `)') +dnl @result{} +changequote(`[', `]')changequote([``], ['']) +dnl @result{} +forloop2(i, 1, 5, ``ifelse('')forloop2(i, 1, 5, ``)'') +dnl @result{} +changequote`'include(`forloop.m4') +dnl @result{} +double(`forloop')double(`_forloop')defn(`forloop2') +dnl @result{}pushdef(``$1'', ``$2'')_forloop($@)popdef(``$1'') +forloop(i, 1, 5, `ifelse(')forloop(i, 1, 5, `)') +dnl @result{} +changequote(`[', `]')changequote([``], ['']) +dnl @result{} +forloop2(i, 1, 5, ``ifelse('')forloop2(i, 1, 5, ``)'') +dnl @error{}m4:stdin:12: recursion limit of 9 exceeded, use -L<N> to change it diff -ruNp m4-1.4.12/checks/211.improved_f m4-1.4.13/checks/211.improved_f --- m4-1.4.12/checks/211.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/211.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -1,11 +1,43 @@ -dnl @ ../doc/m4.texinfo:7829: Origin of test +dnl @ ../doc/m4.texinfo:7766: Origin of test dnl @ expected status: 0 -dnl @ extra options: -Dlimit=10 -Dverbose -Dalt=4 -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -include(`loop.m4')dnl -dnl @result{} 1 2 3 4 5 6 7 8 9 10 +include(`forloop3.m4') +dnl @result{} +undivert(`forloop3.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# forloop_arg(from, to, macro) - invoke MACRO(value) for +dnl @result{}# each value between FROM and TO, without define overhead +dnl @result{}define(`forloop_arg', `ifelse(eval(`($1) <= ($2)'), `1', +dnl @result{} `_forloop(`$1', eval(`$2'), `$3(', `)')')') +dnl @result{}# forloop(var, from, to, stmt) - refactored to share code +dnl @result{}define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', +dnl @result{} `pushdef(`$1')_forloop(eval(`$2'), eval(`$3'), +dnl @result{} `define(`$1',', `)$4')popdef(`$1')')') +dnl @result{}define(`_forloop', +dnl @result{} `$3`$1'$4`'ifelse(`$1', `$2', `', +dnl @result{} `$0(incr(`$1'), `$2', `$3', `$4')')') +dnl @result{}divert`'dnl +forloop(`i', `1', `3', ` i') +dnl @result{} 1 2 3 +define(`echo', `$@') +dnl @result{} +forloop_arg(`1', `3', ` echo') +dnl @result{} 1 2 3 +include(`curry.m4') +dnl @result{} +forloop_arg(`1', `3', `curry(`pushdef', `a')') +dnl @result{} +a +dnl @result{}3 +popdef(`a')a +dnl @result{}2 +popdef(`a')a +dnl @result{}1 +popdef(`a')a +dnl @result{}a diff -ruNp m4-1.4.12/checks/212.improved_f m4-1.4.13/checks/212.improved_f --- m4-1.4.12/checks/212.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/212.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -1,10 +1,35 @@ -dnl @ ../doc/m4.texinfo:7837: Origin of test +dnl @ ../doc/m4.texinfo:7817: Origin of test dnl @ expected status: 0 -dnl @ extra options: -Dlimit=2500 -Dalt=4 -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -include(`loop.m4')dnl +include(`foreachq.m4') +dnl @result{} +traceon(`shift')debugmode(`aq') +dnl @result{} +foreachq(`x', ``1', `2', `3', `4'', `x +')dnl +dnl @result{}1 +dnl @error{}m4trace: -3- shift(`1', `2', `3', `4') +dnl @error{}m4trace: -2- shift(`1', `2', `3', `4') +dnl @result{}2 +dnl @error{}m4trace: -4- shift(`1', `2', `3', `4') +dnl @error{}m4trace: -3- shift(`2', `3', `4') +dnl @error{}m4trace: -3- shift(`1', `2', `3', `4') +dnl @error{}m4trace: -2- shift(`2', `3', `4') +dnl @result{}3 +dnl @error{}m4trace: -5- shift(`1', `2', `3', `4') +dnl @error{}m4trace: -4- shift(`2', `3', `4') +dnl @error{}m4trace: -3- shift(`3', `4') +dnl @error{}m4trace: -4- shift(`1', `2', `3', `4') +dnl @error{}m4trace: -3- shift(`2', `3', `4') +dnl @error{}m4trace: -2- shift(`3', `4') +dnl @result{}4 +dnl @error{}m4trace: -6- shift(`1', `2', `3', `4') +dnl @error{}m4trace: -5- shift(`2', `3', `4') +dnl @error{}m4trace: -4- shift(`3', `4') +dnl @error{}m4trace: -3- shift(`4') diff -ruNp m4-1.4.12/checks/213.improved_f m4-1.4.13/checks/213.improved_f --- m4-1.4.12/checks/213.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/213.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -1,14 +1,33 @@ -dnl @ ../doc/m4.texinfo:7844: Origin of test +dnl @ ../doc/m4.texinfo:7859: Origin of test dnl @ expected status: 0 -dnl @ extra options: -Dlimit=10000 -Dalt=4 -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`foo', `divert`'len(popdef(`_foreachq')_foreachq($@))')dnl -define(`debug', `pushdef(`_foreachq', defn(`foo'))') +include(`foreachq2.m4') dnl @result{} -include(`loop.m4')dnl -dnl @result{}48894 +undivert(`foreachq2.m4')dnl +dnl @result{}include(`quote.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# foreachq(x, `item_1, item_2, ..., item_n', stmt) +dnl @result{}# quoted list, improved version +dnl @result{}define(`foreachq', `pushdef(`$1')_$0($@)popdef(`$1')') +dnl @result{}define(`_arg1q', ``$1'') +dnl @result{}define(`_rest', `ifelse(`$#', `1', `', `dquote(shift($@))')') +dnl @result{}define(`_foreachq', `ifelse(`$2', `', `', +dnl @result{} `define(`$1', _arg1q($2))$3`'$0(`$1', _rest($2), `$3')')') +dnl @result{}divert`'dnl +traceon(`shift')debugmode(`aq') +dnl @result{} +foreachq(`x', ``1', `2', `3', `4'', `x +')dnl +dnl @result{}1 +dnl @error{}m4trace: -3- shift(`1', `2', `3', `4') +dnl @result{}2 +dnl @error{}m4trace: -3- shift(`2', `3', `4') +dnl @result{}3 +dnl @error{}m4trace: -3- shift(`3', `4') +dnl @result{}4 diff -ruNp m4-1.4.12/checks/214.improved_f m4-1.4.13/checks/214.improved_f --- m4-1.4.12/checks/214.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/214.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,49 @@ +dnl @ ../doc/m4.texinfo:7912: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`foreachq3.m4') +dnl @result{} +undivert(`foreachq3.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# foreachq(x, `item_1, item_2, ..., item_n', stmt) +dnl @result{}# quoted list, alternate improved version +dnl @result{}define(`foreachq', `ifelse(`$2', `', `', +dnl @result{} `pushdef(`$1')_$0(`$1', `$3', `', $2)popdef(`$1')')') +dnl @result{}define(`_foreachq', `ifelse(`$#', `3', `', +dnl @result{} `define(`$1', `$4')$2`'$0(`$1', `$2', +dnl @result{} shift(shift(shift($@))))')') +dnl @result{}divert`'dnl +traceon(`shift')debugmode(`aq') +dnl @result{} +foreachq(`x', ``1', `2', `3', `4'', `x +')dnl +dnl @result{}1 +dnl @error{}m4trace: -4- shift(`x', `x +dnl @error{}', `', `1', `2', `3', `4') +dnl @error{}m4trace: -3- shift(`x +dnl @error{}', `', `1', `2', `3', `4') +dnl @error{}m4trace: -2- shift(`', `1', `2', `3', `4') +dnl @result{}2 +dnl @error{}m4trace: -4- shift(`x', `x +dnl @error{}', `1', `2', `3', `4') +dnl @error{}m4trace: -3- shift(`x +dnl @error{}', `1', `2', `3', `4') +dnl @error{}m4trace: -2- shift(`1', `2', `3', `4') +dnl @result{}3 +dnl @error{}m4trace: -4- shift(`x', `x +dnl @error{}', `2', `3', `4') +dnl @error{}m4trace: -3- shift(`x +dnl @error{}', `2', `3', `4') +dnl @error{}m4trace: -2- shift(`2', `3', `4') +dnl @result{}4 +dnl @error{}m4trace: -4- shift(`x', `x +dnl @error{}', `3', `4') +dnl @error{}m4trace: -3- shift(`x +dnl @error{}', `3', `4') +dnl @error{}m4trace: -2- shift(`3', `4') diff -ruNp m4-1.4.12/checks/214.improved_m m4-1.4.13/checks/214.improved_m --- m4-1.4.12/checks/214.improved_m 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/214.improved_m 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:7866: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`wraplifo.m4') -dnl @result{} -m4wrap(`define(`foo', ``$0:'-$1-$*-$#-')foo(`a', `b') -') -dnl @result{} -builtin(`m4wrap', ``'define(`bar', ``$0:'-$1-$*-$#-')bar(`a', `b') -') -dnl @result{} -dnl @result{}bar:-a-a,b-2- -dnl @result{}m4wrap0:---0- diff -ruNp m4-1.4.12/checks/215.improved_f m4-1.4.13/checks/215.improved_f --- m4-1.4.12/checks/215.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/215.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,33 @@ +dnl @ ../doc/m4.texinfo:7999: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`foreachq4.m4') +dnl @result{} +undivert(`foreachq4.m4')dnl +dnl @result{}include(`forloop2.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# foreachq(x, `item_1, item_2, ..., item_n', stmt) +dnl @result{}# quoted list, version based on forloop +dnl @result{}define(`foreachq', +dnl @result{}`ifelse(`$2', `', `', `_$0(`$1', `$3', $2)')') +dnl @result{}define(`_foreachq', +dnl @result{}`pushdef(`$1', forloop(`$1', `3', `$#', +dnl @result{} `$0_(`1', `2', indir(`$1'))')`popdef( +dnl @result{} `$1')')indir(`$1', $@)') +dnl @result{}define(`_foreachq_', +dnl @result{}``define(`$$1', `$$3')$$2`''') +dnl @result{}divert`'dnl +traceon(`shift')debugmode(`aq') +dnl @result{} +foreachq(`x', ``1', `2', `3', `4'', `x +')dnl +dnl @result{}1 +dnl @result{}2 +dnl @result{}3 +dnl @result{}4 diff -ruNp m4-1.4.12/checks/215.improved_m m4-1.4.13/checks/215.improved_m --- m4-1.4.12/checks/215.improved_m 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/215.improved_m 1969-12-31 17:00:00.000000000 -0700 @@ -1,31 +0,0 @@ -dnl @ ../doc/m4.texinfo:7899: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`wraplifo2.m4') -dnl @result{} -undivert(`wraplifo2.m4')dnl -dnl @result{}dnl Redefine m4wrap to have LIFO semantics, improved example. -dnl @result{}include(`join.m4')dnl -dnl @result{}define(`_m4wrap', defn(`m4wrap'))dnl -dnl @result{}define(`_arg1', `$1')dnl -dnl @result{}define(`m4wrap', -dnl @result{}`ifdef(`_$0_text', -dnl @result{} `define(`_$0_text', joinall(` ', $@)defn(`_$0_text'))', -dnl @result{} `_$0(`_arg1(defn(`_$0_text')undefine(`_$0_text'))')dnl -dnl @result{}define(`_$0_text', joinall(` ', $@))')')dnl -m4wrap(`define(`foo', ``$0:'-$1-$*-$#-')foo(`a', `b') -') -dnl @result{} -m4wrap(`lifo text -m4wrap(`nested', `', `$@ -')') -dnl @result{} -dnl @result{}lifo text -dnl @result{}foo:-a-a,b-2- -dnl @result{}nested $@ diff -ruNp m4-1.4.12/checks/216.improved_c m4-1.4.13/checks/216.improved_c --- m4-1.4.12/checks/216.improved_c 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/216.improved_c 1969-12-31 17:00:00.000000000 -0700 @@ -1,31 +0,0 @@ -dnl @ ../doc/m4.texinfo:7935: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -define(`cleardivert', - `pushdef(`_n', divnum)divert(`-1')undivert($@)divert(_n)popdef(`_n')') -dnl @result{} -divert(`1')one -divert -dnl @result{} -cleardivert -dnl @result{} -undivert -dnl @result{}one -dnl @result{} -define(`cleardivert', - `pushdef(`_num', divnum)divert(`-1')ifelse(`$#', `0', - `undivert`'', `undivert($@)')divert(_num)popdef(`_num')') -dnl @result{} -divert(`2')two -divert -dnl @result{} -cleardivert -dnl @result{} -undivert -dnl @result{} diff -ruNp m4-1.4.12/checks/216.improved_f m4-1.4.13/checks/216.improved_f --- m4-1.4.12/checks/216.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/216.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,37 @@ +dnl @ ../doc/m4.texinfo:8035: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`foreach2.m4') +dnl @result{} +undivert(`foreach2.m4')dnl +dnl @result{}include(`quote.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# foreach(x, (item_1, item_2, ..., item_n), stmt) +dnl @result{}# parenthesized list, improved version +dnl @result{}define(`foreach', `pushdef(`$1')_$0(`$1', +dnl @result{} (dquote(dquote_elt$2)), `$3')popdef(`$1')') +dnl @result{}define(`_arg1', `$1') +dnl @result{}define(`_foreach', `ifelse(`$2', `(`')', `', +dnl @result{} `define(`$1', _arg1$2)$3`'$0(`$1', (dquote(shift$2)), `$3')')') +dnl @result{}divert`'dnl +traceon(`shift')debugmode(`aq') +dnl @result{} +foreach(`x', `(`1', `2', `3', `4')', `x +')dnl +dnl @error{}m4trace: -4- shift(`1', `2', `3', `4') +dnl @error{}m4trace: -4- shift(`2', `3', `4') +dnl @error{}m4trace: -4- shift(`3', `4') +dnl @result{}1 +dnl @error{}m4trace: -3- shift(``1'', ``2'', ``3'', ``4'') +dnl @result{}2 +dnl @error{}m4trace: -3- shift(``2'', ``3'', ``4'') +dnl @result{}3 +dnl @error{}m4trace: -3- shift(``3'', ``4'') +dnl @result{}4 +dnl @error{}m4trace: -3- shift(``4'') diff -ruNp m4-1.4.12/checks/217.improved_c m4-1.4.13/checks/217.improved_c --- m4-1.4.12/checks/217.improved_c 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/217.improved_c 1969-12-31 17:00:00.000000000 -0700 @@ -1,37 +0,0 @@ -dnl @ ../doc/m4.texinfo:7971: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`capitalize.m4')dnl -define(`active', `act1, ive')dnl -define(`Active', `Act2, Ive')dnl -define(`ACTIVE', `ACT3, IVE')dnl -upcase(active) -dnl @result{}ACT1,IVE -upcase(`active') -dnl @result{}ACT3, IVE -upcase(``active'') -dnl @result{}ACTIVE -downcase(ACTIVE) -dnl @result{}act3,ive -downcase(`ACTIVE') -dnl @result{}act1, ive -downcase(``ACTIVE'') -dnl @result{}active -capitalize(active) -dnl @result{}Act1 -capitalize(`active') -dnl @result{}Active -capitalize(``active'') -dnl @result{}_capitalize(`active') -define(`A', `OOPS') -dnl @result{} -capitalize(active) -dnl @result{}OOPSct1 -capitalize(`active') -dnl @result{}OOPSctive diff -ruNp m4-1.4.12/checks/217.improved_f m4-1.4.13/checks/217.improved_f --- m4-1.4.12/checks/217.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/217.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,77 @@ +dnl @ ../doc/m4.texinfo:8089: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`foreach2.m4') +dnl @result{} +include(`foreachq2.m4') +dnl @result{} +dnl 0-element list: +foreach(`x', `', `<x>') / foreachq(`x', `', `<x>') +dnl @result{} / +dnl 1-element list of empty element +foreach(`x', `()', `<x>') / foreachq(`x', ``'', `<x>') +dnl @result{}<> / <> +dnl 2-element list of empty elements +foreach(`x', `(`',`')', `<x>') / foreachq(`x', ``',`'', `<x>') +dnl @result{}<><> / <><> +dnl 1-element list of a comma +foreach(`x', `(`,')', `<x>') / foreachq(`x', ``,'', `<x>') +dnl @result{}<,> / <,> +dnl 2-element list of unbalanced parentheses +foreach(`x', `(`(', `)')', `<x>') / foreachq(`x', ``(', `)'', `<x>') +dnl @result{}<(><)> / <(><)> +define(`ab', `oops')dnl using defn(`iterator') +foreach(`x', `(`a', `b')', `defn(`x')') /dnl + foreachq(`x', ``a', `b'', `defn(`x')') +dnl @result{}ab / ab +define(`active', `ACT, IVE') +dnl @result{} +traceon(`active') +dnl @result{} +dnl list of unquoted macros; expansion occurs before recursion +foreach(`x', `(active, active)', `<x> +')dnl +dnl @error{}m4trace: -4- active -> `ACT, IVE' +dnl @error{}m4trace: -4- active -> `ACT, IVE' +dnl @result{}<ACT> +dnl @result{}<IVE> +dnl @result{}<ACT> +dnl @result{}<IVE> +foreachq(`x', `active, active', `<x> +')dnl +dnl @error{}m4trace: -3- active -> `ACT, IVE' +dnl @error{}m4trace: -3- active -> `ACT, IVE' +dnl @result{}<ACT> +dnl @error{}m4trace: -3- active -> `ACT, IVE' +dnl @error{}m4trace: -3- active -> `ACT, IVE' +dnl @result{}<IVE> +dnl @result{}<ACT> +dnl @result{}<IVE> +dnl list of quoted macros; expansion occurs during recursion +foreach(`x', `(`active', `active')', `<x> +')dnl +dnl @error{}m4trace: -1- active -> `ACT, IVE' +dnl @result{}<ACT, IVE> +dnl @error{}m4trace: -1- active -> `ACT, IVE' +dnl @result{}<ACT, IVE> +foreachq(`x', ``active', `active'', `<x> +')dnl +dnl @error{}m4trace: -1- active -> `ACT, IVE' +dnl @result{}<ACT, IVE> +dnl @error{}m4trace: -1- active -> `ACT, IVE' +dnl @result{}<ACT, IVE> +dnl list of double-quoted macro names; no expansion +foreach(`x', `(``active'', ``active'')', `<x> +')dnl +dnl @result{}<active> +dnl @result{}<active> +foreachq(`x', ```active'', ``active''', `<x> +')dnl +dnl @result{}<active> +dnl @result{}<active> diff -ruNp m4-1.4.12/checks/218.improved_c m4-1.4.13/checks/218.improved_c --- m4-1.4.12/checks/218.improved_c 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/218.improved_c 1969-12-31 17:00:00.000000000 -0700 @@ -1,36 +0,0 @@ -dnl @ ../doc/m4.texinfo:8048: Origin of test -dnl @ expected status: 0 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ 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 -dnl @ is preserved. -include(`capitalize2.m4')dnl -define(`active', `act1, ive')dnl -define(`Active', `Act2, Ive')dnl -define(`ACTIVE', `ACT3, IVE')dnl -define(`A', `OOPS')dnl -capitalize(active; `active'; ``active''; ```actIVE''') -dnl @result{}Act1,Ive; Act2, Ive; Active; `Active' -undivert(`capitalize2.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# upcase(text) -dnl @result{}# downcase(text) -dnl @result{}# capitalize(text) -dnl @result{}# change case of text, improved version -dnl @result{}define(`upcase', `translit(`$*', `a-z', `A-Z')') -dnl @result{}define(`downcase', `translit(`$*', `A-Z', `a-z')') -dnl @result{}define(`_arg1', `$1') -dnl @result{}define(`_to_alt', `changequote(`<<[', `]>>')') -dnl @result{}define(`_from_alt', `changequote(<<[`]>>, <<[']>>)') -dnl @result{}define(`_upcase_alt', `translit(<<[$*]>>, <<[a-z]>>, <<[A-Z]>>)') -dnl @result{}define(`_downcase_alt', `translit(<<[$*]>>, <<[A-Z]>>, <<[a-z]>>)') -dnl @result{}define(`_capitalize_alt', -dnl @result{} `regexp(<<[$1]>>, <<[^\(\w\)\(\w*\)]>>, -dnl @result{} <<[_upcase_alt(<<[<<[\1]>>]>>)_downcase_alt(<<[<<[\2]>>]>>)]>>)') -dnl @result{}define(`capitalize', -dnl @result{} `_arg1(_to_alt()patsubst(<<[<<[$*]>>]>>, <<[\w+]>>, -dnl @result{} _from_alt()`]>>_$0_alt(<<[\&]>>)<<['_to_alt())_from_alt())') -dnl @result{}divert`'dnl diff -ruNp m4-1.4.12/checks/218.improved_f m4-1.4.13/checks/218.improved_f --- m4-1.4.12/checks/218.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/218.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:8170: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -Dlimit=10 -Dverbose +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`loop.m4')dnl +dnl @result{} 1 2 3 4 5 6 7 8 9 10 diff -ruNp m4-1.4.12/checks/219.improved_f m4-1.4.13/checks/219.improved_f --- m4-1.4.12/checks/219.improved_f 2008-09-26 06:47:17.000000000 -0600 +++ m4-1.4.13/checks/219.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -1,21 +1,11 @@ -dnl @ ../doc/m4.texinfo:8092: Origin of test -dnl @ expected status: 1 -dnl @ extra options: -dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation, -dnl @ Inc. +dnl @ ../doc/m4.texinfo:8180: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -Dlimit=10 -Dverbose -Dalt +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 dnl @ is preserved. -define(`fatal_error', - `errprint(ifdef(`__program__', `__program__', ``m4'')'dnl -`:ifelse(__line__, `0', `', - `__file__:__line__:')` fatal error: $* -')m4exit(`1')') -dnl @result{} -m4wrap(`divnum(`demo of internal message') -fatal_error(`inside wrapped text')') -dnl @result{} -dnl @error{}m4:stdin:6: Warning: excess arguments to builtin `divnum' ignored -dnl @result{}0 -dnl @error{}m4:stdin:6: fatal error: inside wrapped text +include(`loop.m4')dnl +dnl @result{} 1 2 3 4 5 6 7 8 9 10 diff -ruNp m4-1.4.12/checks/220.improved_f m4-1.4.13/checks/220.improved_f --- m4-1.4.12/checks/220.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/220.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:8190: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -Dlimit=10 -Dverbose -Dalt=4 +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`loop.m4')dnl +dnl @result{} 1 2 3 4 5 6 7 8 9 10 diff -ruNp m4-1.4.12/checks/221.improved_f m4-1.4.13/checks/221.improved_f --- m4-1.4.12/checks/221.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/221.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,10 @@ +dnl @ ../doc/m4.texinfo:8198: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -Dlimit=2500 -Dalt=4 +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`loop.m4')dnl diff -ruNp m4-1.4.12/checks/222.improved_f m4-1.4.13/checks/222.improved_f --- m4-1.4.12/checks/222.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/222.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:8205: Origin of test +dnl @ expected status: 0 +dnl @ extra options: -Dlimit=10000 -Dalt=4 +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`foo', `divert`'len(popdef(`_foreachq')_foreachq($@))')dnl +define(`debug', `pushdef(`_foreachq', defn(`foo'))') +dnl @result{} +include(`loop.m4')dnl +dnl @result{}48894 diff -ruNp m4-1.4.12/checks/223.improved_c m4-1.4.13/checks/223.improved_c --- m4-1.4.12/checks/223.improved_c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/223.improved_c 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,46 @@ +dnl @ ../doc/m4.texinfo:8268: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`stack_sep.m4') +dnl @result{} +define(`copy', `ifdef(`$2', `errprint(`$2 already defined +')m4exit(`1')', + `stack_foreach_sep(`$1', `pushdef(`$2',', `)')')')dnl +pushdef(`a', `1')pushdef(`a', defn(`divnum')) +dnl @result{} +copy(`a', `b') +dnl @result{} +b +dnl @result{}0 +popdef(`b') +dnl @result{} +b +dnl @result{}1 +pushdef(`c', `1')pushdef(`c', `2') +dnl @result{} +stack_foreach_sep_lifo(`c', `', `', `, ') +dnl @result{}2, 1 +undivert(`stack_sep.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# stack_foreach_sep(macro, pre, post, sep) +dnl @result{}# Invoke PRE`'defn`'POST with a single argument of each definition +dnl @result{}# from the definition stack of MACRO, starting with the oldest, and +dnl @result{}# separated by SEP between definitions. +dnl @result{}define(`stack_foreach_sep', +dnl @result{}`_stack_reverse_sep(`$1', `tmp-$1')'dnl +dnl @result{}`_stack_reverse_sep(`tmp-$1', `$1', `$2`'defn(`$1')$3', `$4`'')') +dnl @result{}# stack_foreach_sep_lifo(macro, pre, post, sep) +dnl @result{}# Like stack_foreach_sep, but starting with the newest definition. +dnl @result{}define(`stack_foreach_sep_lifo', +dnl @result{}`_stack_reverse_sep(`$1', `tmp-$1', `$2`'defn(`$1')$3', `$4`'')'dnl +dnl @result{}`_stack_reverse_sep(`tmp-$1', `$1')') +dnl @result{}define(`_stack_reverse_sep', +dnl @result{}`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0( +dnl @result{} `$1', `$2', `$4$3')')') +dnl @result{}divert`'dnl diff -ruNp m4-1.4.12/checks/224.improved_c m4-1.4.13/checks/224.improved_c --- m4-1.4.12/checks/224.improved_c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/224.improved_c 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:8314: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`forloop3.m4')include(`stack_sep.m4')dnl +forloop(`i', `1', `10000', `pushdef(`s', i)') +dnl @result{} +define(`colon', `:')define(`dash', `-') +dnl @result{} +len(stack_foreach_sep(`s', `dash', `', `colon')) +dnl @result{}58893 diff -ruNp m4-1.4.12/checks/225.improved_m m4-1.4.13/checks/225.improved_m --- m4-1.4.12/checks/225.improved_m 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/225.improved_m 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:8337: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`wraplifo.m4') +dnl @result{} +m4wrap(`define(`foo', ``$0:'-$1-$*-$#-')foo(`a', `b') +') +dnl @result{} +builtin(`m4wrap', ``'define(`bar', ``$0:'-$1-$*-$#-')bar(`a', `b') +') +dnl @result{} +dnl @result{}bar:-a-a,b-2- +dnl @result{}m4wrap0:---0- diff -ruNp m4-1.4.12/checks/226.improved_m m4-1.4.13/checks/226.improved_m --- m4-1.4.12/checks/226.improved_m 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/226.improved_m 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:8370: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`wraplifo2.m4') +dnl @result{} +undivert(`wraplifo2.m4')dnl +dnl @result{}dnl Redefine m4wrap to have LIFO semantics, improved example. +dnl @result{}include(`join.m4')dnl +dnl @result{}define(`_m4wrap', defn(`m4wrap'))dnl +dnl @result{}define(`_arg1', `$1')dnl +dnl @result{}define(`m4wrap', +dnl @result{}`ifdef(`_$0_text', +dnl @result{} `define(`_$0_text', joinall(` ', $@)defn(`_$0_text'))', +dnl @result{} `_$0(`_arg1(defn(`_$0_text')undefine(`_$0_text'))')dnl +dnl @result{}define(`_$0_text', joinall(` ', $@))')')dnl +m4wrap(`define(`foo', ``$0:'-$1-$*-$#-')foo(`a', `b') +') +dnl @result{} +m4wrap(`lifo text +m4wrap(`nested', `', `$@ +')') +dnl @result{} +dnl @result{}lifo text +dnl @result{}foo:-a-a,b-2- +dnl @result{}nested $@ diff -ruNp m4-1.4.12/checks/227.improved_c m4-1.4.13/checks/227.improved_c --- m4-1.4.12/checks/227.improved_c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/227.improved_c 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:8406: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`cleardivert', + `pushdef(`_n', divnum)divert(`-1')undivert($@)divert(_n)popdef(`_n')') +dnl @result{} +divert(`1')one +divert +dnl @result{} +cleardivert +dnl @result{} +undivert +dnl @result{}one +dnl @result{} +define(`cleardivert', + `pushdef(`_num', divnum)divert(`-1')ifelse(`$#', `0', + `undivert`'', `undivert($@)')divert(_num)popdef(`_num')') +dnl @result{} +divert(`2')two +divert +dnl @result{} +cleardivert +dnl @result{} +undivert +dnl @result{} diff -ruNp m4-1.4.12/checks/228.improved_c m4-1.4.13/checks/228.improved_c --- m4-1.4.12/checks/228.improved_c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/228.improved_c 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,37 @@ +dnl @ ../doc/m4.texinfo:8442: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`capitalize.m4')dnl +define(`active', `act1, ive')dnl +define(`Active', `Act2, Ive')dnl +define(`ACTIVE', `ACT3, IVE')dnl +upcase(active) +dnl @result{}ACT1,IVE +upcase(`active') +dnl @result{}ACT3, IVE +upcase(``active'') +dnl @result{}ACTIVE +downcase(ACTIVE) +dnl @result{}act3,ive +downcase(`ACTIVE') +dnl @result{}act1, ive +downcase(``ACTIVE'') +dnl @result{}active +capitalize(active) +dnl @result{}Act1 +capitalize(`active') +dnl @result{}Active +capitalize(``active'') +dnl @result{}_capitalize(`active') +define(`A', `OOPS') +dnl @result{} +capitalize(active) +dnl @result{}OOPSct1 +capitalize(`active') +dnl @result{}OOPSctive diff -ruNp m4-1.4.12/checks/229.improved_c m4-1.4.13/checks/229.improved_c --- m4-1.4.12/checks/229.improved_c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/229.improved_c 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,36 @@ +dnl @ ../doc/m4.texinfo:8519: Origin of test +dnl @ expected status: 0 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +include(`capitalize2.m4')dnl +define(`active', `act1, ive')dnl +define(`Active', `Act2, Ive')dnl +define(`ACTIVE', `ACT3, IVE')dnl +define(`A', `OOPS')dnl +capitalize(active; `active'; ``active''; ```actIVE''') +dnl @result{}Act1,Ive; Act2, Ive; Active; `Active' +undivert(`capitalize2.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# upcase(text) +dnl @result{}# downcase(text) +dnl @result{}# capitalize(text) +dnl @result{}# change case of text, improved version +dnl @result{}define(`upcase', `translit(`$*', `a-z', `A-Z')') +dnl @result{}define(`downcase', `translit(`$*', `A-Z', `a-z')') +dnl @result{}define(`_arg1', `$1') +dnl @result{}define(`_to_alt', `changequote(`<<[', `]>>')') +dnl @result{}define(`_from_alt', `changequote(<<[`]>>, <<[']>>)') +dnl @result{}define(`_upcase_alt', `translit(<<[$*]>>, <<[a-z]>>, <<[A-Z]>>)') +dnl @result{}define(`_downcase_alt', `translit(<<[$*]>>, <<[A-Z]>>, <<[a-z]>>)') +dnl @result{}define(`_capitalize_alt', +dnl @result{} `regexp(<<[$1]>>, <<[^\(\w\)\(\w*\)]>>, +dnl @result{} <<[_upcase_alt(<<[<<[\1]>>]>>)_downcase_alt(<<[<<[\2]>>]>>)]>>)') +dnl @result{}define(`capitalize', +dnl @result{} `_arg1(_to_alt()patsubst(<<[<<[$*]>>]>>, <<[\w+]>>, +dnl @result{} _from_alt()`]>>_$0_alt(<<[\&]>>)<<['_to_alt())_from_alt())') +dnl @result{}divert`'dnl diff -ruNp m4-1.4.12/checks/230.improved_f m4-1.4.13/checks/230.improved_f --- m4-1.4.12/checks/230.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/checks/230.improved_f 2009-03-21 18:13:11.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:8563: Origin of test +dnl @ expected status: 1 +dnl @ extra options: +dnl @ Copyright (C) 2006, 2007, 2008, 2009 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 +dnl @ is preserved. +define(`fatal_error', + `errprint(ifdef(`__program__', `__program__', ``m4'')'dnl +`:ifelse(__line__, `0', `', + `__file__:__line__:')` fatal error: $* +')m4exit(`1')') +dnl @result{} +m4wrap(`divnum(`demo of internal message') +fatal_error(`inside wrapped text')') +dnl @result{} +dnl @error{}m4:stdin:6: Warning: excess arguments to builtin `divnum' ignored +dnl @result{}0 +dnl @error{}m4:stdin:6: fatal error: inside wrapped text diff -ruNp m4-1.4.12/checks/get-them m4-1.4.13/checks/get-them --- m4-1.4.12/checks/get-them 2008-09-24 20:29:55.000000000 -0600 +++ m4-1.4.13/checks/get-them 2009-03-12 20:47:28.000000000 -0600 @@ -1,8 +1,8 @@ #!/bin/sh # -*- AWK -*- # Extract all examples from the manual source. -# Copyright (C) 1992, 2005, 2006, 2007, 2008 Free Software Foundation, -# Inc. +# Copyright (C) 1992, 2005, 2006, 2007, 2008, 2009 Free Software +# Foundation, Inc. # # This file is part of GNU M4. # @@ -19,7 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# This script is for use with GNU awk. +# This script was designed under GNU awk, but hopefully portable to +# other implementations. FILE=${1-/dev/null} : ${AWK=awk} @@ -94,8 +95,8 @@ BEGIN { printf("dnl @ %s:%d: Origin of test\n"\ "dnl @ expected status: %d\n"\ "dnl @ extra options: %s\n"\ - "dnl @ Copyright (C) 2006, 2007, 2008 Free Software Foundation,\n"\ - "dnl @ Inc.\n"\ + "dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software\n"\ + "dnl @ Foundation, Inc.\n"\ "dnl @ This file is free software; the Free Software Foundation\n"\ "dnl @ gives unlimited permission to copy and/or distribute it\n"\ "dnl @ with or without modifications, as long as this notice\n"\ @@ -122,14 +123,16 @@ BEGIN { else prefix = ""; gsub("@@", "@", $0); - gsub("@{", "{", $0); + gsub("@[{]", "{", $0); gsub("@}", "}", $0); - gsub("@w{ }", " ", $0); - gsub("@tabchar{}", "\t", $0); + gsub("@w[{] }", " ", $0); + gsub("@tabchar[{]}", "\t", $0); printf("%s%s\n", prefix, $0) >> file; } END { printf("\n"); + if (count > 0) + close(file); } ' $FILE diff -ruNp m4-1.4.12/configure m4-1.4.13/configure --- m4-1.4.12/configure 2008-10-10 21:14:50.000000000 -0600 +++ m4-1.4.13/configure 2009-03-31 19:53:24.000000000 -0600 @@ -1,16 +1,18 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for GNU M4 1.4.12. +# Generated by GNU Autoconf 2.63b for GNU M4 1.4.13. # # Report bugs to <bug-m4@gnu.org>. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software +# Foundation, Inc. +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh @@ -22,23 +24,13 @@ if test -n "${ZSH_VERSION+set}" && (emul alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) set -o posix ;; #( + *) : ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -46,7 +38,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -57,7 +55,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -80,13 +78,6 @@ if test "${PATH_SEPARATOR+set}" != set; } 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 @@ -96,15 +87,15 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -116,12 +107,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -133,330 +128,296 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# 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 || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - # CDPATH. -$as_unset CDPATH - +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST else - as_have_required=no + case \`(set -o) 2>/dev/null\` in #( + *posix*) set -o posix ;; #( + *) : ;; +esac 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 -} +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } exitcode=0 -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 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else - exitcode=1 - echo as_func_ret_success failed. + exitcode=1; echo positional parameters were not saved. 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 - : +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then + as_have_required=yes else - exitcode=1 - echo positional parameters were not saved. + as_have_required=no 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 + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + as_found=: + case $as_dir in #( /*) for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then + break 2 +fi +fi done;; esac + as_found=false done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } IFS=$as_save_IFS - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_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 + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi - - if test $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; } + if test x$as_have_required = xno; then + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and bug-m4@gnu.org +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 fi - - fi - fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit [STATUS=$?] +# ---------------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + as_status=$? + set +e + as_fn_set_status ${1-$as_status} + exit ${1-$as_status} +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" -(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 -} +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append -exitcode=0 -if as_func_success; then - : +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' else - exitcode=1 - echo as_func_success failed. -fi + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi -if as_func_ret_success; then - : +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr else - exitcode=1 - echo as_func_ret_success failed. + as_expr=false fi -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname else - exitcode=1 - echo positional parameters were not saved. + as_dirname=false fi -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -473,8 +434,7 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the @@ -484,15 +444,8 @@ test \$exitcode = 0") || { exit } - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #(((( -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. @@ -501,12 +454,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -536,7 +483,7 @@ rm -f conf$$ conf$$.exe conf$$.dir/conf$ rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -555,10 +502,10 @@ else if test -d "$1"; then test -d "$1/."; else - case $1 in + case $1 in #( -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -572,7 +519,6 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - exec 7<&0 </dev/null 6>&1 # Name of the host. @@ -591,14 +537,14 @@ cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='GNU M4' PACKAGE_TARNAME='m4' -PACKAGE_VERSION='1.4.12' -PACKAGE_STRING='GNU M4 1.4.12' +PACKAGE_VERSION='1.4.13' +PACKAGE_STRING='GNU M4 1.4.13' PACKAGE_BUGREPORT='bug-m4@gnu.org' +PACKAGE_URL='http://www.gnu.org/software/m4/' ac_unique_file="src/m4.h" # Factoring default headers for most tests. @@ -649,7 +595,8 @@ LIBOBJS LIBTESTS_LIBDEPS LIBM4_LTLIBDEPS LIBM4_LIBDEPS -YIELD_LIB +POSIX_SPAWN_PORTED_FALSE +POSIX_SPAWN_PORTED_TRUE REPLACE_ISWCNTRL WCTYPE_H HAVE_WCTYPE_H @@ -658,18 +605,60 @@ HAVE_ISWCNTRL NEXT_WCHAR_H HAVE_WCHAR_H HAVE_WINT_T -WCHAR_H -REPLACE_WCWIDTH -HAVE_DECL_WCWIDTH -GNULIB_WCWIDTH HAVE_UNISTD_H NEXT_UNISTD_H +SYS_WAIT_H +NEXT_SYS_WAIT_H SYS_STAT_H NEXT_SYS_STAT_H HAVE_LSTAT -REPLACE_MKDIR POW_LIB NEXT_STRING_H +HAVE_RANDOM_H +NEXT_STDLIB_H +NEXT_STDIO_H +STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +SIZE_T_SUFFIX +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_PTRDIFF_T +HAVE_SYS_BITYPES_H +HAVE_SYS_INTTYPES_H +HAVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +HAVE__BOOL +STDBOOL_H +NEXT_STDARG_H +STDARG_H +HAVE_SPAWN_H +NEXT_SPAWN_H +NEXT_SIGNAL_H +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T +HAVE_STRUCT_SIGACTION_SA_SIGACTION +HAVE_SIGACTION +HAVE_SIGINFO_T +HAVE_SIGSET_T +HAVE_POSIX_SIGNALBLOCKING +GNULIB_SIGACTION +GNULIB_SIGPROCMASK +GNULIB_SIGNAL_H_SIGPIPE +SCHED_H +HAVE_STRUCT_SCHED_PARAM +HAVE_SCHED_H +NEXT_SCHED_H REPLACE_STRSIGNAL REPLACE_STRERROR REPLACE_STRCASESTR @@ -726,105 +715,76 @@ GNULIB_RAWMEMCHR GNULIB_MEMRCHR GNULIB_MEMPCPY GNULIB_MEMMEM -NEXT_STDLIB_H -NEXT_STDIO_H -STDINT_H -WINT_T_SUFFIX -WCHAR_T_SUFFIX -SIZE_T_SUFFIX -SIG_ATOMIC_T_SUFFIX -PTRDIFF_T_SUFFIX -HAVE_SIGNED_WINT_T -HAVE_SIGNED_WCHAR_T -HAVE_SIGNED_SIG_ATOMIC_T -BITSIZEOF_WINT_T -BITSIZEOF_WCHAR_T -BITSIZEOF_SIZE_T -BITSIZEOF_SIG_ATOMIC_T -BITSIZEOF_PTRDIFF_T -HAVE_SYS_BITYPES_H -HAVE_SYS_INTTYPES_H -HAVE_STDINT_H -NEXT_STDINT_H -HAVE_SYS_TYPES_H -HAVE_INTTYPES_H -HAVE_UNSIGNED_LONG_LONG_INT -HAVE_LONG_LONG_INT -HAVE__BOOL -STDBOOL_H -NEXT_STDARG_H -STDARG_H -NEXT_SIGNAL_H -HAVE_STRUCT_SIGACTION_SA_SIGACTION -HAVE_SIGACTION -HAVE_SIGINFO_T -HAVE_SIGSET_T -HAVE_POSIX_SIGNALBLOCKING -GNULIB_SIGACTION -GNULIB_SIGPROCMASK -GNULIB_SIGNAL_H_SIGPIPE +SPAWN_H +REPLACE_POSIX_SPAWN +HAVE_POSIX_SPAWN +GNULIB_POSIX_SPAWNATTR_DESTROY +GNULIB_POSIX_SPAWNATTR_SETSIGMASK +GNULIB_POSIX_SPAWNATTR_GETSIGMASK +GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT +GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT +GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY +GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY +GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM +GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM +GNULIB_POSIX_SPAWNATTR_SETPGROUP +GNULIB_POSIX_SPAWNATTR_GETPGROUP +GNULIB_POSIX_SPAWNATTR_SETFLAGS +GNULIB_POSIX_SPAWNATTR_GETFLAGS +GNULIB_POSIX_SPAWNATTR_INIT +GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE +GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT +GNULIB_POSIX_SPAWNP +GNULIB_POSIX_SPAWN +APPLE_UNIVERSAL_BUILD +LOCALE_FR_UTF8 +LOCALE_ZH_CN +LOCALE_JA NEXT_MATH_H VOID_UNSETENV REPLACE_STRTOD REPLACE_PUTENV REPLACE_MKSTEMP +HAVE_DECL_GETLOADAVG HAVE_UNSETENV +HAVE_SYS_LOADAVG_H +HAVE_STRUCT_RANDOM_DATA +HAVE_STRTOULL +HAVE_STRTOLL HAVE_STRTOD HAVE_SETENV HAVE_RPMATCH +HAVE_RANDOM_R HAVE_REALLOC_POSIX HAVE_MKDTEMP HAVE_GETSUBOPT HAVE_CALLOC_POSIX +HAVE_ATOLL GNULIB_UNSETENV +GNULIB_STRTOULL +GNULIB_STRTOLL GNULIB_STRTOD GNULIB_SETENV GNULIB_RPMATCH +GNULIB_RANDOM_R GNULIB_PUTENV GNULIB_MKSTEMP GNULIB_MKDTEMP GNULIB_GETSUBOPT +GNULIB_GETLOADAVG +GNULIB_ATOLL GNULIB_CALLOC_POSIX GNULIB_REALLOC_POSIX GNULIB_MALLOC_POSIX HAVE_MALLOC_POSIX -UNISTD_H_HAVE_WINSOCK2_H -REPLACE_WRITE -REPLACE_LSEEK -REPLACE_LCHOWN -REPLACE_GETPAGESIZE -REPLACE_GETCWD -REPLACE_FCHDIR -REPLACE_CLOSE -REPLACE_CHOWN -HAVE_SYS_PARAM_H -HAVE_OS_H -HAVE_DECL_GETLOGIN_R -HAVE_DECL_ENVIRON -HAVE_SLEEP -HAVE_READLINK -HAVE_GETPAGESIZE -HAVE_GETDTABLESIZE -HAVE_FTRUNCATE -HAVE_FSYNC -HAVE_DUP2 -GNULIB_WRITE -GNULIB_UNISTD_H_SIGPIPE -GNULIB_SLEEP -GNULIB_READLINK -GNULIB_LSEEK -GNULIB_LCHOWN -GNULIB_GETPAGESIZE -GNULIB_GETLOGIN_R -GNULIB_GETDTABLESIZE -GNULIB_GETCWD -GNULIB_FTRUNCATE -GNULIB_FSYNC -GNULIB_FCHDIR -GNULIB_ENVIRON -GNULIB_DUP2 -GNULIB_CLOSE -GNULIB_CHOWN +REPLACE_MKDIR +REPLACE_LSTAT +HAVE_LCHMOD +GNULIB_LSTAT +GNULIB_LCHMOD LTLIBMULTITHREAD LIBMULTITHREAD LTLIBTHREAD @@ -873,6 +833,9 @@ HAVE_DECL_COSL HAVE_DECL_ATANL HAVE_DECL_ASINL HAVE_DECL_ACOSL +HAVE_ISNANL +HAVE_ISNAND +HAVE_ISNANF GNULIB_TRUNCL GNULIB_TRUNCF GNULIB_TRUNC @@ -882,6 +845,9 @@ GNULIB_ROUNDF GNULIB_ROUND GNULIB_MATHL GNULIB_LDEXPL +GNULIB_ISNANL +GNULIB_ISNAND +GNULIB_ISNANF GNULIB_ISNAN GNULIB_ISINF GNULIB_ISFINITE @@ -897,6 +863,7 @@ REPLACE_PERROR REPLACE_GETLINE HAVE_DECL_GETLINE HAVE_DECL_GETDELIM +REPLACE_FCLOSE REPLACE_FFLUSH REPLACE_FTELL REPLACE_FTELLO @@ -910,6 +877,10 @@ REPLACE_OBSTACK_PRINTF HAVE_DECL_OBSTACK_PRINTF REPLACE_VASPRINTF HAVE_VASPRINTF +REPLACE_VDPRINTF +HAVE_VDPRINTF +REPLACE_DPRINTF +HAVE_DPRINTF REPLACE_VSPRINTF REPLACE_SPRINTF HAVE_DECL_VSNPRINTF @@ -931,6 +902,7 @@ GNULIB_FPUTS GNULIB_PUTCHAR GNULIB_PUTC GNULIB_FPUTC +GNULIB_FCLOSE GNULIB_FFLUSH GNULIB_FTELLO GNULIB_FTELL @@ -941,6 +913,8 @@ GNULIB_FOPEN GNULIB_OBSTACK_PRINTF_POSIX GNULIB_OBSTACK_PRINTF GNULIB_VASPRINTF +GNULIB_VDPRINTF +GNULIB_DPRINTF GNULIB_VSPRINTF_POSIX GNULIB_VSNPRINTF GNULIB_VPRINTF_POSIX @@ -966,15 +940,101 @@ EMULTIHOP_HIDDEN ERRNO_H NEXT_ERRNO_H PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE INCLUDE_NEXT +UNISTD_H_HAVE_WINSOCK2_H +REPLACE_WRITE +REPLACE_LSEEK +REPLACE_LCHOWN +REPLACE_GETPAGESIZE +REPLACE_GETCWD +REPLACE_FCHDIR +REPLACE_CLOSE +REPLACE_CHOWN +HAVE_SYS_PARAM_H +HAVE_OS_H +HAVE_DECL_GETLOGIN_R +HAVE_DECL_ENVIRON +HAVE_SLEEP +HAVE_READLINK +HAVE_LINK +HAVE_GETUSERSHELL +HAVE_GETPAGESIZE +HAVE_GETHOSTNAME +HAVE_GETDTABLESIZE +HAVE_GETDOMAINNAME +HAVE_FTRUNCATE +HAVE_FSYNC +HAVE_EUIDACCESS +HAVE_DUP2 +GNULIB_WRITE +GNULIB_UNISTD_H_SIGPIPE +GNULIB_SLEEP +GNULIB_READLINK +GNULIB_LSEEK +GNULIB_LINK +GNULIB_LCHOWN +GNULIB_GETUSERSHELL +GNULIB_GETPAGESIZE +GNULIB_GETLOGIN_R +GNULIB_GETHOSTNAME +GNULIB_GETDTABLESIZE +GNULIB_GETDOMAINNAME +GNULIB_GETCWD +GNULIB_FTRUNCATE +GNULIB_FSYNC +GNULIB_FCHDIR +GNULIB_EUIDACCESS +GNULIB_ENVIRON +GNULIB_DUP2 +GNULIB_CLOSE +GNULIB_CHOWN LTLIBCSTACK LIBCSTACK LTLIBSIGSEGV LIBSIGSEGV +LOCALE_FR +WCHAR_H +REPLACE_WCWIDTH +REPLACE_WCSRTOMBS +REPLACE_WCRTOMB +REPLACE_MBSNRTOWCS +REPLACE_MBSRTOWCS +REPLACE_MBRLEN +REPLACE_MBRTOWC +REPLACE_MBSINIT +REPLACE_WCTOB +REPLACE_BTOWC +REPLACE_MBSTATE_T +HAVE_DECL_WCWIDTH +HAVE_DECL_WCTOB +HAVE_WCSNRTOMBS +HAVE_WCSRTOMBS +HAVE_WCRTOMB +HAVE_MBSNRTOWCS +HAVE_MBSRTOWCS +HAVE_MBRLEN +HAVE_MBRTOWC +HAVE_MBSINIT +HAVE_BTOWC +GNULIB_WCWIDTH +GNULIB_WCSNRTOMBS +GNULIB_WCSRTOMBS +GNULIB_WCRTOMB +GNULIB_MBSNRTOWCS +GNULIB_MBSRTOWCS +GNULIB_MBRLEN +GNULIB_MBRTOWC +GNULIB_MBSINIT +GNULIB_WCTOB +GNULIB_BTOWC ALLOCA_H ALLOCA GL_COND_LIBTOOL_FALSE GL_COND_LIBTOOL_TRUE +EGREP +GREP +CPP host_os host_vendor host_cpu @@ -983,9 +1043,6 @@ build_os build_vendor build_cpu build -EGREP -GREP -CPP RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE @@ -1003,6 +1060,7 @@ CPPFLAGS LDFLAGS CFLAGS CC +AM_BACKSLASH am__untar am__tar AMTAR @@ -1056,6 +1114,7 @@ bindir program_transform_name prefix exec_prefix +PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -1076,6 +1135,7 @@ with_libpth_prefix enable_largefile with_included_regex enable_changeword +with_syscmd_shell with_dmalloc ' ac_precious_vars='build_alias @@ -1195,8 +1255,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1222,8 +1281,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1427,8 +1485,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1444,8 +1501,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1475,17 +1531,17 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1502,15 +1558,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1533,8 +1587,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1564,11 +1617,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } + as_fn_error "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } + as_fn_error "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1607,13 +1658,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1639,7 +1688,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU M4 1.4.12 to adapt to many kinds of systems. +\`configure' configures GNU M4 1.4.13 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1709,7 +1758,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU M4 1.4.12:";; + short | recursive ) echo "Configuration of GNU M4 1.4.13:";; esac cat <<\_ACEOF @@ -1736,12 +1785,10 @@ Optional Packages: --with-libpth-prefix[=DIR] search for libpth in DIR/include and DIR/lib --without-libpth-prefix don't search for libpth in includedir and libdir --without-included-regex - don't compile regex; this is the default on 32-bit - systems with recent-enough versions of the GNU C - Library (use with caution on other systems). On - systems with 64-bit ptrdiff_t and 32-bit int, - --with-included-regex is the default, in case regex - functions operate on very long strings (>2GB) + don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems). + --with-syscmd-shell shell used by syscmd [/bin/sh] --with-dmalloc use dmalloc, as in dmalloc.tar.gz from @/ftp.antaire.com:antaire/src/dmalloc. @@ -1759,6 +1806,8 @@ Use these variables to override the choi it to find libraries and programs with nonstandard names/locations. Report bugs to <bug-m4@gnu.org>. +GNU M4 home page: <http://www.gnu.org/software/m4/>. +General help using GNU software: <http://www.gnu.org/gethelp/>. _ACEOF ac_status=$? fi @@ -1821,1129 +1870,1622 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU M4 configure 1.4.12 -generated by GNU Autoconf 2.63 +GNU M4 configure 1.4.13 +generated by GNU Autoconf 2.63b -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi -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 M4 $as_me 1.4.12, which was -generated by GNU Autoconf 2.63. Invocation command line was - - $ $0 $@ -_ACEOF -exec 5>>config.log +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () { -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_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done -IFS=$as_save_IFS + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval -} >&5 +} # ac_fn_c_try_compile -cat >&5 <<_ACEOF +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval -## ----------- ## -## Core tests. ## -## ----------- ## +} # ac_fn_c_try_cpp +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> _ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } -# 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=`$as_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_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $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. ## -## ----------------- ## +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( cat <<\_ASBOX +## ----------------------------- ## +## Report this to bug-m4@gnu.org ## +## ----------------------------- ## _ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - 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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi +} # ac_fn_c_check_header_mongrel - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_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 +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval -# Predefined preprocessor variables. +} # ac_fn_c_try_run -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> _ACEOF +if ac_fn_c_try_compile "$LINENO"; then + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +} # ac_fn_c_check_header_compile -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +} # ac_fn_c_try_link +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +#undef $2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: 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 - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then + eval "$3=yes" else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file + eval "$3=no" fi - -gl_use_threads_default=no -ac_func_list="$ac_func_list setrlimit" -ac_header_list="$ac_header_list ucontext.h" -ac_func_list="$ac_func_list sigaltstack" -ac_header_list="$ac_header_list unistd.h" -ac_header_list="$ac_header_list errno.h" -ac_header_list="$ac_header_list fcntl.h" -ac_func_list="$ac_func_list mempcpy" -ac_header_list="$ac_header_list float.h" -ac_header_list="$ac_header_list stdio_ext.h" -ac_func_list="$ac_func_list __fpending" -ac_func_list="$ac_func_list fpurge" -ac_func_list="$ac_func_list __fpurge" -ac_func_list="$ac_func_list __freading" -ac_header_list="$ac_header_list sys/time.h" -ac_func_list="$ac_func_list gettimeofday" -ac_header_list="$ac_header_list math.h" -ac_header_list="$ac_header_list sys/param.h" -gl_printf_safe=yes -ac_func_list="$ac_func_list mbsinit" -ac_header_list="$ac_header_list locale.h" -ac_func_list="$ac_func_list isblank" -ac_func_list="$ac_func_list iswctype" -ac_func_list="$ac_func_list mbrtowc" -ac_func_list="$ac_func_list wcrtomb" -ac_func_list="$ac_func_list wcscoll" -ac_func_list="$ac_func_list sigaction" -ac_func_list="$ac_func_list siginterrupt" -ac_header_list="$ac_header_list signal.h" -ac_header_list="$ac_header_list stdarg.h" -ac_header_list="$ac_header_list stdint.h" -ac_header_list="$ac_header_list wchar.h" -ac_header_list="$ac_header_list stdio.h" -ac_header_list="$ac_header_list stdlib.h" -ac_header_list="$ac_header_list sys/socket.h" -ac_header_list="$ac_header_list string.h" -ac_func_list="$ac_func_list lstat" -ac_header_list="$ac_header_list sys/stat.h" -ac_func_list="$ac_func_list pipe" -ac_func_list="$ac_func_list vasnprintf" -ac_func_list="$ac_func_list iswcntrl" -ac_header_list="$ac_header_list wctype.h" -# 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,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: 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 - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_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 - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +} # ac_fn_c_check_func +# ac_fn_c_check_decl LINENO SYMBOL VAR +# ------------------------------------ +# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 +$as_echo_n "checking whether $2 is declared... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $2 + (void) $2; +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +} # ac_fn_c_check_decl +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + : +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +} # ac_fn_c_check_type +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + echo >>conftest.val; read $3 <conftest.val; ac_retval=0 +else + ac_retval=1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.val + fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval +} # ac_fn_c_compute_int - - - - - - - - -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 - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&2;} - { (exit 1); exit 1; }; } -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.10' - -# 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. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else - 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_test_x "$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 - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - -done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + eval "$4=yes" +else + eval "$4=no" fi - 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 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -# 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}' +} # ac_fn_c_check_member +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' +It was created by GNU M4 $as_me 1.4.13, which was +generated by GNU Autoconf 2.63b. Invocation command line was -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + $ $0 $@ -{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# 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 +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## - # 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". - { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi +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` - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -$as_echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "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 $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +/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` -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= - { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi +_ASUNAME -{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +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_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done + $as_echo "PATH: $as_dir" + done IFS=$as_save_IFS -fi +} >&5 - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +cat >&5 <<_ACEOF -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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - $as_echo_n "(cached) " >&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_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS +## ----------- ## +## Core tests. ## +## ----------- ## -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:$LINENO: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +_ACEOF - test -n "$AWK" && break +# 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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + 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 + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&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 - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi +# 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 -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 + 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; 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 -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 - { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } - fi -fi + 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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo -# 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 + 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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_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 && + $as_echo "$as_me: caught signal $ac_signal" + $as_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'; as_fn_exit 1' $ac_signal +done +ac_signal=0 +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h -# Define the identity of the package. - PACKAGE='m4' - VERSION='1.4.12' +$as_echo "/* confdefs.h */" > confdefs.h +# Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" +#define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" _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}"} - +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" fi done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac fi else - STRIP="$ac_cv_prog_STRIP" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file fi +gl_use_threads_default=no +as_fn_append ac_func_list " btowc" +as_fn_append ac_func_list " setrlimit" +as_fn_append ac_header_list " ucontext.h" +as_fn_append ac_func_list " sigaltstack" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " errno.h" +as_fn_append ac_header_list " fcntl.h" +as_fn_append ac_func_list " mempcpy" +as_fn_append ac_header_list " float.h" +as_fn_append ac_header_list " stdio_ext.h" +as_fn_append ac_func_list " __fpending" +as_fn_append ac_func_list " fpurge" +as_fn_append ac_func_list " __fpurge" +as_fn_append ac_func_list " __freading" +as_fn_append ac_func_list " getdtablesize" +as_fn_append ac_header_list " sys/time.h" +as_fn_append ac_func_list " gettimeofday" +as_fn_append ac_func_list " lstat" +as_fn_append ac_header_list " math.h" +as_fn_append ac_func_list " mbsinit" +as_fn_append ac_func_list " mbrtowc" +as_fn_append ac_func_list " pathconf" +as_fn_append ac_header_list " sys/param.h" +as_fn_append ac_func_list " posix_spawn" +gl_printf_safe=yes +as_fn_append ac_header_list " locale.h" +as_fn_append ac_func_list " isblank" +as_fn_append ac_func_list " iswctype" +as_fn_append ac_func_list " wcscoll" +as_fn_append ac_header_list " sched.h" +as_fn_append ac_func_list " sigaction" +as_fn_append ac_func_list " siginterrupt" +as_fn_append ac_header_list " signal.h" +as_fn_append ac_header_list " spawn.h" +as_fn_append ac_header_list " stdarg.h" +as_fn_append ac_header_list " stdint.h" +as_fn_append ac_header_list " wchar.h" +as_fn_append ac_header_list " stdio.h" +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_header_list " sys/socket.h" +as_fn_append ac_header_list " string.h" +as_fn_append ac_header_list " sys/stat.h" +as_fn_append ac_header_list " sys/wait.h" +as_fn_append ac_func_list " pipe" +as_fn_append ac_func_list " vasnprintf" +as_fn_append ac_func_list " wcrtomb" +as_fn_append ac_func_list " iswcntrl" +as_fn_append ac_header_list " wctype.h" +as_fn_append ac_func_list " setenv" +as_fn_append ac_func_list " wctob" +# 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 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 -' - - - +## -------------------- ## +## Main body of script. ## +## -------------------- ## +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 + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done +done +if test -z "$ac_aux_dir"; then + as_fn_error "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 +fi +# These three variables are undocumented and unsupported, +# 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. -ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin" +am__api_version='1.10b' -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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&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 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + # 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_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir + fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# 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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + 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". + as_fn_error "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + as_fn_error "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - 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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" fi fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS -if test $ac_prog_rejected = yes; then - # 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 - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 + as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + 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='m4' + VERSION='1.4.13' + + +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"} + +# 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 -' + + + + +AM_BACKSLASH='\' + + + + + +ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin" + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 @@ -2956,38 +3498,34 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$CC" && break - done fi -if test -z "$CC"; then +if test -z "$ac_cv_prog_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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 @@ -3000,141 +3538,330 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - - 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:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi -fi - - -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - -# Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -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 test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" -ac_rmfiles= -for ac_file in $ac_files + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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 - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -rm -f $ac_rmfiles + done +IFS=$as_save_IFS -if { (ac_try="$ac_link_default" +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&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_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&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_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ { ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +{ { ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +{ { ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3151,7 +3878,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3170,84 +3897,76 @@ test "$ac_cv_exeext" = no && ac_cv_exeex else ac_file='' fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } fi - ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (case "(($ac_try" in + { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. +as_fn_error "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +See \`config.log' for more details." "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" +if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3262,32 +3981,24 @@ for ac_file in conftest.exe conftest con esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } fi - rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3299,17 +4010,17 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" +if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3322,31 +4033,23 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3360,37 +4063,16 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes @@ -3399,7 +4081,7 @@ else fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 @@ -3408,11 +4090,7 @@ else ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3423,35 +4101,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3462,36 +4116,12 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3502,42 +4132,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -3554,18 +4159,14 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> @@ -3622,32 +4223,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlang -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -3658,17 +4236,19 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac - +if test "x$ac_cv_prog_cc_c89" != xno; then + : +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3687,7 +4267,7 @@ am__doit: .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= @@ -3715,7 +4295,7 @@ if test "$am__include" = "#"; then fi -{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf @@ -3740,7 +4320,7 @@ fi depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 @@ -3785,6 +4365,12 @@ else done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll @@ -3795,19 +4381,23 @@ else break fi ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; none) break ;; esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message @@ -3831,7 +4421,7 @@ else fi fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type @@ -3849,7 +4439,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 @@ -3862,24 +4452,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3889,7 +4479,7 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 @@ -3902,24 +4492,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3928,7 +4518,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -3939,10 +4529,10 @@ else fi if test "x$CC" != xcc; then - { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else - { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | @@ -3950,11 +4540,7 @@ set dummy $CC; ac_cc=`$as_echo "$2" | if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3970,63 +4556,63 @@ _ACEOF # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* -if { (case "(($ac_try" in +if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - test -f conftest2.$ac_objext && { (case "(($ac_try" in + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' - { (case "(($ac_try" in + { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* - if { (case "(($ac_try" in + if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - test -f conftest2.$ac_objext && { (case "(($ac_try" in + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then # cc works too. : @@ -4043,23 +4629,22 @@ rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -cat >>confdefs.h <<\_ACEOF -#define NO_MINUS_C_MINUS_O 1 -_ACEOF +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC -ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. @@ -4069,13 +4654,84 @@ if eval "test \"`echo '$ac_cv_prog_cc_'$ fi +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + 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 -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then @@ -4097,11 +4753,7 @@ do # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> @@ -4110,72 +4762,28 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : else - $as_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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done @@ -4193,7 +4801,7 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -4204,11 +4812,7 @@ do # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> @@ -4217,72 +4821,28 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : else - $as_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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done @@ -4291,13 +4851,10 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c @@ -4307,7 +4864,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLA ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 @@ -4320,7 +4877,7 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/x do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue @@ -4340,7 +4897,7 @@ case `"$ac_path_GREP" --version 2>&1` in $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" @@ -4355,24 +4912,22 @@ esac $ac_path_GREP_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 @@ -4388,7 +4943,7 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/x do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue @@ -4408,7 +4963,7 @@ case `"$ac_path_EGREP" --version 2>&1` i $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" @@ -4423,12 +4978,10 @@ esac $ac_path_EGREP_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4436,21 +4989,17 @@ fi fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> @@ -4465,41 +5014,16 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no + ac_cv_header_stdc=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <string.h> @@ -4516,11 +5040,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> @@ -4540,11 +5060,7 @@ if test $ac_cv_header_stdc = yes; then if test "$cross_compiling" = yes; then : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ctype.h> #include <stdlib.h> @@ -4571,505 +5087,145 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = x""yes; then + MINIX=yes +else + MINIX= +fi + if test "$MINIX" = yes; then +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + case "$host_os" in + hpux*) + +$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + + ;; + esac + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +# 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_safe_to_define___extensions__=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" + ac_cv_safe_to_define___extensions__=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h -fi + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h -done + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - if test "${ac_cv_header_minix_config_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_source+set}" = set; then $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -$as_echo_n "checking minix/config.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -#include <minix/config.h> +#include <sys/types.h> /* for off_t */ + #include <stdio.h> +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -$as_echo_n "checking minix/config.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <minix/config.h> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_minix_config_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } - -fi -if test "x$ac_cv_header_minix_config_h" = x""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 - - - - { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if test "${ac_cv_safe_to_define___extensions__+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -# define __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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_safe_to_define___extensions__=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_safe_to_define___extensions__=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$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 _ALL_SOURCE 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _TANDEM_SOURCE 1 -_ACEOF - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -{ $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_source+set}" = set; then - $as_echo_n "(cached) " >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> /* for off_t */ - #include <stdio.h> -int -main () -{ -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then ac_cv_sys_largefile_source=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include <sys/types.h> /* for off_t */ @@ -5083,43 +5239,16 @@ int (*fp) (FILE *, off_t, int) = fseeko; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then ac_cv_sys_largefile_source=1; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 $as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; @@ -5136,9 +5265,7 @@ rm -rf conftest* # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_FSEEKO 1 -_ACEOF +$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h fi @@ -5169,20 +5296,16 @@ fi ;; esac - case $ac_cv_prog_cc_stdc in - no) ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; - *) { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5 + case $ac_cv_prog_cc_stdc in #( + no) ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if test "${ac_cv_prog_cc_c99+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdbool.h> @@ -5324,32 +5447,9 @@ _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then ac_cv_prog_cc_c99=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done @@ -5360,31 +5460,27 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 else - { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> @@ -5441,32 +5537,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlang -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -5477,14 +5550,14 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then @@ -5493,23 +5566,21 @@ else ac_cv_prog_cc_stdc=no fi - fi - ;; esac - { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO Standard C" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 $as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } if test "${ac_cv_prog_cc_stdc+set}" = set; then $as_echo_n "(cached) " >&6 fi - case $ac_cv_prog_cc_stdc in - no) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - '') { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - *) { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 + case $ac_cv_prog_cc_stdc in #( + no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 $as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; esac @@ -5518,7 +5589,6 @@ esac - # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then enableval=$enable_threads; gl_use_threads=$enableval @@ -5563,22 +5633,21 @@ fi - if test -z "$AB_PACKAGE"; then AB_PACKAGE=${PACKAGE_NAME:-$PACKAGE} fi - { $as_echo "$as_me:$LINENO: autobuild project... $AB_PACKAGE" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild project... $AB_PACKAGE" >&5 $as_echo "$as_me: autobuild project... $AB_PACKAGE" >&6;} if test -z "$AB_VERSION"; then AB_VERSION=${PACKAGE_VERSION:-$VERSION} fi - { $as_echo "$as_me:$LINENO: autobuild revision... $AB_VERSION" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild revision... $AB_VERSION" >&5 $as_echo "$as_me: autobuild revision... $AB_VERSION" >&6;} hostname=`hostname` if test "$hostname"; then - { $as_echo "$as_me:$LINENO: autobuild hostname... $hostname" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild hostname... $hostname" >&5 $as_echo "$as_me: autobuild hostname... $hostname" >&6;} fi @@ -5589,7 +5658,7 @@ $as_echo "$as_me: autobuild hostname... date=`date` fi if test "$date"; then - { $as_echo "$as_me:$LINENO: autobuild timestamp... $date" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild timestamp... $date" >&5 $as_echo "$as_me: autobuild timestamp... $date" >&6;} fi @@ -5613,19 +5682,15 @@ $as_echo "$as_me: autobuild timestamp... # 'unsigned long long int', which confuses assumptions made by gnulib. # Simply pretend that neither type exists if both do not work. - { $as_echo "$as_me:$LINENO: checking for long long int" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 $as_echo_n "checking for long long int... " >&6; } if test "${ac_cv_type_long_long_int+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* For now, do not test the preprocessor; as of 2007 there are too many + + /* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ @@ -5654,35 +5719,11 @@ main () } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; 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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> #ifndef LLONG_MAX @@ -5708,77 +5749,39 @@ long long int n = 1; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then ac_cv_type_long_long_int=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_type_long_long_int=no + ac_cv_type_long_long_int=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long_int=no + ac_cv_type_long_long_int=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 $as_echo "$ac_cv_type_long_long_int" >&6; } if test $ac_cv_type_long_long_int = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_LONG_INT 1 -_ACEOF +$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for unsigned long long int" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 $as_echo_n "checking for unsigned long long int... " >&6; } if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* For now, do not test the preprocessor; as of 2007 there are too many + + /* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ @@ -5807,46 +5810,19 @@ main () } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then ac_cv_type_unsigned_long_long_int=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_unsigned_long_long_int=no + ac_cv_type_unsigned_long_long_int=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_UNSIGNED_LONG_LONG_INT 1 -_ACEOF +$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h fi @@ -5854,9 +5830,7 @@ if test $ac_cv_type_long_long_int:$ac_cv then ac_cv_type_long_long_int=no -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_LONG_INT 0 -_ACEOF +$as_echo "#define HAVE_LONG_LONG_INT 0" >>confdefs.h fi @@ -5864,18 +5838,15 @@ fi + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <alloca.h> int @@ -5887,59 +5858,28 @@ char *p = (char *) alloca (2 * sizeof (i return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then ac_cv_working_alloca_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_working_alloca_h=no + ac_cv_working_alloca_h=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking for alloca" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca @@ -5971,47 +5911,20 @@ char *p = (char *) alloca (1); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then ac_cv_func_alloca_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_alloca_works=no + ac_cv_func_alloca_works=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -6025,21 +5938,15 @@ else ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF +$as_echo "#define C_ALLOCA 1" >>confdefs.h -{ $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if test "${ac_cv_os_cray+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray @@ -6057,100 +5964,13 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF @@ -6163,7 +5983,7 @@ fi done fi -{ $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then $as_echo_n "(cached) " >&6 @@ -6171,11 +5991,7 @@ 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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -6198,46 +6014,18 @@ main () return find_stack_direction () < 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then ac_cv_c_stack_direction=1 else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 + ac_cv_c_stack_direction=-1 fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } - cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF @@ -6246,256 +6034,205 @@ _ACEOF fi + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + HAVE_BTOWC=1; + HAVE_MBSINIT=1; + HAVE_MBRTOWC=1; + HAVE_MBRLEN=1; + HAVE_MBSRTOWCS=1; + HAVE_MBSNRTOWCS=1; + HAVE_WCRTOMB=1; + HAVE_WCSRTOMBS=1; + HAVE_WCSNRTOMBS=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCWIDTH=1; + REPLACE_MBSTATE_T=0; + REPLACE_BTOWC=0; + REPLACE_WCTOB=0; + REPLACE_MBSINIT=0; + REPLACE_MBRTOWC=0; + REPLACE_MBRLEN=0; + REPLACE_MBSRTOWCS=0; + REPLACE_MBSNRTOWCS=0; + REPLACE_WCRTOMB=0; + REPLACE_WCSRTOMBS=0; + REPLACE_WCWIDTH=0; + WCHAR_H=''; + -for ac_func in $ac_func_list + for ac_func in $ac_func_list do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ +fi +done -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } +if test "${am_cv_langinfo_codeset+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <langinfo.h> int main () { -return $ac_func (); +char* cs = nl_langinfo(CODESET); return !cs; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then + am_cv_langinfo_codeset=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + am_cv_langinfo_codeset=no fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -done - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +$as_echo "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then +$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + fi -for ac_header in $ac_header_list -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* - ac_header_compiler=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` + + for ac_header in $ac_header_list +do + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -6513,16 +6250,25 @@ done + case "$host_os" in + sunos4* | freebsd* | dragonfly* | openbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems + FAULT_YIELDS_SIGBUS=1 ;; + hpux*) # HP-UX + FAULT_YIELDS_SIGBUS=1 ;; + macos* | darwin*) # MacOS X + FAULT_YIELDS_SIGBUS=1 ;; + gnu*) # Hurd + FAULT_YIELDS_SIGBUS=1 ;; + *) + FAULT_YIELDS_SIGBUS=0 ;; + esac +cat >>confdefs.h <<_ACEOF +#define FAULT_YIELDS_SIGBUS $FAULT_YIELDS_SIGBUS +_ACEOF - - - - - - - { $as_echo "$as_me:$LINENO: checking for working C stack overflow detection" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working C stack overflow detection" >&5 $as_echo_n "checking for working C stack overflow detection... " >&6; } if test "${ac_cv_sys_stack_overflow_works+set}" = set; then $as_echo_n "(cached) " >&6 @@ -6530,11 +6276,7 @@ else if test "$cross_compiling" = yes; then ac_cv_sys_stack_overflow_works=cross-compiling else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> @@ -6580,6 +6322,10 @@ cat >>conftest.$ac_ext <<_ACEOF sigemptyset (&act.sa_mask); act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; act.sa_handler = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return -1; + #endif return sigaction (SIGSEGV, &act, 0); } static volatile int * @@ -6612,54 +6358,25 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then ac_cv_sys_stack_overflow_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_sys_stack_overflow_works=no + ac_cv_sys_stack_overflow_works=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_stack_overflow_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_stack_overflow_works" >&5 $as_echo "$ac_cv_sys_stack_overflow_works" >&6; } if test $ac_cv_sys_stack_overflow_works = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STACK_OVERFLOW_HANDLING 1 -_ACEOF +$as_echo "#define HAVE_STACK_OVERFLOW_HANDLING 1" >>confdefs.h - { $as_echo "$as_me:$LINENO: checking for correct stack_t interpretation" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct stack_t interpretation" >&5 $as_echo_n "checking for correct stack_t interpretation... " >&6; } if test "${gl_cv_sigaltstack_low_base+set}" = set; then $as_echo_n "(cached) " >&6 @@ -6668,14 +6385,10 @@ else if test "$cross_compiling" = yes; then gl_cv_sigaltstack_low_base=cross-compiling else - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include <stdlib.h> #include <signal.h> #if HAVE_SYS_SIGNAL_H @@ -6722,54 +6435,25 @@ int main () exit (3); } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then gl_cv_sigaltstack_low_base=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_sigaltstack_low_base=no + gl_cv_sigaltstack_low_base=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_sigaltstack_low_base" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sigaltstack_low_base" >&5 $as_echo "$gl_cv_sigaltstack_low_base" >&6; } if test "$gl_cv_sigaltstack_low_base" = no; then -cat >>confdefs.h <<\_ACEOF -#define SIGALTSTACK_SS_REVERSED 1 -_ACEOF +$as_echo "#define SIGALTSTACK_SS_REVERSED 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for precise C stack overflow detection" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for precise C stack overflow detection" >&5 $as_echo_n "checking for precise C stack overflow detection... " >&6; } if test "${ac_cv_sys_xsi_stack_overflow_heuristic+set}" = set; then $as_echo_n "(cached) " >&6 @@ -6777,11 +6461,7 @@ else if test "$cross_compiling" = yes; then ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> @@ -6859,6 +6539,10 @@ cat >>conftest.$ac_ext <<_ACEOF sigemptyset (&act.sa_mask); act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; act.sa_sigaction = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return -1; + #endif return sigaction (SIGSEGV, &act, 0); } static volatile int * @@ -6891,51 +6575,22 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then ac_cv_sys_xsi_stack_overflow_heuristic=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_sys_xsi_stack_overflow_heuristic=no + ac_cv_sys_xsi_stack_overflow_heuristic=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_xsi_stack_overflow_heuristic" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_xsi_stack_overflow_heuristic" >&5 $as_echo "$ac_cv_sys_xsi_stack_overflow_heuristic" >&6; } if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1 -_ACEOF +$as_echo "#define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1" >>confdefs.h fi fi @@ -6979,7 +6634,7 @@ fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 $as_echo_n "checking for ld used by GCC... " >&6; } case $host in *-*-mingw*) @@ -7009,10 +6664,10 @@ $as_echo_n "checking for ld used by GCC. ;; esac elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${acl_cv_path_LD+set}" = set; then @@ -7043,16 +6698,14 @@ fi LD="$acl_cv_path_LD" if test -n "$LD"; then - { $as_echo "$as_me:$LINENO: result: $LD" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 @@ -7065,14 +6718,14 @@ case `$LD -v 2>&1 </dev/null` in acl_cv_prog_gnu_ld=no ;; esac fi -{ $as_echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld - { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if test "${acl_cv_rpath+set}" = set; then $as_echo_n "(cached) " >&6 @@ -7085,7 +6738,7 @@ else acl_cv_rpath=done fi -{ $as_echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" @@ -7110,16 +6763,12 @@ fi acl_libdirstem2= case "$host_os" in solaris*) - { $as_echo "$as_me:$LINENO: checking for 64-bit host" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if test "${gl_cv_solaris_64bit+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 @@ -7137,7 +6786,7 @@ rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_solaris_64bit" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 @@ -7439,12 +7088,16 @@ fi case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBSIGSEGV_PREFIX="$basedir" + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - LIBSIGSEGV_PREFIX="$basedir" + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi additional_includedir="$basedir/include" ;; esac @@ -7654,7 +7307,7 @@ fi done - { $as_echo "$as_me:$LINENO: checking for libsigsegv" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 $as_echo_n "checking for libsigsegv... " >&6; } if test "${gl_cv_lib_sigsegv+set}" = set; then $as_echo_n "(cached) " >&6 @@ -7663,11 +7316,7 @@ else gl_cv_lib_sigsegv="no, consider installing GNU libsigsegv" gl_save_LIBS="$LIBS" LIBS="$LIBS $LIBSIGSEGV" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sigsegv.h> int @@ -7678,52 +7327,23 @@ sigsegv_deinstall_handler(); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then gl_cv_lib_sigsegv=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS="$gl_save_LIBS" fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_lib_sigsegv" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_sigsegv" >&5 $as_echo "$gl_cv_lib_sigsegv" >&6; } if test "$gl_cv_lib_sigsegv" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBSIGSEGV 1 -_ACEOF +$as_echo "#define HAVE_LIBSIGSEGV 1" >>confdefs.h - { $as_echo "$as_me:$LINENO: checking how to link with libsigsegv" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 $as_echo_n "checking how to link with libsigsegv... " >&6; } - { $as_echo "$as_me:$LINENO: result: $LIBSIGSEGV" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 $as_echo "$LIBSIGSEGV" >&6; } else CPPFLAGS="$gl_save_CPPFLAGS" @@ -7738,17 +7358,13 @@ $as_echo "$LIBSIGSEGV" >&6; } - { $as_echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system is Windows or MSDOS" >&5 $as_echo_n "checking whether system is Windows or MSDOS... " >&6; } if test "${ac_cv_win_or_dos+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -7761,52 +7377,27 @@ neither MSDOS nor Windows return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then ac_cv_win_or_dos=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_win_or_dos=no + ac_cv_win_or_dos=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_win_or_dos" >&5 $as_echo "$ac_cv_win_or_dos" >&6; } if test x"$ac_cv_win_or_dos" = xyes; then ac_fs_accepts_drive_letter_prefix=1 ac_fs_backslash_is_file_name_separator=1 - { $as_echo "$as_me:$LINENO: checking whether drive letter can start relative path" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether drive letter can start relative path" >&5 $as_echo_n "checking whether drive letter can start relative path... " >&6; } if test "${ac_cv_drive_letter_can_be_relative+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -7819,36 +7410,15 @@ drive letters are always absolute return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then ac_cv_drive_letter_can_be_relative=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_drive_letter_can_be_relative=no + ac_cv_drive_letter_can_be_relative=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_drive_letter_can_be_relative" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_drive_letter_can_be_relative" >&5 $as_echo "$ac_cv_drive_letter_can_be_relative" >&6; } if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then ac_fs_drive_letter_can_be_relative=1 @@ -7870,7 +7440,6 @@ _ACEOF - cat >>confdefs.h <<_ACEOF #define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator _ACEOF @@ -7884,7 +7453,7 @@ _ACEOF - { $as_echo "$as_me:$LINENO: checking whether // is distinct from /" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 $as_echo_n "checking whether // is distinct from /... " >&6; } if test "${gl_cv_double_slash_root+set}" = set; then $as_echo_n "(cached) " >&6 @@ -7913,26 +7482,82 @@ else fi fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_double_slash_root" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 $as_echo "$gl_cv_double_slash_root" >&6; } if test "$gl_cv_double_slash_root" = yes; then -cat >>confdefs.h <<\_ACEOF -#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1 -_ACEOF +$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h fi + GNULIB_CHOWN=0; + GNULIB_CLOSE=0; + GNULIB_DUP2=0; + GNULIB_ENVIRON=0; + GNULIB_EUIDACCESS=0; + GNULIB_FCHDIR=0; + GNULIB_FSYNC=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETDOMAINNAME=0; + GNULIB_GETDTABLESIZE=0; + GNULIB_GETHOSTNAME=0; + GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; + GNULIB_GETUSERSHELL=0; + GNULIB_LCHOWN=0; + GNULIB_LINK=0; + GNULIB_LSEEK=0; + GNULIB_READLINK=0; + GNULIB_SLEEP=0; + GNULIB_UNISTD_H_SIGPIPE=0; + GNULIB_WRITE=0; + HAVE_DUP2=1; + HAVE_EUIDACCESS=1; + HAVE_FSYNC=1; + HAVE_FTRUNCATE=1; + HAVE_GETDOMAINNAME=1; + HAVE_GETDTABLESIZE=1; + HAVE_GETHOSTNAME=1; + HAVE_GETPAGESIZE=1; + HAVE_GETUSERSHELL=1; + HAVE_LINK=1; + HAVE_READLINK=1; + HAVE_SLEEP=1; + HAVE_DECL_ENVIRON=1; + HAVE_DECL_GETLOGIN_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; + REPLACE_CHOWN=0; + REPLACE_CLOSE=0; + REPLACE_FCHDIR=0; + REPLACE_GETCWD=0; + REPLACE_GETPAGESIZE=0; + REPLACE_LCHOWN=0; + REPLACE_LSEEK=0; + REPLACE_WRITE=0; + UNISTD_H_HAVE_WINSOCK2_H=0; + + - { $as_echo "$as_me:$LINENO: checking whether the preprocessor supports include_next" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 $as_echo_n "checking whether the preprocessor supports include_next... " >&6; } if test "${gl_cv_have_include_next+set}" = set; then $as_echo_n "(cached) " >&6 else - rm -rf conftestd1 conftestd2 - mkdir conftestd1 conftestd2 - cat <<EOF > conftestd1/conftest.h + rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat <<EOF > conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd1b/conftest.h #define DEFINED_IN_CONFTESTD1 #include <stdio.h> #include_next <conftest.h> @@ -7948,52 +7573,50 @@ EOF #endif #define DEFINED_IN_CONFTESTD2 EOF - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" - cat >conftest.$ac_ext <<_ACEOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ #include <conftest.h> _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then gl_cv_have_include_next=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_have_include_next=no -fi + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <conftest.h> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_have_include_next=buggy +else + gl_cv_have_include_next=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 - CPPFLAGS="$save_CPPFLAGS" - rm -rf conftestd1 conftestd2 + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_have_include_next" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 $as_echo "$gl_cv_have_include_next" >&6; } PRAGMA_SYSTEM_HEADER= if test $gl_cv_have_include_next = yes; then INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next if test -n "$GCC"; then PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' fi else - INCLUDE_NEXT=include + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi fi @@ -8002,17 +7625,14 @@ $as_echo "$gl_cv_have_include_next" >&6; - { $as_echo "$as_me:$LINENO: checking for complete errno.h" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 $as_echo_n "checking for complete errno.h... " >&6; } if test "${gl_cv_header_errno_h_complete+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <errno.h> @@ -8055,7 +7675,7 @@ rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_errno_h_complete" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 $as_echo "$gl_cv_header_errno_h_complete" >&6; } if test $gl_cv_header_errno_h_complete = yes; then ERRNO_H='' @@ -8066,30 +7686,26 @@ $as_echo "$gl_cv_header_errno_h_complete - - - - if test $gl_cv_have_include_next = yes; then gl_cv_next_errno_h='<'errno.h'>' else - { $as_echo "$as_me:$LINENO: checking absolute name of <errno.h>" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5 $as_echo_n "checking absolute name of <errno.h>... " >&6; } if test "${gl_cv_next_errno_h+set}" = set; then $as_echo_n "(cached) " >&6 else if test $ac_cv_header_errno_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <errno.h> _ACEOF - gl_cv_next_errno_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/errno.h#{ s#.*"\(.*/errno.h\)".*#\1# s#^/[^/]#//&# @@ -8101,7 +7717,7 @@ _ACEOF fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_errno_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 $as_echo "$gl_cv_next_errno_h" >&6; } fi NEXT_ERRNO_H=$gl_cv_next_errno_h @@ -8113,17 +7729,13 @@ $as_echo "$gl_cv_next_errno_h" >&6; } if test -n "$ERRNO_H"; then - { $as_echo "$as_me:$LINENO: checking for EMULTIHOP value" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 $as_echo_n "checking for EMULTIHOP value... " >&6; } if test "${gl_cv_header_errno_h_EMULTIHOP+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <errno.h> @@ -8141,11 +7753,7 @@ fi rm -f conftest* if test $gl_cv_header_errno_h_EMULTIHOP = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 @@ -8162,371 +7770,170 @@ fi rm -f conftest* if test $gl_cv_header_errno_h_EMULTIHOP = hidden; 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. */ - + if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " #define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include <stdio.h> #include <stdlib.h> +"; then + : +fi -int -main () -{ -static int test_array [1 - 2 * !((EMULTIHOP) >= 0)]; -test_array [0] = 0 + fi + fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } + case $gl_cv_header_errno_h_EMULTIHOP in + yes | no) + EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= + ;; + *) + EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" + ;; + esac -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> -int -main () -{ -static int test_array [1 - 2 * !((EMULTIHOP) <= $ac_mid)]; -test_array [0] = 0 + fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break + + if test -n "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +$as_echo_n "checking for ENOLINK value... " >&6; } +if test "${gl_cv_header_errno_h_ENOLINK+set}" = set; then + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +#include <errno.h> +#ifdef ENOLINK +yes +#endif - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + gl_cv_header_errno_h_ENOLINK=yes +else + gl_cv_header_errno_h_ENOLINK=no +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_ENOLINK = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> - -int -main () -{ -static int test_array [1 - 2 * !((EMULTIHOP) < 0)]; -test_array [0] = 0 +#ifdef ENOLINK +yes +#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_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. */ +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + gl_cv_header_errno_h_ENOLINK=hidden +fi +rm -f conftest* + if test $gl_cv_header_errno_h_ENOLINK = hidden; then + if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " #define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include <stdio.h> #include <stdlib.h> +"; then + : +fi -int -main () -{ -static int test_array [1 - 2 * !((EMULTIHOP) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + fi + fi - 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } + case $gl_cv_header_errno_h_ENOLINK in + yes | no) + ENOLINK_HIDDEN=0; ENOLINK_VALUE= + ;; + *) + ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" + ;; + esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= -fi + 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 + if test -n "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +$as_echo_n "checking for EOVERFLOW value... " >&6; } +if test "${gl_cv_header_errno_h_EOVERFLOW+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> - -int -main () -{ -static int test_array [1 - 2 * !((EMULTIHOP) <= $ac_mid)]; -test_array [0] = 0 +#ifdef EOVERFLOW +yes +#endif - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + gl_cv_header_errno_h_EOVERFLOW=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` + gl_cv_header_errno_h_EOVERFLOW=no fi +rm -f conftest* -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) gl_cv_header_errno_h_EMULTIHOP=$ac_lo;; -'') ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $gl_cv_header_errno_h_EOVERFLOW = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + gl_cv_header_errno_h_EOVERFLOW=hidden +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then + if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include <errno.h> /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include <stdio.h> #include <stdlib.h> +"; then + : +fi -static long int longval () { return EMULTIHOP; } -static unsigned long int ulongval () { return EMULTIHOP; } -#include <stdio.h> -#include <stdlib.h> -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if ((EMULTIHOP) < 0) - { - long int i = longval (); - if (i != (EMULTIHOP)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (EMULTIHOP)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_header_errno_h_EMULTIHOP=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val fi fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 -$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } - case $gl_cv_header_errno_h_EMULTIHOP in +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } + case $gl_cv_header_errno_h_EOVERFLOW in yes | no) - EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= + EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= ;; *) - EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" + EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" ;; esac @@ -8534,1720 +7941,1072 @@ $as_echo "$gl_cv_header_errno_h_EMULTIHO fi - if test -n "$ERRNO_H"; then - { $as_echo "$as_me:$LINENO: checking for ENOLINK value" >&5 -$as_echo_n "checking for ENOLINK value... " >&6; } -if test "${gl_cv_header_errno_h_ENOLINK+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include <errno.h> -#ifdef ENOLINK -yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - gl_cv_header_errno_h_ENOLINK=yes +ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror_r" = x""yes; then + ac_have_decl=1 else - gl_cv_header_errno_h_ENOLINK=no + ac_have_decl=0 fi -rm -f conftest* - - if test $gl_cv_header_errno_h_ENOLINK = no; then - 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 <errno.h> -#ifdef ENOLINK -yes -#endif +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R $ac_have_decl _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - gl_cv_header_errno_h_ENOLINK=hidden -fi -rm -f conftest* - if test $gl_cv_header_errno_h_ENOLINK = hidden; then - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +for ac_func in strerror_r +do + ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" +if test "x$ac_cv_func_strerror_r" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_STRERROR_R 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> +fi +done -int -main () -{ -static int test_array [1 - 2 * !((ENOLINK) >= 0)]; -test_array [0] = 0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +$as_echo_n "checking whether strerror_r returns char *... " >&6; } +if test "${ac_cv_func_strerror_r_char_p+set}" = set; then + $as_echo_n "(cached) " >&6 +else - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> - +$ac_includes_default int main () { -static int test_array [1 - 2 * !((ENOLINK) <= $ac_mid)]; -test_array [0] = 0 + + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_func_strerror_r_char_p=yes fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done + 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 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> - +$ac_includes_default + extern char *strerror_r (); int main () { -static int test_array [1 - 2 * !((ENOLINK) < 0)]; -test_array [0] = 0 - +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + return ! isalpha (x); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_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. */ +if ac_fn_c_try_run "$LINENO"; then + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> + fi -int -main () -{ -static int test_array [1 - 2 * !((ENOLINK) >= $ac_mid)]; -test_array [0] = 0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h - 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 + + XGETTEXT_EXTRA_OPTIONS= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif - ac_lo= ac_hi= +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_c_inline=$ac_kw fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -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 <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> + test "$ac_cv_c_inline" != no && break +done -int -main () -{ -static int test_array [1 - 2 * !((ENOLINK) <= $ac_mid)]; -test_array [0] = 0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } - ; - return 0; -} +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 -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + ;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) gl_cv_header_errno_h_ENOLINK=$ac_lo;; -'') ;; -esac +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = x""yes; then + : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + +cat >>confdefs.h <<_ACEOF +#define mode_t int _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> +fi -static long int longval () { return ENOLINK; } -static unsigned long int ulongval () { return ENOLINK; } -#include <stdio.h> -#include <stdlib.h> -int -main () -{ - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if ((ENOLINK) < 0) - { - long int i = longval (); - if (i != (ENOLINK)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (ENOLINK)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; + ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "#include <signal.h> +" +if test "x$ac_cv_type_sig_atomic_t" = x""yes; then - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_SIG_ATOMIC_T 1 _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_header_errno_h_ENOLINK=`cat conftest.val` + + else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val - fi - fi +$as_echo "#define sig_atomic_t int" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_errno_h_ENOLINK" >&5 -$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } - case $gl_cv_header_errno_h_ENOLINK in - yes | no) - ENOLINK_HIDDEN=0; ENOLINK_VALUE= - ;; - *) - ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" - ;; - esac - fi + GNULIB_OPEN=0; + REPLACE_OPEN=0; - if test -n "$ERRNO_H"; then - { $as_echo "$as_me:$LINENO: checking for EOVERFLOW value" >&5 -$as_echo_n "checking for EOVERFLOW value... " >&6; } -if test "${gl_cv_header_errno_h_EOVERFLOW+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <errno.h> -#ifdef EOVERFLOW -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - gl_cv_header_errno_h_EOVERFLOW=yes -else - gl_cv_header_errno_h_EOVERFLOW=no -fi -rm -f conftest* + GNULIB_FPRINTF=0; + GNULIB_FPRINTF_POSIX=0; + GNULIB_PRINTF=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_VFPRINTF=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + GNULIB_DPRINTF=0; + GNULIB_VDPRINTF=0; + GNULIB_VASPRINTF=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; + GNULIB_FOPEN=0; + GNULIB_FREOPEN=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FFLUSH=0; + GNULIB_FCLOSE=0; + GNULIB_FPUTC=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_FPUTS=0; + GNULIB_PUTS=0; + GNULIB_FWRITE=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + GNULIB_PERROR=0; + GNULIB_STDIO_H_SIGPIPE=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_FPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_PRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_SNPRINTF=0; + HAVE_DECL_SNPRINTF=1; + REPLACE_VSNPRINTF=0; + HAVE_DECL_VSNPRINTF=1; + REPLACE_SPRINTF=0; + REPLACE_VSPRINTF=0; + HAVE_DPRINTF=1; + REPLACE_DPRINTF=0; + HAVE_VDPRINTF=1; + REPLACE_VDPRINTF=0; + HAVE_VASPRINTF=1; + REPLACE_VASPRINTF=0; + HAVE_DECL_OBSTACK_PRINTF=1; + REPLACE_OBSTACK_PRINTF=0; + REPLACE_FOPEN=0; + REPLACE_FREOPEN=0; + HAVE_FSEEKO=1; + REPLACE_FSEEKO=0; + REPLACE_FSEEK=0; + HAVE_FTELLO=1; + REPLACE_FTELLO=0; + REPLACE_FTELL=0; + REPLACE_FFLUSH=0; + REPLACE_FCLOSE=0; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + REPLACE_GETLINE=0; + REPLACE_PERROR=0; - if test $gl_cv_header_errno_h_EOVERFLOW = no; then - 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 <errno.h> -#ifdef EOVERFLOW -yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - gl_cv_header_errno_h_EOVERFLOW=hidden -fi -rm -f conftest* - if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then - if 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 <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) >= 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_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 <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) < 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + GNULIB_CEILF=0; + GNULIB_CEILL=0; + GNULIB_FLOORF=0; + GNULIB_FLOORL=0; + GNULIB_FREXP=0; + GNULIB_FREXPL=0; + GNULIB_ISFINITE=0; + GNULIB_ISINF=0; + GNULIB_ISNAN=0; + GNULIB_ISNANF=0; + GNULIB_ISNAND=0; + GNULIB_ISNANL=0; + GNULIB_LDEXPL=0; + GNULIB_MATHL=0; + GNULIB_ROUND=0; + GNULIB_ROUNDF=0; + GNULIB_ROUNDL=0; + GNULIB_SIGNBIT=0; + GNULIB_TRUNC=0; + GNULIB_TRUNCF=0; + GNULIB_TRUNCL=0; + HAVE_ISNANF=1; + HAVE_ISNAND=1; + HAVE_ISNANL=1; + HAVE_DECL_ACOSL=1; + HAVE_DECL_ASINL=1; + HAVE_DECL_ATANL=1; + HAVE_DECL_COSL=1; + HAVE_DECL_EXPL=1; + HAVE_DECL_FREXPL=1; + HAVE_DECL_LDEXPL=1; + HAVE_DECL_LOGL=1; + HAVE_DECL_SINL=1; + HAVE_DECL_SQRTL=1; + HAVE_DECL_TANL=1; + HAVE_DECL_TRUNC=1; + HAVE_DECL_TRUNCF=1; + REPLACE_CEILF=0; + REPLACE_CEILL=0; + REPLACE_FLOORF=0; + REPLACE_FLOORL=0; + REPLACE_FREXP=0; + REPLACE_FREXPL=0; + REPLACE_HUGE_VAL=0; + REPLACE_ISFINITE=0; + REPLACE_ISINF=0; + REPLACE_ISNAN=0; + REPLACE_LDEXPL=0; + REPLACE_NAN=0; + REPLACE_ROUND=0; + REPLACE_ROUNDF=0; + REPLACE_ROUNDL=0; + REPLACE_SIGNBIT=0; + REPLACE_SIGNBIT_USING_GCC=0; + REPLACE_TRUNCL=0; -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdin defaults to large file offsets" >&5 +$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; } +if test "${gl_cv_var_stdin_large_offset+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> int main () { -static int test_array [1 - 2 * !((EOVERFLOW) >= $ac_mid)]; -test_array [0] = 0 - +#if defined __SL64 && defined __SCLE /* cygwin */ + /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making + fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and + it is easier to do a version check than building a runtime test. */ +# include <cygwin/version.h> +# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) + choke me +# endif +#endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break +if ac_fn_c_try_link "$LINENO"; then + gl_cv_var_stdin_large_offset=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + gl_cv_var_stdin_large_offset=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var_stdin_large_offset" >&5 +$as_echo "$gl_cv_var_stdin_large_offset" >&6; } + + + + + if test -z "$GETOPT_H"; then + for ac_header in getopt.h +do + ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_GETOPT_H 1 +_ACEOF -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + GETOPT_H=getopt.h +fi + +done + + fi + + if test -z "$GETOPT_H"; then + for ac_func in getopt_long_only +do + ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" +if test "x$ac_cv_func_getopt_long_only" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_GETOPT_LONG_ONLY 1 +_ACEOF - ac_lo= ac_hi= +else + GETOPT_H=getopt.h fi +done -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + + if test -z "$GETOPT_H"; then + ac_fn_c_check_decl "$LINENO" "optreset" "ac_cv_have_decl_optreset" "#include <getopt.h> +" +if test "x$ac_cv_have_decl_optreset" = x""yes; then + GETOPT_H=getopt.h 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. */ + fi -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> + if test -z "$GETOPT_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 +$as_echo_n "checking for working GNU getopt function... " >&6; } +if test "${gl_cv_func_gnu_getopt+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + ac_fn_c_check_decl "$LINENO" "getopt_clip" "ac_cv_have_decl_getopt_clip" "#include <getopt.h> +" +if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then + gl_cv_func_gnu_getopt=no +else + gl_cv_func_gnu_getopt=yes +fi +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <getopt.h> int main () { -static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; -test_array [0] = 0 + + char *myargv[3]; + myargv[0] = "conftest"; + myargv[1] = "-+"; + myargv[2] = 0; + return getopt (2, myargv, "+a") != '?'; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_gnu_getopt=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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_exeext conftest.$ac_ext +fi - ac_lo=`expr '(' $ac_mid ')' + 1` fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gnu_getopt" >&5 +$as_echo "$gl_cv_func_gnu_getopt" >&6; } + if test "$gl_cv_func_gnu_getopt" = "no"; then + GETOPT_H=getopt.h + fi + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) gl_cv_header_errno_h_EOVERFLOW=$ac_lo;; -'') ;; -esac +ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default" +if test "x$ac_cv_have_decl_getenv" = x""yes; then + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + ac_have_decl=0 +fi -#define _XOPEN_SOURCE_EXTENDED 1 -#include <errno.h> -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include <stdio.h> -#include <stdlib.h> +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV $ac_have_decl +_ACEOF -static long int longval () { return EOVERFLOW; } -static unsigned long int ulongval () { return EOVERFLOW; } -#include <stdio.h> -#include <stdlib.h> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if test "${ac_cv_c_restrict+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + } int main () { - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if ((EOVERFLOW) < 0) - { - long int i = longval (); - if (i != (EOVERFLOW)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (EOVERFLOW)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - +int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t) ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_header_errno_h_EOVERFLOW=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_c_restrict=$ac_kw fi -rm -f conftest.val - fi - fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 -$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } - case $gl_cv_header_errno_h_EOVERFLOW in - yes | no) - EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= - ;; - *) - EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" - ;; - esac - - - fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } -{ $as_echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 -$as_echo_n "checking whether strerror_r is declared... " >&6; } -if test "${ac_cv_have_decl_strerror_r+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strerror_r - (void) strerror_r; -#endif + ;; + esac - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strerror_r=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 -$as_echo "$ac_cv_have_decl_strerror_r" >&6; } -if test "x$ac_cv_have_decl_strerror_r" = x""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=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5 +$as_echo_n "checking absolute name of <sys/time.h>... " >&6; } +if test "${gl_cv_next_sys_time_h+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + if test $ac_cv_header_sys_time_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $ac_func innocuous_$ac_func +#include <sys/time.h> -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/time.h#{ + s#.*"\(.*/sys/time.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 +$as_echo "$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h -#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 + + + if test $ac_cv_header_sys_time_h = yes; then + HAVE_SYS_TIME_H=1 + else + HAVE_SYS_TIME_H=0 + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 +$as_echo_n "checking for struct timeval... " >&6; } +if test "${gl_cv_sys_struct_timeval+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #include <time.h> int main () { -return $ac_func (); +static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_sys_struct_timeval=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + gl_cv_sys_struct_timeval=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 +$as_echo "$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval = yes; then + HAVE_STRUCT_TIMEVAL=1 + else + HAVE_STRUCT_TIMEVAL=0 + fi -fi -done -{ $as_echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 -$as_echo_n "checking whether strerror_r returns char *... " >&6; } -if test "${ac_cv_func_strerror_r_char_p+set}" = set; then - $as_echo_n "(cached) " >&6 -else + REPLACE_GETTIMEOFDAY=0 - 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 () -{ + if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then + SYS_TIME_H=sys/time.h + else + SYS_TIME_H= + fi - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_func_strerror_r_char_p=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - else - # strerror_r is not declared. Choose between - # 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. + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if test "${gl_cv_cc_float_expbit0+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then - : + gl_cv_cc_float_expbit0="word 0 bit 23" else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default - extern char *strerror_r (); -int -main () -{ -char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - return ! isalpha (x); - ; - return 0; + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (float x) +{ + memory_float m; + size_t i; + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); } + _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_strerror_r_char_p=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_float_expbit0=`cat conftest.out` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + gl_cv_cc_float_expbit0="unknown" fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - - fi + rm -f conftest.out fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 -$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } -if test $ac_cv_func_strerror_r_char_p = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` -cat >>confdefs.h <<\_ACEOF -#define STRERROR_R_CHAR_P 1 +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_WORD $word _ACEOF -fi + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac - { $as_echo "$as_me:$LINENO: checking for sig_atomic_t" >&5 -$as_echo_n "checking for sig_atomic_t... " >&6; } -if test "${ac_cv_type_sig_atomic_t+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_sig_atomic_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <signal.h> +#include <sys/types.h> + #include <sys/param.h> int main () { -if (sizeof (sig_atomic_t)) - return 0; +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <signal.h> +#include <sys/types.h> + #include <sys/param.h> int main () { -if (sizeof ((sig_atomic_t))) - return 0; +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_sig_atomic_t=yes + ac_cv_c_bigendian=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_sig_atomic_t" >&5 -$as_echo "$ac_cv_type_sig_atomic_t" >&6; } -if test "x$ac_cv_type_sig_atomic_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_SIG_ATOMIC_T 1 -_ACEOF - - -else - -cat >>confdefs.h <<\_ACEOF -#define sig_atomic_t int -_ACEOF - -fi + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif -{ $as_echo "$as_me:$LINENO: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif +#include <limits.h> + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_inline=$ac_kw +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + ac_cv_c_bigendian=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - - - GNULIB_OPEN=0; - REPLACE_OPEN=0; - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; - GNULIB_FPRINTF=0; - GNULIB_FPRINTF_POSIX=0; - GNULIB_PRINTF=0; - GNULIB_PRINTF_POSIX=0; - GNULIB_SNPRINTF=0; - GNULIB_SPRINTF_POSIX=0; - GNULIB_VFPRINTF=0; - GNULIB_VFPRINTF_POSIX=0; - GNULIB_VPRINTF=0; - GNULIB_VPRINTF_POSIX=0; - GNULIB_VSNPRINTF=0; - GNULIB_VSPRINTF_POSIX=0; - GNULIB_VASPRINTF=0; - GNULIB_OBSTACK_PRINTF=0; - GNULIB_OBSTACK_PRINTF_POSIX=0; - GNULIB_FOPEN=0; - GNULIB_FREOPEN=0; - GNULIB_FSEEK=0; - GNULIB_FSEEKO=0; - GNULIB_FTELL=0; - GNULIB_FTELLO=0; - GNULIB_FFLUSH=0; - GNULIB_FPUTC=0; - GNULIB_PUTC=0; - GNULIB_PUTCHAR=0; - GNULIB_FPUTS=0; - GNULIB_PUTS=0; - GNULIB_FWRITE=0; - GNULIB_GETDELIM=0; - GNULIB_GETLINE=0; - GNULIB_PERROR=0; - GNULIB_STDIO_H_SIGPIPE=0; - REPLACE_STDIO_WRITE_FUNCS=0; - REPLACE_FPRINTF=0; - REPLACE_VFPRINTF=0; - REPLACE_PRINTF=0; - REPLACE_VPRINTF=0; - REPLACE_SNPRINTF=0; - HAVE_DECL_SNPRINTF=1; - REPLACE_VSNPRINTF=0; - HAVE_DECL_VSNPRINTF=1; - REPLACE_SPRINTF=0; - REPLACE_VSPRINTF=0; - HAVE_VASPRINTF=1; - REPLACE_VASPRINTF=0; - HAVE_DECL_OBSTACK_PRINTF=1; - REPLACE_OBSTACK_PRINTF=0; - REPLACE_FOPEN=0; - REPLACE_FREOPEN=0; - HAVE_FSEEKO=1; - REPLACE_FSEEKO=0; - REPLACE_FSEEK=0; - HAVE_FTELLO=1; - REPLACE_FTELLO=0; - REPLACE_FTELL=0; - REPLACE_FFLUSH=0; - HAVE_DECL_GETDELIM=1; - HAVE_DECL_GETLINE=1; - REPLACE_GETLINE=0; - REPLACE_PERROR=0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + ;; #( + *) + as_fn_error "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac +ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5 +$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } +if test "${ac_cv_gnu_library_2_1+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky GNU user" >/dev/null 2>&1; then + ac_cv_gnu_library_2_1=yes +else + ac_cv_gnu_library_2_1=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +$as_echo "$ac_cv_gnu_library_2_1" >&6; } + GLIBC21="$ac_cv_gnu_library_2_1" - GNULIB_CEILF=0; - GNULIB_CEILL=0; - GNULIB_FLOORF=0; - GNULIB_FLOORL=0; - GNULIB_FREXP=0; - GNULIB_FREXPL=0; - GNULIB_ISFINITE=0; - GNULIB_ISINF=0; - GNULIB_ISNAN=0; - GNULIB_LDEXPL=0; - GNULIB_MATHL=0; - GNULIB_ROUND=0; - GNULIB_ROUNDF=0; - GNULIB_ROUNDL=0; - GNULIB_SIGNBIT=0; - GNULIB_TRUNC=0; - GNULIB_TRUNCF=0; - GNULIB_TRUNCL=0; - HAVE_DECL_ACOSL=1; - HAVE_DECL_ASINL=1; - HAVE_DECL_ATANL=1; - HAVE_DECL_COSL=1; - HAVE_DECL_EXPL=1; - HAVE_DECL_FREXPL=1; - HAVE_DECL_LDEXPL=1; - HAVE_DECL_LOGL=1; - HAVE_DECL_SINL=1; - HAVE_DECL_SQRTL=1; - HAVE_DECL_TANL=1; - HAVE_DECL_TRUNC=1; - HAVE_DECL_TRUNCF=1; - REPLACE_CEILF=0; - REPLACE_CEILL=0; - REPLACE_FLOORF=0; - REPLACE_FLOORL=0; - REPLACE_FREXP=0; - REPLACE_FREXPL=0; - REPLACE_HUGE_VAL=0; - REPLACE_ISFINITE=0; - REPLACE_ISINF=0; - REPLACE_ISNAN=0; - REPLACE_LDEXPL=0; - REPLACE_NAN=0; - REPLACE_ROUND=0; - REPLACE_ROUNDF=0; - REPLACE_ROUNDL=0; - REPLACE_SIGNBIT=0; - REPLACE_SIGNBIT_USING_GCC=0; - REPLACE_TRUNCL=0; - { $as_echo "$as_me:$LINENO: checking whether stdin defaults to large file offsets" >&5 -$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; } -if test "${gl_cv_var_stdin_large_offset+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + gl_threads_api=none + LIBTHREAD= + LTLIBTHREAD= + LIBMULTITHREAD= + LTLIBMULTITHREAD= + if test "$gl_use_threads" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 +$as_echo_n "checking whether imported symbols can be declared weak... " >&6; } + gl_have_weak=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> +extern void xyzzy (); +#pragma weak xyzzy int main () { -#if defined __SL64 && defined __SCLE /* cygwin */ - /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making - fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and - it is easier to do a version check than building a runtime test. */ -# include <cygwin/version.h> -# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) - choke me -# endif -#endif +xyzzy(); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_var_stdin_large_offset=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_var_stdin_large_offset=no +if ac_fn_c_try_link "$LINENO"; then + gl_have_weak=yes fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_var_stdin_large_offset" >&5 -$as_echo "$gl_cv_var_stdin_large_offset" >&6; } - - - if test -z "$GETOPT_H"; then - -for ac_header in getopt.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_weak" >&5 +$as_echo "$gl_have_weak" >&6; } + if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then + # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that + # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY. + ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = x""yes; then + gl_have_pthread_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no + gl_have_pthread_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$gl_have_pthread_h" = yes; then + # Other possible tests: + # -lpthreads (FSU threads, PCthreads) + # -lgthreads + gl_have_pthread= + # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist + # in libc. IRIX 6.5 has the first one in both libc and libpthread, but + # the second one only in libpthread, and lock.c needs it. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#include <pthread.h> +int +main () +{ +pthread_mutex_lock((pthread_mutex_t*)0); + pthread_mutexattr_init((pthread_mutexattr_t*)0); + ; + return 0; +} _ACEOF - -else - GETOPT_H=getopt.h +if ac_fn_c_try_link "$LINENO"; then + gl_have_pthread=yes fi - -done - - fi - - if test -z "$GETOPT_H"; then - -for ac_func in getopt_long_only -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + # Test for libpthread by looking for pthread_kill. (Not pthread_self, + # since it is defined as a macro on OSF/1.) + if test -n "$gl_have_pthread"; then + # The program links fine without libpthread. But it may actually + # need to link with libpthread in order to create multiple threads. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } +if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#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 @@ -10255,411 +9014,202 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +char pthread_kill (); int main () { -return $ac_func (); +return pthread_kill (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then + ac_cv_lib_pthread_pthread_kill=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + ac_cv_lib_pthread_pthread_kill=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then + LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread + # On Solaris and HP-UX, most pthread functions exist also in libc. + # Therefore pthread_in_use() needs to actually try to create a + # thread: pthread_create from libc will fail, whereas + # pthread_create will actually create a thread. + case "$host_os" in + solaris* | hpux*) -else - GETOPT_H=getopt.h -fi -done +$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h - fi + esac - if test -z "$GETOPT_H"; then - { $as_echo "$as_me:$LINENO: checking whether optreset is declared" >&5 -$as_echo_n "checking whether optreset is declared... " >&6; } -if test "${ac_cv_have_decl_optreset+set}" = set; then +fi + + else + # Some library is needed. Try libpthread and libc_r. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } +if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <getopt.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 pthread_kill (); int main () { -#ifndef optreset - (void) optreset; -#endif - +return pthread_kill (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_optreset=yes +if ac_fn_c_try_link "$LINENO"; then + ac_cv_lib_pthread_pthread_kill=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_optreset=no + ac_cv_lib_pthread_pthread_kill=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5 -$as_echo "$ac_cv_have_decl_optreset" >&6; } -if test "x$ac_cv_have_decl_optreset" = x""yes; then - GETOPT_H=getopt.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then + gl_have_pthread=yes + LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread + LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread fi - fi - - if test -z "$GETOPT_H"; then - { $as_echo "$as_me:$LINENO: checking for working GNU getopt function" >&5 -$as_echo_n "checking for working GNU getopt function... " >&6; } -if test "${gl_cv_func_gnu_getopt+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - { $as_echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5 -$as_echo_n "checking whether getopt_clip is declared... " >&6; } -if test "${ac_cv_have_decl_getopt_clip+set}" = set; then + if test -z "$gl_have_pthread"; then + # For FreeBSD 4. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 +$as_echo_n "checking for pthread_kill in -lc_r... " >&6; } +if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <getopt.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 pthread_kill (); int main () { -#ifndef getopt_clip - (void) getopt_clip; -#endif - +return pthread_kill (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getopt_clip=yes +if ac_fn_c_try_link "$LINENO"; then + ac_cv_lib_c_r_pthread_kill=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getopt_clip=no + ac_cv_lib_c_r_pthread_kill=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5 -$as_echo "$ac_cv_have_decl_getopt_clip" >&6; } -if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then - gl_cv_func_gnu_getopt=no -else - gl_cv_func_gnu_getopt=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } +if test "x$ac_cv_lib_c_r_pthread_kill" = x""yes; then + gl_have_pthread=yes + LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r + LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r 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 <getopt.h> -int -main () -{ - - char *myargv[3]; - myargv[0] = "conftest"; - myargv[1] = "-+"; - myargv[2] = 0; - return getopt (2, myargv, "+a") != '?'; + fi + fi + if test -n "$gl_have_pthread"; then + gl_threads_api=posix - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_gnu_getopt=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h -( exit $ac_status ) -gl_cv_func_gnu_getopt=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then + if test $gl_have_weak = yes; then +$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5 -$as_echo "$gl_cv_func_gnu_getopt" >&6; } - if test "$gl_cv_func_gnu_getopt" = "no"; then - GETOPT_H=getopt.h + LIBTHREAD= + LTLIBTHREAD= + fi + fi + fi + fi fi - fi - -{ $as_echo "$as_me:$LINENO: checking whether getenv is declared" >&5 -$as_echo_n "checking whether getenv is declared... " >&6; } -if test "${ac_cv_have_decl_getenv+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test -z "$gl_have_pthread"; then + if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then + gl_have_solaristhread= + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include <thread.h> +#include <synch.h> int main () { -#ifndef getenv - (void) getenv; -#endif - +thr_self(); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getenv=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getenv=no +if ac_fn_c_try_link "$LINENO"; then + gl_have_solaristhread=yes fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + if test -n "$gl_have_solaristhread"; then + gl_threads_api=solaris + LIBTHREAD=-lthread + LTLIBTHREAD=-lthread + LIBMULTITHREAD="$LIBTHREAD" + LTLIBMULTITHREAD="$LTLIBTHREAD" -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 -$as_echo "$ac_cv_have_decl_getenv" >&6; } -if test "x$ac_cv_have_decl_getenv" = x""yes; then +$as_echo "#define USE_SOLARIS_THREADS 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 1 -_ACEOF + if test $gl_have_weak = yes; then +$as_echo "#define USE_SOLARIS_THREADS_WEAK 1" >>confdefs.h -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 0 -_ACEOF + LIBTHREAD= + LTLIBTHREAD= + fi + fi + fi + fi + if test "$gl_use_threads" = pth; then + gl_save_CPPFLAGS="$CPPFLAGS" -fi -{ $as_echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 -$as_echo_n "checking for C/C++ restrict keyword... " >&6; } -if test "${ac_cv_c_restrict+set}" = set; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libpth" >&5 +$as_echo_n "checking how to link with libpth... " >&6; } +if test "${ac_cv_libpth_libs+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_c_restrict=no - # The order here caters to the fact that C++ does not require restrict. - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_restrict=$ac_kw -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_restrict" != no && break - done - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5 -$as_echo "$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 @@ -10668,6877 +9218,1742 @@ _ACEOF + 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-libpth-prefix was given. +if test "${with_libpth_prefix+set}" = set; then + withval=$with_libpth_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" - if test $gl_cv_have_include_next = yes; then - gl_cv_next_sys_time_h='<'sys/time.h'>' - else - { $as_echo "$as_me:$LINENO: checking absolute name of <sys/time.h>" >&5 -$as_echo_n "checking absolute name of <sys/time.h>... " >&6; } -if test "${gl_cv_next_sys_time_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" - 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 <sys/time.h> + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -_ACEOF - gl_cv_next_sys_time_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/sys/time.h#{ - s#.*"\(.*/sys/time.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_sys_time_h='<'sys/time.h'>' - fi + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_time_h" >&5 -$as_echo "$gl_cv_next_sys_time_h" >&6; } - fi - NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h - - - - - if test $ac_cv_header_sys_time_h = yes; then - HAVE_SYS_TIME_H=1 - else - HAVE_SYS_TIME_H=0 - fi + LIBPTH= + LTLIBPTH= + INCPTH= + LIBPTH_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='pth ' + 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" || LIBPTH="${LIBPTH}${LIBPTH:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$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 $LTLIBPTH; do - { $as_echo "$as_me:$LINENO: checking for struct timeval" >&5 -$as_echo_n "checking for struct timeval... " >&6; } -if test "${gl_cv_sys_struct_timeval+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if HAVE_SYS_TIME_H - #include <sys/time.h> - #endif - #include <time.h> - -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_sys_struct_timeval=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5 -$as_echo "$gl_cv_sys_struct_timeval" >&6; } - if test $gl_cv_sys_struct_timeval = yes; then - HAVE_STRUCT_TIMEVAL=1 - 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 - - - - - - - - - { $as_echo "$as_me:$LINENO: checking where to find the exponent in a 'float'" >&5 -$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } -if test "${gl_cv_cc_float_expbit0+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then - gl_cv_cc_float_expbit0="word 0 bit 23" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include <float.h> -#include <stddef.h> -#include <stdio.h> -#include <string.h> -#define NWORDS \ - ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { float value; unsigned int word[NWORDS]; } memory_float; -static unsigned int ored_words[NWORDS]; -static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (float x) -{ - memory_float m; - size_t i; - /* Clear it first, in case - sizeof (float) < sizeof (memory_float). */ - memset (&m, 0, sizeof (memory_float)); - m.value = x; - for (i = 0; i < NWORDS; i++) - { - ored_words[i] |= m.word[i]; - anded_words[i] &= m.word[i]; - } -} -int main () -{ - size_t j; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - for (j = 0; j < NWORDS; j++) - anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25f); - add_to_ored_words (0.5f); - add_to_ored_words (1.0f); - add_to_ored_words (2.0f); - add_to_ored_words (4.0f); - /* Remove bits that are common (e.g. if representation of the first mantissa - bit is explicit). */ - for (j = 0; j < NWORDS; j++) - ored_words[j] &= ~anded_words[j]; - /* Now find the nonzero word. */ - for (j = 0; j < NWORDS; j++) - if (ored_words[j] != 0) - break; - if (j < NWORDS) - { - size_t i; - for (i = j + 1; i < NWORDS; i++) - if (ored_words[i] != 0) - { - fprintf (fp, "unknown"); - return (fclose (fp) != 0); - } - for (i = 0; ; i++) - if ((ored_words[j] >> i) & 1) - { - fprintf (fp, "word %d bit %d", (int) j, (int) i); - return (fclose (fp) != 0); - } - } - fprintf (fp, "unknown"); - return (fclose (fp) != 0); -} - -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_float_expbit0=`cat conftest.out` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_cc_float_expbit0="unknown" -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - rm -f conftest.out - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_float_expbit0" >&5 -$as_echo "$gl_cv_cc_float_expbit0" >&6; } - case "$gl_cv_cc_float_expbit0" in - word*bit*) - word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` - -cat >>confdefs.h <<_ACEOF -#define FLT_EXPBIT0_WORD $word -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define FLT_EXPBIT0_BIT $bit -_ACEOF - - ;; - esac - + 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" - { $as_echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 -$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } -if test "${am_cv_langinfo_codeset+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <langinfo.h> -int -main () -{ -char* cs = nl_langinfo(CODESET); return !cs; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - am_cv_langinfo_codeset=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - am_cv_langinfo_codeset=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -$as_echo "$am_cv_langinfo_codeset" >&6; } - if test $am_cv_langinfo_codeset = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LANGINFO_CODESET 1 -_ACEOF - - fi - -{ $as_echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 -$as_echo_n "checking whether getc_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getc_unlocked - (void) getc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getc_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getc_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 -$as_echo "$ac_cv_have_decl_getc_unlocked" >&6; } -if test "x$ac_cv_have_decl_getc_unlocked" = x""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 - - - - { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 -$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } -if test "${ac_cv_gnu_library_2_1+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include <features.h> -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) - Lucky GNU user - #endif -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Lucky GNU user" >/dev/null 2>&1; then - ac_cv_gnu_library_2_1=yes -else - ac_cv_gnu_library_2_1=no -fi -rm -f conftest* - - - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 -$as_echo "$ac_cv_gnu_library_2_1" >&6; } - - GLIBC21="$ac_cv_gnu_library_2_1" - - - - - gl_threads_api=none - LIBTHREAD= - LTLIBTHREAD= - LIBMULTITHREAD= - LTLIBMULTITHREAD= - if test "$gl_use_threads" != no; then - { $as_echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5 -$as_echo_n "checking whether imported symbols can be declared weak... " >&6; } - gl_have_weak=no - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -extern void xyzzy (); -#pragma weak xyzzy -int -main () -{ -xyzzy(); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_have_weak=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $gl_have_weak" >&5 -$as_echo "$gl_have_weak" >&6; } - if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then - # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that - # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY. - if test "${ac_cv_header_pthread_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 -$as_echo_n "checking for pthread.h... " >&6; } -if test "${ac_cv_header_pthread_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -$as_echo "$ac_cv_header_pthread_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking pthread.h usability" >&5 -$as_echo_n "checking pthread.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <pthread.h> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking pthread.h presence" >&5 -$as_echo_n "checking pthread.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <pthread.h> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 -$as_echo_n "checking for pthread.h... " >&6; } -if test "${ac_cv_header_pthread_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_pthread_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -$as_echo "$ac_cv_header_pthread_h" >&6; } - -fi -if test "x$ac_cv_header_pthread_h" = x""yes; then - gl_have_pthread_h=yes -else - gl_have_pthread_h=no -fi - - - if test "$gl_have_pthread_h" = yes; then - # Other possible tests: - # -lpthreads (FSU threads, PCthreads) - # -lgthreads - gl_have_pthread= - # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist - # in libc. IRIX 6.5 has the first one in both libc and libpthread, but - # the second one only in libpthread, and lock.c needs it. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <pthread.h> -int -main () -{ -pthread_mutex_lock((pthread_mutex_t*)0); - pthread_mutexattr_init((pthread_mutexattr_t*)0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_have_pthread=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - # Test for libpthread by looking for pthread_kill. (Not pthread_self, - # since it is defined as a macro on OSF/1.) - if test -n "$gl_have_pthread"; then - # The program links fine without libpthread. But it may actually - # need to link with libpthread in order to create multiple threads. - { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 -$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $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 pthread_kill (); -int -main () -{ -return pthread_kill (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_pthread_pthread_kill=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_pthread_pthread_kill=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } -if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then - LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread - # On Solaris and HP-UX, most pthread functions exist also in libc. - # Therefore pthread_in_use() needs to actually try to create a - # thread: pthread_create from libc will fail, whereas - # pthread_create will actually create a thread. - case "$host_os" in - solaris* | hpux*) - -cat >>confdefs.h <<\_ACEOF -#define PTHREAD_IN_USE_DETECTION_HARD 1 -_ACEOF - - esac - -fi - - else - # Some library is needed. Try libpthread and libc_r. - { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 -$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $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 pthread_kill (); -int -main () -{ -return pthread_kill (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_pthread_pthread_kill=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_pthread_pthread_kill=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } -if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then - gl_have_pthread=yes - LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread - LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread -fi - - if test -z "$gl_have_pthread"; then - # For FreeBSD 4. - { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5 -$as_echo_n "checking for pthread_kill in -lc_r... " >&6; } -if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc_r $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 pthread_kill (); -int -main () -{ -return pthread_kill (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_c_r_pthread_kill=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_c_r_pthread_kill=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5 -$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } -if test "x$ac_cv_lib_c_r_pthread_kill" = x""yes; then - gl_have_pthread=yes - LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r - LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r -fi - - fi - fi - if test -n "$gl_have_pthread"; then - gl_threads_api=posix - -cat >>confdefs.h <<\_ACEOF -#define USE_POSIX_THREADS 1 -_ACEOF - - if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then - if test $gl_have_weak = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_POSIX_THREADS_WEAK 1 -_ACEOF - - LIBTHREAD= - LTLIBTHREAD= - fi - fi - fi - fi - fi - if test -z "$gl_have_pthread"; then - if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then - gl_have_solaristhread= - gl_save_LIBS="$LIBS" - LIBS="$LIBS -lthread" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <thread.h> -#include <synch.h> -int -main () -{ -thr_self(); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_have_solaristhread=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$gl_save_LIBS" - if test -n "$gl_have_solaristhread"; then - gl_threads_api=solaris - LIBTHREAD=-lthread - LTLIBTHREAD=-lthread - LIBMULTITHREAD="$LIBTHREAD" - LTLIBMULTITHREAD="$LTLIBTHREAD" - -cat >>confdefs.h <<\_ACEOF -#define USE_SOLARIS_THREADS 1 -_ACEOF - - if test $gl_have_weak = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_SOLARIS_THREADS_WEAK 1 -_ACEOF - - LIBTHREAD= - LTLIBTHREAD= - fi - fi - fi - fi - if test "$gl_use_threads" = pth; then - gl_save_CPPFLAGS="$CPPFLAGS" - - - - - - { $as_echo "$as_me:$LINENO: checking how to link with libpth" >&5 -$as_echo_n "checking how to link with libpth... " >&6; } -if test "${ac_cv_libpth_libs+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - - - - - - - - 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-libpth-prefix was given. -if test "${with_libpth_prefix+set}" = set; then - withval=$with_libpth_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" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi - -fi - - LIBPTH= - LTLIBPTH= - INCPTH= - LIBPTH_PREFIX= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='pth ' - 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" || LIBPTH="${LIBPTH}${LIBPTH:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$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 $LTLIBPTH; 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 - LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-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" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - LIBPTH="${LIBPTH}${LIBPTH:+ }$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 - LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBPTH="${LIBPTH}${LIBPTH:+ }$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 $LIBPTH; 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 - LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" - else - LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBPTH="${LIBPTH}${LIBPTH:+ }$found_a" - else - LIBPTH="${LIBPTH}${LIBPTH:+ }-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/"'*$,,'` - LIBPTH_PREFIX="$basedir" - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - LIBPTH_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 $INCPTH; 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 - INCPTH="${INCPTH}${INCPTH:+ }-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" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBPTH; 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 - LIBPTH="${LIBPTH}${LIBPTH:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBPTH; 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 - LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-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$,,'` - ;; - *) - LIBPTH="${LIBPTH}${LIBPTH:+ }$dep" - LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$dep" - ;; - esac - done - fi - else - LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" - LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-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" - LIBPTH="${LIBPTH}${LIBPTH:+ }$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" - LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-R$found_dir" - done - fi - - - - - - - ac_cv_libpth_libs="$LIBPTH" - ac_cv_libpth_ltlibs="$LTLIBPTH" - ac_cv_libpth_cppflags="$INCPTH" - ac_cv_libpth_prefix="$LIBPTH_PREFIX" - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5 -$as_echo "$ac_cv_libpth_libs" >&6; } - LIBPTH="$ac_cv_libpth_libs" - LTLIBPTH="$ac_cv_libpth_ltlibs" - INCPTH="$ac_cv_libpth_cppflags" - LIBPTH_PREFIX="$ac_cv_libpth_prefix" - - for element in $INCPTH; 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 - - - - - HAVE_LIBPTH=yes - - - - gl_have_pth= - gl_save_LIBS="$LIBS" - LIBS="$LIBS -lpth" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <pth.h> -int -main () -{ -pth_self(); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_have_pth=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$gl_save_LIBS" - if test -n "$gl_have_pth"; then - gl_threads_api=pth - LIBTHREAD="$LIBPTH" - LTLIBTHREAD="$LTLIBPTH" - LIBMULTITHREAD="$LIBTHREAD" - LTLIBMULTITHREAD="$LTLIBTHREAD" - -cat >>confdefs.h <<\_ACEOF -#define USE_PTH_THREADS 1 -_ACEOF - - if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then - if test $gl_have_weak = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_PTH_THREADS_WEAK 1 -_ACEOF - - LIBTHREAD= - LTLIBTHREAD= - fi - fi - else - CPPFLAGS="$gl_save_CPPFLAGS" - fi - fi - if test -z "$gl_have_pthread"; then - if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then - if { case "$host_os" in - mingw*) true;; - *) false;; - esac - }; then - gl_threads_api=win32 - -cat >>confdefs.h <<\_ACEOF -#define USE_WIN32_THREADS 1 -_ACEOF - - fi - fi - fi - fi - { $as_echo "$as_me:$LINENO: checking for multithread API to use" >&5 -$as_echo_n "checking for multithread API to use... " >&6; } - { $as_echo "$as_me:$LINENO: result: $gl_threads_api" >&5 -$as_echo "$gl_threads_api" >&6; } - - - - - - - - - - - GNULIB_CHOWN=0; - GNULIB_CLOSE=0; - GNULIB_DUP2=0; - GNULIB_ENVIRON=0; - GNULIB_FCHDIR=0; - GNULIB_FSYNC=0; - GNULIB_FTRUNCATE=0; - GNULIB_GETCWD=0; - GNULIB_GETDTABLESIZE=0; - GNULIB_GETLOGIN_R=0; - GNULIB_GETPAGESIZE=0; - GNULIB_LCHOWN=0; - GNULIB_LSEEK=0; - GNULIB_READLINK=0; - GNULIB_SLEEP=0; - GNULIB_UNISTD_H_SIGPIPE=0; - GNULIB_WRITE=0; - HAVE_DUP2=1; - HAVE_FSYNC=1; - HAVE_FTRUNCATE=1; - HAVE_GETDTABLESIZE=1; - HAVE_GETPAGESIZE=1; - HAVE_READLINK=1; - HAVE_SLEEP=1; - HAVE_DECL_ENVIRON=1; - HAVE_DECL_GETLOGIN_R=1; - HAVE_OS_H=0; - HAVE_SYS_PARAM_H=0; - REPLACE_CHOWN=0; - REPLACE_CLOSE=0; - REPLACE_FCHDIR=0; - REPLACE_GETCWD=0; - REPLACE_GETPAGESIZE=0; - REPLACE_LCHOWN=0; - REPLACE_LSEEK=0; - REPLACE_WRITE=0; - UNISTD_H_HAVE_WINSOCK2_H=0; - - - { $as_echo "$as_me:$LINENO: checking whether malloc, realloc, calloc are POSIX compliant" >&5 -$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } -if test "${gl_cv_func_malloc_posix+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ - choke me - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_func_malloc_posix=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_malloc_posix=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_malloc_posix" >&5 -$as_echo "$gl_cv_func_malloc_posix" >&6; } - - - GNULIB_MALLOC_POSIX=0; - GNULIB_REALLOC_POSIX=0; - GNULIB_CALLOC_POSIX=0; - GNULIB_GETSUBOPT=0; - GNULIB_MKDTEMP=0; - GNULIB_MKSTEMP=0; - GNULIB_PUTENV=0; - GNULIB_RPMATCH=0; - GNULIB_SETENV=0; - GNULIB_STRTOD=0; - GNULIB_UNSETENV=0; - HAVE_CALLOC_POSIX=1; - HAVE_GETSUBOPT=1; - HAVE_MALLOC_POSIX=1; - HAVE_MKDTEMP=1; - HAVE_REALLOC_POSIX=1; - HAVE_RPMATCH=1; - HAVE_SETENV=1; - HAVE_STRTOD=1; - HAVE_UNSETENV=1; - REPLACE_MKSTEMP=0; - REPLACE_PUTENV=0; - REPLACE_STRTOD=0; - VOID_UNSETENV=0; - - - -for ac_header in stdlib.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_malloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include <stdlib.h> -#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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then - gl_cv_func_malloc_0_nonnull=1 -else - gl_cv_func_malloc_0_nonnull=0 -fi - - - -cat >>confdefs.h <<_ACEOF -#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull -_ACEOF - - - - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then - $as_echo_n "(cached) " >&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 <sys/types.h> - /* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_largefile_CC=' -n32'; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - $as_echo_n "(cached) " >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> - /* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include <sys/types.h> - /* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=64; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then - $as_echo_n "(cached) " >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> - /* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include <sys/types.h> - /* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=1; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -rf conftest* - fi -fi - - - - - - - - - - - - - - - - - - - GNULIB_SIGNAL_H_SIGPIPE=0; - GNULIB_SIGPROCMASK=0; - GNULIB_SIGACTION=0; - HAVE_POSIX_SIGNALBLOCKING=1; - HAVE_SIGSET_T=1; - HAVE_SIGINFO_T=1; - HAVE_SIGACTION=1; - HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; - - - - -{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if test "${ac_cv_type_uid_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> - -_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 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then - -cat >>confdefs.h <<\_ACEOF -#define uid_t int -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define gid_t int -_ACEOF - -fi - - - - - -{ $as_echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 -$as_echo_n "checking whether snprintf is declared... " >&6; } -if test "${ac_cv_have_decl_snprintf+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef snprintf - (void) snprintf; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_snprintf=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_snprintf=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 -$as_echo "$ac_cv_have_decl_snprintf" >&6; } -if test "x$ac_cv_have_decl_snprintf" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SNPRINTF 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SNPRINTF 0 -_ACEOF - - -fi - - - - -{ $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if test "${ac_cv_header_stdbool_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - #include <stdbool.h> - #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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdbool_h=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdbool_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } - { $as_echo "$as_me:$LINENO: checking for _Bool" >&5 -$as_echo_n "checking for _Bool... " >&6; } -if test "${ac_cv_type__Bool+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type__Bool=no -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 () -{ -if (sizeof (_Bool)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - 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 () -{ -if (sizeof ((_Bool))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type__Bool=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -$as_echo "$ac_cv_type__Bool" >&6; } -if test "x$ac_cv_type__Bool" = x""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 - - - - - - - - - - GNULIB_MEMMEM=0; - GNULIB_MEMPCPY=0; - GNULIB_MEMRCHR=0; - GNULIB_RAWMEMCHR=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_STRSTR=0; - GNULIB_STRCASESTR=0; - GNULIB_STRTOK_R=0; - GNULIB_MBSLEN=0; - GNULIB_MBSNLEN=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; - GNULIB_STRERROR=0; - GNULIB_STRSIGNAL=0; - GNULIB_STRVERSCMP=0; - HAVE_DECL_MEMMEM=1; - HAVE_MEMPCPY=1; - HAVE_DECL_MEMRCHR=1; - HAVE_RAWMEMCHR=1; - HAVE_STPCPY=1; - HAVE_STPNCPY=1; - HAVE_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; - HAVE_DECL_STRERROR=1; - HAVE_DECL_STRSIGNAL=1; - HAVE_STRVERSCMP=1; - REPLACE_MEMMEM=0; - REPLACE_STRDUP=0; - REPLACE_STRSTR=0; - REPLACE_STRCASESTR=0; - REPLACE_STRERROR=0; - REPLACE_STRSIGNAL=0; - - - - - - - if test -z "$ERRNO_H"; then - { $as_echo "$as_me:$LINENO: checking for working strerror function" >&5 -$as_echo_n "checking for working strerror function... " >&6; } -if test "${gl_cv_func_working_strerror+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> - -int -main () -{ -return !*strerror (-2); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_func_working_strerror=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_working_strerror=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> - -int -main () -{ -return !*strerror (-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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_working_strerror=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_working_strerror=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_working_strerror" >&5 -$as_echo "$gl_cv_func_working_strerror" >&6; } - if test $gl_cv_func_working_strerror = no; then - REPLACE_STRERROR=1 - fi - else - REPLACE_STRERROR=1 - fi - if test $REPLACE_STRERROR = 1; then - - { $as_echo "$as_me:$LINENO: checking whether strerror is declared" >&5 -$as_echo_n "checking whether strerror is declared... " >&6; } -if test "${ac_cv_have_decl_strerror+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strerror - (void) strerror; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strerror=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5 -$as_echo "$ac_cv_have_decl_strerror" >&6; } -if test "x$ac_cv_have_decl_strerror" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR 0 -_ACEOF - - -fi - - - - - - - - - if test $ac_cv_header_sys_socket_h != yes; then - -for ac_header in winsock2.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - fi - - fi - - - - - - - - - - - - - - - - - if test $gl_cv_have_include_next = yes; then - gl_cv_next_string_h='<'string.h'>' - else - { $as_echo "$as_me:$LINENO: checking absolute name of <string.h>" >&5 -$as_echo_n "checking absolute name of <string.h>... " >&6; } -if test "${gl_cv_next_string_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - if test $ac_cv_header_string_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> - -_ACEOF - gl_cv_next_string_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/string.h#{ - s#.*"\(.*/string.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_string_h='<'string.h'>' - fi - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_string_h" >&5 -$as_echo "$gl_cv_next_string_h" >&6; } - fi - NEXT_STRING_H=$gl_cv_next_string_h - - - - -{ $as_echo "$as_me:$LINENO: checking whether strndup is declared" >&5 -$as_echo_n "checking whether strndup is declared... " >&6; } -if test "${ac_cv_have_decl_strndup+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strndup - (void) strndup; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strndup=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strndup" >&5 -$as_echo "$ac_cv_have_decl_strndup" >&6; } -if test "x$ac_cv_have_decl_strndup" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNDUP 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNDUP 0 -_ACEOF - - -fi - - -{ $as_echo "$as_me:$LINENO: checking whether strnlen is declared" >&5 -$as_echo_n "checking whether strnlen is declared... " >&6; } -if test "${ac_cv_have_decl_strnlen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strnlen - (void) strnlen; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strnlen=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strnlen" >&5 -$as_echo "$ac_cv_have_decl_strnlen" >&6; } -if test "x$ac_cv_have_decl_strnlen" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNLEN 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNLEN 0 -_ACEOF - - -fi - - -{ $as_echo "$as_me:$LINENO: checking whether strsignal is declared" >&5 -$as_echo_n "checking whether strsignal is declared... " >&6; } -if test "${ac_cv_have_decl_strsignal+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strsignal - (void) strsignal; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strsignal=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strsignal=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strsignal" >&5 -$as_echo "$ac_cv_have_decl_strsignal" >&6; } -if test "x$ac_cv_have_decl_strsignal" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRSIGNAL 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRSIGNAL 0 -_ACEOF - - -fi - - -{ $as_echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5 -$as_echo_n "checking whether sys_siglist is declared... " >&6; } -if test "${ac_cv_have_decl_sys_siglist+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> -/* NetBSD declares sys_siglist in unistd.h. */ -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif - - -int -main () -{ -#ifndef sys_siglist - (void) sys_siglist; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_sys_siglist=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_sys_siglist=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5 -$as_echo "$ac_cv_have_decl_sys_siglist" >&6; } -if test "x$ac_cv_have_decl_sys_siglist" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SYS_SIGLIST 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SYS_SIGLIST 0 -_ACEOF - - -fi - - - - - REPLACE_MKDIR=0; - - - -{ $as_echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 -$as_echo_n "checking whether stat file-mode macros are broken... " >&6; } -if test "${ac_cv_header_stat_broken+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> -#include <sys/stat.h> - -#if defined S_ISBLK && defined S_IFDIR -extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; -#endif - -#if defined S_ISBLK && defined S_IFCHR -extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; -#endif - -#if defined S_ISLNK && defined S_IFREG -extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; -#endif - -#if defined S_ISSOCK && defined S_IFREG -extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; -#endif - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stat_broken=no -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stat_broken=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 -$as_echo "$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 - - - - - -{ $as_echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 -$as_echo_n "checking whether clearerr_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef clearerr_unlocked - (void) clearerr_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_clearerr_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_clearerr_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 -$as_echo "$ac_cv_have_decl_clearerr_unlocked" >&6; } -if test "x$ac_cv_have_decl_clearerr_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 -$as_echo_n "checking whether feof_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef feof_unlocked - (void) feof_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_feof_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_feof_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 -$as_echo "$ac_cv_have_decl_feof_unlocked" >&6; } -if test "x$ac_cv_have_decl_feof_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 -$as_echo_n "checking whether ferror_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef ferror_unlocked - (void) ferror_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_ferror_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_ferror_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 -$as_echo "$ac_cv_have_decl_ferror_unlocked" >&6; } -if test "x$ac_cv_have_decl_ferror_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 -$as_echo_n "checking whether fflush_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fflush_unlocked - (void) fflush_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fflush_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fflush_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fflush_unlocked" >&6; } -if test "x$ac_cv_have_decl_fflush_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 -$as_echo_n "checking whether fgets_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fgets_unlocked - (void) fgets_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fgets_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fgets_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fgets_unlocked" >&6; } -if test "x$ac_cv_have_decl_fgets_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 -$as_echo_n "checking whether fputc_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fputc_unlocked - (void) fputc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fputc_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fputc_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fputc_unlocked" >&6; } -if test "x$ac_cv_have_decl_fputc_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 -$as_echo_n "checking whether fputs_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fputs_unlocked - (void) fputs_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fputs_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fputs_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fputs_unlocked" >&6; } -if test "x$ac_cv_have_decl_fputs_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 -$as_echo_n "checking whether fread_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fread_unlocked - (void) fread_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fread_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fread_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fread_unlocked" >&6; } -if test "x$ac_cv_have_decl_fread_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 -$as_echo_n "checking whether fwrite_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fwrite_unlocked - (void) fwrite_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fwrite_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fwrite_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fwrite_unlocked" >&6; } -if test "x$ac_cv_have_decl_fwrite_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 -$as_echo_n "checking whether getchar_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getchar_unlocked - (void) getchar_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getchar_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getchar_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 -$as_echo "$ac_cv_have_decl_getchar_unlocked" >&6; } -if test "x$ac_cv_have_decl_getchar_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 -$as_echo_n "checking whether putc_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef putc_unlocked - (void) putc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_putc_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_putc_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 -$as_echo "$ac_cv_have_decl_putc_unlocked" >&6; } -if test "x$ac_cv_have_decl_putc_unlocked" = x""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 - - -{ $as_echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 -$as_echo_n "checking whether putchar_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef putchar_unlocked - (void) putchar_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_putchar_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_putchar_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 -$as_echo "$ac_cv_have_decl_putchar_unlocked" >&6; } -if test "x$ac_cv_have_decl_putchar_unlocked" = x""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 - - - - - - { $as_echo "$as_me:$LINENO: checking for wchar_t" >&5 -$as_echo_n "checking for wchar_t... " >&6; } -if test "${gt_cv_c_wchar_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stddef.h> - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gt_cv_c_wchar_t=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 -$as_echo "$gt_cv_c_wchar_t" >&6; } - if test $gt_cv_c_wchar_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_WCHAR_T 1 -_ACEOF - - fi - - - { $as_echo "$as_me:$LINENO: checking for wint_t" >&5 -$as_echo_n "checking for wint_t... " >&6; } -if test "${gt_cv_c_wint_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >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: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included - before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gt_cv_c_wint_t=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 -$as_echo "$gt_cv_c_wint_t" >&6; } - if test $gt_cv_c_wint_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_WINT_T 1 -_ACEOF - - fi - -{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 -$as_echo_n "checking for size_t... " >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_size_t=no -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 () -{ -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - 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 () -{ -if (sizeof ((size_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -$as_echo "$ac_cv_type_size_t" >&6; } -if test "x$ac_cv_type_size_t" = x""yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - - - { $as_echo "$as_me:$LINENO: checking for inttypes.h" >&5 -$as_echo_n "checking for inttypes.h... " >&6; } -if test "${gl_cv_header_inttypes_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> -#include <inttypes.h> -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_header_inttypes_h=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 -$as_echo "$gl_cv_header_inttypes_h" >&6; } - if test $gl_cv_header_inttypes_h = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_INTTYPES_H_WITH_UINTMAX 1 -_ACEOF - - fi - - - { $as_echo "$as_me:$LINENO: checking for stdint.h" >&5 -$as_echo_n "checking for stdint.h... " >&6; } -if test "${gl_cv_header_stdint_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> -#include <stdint.h> -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_header_stdint_h=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 -$as_echo "$gl_cv_header_stdint_h" >&6; } - if test $gl_cv_header_stdint_h = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_STDINT_H_WITH_UINTMAX 1 -_ACEOF - - fi - - - - - { $as_echo "$as_me:$LINENO: checking for intmax_t" >&5 -$as_echo_n "checking for intmax_t... " >&6; } -if test "${gt_cv_c_intmax_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include <stddef.h> -#include <stdlib.h> -#if HAVE_STDINT_H_WITH_UINTMAX -#include <stdint.h> -#endif -#if HAVE_INTTYPES_H_WITH_UINTMAX -#include <inttypes.h> -#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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gt_cv_c_intmax_t=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 -$as_echo "$gt_cv_c_intmax_t" >&6; } - if test $gt_cv_c_intmax_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_INTMAX_T 1 -_ACEOF - - else - - test $ac_cv_type_long_long_int = yes \ - && ac_type='long long' \ - || ac_type='long' - -cat >>confdefs.h <<_ACEOF -#define intmax_t $ac_type -_ACEOF - - fi - - - - - - { $as_echo "$as_me:$LINENO: checking whether printf supports size specifiers as in C99" >&5 -$as_echo_n "checking whether printf supports size specifiers as in C99... " >&6; } -if test "${gl_cv_func_printf_sizes_c99+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then - - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; - darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on OpenBSD >= 3.9. - openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) - gl_cv_func_printf_sizes_c99="guessing no";; - openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on Solaris >= 2.10. - solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";; - solaris*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_printf_sizes_c99="guessing no";; - netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_sizes_c99="guessing no";; - esac - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include <stddef.h> -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#if HAVE_STDINT_H_WITH_UINTMAX -# include <stdint.h> -#endif -#if HAVE_INTTYPES_H_WITH_UINTMAX -# include <inttypes.h> -#endif -static char buf[100]; -int main () -{ -#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX - buf[0] = '\0'; - if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 - || strcmp (buf, "12345671 33") != 0) - return 1; -#endif - buf[0] = '\0'; - if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 - || strcmp (buf, "12345672 33") != 0) - return 1; - buf[0] = '\0'; - if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 - || strcmp (buf, "12345673 33") != 0) - return 1; - buf[0] = '\0'; - if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 - || strcmp (buf, "1.5 33") != 0) - return 1; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_sizes_c99=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_printf_sizes_c99=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_sizes_c99" >&5 -$as_echo "$gl_cv_func_printf_sizes_c99" >&6; } - - - - { $as_echo "$as_me:$LINENO: checking whether printf supports 'long double' arguments" >&5 -$as_echo_n "checking whether printf supports 'long double' arguments... " >&6; } -if test "${gl_cv_func_printf_long_double+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then - - case "$host_os" in - beos*) gl_cv_func_printf_long_double="guessing no";; - mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; - *) gl_cv_func_printf_long_double="guessing yes";; - esac - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include <stdio.h> -#include <string.h> -static char buf[10000]; -int main () -{ - buf[0] = '\0'; - if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 - || strcmp (buf, "1.750000 33") != 0) - return 1; - buf[0] = '\0'; - if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 - || strcmp (buf, "1.750000e+00 33") != 0) - return 1; - buf[0] = '\0'; - if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 - || strcmp (buf, "1.75 33") != 0) - return 1; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_long_double=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_printf_long_double=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_long_double" >&5 -$as_echo "$gl_cv_func_printf_long_double" >&6; } - - - - { $as_echo "$as_me:$LINENO: checking whether printf supports infinite 'double' arguments" >&5 -$as_echo_n "checking whether printf supports infinite 'double' arguments... " >&6; } -if test "${gl_cv_func_printf_infinite+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then - - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; - darwin*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on HP-UX >= 11. - hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; - hpux*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_printf_infinite="guessing no";; - netbsd*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_printf_infinite="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_infinite="guessing no";; - esac - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include <stdio.h> -#include <string.h> -static int -strisnan (const char *string, size_t start_index, size_t end_index) -{ - if (start_index < end_index) - { - if (string[start_index] == '-') - start_index++; - if (start_index + 3 <= end_index - && memcmp (string + start_index, "nan", 3) == 0) - { - start_index += 3; - if (start_index == end_index - || (string[start_index] == '(' && string[end_index - 1] == ')')) - return 1; - } - } - return 0; -} -static char buf[10000]; -static double zero = 0.0; -int main () -{ - if (sprintf (buf, "%f", 1.0 / 0.0) < 0 - || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%f", -1.0 / 0.0) < 0 - || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; - if (sprintf (buf, "%f", zero / zero) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%e", 1.0 / 0.0) < 0 - || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%e", -1.0 / 0.0) < 0 - || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; - if (sprintf (buf, "%e", zero / zero) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%g", 1.0 / 0.0) < 0 - || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%g", -1.0 / 0.0) < 0 - || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; - if (sprintf (buf, "%g", zero / zero) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_infinite=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_printf_infinite=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_infinite" >&5 -$as_echo "$gl_cv_func_printf_infinite" >&6; } - - - - - - if test -n "$gl_printf_safe"; then - -cat >>confdefs.h <<\_ACEOF -#define CHECK_PRINTF_SAFE 1 -_ACEOF - - fi - case "$gl_cv_func_printf_long_double" in - *yes) - { $as_echo "$as_me:$LINENO: checking whether printf supports infinite 'long double' arguments" >&5 -$as_echo_n "checking whether printf supports infinite 'long double' arguments... " >&6; } -if test "${gl_cv_func_printf_infinite_long_double+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then - - case "$host_cpu" in - # Guess no on ia64, x86_64, i386. - ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; - *) - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";; - darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on HP-UX >= 11. - hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; - hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_printf_infinite_long_double="guessing no";; - netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_infinite_long_double="guessing no";; - esac - ;; - esac - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -#include <stdlib.h> -#if defined __MACH__ && defined __APPLE__ -/* Avoid a crash on MacOS X. */ -#include <mach/mach.h> -#include <mach/mach_error.h> -#include <mach/thread_status.h> -#include <mach/exception.h> -#include <mach/task.h> -#include <pthread.h> -/* The exception port on which our thread listens. */ -static mach_port_t our_exception_port; -/* The main function of the thread listening for exceptions of type - EXC_BAD_ACCESS. */ -static void * -mach_exception_thread (void *arg) -{ - /* Buffer for a message to be received. */ - struct { - mach_msg_header_t head; - mach_msg_body_t msgh_body; - char data[1024]; - } msg; - mach_msg_return_t retval; - /* Wait for a message on the exception port. */ - retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), - our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - if (retval != MACH_MSG_SUCCESS) - abort (); - exit (1); -} -static void -nocrash_init (void) -{ - mach_port_t self = mach_task_self (); - /* Allocate a port on which the thread shall listen for exceptions. */ - if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) - == KERN_SUCCESS) { - /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ - if (mach_port_insert_right (self, our_exception_port, our_exception_port, - MACH_MSG_TYPE_MAKE_SEND) - == KERN_SUCCESS) { - /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting - for us. */ - exception_mask_t mask = EXC_MASK_BAD_ACCESS; - /* Create the thread listening on the exception port. */ - pthread_attr_t attr; - pthread_t thread; - if (pthread_attr_init (&attr) == 0 - && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 - && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { - pthread_attr_destroy (&attr); - /* Replace the exception port info for these exceptions with our own. - Note that we replace the exception port for the entire task, not only - for a particular thread. This has the effect that when our exception - port gets the message, the thread specific exception port has already - been asked, and we don't need to bother about it. - See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ - task_set_exception_ports (self, mask, our_exception_port, - EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); - } - } - } -} -#else -/* Avoid a crash on POSIX systems. */ -#include <signal.h> -/* A POSIX signal handler. */ -static void -exception_handler (int sig) -{ - exit (1); -} -static void -nocrash_init (void) -{ -#ifdef SIGSEGV - signal (SIGSEGV, exception_handler); -#endif -#ifdef SIGBUS - signal (SIGBUS, exception_handler); -#endif -} -#endif - -#include <float.h> -#include <stdio.h> -#include <string.h> -static int -strisnan (const char *string, size_t start_index, size_t end_index) -{ - if (start_index < end_index) - { - if (string[start_index] == '-') - start_index++; - if (start_index + 3 <= end_index - && memcmp (string + start_index, "nan", 3) == 0) - { - start_index += 3; - if (start_index == end_index - || (string[start_index] == '(' && string[end_index - 1] == ')')) - return 1; - } - } - return 0; -} -static char buf[10000]; -static long double zeroL = 0.0L; -int main () -{ - nocrash_init(); - if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0 - || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0 - || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; - if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0 - || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0 - || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; - if (sprintf (buf, "%Le", zeroL / zeroL) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0 - || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0 - || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; - if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; -#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) -/* Representation of an 80-bit 'long double' as an initializer for a sequence - of 'unsigned int' words. */ -# ifdef WORDS_BIGENDIAN -# define LDBL80_WORDS(exponent,manthi,mantlo) \ - { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ - (unsigned int) (mantlo) << 16 \ - } -# else -# define LDBL80_WORDS(exponent,manthi,mantlo) \ - { mantlo, manthi, exponent } -# endif - { /* Quiet NaN. */ - static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - } - { - /* Signalling NaN. */ - static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - } - { /* Pseudo-NaN. */ - static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - } - { /* Pseudo-Infinity. */ - static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - } - { /* Pseudo-Zero. */ - static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - } - { /* Unnormalized number. */ - static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - } - { /* Pseudo-Denormal. */ - static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - } -#endif - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_infinite_long_double=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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 + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-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" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBPTH="${LIBPTH}${LIBPTH:+ }$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 + LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBPTH="${LIBPTH}${LIBPTH:+ }$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 $LIBPTH; do -( exit $ac_status ) -gl_cv_func_printf_infinite_long_double=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + 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 + LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" + else + LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBPTH="${LIBPTH}${LIBPTH:+ }$found_a" + else + LIBPTH="${LIBPTH}${LIBPTH:+ }-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/"'*$,,'` + if test "$name" = 'pth'; then + LIBPTH_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'pth'; then + LIBPTH_PREFIX="$basedir" + fi + 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 $INCPTH; 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 + INCPTH="${INCPTH}${INCPTH:+ }-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" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBPTH; 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" -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_infinite_long_double" >&5 -$as_echo "$gl_cv_func_printf_infinite_long_double" >&6; } - ;; - *) - gl_cv_func_printf_infinite_long_double="irrelevant" - ;; - esac + 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 + LIBPTH="${LIBPTH}${LIBPTH:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBPTH; 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 + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-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$,,'` + ;; + *) + LIBPTH="${LIBPTH}${LIBPTH:+ }$dep" + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$dep" + ;; + esac + done + fi + else + LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-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" + LIBPTH="${LIBPTH}${LIBPTH:+ }$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" + LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-R$found_dir" + done + fi - { $as_echo "$as_me:$LINENO: checking whether printf supports the 'a' and 'A' directives" >&5 -$as_echo_n "checking whether printf supports the 'a' and 'A' directives... " >&6; } -if test "${gl_cv_func_printf_directive_a+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - case "$host_os" in - # Guess yes on glibc >= 2.5 systems. - *-gnu*) - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - #include <features.h> - #ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2) - BZ2908 - #endif - #endif + ac_cv_libpth_libs="$LIBPTH" + ac_cv_libpth_ltlibs="$LTLIBPTH" + ac_cv_libpth_cppflags="$INCPTH" + ac_cv_libpth_prefix="$LIBPTH_PREFIX" -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "BZ2908" >/dev/null 2>&1; then - gl_cv_func_printf_directive_a="guessing yes" -else - gl_cv_func_printf_directive_a="guessing no" fi -rm -f conftest* - - ;; - # If we don't know, assume the worst. - *) gl_cv_func_printf_directive_a="guessing no";; - esac - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include <stdio.h> -#include <string.h> -static char buf[100]; -int main () -{ - if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 - || (strcmp (buf, "0x1.922p+1 33") != 0 - && strcmp (buf, "0x3.244p+0 33") != 0 - && strcmp (buf, "0x6.488p-1 33") != 0 - && strcmp (buf, "0xc.91p-2 33") != 0)) - return 1; - if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 - || (strcmp (buf, "-0X1.922P+1 33") != 0 - && strcmp (buf, "-0X3.244P+0 33") != 0 - && strcmp (buf, "-0X6.488P-1 33") != 0 - && strcmp (buf, "-0XC.91P-2 33") != 0)) - return 1; - /* This catches a FreeBSD 6.1 bug: it doesn't round. */ - if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 - || (strcmp (buf, "0x1.83p+0 33") != 0 - && strcmp (buf, "0x3.05p-1 33") != 0 - && strcmp (buf, "0x6.0ap-2 33") != 0 - && strcmp (buf, "0xc.14p-3 33") != 0)) - return 1; - /* This catches a FreeBSD 6.1 bug. See - <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */ - if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0 - || buf[0] == '0') - return 1; - /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */ - if (sprintf (buf, "%.1a", 1.999) < 0 - || (strcmp (buf, "0x1.0p+1") != 0 - && strcmp (buf, "0x2.0p+0") != 0 - && strcmp (buf, "0x4.0p-1") != 0 - && strcmp (buf, "0x8.0p-2") != 0)) - return 1; - /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a - glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */ - if (sprintf (buf, "%.1La", 1.999L) < 0 - || (strcmp (buf, "0x1.0p+1") != 0 - && strcmp (buf, "0x2.0p+0") != 0 - && strcmp (buf, "0x4.0p-1") != 0 - && strcmp (buf, "0x8.0p-2") != 0)) - return 1; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_directive_a=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libpth_libs" >&5 +$as_echo "$ac_cv_libpth_libs" >&6; } + LIBPTH="$ac_cv_libpth_libs" + LTLIBPTH="$ac_cv_libpth_ltlibs" + INCPTH="$ac_cv_libpth_cppflags" + LIBPTH_PREFIX="$ac_cv_libpth_prefix" -( exit $ac_status ) -gl_cv_func_printf_directive_a=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + for element in $INCPTH; 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 -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_directive_a" >&5 -$as_echo "$gl_cv_func_printf_directive_a" >&6; } - { $as_echo "$as_me:$LINENO: checking whether printf supports the 'F' directive" >&5 -$as_echo_n "checking whether printf supports the 'F' directive... " >&6; } -if test "${gl_cv_func_printf_directive_f+set}" = set; then - $as_echo_n "(cached) " >&6 -else + HAVE_LIBPTH=yes - if test "$cross_compiling" = yes; then - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; - # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; - darwin*) gl_cv_func_printf_directive_f="guessing yes";; - # Guess yes on Solaris >= 2.10. - solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";; - solaris*) gl_cv_func_printf_directive_f="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_directive_f="guessing no";; - esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + gl_have_pth= + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lpth" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include <stdio.h> -#include <string.h> -static char buf[100]; -int main () +#include <pth.h> +int +main () { - if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 - || strcmp (buf, "1234567.000000 33") != 0) - return 1; - if (sprintf (buf, "%F", 1.0 / 0.0) < 0 - || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) - return 1; - /* This catches a Cygwin 2007 bug. */ - if (sprintf (buf, "%.F", 1234.0) < 0 - || strcmp (buf, "1234") != 0) - return 1; +pth_self(); + ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_directive_f=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_printf_directive_f=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_link "$LINENO"; then + gl_have_pth=yes fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + if test -n "$gl_have_pth"; then + gl_threads_api=pth + LIBTHREAD="$LIBPTH" + LTLIBTHREAD="$LTLIBPTH" + LIBMULTITHREAD="$LIBTHREAD" + LTLIBMULTITHREAD="$LTLIBTHREAD" + +$as_echo "#define USE_PTH_THREADS 1" >>confdefs.h + + if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then + if test $gl_have_weak = yes; then + +$as_echo "#define USE_PTH_THREADS_WEAK 1" >>confdefs.h + LIBTHREAD= + LTLIBTHREAD= + fi + fi + else + CPPFLAGS="$gl_save_CPPFLAGS" + fi + fi + if test -z "$gl_have_pthread"; then + if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then + if { case "$host_os" in + mingw*) true;; + *) false;; + esac + }; then + gl_threads_api=win32 +$as_echo "#define USE_WIN32_THREADS 1" >>confdefs.h -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_directive_f" >&5 -$as_echo "$gl_cv_func_printf_directive_f" >&6; } + fi + fi + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5 +$as_echo_n "checking for multithread API to use... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5 +$as_echo "$gl_threads_api" >&6; } - { $as_echo "$as_me:$LINENO: checking whether printf supports the 'n' directive" >&5 -$as_echo_n "checking whether printf supports the 'n' directive... " >&6; } -if test "${gl_cv_func_printf_directive_n+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - case "$host_os" in - *) gl_cv_func_printf_directive_n="guessing yes";; - esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdio.h> -#include <string.h> -static char fmtstring[10]; -static char buf[100]; -int main () -{ - int count = -1; - /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) - support %n in format strings in read-only memory but not in writable - memory. */ - strcpy (fmtstring, "%d %n"); - if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 - || strcmp (buf, "123 ") != 0 - || count != 4) - return 1; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_directive_n=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -gl_cv_func_printf_directive_n=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + GNULIB_LCHMOD=0; + GNULIB_LSTAT=0; + HAVE_LCHMOD=1; + REPLACE_LSTAT=0; + REPLACE_MKDIR=0; -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_directive_n" >&5 -$as_echo "$gl_cv_func_printf_directive_n" >&6; } - { $as_echo "$as_me:$LINENO: checking whether printf supports POSIX/XSI format strings with positions" >&5 -$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } -if test "${gl_cv_func_printf_positions+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if test "${gl_cv_func_malloc_posix+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - - case "$host_os" in - netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) - gl_cv_func_printf_positions="guessing no";; - beos*) gl_cv_func_printf_positions="guessing no";; - mingw* | pw*) gl_cv_func_printf_positions="guessing no";; - *) gl_cv_func_printf_positions="guessing yes";; - esac - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> -#include <string.h> -/* The string "%2$d %1$d", with dollar characters protected from the shell's - dollar expansion (possibly an autoconf bug). */ -static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; -static char buf[100]; -int main () +int +main () { - sprintf (buf, format, 33, 55); - return (strcmp (buf, "55 33") != 0); +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_positions=yes +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_func_malloc_posix=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_printf_positions=no + gl_cv_func_malloc_posix=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +$as_echo "$gl_cv_func_malloc_posix" >&6; } + + + GNULIB_MALLOC_POSIX=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_ATOLL=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_MKDTEMP=0; + GNULIB_MKSTEMP=0; + GNULIB_PUTENV=0; + GNULIB_RANDOM_R=0; + GNULIB_RPMATCH=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_UNSETENV=0; + HAVE_ATOLL=1; + HAVE_CALLOC_POSIX=1; + HAVE_GETSUBOPT=1; + HAVE_MALLOC_POSIX=1; + HAVE_MKDTEMP=1; + HAVE_REALLOC_POSIX=1; + HAVE_RANDOM_R=1; + HAVE_RPMATCH=1; + HAVE_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNSETENV=1; + HAVE_DECL_GETLOADAVG=1; + REPLACE_MKSTEMP=0; + REPLACE_PUTENV=0; + REPLACE_STRTOD=0; + VOID_UNSETENV=0; + for ac_header in stdlib.h +do + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_positions" >&5 -$as_echo "$gl_cv_func_printf_positions" >&6; } - +done - { $as_echo "$as_me:$LINENO: checking whether printf supports the grouping flag" >&5 -$as_echo_n "checking whether printf supports the grouping flag... " >&6; } -if test "${gl_cv_func_printf_flag_grouping+set}" = set; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then $as_echo_n "(cached) " >&6 else - - if test "$cross_compiling" = yes; then - - case "$host_os" in - cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; - netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; - mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; - *) gl_cv_func_printf_flag_grouping="guessing yes";; - esac - + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include <stdlib.h> +#else +char *malloc (); +#endif -#include <stdio.h> -#include <string.h> -static char buf[100]; -int main () +int +main () { - if (sprintf (buf, "%'d %d", 1234567, 99) < 0 - || buf[strlen (buf) - 1] != '9') - return 1; +return ! malloc (0); + ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_flag_grouping=yes +if ac_fn_c_try_run "$LINENO"; then + ac_cv_func_malloc_0_nonnull=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_printf_flag_grouping=no + ac_cv_func_malloc_0_nonnull=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then + gl_cv_func_malloc_0_nonnull=1 +else + gl_cv_func_malloc_0_nonnull=0 +fi -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_flag_grouping" >&5 -$as_echo "$gl_cv_func_printf_flag_grouping" >&6; } +cat >>confdefs.h <<_ACEOF +#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull +_ACEOF - { $as_echo "$as_me:$LINENO: checking whether printf supports the left-adjust flag correctly" >&5 -$as_echo_n "checking whether printf supports the left-adjust flag correctly... " >&6; } -if test "${gl_cv_func_printf_flag_leftadjust+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - case "$host_os" in - # Guess yes on HP-UX 11. - hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; - # Guess no on HP-UX 10 and older. - hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; - # Guess yes otherwise. - *) gl_cv_func_printf_flag_leftadjust="guessing yes";; - esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +$as_echo_n "checking for mbstate_t... " >&6; } +if test "${ac_cv_type_mbstate_t+set}" = set; then + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include <stdio.h> -#include <string.h> -static char buf[100]; -int main () +$ac_includes_default +# include <wchar.h> +int +main () { - /* Check that a '-' flag is not annihilated by a negative width. */ - if (sprintf (buf, "a%-*sc", -3, "b") < 0 - || strcmp (buf, "ab c") != 0) - return 1; +mbstate_t x; return sizeof 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_flag_leftadjust=yes +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_type_mbstate_t=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_mbstate_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +$as_echo "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h -( exit $ac_status ) -gl_cv_func_printf_flag_leftadjust=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + else +$as_echo "#define mbstate_t int" >>confdefs.h + + fi -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_flag_leftadjust" >&5 -$as_echo "$gl_cv_func_printf_flag_leftadjust" >&6; } - { $as_echo "$as_me:$LINENO: checking whether printf supports the zero flag correctly" >&5 -$as_echo_n "checking whether printf supports the zero flag correctly... " >&6; } -if test "${gl_cv_func_printf_flag_zero+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_printf_flag_zero="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_flag_zero="guessing no";; - esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +$as_echo_n "checking for a traditional japanese locale... " >&6; } +if test "${gt_cv_locale_ja+set}" = set; then + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> #include <string.h> -static char buf[100]; +struct tm t; +char buf[16]; int main () { - if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0 - || (strcmp (buf, " inf") != 0 - && strcmp (buf, " infinity") != 0)) + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; return 0; } + _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_flag_zero=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + fi + rm -fr conftest* -( exit $ac_status ) -gl_cv_func_printf_flag_zero=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +$as_echo "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_flag_zero" >&5 -$as_echo "$gl_cv_func_printf_flag_zero" >&6; } - { $as_echo "$as_me:$LINENO: checking whether printf supports large precisions" >&5 -$as_echo_n "checking whether printf supports large precisions... " >&6; } -if test "${gl_cv_func_printf_precision+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if test "${gt_cv_locale_zh_CN+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - - case "$host_os" in - # Guess no only on native Win32 and BeOS systems. - mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; - beos*) gl_cv_func_printf_precision="guessing no" ;; - *) gl_cv_func_printf_precision="guessing yes" ;; - esac - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> #include <string.h> -static char buf[5000]; +struct tm t; +char buf[16]; int main () { -#ifdef __BEOS__ - /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ - return 1; + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } #endif - if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) return 1; return 0; } + _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_printf_precision=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* -( exit $ac_status ) -gl_cv_func_printf_precision=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_precision" >&5 -$as_echo "$gl_cv_func_printf_precision" >&6; } - - { $as_echo "$as_me:$LINENO: checking whether printf survives out-of-memory conditions" >&5 -$as_echo_n "checking whether printf survives out-of-memory conditions... " >&6; } -if test "${gl_cv_func_printf_enomem+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = 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 <stdlib.h> -#if defined __MACH__ && defined __APPLE__ -/* Avoid a crash on MacOS X. */ -#include <mach/mach.h> -#include <mach/mach_error.h> -#include <mach/thread_status.h> -#include <mach/exception.h> -#include <mach/task.h> -#include <pthread.h> -/* The exception port on which our thread listens. */ -static mach_port_t our_exception_port; -/* The main function of the thread listening for exceptions of type - EXC_BAD_ACCESS. */ -static void * -mach_exception_thread (void *arg) -{ - /* Buffer for a message to be received. */ - struct { - mach_msg_header_t head; - mach_msg_body_t msgh_body; - char data1024; - } msg; - mach_msg_return_t retval; - /* Wait for a message on the exception port. */ - retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), - our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - if (retval != MACH_MSG_SUCCESS) - abort (); - exit (1); -} -static void -nocrash_init (void) -{ - mach_port_t self = mach_task_self (); - /* Allocate a port on which the thread shall listen for exceptions. */ - if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) - == KERN_SUCCESS) { - /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ - if (mach_port_insert_right (self, our_exception_port, our_exception_port, - MACH_MSG_TYPE_MAKE_SEND) - == KERN_SUCCESS) { - /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting - for us. */ - exception_mask_t mask = EXC_MASK_BAD_ACCESS; - /* Create the thread listening on the exception port. */ - pthread_attr_t attr; - pthread_t thread; - if (pthread_attr_init (&attr) == 0 - && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 - && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { - pthread_attr_destroy (&attr); - /* Replace the exception port info for these exceptions with our own. - Note that we replace the exception port for the entire task, not only - for a particular thread. This has the effect that when our exception - port gets the message, the thread specific exception port has already - been asked, and we don't need to bother about it. - See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ - task_set_exception_ports (self, mask, our_exception_port, - EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); - } - } - } -} -#else -/* Avoid a crash on POSIX systems. */ -#include <signal.h> -/* A POSIX signal handler. */ -static void -exception_handler (int sig) -{ - exit (1); -} -static void -nocrash_init (void) -{ -#ifdef SIGSEGV - signal (SIGSEGV, exception_handler); -#endif -#ifdef SIGBUS - signal (SIGBUS, exception_handler); -#endif -} -#endif - -#include <stdio.h> -#include <sys/types.h> -#include <sys/time.h> -#include <sys/resource.h> -#include <errno.h> -int main() -{ - struct rlimit limit; - int ret; - nocrash_init (); - /* Some printf implementations allocate temporary space with malloc. */ - /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ -#ifdef RLIMIT_DATA - if (getrlimit (RLIMIT_DATA, &limit) < 0) - return 77; - if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) - limit.rlim_max = 5000000; - limit.rlim_cur = limit.rlim_max; - if (setrlimit (RLIMIT_DATA, &limit) < 0) - return 77; -#endif - /* On Linux systems, malloc() is limited by RLIMIT_AS. */ -#ifdef RLIMIT_AS - if (getrlimit (RLIMIT_AS, &limit) < 0) - return 77; - if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) - limit.rlim_max = 5000000; - limit.rlim_cur = limit.rlim_max; - if (setrlimit (RLIMIT_AS, &limit) < 0) - return 77; -#endif - /* Some printf implementations allocate temporary space on the stack. */ -#ifdef RLIMIT_STACK - if (getrlimit (RLIMIT_STACK, &limit) < 0) - return 77; - if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) - limit.rlim_max = 5000000; - limit.rlim_cur = limit.rlim_max; - if (setrlimit (RLIMIT_STACK, &limit) < 0) - return 77; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> #endif - ret = printf ("%.5000000f", 1.0); - return !(ret == 5000002 || (ret < 0 && errno == ENOMEM)); +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; } _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest$ac_exeext; then - (./conftest - result=$? - if test $result != 0 && test $result != 77; then result=1; fi - exit $result - ) >/dev/null 2>/dev/null - case $? in - 0) gl_cv_func_printf_enomem="yes" ;; - 77) gl_cv_func_printf_enomem="guessing no" ;; - *) gl_cv_func_printf_enomem="no" ;; - esac + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 else - gl_cv_func_printf_enomem="guessing no" + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi fi - rm -fr conftest* - else - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on Solaris. - solaris*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on AIX. - aix*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on HP-UX/hppa. - hpux*) case "$host_cpu" in - hppa*) gl_cv_func_printf_enomem="guessing yes";; - *) gl_cv_func_printf_enomem="guessing no";; - esac - ;; - # Guess yes on IRIX. - irix*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on OSF/1. - osf*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_printf_enomem="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_enomem="guessing no";; - esac fi + fi + rm -fr conftest* fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_printf_enomem" >&5 -$as_echo "$gl_cv_func_printf_enomem" >&6; } - - - GNULIB_WCWIDTH=0; - HAVE_DECL_WCWIDTH=1; - REPLACE_WCWIDTH=0; - WCHAR_H=''; - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi +if test "$enable_largefile" != no; then -{ $as_echo "$as_me:$LINENO: checking whether strdup is declared" >&5 -$as_echo_n "checking whether strdup is declared... " >&6; } -if test "${ac_cv_have_decl_strdup+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include <sys/types.h> + /* 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 () { -#ifndef strdup - (void) strdup; -#endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strdup=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strdup=no + if ac_fn_c_try_compile "$LINENO"; then + break fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then + ac_cv_sys_largefile_CC=' -n32'; break fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 -$as_echo "$ac_cv_have_decl_strdup" >&6; } -if test "x$ac_cv_have_decl_strdup" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRDUP 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRDUP 0 -_ACEOF - - +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi - -{ $as_echo "$as_me:$LINENO: checking whether alarm is declared" >&5 -$as_echo_n "checking whether alarm is declared... " >&6; } -if test "${ac_cv_have_decl_alarm+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include <sys/types.h> + /* 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 () { -#ifndef alarm - (void) alarm; -#endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_alarm=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_alarm=no +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_sys_file_offset_bits=no; break fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include <sys/types.h> + /* 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 +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_sys_file_offset_bits=64; break +fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_alarm" >&5 -$as_echo "$ac_cv_have_decl_alarm" >&6; } -if test "x$ac_cv_have_decl_alarm" = x""yes; then - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ALARM 1 +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF - - +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + $as_echo_n "(cached) " >&6 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ALARM 0 -_ACEOF - - -fi - - + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* 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 () +{ - if false; then - GL_COND_LIBTOOL_TRUE= - GL_COND_LIBTOOL_FALSE='#' -else - GL_COND_LIBTOOL_TRUE='#' - GL_COND_LIBTOOL_FALSE= + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_sys_large_files=no; break fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include <sys/types.h> + /* 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 () +{ - gl_cond_libtool=false - gl_libdeps= - gl_ltlibdeps= - - - - - - - - - gl_source_base='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 - { $as_echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5 -$as_echo_n "checking for alloca as a compiler built-in... " >&6; } -if test "${gl_cv_rpl_alloca+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ; + return 0; +} _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 - +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files _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 +;; +esac +rm -rf conftest* + fi fi -rm -f conftest* + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5 -$as_echo "$gl_cv_rpl_alloca" >&6; } - if test $gl_cv_rpl_alloca = yes; then +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF +$as_echo "#define AA_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h - ALLOCA_H=alloca.h - else - ALLOCA_H= - fi + APPLE_UNIVERSAL_BUILD=1 else - ALLOCA_H=alloca.h + APPLE_UNIVERSAL_BUILD=0 fi - { $as_echo "$as_me:$LINENO: checking whether to enable assertions" >&5 -$as_echo_n "checking whether to enable assertions... " >&6; } - # Check whether --enable-assert was given. -if test "${enable_assert+set}" = set; then - enableval=$enable_assert; { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -cat >>confdefs.h <<\_ACEOF -#define NDEBUG 1 -_ACEOF -else - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -fi + GNULIB_POSIX_SPAWN=0; + GNULIB_POSIX_SPAWNP=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0; + GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=0; + GNULIB_POSIX_SPAWNATTR_INIT=0; + GNULIB_POSIX_SPAWNATTR_GETFLAGS=0; + GNULIB_POSIX_SPAWNATTR_SETFLAGS=0; + GNULIB_POSIX_SPAWNATTR_GETPGROUP=0; + GNULIB_POSIX_SPAWNATTR_SETPGROUP=0; + GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM=0; + GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM=0; + GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY=0; + GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY=0; + GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT=0; + GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT=0; + GNULIB_POSIX_SPAWNATTR_GETSIGMASK=0; + GNULIB_POSIX_SPAWNATTR_SETSIGMASK=0; + GNULIB_POSIX_SPAWNATTR_DESTROY=0; + HAVE_POSIX_SPAWN=1; + REPLACE_POSIX_SPAWN=0; + SPAWN_H=''; - # for STACK_DIRECTION + if test $ac_cv_func_posix_spawn = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn works" >&5 +$as_echo_n "checking whether posix_spawn works... " >&6; } +if test "${gl_cv_func_posix_spawn_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test $cross_compiling = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <errno.h> +#include <fcntl.h> +#include <signal.h> +#include <spawn.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> +extern char **environ; +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif +#ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +#endif +#ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(x) (((x) >> 8) & 0xff) +#endif +#define CHILD_PROGRAM_FILENAME "/non/exist/ent" +static int +fd_safer (int fd) +{ + if (0 <= fd && fd <= 2) + { + int f = fd_safer (dup (fd)); + int e = errno; + close (fd); + errno = e; + fd = f; + } - { $as_echo "$as_me:$LINENO: checking whether sigaltstack is declared" >&5 -$as_echo_n "checking whether sigaltstack is declared... " >&6; } -if test "${ac_cv_have_decl_sigaltstack+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> + return fd; +} int main () { -#ifndef sigaltstack - (void) sigaltstack; -#endif + char *argv[2] = { CHILD_PROGRAM_FILENAME, NULL }; + int ofd[2]; + sigset_t blocked_signals; + sigset_t fatal_signal_set; + posix_spawn_file_actions_t actions; + bool actions_allocated; + posix_spawnattr_t attrs; + bool attrs_allocated; + int err; + pid_t child; + int status; + int exitstatus; - ; + setvbuf (stdout, NULL, _IOFBF, 0); + puts ("This should be seen only once."); + if (pipe (ofd) < 0 || (ofd[1] = fd_safer (ofd[1])) < 0) + { + perror ("cannot create pipe"); + exit (1); + } + sigprocmask (SIG_SETMASK, NULL, &blocked_signals); + sigemptyset (&fatal_signal_set); + sigaddset (&fatal_signal_set, SIGINT); + sigaddset (&fatal_signal_set, SIGTERM); + sigaddset (&fatal_signal_set, SIGHUP); + sigaddset (&fatal_signal_set, SIGPIPE); + sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL); + actions_allocated = false; + attrs_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (err = posix_spawn_file_actions_adddup2 (&actions, ofd[0], STDIN_FILENO)) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ofd[0])) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ofd[1])) != 0 + || (err = posix_spawnattr_init (&attrs)) != 0 + || (attrs_allocated = true, + (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0 + || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0) + || (err = posix_spawnp (&child, CHILD_PROGRAM_FILENAME, &actions, &attrs, argv, environ)) != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + if (attrs_allocated) + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + if (err == ENOENT) + return 0; + else + { + errno = err; + perror ("subprocess failed"); + exit (1); + } + } + posix_spawn_file_actions_destroy (&actions); + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + close (ofd[0]); + close (ofd[1]); + status = 0; + while (waitpid (child, &status, 0) != child) + ; + if (!WIFEXITED (status)) + { + fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status); + exit (1); + } + exitstatus = WEXITSTATUS (status); + if (exitstatus != 127) + { + fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus); + exit (1); + } return 0; } -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_sigaltstack=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_sigaltstack=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_sigaltstack" >&5 -$as_echo "$ac_cv_have_decl_sigaltstack" >&6; } -if test "x$ac_cv_have_decl_sigaltstack" = x""yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SIGALTSTACK 1 _ACEOF - - +if ac_fn_c_try_link "$LINENO"; then + if test -s conftest$ac_exeext \ + && ./conftest$ac_exeext > conftest.out \ + && echo 'This should be seen only once.' > conftest.ok \ + && cmp conftest.out conftest.ok > /dev/null; then + gl_cv_func_posix_spawn_works=yes + else + gl_cv_func_posix_spawn_works=no + fi else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SIGALTSTACK 0 -_ACEOF - - + gl_cv_func_posix_spawn_works=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $gl_cv_func_posix_spawn_works = yes; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test whether posix_spawn_file_actions_addopen supports filename arguments + that contain special characters such as '*'. */ +#include <errno.h> +#include <fcntl.h> +#include <signal.h> +#include <spawn.h> +#include <stdbool.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> +extern char **environ; +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif +#ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +#endif +#ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(x) (((x) >> 8) & 0xff) +#endif +#define CHILD_PROGRAM_FILENAME "conftest" +#define DATA_FILENAME "conftest%=*#?" +static int +parent_main (void) +{ + FILE *fp; + char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL }; + posix_spawn_file_actions_t actions; + bool actions_allocated; + int err; + pid_t child; + int status; + int exitstatus; + /* Create a data file with specific contents. */ + fp = fopen (DATA_FILENAME, "wb"); + if (fp == NULL) + { + perror ("cannot create data file"); + return 1; + } + fwrite ("Halle Potta", 1, 11, fp); + if (fflush (fp) || fclose (fp)) + { + perror ("cannot prepare data file"); + return 1; + } + /* Avoid reading from our stdin, as it could block. */ + freopen ("/dev/null", "rb", stdin); + /* Test whether posix_spawn_file_actions_addopen with this file name + actually works, but spawning a child that reads from this file. */ + actions_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, DATA_FILENAME, O_RDONLY, 0600)) != 0 + || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + errno = err; + perror ("subprocess failed"); + return 1; + } + posix_spawn_file_actions_destroy (&actions); + status = 0; + while (waitpid (child, &status, 0) != child) + ; + if (!WIFEXITED (status)) + { + fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status); + return 1; + } + exitstatus = WEXITSTATUS (status); + if (exitstatus != 0) + { + fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus); + return 1; + } + return 0; +} +static int +child_main (void) +{ + char buf[1024]; - { $as_echo "$as_me:$LINENO: checking for stack_t" >&5 -$as_echo_n "checking for stack_t... " >&6; } -if test "${ac_cv_type_stack_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_stack_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> + /* See if reading from STDIN_FILENO yields the expected contents. */ + if (fread (buf, 1, sizeof (buf), stdin) == 11 + && memcmp (buf, "Halle Potta", 11) == 0) + return 0; + else + return 2; +} -int -main () +static void +cleanup_then_die (int sig) { -if (sizeof (stack_t)) - return 0; - ; - return 0; + /* Clean up data file. */ + unlink (DATA_FILENAME); + + /* Re-raise the signal and die from it. */ + signal (sig, SIG_DFL); + raise (sig); } -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> int -main () +main (int argc, char *argv[]) { -if (sizeof ((stack_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + int exitstatus; - ac_cv_type_stack_t=yes -fi + if (!(argc > 1 && strcmp (argv[1], "-child") == 0)) + { + /* This is the parent process. */ + signal (SIGINT, cleanup_then_die); + signal (SIGTERM, cleanup_then_die); + #ifdef SIGHUP + signal (SIGHUP, cleanup_then_die); + #endif -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + exitstatus = parent_main (); + } + else + { + /* This is the child process. */ + exitstatus = child_main (); + } + unlink (DATA_FILENAME); + return exitstatus; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + : +else + gl_cv_func_posix_spawn_works=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_stack_t" >&5 -$as_echo "$ac_cv_type_stack_t" >&6; } -if test "x$ac_cv_type_stack_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_STACK_T 1 -_ACEOF + fi + else + case "$host_os" in + aix*) gl_cv_func_posix_spawn_works="guessing no";; + *) gl_cv_func_posix_spawn_works="guessing yes";; + esac + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_works" >&5 +$as_echo "$gl_cv_func_posix_spawn_works" >&6; } + case "$gl_cv_func_posix_spawn_works" in + *yes) ;; + *) REPLACE_POSIX_SPAWN=1 ;; + esac + else + HAVE_POSIX_SPAWN=0 + fi - if test "$gl_cv_lib_sigsegv" = yes \ - && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then - LIBCSTACK=$LIBSIGSEGV - - LTLIBCSTACK=$LTLIBSIGSEGV - fi + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=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_STRSTR=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=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; + GNULIB_STRERROR=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_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; + HAVE_DECL_STRERROR=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMMEM=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRERROR=0; + REPLACE_STRSIGNAL=0; -cat >>confdefs.h <<\_ACEOF -#define SIGNAL_SAFE_LIST 1 -_ACEOF @@ -17548,80 +10963,279 @@ _ACEOF + GNULIB_SIGNAL_H_SIGPIPE=0; + GNULIB_SIGPROCMASK=0; + GNULIB_SIGACTION=0; + HAVE_POSIX_SIGNALBLOCKING=1; + HAVE_SIGSET_T=1; + HAVE_SIGINFO_T=1; + HAVE_SIGACTION=1; + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; - M4_LIBOBJS="$M4_LIBOBJS cloexec.$ac_objext" + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if test "${ac_cv_type_uid_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +_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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then +$as_echo "#define uid_t int" >>confdefs.h +$as_echo "#define gid_t int" >>confdefs.h +fi - M4_LIBOBJS="$M4_LIBOBJS close-stream.$ac_objext" - : +ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_snprintf" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi -cat >>confdefs.h <<\_ACEOF -#define GNULIB_CLOSE_STREAM 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF $ac_have_decl _ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if test "${ac_cv_header_stdbool_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + #include <stdbool.h> + #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); - M4_LIBOBJS="$M4_LIBOBJS closein.$ac_objext" + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = x""yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF - : +fi + if test $ac_cv_header_stdbool_h = yes; then +$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h + fi - M4_LIBOBJS="$M4_LIBOBJS closeout.$ac_objext" - : + if test -z "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 +$as_echo_n "checking for working strerror function... " >&6; } +if test "${gl_cv_func_working_strerror+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> +int +main () +{ +return !*strerror (-2); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_func_working_strerror=yes +else + gl_cv_func_working_strerror=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> +int +main () +{ +return !*strerror (-2); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_working_strerror=yes +else + gl_cv_func_working_strerror=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 +$as_echo "$gl_cv_func_working_strerror" >&6; } + if test $gl_cv_func_working_strerror = no; then + REPLACE_STRERROR=1 + fi + else + REPLACE_STRERROR=1 + fi + if test $REPLACE_STRERROR = 1; then - M4_LIBOBJS="$M4_LIBOBJS basename.$ac_objext" + ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR $ac_have_decl +_ACEOF + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF +fi +done + fi + fi - M4_LIBOBJS="$M4_LIBOBJS dirname.$ac_objext" @@ -17631,126 +11245,138 @@ _ACEOF - M4_LIBOBJS="$M4_LIBOBJS stripslash.$ac_objext" + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5 +$as_echo_n "checking absolute name of <string.h>... " >&6; } +if test "${gl_cv_next_string_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test $ac_cv_header_string_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/string.h#{ + s#.*"\(.*/string.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_string_h='<'string.h'>' + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +$as_echo "$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h - { $as_echo "$as_me:$LINENO: checking whether // is distinct from /" >&5 -$as_echo_n "checking whether // is distinct from /... " >&6; } -if test "${gl_cv_double_slash_root+set}" = set; then - $as_echo_n "(cached) " >&6 +ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" +if test "x$ac_cv_have_decl_strndup" = x""yes; then + ac_have_decl=1 else - 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 - # <bug-gnulib@gnu.org>. - 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 / // 2>/dev/null` - if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then - gl_cv_double_slash_root=no - else - gl_cv_double_slash_root=yes - fi - fi + ac_have_decl=0 fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_double_slash_root" >&5 -$as_echo "$gl_cv_double_slash_root" >&6; } - if test "$gl_cv_double_slash_root" = yes; then -cat >>confdefs.h <<\_ACEOF -#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNDUP $ac_have_decl _ACEOF - fi - - - - +ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" +if test "x$ac_cv_have_decl_strnlen" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNLEN $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strsignal" "ac_cv_have_decl_strsignal" "$ac_includes_default" +if test "x$ac_cv_have_decl_strsignal" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRSIGNAL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h> +/* NetBSD declares sys_siglist in unistd.h. */ +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif +" +if test "x$ac_cv_have_decl_sys_siglist" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SYS_SIGLIST $ac_have_decl +_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 +$as_echo_n "checking whether stat file-mode macros are broken... " >&6; } +if test "${ac_cv_header_stat_broken+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/stat.h> +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif -{ $as_echo "$as_me:$LINENO: checking for error_at_line" >&5 -$as_echo_n "checking for error_at_line... " >&6; } -if test "${ac_cv_lib_error_at_line+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <error.h> -int -main () -{ -error_at_line (0, 0, "", 0, "an error occurred"); - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_error_at_line=yes +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_header_stat_broken=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_error_at_line=no + ac_cv_header_stat_broken=yes fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 +$as_echo "$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 -$as_echo "$ac_cv_lib_error_at_line" >&6; } -if test $ac_cv_lib_error_at_line = no; then @@ -17759,1405 +11385,1902 @@ if test $ac_cv_lib_error_at_line = no; t - M4_LIBOBJS="$M4_LIBOBJS error.$ac_objext" +ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_clearerr_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_feof_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi - : +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_ferror_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fflush_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fgets_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputc_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputs_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fread_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi - M4_LIBOBJS="$M4_LIBOBJS exitfail.$ac_objext" +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fwrite_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi - : +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getchar_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putc_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putchar_unlocked" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +$as_echo_n "checking for wchar_t... " >&6; } +if test "${gt_cv_c_wchar_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + wchar_t foo = (wchar_t)'\0'; +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gt_cv_c_wchar_t=yes +else + gt_cv_c_wchar_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +$as_echo "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h + fi - { $as_echo "$as_me:$LINENO: checking for working fcntl.h" >&5 -$as_echo_n "checking for working fcntl.h... " >&6; } -if test "${gl_cv_header_working_fcntl_h+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +$as_echo_n "checking for wint_t... " >&6; } +if test "${gt_cv_c_wint_t+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - gl_cv_header_working_fcntl_h=cross-compiling -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sys/types.h> - #include <sys/stat.h> - #include <unistd.h> - #include <fcntl.h> - #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 - }; +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + wint_t foo = (wchar_t)'\0'; 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_header_working_fcntl_h=yes +if ac_fn_c_try_compile "$LINENO"; then + gt_cv_c_wint_t=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -case $? in #( - 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 + gt_cv_c_wint_t=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +$as_echo "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then +$as_echo "#define HAVE_WINT_T 1" >>confdefs.h -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_working_fcntl_h" >&5 -$as_echo "$gl_cv_header_working_fcntl_h" >&6; } + fi - case $gl_cv_header_working_fcntl_h in #( - *O_NOATIME* | no | cross-compiling) ac_val=0;; #( - *) ac_val=1;; - esac +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then + : +else cat >>confdefs.h <<_ACEOF -#define HAVE_WORKING_O_NOATIME $ac_val +#define size_t unsigned int _ACEOF +fi - 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +$as_echo_n "checking for inttypes.h... " >&6; } +if test "${gl_cv_header_inttypes_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <inttypes.h> +int +main () +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_header_inttypes_h=yes +else + gl_cv_header_inttypes_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5 +$as_echo "$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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +$as_echo_n "checking for stdint.h... " >&6; } +if test "${gl_cv_header_stdint_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <stdint.h> +int +main () +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_header_stdint_h=yes +else + gl_cv_header_stdint_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5 +$as_echo "$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 - - - if test $gl_cv_have_include_next = yes; then - gl_cv_next_fcntl_h='<'fcntl.h'>' - else - { $as_echo "$as_me:$LINENO: checking absolute name of <fcntl.h>" >&5 -$as_echo_n "checking absolute name of <fcntl.h>... " >&6; } -if test "${gl_cv_next_fcntl_h+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +$as_echo_n "checking for intmax_t... " >&6; } +if test "${gt_cv_c_intmax_t+set}" = set; then $as_echo_n "(cached) " >&6 else - - if test $ac_cv_header_fcntl_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <fcntl.h> -_ACEOF - gl_cv_next_fcntl_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/fcntl.h#{ - s#.*"\(.*/fcntl.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_fcntl_h='<'fcntl.h'>' - fi +#include <stddef.h> +#include <stdlib.h> +#if HAVE_STDINT_H_WITH_UINTMAX +#include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include <inttypes.h> +#endif +int +main () +{ +intmax_t x = -1; return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gt_cv_c_intmax_t=yes +else + gt_cv_c_intmax_t=no fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_fcntl_h" >&5 -$as_echo "$gl_cv_next_fcntl_h" >&6; } - fi - NEXT_FCNTL_H=$gl_cv_next_fcntl_h +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 +$as_echo "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then +$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h + else - FCNTL_H='fcntl.h' + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long' \ + || ac_type='long' + +cat >>confdefs.h <<_ACEOF +#define intmax_t $ac_type +_ACEOF + fi - { $as_echo "$as_me:$LINENO: checking whether fflush works on input streams" >&5 -$as_echo_n "checking whether fflush works on input streams... " >&6; } -if test "${gl_cv_func_fflush_stdin+set}" = set; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports size specifiers as in C99" >&5 +$as_echo_n "checking whether printf supports size specifiers as in C99... " >&6; } +if test "${gl_cv_func_printf_sizes_c99+set}" = set; then $as_echo_n "(cached) " >&6 else - echo hello world > conftest.txt - if test "$cross_compiling" = yes; then - gl_cv_func_fflush_stdin=no + + if test "$cross_compiling" = yes; then + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_printf_sizes_c99="guessing no";; + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";; + solaris*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_sizes_c99="guessing no";; + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_sizes_c99="guessing no";; + esac + else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include <stddef.h> #include <stdio.h> -#include <unistd.h> - -int -main () +#include <string.h> +#include <sys/types.h> +#if HAVE_STDINT_H_WITH_UINTMAX +# include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +# include <inttypes.h> +#endif +static char buf[100]; +int main () { -FILE *f = fopen ("conftest.txt", "r"); - char buffer[10]; - int fd; - if (f == NULL) - return 1; - fd = fileno (f); - if (fd < 0 || fread (buffer, 1, 5, f) != 5) - return 2; - /* For deterministic results, ensure f read a bigger buffer. */ - if (lseek (fd, 0, SEEK_CUR) == 5) - return 3; - /* POSIX requires fflush-fseek to set file offset of fd. */ - if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0) - return 4; - if (lseek (fd, 0, SEEK_CUR) != 5) - return 5; - /* TODO: Verify behaviour of fflush after ungetc, see - <http://lists.gnu.org/archive/html/bug-gnulib/2008-03/msg00131.html>. */ - return 0; - - ; +#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX + buf[0] = '\0'; + if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 + || strcmp (buf, "12345671 33") != 0) + return 1; +#endif + buf[0] = '\0'; + if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 + || strcmp (buf, "12345672 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 + || strcmp (buf, "12345673 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 + || strcmp (buf, "1.5 33") != 0) + return 1; return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_fflush_stdin=yes +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_sizes_c99=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_fflush_stdin=no + gl_cv_func_printf_sizes_c99=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - rm conftest.txt - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_fflush_stdin" >&5 -$as_echo "$gl_cv_func_fflush_stdin" >&6; } - if test $gl_cv_func_fflush_stdin = no; then - - - - - - - - - - M4_LIBOBJS="$M4_LIBOBJS fflush.$ac_objext" - - - - - - - - - - M4_LIBOBJS="$M4_LIBOBJS fseeko.$ac_objext" - - - REPLACE_FFLUSH=1 - REPLACE_FSEEKO=1 - - - : - - - fi - - - - GNULIB_FFLUSH=1 - - - - - - - - - - - M4_LIBOBJS="$M4_LIBOBJS filenamecat.$ac_objext" - - - - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_sizes_c99" >&5 +$as_echo "$gl_cv_func_printf_sizes_c99" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports 'long double' arguments" >&5 +$as_echo_n "checking whether printf supports 'long double' arguments... " >&6; } +if test "${gl_cv_func_printf_long_double+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then - FLOAT_H= - case "$host_os" in - beos* | openbsd*) - FLOAT_H=float.h + case "$host_os" in + beos*) gl_cv_func_printf_long_double="guessing no";; + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; + *) gl_cv_func_printf_long_double="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +#include <string.h> +static char buf[10000]; +int main () +{ + buf[0] = '\0'; + if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000e+00 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.75 33") != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_long_double=yes +else + gl_cv_func_printf_long_double=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_long_double" >&5 +$as_echo "$gl_cv_func_printf_long_double" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'double' arguments" >&5 +$as_echo_n "checking whether printf supports infinite 'double' arguments... " >&6; } +if test "${gl_cv_func_printf_infinite+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; + darwin*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; + hpux*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite="guessing no";; + netbsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_infinite="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite="guessing no";; + esac - if test $gl_cv_have_include_next = yes; then - gl_cv_next_float_h='<'float.h'>' - else - { $as_echo "$as_me:$LINENO: checking absolute name of <float.h>" >&5 -$as_echo_n "checking absolute name of <float.h>... " >&6; } -if test "${gl_cv_next_float_h+set}" = set; then - $as_echo_n "(cached) " >&6 else - - if test $ac_cv_header_float_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <float.h> +#include <stdio.h> +#include <string.h> +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static int +have_minus_zero () +{ + static double plus_zero = 0.0; + double minus_zero = - plus_zero; + return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0; +} +static char buf[10000]; +static double zero = 0.0; +int main () +{ + if (sprintf (buf, "%f", 1.0 / 0.0) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%f", -1.0 / 0.0) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%f", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%e", 1.0 / 0.0) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%e", -1.0 / 0.0) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%e", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%g", 1.0 / 0.0) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%g", -1.0 / 0.0) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%g", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + /* This test fails on HP-UX 10.20. */ + if (have_minus_zero ()) + if (sprintf (buf, "%g", - zero) < 0 + || strcmp (buf, "-0") != 0) + return 1; + return 0; +} _ACEOF - gl_cv_next_float_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/float.h#{ - s#.*"\(.*/float.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_float_h='<'float.h'>' - fi - +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_infinite=yes +else + gl_cv_func_printf_infinite=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_float_h" >&5 -$as_echo "$gl_cv_next_float_h" >&6; } - fi - NEXT_FLOAT_H=$gl_cv_next_float_h - - - - ;; - esac - - +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite" >&5 +$as_echo "$gl_cv_func_printf_infinite" >&6; } - case "$host_os" in - mingw* | pw*) - REPLACE_FOPEN=1 + if test -n "$gl_printf_safe"; then +$as_echo "#define CHECK_PRINTF_SAFE 1" >>confdefs.h + fi + case "$gl_cv_func_printf_long_double" in + *yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'long double' arguments" >&5 +$as_echo_n "checking whether printf supports infinite 'long double' arguments... " >&6; } +if test "${gl_cv_func_printf_infinite_long_double+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then - M4_LIBOBJS="$M4_LIBOBJS fopen.$ac_objext" + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; + *) + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";; + darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite_long_double="guessing no";; + netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite_long_double="guessing no";; + esac + ;; + esac - ;; - *) - { $as_echo "$as_me:$LINENO: checking whether fopen recognizes a trailing slash" >&5 -$as_echo_n "checking whether fopen recognizes a trailing slash... " >&6; } -if test "${gl_cv_func_fopen_slash+set}" = set; then - $as_echo_n "(cached) " >&6 else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test "$cross_compiling" = yes; then - - case "$host_os" in - solaris2.[0-9]*) gl_cv_func_fopen_slash="guessing no" ;; - hpux*) gl_cv_func_fopen_slash="guessing no" ;; - *) gl_cv_func_fopen_slash="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 <stdlib.h> +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on MacOS X. */ +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <mach/thread_status.h> +#include <mach/exception.h> +#include <mach/task.h> +#include <pthread.h> +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#else +/* Avoid a crash on POSIX systems. */ +#include <signal.h> +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif -#include <stddef.h> +#include <float.h> #include <stdio.h> +#include <string.h> +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static char buf[10000]; +static long double zeroL = 0.0L; int main () { - return fopen ("conftest.sl/", "w") != NULL; + nocrash_init(); + if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%Le", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; +#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { + /* Signalling NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-Infinity. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-Zero. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Unnormalized number. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-Denormal. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } +#endif + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_fopen_slash=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_infinite_long_double=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_fopen_slash=no + gl_cv_func_printf_infinite_long_double=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - rm -f conftest.sl - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_fopen_slash" >&5 -$as_echo "$gl_cv_func_fopen_slash" >&6; } - case "$gl_cv_func_fopen_slash" in - *no) - -cat >>confdefs.h <<\_ACEOF -#define FOPEN_TRAILING_SLASH_BUG 1 -_ACEOF - - REPLACE_FOPEN=1 - - - - - - - - - M4_LIBOBJS="$M4_LIBOBJS fopen.$ac_objext" - - - - - ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite_long_double" >&5 +$as_echo "$gl_cv_func_printf_infinite_long_double" >&6; } + ;; + *) + gl_cv_func_printf_infinite_long_double="irrelevant" ;; esac - GNULIB_FOPEN=1 - - - - - - - - - - - M4_LIBOBJS="$M4_LIBOBJS fopen-safer.$ac_objext" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'a' and 'A' directives" >&5 +$as_echo_n "checking whether printf supports the 'a' and 'A' directives... " >&6; } +if test "${gl_cv_func_printf_directive_a+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + case "$host_os" in + # Guess yes on glibc >= 2.5 systems. + *-gnu*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + #include <features.h> + #ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2) + BZ2908 + #endif + #endif -cat >>confdefs.h <<\_ACEOF -#define GNULIB_FOPEN_SAFER 1 _ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "BZ2908" >/dev/null 2>&1; then + gl_cv_func_printf_directive_a="guessing yes" +else + gl_cv_func_printf_directive_a="guessing no" +fi +rm -f conftest* + ;; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_a="guessing no";; + esac - - - - - - - - - - - - - - fp_headers=' -# include <stdio.h> -# if HAVE_STDIO_EXT_H -# include <stdio_ext.h> -# endif -' - { $as_echo "$as_me:$LINENO: checking whether __fpending is declared" >&5 -$as_echo_n "checking whether __fpending is declared... " >&6; } -if test "${ac_cv_have_decl___fpending+set}" = set; then - $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$fp_headers -int -main () +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () { -#ifndef __fpending - (void) __fpending; -#endif - - ; + if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.922p+1 33") != 0 + && strcmp (buf, "0x3.244p+0 33") != 0 + && strcmp (buf, "0x6.488p-1 33") != 0 + && strcmp (buf, "0xc.91p-2 33") != 0)) + return 1; + if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "-0X1.922P+1 33") != 0 + && strcmp (buf, "-0X3.244P+0 33") != 0 + && strcmp (buf, "-0X6.488P-1 33") != 0 + && strcmp (buf, "-0XC.91P-2 33") != 0)) + return 1; + /* This catches a FreeBSD 6.1 bug: it doesn't round. */ + if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.83p+0 33") != 0 + && strcmp (buf, "0x3.05p-1 33") != 0 + && strcmp (buf, "0x6.0ap-2 33") != 0 + && strcmp (buf, "0xc.14p-3 33") != 0)) + return 1; + /* This catches a FreeBSD 6.1 bug. See + <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */ + if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0 + || buf[0] == '0') + return 1; + /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */ + if (sprintf (buf, "%.1a", 1.999) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + return 1; + /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a + glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */ + if (sprintf (buf, "%.1La", 1.999L) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + return 1; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl___fpending=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_directive_a=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl___fpending=no + gl_cv_func_printf_directive_a=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___fpending" >&5 -$as_echo "$ac_cv_have_decl___fpending" >&6; } -if test "x$ac_cv_have_decl___fpending" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL___FPENDING 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL___FPENDING 0 -_ACEOF fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_a" >&5 +$as_echo "$gl_cv_func_printf_directive_a" >&6; } - if test $ac_cv_func___fpending = no; then - { $as_echo "$as_me:$LINENO: checking how to determine the number of pending output bytes on a stream" >&5 -$as_echo_n "checking how to determine the number of pending output bytes on a stream... " >&6; } -if test "${ac_cv_sys_pending_output_n_bytes+set}" = set; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'F' directive" >&5 +$as_echo_n "checking whether printf supports the 'F' directive... " >&6; } +if test "${gl_cv_func_printf_directive_f+set}" = set; then $as_echo_n "(cached) " >&6 else - for ac_expr in \ - \ - '# glibc2' \ - 'fp->_IO_write_ptr - fp->_IO_write_base' \ - \ - '# traditional Unix' \ - 'fp->_ptr - fp->_base' \ - \ - '# BSD' \ - 'fp->_p - fp->_bf._base' \ - \ - '# SCO, Unixware' \ - '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ - \ - '# QNX' \ - '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \ - \ - '# old glibc?' \ - 'fp->__bufp - fp->__buffer' \ - \ - '# old glibc iostream?' \ - 'fp->_pptr - fp->_pbase' \ - \ - '# emx+gcc' \ - 'fp->_ptr - fp->_buffer' \ - \ - '# VMS' \ - '(*fp)->_ptr - (*fp)->_base' \ - \ - '# e.g., DGUX R4.11; the info is not available' \ - 1 \ - ; do + if test "$cross_compiling" = yes; then - # Skip each embedded comment. - case "$ac_expr" in '#'*) continue;; esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; + darwin*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";; + solaris*) gl_cv_func_printf_directive_f="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_f="guessing no";; + esac - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> -int -main () +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () { -FILE *fp = stdin; (void) ($ac_expr); - ; + if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 + || strcmp (buf, "1234567.000000 33") != 0) + return 1; + if (sprintf (buf, "%F", 1.0 / 0.0) < 0 + || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) + return 1; + /* This catches a Cygwin 1.5.x bug. */ + if (sprintf (buf, "%.F", 1234.0) < 0 + || strcmp (buf, "1234") != 0) + return 1; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - fp_done=yes - +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_directive_f=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + gl_cv_func_printf_directive_f=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - -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 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_pending_output_n_bytes" >&5 -$as_echo "$ac_cv_sys_pending_output_n_bytes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define PENDING_OUTPUT_N_BYTES $ac_cv_sys_pending_output_n_bytes -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_f" >&5 +$as_echo "$gl_cv_func_printf_directive_f" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'n' directive" >&5 +$as_echo_n "checking whether printf supports the 'n' directive... " >&6; } +if test "${gl_cv_func_printf_directive_n+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + case "$host_os" in + *) gl_cv_func_printf_directive_n="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +#include <string.h> +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 + || strcmp (buf, "123 ") != 0 + || count != 4) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_directive_n=yes +else + gl_cv_func_printf_directive_n=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi - M4_LIBOBJS="$M4_LIBOBJS fpending.$ac_objext" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_n" >&5 +$as_echo "$gl_cv_func_printf_directive_n" >&6; } - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'ls' directive" >&5 +$as_echo_n "checking whether printf supports the 'ls' directive... " >&6; } +if test "${gl_cv_func_printf_directive_ls+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + case "$host_os" in + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#include <string.h> +int main () +{ + char buf[100]; + /* Test whether %ls works at all. + This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on + Cygwin 1.5. */ + { + static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "abc") != 0) + return 1; + } + /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an + assertion failure inside libc), but not on OpenBSD 4.0. */ + { + static const wchar_t wstring[] = { 'a', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "a") != 0) + return 1; + } + /* Test whether precisions in %ls are supported as specified in ISO C 99 + section 7.19.6.1: + "If a precision is specified, no more than that many bytes are written + (including shift sequences, if any), and the array shall contain a + null wide character if, to equal the multibyte character sequence + length given by the precision, the function would need to access a + wide character one past the end of the array." + This test fails on Solaris 10. */ + { + static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%.2ls", wstring) < 0 + || strcmp (buf, "ab") != 0) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_directive_ls=yes +else + gl_cv_func_printf_directive_ls=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_ls" >&5 +$as_echo "$gl_cv_func_printf_directive_ls" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if test "${gl_cv_func_printf_positions+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac - { $as_echo "$as_me:$LINENO: checking whether fpurge is declared" >&5 -$as_echo_n "checking whether fpurge is declared... " >&6; } -if test "${ac_cv_have_decl_fpurge+set}" = set; then - $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> -int -main () +#include <stdio.h> +#include <string.h> +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () { -#ifndef fpurge - (void) fpurge; -#endif - - ; - return 0; + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fpurge=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_positions=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fpurge=no + gl_cv_func_printf_positions=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fpurge" >&5 -$as_echo "$ac_cv_have_decl_fpurge" >&6; } -if test "x$ac_cv_have_decl_fpurge" = x""yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +$as_echo "$gl_cv_func_printf_positions" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPURGE 1 -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the grouping flag" >&5 +$as_echo_n "checking whether printf supports the grouping flag... " >&6; } +if test "${gl_cv_func_printf_flag_grouping+set}" = set; then + $as_echo_n "(cached) " >&6 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPURGE 0 -_ACEOF + if test "$cross_compiling" = yes; then + + case "$host_os" in + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () +{ + if (sprintf (buf, "%'d %d", 1234567, 99) < 0 + || buf[strlen (buf) - 1] != '9') + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_flag_grouping=yes +else + gl_cv_func_printf_flag_grouping=no fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_grouping" >&5 +$as_echo "$gl_cv_func_printf_flag_grouping" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the left-adjust flag correctly" >&5 +$as_echo_n "checking whether printf supports the left-adjust flag correctly... " >&6; } +if test "${gl_cv_func_printf_flag_leftadjust+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + case "$host_os" in + # Guess yes on HP-UX 11. + hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess no on HP-UX 10 and older. + hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_printf_flag_leftadjust="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () +{ + /* Check that a '-' flag is not annihilated by a negative width. */ + if (sprintf (buf, "a%-*sc", -3, "b") < 0 + || strcmp (buf, "ab c") != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_flag_leftadjust=yes +else + gl_cv_func_printf_flag_leftadjust=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_leftadjust" >&5 +$as_echo "$gl_cv_func_printf_flag_leftadjust" >&6; } - { $as_echo "$as_me:$LINENO: checking whether frexp() can be used without linking with libm" >&5 -$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; } -if test "${gl_cv_func_frexp_no_libm+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the zero flag correctly" >&5 +$as_echo_n "checking whether printf supports the zero flag correctly... " >&6; } +if test "${gl_cv_func_printf_flag_zero+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_flag_zero="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <math.h> - double x; -int -main () + +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () { -int e; return frexp (x, &e) > 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_frexp_no_libm=yes + if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0 + || (strcmp (buf, " inf") != 0 + && strcmp (buf, " infinity") != 0)) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_flag_zero=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_frexp_no_libm=no + gl_cv_func_printf_flag_zero=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_frexp_no_libm" >&5 -$as_echo "$gl_cv_func_frexp_no_libm" >&6; } - if test $gl_cv_func_frexp_no_libm = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_zero" >&5 +$as_echo "$gl_cv_func_printf_flag_zero" >&6; } - { $as_echo "$as_me:$LINENO: checking whether frexp works" >&5 -$as_echo_n "checking whether frexp works... " >&6; } -if test "${gl_cv_func_frexp_works+set}" = set; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports large precisions" >&5 +$as_echo_n "checking whether printf supports large precisions... " >&6; } +if test "${gl_cv_func_printf_precision+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then - case "$host_os" in - netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; - *) gl_cv_func_frexp_works="guessing yes";; + + case "$host_os" in + # Guess no only on native Win32 and BeOS systems. + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + *) gl_cv_func_printf_precision="guessing yes" ;; esac else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <float.h> -#include <math.h> +#include <stdio.h> #include <string.h> -int main() +static char buf[5000]; +int main () { - int i; - volatile double x; -/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. - So we use -zero instead. */ - double zero = 0.0; - /* Test on denormalized numbers. */ - for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) - ; - if (x > 0.0) - { - int exp; - double y = frexp (x, &exp); - /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. - On NetBSD: y = 0.75. Correct: y = 0.5. */ - if (y != 0.5) - return 1; - } - /* Test on infinite numbers. */ - x = 1.0 / 0.0; - { - int exp; - double y = frexp (x, &exp); - if (y != x) - return 1; - } - /* Test on negative zero. */ - x = -zero; - { - int exp; - double y = frexp (x, &exp); - if (memcmp (&y, &x, sizeof x)) - return 1; - } +#ifdef __BEOS__ + /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ + return 1; +#endif + if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) + return 1; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_frexp_works=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_printf_precision=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_frexp_works=no + gl_cv_func_printf_precision=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_precision" >&5 +$as_echo "$gl_cv_func_printf_precision" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf survives out-of-memory conditions" >&5 +$as_echo_n "checking whether printf survives out-of-memory conditions... " >&6; } +if test "${gl_cv_func_printf_enomem+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + gl_cv_func_printf_enomem="guessing no" + if test "$cross_compiling" = no; then + if test $APPLE_UNIVERSAL_BUILD = 0; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include <stdlib.h> +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on MacOS X. */ +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <mach/thread_status.h> +#include <mach/exception.h> +#include <mach/task.h> +#include <pthread.h> +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data1024; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#else +/* Avoid a crash on POSIX systems. */ +#include <signal.h> +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif +#include <stdio.h> +#include <sys/types.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <errno.h> +int main() +{ + struct rlimit limit; + int ret; + nocrash_init (); + /* Some printf implementations allocate temporary space with malloc. */ + /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ +#ifdef RLIMIT_DATA + if (getrlimit (RLIMIT_DATA, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_DATA, &limit) < 0) + return 77; +#endif + /* On Linux systems, malloc() is limited by RLIMIT_AS. */ +#ifdef RLIMIT_AS + if (getrlimit (RLIMIT_AS, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_AS, &limit) < 0) + return 77; +#endif + /* Some printf implementations allocate temporary space on the stack. */ +#ifdef RLIMIT_STACK + if (getrlimit (RLIMIT_STACK, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_STACK, &limit) < 0) + return 77; +#endif + ret = printf ("%.5000000f", 1.0); + return !(ret == 5000002 || (ret < 0 && errno == ENOMEM)); +} +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + (./conftest + result=$? + if test $result != 0 && test $result != 77; then result=1; fi + exit $result + ) >/dev/null 2>/dev/null + case $? in + 0) gl_cv_func_printf_enomem="yes" ;; + 77) gl_cv_func_printf_enomem="guessing no" ;; + *) gl_cv_func_printf_enomem="no" ;; + esac + else + gl_cv_func_printf_enomem="guessing no" + fi + rm -fr conftest* + else + gl_cv_func_printf_enomem="guessing no" + fi + fi + if test "$gl_cv_func_printf_enomem" = "guessing no"; then + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Solaris. + solaris*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on AIX. + aix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on HP-UX/hppa. + hpux*) case "$host_cpu" in + hppa*) gl_cv_func_printf_enomem="guessing yes";; + *) gl_cv_func_printf_enomem="guessing no";; + esac + ;; + # Guess yes on IRIX. + irix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on OSF/1. + osf*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Haiku. + haiku*) gl_cv_func_printf_enomem="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_enomem="guessing no";; + esac + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_frexp_works" >&5 -$as_echo "$gl_cv_func_frexp_works" >&6; } - - case "$gl_cv_func_frexp_works" in - *yes) gl_func_frexp_no_libm=yes ;; - *) gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;; - esac - else - gl_func_frexp_no_libm=no - REPLACE_FREXP=1 - fi - if test $gl_func_frexp_no_libm = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FREXP_IN_LIBC 1 -_ACEOF - - else - - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_enomem" >&5 +$as_echo "$gl_cv_func_printf_enomem" >&6; } - M4_LIBOBJS="$M4_LIBOBJS frexp.$ac_objext" - fi - GNULIB_FREXP=1 - { $as_echo "$as_me:$LINENO: checking whether frexpl() can be used without linking with libm" >&5 -$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } -if test "${gl_cv_func_frexpl_no_libm+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ungetc works on arbitrary bytes" >&5 +$as_echo_n "checking whether ungetc works on arbitrary bytes... " >&6; } +if test "${gl_cv_func_ungetc_works+set}" = set; then $as_echo_n "(cached) " >&6 else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + gl_cv_func_ungetc_works='guessing no' +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <math.h> - long double x; + +#include <stdio.h> + int main () { -int e; return frexpl (x, &e) > 0; +FILE *f; long l; + if (!(f = fopen ("conftest.tmp", "w+"))) return 1; + if (fputs ("abc", f) < 0) return 2; + rewind (f); + if (fgetc (f) != 'a') return 3; + if (fgetc (f) != 'b') return 4; + if (ungetc ('d', f) != 'd') return 5; + if (ftell (f) != 1) return 6; + if (fgetc (f) != 'd') return 7; + if (ftell (f) != 2) return 8; + if (fseek (f, 0, SEEK_CUR) != 0) return 9; + if (ftell (f) != 2) return 10; + if (fgetc (f) != 'c') return 11; + fclose (f); remove ("conftest.tmp"); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_frexpl_no_libm=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_ungetc_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_frexpl_no_libm=no + gl_cv_func_ungetc_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_frexpl_no_libm" >&5 -$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } - if test $gl_cv_func_frexpl_no_libm = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ungetc_works" >&5 +$as_echo "$gl_cv_func_ungetc_works" >&6; } + if test "$gl_cv_func_ungetc_works" != yes; then +$as_echo "#define FUNC_UNGETC_BROKEN 1" >>confdefs.h - { $as_echo "$as_me:$LINENO: checking whether frexpl works" >&5 -$as_echo_n "checking whether frexpl works... " >&6; } -if test "${gl_cv_func_frexpl_works+set}" = set; then - $as_echo_n "(cached) " >&6 -else + fi - if test "$cross_compiling" = yes; then - case "$host_os" in - aix* | beos* | darwin* | irix* | mingw* | pw*) - gl_cv_func_frexpl_works="guessing no";; - *) gl_cv_func_frexpl_works="guessing yes";; - esac + +ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" +if test "x$ac_cv_have_decl_alarm" = x""yes; then + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + ac_have_decl=0 +fi -#include <float.h> -#include <math.h> -/* Override the values of <float.h>, like done in float.in.h. */ -#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) -# undef LDBL_MIN_EXP -# define LDBL_MIN_EXP (-16381) -#endif -extern long double frexpl (long double, int *); -int main() -{ - volatile long double x; - /* Test on finite numbers that fails on AIX 5.1. */ - x = 16.0L; - { - int exp = -9999; - frexpl (x, &exp); - if (exp != 5) - return 1; - } - /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl - function returns an invalid (incorrectly normalized) value: it returns - y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } - but the correct result is - 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ - x = 1.01L; - { - int exp = -9999; - long double y = frexpl (x, &exp); - if (!(exp == 1 && y == 0.505L)) - return 1; - } - /* Test on large finite numbers. This fails on BeOS at i = 16322, while - LDBL_MAX_EXP = 16384. - In the loop end test, we test x against Infinity, rather than comparing - i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */ - { - int i; - for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) - { - int exp = -9999; - frexpl (x, &exp); - if (exp != i) - return 1; - } - } - /* Test on denormalized numbers. */ - { - int i; - for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) - ; - if (x > 0.0L) - { - int exp; - long double y = frexpl (x, &exp); - /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, - exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */ - if (exp != LDBL_MIN_EXP - 1) - return 1; - } - } - /* Test on infinite numbers. */ - x = 1.0L / 0.0L; - { - int exp; - long double y = frexpl (x, &exp); - if (y != x) - return 1; - } - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ALARM $ac_have_decl _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_frexpl_works=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -gl_cv_func_frexpl_works=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + if false; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' +else + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_frexpl_works" >&5 -$as_echo "$gl_cv_func_frexpl_works" >&6; } - case "$gl_cv_func_frexpl_works" in - *yes) gl_func_frexpl_no_libm=yes ;; - *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; - esac - else - gl_func_frexpl_no_libm=no - REPLACE_FREXPL=1 - fi - if test $gl_func_frexpl_no_libm = yes; then + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + + + + + -cat >>confdefs.h <<\_ACEOF -#define HAVE_FREXPL_IN_LIBC 1 -_ACEOF - { $as_echo "$as_me:$LINENO: checking whether frexpl is declared" >&5 -$as_echo_n "checking whether frexpl is declared... " >&6; } -if test "${ac_cv_have_decl_frexpl+set}" = set; then + + + gl_source_base='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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 +$as_echo_n "checking for alloca as a compiler built-in... " >&6; } +if test "${gl_cv_rpl_alloca+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <math.h> -int -main () -{ -#ifndef frexpl - (void) frexpl; +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca #endif - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_frexpl=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_frexpl=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_frexpl" >&5 -$as_echo "$ac_cv_have_decl_frexpl" >&6; } -if test "x$ac_cv_have_decl_frexpl" = x""yes; then - : +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Need own alloca" >/dev/null 2>&1; then + gl_cv_rpl_alloca=yes else - HAVE_DECL_FREXPL=0 + gl_cv_rpl_alloca=no fi - - else - HAVE_DECL_FREXPL=0 - - +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 +$as_echo "$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + ALLOCA_H=alloca.h + else + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi - M4_LIBOBJS="$M4_LIBOBJS frexpl.$ac_objext" - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5 +$as_echo_n "checking whether to enable assertions... " >&6; } + # Check whether --enable-assert was given. +if test "${enable_assert+set}" = set; then + enableval=$enable_assert; if test "x$enableval" = xno; then +$as_echo "#define NDEBUG 1" >>confdefs.h +elif test "x$enableval" != xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5 +$as_echo "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;} + enable_assert=yes +fi +else + enable_assert=yes +fi - GNULIB_FREXPL=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5 +$as_echo "$enable_assert" >&6; } + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else - { $as_echo "$as_me:$LINENO: checking for fseeko" >&5 -$as_echo_n "checking for fseeko... " >&6; } -if test "${gl_cv_func_fseeko+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 +$as_echo_n "checking whether btowc(EOF) is correct... " >&6; } +if test "${gl_cv_func_btowc_eof+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac + if test $LOCALE_FR != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + +#include <locale.h> #include <stdio.h> -int -main () +#include <string.h> +#include <wchar.h> +int main () { -fseeko (stdin, 0, 0); - ; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_fseeko=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_btowc_eof=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_fseeko=no + gl_cv_func_btowc_eof=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_fseeko" >&5 -$as_echo "$gl_cv_func_fseeko" >&6; } - if test $gl_cv_func_fseeko = no; then - HAVE_FSEEKO=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 +$as_echo "$gl_cv_func_btowc_eof" >&6; } + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + WCHAR_H=wchar.h @@ -19165,99 +13288,65 @@ $as_echo "$gl_cv_func_fseeko" >&6; } - M4_LIBOBJS="$M4_LIBOBJS fseeko.$ac_objext" - REPLACE_FSEEKO=1 + M4_LIBOBJS="$M4_LIBOBJS btowc.$ac_objext" - elif test $gl_cv_var_stdin_large_offset = no; then + : + fi + GNULIB_BTOWC=1 - M4_LIBOBJS="$M4_LIBOBJS fseeko.$ac_objext" + # for STACK_DIRECTION - REPLACE_FSEEKO=1 - fi + ac_fn_c_check_decl "$LINENO" "sigaltstack" "ac_cv_have_decl_sigaltstack" "#include <signal.h> +" +if test "x$ac_cv_have_decl_sigaltstack" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SIGALTSTACK $ac_have_decl +_ACEOF - GNULIB_FSEEKO=1 + ac_fn_c_check_type "$LINENO" "stack_t" "ac_cv_type_stack_t" "#include <signal.h> +" +if test "x$ac_cv_type_stack_t" = x""yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_STACK_T 1 +_ACEOF +fi - { $as_echo "$as_me:$LINENO: checking for ftello" >&5 -$as_echo_n "checking for ftello... " >&6; } -if test "${gl_cv_func_ftello+set}" = set; then - $as_echo_n "(cached) " >&6 -else + if test "$gl_cv_lib_sigsegv" = yes \ + && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then + LIBCSTACK=$LIBSIGSEGV - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -ftello (stdin); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_ftello=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + LTLIBCSTACK=$LTLIBSIGSEGV - gl_cv_func_ftello=no -fi + fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_ftello" >&5 -$as_echo "$gl_cv_func_ftello" >&6; } - if test $gl_cv_func_ftello = no; then - HAVE_FTELLO=0 +$as_echo "#define SIGNAL_SAFE_LIST 1" >>confdefs.h @@ -19266,12 +13355,10 @@ $as_echo "$gl_cv_func_ftello" >&6; } - M4_LIBOBJS="$M4_LIBOBJS ftello.$ac_objext" - REPLACE_FTELLO=1 + M4_LIBOBJS="$M4_LIBOBJS cloexec.$ac_objext" - elif test $gl_cv_var_stdin_large_offset = no; then @@ -19281,20 +13368,18 @@ $as_echo "$gl_cv_func_ftello" >&6; } - M4_LIBOBJS="$M4_LIBOBJS ftello.$ac_objext" + M4_LIBOBJS="$M4_LIBOBJS close-stream.$ac_objext" - REPLACE_FTELLO=1 - fi + : - GNULIB_FTELLO=1 +$as_echo "#define GNULIB_CLOSE_STREAM 1" >>confdefs.h - if test -n "$GETOPT_H"; then @@ -19303,9 +13388,10 @@ $as_echo "$gl_cv_func_ftello" >&6; } + M4_LIBOBJS="$M4_LIBOBJS closein.$ac_objext" - M4_LIBOBJS="$M4_LIBOBJS getopt.$ac_objext" + : @@ -19314,15 +13400,12 @@ $as_echo "$gl_cv_func_ftello" >&6; } - M4_LIBOBJS="$M4_LIBOBJS getopt1.$ac_objext" - GETOPT_H=getopt.h + M4_LIBOBJS="$M4_LIBOBJS closeout.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define __GETOPT_PREFIX rpl_ -_ACEOF + : @@ -19332,9 +13415,9 @@ _ACEOF -fi + M4_LIBOBJS="$M4_LIBOBJS basename.$ac_objext" @@ -19344,2189 +13427,1103 @@ fi + M4_LIBOBJS="$M4_LIBOBJS dirname.$ac_objext" - { $as_echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5 -$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; } -if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/time.h> - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_func_gettimeofday_posix_signature=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - gl_cv_func_gettimeofday_posix_signature=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5 -$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; } + + M4_LIBOBJS="$M4_LIBOBJS stripslash.$ac_objext" - { $as_echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5 -$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; } -if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +$as_echo_n "checking whether // is distinct from /... " >&6; } +if test "${gl_cv_double_slash_root+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - gl_cv_func_gettimeofday_clobber=yes + 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 + # <bug-gnulib@gnu.org>. + 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 / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +$as_echo "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +$as_echo_n "checking if environ is properly declared... " >&6; } + if test "${gt_cv_var_environ_declaration+set}" = set; then + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> - #include <sys/time.h> - #include <time.h> - #include <stdlib.h> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> + extern struct { int foo; } environ; 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; - +environ.foo = 1; ; return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_gettimeofday_clobber=no -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_gettimeofday_clobber=yes -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gt_cv_var_environ_declaration=no +else + gt_cv_var_environ_declaration=yes fi - - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5 -$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; } - - if test $gl_cv_func_gettimeofday_clobber = yes; then - REPLACE_GETTIMEOFDAY=1 - SYS_TIME_H=sys/time.h + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +$as_echo "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then +$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h + fi + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + GNULIB_ENVIRON=1 - M4_LIBOBJS="$M4_LIBOBJS gettimeofday.$ac_objext" -for ac_header in sys/timeb.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_func in _ftime -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +$as_echo_n "checking for error_at_line... " >&6; } +if test "${ac_cv_lib_error_at_line+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +#include <error.h> int main () { -return $ac_func (); +error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then + ac_cv_lib_error_at_line=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + ac_cv_lib_error_at_line=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +$as_echo "$ac_cv_lib_error_at_line" >&6; } +if test $ac_cv_lib_error_at_line = no; then -fi -done -cat >>confdefs.h <<\_ACEOF -#define gmtime rpl_gmtime -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define localtime rpl_localtime -_ACEOF + M4_LIBOBJS="$M4_LIBOBJS error.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1 -_ACEOF +fi - 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 + : + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format" + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format" - M4_LIBOBJS="$M4_LIBOBJS gettimeofday.$ac_objext" -for ac_header in sys/timeb.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done + M4_LIBOBJS="$M4_LIBOBJS exitfail.$ac_objext" -for ac_func in _ftime -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ + : -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#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 + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +$as_echo_n "checking for working fcntl.h... " >&6; } +if test "${gl_cv_header_working_fcntl_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + gl_cv_header_working_fcntl_h=cross-compiling +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> + #include <fcntl.h> + #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 () { -return $ac_func (); + + 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_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_run "$LINENO"; then + gl_cv_header_working_fcntl_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + 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_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +$as_echo "$gl_cv_header_working_fcntl_h" >&6; } + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_O_NOATIME $ac_val _ACEOF -fi -done + 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 - fi - fi - # Autoconf 2.61a.99 and earlier don't support linking a file only - # in VPATH builds. But since GNUmakefile is for maintainer use - # only, it does not matter if we skip the link with older autoconf. - # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH - # builds, so use a shell variable to bypass this. - GNUmakefile=GNUmakefile - ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" - { $as_echo "$as_me:$LINENO: checking whether the compiler generally respects inline" >&5 -$as_echo_n "checking whether the compiler generally respects inline... " >&6; } -if test "${gl_cv_c_inline_effective+set}" = set; then + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5 +$as_echo_n "checking absolute name of <fcntl.h>... " >&6; } +if test "${gl_cv_next_fcntl_h+set}" = set; then $as_echo_n "(cached) " >&6 else - if test $ac_cv_c_inline = no; then - gl_cv_c_inline_effective=no - else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + if test $ac_cv_header_fcntl_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include <fcntl.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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_c_inline_effective=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/fcntl.h#{ + s#.*"\(.*/fcntl.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_fcntl_h='<'fcntl.h'>' + fi - gl_cv_c_inline_effective=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +$as_echo "$gl_cv_next_fcntl_h" >&6; } fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_c_inline_effective" >&5 -$as_echo "$gl_cv_c_inline_effective" >&6; } - if test $gl_cv_c_inline_effective = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_INLINE 1 -_ACEOF - fi + FCNTL_H='fcntl.h' - { $as_echo "$as_me:$LINENO: checking whether isnan(double) can be used without linking with libm" >&5 -$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; } -if test "${gl_cv_func_isnand_no_libm+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5 +$as_echo_n "checking whether fflush works on input streams... " >&6; } +if test "${gl_cv_func_fflush_stdin+set}" = set; then $as_echo_n "(cached) " >&6 else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + echo hello world > conftest.txt + if test "$cross_compiling" = yes; then + gl_cv_func_fflush_stdin=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <math.h> - #if __GNUC__ >= 4 - # undef isnand - # define isnand(x) __builtin_isnan ((double)(x)) - #else - # undef isnand - # define isnand(x) isnan ((double)(x)) - #endif - double x; + +#include <stdio.h> +#include <unistd.h> + int main () { -return isnand (x); +FILE *f = fopen ("conftest.txt", "r"); + char buffer[10]; + int fd; + int c; + if (f == NULL) + return 1; + fd = fileno (f); + if (fd < 0 || fread (buffer, 1, 5, f) != 5) + return 2; + /* For deterministic results, ensure f read a bigger buffer. */ + if (lseek (fd, 0, SEEK_CUR) == 5) + return 3; + /* POSIX requires fflush-fseek to set file offset of fd. This fails + on BSD systems and on mingw. */ + if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0) + return 4; + if (lseek (fd, 0, SEEK_CUR) != 5) + return 5; + /* Verify behaviour of fflush after ungetc. See + <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */ + /* Verify behaviour of fflush after a backup ungetc. This fails on + mingw. */ + c = fgetc (f); + ungetc (c, f); + fflush (f); + if (fgetc (f) != c) + return 6; + /* Verify behaviour of fflush after a non-backup ungetc. This fails + on glibc 2.8 and on BSD systems. */ + c = fgetc (f); + ungetc ('@', f); + fflush (f); + if (fgetc (f) != c) + return 7; + return 0; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_isnand_no_libm=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_fflush_stdin=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_isnand_no_libm=no + gl_cv_func_fflush_stdin=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + rm conftest.txt fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_isnand_no_libm" >&5 -$as_echo "$gl_cv_func_isnand_no_libm" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5 +$as_echo "$gl_cv_func_fflush_stdin" >&6; } + if test $gl_cv_func_fflush_stdin = no; then - if test $gl_cv_func_isnand_no_libm = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNAND_IN_LIBC 1 -_ACEOF - else + M4_LIBOBJS="$M4_LIBOBJS fflush.$ac_objext" - M4_LIBOBJS="$M4_LIBOBJS isnand.$ac_objext" - { $as_echo "$as_me:$LINENO: checking where to find the exponent in a 'double'" >&5 -$as_echo_n "checking where to find the exponent in a 'double'... " >&6; } -if test "${gl_cv_cc_double_expbit0+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined arm || defined __arm || defined __arm__ - mixed_endianness -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "mixed_endianness" >/dev/null 2>&1; then - gl_cv_cc_double_expbit0="unknown" -else + M4_LIBOBJS="$M4_LIBOBJS fseeko.$ac_objext" - : -if test "${ac_cv_c_bigendian+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; + REPLACE_FFLUSH=1 + REPLACE_FSEEKO=1 -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # Check for potential -arch flags. It is not universal unless - # there are some -arch flags. Note that *ppc* also matches - # ppc64. This check is also rather less than ideal. - case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( - *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; - esac -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + : + + fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> - #include <sys/param.h> -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif + GNULIB_FFLUSH=1 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> - #include <sys/param.h> -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <limits.h> -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <limits.h> + M4_LIBOBJS="$M4_LIBOBJS filenamecat.$ac_objext" -int -main () -{ -#ifndef _BIG_ENDIAN - not big endian - #endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then - # Try to guess by grepping values from an object file. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; + FLOAT_H= + case "$host_os" in + beos* | openbsd*) + FLOAT_H=float.h -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_float_h='<'float.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5 +$as_echo_n "checking absolute name of <float.h>... " >&6; } +if test "${gl_cv_next_float_h+set}" = set; then + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + if test $ac_cv_header_float_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> - ; - return 0; -} _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/float.h#{ + s#.*"\(.*/float.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_float_h='<'float.h'>' + fi -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +$as_echo "$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h - fi -fi -: - case $ac_cv_c_bigendian in #( - yes) - gl_cv_cc_double_expbit0="word 0 bit 20";; #( - no) - gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( - universal) -cat >>confdefs.h <<\_ACEOF -#define AC_APPLE_UNIVERSAL_BUILD 1 -_ACEOF + ;; + esac + + - ;; #( - *) - gl_cv_cc_double_expbit0="unknown" ;; - esac -fi -rm -f conftest* + case "$host_os" in + mingw* | pw*) + REPLACE_FOPEN=1 + gl_cv_func_fopen_slash="guessing no" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen recognizes a trailing slash" >&5 +$as_echo_n "checking whether fopen recognizes a trailing slash... " >&6; } +if test "${gl_cv_func_fopen_slash+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then + case "$host_os" in + solaris2.[0-9]*) gl_cv_func_fopen_slash="guessing no" ;; + hpux*) gl_cv_func_fopen_slash="guessing no" ;; + *) gl_cv_func_fopen_slash="guessing yes" ;; + esac else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <float.h> #include <stddef.h> #include <stdio.h> -#include <string.h> -#define NWORDS \ - ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { double value; unsigned int word[NWORDS]; } memory_double; -static unsigned int ored_words[NWORDS]; -static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (double x) -{ - memory_double m; - size_t i; - /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ - memset (&m, 0, sizeof (memory_double)); - m.value = x; - for (i = 0; i < NWORDS; i++) - { - ored_words[i] |= m.word[i]; - anded_words[i] &= m.word[i]; - } -} int main () { - size_t j; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - for (j = 0; j < NWORDS; j++) - anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25); - add_to_ored_words (0.5); - add_to_ored_words (1.0); - add_to_ored_words (2.0); - add_to_ored_words (4.0); - /* Remove bits that are common (e.g. if representation of the first mantissa - bit is explicit). */ - for (j = 0; j < NWORDS; j++) - ored_words[j] &= ~anded_words[j]; - /* Now find the nonzero word. */ - for (j = 0; j < NWORDS; j++) - if (ored_words[j] != 0) - break; - if (j < NWORDS) - { - size_t i; - for (i = j + 1; i < NWORDS; i++) - if (ored_words[i] != 0) - { - fprintf (fp, "unknown"); - return (fclose (fp) != 0); - } - for (i = 0; ; i++) - if ((ored_words[j] >> i) & 1) - { - fprintf (fp, "word %d bit %d", (int) j, (int) i); - return (fclose (fp) != 0); - } - } - fprintf (fp, "unknown"); - return (fclose (fp) != 0); + return fopen ("conftest.sl/", "w") != NULL; } - _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_double_expbit0=`cat conftest.out` +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_fopen_slash=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_cc_double_expbit0="unknown" + gl_cv_func_fopen_slash=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - - rm -f conftest.out + rm -f conftest.sl fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_double_expbit0" >&5 -$as_echo "$gl_cv_cc_double_expbit0" >&6; } - case "$gl_cv_cc_double_expbit0" in - word*bit*) - word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` - -cat >>confdefs.h <<_ACEOF -#define DBL_EXPBIT0_WORD $word -_ACEOF - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_slash" >&5 +$as_echo "$gl_cv_func_fopen_slash" >&6; } + ;; + esac + case "$gl_cv_func_fopen_slash" in + *no) -cat >>confdefs.h <<_ACEOF -#define DBL_EXPBIT0_BIT $bit -_ACEOF +$as_echo "#define FOPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + REPLACE_FOPEN=1 ;; esac + if test $REPLACE_FOPEN = 1; then + + + + + + + + + M4_LIBOBJS="$M4_LIBOBJS fopen.$ac_objext" + + fi - { $as_echo "$as_me:$LINENO: checking whether isnan(float) can be used without linking with libm" >&5 -$as_echo_n "checking whether isnan(float) can be used without linking with libm... " >&6; } -if test "${gl_cv_func_isnanf_no_libm+set}" = set; then - $as_echo_n "(cached) " >&6 -else + GNULIB_FOPEN=1 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> - #if __GNUC__ >= 4 - # undef isnanf - # define isnanf(x) __builtin_isnanf ((float)(x)) - #elif defined isnan - # undef isnanf - # define isnanf(x) isnan ((float)(x)) - #endif - float x; -int -main () -{ -return isnanf (x); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_isnanf_no_libm=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - gl_cv_func_isnanf_no_libm=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_isnanf_no_libm" >&5 -$as_echo "$gl_cv_func_isnanf_no_libm" >&6; } - if test $gl_cv_func_isnanf_no_libm = yes; then - { $as_echo "$as_me:$LINENO: checking whether isnan(float) works" >&5 -$as_echo_n "checking whether isnan(float) works... " >&6; } -if test "${gl_cv_func_isnanf_works+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - case "$host_os" in - irix* | solaris*) gl_cv_func_isnanf_works="guessing no";; - *) gl_cv_func_isnanf_works="guessing yes";; - esac + M4_LIBOBJS="$M4_LIBOBJS fopen-safer.$ac_objext" + + + + +$as_echo "#define GNULIB_FOPEN_SAFER 1" >>confdefs.h + + + + + + fp_headers=' +# include <stdio.h> +# if HAVE_STDIO_EXT_H +# include <stdio_ext.h> +# endif +' + ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers +" +if test "x$ac_cv_have_decl___fpending" = x""yes; then + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL___FPENDING $ac_have_decl _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> -#if __GNUC__ >= 4 -# undef isnanf -# define isnanf(x) __builtin_isnanf ((float)(x)) -#elif defined isnan -# undef isnanf -# define isnanf(x) isnan ((float)(x)) -#endif -/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ -#ifdef __DECC -static float -NaN () -{ - static float zero = 0.0f; - return zero / zero; -} -#else -# define NaN() (0.0f / 0.0f) -#endif -#define NWORDS \ - ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { unsigned int word[NWORDS]; float value; } memory_float; -int main() -{ - memory_float m; + if test $ac_cv_func___fpending = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine the number of pending output bytes on a stream" >&5 +$as_echo_n "checking how to determine the number of pending output bytes on a stream... " >&6; } +if test "${ac_cv_sys_pending_output_n_bytes+set}" = set; then + $as_echo_n "(cached) " >&6 +else - if (isnanf (1.0f / 0.0f)) - return 1; + for ac_expr in \ + \ + '# glibc2' \ + 'fp->_IO_write_ptr - fp->_IO_write_base' \ + \ + '# traditional Unix' \ + 'fp->_ptr - fp->_base' \ + \ + '# BSD' \ + 'fp->_p - fp->_bf._base' \ + \ + '# SCO, Unixware' \ + '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ + \ + '# QNX' \ + '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \ + \ + '# old glibc?' \ + 'fp->__bufp - fp->__buffer' \ + \ + '# old glibc iostream?' \ + 'fp->_pptr - fp->_pbase' \ + \ + '# emx+gcc' \ + 'fp->_ptr - fp->_buffer' \ + \ + '# VMS' \ + '(*fp)->_ptr - (*fp)->_base' \ + \ + '# e.g., DGUX R4.11; the info is not available' \ + 1 \ + ; do - if (!isnanf (NaN ())) - return 1; + # Skip each embedded comment. + case "$ac_expr" in '#'*) continue;; esac -#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT - /* The isnanf function should be immune against changes in the sign bit and - in the mantissa bits. The xor operation twiddles a bit that can only be - a sign bit or a mantissa bit. */ - if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0) - { - m.value = NaN (); - /* Set the bits below the exponent to 01111...111. */ - m.word[0] &= -1U << FLT_EXPBIT0_BIT; - m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1; - if (!isnanf (m.value)) - return 1; - } -#endif + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *fp = stdin; (void) ($ac_expr); + ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_isnanf_works=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then + fp_done=yes -( exit $ac_status ) -gl_cv_func_isnanf_works=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 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 -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_isnanf_works" >&5 -$as_echo "$gl_cv_func_isnanf_works" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_pending_output_n_bytes" >&5 +$as_echo "$ac_cv_sys_pending_output_n_bytes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define PENDING_OUTPUT_N_BYTES $ac_cv_sys_pending_output_n_bytes +_ACEOF + + + + + + + + + + M4_LIBOBJS="$M4_LIBOBJS fpending.$ac_objext" fi - if test $gl_cv_func_isnanf_no_libm = yes \ - && { case "$gl_cv_func_isnanf_works" in - *yes) true;; - *) false;; - esac - }; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNANF_IN_LIBC 1 -_ACEOF - else + ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "#include <stdio.h> +" +if test "x$ac_cv_have_decl_fpurge" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPURGE $ac_have_decl +_ACEOF - M4_LIBOBJS="$M4_LIBOBJS isnanf.$ac_objext" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5 +$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; } +if test "${gl_cv_func_frexp_no_libm+set}" = set; then + $as_echo_n "(cached) " >&6 +else - { $as_echo "$as_me:$LINENO: checking where to find the exponent in a 'float'" >&5 -$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } -if test "${gl_cv_cc_float_expbit0+set}" = set; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + double x; +int +main () +{ +int e; return frexp (x, &e) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_frexp_no_libm=yes +else + gl_cv_func_frexp_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 +$as_echo "$gl_cv_func_frexp_no_libm" >&6; } + if test $gl_cv_func_frexp_no_libm = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 +$as_echo_n "checking whether frexp works... " >&6; } +if test "${gl_cv_func_frexp_works+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then - gl_cv_cc_float_expbit0="word 0 bit 23" + case "$host_os" in + netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; + *) gl_cv_func_frexp_works="guessing yes";; + esac + else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <float.h> -#include <stddef.h> -#include <stdio.h> +#include <math.h> #include <string.h> -#define NWORDS \ - ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { float value; unsigned int word[NWORDS]; } memory_float; -static unsigned int ored_words[NWORDS]; -static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (float x) -{ - memory_float m; - size_t i; - /* Clear it first, in case - sizeof (float) < sizeof (memory_float). */ - memset (&m, 0, sizeof (memory_float)); - m.value = x; - for (i = 0; i < NWORDS; i++) - { - ored_words[i] |= m.word[i]; - anded_words[i] &= m.word[i]; - } -} -int main () +int main() { - size_t j; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - for (j = 0; j < NWORDS; j++) - anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25f); - add_to_ored_words (0.5f); - add_to_ored_words (1.0f); - add_to_ored_words (2.0f); - add_to_ored_words (4.0f); - /* Remove bits that are common (e.g. if representation of the first mantissa - bit is explicit). */ - for (j = 0; j < NWORDS; j++) - ored_words[j] &= ~anded_words[j]; - /* Now find the nonzero word. */ - for (j = 0; j < NWORDS; j++) - if (ored_words[j] != 0) - break; - if (j < NWORDS) + int i; + volatile double x; +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -zero instead. */ + double zero = 0.0; + /* Test on denormalized numbers. */ + for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) + ; + if (x > 0.0) { - size_t i; - for (i = j + 1; i < NWORDS; i++) - if (ored_words[i] != 0) - { - fprintf (fp, "unknown"); - return (fclose (fp) != 0); - } - for (i = 0; ; i++) - if ((ored_words[j] >> i) & 1) - { - fprintf (fp, "word %d bit %d", (int) j, (int) i); - return (fclose (fp) != 0); - } + int exp; + double y = frexp (x, &exp); + /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. + On NetBSD: y = 0.75. Correct: y = 0.5. */ + if (y != 0.5) + return 1; } - fprintf (fp, "unknown"); - return (fclose (fp) != 0); + /* Test on infinite numbers. */ + x = 1.0 / 0.0; + { + int exp; + double y = frexp (x, &exp); + if (y != x) + return 1; + } + /* Test on negative zero. */ + x = -zero; + { + int exp; + double y = frexp (x, &exp); + if (memcmp (&y, &x, sizeof x)) + return 1; + } + return 0; } - _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_float_expbit0=`cat conftest.out` +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_frexp_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_cc_float_expbit0="unknown" + gl_cv_func_frexp_works=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - rm -f conftest.out - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_float_expbit0" >&5 -$as_echo "$gl_cv_cc_float_expbit0" >&6; } - case "$gl_cv_cc_float_expbit0" in - word*bit*) - word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 +$as_echo "$gl_cv_func_frexp_works" >&6; } + + case "$gl_cv_func_frexp_works" in + *yes) gl_func_frexp_no_libm=yes ;; + *) gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;; + esac + else + gl_func_frexp_no_libm=no + REPLACE_FREXP=1 + fi + if test $gl_func_frexp_no_libm = yes; then + +$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h + + else + + -cat >>confdefs.h <<_ACEOF -#define FLT_EXPBIT0_WORD $word -_ACEOF -cat >>confdefs.h <<_ACEOF -#define FLT_EXPBIT0_BIT $bit -_ACEOF - ;; - esac + M4_LIBOBJS="$M4_LIBOBJS frexp.$ac_objext" + fi - { $as_echo "$as_me:$LINENO: checking whether isnan(long double) can be used without linking with libm" >&5 -$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; } -if test "${gl_cv_func_isnanl_no_libm+set}" = set; then + GNULIB_FREXP=1 + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5 +$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } +if test "${gl_cv_func_frexpl_no_libm+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <math.h> - #if __GNUC__ >= 4 - # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) - #elif defined isnan - # undef isnanl - # define isnanl(x) isnan ((long double)(x)) - #endif long double x; int main () { -return isnanl (x); +int e; return frexpl (x, &e) > 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_isnanl_no_libm=yes +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_frexpl_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_isnanl_no_libm=no + gl_cv_func_frexpl_no_libm=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_isnanl_no_libm" >&5 -$as_echo "$gl_cv_func_isnanl_no_libm" >&6; } - - gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm - if test $gl_func_isnanl_no_libm = yes; then - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 +$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } + if test $gl_cv_func_frexpl_no_libm = yes; then - { $as_echo "$as_me:$LINENO: checking whether isnanl works" >&5 -$as_echo_n "checking whether isnanl works... " >&6; } -if test "${gl_cv_func_isnanl_works+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 +$as_echo_n "checking whether frexpl works... " >&6; } +if test "${gl_cv_func_frexpl_works+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then - case "$host_cpu" in - # Guess no on ia64, x86_64, i386. - ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; - *) - case "$host_os" in - netbsd*) gl_cv_func_isnanl_works="guessing no";; - *) gl_cv_func_isnanl_works="guessing yes";; - esac - ;; + case "$host_os" in + aix* | beos* | darwin* | irix* | mingw* | pw*) + gl_cv_func_frexpl_works="guessing no";; + *) gl_cv_func_frexpl_works="guessing yes";; esac else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <float.h> -#include <limits.h> #include <math.h> -#if __GNUC__ >= 4 -# undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) -#elif defined isnan -# undef isnanl -# define isnanl(x) isnan ((long double)(x)) +/* Override the values of <float.h>, like done in float.in.h. */ +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) #endif -#define NWORDS \ - ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { unsigned int word[NWORDS]; long double value; } - memory_long_double; -int main () +extern long double frexpl (long double, int *); +int main() { - memory_long_double m; - unsigned int i; - - /* gcc-3.4.3 on IRIX 6.5 appears to have a problem with this. */ - if (!isnanl (0.0L / 0.0L)) - return 1; - - /* The isnanl function should be immune against changes in the sign bit and - in the mantissa bits. The xor operation twiddles a bit that can only be - a sign bit or a mantissa bit (since the exponent never extends to - bit 31). */ - m.value = 0.0L / 0.0L; - m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); - for (i = 0; i < NWORDS; i++) - m.word[i] |= 1; - if (!isnanl (m.value)) - return 1; - -#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) -/* Representation of an 80-bit 'long double' as an initializer for a sequence - of 'unsigned int' words. */ -# ifdef WORDS_BIGENDIAN -# define LDBL80_WORDS(exponent,manthi,mantlo) \ - { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ - (unsigned int) (mantlo) << 16 \ - } -# else -# define LDBL80_WORDS(exponent,manthi,mantlo) \ - { mantlo, manthi, exponent } -# endif - { /* Quiet NaN. */ - static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; - if (!isnanl (x.value)) - return 1; - } + volatile long double x; + /* Test on finite numbers that fails on AIX 5.1. */ + x = 16.0L; { - /* Signalling NaN. */ - static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; - if (!isnanl (x.value)) - return 1; - } - /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, - Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in - Intel IA-64 Architecture Software Developer's Manual, Volume 1: - Application Architecture. - Table 5-2 "Floating-Point Register Encodings" - Figure 5-6 "Memory to Floating-Point Register Data Translation" - */ - { /* Pseudo-NaN. */ - static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; - if (!isnanl (x.value)) + int exp = -9999; + frexpl (x, &exp); + if (exp != 5) return 1; } - { /* Pseudo-Infinity. */ - static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) + /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl + function returns an invalid (incorrectly normalized) value: it returns + y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } + but the correct result is + 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ + x = 1.01L; + { + int exp = -9999; + long double y = frexpl (x, &exp); + if (!(exp == 1 && y == 0.505L)) return 1; } - { /* Pseudo-Zero. */ - static memory_long_double x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) - return 1; + /* Test on large finite numbers. This fails on BeOS at i = 16322, while + LDBL_MAX_EXP = 16384. + In the loop end test, we test x against Infinity, rather than comparing + i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */ + { + int i; + for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) + { + int exp = -9999; + frexpl (x, &exp); + if (exp != i) + return 1; + } } - { /* Unnormalized number. */ - static memory_long_double x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; - if (!isnanl (x.value)) - return 1; + /* Test on denormalized numbers. */ + { + int i; + for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) + ; + if (x > 0.0L) + { + int exp; + long double y = frexpl (x, &exp); + /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, + exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */ + if (exp != LDBL_MIN_EXP - 1) + return 1; + } } - { /* Pseudo-Denormal. */ - static memory_long_double x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; - if (!isnanl (x.value)) + /* Test on infinite numbers. */ + x = 1.0L / 0.0L; + { + int exp; + long double y = frexpl (x, &exp); + if (y != x) return 1; } -#endif - return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_isnanl_works=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_frexpl_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_isnanl_works=no + gl_cv_func_frexpl_works=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_isnanl_works" >&5 -$as_echo "$gl_cv_func_isnanl_works" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 +$as_echo "$gl_cv_func_frexpl_works" >&6; } - case "$gl_cv_func_isnanl_works" in - *yes) ;; - *) gl_func_isnanl_no_libm=no ;; + case "$gl_cv_func_frexpl_works" in + *yes) gl_func_frexpl_no_libm=yes ;; + *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; esac + else + gl_func_frexpl_no_libm=no + REPLACE_FREXPL=1 fi - if test $gl_func_isnanl_no_libm = yes; then + if test $gl_func_frexpl_no_libm = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNANL_IN_LIBC 1 -_ACEOF +$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h + + ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h> +" +if test "x$ac_cv_have_decl_frexpl" = x""yes; then + : +else + HAVE_DECL_FREXPL=0 +fi else + HAVE_DECL_FREXPL=0 + + + + M4_LIBOBJS="$M4_LIBOBJS frexpl.$ac_objext" + + fi + + + + GNULIB_FREXPL=1 + - M4_LIBOBJS="$M4_LIBOBJS isnanl.$ac_objext" - { $as_echo "$as_me:$LINENO: checking where to find the exponent in a 'long double'" >&5 -$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } -if test "${gl_cv_cc_long_double_expbit0+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5 +$as_echo_n "checking for fseeko... " >&6; } +if test "${gl_cv_func_fseeko+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - - gl_cv_cc_long_double_expbit0="unknown" - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include <float.h> -#include <stddef.h> #include <stdio.h> -#include <string.h> -#define NWORDS \ - ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { long double value; unsigned int word[NWORDS]; } - memory_long_double; -static unsigned int ored_words[NWORDS]; -static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (long double x) -{ - memory_long_double m; - size_t i; - /* Clear it first, in case - sizeof (long double) < sizeof (memory_long_double). */ - memset (&m, 0, sizeof (memory_long_double)); - m.value = x; - for (i = 0; i < NWORDS; i++) - { - ored_words[i] |= m.word[i]; - anded_words[i] &= m.word[i]; - } -} -int main () +int +main () { - size_t j; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - for (j = 0; j < NWORDS; j++) - anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25L); - add_to_ored_words (0.5L); - add_to_ored_words (1.0L); - add_to_ored_words (2.0L); - add_to_ored_words (4.0L); - /* Remove bits that are common (e.g. if representation of the first mantissa - bit is explicit). */ - for (j = 0; j < NWORDS; j++) - ored_words[j] &= ~anded_words[j]; - /* Now find the nonzero word. */ - for (j = 0; j < NWORDS; j++) - if (ored_words[j] != 0) - break; - if (j < NWORDS) - { - size_t i; - for (i = j + 1; i < NWORDS; i++) - if (ored_words[i] != 0) - { - fprintf (fp, "unknown"); - return (fclose (fp) != 0); - } - for (i = 0; ; i++) - if ((ored_words[j] >> i) & 1) - { - fprintf (fp, "word %d bit %d", (int) j, (int) i); - return (fclose (fp) != 0); - } - } - fprintf (fp, "unknown"); - return (fclose (fp) != 0); +fseeko (stdin, 0, 0); + ; + return 0; } - _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_long_double_expbit0=`cat conftest.out` +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_fseeko=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_cc_long_double_expbit0="unknown" + gl_cv_func_fseeko=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5 +$as_echo "$gl_cv_func_fseeko" >&6; } + if test $gl_cv_func_fseeko = no; then + HAVE_FSEEKO=0 - rm -f conftest.out -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_long_double_expbit0" >&5 -$as_echo "$gl_cv_cc_long_double_expbit0" >&6; } - case "$gl_cv_cc_long_double_expbit0" in - word*bit*) - word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` -cat >>confdefs.h <<_ACEOF -#define LDBL_EXPBIT0_WORD $word -_ACEOF -cat >>confdefs.h <<_ACEOF -#define LDBL_EXPBIT0_BIT $bit -_ACEOF - ;; - esac - fi + M4_LIBOBJS="$M4_LIBOBJS fseeko.$ac_objext" + REPLACE_FSEEKO=1 + elif test $gl_cv_var_stdin_large_offset = no; then @@ -21536,449 +14533,124 @@ _ACEOF - use_additional=yes + M4_LIBOBJS="$M4_LIBOBJS fseeko.$ac_objext" - 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\" + REPLACE_FSEEKO=1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" + fi -# Check whether --with-libsigsegv-prefix was given. -if test "${with_libsigsegv_prefix+set}" = set; then - withval=$with_libsigsegv_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" + GNULIB_FSEEKO=1 - 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" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi -fi - LIBSIGSEGV= - LTLIBSIGSEGV= - INCSIGSEGV= - LIBSIGSEGV_PREFIX= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='sigsegv ' - 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" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$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 $LTLIBSIGSEGV; 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 - LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-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" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$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 - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$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 $LIBSIGSEGV; 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" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5 +$as_echo_n "checking for ftello... " >&6; } +if test "${gl_cv_func_ftello+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +ftello (stdin); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_ftello=yes +else + gl_cv_func_ftello=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5 +$as_echo "$gl_cv_func_ftello" >&6; } + if test $gl_cv_func_ftello = no; then + HAVE_FTELLO=0 + + + + + + + + + + M4_LIBOBJS="$M4_LIBOBJS ftello.$ac_objext" + + + REPLACE_FTELLO=1 + + elif test $gl_cv_var_stdin_large_offset = no; then + + + + + + + + + + M4_LIBOBJS="$M4_LIBOBJS ftello.$ac_objext" + + + REPLACE_FTELLO=1 + + fi + + + + GNULIB_FTELLO=1 + + + + + if test $ac_cv_func_getdtablesize != yes; then + HAVE_GETDTABLESIZE=0 + + + + + + + + + M4_LIBOBJS="$M4_LIBOBJS getdtablesize.$ac_objext" + + fi + + + + GNULIB_GETDTABLESIZE=1 + + + + if test -n "$GETOPT_H"; then + + + - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" - else - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" - else - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-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/"'*$,,'` - LIBSIGSEGV_PREFIX="$basedir" - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - LIBSIGSEGV_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 $INCSIGSEGV; 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 - INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-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" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBSIGSEGV; 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 - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBSIGSEGV; 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" + M4_LIBOBJS="$M4_LIBOBJS getopt.$ac_objext" - 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 - LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-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$,,'` - ;; - *) - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" - LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" - ;; - esac - done - fi - else - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" - LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-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" - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$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" - LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" - done - fi @@ -21986,110 +14658,165 @@ fi - gl_save_CPPFLAGS="$CPPFLAGS" - for element in $INCSIGSEGV; do - haveit= - for x in $CPPFLAGS; do + M4_LIBOBJS="$M4_LIBOBJS getopt1.$ac_objext" - 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 + GETOPT_H=getopt.h +$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h - { $as_echo "$as_me:$LINENO: checking for libsigsegv" >&5 -$as_echo_n "checking for libsigsegv... " >&6; } -if test "${gl_cv_lib_sigsegv+set}" = set; then + + + + + + +fi + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 +$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; } +if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then $as_echo_n "(cached) " >&6 else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/time.h> + struct timeval c; - gl_cv_lib_sigsegv="no, consider installing GNU libsigsegv" - gl_save_LIBS="$LIBS" - LIBS="$LIBS $LIBSIGSEGV" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +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 -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_func_gettimeofday_posix_signature=yes +else + gl_cv_func_gettimeofday_posix_signature=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 +$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; } +if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + gl_cv_func_gettimeofday_clobber=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sigsegv.h> +#include <string.h> + #include <sys/time.h> + #include <time.h> + #include <stdlib.h> + int main () { -sigsegv_deinstall_handler(); + + 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_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_lib_sigsegv=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_gettimeofday_clobber=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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_exeext conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 +$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; } + + if test $gl_cv_func_gettimeofday_clobber = yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + + + + + + + + + + M4_LIBOBJS="$M4_LIBOBJS gettimeofday.$ac_objext" + + + for ac_header in sys/timeb.h +do + ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIMEB_H 1 +_ACEOF + +fi + +done + + for ac_func in _ftime +do + ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime" +if test "x$ac_cv_func__ftime" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE__FTIME 1 +_ACEOF + +fi +done + + +$as_echo "#define gmtime rpl_gmtime" >>confdefs.h -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$gl_save_LIBS" +$as_echo "#define localtime rpl_localtime" >>confdefs.h -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_lib_sigsegv" >&5 -$as_echo "$gl_cv_lib_sigsegv" >&6; } - if test "$gl_cv_lib_sigsegv" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBSIGSEGV 1 -_ACEOF - { $as_echo "$as_me:$LINENO: checking how to link with libsigsegv" >&5 -$as_echo_n "checking how to link with libsigsegv... " >&6; } - { $as_echo "$as_me:$LINENO: result: $LIBSIGSEGV" >&5 -$as_echo "$LIBSIGSEGV" >&6; } - else - CPPFLAGS="$gl_save_CPPFLAGS" - LIBSIGSEGV= - LTLIBSIGSEGV= - fi +$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h + 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 @@ -22098,175 +14825,129 @@ $as_echo "$LIBSIGSEGV" >&6; } + M4_LIBOBJS="$M4_LIBOBJS gettimeofday.$ac_objext" + for ac_header in sys/timeb.h +do + ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIMEB_H 1 +_ACEOF +fi +done - LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\"" + for ac_func in _ftime +do + ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime" +if test "x$ac_cv_func__ftime" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE__FTIME 1 +_ACEOF +fi +done - if test "$gl_threads_api" = posix; then - # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the - # pthread_rwlock_* functions. - { $as_echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5 -$as_echo_n "checking for pthread_rwlock_t... " >&6; } -if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then + fi + fi + + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 +$as_echo_n "checking whether the compiler generally respects inline... " >&6; } +if test "${gl_cv_c_inline_effective+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_pthread_rwlock_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <pthread.h> - -int -main () -{ -if (sizeof (pthread_rwlock_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <pthread.h> int main () { -if (sizeof ((pthread_rwlock_t))) - return 0; +#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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_c_inline_effective=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_pthread_rwlock_t=yes + gl_cv_c_inline_effective=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 +$as_echo "$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5 -$as_echo "$ac_cv_type_pthread_rwlock_t" >&6; } -if test "x$ac_cv_type_pthread_rwlock_t" = x""yes; then +$as_echo "#define HAVE_INLINE 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define HAVE_PTHREAD_RWLOCK 1 -_ACEOF + fi -fi - # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; } +if test "${gl_cv_func_isnand_no_libm+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <pthread.h> +#include <math.h> + #if __GNUC__ >= 4 + # undef isnand + # define isnand(x) __builtin_isnan ((double)(x)) + #else + # undef isnand + # define isnand(x) isnan ((double)(x)) + #endif + double x; int main () { -#if __FreeBSD__ == 4 -error "No, in FreeBSD 4.0 recursive mutexes actually don't work." -#else -int x = (int)PTHREAD_MUTEX_RECURSIVE; -return !x; -#endif +return isnand (x); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_isnand_no_libm=yes +else + gl_cv_func_isnand_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -cat >>confdefs.h <<\_ACEOF -#define HAVE_PTHREAD_MUTEX_RECURSIVE 1 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5 +$as_echo "$gl_cv_func_isnand_no_libm" >&6; } -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test $gl_cv_func_isnand_no_libm = yes; then +$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h -fi + else -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi @@ -22274,412 +14955,492 @@ rm -f core conftest.err conftest.$ac_obj - { $as_echo "$as_me:$LINENO: checking whether lseek detects pipes" >&5 -$as_echo_n "checking whether lseek detects pipes... " >&6; } -if test "${gl_cv_func_lseek_pipe+set}" = set; then + + M4_LIBOBJS="$M4_LIBOBJS isnand.$ac_objext" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +$as_echo_n "checking where to find the exponent in a 'double'... " >&6; } +if test "${gl_cv_cc_double_expbit0+set}" = set; then $as_echo_n "(cached) " >&6 else - if test $cross_compiling = no; then - cat >conftest.$ac_ext <<_ACEOF -#include <sys/types.h> /* for off_t */ -#include <stdio.h> /* for SEEK_CUR */ -#include <unistd.h> -int main () -{ - /* Exit with success only if stdin is seekable. */ - return lseek (0, (off_t)0, SEEK_CUR) < 0; -} + if test "$cross_compiling" = yes; then + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - if test -s conftest$ac_exeext \ - && ./conftest$ac_exeext < conftest.$ac_ext \ - && { echo hi | ./conftest$ac_exeext; test $? = 1; }; then - gl_cv_func_lseek_pipe=yes - else - gl_cv_func_lseek_pipe=no - fi +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "mixed_endianness" >/dev/null 2>&1; then + gl_cv_cc_double_expbit0="unknown" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - gl_cv_func_lseek_pipe=no + : +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - else - cat >conftest.$ac_ext <<_ACEOF +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif -#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__ -/* mingw and BeOS mistakenly return 0 when trying to seek on pipes. */ - Choke me. -#endif + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_func_lseek_pipe=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif - gl_cv_func_lseek_pipe=no + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_lseek_pipe" >&5 -$as_echo "$gl_cv_func_lseek_pipe" >&6; } - if test $gl_cv_func_lseek_pipe = no; then - - - - - - - - - - M4_LIBOBJS="$M4_LIBOBJS lseek.$ac_objext" - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> - REPLACE_LSEEK=1 +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif -cat >>confdefs.h <<\_ACEOF -#define LSEEK_PIPE_BROKEN 1 + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif - fi - - - - GNULIB_LSEEK=1 - + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; -for ac_header in stdlib.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes +if ac_fn_c_try_run "$LINENO"; then + ac_cv_c_bigendian=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi - ac_header_compiler=no + fi fi +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no fi +rm -f conftest* -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_double_expbit0=`cat conftest.out` +else + gl_cv_cc_double_expbit0="unknown" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +$as_echo "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_WORD $word _ACEOF -fi -done +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_BIT $bit +_ACEOF -{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + ;; + esac + + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(float) can be used without linking with libm... " >&6; } +if test "${gl_cv_func_isnanf_no_libm+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - ac_cv_func_malloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include <stdlib.h> -#else -char *malloc (); -#endif + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + #if __GNUC__ >= 4 + # undef isnanf + # define isnanf(x) __builtin_isnanf ((float)(x)) + #elif defined isnan + # undef isnanf + # define isnanf(x) isnan ((float)(x)) + #endif + float x; int main () { -return ! malloc (0); +return isnanf (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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_isnanf_no_libm=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + gl_cv_func_isnanf_no_libm=no fi - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 0 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_no_libm" >&5 +$as_echo "$gl_cv_func_isnanf_no_libm" >&6; } + if test $gl_cv_func_isnanf_no_libm = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) works" >&5 +$as_echo_n "checking whether isnan(float) works... " >&6; } +if test "${gl_cv_func_isnanf_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + case "$host_os" in + irix* | solaris*) gl_cv_func_isnanf_works="guessing no";; + *) gl_cv_func_isnanf_works="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> +#if __GNUC__ >= 4 +# undef isnanf +# define isnanf(x) __builtin_isnanf ((float)(x)) +#elif defined isnan +# undef isnanf +# define isnanf(x) isnan ((float)(x)) +#endif +/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ +#ifdef __DECC +static float +NaN () +{ + static float zero = 0.0f; + return zero / zero; +} +#else +# define NaN() (0.0f / 0.0f) +#endif +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; float value; } memory_float; +int main() +{ + memory_float m; + if (isnanf (1.0f / 0.0f)) + return 1; - M4_LIBOBJS="$M4_LIBOBJS malloc.$ac_objext" + if (!isnanf (NaN ())) + return 1; +#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT + /* The isnanf function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit. */ + if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0) + { + m.value = NaN (); + /* Set the bits below the exponent to 01111...111. */ + m.word[0] &= -1U << FLT_EXPBIT0_BIT; + m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1; + if (!isnanf (m.value)) + return 1; + } +#endif -cat >>confdefs.h <<\_ACEOF -#define malloc rpl_malloc + return 0; +} _ACEOF - +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_isnanf_works=yes +else + gl_cv_func_isnanf_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_works" >&5 +$as_echo "$gl_cv_func_isnanf_works" >&6; } - -cat >>confdefs.h <<\_ACEOF -#define GNULIB_MALLOC_GNU 1 -_ACEOF - - - - if test $gl_cv_func_malloc_posix = yes; then - HAVE_MALLOC_POSIX=1 - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC_POSIX 1 -_ACEOF - - else - - - - - - - - - M4_LIBOBJS="$M4_LIBOBJS malloc.$ac_objext" - - HAVE_MALLOC_POSIX=0 fi + if test $gl_cv_func_isnanf_no_libm = yes \ + && { case "$gl_cv_func_isnanf_works" in + *yes) true;; + *) false;; + esac + }; then +$as_echo "#define HAVE_ISNANF_IN_LIBC 1" >>confdefs.h - - - GNULIB_MALLOC_POSIX=1 - - - - - - + else @@ -22689,600 +15450,906 @@ _ACEOF + M4_LIBOBJS="$M4_LIBOBJS isnanf.$ac_objext" - if test $gl_cv_have_include_next = yes; then - gl_cv_next_math_h='<'math.h'>' - else - { $as_echo "$as_me:$LINENO: checking absolute name of <math.h>" >&5 -$as_echo_n "checking absolute name of <math.h>... " >&6; } -if test "${gl_cv_next_math_h+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if test "${gl_cv_cc_float_expbit0+set}" = set; then $as_echo_n "(cached) " >&6 else - if test $ac_cv_header_math_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + if test "$cross_compiling" = yes; then + gl_cv_cc_float_expbit0="word 0 bit 23" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (float x) +{ + memory_float m; + size_t i; + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_float_expbit0=`cat conftest.out` +else + gl_cv_cc_float_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi -_ACEOF - gl_cv_next_math_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/math.h#{ - s#.*"\(.*/math.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_math_h='<'math.h'>' - fi + rm -f conftest.out fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_math_h" >&5 -$as_echo "$gl_cv_next_math_h" >&6; } - fi - NEXT_MATH_H=$gl_cv_next_math_h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_WORD $word +_ACEOF - { $as_echo "$as_me:$LINENO: checking whether NAN macro works" >&5 -$as_echo_n "checking whether NAN macro works... " >&6; } -if test "${gl_cv_header_math_nan_works+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> -int -main () -{ -/* Solaris 10 has a broken definition of NAN. Other platforms - fail to provide NAN, or provide it only in C99 mode; this - test only needs to fail when NAN is provided but wrong. */ - float f = 1.0f; -#ifdef NAN - f = NAN; -#endif - return f == 0; - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_BIT $bit _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_header_math_nan_works=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - gl_cv_header_math_nan_works=no -fi + ;; + esac + -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_math_nan_works" >&5 -$as_echo "$gl_cv_header_math_nan_works" >&6; } - if test $gl_cv_header_math_nan_works = no; then - REPLACE_NAN=1 fi - { $as_echo "$as_me:$LINENO: checking whether HUGE_VAL works" >&5 -$as_echo_n "checking whether HUGE_VAL works... " >&6; } -if test "${gl_cv_header_math_huge_val_works+set}" = set; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; } +if test "${gl_cv_func_isnanl_no_libm+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <math.h> + #if __GNUC__ >= 4 + # undef isnanl + # define isnanl(x) __builtin_isnanl ((long double)(x)) + #elif defined isnan + # undef isnanl + # define isnanl(x) isnan ((long double)(x)) + #endif + long double x; int main () { -/* Solaris 10 has a broken definition of HUGE_VAL. */ - double d = HUGE_VAL; - return d == 0; +return isnanl (x); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_header_math_huge_val_works=yes +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_isnanl_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_header_math_huge_val_works=no + gl_cv_func_isnanl_no_libm=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_math_huge_val_works" >&5 -$as_echo "$gl_cv_header_math_huge_val_works" >&6; } - if test $gl_cv_header_math_huge_val_works = no; then - REPLACE_HUGE_VAL=1 - fi - - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5 +$as_echo "$gl_cv_func_isnanl_no_libm" >&6; } + gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm + if test $gl_func_isnanl_no_libm = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5 +$as_echo_n "checking whether isnanl works... " >&6; } +if test "${gl_cv_func_isnanl_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; + *) + case "$host_os" in + netbsd*) gl_cv_func_isnanl_works="guessing no";; + *) gl_cv_func_isnanl_works="guessing yes";; + esac + ;; + esac -for ac_func in memchr -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ -#ifdef __STDC__ -# include <limits.h> +#include <float.h> +#include <limits.h> +#include <math.h> +#if __GNUC__ >= 4 +# undef isnanl +# define isnanl(x) __builtin_isnanl ((long double)(x)) +#elif defined isnan +# undef isnanl +# define isnanl(x) isnan ((long double)(x)) +#endif +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; long double value; } + memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} #else -# include <assert.h> +# define NaNl() (0.0L / 0.0L) #endif +int main () +{ + memory_long_double m; + unsigned int i; -#undef $ac_func + if (!isnanl (NaNl ())) + return 1; -/* 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 + /* The isnanl function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (!isnanl (m.value)) + return 1; + +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { + /* Signalling NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, + Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in + Intel IA-64 Architecture Software Developer's Manual, Volume 1: + Application Architecture. + Table 5-2 "Floating-Point Register Encodings" + Figure 5-6 "Memory to Floating-Point Register Data Translation" + */ + { /* Pseudo-NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { /* Pseudo-Infinity. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { /* Pseudo-Zero. */ + static memory_long_double x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { /* Unnormalized number. */ + static memory_long_double x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { /* Pseudo-Denormal. */ + static memory_long_double x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } #endif -int -main () -{ -return $ac_func (); - ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_isnanl_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + gl_cv_func_isnanl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 +$as_echo "$gl_cv_func_isnanl_works" >&6; } -else + case "$gl_cv_func_isnanl_works" in + *yes) ;; + *) gl_func_isnanl_no_libm=no ;; + esac + fi + if test $gl_func_isnanl_no_libm = yes; then - M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" +$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h -fi -done + else - if test $ac_cv_func_memchr = no; then -for ac_header in bp-sym.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + + + + + + M4_LIBOBJS="$M4_LIBOBJS isnanl.$ac_objext" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 +$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } +if test "${gl_cv_cc_long_double_expbit0+set}" = set; then $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi + if test "$cross_compiling" = yes; then -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } + gl_cv_cc_long_double_expbit0="unknown" -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <$ac_header> + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { long double value; unsigned int word[NWORDS]; } + memory_long_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (long double x) +{ + memory_long_double m; + size_t i; + /* Clear it first, in case + sizeof (long double) < sizeof (memory_long_double). */ + memset (&m, 0, sizeof (memory_long_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25L); + add_to_ored_words (0.5L); + add_to_ored_words (1.0L); + add_to_ored_words (2.0L); + add_to_ored_words (4.0L); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_long_double_expbit0=`cat conftest.out` else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + gl_cv_cc_long_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } + rm -f conftest.out -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5 +$as_echo "$gl_cv_cc_long_double_expbit0" >&6; } + case "$gl_cv_cc_long_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_WORD $word _ACEOF -fi -done +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac fi - if test $cross_compiling != no; then - # AC_FUNC_MEMCMP as of 2.62 defaults to 'no' when cross compiling. - # We default to yes if memcmp appears to exist, which works - # better for MinGW. - { $as_echo "$as_me:$LINENO: checking whether cross-compiling target has memcmp" >&5 -$as_echo_n "checking whether cross-compiling target has memcmp... " >&6; } -if test "${ac_cv_func_memcmp_working+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> -int -main () -{ -int ret = memcmp ("foo", "bar", 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_memcmp_working=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_memcmp_working=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 -$as_echo "$ac_cv_func_memcmp_working" >&6; } - fi - { $as_echo "$as_me:$LINENO: checking for working memcmp" >&5 -$as_echo_n "checking for working memcmp... " >&6; } -if test "${ac_cv_func_memcmp_working+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_memcmp_working=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - /* Some versions of memcmp are not 8-bit clean. */ - char c0 = '\100', c1 = '\200', c2 = '\201'; - if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) - return 1; - /* The Next x86 OpenStep bug shows up only when comparing 16 bytes - or more and with at least one buffer not starting on a 4-byte boundary. - William Lewis provided this test program. */ - { - char foo[21]; - char bar[21]; - int i; - for (i = 0; i < 4; i++) - { - char *a = foo + i; - char *b = bar + i; - strcpy (a, "--------01111111"); - strcpy (b, "--------10000000"); - if (memcmp (a, b, 16) >= 0) - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_memcmp_working=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_func_memcmp_working=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -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-libsigsegv-prefix was given. +if test "${with_libsigsegv_prefix+set}" = set; then + withval=$with_libsigsegv_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" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi + fi + fi + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 -$as_echo "$ac_cv_func_memcmp_working" >&6; } -test $ac_cv_func_memcmp_working = no && + LIBSIGSEGV= + LTLIBSIGSEGV= + INCSIGSEGV= + LIBSIGSEGV_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='sigsegv ' + 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" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$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 $LTLIBSIGSEGV; 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 + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-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" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$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 + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$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 $LIBSIGSEGV; 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 + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a" + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-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/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'sigsegv'; then + LIBSIGSEGV_PREFIX="$basedir" + fi + 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 $INCSIGSEGV; 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" - M4_LIBOBJS="$M4_LIBOBJS memcmp.$ac_objext" + 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 + INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-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" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSIGSEGV; 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 $ac_cv_func_memcmp_working = no; then + 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 + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSIGSEGV; do -cat >>confdefs.h <<\_ACEOF -#define memcmp rpl_memcmp -_ACEOF + 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 + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-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$,,'` + ;; + *) + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep" + ;; + esac + done + fi + else + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name" + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-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" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$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" + LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir" + done fi @@ -23291,120 +16358,76 @@ _ACEOF + gl_save_CPPFLAGS="$CPPFLAGS" + for element in $INCSIGSEGV; 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 -for ac_func in memset -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5 +$as_echo_n "checking for libsigsegv... " >&6; } +if test "${gl_cv_lib_sigsegv+set}" = set; then + $as_echo_n "(cached) " >&6 else - M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" + gl_cv_lib_sigsegv="no, consider installing GNU libsigsegv" + gl_save_LIBS="$LIBS" + LIBS="$LIBS $LIBSIGSEGV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sigsegv.h> +int +main () +{ +sigsegv_deinstall_handler(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then + gl_cv_lib_sigsegv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" fi -done +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_sigsegv" >&5 +$as_echo "$gl_cv_lib_sigsegv" >&6; } + if test "$gl_cv_lib_sigsegv" = yes; then +$as_echo "#define HAVE_LIBSIGSEGV 1" >>confdefs.h - if test $ac_cv_func_memset = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5 +$as_echo_n "checking how to link with libsigsegv... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5 +$as_echo "$LIBSIGSEGV" >&6; } + else + CPPFLAGS="$gl_save_CPPFLAGS" + LIBSIGSEGV= + LTLIBSIGSEGV= + fi - : - fi @@ -23416,462 +16439,306 @@ done + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\"" -for ac_func in mkdtemp -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif + if test "$gl_threads_api" = posix; then + # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the + # pthread_rwlock_* functions. + ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h> +" +if test "x$ac_cv_type_pthread_rwlock_t" = x""yes; then -#undef $ac_func +$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>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 $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 +fi + # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> int main () { -return $ac_func (); +#if __FreeBSD__ == 4 +error "No, in FreeBSD 4.0 recursive mutexes actually don't work." +#else +int x = (int)PTHREAD_MUTEX_RECURSIVE; +return !x; +#endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else +if ac_fn_c_try_compile "$LINENO"; then - M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" +$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h fi -done - - - if test $ac_cv_func_mkdtemp = no; then - HAVE_MKDTEMP=0 - : - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - GNULIB_MKDTEMP=1 - - { $as_echo "$as_me:$LINENO: checking for working mkstemp" >&5 -$as_echo_n "checking for working mkstemp... " >&6; } -if test "${gl_cv_func_working_mkstemp+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5 +$as_echo_n "checking whether lseek detects pipes... " >&6; } +if test "${gl_cv_func_lseek_pipe+set}" = set; then $as_echo_n "(cached) " >&6 else - - mkdir conftest.mkstemp - if test "$cross_compiling" = yes; then - gl_cv_func_working_mkstemp=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $cross_compiling = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -int -main () + +#include <sys/types.h> /* for off_t */ +#include <stdio.h> /* for SEEK_CUR */ +#include <unistd.h> +int main () { -int i; - off_t large = (off_t) 4294967295u; - if (large < 0) - large = 2147483647; - for (i = 0; i < 70; i++) - { - char templ[] = "conftest.mkstemp/coXXXXXX"; - int (*mkstemp_function) (char *) = mkstemp; - int fd = mkstemp_function (templ); - if (fd < 0 || lseek (fd, large, SEEK_SET) != large) - return 1; - close (fd); - } - return 0; - ; - return 0; + /* Exit with success only if stdin is seekable. */ + return lseek (0, (off_t)0, SEEK_CUR) < 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_working_mkstemp=yes +if ac_fn_c_try_link "$LINENO"; then + if test -s conftest$ac_exeext \ + && ./conftest$ac_exeext < conftest.$ac_ext \ + && { echo hi | ./conftest$ac_exeext; test $? = 1; }; then + gl_cv_func_lseek_pipe=yes + else + gl_cv_func_lseek_pipe=no + fi else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_func_lseek_pipe=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -( exit $ac_status ) -gl_cv_func_working_mkstemp=no +#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__ +/* mingw and BeOS mistakenly return 0 when trying to seek on pipes. */ + Choke me. +#endif +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_func_lseek_pipe=yes +else + gl_cv_func_lseek_pipe=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lseek_pipe" >&5 +$as_echo "$gl_cv_func_lseek_pipe" >&6; } + if test $gl_cv_func_lseek_pipe = no; then - rm -rf conftest.mkstemp - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_working_mkstemp" >&5 -$as_echo "$gl_cv_func_working_mkstemp" >&6; } - if test $gl_cv_func_working_mkstemp != yes; then - REPLACE_MKSTEMP=1 + M4_LIBOBJS="$M4_LIBOBJS lseek.$ac_objext" - M4_LIBOBJS="$M4_LIBOBJS mkstemp.$ac_objext" + REPLACE_LSEEK=1 +$as_echo "#define LSEEK_PIPE_BROKEN 1" >>confdefs.h fi - GNULIB_MKSTEMP=1 - - - - - - - - - + GNULIB_LSEEK=1 -{ $as_echo "$as_me:$LINENO: checking for obstacks" >&5 -$as_echo_n "checking for obstacks... " >&6; } -if test "${ac_cv_func_obstack+set}" = set; then + if test $ac_cv_func_lstat = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 +$as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; } +if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default - #include "obstack.h" int main () { -struct obstack mem; - #define obstack_chunk_alloc malloc - #define obstack_chunk_free free - obstack_init (&mem); - obstack_free (&mem, 0); +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_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_obstack=yes +if ac_fn_c_try_run "$LINENO"; then + ac_cv_func_lstat_dereferences_slashed_symlink=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_obstack=no + ac_cv_func_lstat_dereferences_slashed_symlink=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_obstack" >&5 -$as_echo "$ac_cv_func_obstack" >&6; } -if test $ac_cv_func_obstack = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_OBSTACK 1 -_ACEOF else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF +if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then - M4_LIBOBJS="$M4_LIBOBJS obstack.$ac_objext" - -fi - - - - case "$host_os" in - mingw* | pw*) - if test $REPLACE_OPEN != 1; then + M4_LIBOBJS="$M4_LIBOBJS lstat.$ac_objext" +fi + if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + REPLACE_LSTAT=1 + fi + # Prerequisites of lib/lstat.c. + fi - M4_LIBOBJS="$M4_LIBOBJS open.$ac_objext" + GNULIB_LSTAT=1 + for ac_header in stdlib.h +do + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF - : +fi - fi - REPLACE_OPEN=1 +done - ;; - *) - { $as_echo "$as_me:$LINENO: checking whether open recognizes a trailing slash" >&5 -$as_echo_n "checking whether open recognizes a trailing slash... " >&6; } -if test "${gl_cv_func_open_slash+set}" = set; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then $as_echo_n "(cached) " >&6 else - - if test "$cross_compiling" = yes; then - - case "$host_os" in - solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;; - hpux*) gl_cv_func_open_slash="guessing no" ;; - *) gl_cv_func_open_slash="guessing yes" ;; - esac - + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include <fcntl.h> -#if HAVE_UNISTD_H -# include <unistd.h> +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include <stdlib.h> +#else +char *malloc (); #endif -int main () + +int +main () { - return open ("conftest.sl/", O_CREAT, 0600) >= 0; +return ! malloc (0); + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_open_slash=yes +if ac_fn_c_try_run "$LINENO"; then + ac_cv_func_malloc_0_nonnull=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_open_slash=no + ac_cv_func_malloc_0_nonnull=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then - rm -f conftest.sl +$as_echo "#define HAVE_MALLOC 1" >>confdefs.h -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_open_slash" >&5 -$as_echo "$gl_cv_func_open_slash" >&6; } - case "$gl_cv_func_open_slash" in - *no) +else + $as_echo "#define HAVE_MALLOC 0" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define OPEN_TRAILING_SLASH_BUG 1 -_ACEOF - if test $REPLACE_OPEN != 1; then + M4_LIBOBJS="$M4_LIBOBJS malloc.$ac_objext" +$as_echo "#define malloc rpl_malloc" >>confdefs.h - M4_LIBOBJS="$M4_LIBOBJS open.$ac_objext" +fi - : +$as_echo "#define GNULIB_MALLOC_GNU 1" >>confdefs.h - fi - REPLACE_OPEN=1 - ;; - esac - ;; - esac + + if test $gl_cv_func_malloc_posix = yes; then + HAVE_MALLOC_POSIX=1 + +$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h + + else -cat >>confdefs.h <<\_ACEOF -#define GNULIB_OPEN 1 -_ACEOF - GNULIB_OPEN=1 + M4_LIBOBJS="$M4_LIBOBJS malloc.$ac_objext" + + HAVE_MALLOC_POSIX=0 + fi + GNULIB_MALLOC_POSIX=1 @@ -23880,725 +16747,501 @@ _ACEOF - { $as_echo "$as_me:$LINENO: checking whether frexp can be used without linking with libm" >&5 -$as_echo_n "checking whether frexp can be used without linking with libm... " >&6; } -if test "${gl_cv_func_frexp_no_libm+set}" = set; then + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_math_h='<'math.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5 +$as_echo_n "checking absolute name of <math.h>... " >&6; } +if test "${gl_cv_next_math_h+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_math_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <math.h> - double x; - int y; -int -main () -{ -return frexp (x, &y) < 1; - ; - return 0; -} + _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_frexp_no_libm=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_math_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/math.h#{ + s#.*"\(.*/math.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_math_h='<'math.h'>' + fi - gl_cv_func_frexp_no_libm=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5 +$as_echo "$gl_cv_next_math_h" >&6; } + fi + NEXT_MATH_H=$gl_cv_next_math_h -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_frexp_no_libm" >&5 -$as_echo "$gl_cv_func_frexp_no_libm" >&6; } - if test $gl_cv_func_frexp_no_libm = yes; then - { $as_echo "$as_me:$LINENO: checking whether frexp works" >&5 -$as_echo_n "checking whether frexp works... " >&6; } -if test "${gl_cv_func_frexp_works+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5 +$as_echo_n "checking whether NAN macro works... " >&6; } +if test "${gl_cv_header_math_nan_works+set}" = set; then $as_echo_n "(cached) " >&6 else - - if test "$cross_compiling" = yes; then - case "$host_os" in - netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; - *) gl_cv_func_frexp_works="guessing yes";; - esac - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include <float.h> #include <math.h> -#include <string.h> -int main() +int +main () { - int i; - volatile double x; -/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. - So we use -zero instead. */ - double zero = 0.0; - /* Test on denormalized numbers. */ - for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) - ; - if (x > 0.0) - { - int exp; - double y = frexp (x, &exp); - /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. - On NetBSD: y = 0.75. Correct: y = 0.5. */ - if (y != 0.5) - return 1; - } - /* Test on infinite numbers. */ - x = 1.0 / 0.0; - { - int exp; - double y = frexp (x, &exp); - if (y != x) - return 1; - } - /* Test on negative zero. */ - x = -zero; - { - int exp; - double y = frexp (x, &exp); - if (memcmp (&y, &x, sizeof x)) - return 1; - } +/* Solaris 10 has a broken definition of NAN. Other platforms + fail to provide NAN, or provide it only in C99 mode; this + test only needs to fail when NAN is provided but wrong. */ + float f = 1.0f; +#ifdef NAN + f = NAN; +#endif + return f == 0; + ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_frexp_works=yes +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_header_math_nan_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_frexp_works=no + gl_cv_header_math_nan_works=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_frexp_works" >&5 -$as_echo "$gl_cv_func_frexp_works" >&6; } - - case "$gl_cv_func_frexp_works" in - *yes) - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FREXP_IN_LIBC 1 -_ACEOF - - ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5 +$as_echo "$gl_cv_header_math_nan_works" >&6; } + if test $gl_cv_header_math_nan_works = no; then + REPLACE_NAN=1 fi - - { $as_echo "$as_me:$LINENO: checking whether ldexp can be used without linking with libm" >&5 -$as_echo_n "checking whether ldexp can be used without linking with libm... " >&6; } -if test "${gl_cv_func_ldexp_no_libm+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5 +$as_echo_n "checking whether HUGE_VAL works... " >&6; } +if test "${gl_cv_header_math_huge_val_works+set}" = set; then $as_echo_n "(cached) " >&6 else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <math.h> - double x; - int y; int main () { -return ldexp (x, y) < 1; +/* Solaris 10 has a broken definition of HUGE_VAL. */ + double d = HUGE_VAL; + return d == 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_ldexp_no_libm=yes +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_header_math_huge_val_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_ldexp_no_libm=no + gl_cv_header_math_huge_val_works=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5 +$as_echo "$gl_cv_header_math_huge_val_works" >&6; } + if test $gl_cv_header_math_huge_val_works = no; then + REPLACE_HUGE_VAL=1 + fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_ldexp_no_libm" >&5 -$as_echo "$gl_cv_func_ldexp_no_libm" >&6; } - if test $gl_cv_func_ldexp_no_libm = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_LDEXP_IN_LIBC 1 -_ACEOF - fi - { $as_echo "$as_me:$LINENO: checking whether frexpl can be used without linking with libm" >&5 -$as_echo_n "checking whether frexpl can be used without linking with libm... " >&6; } -if test "${gl_cv_func_frexpl_no_libm+set}" = set; then + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + case "$host_os" in + # Guess no on AIX and OSF/1. + osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <math.h> - long double x; - int y; -int -main () + +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () { -return frexpl (x, &y) < 1; - ; + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_frexpl_no_libm=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_mbrtowc_incomplete_state=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_frexpl_no_libm=no + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_frexpl_no_libm" >&5 -$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } - if test $gl_cv_func_frexpl_no_libm = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } - { $as_echo "$as_me:$LINENO: checking whether frexpl works" >&5 -$as_echo_n "checking whether frexpl works... " >&6; } -if test "${gl_cv_func_frexpl_works+set}" = set; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - case "$host_os" in - aix* | beos* | darwin* | irix* | mingw* | pw*) - gl_cv_func_frexpl_works="guessing no";; - *) gl_cv_func_frexpl_works="guessing yes";; - esac - + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <float.h> -#include <math.h> -/* Override the values of <float.h>, like done in float.in.h. */ -#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) -# undef LDBL_MIN_EXP -# define LDBL_MIN_EXP (-16381) -#endif -extern long double frexpl (long double, int *); -int main() +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () { - volatile long double x; - /* Test on finite numbers that fails on AIX 5.1. */ - x = 16.0L; - { - int exp = -9999; - frexpl (x, &exp); - if (exp != 5) - return 1; - } - /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl - function returns an invalid (incorrectly normalized) value: it returns - y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } - but the correct result is - 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ - x = 1.01L; - { - int exp = -9999; - long double y = frexpl (x, &exp); - if (!(exp == 1 && y == 0.505L)) - return 1; - } - /* Test on large finite numbers. This fails on BeOS at i = 16322, while - LDBL_MAX_EXP = 16384. - In the loop end test, we test x against Infinity, rather than comparing - i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */ - { - int i; - for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) - { - int exp = -9999; - frexpl (x, &exp); - if (exp != i) - return 1; - } - } - /* Test on denormalized numbers. */ - { - int i; - for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) - ; - if (x > 0.0L) - { - int exp; - long double y = frexpl (x, &exp); - /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, - exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */ - if (exp != LDBL_MIN_EXP - 1) - return 1; - } - } - /* Test on infinite numbers. */ - x = 1.0L / 0.0L; - { - int exp; - long double y = frexpl (x, &exp); - if (y != x) - return 1; - } + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_frexpl_works=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_mbrtowc_sanitycheck=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_frexpl_works=no + gl_cv_func_mbrtowc_sanitycheck=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_frexpl_works" >&5 -$as_echo "$gl_cv_func_frexpl_works" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } - case "$gl_cv_func_frexpl_works" in - *yes) gl_func_frexpl_no_libm=yes ;; - *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; esac else - gl_func_frexpl_no_libm=no - REPLACE_FREXPL=1 + REPLACE_MBSTATE_T=1 fi - if test $gl_func_frexpl_no_libm = yes; then + if test $REPLACE_MBSTATE_T = 1; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_FREXPL_IN_LIBC 1 -_ACEOF - { $as_echo "$as_me:$LINENO: checking whether frexpl is declared" >&5 -$as_echo_n "checking whether frexpl is declared... " >&6; } -if test "${ac_cv_have_decl_frexpl+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> + WCHAR_H=wchar.h -int -main () -{ -#ifndef frexpl - (void) frexpl; -#endif + fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_frexpl=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + fi - ac_cv_have_decl_frexpl=no -fi + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + fi + if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_frexpl" >&5 -$as_echo "$ac_cv_have_decl_frexpl" >&6; } -if test "x$ac_cv_have_decl_frexpl" = x""yes; then - : -else - HAVE_DECL_FREXPL=0 -fi - fi - { $as_echo "$as_me:$LINENO: checking whether ldexpl can be used without linking with libm" >&5 -$as_echo_n "checking whether ldexpl can be used without linking with libm... " >&6; } -if test "${gl_cv_func_ldexpl_no_libm+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test "${gl_cv_func_mbrtowc_null_arg+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> - long double x; - int y; -int -main () -{ -return ldexpl (x, y) < 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_ldexpl_no_libm=yes + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - gl_cv_func_ldexpl_no_libm=no +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_mbrtowc_null_arg=yes +else + gl_cv_func_mbrtowc_null_arg=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_ldexpl_no_libm" >&5 -$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; } - if test $gl_cv_func_ldexpl_no_libm = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg" >&5 +$as_echo "$gl_cv_func_mbrtowc_null_arg" >&6; } - { $as_echo "$as_me:$LINENO: checking whether ldexpl works" >&5 -$as_echo_n "checking whether ldexpl works... " >&6; } -if test "${gl_cv_func_ldexpl_works+set}" = set; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; } +if test "${gl_cv_func_mbrtowc_retval+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - case "$host_os" in - aix*) gl_cv_func_ldexpl_works="guessing no";; - *) gl_cv_func_ldexpl_works="guessing yes";; - esac - + case "$host_os" in + # Guess no on HP-UX and Solaris. + hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <math.h> -extern long double ldexpl (long double, int); -int main() +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () { - volatile long double x = 1.0; - volatile long double y = ldexpl (x, -1); - return (y != 0.5L); + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + return 1; + } + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + return 1; + } + } + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_ldexpl_works=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_mbrtowc_retval=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_ldexpl_works=no + gl_cv_func_mbrtowc_retval=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_ldexpl_works" >&5 -$as_echo "$gl_cv_func_ldexpl_works" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_retval" >&6; } - case "$gl_cv_func_ldexpl_works" in - *yes) -cat >>confdefs.h <<\_ACEOF -#define HAVE_LDEXPL_IN_LIBC 1 -_ACEOF - { $as_echo "$as_me:$LINENO: checking whether ldexpl is declared" >&5 -$as_echo_n "checking whether ldexpl is declared... " >&6; } -if test "${ac_cv_have_decl_ldexpl+set}" = set; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test "${gl_cv_func_mbrtowc_nul_retval+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <math.h> -int -main () +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () { -#ifndef ldexpl - (void) ldexpl; -#endif + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; - ; + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 1; + } return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_ldexpl=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_mbrtowc_nul_retval=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_ldexpl=no + gl_cv_func_mbrtowc_nul_retval=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_ldexpl" >&5 -$as_echo "$ac_cv_have_decl_ldexpl" >&6; } -if test "x$ac_cv_have_decl_ldexpl" = x""yes; then - : -else - HAVE_DECL_LDEXPL=0 + + fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } - ;; + case "$gl_cv_func_mbrtowc_null_arg" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NULL_ARG_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; esac fi + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + WCHAR_H=wchar.h @@ -24608,561 +17251,307 @@ fi - M4_LIBOBJS="$M4_LIBOBJS quotearg.$ac_objext" + M4_LIBOBJS="$M4_LIBOBJS mbrtowc.$ac_objext" + : + fi + GNULIB_MBRTOWC=1 + - { $as_echo "$as_me:$LINENO: checking for mbstate_t" >&5 -$as_echo_n "checking for mbstate_t... " >&6; } -if test "${ac_cv_type_mbstate_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -# include <wchar.h> -int -main () -{ -mbstate_t x; return sizeof x; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_mbstate_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_mbstate_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 -$as_echo "$ac_cv_type_mbstate_t" >&6; } - if test $ac_cv_type_mbstate_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBSTATE_T 1 -_ACEOF - else -cat >>confdefs.h <<\_ACEOF -#define mbstate_t int -_ACEOF - fi - { $as_echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 -$as_echo_n "checking whether mbrtowc and mbstate_t are properly declared... " >&6; } -if test "${gl_cv_func_mbrtowc+set}" = set; then + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + case "$host_os" in + # Guess no on AIX and OSF/1. + osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + +#include <locale.h> +#include <string.h> #include <wchar.h> -int -main () +int main () { -wchar_t wc; - char const s[] = ""; - size_t n = 1; - mbstate_t state; - return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); - ; + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_mbrtowc=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_mbrtowc_incomplete_state=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_mbrtowc=no + gl_cv_func_mbrtowc_incomplete_state=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc" >&5 -$as_echo "$gl_cv_func_mbrtowc" >&6; } - if test $gl_cv_func_mbrtowc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBRTOWC 1 -_ACEOF - - fi - - - - - + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } -for ac_func in raise -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then $as_echo_n "(cached) " >&6 else - 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 <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#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 + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -int -main () +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () { -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_mbrtowc_sanitycheck=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + gl_cv_func_mbrtowc_sanitycheck=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" + fi fi -done - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + if test $REPLACE_MBSTATE_T = 1; then + WCHAR_H=wchar.h + fi + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + fi + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + fi + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + WCHAR_H=wchar.h -# Check whether --with-included-regex was given. -if test "${with_included_regex+set}" = set; then - withval=$with_included_regex; -fi - case $with_included_regex in #( - yes|no) ac_use_included_regex=$with_included_regex - ;; - '') - # If the system regex support is good enough that it passes the - # following run test, then default to *not* using the included regex.c. - # If cross compiling, assume the test would fail and use the included - # regex.c. - { $as_echo "$as_me:$LINENO: checking for working re_compile_pattern" >&5 -$as_echo_n "checking for working re_compile_pattern... " >&6; } -if test "${gl_cv_func_re_compile_pattern_working+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - gl_cv_func_re_compile_pattern_working=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - #if HAVE_LOCALE_H - #include <locale.h> - #endif - #include <limits.h> - #include <regex.h> -int -main () -{ -static struct re_pattern_buffer regex; - unsigned char folded_chars[UCHAR_MAX + 1]; - int i; - const char *s; - struct re_registers regs; - #if HAVE_LOCALE_H - /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html - This test needs valgrind to catch the bug on Debian - GNU/Linux 3.1 x86, but it might catch the bug better - on other platforms and it shouldn't hurt to try the - test here. */ - if (setlocale (LC_ALL, "en_US.UTF-8")) - { - static char const pat[] = "insert into"; - static char const data[] = - "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; - re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE - | RE_ICASE); - memset (®ex, 0, sizeof regex); - s = re_compile_pattern (pat, sizeof pat - 1, ®ex); - if (s) - return 1; - if (re_search (®ex, data, sizeof data - 1, - 0, sizeof data - 1, ®s) - != -1) - return 1; - if (! setlocale (LC_ALL, "C")) - return 1; - } - #endif - /* This test is from glibc bug 3957, reported by Andrew Mackey. */ - re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("a[^x]b", 6, ®ex); - if (s) - return 1; - /* This should fail, but succeeds for glibc-2.5. */ - if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) - return 1; - /* This regular expression is from Spencer ere test number 75 - in grep-2.3. */ - re_set_syntax (RE_SYNTAX_POSIX_EGREP); - memset (®ex, 0, sizeof regex); - for (i = 0; i <= UCHAR_MAX; i++) - folded_chars[i] = i; - regex.translate = folded_chars; - s = re_compile_pattern ("a[[:]:]]b\n", 11, ®ex); - /* This should fail with _Invalid character class name_ error. */ - if (!s) - return 1; + M4_LIBOBJS="$M4_LIBOBJS mbsinit.$ac_objext" - /* This should succeed, but does not for glibc-2.1.3. */ - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("{1", 2, ®ex); - if (s) - return 1; + : - /* The following example is derived from a problem report - against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */ - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("[an\371]*n", 7, ®ex); - if (s) - return 1; + fi - /* This should match, but does not for glibc-2.2.1. */ - if (re_match (®ex, "an", 2, 0, ®s) != 2) - return 1; - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("x", 1, ®ex); - if (s) - return 1; - /* glibc-2.2.93 does not work with a negative RANGE argument. */ - if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) - return 1; + GNULIB_MBSINIT=1 - /* The version of regex.c in older versions of gnulib - ignored RE_ICASE. Detect that problem too. */ - re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("x", 1, ®ex); - if (s) - return 1; - if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) - return 1; - /* Catch a bug reported by Vin Shelton in - http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html - */ - re_set_syntax (RE_SYNTAX_POSIX_BASIC - & ~RE_CONTEXT_INVALID_DUP - & ~RE_NO_EMPTY_RANGES); - memset (®ex, 0, sizeof regex); - s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); - if (s) - return 1; - /* REG_STARTEND was added to glibc on 2004-01-15. - Reject older versions. */ - if (! REG_STARTEND) - return 1; - /* Reject hosts whose regoff_t values are too narrow. - These include glibc 2.3.5 on hosts with 64-bit ptrdiff_t - and 32-bit int. */ - if (sizeof (regoff_t) < sizeof (ptrdiff_t) - || sizeof (regoff_t) < sizeof (ssize_t)) - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_re_compile_pattern_working=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -gl_cv_func_re_compile_pattern_working=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_re_compile_pattern_working" >&5 -$as_echo "$gl_cv_func_re_compile_pattern_working" >&6; } - case $gl_cv_func_re_compile_pattern_working in #( - yes) ac_use_included_regex=no;; #( - no) ac_use_included_regex=yes;; - esac - ;; - *) { { $as_echo "$as_me:$LINENO: error: Invalid value for --with-included-regex: $with_included_regex" >&5 -$as_echo "$as_me: error: Invalid value for --with-included-regex: $with_included_regex" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - if test $ac_use_included_regex = yes; then -cat >>confdefs.h <<\_ACEOF -#define _REGEX_LARGE_OFFSETS 1 + for ac_func in mkdtemp +do + ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp" +if test "x$ac_cv_func_mkdtemp" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_MKDTEMP 1 _ACEOF +else + + M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define re_syntax_options rpl_re_syntax_options -_ACEOF +fi +done -cat >>confdefs.h <<\_ACEOF -#define re_set_syntax rpl_re_set_syntax -_ACEOF + if test $ac_cv_func_mkdtemp = no; then + HAVE_MKDTEMP=0 + : + fi -cat >>confdefs.h <<\_ACEOF -#define re_compile_pattern rpl_re_compile_pattern -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define re_compile_fastmap rpl_re_compile_fastmap -_ACEOF + GNULIB_MKDTEMP=1 -cat >>confdefs.h <<\_ACEOF -#define re_search rpl_re_search -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define re_search_2 rpl_re_search_2 -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5 +$as_echo_n "checking for working mkstemp... " >&6; } +if test "${gl_cv_func_working_mkstemp+set}" = set; then + $as_echo_n "(cached) " >&6 +else -cat >>confdefs.h <<\_ACEOF -#define re_match rpl_re_match + mkdir conftest.mkstemp + if test "$cross_compiling" = yes; then + gl_cv_func_working_mkstemp=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +int i; + off_t large = (off_t) 4294967295u; + if (large < 0) + large = 2147483647; + for (i = 0; i < 70; i++) + { + char templ[] = "conftest.mkstemp/coXXXXXX"; + int (*mkstemp_function) (char *) = mkstemp; + int fd = mkstemp_function (templ); + if (fd < 0 || lseek (fd, large, SEEK_SET) != large) + return 1; + close (fd); + } + return 0; + ; + return 0; +} _ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_working_mkstemp=yes +else + gl_cv_func_working_mkstemp=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + rm -rf conftest.mkstemp -cat >>confdefs.h <<\_ACEOF -#define re_match_2 rpl_re_match_2 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5 +$as_echo "$gl_cv_func_working_mkstemp" >&6; } + if test $gl_cv_func_working_mkstemp != yes; then + REPLACE_MKSTEMP=1 -cat >>confdefs.h <<\_ACEOF -#define re_set_registers rpl_re_set_registers -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define re_comp rpl_re_comp -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define re_exec rpl_re_exec -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define regcomp rpl_regcomp -_ACEOF + M4_LIBOBJS="$M4_LIBOBJS mkstemp.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define regexec rpl_regexec -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define regerror rpl_regerror -_ACEOF + fi -cat >>confdefs.h <<\_ACEOF -#define regfree rpl_regfree -_ACEOF + GNULIB_MKSTEMP=1 @@ -25171,164 +17560,67 @@ _ACEOF - M4_LIBOBJS="$M4_LIBOBJS regex.$ac_objext" -for ac_header in libintl.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for obstacks" >&5 +$as_echo_n "checking for obstacks... " >&6; } +if test "${ac_cv_func_obstack+set}" = set; then $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default -#include <$ac_header> + #include "obstack.h" +int +main () +{ +struct obstack mem; + #define obstack_chunk_alloc malloc + #define obstack_chunk_free free + obstack_init (&mem); + obstack_free (&mem, 0); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes +if ac_fn_c_try_link "$LINENO"; then + ac_cv_func_obstack=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no + ac_cv_func_obstack=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_obstack" >&5 +$as_echo "$ac_cv_func_obstack" >&6; } +if test $ac_cv_func_obstack = yes; then -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +$as_echo "#define HAVE_OBSTACK 1" >>confdefs.h -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + + + + + M4_LIBOBJS="$M4_LIBOBJS obstack.$ac_objext" fi -done + case "$host_os" in + mingw* | pw*) + + + if test $REPLACE_OPEN != 1; then @@ -25337,213 +17629,117 @@ done + M4_LIBOBJS="$M4_LIBOBJS open.$ac_objext" + : + fi + REPLACE_OPEN=1 - { $as_echo "$as_me:$LINENO: checking whether isblank is declared" >&5 -$as_echo_n "checking whether isblank is declared... " >&6; } -if test "${ac_cv_have_decl_isblank+set}" = set; then + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +$as_echo_n "checking whether open recognizes a trailing slash... " >&6; } +if test "${gl_cv_func_open_slash+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + if test "$cross_compiling" = yes; then + + case "$host_os" in + solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;; + hpux*) gl_cv_func_open_slash="guessing no" ;; + *) gl_cv_func_open_slash="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <ctype.h> -int -main () -{ -#ifndef isblank - (void) isblank; +#include <fcntl.h> +#if HAVE_UNISTD_H +# include <unistd.h> #endif - - ; - return 0; +int main () +{ + return open ("conftest.sl/", O_CREAT, 0600) >= 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_isblank=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_open_slash=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_isblank=no + gl_cv_func_open_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + rm -f conftest.sl + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isblank" >&5 -$as_echo "$ac_cv_have_decl_isblank" >&6; } -if test "x$ac_cv_have_decl_isblank" = x""yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +$as_echo "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISBLANK 1 -_ACEOF +$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISBLANK 0 -_ACEOF + + if test $REPLACE_OPEN != 1; then -fi + + + + M4_LIBOBJS="$M4_LIBOBJS open.$ac_objext" + + + + : + fi + REPLACE_OPEN=1 + ;; + esac + ;; + esac +$as_echo "#define GNULIB_OPEN 1" >>confdefs.h + GNULIB_OPEN=1 - if test $ac_cv_func_sigaction = yes; then - { $as_echo "$as_me:$LINENO: checking for struct sigaction.sa_sigaction" >&5 -$as_echo_n "checking for struct sigaction.sa_sigaction... " >&6; } -if test "${ac_cv_member_struct_sigaction_sa_sigaction+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> -int -main () -{ -static struct sigaction ac_aggr; -if (ac_aggr.sa_sigaction) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_sigaction_sa_sigaction=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> -int -main () -{ -static struct sigaction ac_aggr; -if (sizeof ac_aggr.sa_sigaction) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_sigaction_sa_sigaction=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_member_struct_sigaction_sa_sigaction=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_sigaction_sa_sigaction" >&5 -$as_echo "$ac_cv_member_struct_sigaction_sa_sigaction" >&6; } -if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = x""yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 -_ACEOF -fi - if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then - HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 - fi - else - HAVE_SIGACTION=0 + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + SPAWN_H='spawn.h' - M4_LIBOBJS="$M4_LIBOBJS sigaction.$ac_objext" @@ -25551,131 +17747,43 @@ fi + M4_LIBOBJS="$M4_LIBOBJS spawn_faction_addclose.$ac_objext" + fi + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1 - { $as_echo "$as_me:$LINENO: checking for siginfo_t" >&5 -$as_echo_n "checking for siginfo_t... " >&6; } -if test "${ac_cv_type_siginfo_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_siginfo_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then -#include <signal.h> + + SPAWN_H='spawn.h' -int -main () -{ -if (sizeof (siginfo_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> -int -main () -{ -if (sizeof ((siginfo_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_siginfo_t=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi + M4_LIBOBJS="$M4_LIBOBJS spawn_faction_adddup2.$ac_objext" -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_siginfo_t" >&5 -$as_echo "$ac_cv_type_siginfo_t" >&6; } -if test "x$ac_cv_type_siginfo_t" = x""yes; then + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGINFO_T 1 -_ACEOF + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 -fi - if test $ac_cv_type_siginfo_t = no; then - HAVE_SIGINFO_T=0 - fi - fi + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - GNULIB_SIGACTION=1 + SPAWN_H='spawn.h' @@ -25685,308 +17793,67 @@ fi + M4_LIBOBJS="$M4_LIBOBJS spawn_faction_addopen.$ac_objext" + fi + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1 - if test $gl_cv_have_include_next = yes; then - gl_cv_next_signal_h='<'signal.h'>' - else - { $as_echo "$as_me:$LINENO: checking absolute name of <signal.h>" >&5 -$as_echo_n "checking absolute name of <signal.h>... " >&6; } -if test "${gl_cv_next_signal_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test $ac_cv_header_signal_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 <signal.h> -_ACEOF - gl_cv_next_signal_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/signal.h#{ - s#.*"\(.*/signal.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_signal_h='<'signal.h'>' - fi -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_signal_h" >&5 -$as_echo "$gl_cv_next_signal_h" >&6; } - fi - NEXT_SIGNAL_H=$gl_cv_next_signal_h + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + SPAWN_H='spawn.h' - { $as_echo "$as_me:$LINENO: checking for signbit macro" >&5 -$as_echo_n "checking for signbit macro... " >&6; } -if test "${gl_cv_func_signbit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - gl_cv_func_signbit="guessing no" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> -/* If signbit is defined as a function, don't use it, since calling it for - 'float' or 'long double' arguments would involve conversions. - If signbit is not declared at all but exists as a library function, don't - use it, since the prototype may not match. - If signbit is not declared at all but exists as a compiler built-in, don't - use it, since it's preferable to use __builtin_signbit* (no warnings, - no conversions). */ -#ifndef signbit -# error "signbit should be a macro" -#endif -#include <string.h> -/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. - So we use -p0f and -p0d instead. */ -float p0f = 0.0f; -float m0f = -p0f; -double p0d = 0.0; -double m0d = -p0d; -/* On HP-UX 10.20, negating 0.0L does not yield -0.0L. - So we use another constant expression instead. */ -long double p0l = 0.0L; -#ifdef __hpux -long double m0l = -LDBL_MIN * LDBL_MIN; -#else -long double m0l = -p0l; -#endif -int main () -{ - { - float plus_inf = 1.0f / p0f; - float minus_inf = -1.0f / p0f; - if (!(!signbit (255.0f) - && signbit (-255.0f) - && !signbit (p0f) - && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) - && !signbit (plus_inf) - && signbit (minus_inf))) - return 1; - } - { - double plus_inf = 1.0 / p0d; - double minus_inf = -1.0 / p0d; - if (!(!signbit (255.0) - && signbit (-255.0) - && !signbit (p0d) - && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) - && !signbit (plus_inf) - && signbit (minus_inf))) - return 1; - } - { - long double plus_inf = 1.0L / p0l; - long double minus_inf = -1.0L / p0l; - if (!(!signbit (255.0L) - && signbit (-255.0L) - && !signbit (p0l) - && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)) - && !signbit (plus_inf) - && signbit (minus_inf))) - return 1; - } - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_signbit=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + M4_LIBOBJS="$M4_LIBOBJS spawn_faction_destroy.$ac_objext" -( exit $ac_status ) -gl_cv_func_signbit=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + fi + GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=1 -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_signbit" >&5 -$as_echo "$gl_cv_func_signbit" >&6; } - { $as_echo "$as_me:$LINENO: checking for signbit compiler built-ins" >&5 -$as_echo_n "checking for signbit compiler built-ins... " >&6; } -if test "${gl_cv_func_signbit_gcc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - gl_cv_func_signbit_gcc="guessing no" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if __GNUC__ >= 4 -# define signbit(x) \ - (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ - sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ - __builtin_signbitf (x)) -#else -# error "signbit should be three compiler built-ins" -#endif -#include <string.h> -/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. - So we use -p0f and -p0d instead. */ -float p0f = 0.0f; -float m0f = -p0f; -double p0d = 0.0; -double m0d = -p0d; -/* On HP-UX 10.20, negating 0.0L does not yield -0.0L. - So we use another constant expression instead. */ -long double p0l = 0.0L; -#ifdef __hpux -long double m0l = -LDBL_MIN * LDBL_MIN; -#else -long double m0l = -p0l; -#endif -int main () -{ - { - float plus_inf = 1.0f / p0f; - float minus_inf = -1.0f / p0f; - if (!(!signbit (255.0f) - && signbit (-255.0f) - && !signbit (p0f) - && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) - && !signbit (plus_inf) - && signbit (minus_inf))) - return 1; - } - { - double plus_inf = 1.0 / p0d; - double minus_inf = -1.0 / p0d; - if (!(!signbit (255.0) - && signbit (-255.0) - && !signbit (p0d) - && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) - && !signbit (plus_inf) - && signbit (minus_inf))) - return 1; - } - { - long double plus_inf = 1.0L / p0l; - long double minus_inf = -1.0L / p0l; - if (!(!signbit (255.0L) - && signbit (-255.0L) - && !signbit (p0l) - && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)) - && !signbit (plus_inf) - && signbit (minus_inf))) - return 1; - } - return 0; -} + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_signbit_gcc=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + SPAWN_H='spawn.h' -( exit $ac_status ) -gl_cv_func_signbit_gcc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_signbit_gcc" >&5 -$as_echo "$gl_cv_func_signbit_gcc" >&6; } - if test "$gl_cv_func_signbit_gcc" = yes; then - REPLACE_SIGNBIT_USING_GCC=1 - else - if test "$gl_cv_func_signbit" != yes; then - REPLACE_SIGNBIT=1 + M4_LIBOBJS="$M4_LIBOBJS spawn_faction_init.$ac_objext" + + fi + + + GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=1 + + + + + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + SPAWN_H='spawn.h' - M4_LIBOBJS="$M4_LIBOBJS signbitf.$ac_objext" @@ -25995,2336 +17862,1009 @@ $as_echo "$gl_cv_func_signbit_gcc" >&6; + M4_LIBOBJS="$M4_LIBOBJS spawnattr_destroy.$ac_objext" - M4_LIBOBJS="$M4_LIBOBJS signbitd.$ac_objext" + fi + GNULIB_POSIX_SPAWNATTR_DESTROY=1 + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + SPAWN_H='spawn.h' - M4_LIBOBJS="$M4_LIBOBJS signbitl.$ac_objext" - { $as_echo "$as_me:$LINENO: checking where to find the sign bit in a 'float'" >&5 -$as_echo_n "checking where to find the sign bit in a 'float'... " >&6; } -if test "${gl_cv_cc_float_signbit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - gl_cv_cc_float_signbit="unknown" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stddef.h> -#include <stdio.h> -#define NWORDS \ - ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { float value; unsigned int word[NWORDS]; } - memory_float; -static memory_float plus = { 1.0f }; -static memory_float minus = { -1.0f }; -int main () -{ - size_t j, k, i; - unsigned int m; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - /* Find the different bit. */ - k = 0; m = 0; - for (j = 0; j < NWORDS; j++) - { - unsigned int x = plus.word[j] ^ minus.word[j]; - if ((x & (x - 1)) || (x && m)) - { - /* More than one bit difference. */ - fprintf (fp, "unknown"); - return 1; - } - if (x) - { - k = j; - m = x; - } - } - if (m == 0) - { - /* No difference. */ - fprintf (fp, "unknown"); - return 1; - } - /* Now m = plus.word[k] ^ ~minus.word[k]. */ - if (plus.word[k] & ~minus.word[k]) - { - /* Oh? The sign bit is set in the positive and cleared in the negative - numbers? */ - fprintf (fp, "unknown"); - return 1; - } - for (i = 0; ; i++) - if ((m >> i) & 1) - break; - fprintf (fp, "word %d bit %d", (int) k, (int) i); - return (fclose (fp) != 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_float_signbit=`cat conftest.out` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + M4_LIBOBJS="$M4_LIBOBJS spawnattr_init.$ac_objext" -( exit $ac_status ) -gl_cv_cc_float_signbit="unknown" -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + fi - rm -f conftest.out + GNULIB_POSIX_SPAWNATTR_INIT=1 -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_float_signbit" >&5 -$as_echo "$gl_cv_cc_float_signbit" >&6; } - case "$gl_cv_cc_float_signbit" in - word*bit*) - word=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word.*bit //'` -cat >>confdefs.h <<_ACEOF -#define FLT_SIGNBIT_WORD $word -_ACEOF -cat >>confdefs.h <<_ACEOF -#define FLT_SIGNBIT_BIT $bit -_ACEOF + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - ;; - esac + SPAWN_H='spawn.h' - { $as_echo "$as_me:$LINENO: checking where to find the sign bit in a 'double'" >&5 -$as_echo_n "checking where to find the sign bit in a 'double'... " >&6; } -if test "${gl_cv_cc_double_signbit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - gl_cv_cc_double_signbit="unknown" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stddef.h> -#include <stdio.h> -#define NWORDS \ - ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { double value; unsigned int word[NWORDS]; } - memory_float; -static memory_float plus = { 1.0 }; -static memory_float minus = { -1.0 }; -int main () -{ - size_t j, k, i; - unsigned int m; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - /* Find the different bit. */ - k = 0; m = 0; - for (j = 0; j < NWORDS; j++) - { - unsigned int x = plus.word[j] ^ minus.word[j]; - if ((x & (x - 1)) || (x && m)) - { - /* More than one bit difference. */ - fprintf (fp, "unknown"); - return 1; - } - if (x) - { - k = j; - m = x; - } - } - if (m == 0) - { - /* No difference. */ - fprintf (fp, "unknown"); - return 1; - } - /* Now m = plus.word[k] ^ ~minus.word[k]. */ - if (plus.word[k] & ~minus.word[k]) - { - /* Oh? The sign bit is set in the positive and cleared in the negative - numbers? */ - fprintf (fp, "unknown"); - return 1; - } - for (i = 0; ; i++) - if ((m >> i) & 1) - break; - fprintf (fp, "word %d bit %d", (int) k, (int) i); - return (fclose (fp) != 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_double_signbit=`cat conftest.out` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -gl_cv_cc_double_signbit="unknown" -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + M4_LIBOBJS="$M4_LIBOBJS spawnattr_setflags.$ac_objext" + fi - rm -f conftest.out -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_double_signbit" >&5 -$as_echo "$gl_cv_cc_double_signbit" >&6; } - case "$gl_cv_cc_double_signbit" in - word*bit*) - word=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word.*bit //'` + GNULIB_POSIX_SPAWNATTR_SETFLAGS=1 -cat >>confdefs.h <<_ACEOF -#define DBL_SIGNBIT_WORD $word -_ACEOF -cat >>confdefs.h <<_ACEOF -#define DBL_SIGNBIT_BIT $bit -_ACEOF - ;; - esac + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + SPAWN_H='spawn.h' + - { $as_echo "$as_me:$LINENO: checking where to find the sign bit in a 'long double'" >&5 -$as_echo_n "checking where to find the sign bit in a 'long double'... " >&6; } -if test "${gl_cv_cc_long_double_signbit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - gl_cv_cc_long_double_signbit="unknown" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stddef.h> -#include <stdio.h> -#define NWORDS \ - ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { long double value; unsigned int word[NWORDS]; } - memory_float; -static memory_float plus = { 1.0L }; -static memory_float minus = { -1.0L }; -int main () -{ - size_t j, k, i; - unsigned int m; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - /* Find the different bit. */ - k = 0; m = 0; - for (j = 0; j < NWORDS; j++) - { - unsigned int x = plus.word[j] ^ minus.word[j]; - if ((x & (x - 1)) || (x && m)) - { - /* More than one bit difference. */ - fprintf (fp, "unknown"); - return 1; - } - if (x) - { - k = j; - m = x; - } - } - if (m == 0) - { - /* No difference. */ - fprintf (fp, "unknown"); - return 1; - } - /* Now m = plus.word[k] ^ ~minus.word[k]. */ - if (plus.word[k] & ~minus.word[k]) - { - /* Oh? The sign bit is set in the positive and cleared in the negative - numbers? */ - fprintf (fp, "unknown"); - return 1; - } - for (i = 0; ; i++) - if ((m >> i) & 1) - break; - fprintf (fp, "word %d bit %d", (int) k, (int) i); - return (fclose (fp) != 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_long_double_signbit=`cat conftest.out` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -gl_cv_cc_long_double_signbit="unknown" -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + M4_LIBOBJS="$M4_LIBOBJS spawnattr_setsigmask.$ac_objext" + fi - rm -f conftest.out -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_long_double_signbit" >&5 -$as_echo "$gl_cv_cc_long_double_signbit" >&6; } - case "$gl_cv_cc_long_double_signbit" in - word*bit*) - word=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word.*bit //'` + GNULIB_POSIX_SPAWNATTR_SETSIGMASK=1 -cat >>confdefs.h <<_ACEOF -#define LDBL_SIGNBIT_WORD $word -_ACEOF -cat >>confdefs.h <<_ACEOF -#define LDBL_SIGNBIT_BIT $bit -_ACEOF - ;; - esac + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then - if test "$gl_cv_cc_float_signbit" = unknown; then - { $as_echo "$as_me:$LINENO: checking whether copysignf is declared" >&5 -$as_echo_n "checking whether copysignf is declared... " >&6; } -if test "${ac_cv_have_decl_copysignf+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> + SPAWN_H='spawn.h' -int -main () -{ -#ifndef copysignf - (void) copysignf; -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_copysignf=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_copysignf=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_copysignf" >&5 -$as_echo "$ac_cv_have_decl_copysignf" >&6; } -if test "x$ac_cv_have_decl_copysignf" = x""yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_COPYSIGNF 1 -_ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_COPYSIGNF 0 -_ACEOF -fi + M4_LIBOBJS="$M4_LIBOBJS spawnp.$ac_objext" - if test "$ac_cv_have_decl_copysignf" = yes; then - { $as_echo "$as_me:$LINENO: checking whether copysignf can be used without linking with libm" >&5 -$as_echo_n "checking whether copysignf can be used without linking with libm... " >&6; } -if test "${gl_cv_func_copysignf_no_libm+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> - float x, y; -int -main () -{ -return copysignf (x, y) < 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_copysignf_no_libm=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - gl_cv_func_copysignf_no_libm=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_copysignf_no_libm" >&5 -$as_echo "$gl_cv_func_copysignf_no_libm" >&6; } - if test $gl_cv_func_copysignf_no_libm = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_COPYSIGNF_IN_LIBC 1 -_ACEOF - fi - fi - fi - if test "$gl_cv_cc_double_signbit" = unknown; then - { $as_echo "$as_me:$LINENO: checking whether copysign is declared" >&5 -$as_echo_n "checking whether copysign is declared... " >&6; } -if test "${ac_cv_have_decl_copysign+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <math.h> -int -main () -{ -#ifndef copysign - (void) copysign; -#endif - ; - return 0; -} + M4_LIBOBJS="$M4_LIBOBJS spawni.$ac_objext" + + for ac_header in paths.h +do + ac_fn_c_check_header_mongrel "$LINENO" "paths.h" "ac_cv_header_paths_h" "$ac_includes_default" +if test "x$ac_cv_header_paths_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_PATHS_H 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_copysign=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_copysign=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_copysign" >&5 -$as_echo "$ac_cv_have_decl_copysign" >&6; } -if test "x$ac_cv_have_decl_copysign" = x""yes; then +done -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_COPYSIGN 1 + for ac_func in confstr sched_setparam sched_setscheduler setegid seteuid vfork +do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF +fi +done -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_COPYSIGN 0 -_ACEOF + fi -fi + GNULIB_POSIX_SPAWNP=1 - if test "$ac_cv_have_decl_copysign" = yes; then - { $as_echo "$as_me:$LINENO: checking whether copysign can be used without linking with libm" >&5 -$as_echo_n "checking whether copysign can be used without linking with libm... " >&6; } -if test "${gl_cv_func_copysign_no_libm+set}" = set; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp can be used without linking with libm" >&5 +$as_echo_n "checking whether frexp can be used without linking with libm... " >&6; } +if test "${gl_cv_func_frexp_no_libm+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <math.h> - double x, y; + double x; + int y; int main () { -return copysign (x, y) < 0; +return frexp (x, &y) < 1; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_copysign_no_libm=yes +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_frexp_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_copysign_no_libm=no + gl_cv_func_frexp_no_libm=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_copysign_no_libm" >&5 -$as_echo "$gl_cv_func_copysign_no_libm" >&6; } - if test $gl_cv_func_copysign_no_libm = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 +$as_echo "$gl_cv_func_frexp_no_libm" >&6; } + if test $gl_cv_func_frexp_no_libm = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_COPYSIGN_IN_LIBC 1 -_ACEOF - fi - fi - fi - if test "$gl_cv_cc_long_double_signbit" = unknown; then - { $as_echo "$as_me:$LINENO: checking whether copysignl is declared" >&5 -$as_echo_n "checking whether copysignl is declared... " >&6; } -if test "${ac_cv_have_decl_copysignl+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 +$as_echo_n "checking whether frexp works... " >&6; } +if test "${gl_cv_func_frexp_works+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + if test "$cross_compiling" = yes; then + case "$host_os" in + netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; + *) gl_cv_func_frexp_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <math.h> -int -main () +#include <float.h> +#include <math.h> +#include <string.h> +int main() { -#ifndef copysignl - (void) copysignl; -#endif - - ; + int i; + volatile double x; +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -zero instead. */ + double zero = 0.0; + /* Test on denormalized numbers. */ + for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) + ; + if (x > 0.0) + { + int exp; + double y = frexp (x, &exp); + /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. + On NetBSD: y = 0.75. Correct: y = 0.5. */ + if (y != 0.5) + return 1; + } + /* Test on infinite numbers. */ + x = 1.0 / 0.0; + { + int exp; + double y = frexp (x, &exp); + if (y != x) + return 1; + } + /* Test on negative zero. */ + x = -zero; + { + int exp; + double y = frexp (x, &exp); + if (memcmp (&y, &x, sizeof x)) + return 1; + } return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_copysignl=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_copysignl=no +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_frexp_works=yes +else + gl_cv_func_frexp_works=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_copysignl" >&5 -$as_echo "$ac_cv_have_decl_copysignl" >&6; } -if test "x$ac_cv_have_decl_copysignl" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_COPYSIGNL 1 -_ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_COPYSIGNL 0 -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 +$as_echo "$gl_cv_func_frexp_works" >&6; } + case "$gl_cv_func_frexp_works" in + *yes) -fi +$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h + ;; + esac + fi - if test "$ac_cv_have_decl_copysignl" = yes; then - { $as_echo "$as_me:$LINENO: checking whether copysignl can be used without linking with libm" >&5 -$as_echo_n "checking whether copysignl can be used without linking with libm... " >&6; } -if test "${gl_cv_func_copysignl_no_libm+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexp can be used without linking with libm... " >&6; } +if test "${gl_cv_func_ldexp_no_libm+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <math.h> - long double x, y; + double x; + int y; int main () { -return copysignl (x, y) < 0; +return ldexp (x, y) < 1; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gl_cv_func_copysignl_no_libm=yes +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_ldexp_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_copysignl_no_libm=no + gl_cv_func_ldexp_no_libm=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_copysignl_no_libm" >&5 -$as_echo "$gl_cv_func_copysignl_no_libm" >&6; } - if test $gl_cv_func_copysignl_no_libm = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5 +$as_echo "$gl_cv_func_ldexp_no_libm" >&6; } + if test $gl_cv_func_ldexp_no_libm = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_COPYSIGNL_IN_LIBC 1 -_ACEOF +$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h - fi - fi - fi - fi fi - GNULIB_SIGNBIT=1 - - - - signals_not_posix= - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sigset_t" >/dev/null 2>&1; then - : -else - signals_not_posix=1 -fi -rm -f conftest* - - if test -z "$signals_not_posix"; then - { $as_echo "$as_me:$LINENO: checking for sigprocmask" >&5 -$as_echo_n "checking for sigprocmask... " >&6; } -if test "${ac_cv_func_sigprocmask+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl can be used without linking with libm" >&5 +$as_echo_n "checking whether frexpl can be used without linking with libm... " >&6; } +if test "${gl_cv_func_frexpl_no_libm+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define sigprocmask to an innocuous variant, in case <limits.h> declares sigprocmask. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define sigprocmask innocuous_sigprocmask - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char sigprocmask (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef sigprocmask - -/* 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 sigprocmask (); -/* 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_sigprocmask || defined __stub___sigprocmask -choke me -#endif + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + long double x; + int y; int main () { -return sigprocmask (); +return frexpl (x, &y) < 1; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_sigprocmask=yes +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_frexpl_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_sigprocmask=no + gl_cv_func_frexpl_no_libm=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_sigprocmask" >&5 -$as_echo "$ac_cv_func_sigprocmask" >&6; } -if test "x$ac_cv_func_sigprocmask" = x""yes; then - gl_cv_func_sigprocmask=1 fi - - fi - if test -z "$gl_cv_func_sigprocmask"; then - HAVE_POSIX_SIGNALBLOCKING=0 - - - - - - - - - M4_LIBOBJS="$M4_LIBOBJS sigprocmask.$ac_objext" - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 +$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } + if test $gl_cv_func_frexpl_no_libm = yes; then - { $as_echo "$as_me:$LINENO: checking for sigset_t" >&5 -$as_echo_n "checking for sigset_t... " >&6; } -if test "${ac_cv_type_sigset_t+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 +$as_echo_n "checking whether frexpl works... " >&6; } +if test "${gl_cv_func_frexpl_works+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_sigset_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> -/* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ -#include <sys/types.h> -int -main () -{ -if (sizeof (sigset_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + case "$host_os" in + aix* | beos* | darwin* | irix* | mingw* | pw*) + gl_cv_func_frexpl_works="guessing no";; + *) gl_cv_func_frexpl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <signal.h> -/* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ -#include <sys/types.h> -int -main () +#include <float.h> +#include <math.h> +/* Override the values of <float.h>, like done in float.in.h. */ +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +extern long double frexpl (long double, int *); +int main() { -if (sizeof ((sigset_t))) - return 0; - ; + volatile long double x; + /* Test on finite numbers that fails on AIX 5.1. */ + x = 16.0L; + { + int exp = -9999; + frexpl (x, &exp); + if (exp != 5) + return 1; + } + /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl + function returns an invalid (incorrectly normalized) value: it returns + y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } + but the correct result is + 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ + x = 1.01L; + { + int exp = -9999; + long double y = frexpl (x, &exp); + if (!(exp == 1 && y == 0.505L)) + return 1; + } + /* Test on large finite numbers. This fails on BeOS at i = 16322, while + LDBL_MAX_EXP = 16384. + In the loop end test, we test x against Infinity, rather than comparing + i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */ + { + int i; + for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) + { + int exp = -9999; + frexpl (x, &exp); + if (exp != i) + return 1; + } + } + /* Test on denormalized numbers. */ + { + int i; + for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) + ; + if (x > 0.0L) + { + int exp; + long double y = frexpl (x, &exp); + /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, + exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */ + if (exp != LDBL_MIN_EXP - 1) + return 1; + } + } + /* Test on infinite numbers. */ + x = 1.0L / 0.0L; + { + int exp; + long double y = frexpl (x, &exp); + if (y != x) + return 1; + } return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_frexpl_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_sigset_t=yes + gl_cv_func_frexpl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 +$as_echo "$gl_cv_func_frexpl_works" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_sigset_t" >&5 -$as_echo "$ac_cv_type_sigset_t" >&6; } -if test "x$ac_cv_type_sigset_t" = x""yes; then + case "$gl_cv_func_frexpl_works" in + *yes) gl_func_frexpl_no_libm=yes ;; + *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; + esac + else + gl_func_frexpl_no_libm=no + REPLACE_FREXPL=1 + fi + if test $gl_func_frexpl_no_libm = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGSET_T 1 -_ACEOF +$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h -gl_cv_type_sigset_t=yes + ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h> +" +if test "x$ac_cv_have_decl_frexpl" = x""yes; then + : else - gl_cv_type_sigset_t=no + HAVE_DECL_FREXPL=0 fi - if test $gl_cv_type_sigset_t != yes; then - HAVE_SIGSET_T=0 - fi - - fi - - - GNULIB_SIGPROCMASK=1 - - - -for ac_header in stdint.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexpl can be used without linking with libm... " >&6; } +if test "${gl_cv_func_ldexpl_no_libm+set}" = set; then $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include <math.h> + long double x; + int y; +int +main () +{ +return ldexpl (x, y) < 1; + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_ldexpl_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_func_ldexpl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - ac_header_compiler=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5 +$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; } + if test $gl_cv_func_ldexpl_no_libm = yes; then -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5 +$as_echo_n "checking whether ldexpl works... " >&6; } +if test "${gl_cv_func_ldexpl_works+set}" = set; then + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi + if test "$cross_compiling" = yes; then + case "$host_os" in + aix*) gl_cv_func_ldexpl_works="guessing no";; + *) gl_cv_func_ldexpl_works="guessing yes";; + esac -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +#include <math.h> +extern long double ldexpl (long double, int); +int main() +{ + volatile long double x1 = 1.0; + volatile long double y1 = ldexpl (x1, -1); + volatile long double x2 = 1.73205L; + volatile long double y2 = ldexpl (x2, 0); + return (y1 != 0.5L) || (y2 != x2); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_ldexpl_works=yes else - eval "$as_ac_Header=\$ac_header_preproc" + gl_cv_func_ldexpl_works=no fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5 +$as_echo "$gl_cv_func_ldexpl_works" >&6; } -done + case "$gl_cv_func_ldexpl_works" in + *yes) - { $as_echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 -$as_echo_n "checking for SIZE_MAX... " >&6; } - if test "${gl_cv_size_max+set}" = set; then - $as_echo_n "(cached) " >&6 +$as_echo "#define HAVE_LDEXPL_IN_LIBC 1" >>confdefs.h + + ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include <math.h> +" +if test "x$ac_cv_have_decl_ldexpl" = x""yes; then + : else + HAVE_DECL_LDEXPL=0 +fi - 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. */ + ;; + esac + fi -#include <limits.h> -#if HAVE_STDINT_H -#include <stdint.h> -#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 <stddef.h> -#include <limits.h> -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stddef.h> -#include <limits.h> -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stddef.h> -#include <limits.h> -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stddef.h> -#include <limits.h> -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} + + M4_LIBOBJS="$M4_LIBOBJS quotearg.$ac_objext" + + + + + + + + + + + + + + + for ac_func in rawmemchr +do + ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" +if test "x$ac_cv_func_rawmemchr" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_RAWMEMCHR 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" + fi +done -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= -fi + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + : + fi + + + + GNULIB_RAWMEMCHR=1 -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 <stddef.h> -#include <limits.h> -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` + +# Check whether --with-included-regex was given. +if test "${with_included_regex+set}" = set; then + withval=$with_included_regex; 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 + + case $with_included_regex in #( + yes|no) ac_use_included_regex=$with_included_regex + ;; + '') + # If the system regex support is good enough that it passes the + # following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 +$as_echo_n "checking for working re_compile_pattern... " >&6; } +if test "${gl_cv_func_re_compile_pattern_working+set}" = set; then + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + gl_cv_func_re_compile_pattern_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stddef.h> -#include <limits.h> -static long int longval () { return sizeof (size_t) * CHAR_BIT - 1; } -static unsigned long int ulongval () { return sizeof (size_t) * CHAR_BIT - 1; } -#include <stdio.h> -#include <stdlib.h> +$ac_includes_default + #if HAVE_LOCALE_H + #include <locale.h> + #endif + #include <limits.h> + #include <regex.h> + int main () { +static struct re_pattern_buffer regex; + unsigned char folded_chars[UCHAR_MAX + 1]; + int i; + const char *s; + struct re_registers regs; - 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", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (sizeof (size_t) * CHAR_BIT - 1)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; + #if HAVE_LOCALE_H + /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html + This test needs valgrind to catch the bug on Debian + GNU/Linux 3.1 x86, but it might catch the bug better + on other platforms and it shouldn't hurt to try the + test here. */ + if (setlocale (LC_ALL, "en_US.UTF-8")) + { + static char const pat[] = "insert into"; + static char const data[] = + "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE + | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern (pat, sizeof pat - 1, ®ex); + if (s) + return 1; + if (re_search (®ex, data, sizeof data - 1, + 0, sizeof data - 1, ®s) + != -1) + return 1; + if (! setlocale (LC_ALL, "C")) + return 1; + } + #endif - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - size_t_bits_minus_1=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + /* This test is from glibc bug 3957, reported by Andrew Mackey. */ + re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[^x]b", 6, ®ex); + if (s) + return 1; -( exit $ac_status ) -size_t_bits_minus_1= -fi -rm -rf conftest.dSYM -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 <stddef.h> -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; -test_array [0] = 0 + /* This should fail, but succeeds for glibc-2.5. */ + if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) + return 1; + + /* This regular expression is from Spencer ere test number 75 + in grep-2.3. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + for (i = 0; i <= UCHAR_MAX; i++) + folded_chars[i] = i; + regex.translate = folded_chars; + s = re_compile_pattern ("a[[:]:]]b\n", 11, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + return 1; + + /* This should succeed, but does not for glibc-2.1.3. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("{1", 2, ®ex); + + if (s) + return 1; + + /* The following example is derived from a problem report + against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */ + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[an\371]*n", 7, ®ex); + if (s) + return 1; + + /* This should match, but does not for glibc-2.2.1. */ + if (re_match (®ex, "an", 2, 0, ®s) != 2) + return 1; + + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + return 1; + + /* glibc-2.2.93 does not work with a negative RANGE argument. */ + if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + return 1; + + /* The version of regex.c in older versions of gnulib + ignored RE_ICASE. Detect that problem too. */ + re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + return 1; + + if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) + return 1; + + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + return 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stddef.h> -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; -test_array [0] = 0 + /* REG_STARTEND was added to glibc on 2004-01-15. + Reject older versions. */ + if (! REG_STARTEND) + return 1; + + /* Reject hosts whose regoff_t values are too narrow. + These include glibc 2.3.5 on hosts with 64-bit ptrdiff_t + and 32-bit int. */ + if (sizeof (regoff_t) < sizeof (ptrdiff_t) + || sizeof (regoff_t) < sizeof (ssize_t)) + return 1; + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_re_compile_pattern_working=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_func_re_compile_pattern_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi - 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 +$as_echo "$gl_cv_func_re_compile_pattern_working" >&6; } + case $gl_cv_func_re_compile_pattern_working in #( + yes) ac_use_included_regex=no;; #( + no) ac_use_included_regex=yes;; + esac + ;; + *) as_fn_error "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 + ;; + esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test $ac_use_included_regex = 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 <stddef.h> -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; -test_array [0] = 0 +$as_echo "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stddef.h> -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi +$as_echo "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h -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 <stddef.h> -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h - 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 <stddef.h> -static long int longval () { return sizeof (size_t) <= sizeof (unsigned int); } -static unsigned long int ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } -#include <stdio.h> -#include <stdlib.h> -int -main () -{ +$as_echo "#define re_search rpl_re_search" >>confdefs.h - 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", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (sizeof (size_t) <= sizeof (unsigned int))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - fits_in_uint=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define re_search_2 rpl_re_search_2" >>confdefs.h + + +$as_echo "#define re_match rpl_re_match" >>confdefs.h + + +$as_echo "#define re_match_2 rpl_re_match_2" >>confdefs.h + + +$as_echo "#define re_set_registers rpl_re_set_registers" >>confdefs.h + + +$as_echo "#define re_comp rpl_re_comp" >>confdefs.h + + +$as_echo "#define re_exec rpl_re_exec" >>confdefs.h + + +$as_echo "#define regcomp rpl_regcomp" >>confdefs.h + + +$as_echo "#define regexec rpl_regexec" >>confdefs.h + + +$as_echo "#define regerror rpl_regerror" >>confdefs.h + + +$as_echo "#define regfree rpl_regfree" >>confdefs.h -( exit $ac_status ) -fits_in_uint= -fi -rm -rf conftest.dSYM -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 <stddef.h> - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - fits_in_uint=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $fits_in_uint = 1; then - gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" - else - gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" - fi - else - gl_cv_size_max='((size_t)~(size_t)0)' - fi - fi -fi - { $as_echo "$as_me:$LINENO: result: $gl_cv_size_max" >&5 -$as_echo "$gl_cv_size_max" >&6; } - if test "$gl_cv_size_max" != yes; then -cat >>confdefs.h <<_ACEOF -#define SIZE_MAX $gl_cv_size_max -_ACEOF + M4_LIBOBJS="$M4_LIBOBJS regex.$ac_objext" - fi - gl_cv_func_snprintf_usable=no -for ac_func in snprintf + for ac_header in libintl.h do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBINTL_H 1 +_ACEOF + +fi + +done + + + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> +" +if test "x$ac_cv_have_decl_isblank" = x""yes; then + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISBLANK $ac_have_decl _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif + fi -#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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <sched.h> + struct sched_param a; + int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER }; int main () { -return $ac_func (); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_compile "$LINENO"; then + SCHED_H='' else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + SCHED_H='sched.h' - eval "$as_ac_var=no" -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -fi -done - if test $ac_cv_func_snprintf = yes; then - { $as_echo "$as_me:$LINENO: checking whether snprintf respects a size of 1" >&5 -$as_echo_n "checking whether snprintf respects a size of 1... " >&6; } -if test "${gl_cv_func_snprintf_size1+set}" = set; then + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sched_h='<'sched.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sched.h>" >&5 +$as_echo_n "checking absolute name of <sched.h>... " >&6; } +if test "${gl_cv_next_sched_h+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - gl_cv_func_snprintf_size1="guessing yes" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_sched_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include <sched.h> -#include <stdio.h> -int main() -{ - static char buf[8] = "DEADBEEF"; - snprintf (buf, 1, "%d", 12345); - return buf[1] != 'E'; -} _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_snprintf_size1=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sched_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sched.h#{ + s#.*"\(.*/sched.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sched_h='<'sched.h'>' + fi -( exit $ac_status ) -gl_cv_func_snprintf_size1=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sched_h" >&5 +$as_echo "$gl_cv_next_sched_h" >&6; } + fi + NEXT_SCHED_H=$gl_cv_next_sched_h -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_snprintf_size1" >&5 -$as_echo "$gl_cv_func_snprintf_size1" >&6; } - case "$gl_cv_func_snprintf_size1" in - *yes) - gl_cv_func_snprintf_usable=yes - ;; - esac - fi - if test $gl_cv_func_snprintf_usable = no; then + if test $ac_cv_header_sched_h = yes; then + HAVE_SCHED_H=1 + else + HAVE_SCHED_H=0 + fi + ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include <sched.h> +" +if test "x$ac_cv_type_struct_sched_param" = x""yes; then + HAVE_STRUCT_SCHED_PARAM=1 +else + HAVE_STRUCT_SCHED_PARAM=0 +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - M4_LIBOBJS="$M4_LIBOBJS snprintf.$ac_objext" - if test $ac_cv_func_snprintf = yes; then - REPLACE_SNPRINTF=1 - fi - : + if test $ac_cv_func_sigaction = yes; then + ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h> +" +if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = x""yes; then - fi +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 +_ACEOF +fi + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 - if test $ac_cv_have_decl_snprintf = no; then - HAVE_DECL_SNPRINTF=0 - fi - GNULIB_SNPRINTF=1 - { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 -$as_echo_n "checking for ssize_t... " >&6; } -if test "${gt_cv_ssize_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> -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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gt_cv_ssize_t=yes -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 -$as_echo "$gt_cv_ssize_t" >&6; } - if test $gt_cv_ssize_t = no; then + M4_LIBOBJS="$M4_LIBOBJS sigaction.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define ssize_t int -_ACEOF - fi - STDARG_H=''; - NEXT_STDARG_H='<stdarg.h>'; - { $as_echo "$as_me:$LINENO: checking for va_copy" >&5 -$as_echo_n "checking for va_copy... " >&6; } - if test "${gl_cv_func_va_copy+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdarg.h> -int -main () -{ -#ifndef va_copy -void (*func) (va_list, va_list) = va_copy; -#endif - ; - return 0; -} + ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_siginfo_t" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_func_va_copy=yes -else - $as_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 - { $as_echo "$as_me:$LINENO: result: $gl_cv_func_va_copy" >&5 -$as_echo "$gl_cv_func_va_copy" >&6; } - if test $gl_cv_func_va_copy = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined _AIX && !defined __GNUC__ - AIX vaccine - #endif + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi + + fi -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "vaccine" >/dev/null 2>&1; then - gl_aixcc=yes -else - gl_aixcc=no -fi -rm -f conftest* - if test $gl_aixcc = yes; then - STDARG_H=stdarg.h + GNULIB_SIGACTION=1 @@ -28335,168 +18875,272 @@ rm -f conftest* if test $gl_cv_have_include_next = yes; then - gl_cv_next_stdarg_h='<'stdarg.h'>' + gl_cv_next_signal_h='<'signal.h'>' else - { $as_echo "$as_me:$LINENO: checking absolute name of <stdarg.h>" >&5 -$as_echo_n "checking absolute name of <stdarg.h>... " >&6; } -if test "${gl_cv_next_stdarg_h+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5 +$as_echo_n "checking absolute name of <signal.h>... " >&6; } +if test "${gl_cv_next_signal_h+set}" = set; then $as_echo_n "(cached) " >&6 else - if test $ac_cv_header_stdarg_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_signal_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdarg.h> +#include <signal.h> _ACEOF - gl_cv_next_stdarg_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/stdarg.h#{ - s#.*"\(.*/stdarg.h\)".*#\1# + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_signal_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/signal.h#{ + s#.*"\(.*/signal.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else - gl_cv_next_stdarg_h='<'stdarg.h'>' + gl_cv_next_signal_h='<'signal.h'>' fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdarg_h" >&5 -$as_echo "$gl_cv_next_stdarg_h" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 +$as_echo "$gl_cv_next_signal_h" >&6; } fi - NEXT_STDARG_H=$gl_cv_next_stdarg_h + NEXT_SIGNAL_H=$gl_cv_next_signal_h - if test "$gl_cv_next_stdarg_h" = '""'; then - gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' - NEXT_STDARG_H="$gl_cv_next_stdarg_h" - fi - else - if test "${gl_cv_func___va_copy+set}" = set; then +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " +#include <signal.h> + +" +if test "x$ac_cv_type_volatile_sig_atomic_t" = x""yes; then + : +else + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5 +$as_echo_n "checking for signbit macro... " >&6; } +if test "${gl_cv_func_signbit+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + gl_cv_func_signbit="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdarg.h> -int -main () -{ -#ifndef __va_copy -error, bail out +#include <math.h> +/* If signbit is defined as a function, don't use it, since calling it for + 'float' or 'long double' arguments would involve conversions. + If signbit is not declared at all but exists as a library function, don't + use it, since the prototype may not match. + If signbit is not declared at all but exists as a compiler built-in, don't + use it, since it's preferable to use __builtin_signbit* (no warnings, + no conversions). */ +#ifndef signbit +# error "signbit should be a macro" #endif +#include <string.h> - ; +/* Global variables. + Needed because GCC 4 constant-folds __builtin_signbitl (literal) + but cannot constant-fold __builtin_signbitl (variable). */ +float vf; +double vd; +long double vl; +int main () +{ +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -p0f and -p0d instead. */ +float p0f = 0.0f; +float m0f = -p0f; +double p0d = 0.0; +double m0d = -p0d; +/* On HP-UX 10.20, negating 0.0L does not yield -0.0L. + So we use another constant expression instead. + But that expression does not work on other platforms, such as when + cross-compiling to PowerPC on MacOS X 10.5. */ +long double p0l = 0.0L; +#if defined __hpux || defined __sgi +long double m0l = -LDBL_MIN * LDBL_MIN; +#else +long double m0l = -p0l; +#endif + if (signbit (vf)) + vf++; + { + float plus_inf = 1.0f / p0f; + float minus_inf = -1.0f / p0f; + if (!(!signbit (255.0f) + && signbit (-255.0f) + && !signbit (p0f) + && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + if (signbit (vd)) + vd++; + { + double plus_inf = 1.0 / p0d; + double minus_inf = -1.0 / p0d; + if (!(!signbit (255.0) + && signbit (-255.0) + && !signbit (p0d) + && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + if (signbit (vl)) + vl++; + { + long double plus_inf = 1.0L / p0l; + long double minus_inf = -1.0L / p0l; + if (!(!signbit (255.0L) + && signbit (-255.0L) + && !signbit (p0l) + && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } return 0; } + + _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_func___va_copy=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_signbit=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func___va_copy=no + gl_cv_func_signbit=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - if test $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 - 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 - - - +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit" >&5 +$as_echo "$gl_cv_func_signbit" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit compiler built-ins" >&5 +$as_echo_n "checking for signbit compiler built-ins... " >&6; } +if test "${gl_cv_func_signbit_gcc+set}" = set; then + $as_echo_n "(cached) " >&6 +else - if test $ac_cv_type_long_long_int = yes; then - HAVE_LONG_LONG_INT=1 - else - HAVE_LONG_LONG_INT=0 - fi + if test "$cross_compiling" = yes; then + gl_cv_func_signbit_gcc="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if __GNUC__ >= 4 +# define signbit(x) \ + (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ + sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ + __builtin_signbitf (x)) +#else +# error "signbit should be three compiler built-ins" +#endif +#include <string.h> - 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 +/* Global variables. + Needed because GCC 4 constant-folds __builtin_signbitl (literal) + but cannot constant-fold __builtin_signbitl (variable). */ +float vf; +double vd; +long double vl; +int main () +{ +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -p0f and -p0d instead. */ +float p0f = 0.0f; +float m0f = -p0f; +double p0d = 0.0; +double m0d = -p0d; +/* On HP-UX 10.20, negating 0.0L does not yield -0.0L. + So we use another constant expression instead. + But that expression does not work on other platforms, such as when + cross-compiling to PowerPC on MacOS X 10.5. */ +long double p0l = 0.0L; +#if defined __hpux || defined __sgi +long double m0l = -LDBL_MIN * LDBL_MIN; +#else +long double m0l = -p0l; +#endif + if (signbit (vf)) + vf++; + { + float plus_inf = 1.0f / p0f; + float minus_inf = -1.0f / p0f; + if (!(!signbit (255.0f) + && signbit (-255.0f) + && !signbit (p0f) + && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + if (signbit (vd)) + vd++; + { + double plus_inf = 1.0 / p0d; + double minus_inf = -1.0 / p0d; + if (!(!signbit (255.0) + && signbit (-255.0) + && !signbit (p0d) + && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + if (signbit (vl)) + vl++; + { + long double plus_inf = 1.0L / p0l; + long double minus_inf = -1.0L / p0l; + if (!(!signbit (255.0L) + && signbit (-255.0L) + && !signbit (p0l) + && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + return 0; +} - if test $ac_cv_header_inttypes_h = yes; then - HAVE_INTTYPES_H=1 - else - HAVE_INTTYPES_H=0 - fi +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_signbit_gcc=yes +else + gl_cv_func_signbit_gcc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi - if test $ac_cv_header_sys_types_h = yes; then - HAVE_SYS_TYPES_H=1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_gcc" >&5 +$as_echo "$gl_cv_func_signbit_gcc" >&6; } + if test "$gl_cv_func_signbit_gcc" = yes; then + REPLACE_SIGNBIT_USING_GCC=1 else - HAVE_SYS_TYPES_H=0 - fi - - + if test "$gl_cv_func_signbit" != yes; then + REPLACE_SIGNBIT=1 @@ -28505,881 +19149,614 @@ _ACEOF + M4_LIBOBJS="$M4_LIBOBJS signbitf.$ac_objext" - if test $gl_cv_have_include_next = yes; then - gl_cv_next_stdint_h='<'stdint.h'>' - else - { $as_echo "$as_me:$LINENO: checking absolute name of <stdint.h>" >&5 -$as_echo_n "checking absolute name of <stdint.h>... " >&6; } -if test "${gl_cv_next_stdint_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test $ac_cv_header_stdint_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdint.h> -_ACEOF - gl_cv_next_stdint_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/stdint.h#{ - s#.*"\(.*/stdint.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_stdint_h='<'stdint.h'>' - fi -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdint_h" >&5 -$as_echo "$gl_cv_next_stdint_h" >&6; } - fi - NEXT_STDINT_H=$gl_cv_next_stdint_h - if test $ac_cv_header_stdint_h = yes; then - HAVE_STDINT_H=1 - else - HAVE_STDINT_H=0 - fi + M4_LIBOBJS="$M4_LIBOBJS signbitd.$ac_objext" - if test $ac_cv_header_stdint_h = yes; then - { $as_echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5 -$as_echo_n "checking whether stdint.h conforms to C99... " >&6; } -if test "${gl_cv_header_working_stdint_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - gl_cv_header_working_stdint_h=no - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ -#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ -#include <stdint.h> -/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ -#if !(defined WCHAR_MIN && defined WCHAR_MAX) -#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>" -#endif - /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ - #include <stddef.h> - #include <signal.h> - #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> - # include <wchar.h> - #endif -#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; -#include <limits.h> /* for CHAR_BIT */ -#define TYPE_MINIMUM(t) \ - ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) -#define TYPE_MAXIMUM(t) \ - ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) -struct s { - int check_PTRDIFF: - PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) - && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) - ? 1 : -1; - /* Detect bug in FreeBSD 6.0 / ia64. */ - int check_SIG_ATOMIC: - SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) - && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) - ? 1 : -1; - int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; - int check_WCHAR: - WCHAR_MIN == TYPE_MINIMUM (wchar_t) - && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) - ? 1 : -1; - /* Detect bug in mingw. */ - int check_WINT: - WINT_MIN == TYPE_MINIMUM (wint_t) - && WINT_MAX == TYPE_MAXIMUM (wint_t) - ? 1 : -1; - /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ - int check_UINT8_C: - (-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; + M4_LIBOBJS="$M4_LIBOBJS signbitl.$ac_objext" - /* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_header_working_stdint_h=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'float'" >&5 +$as_echo_n "checking where to find the sign bit in a 'float'... " >&6; } +if test "${gl_cv_cc_float_signbit+set}" = set; then + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test "$cross_compiling" = yes; then + + gl_cv_cc_float_signbit="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdio.h> +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } + memory_float; +static memory_float plus = { 1.0f }; +static memory_float minus = { -1.0f }; +int main () +{ + size_t j, k, i; + unsigned int m; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + /* Find the different bit. */ + k = 0; m = 0; + for (j = 0; j < NWORDS; j++) + { + unsigned int x = plus.word[j] ^ minus.word[j]; + if ((x & (x - 1)) || (x && m)) + { + /* More than one bit difference. */ + fprintf (fp, "unknown"); + return 1; + } + if (x) + { + k = j; + m = x; + } + } + if (m == 0) + { + /* No difference. */ + fprintf (fp, "unknown"); + return 1; + } + /* Now m = plus.word[k] ^ ~minus.word[k]. */ + if (plus.word[k] & ~minus.word[k]) + { + /* Oh? The sign bit is set in the positive and cleared in the negative + numbers? */ + fprintf (fp, "unknown"); + return 1; + } + for (i = 0; ; i++) + if ((m >> i) & 1) + break; + fprintf (fp, "word %d bit %d", (int) k, (int) i); + return (fclose (fp) != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_float_signbit=`cat conftest.out` +else + gl_cv_cc_float_signbit="unknown" fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 -$as_echo "$gl_cv_header_working_stdint_h" >&6; } - fi - if test "$gl_cv_header_working_stdint_h" = yes; then - STDINT_H= - else + rm -f conftest.out -for ac_header in sys/inttypes.h sys/bitypes.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_signbit" >&5 +$as_echo "$gl_cv_cc_float_signbit" >&6; } + case "$gl_cv_cc_float_signbit" in + word*bit*) + word=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_SIGNBIT_WORD $word _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + + +cat >>confdefs.h <<_ACEOF +#define FLT_SIGNBIT_BIT $bit _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi + ;; + esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'double'" >&5 +$as_echo_n "checking where to find the sign bit in a 'double'... " >&6; } +if test "${gl_cv_cc_double_signbit+set}" = set; then + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi + if test "$cross_compiling" = yes; then -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } + gl_cv_cc_double_signbit="unknown" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +#include <stddef.h> +#include <stdio.h> +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } + memory_float; +static memory_float plus = { 1.0 }; +static memory_float minus = { -1.0 }; +int main () +{ + size_t j, k, i; + unsigned int m; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + /* Find the different bit. */ + k = 0; m = 0; + for (j = 0; j < NWORDS; j++) + { + unsigned int x = plus.word[j] ^ minus.word[j]; + if ((x & (x - 1)) || (x && m)) + { + /* More than one bit difference. */ + fprintf (fp, "unknown"); + return 1; + } + if (x) + { + k = j; + m = x; + } + } + if (m == 0) + { + /* No difference. */ + fprintf (fp, "unknown"); + return 1; + } + /* Now m = plus.word[k] ^ ~minus.word[k]. */ + if (plus.word[k] & ~minus.word[k]) + { + /* Oh? The sign bit is set in the positive and cleared in the negative + numbers? */ + fprintf (fp, "unknown"); + return 1; + } + for (i = 0; ; i++) + if ((m >> i) & 1) + break; + fprintf (fp, "word %d bit %d", (int) k, (int) i); + return (fclose (fp) != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_double_signbit=`cat conftest.out` +else + gl_cv_cc_double_signbit="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -done + rm -f conftest.out - if test $ac_cv_header_sys_inttypes_h = yes; then - HAVE_SYS_INTTYPES_H=1 - else - HAVE_SYS_INTTYPES_H=0 - fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_signbit" >&5 +$as_echo "$gl_cv_cc_double_signbit" >&6; } + case "$gl_cv_cc_double_signbit" in + word*bit*) + word=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word.*bit //'` - if test $ac_cv_header_sys_bitypes_h = yes; then - HAVE_SYS_BITYPES_H=1 - else - HAVE_SYS_BITYPES_H=0 - fi +cat >>confdefs.h <<_ACEOF +#define DBL_SIGNBIT_WORD $word +_ACEOF +cat >>confdefs.h <<_ACEOF +#define DBL_SIGNBIT_BIT $bit +_ACEOF + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'long double'" >&5 +$as_echo_n "checking where to find the sign bit in a 'long double'... " >&6; } +if test "${gl_cv_cc_long_double_signbit+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + gl_cv_cc_long_double_signbit="unknown" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> +#include <stdio.h> +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { long double value; unsigned int word[NWORDS]; } + memory_float; +static memory_float plus = { 1.0L }; +static memory_float minus = { -1.0L }; +int main () +{ + size_t j, k, i; + unsigned int m; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + /* Find the different bit. */ + k = 0; m = 0; + for (j = 0; j < NWORDS; j++) + { + unsigned int x = plus.word[j] ^ minus.word[j]; + if ((x & (x - 1)) || (x && m)) + { + /* More than one bit difference. */ + fprintf (fp, "unknown"); + return 1; + } + if (x) + { + k = j; + m = x; + } + } + if (m == 0) + { + /* No difference. */ + fprintf (fp, "unknown"); + return 1; + } + /* Now m = plus.word[k] ^ ~minus.word[k]. */ + if (plus.word[k] & ~minus.word[k]) + { + /* Oh? The sign bit is set in the positive and cleared in the negative + numbers? */ + fprintf (fp, "unknown"); + return 1; + } + for (i = 0; ; i++) + if ((m >> i) & 1) + break; + fprintf (fp, "word %d bit %d", (int) k, (int) i); + return (fclose (fp) != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_long_double_signbit=`cat conftest.out` +else + gl_cv_cc_long_double_signbit="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + rm -f conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_signbit" >&5 +$as_echo "$gl_cv_cc_long_double_signbit" >&6; } + case "$gl_cv_cc_long_double_signbit" in + word*bit*) + word=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word.*bit //'` +cat >>confdefs.h <<_ACEOF +#define LDBL_SIGNBIT_WORD $word +_ACEOF - for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do - { $as_echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 -$as_echo_n "checking for bit size of $gltype... " >&6; } -if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<_ACEOF +#define LDBL_SIGNBIT_BIT $bit _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ - #include <stddef.h> - #include <signal.h> - #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> - # include <wchar.h> - #endif + ;; + esac -#include <limits.h> -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + if test "$gl_cv_cc_float_signbit" = unknown; then + ac_fn_c_check_decl "$LINENO" "copysignf" "ac_cv_have_decl_copysignf" "#include <math.h> +" +if test "x$ac_cv_have_decl_copysignf" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_COPYSIGNF $ac_have_decl _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ - #include <stddef.h> - #include <signal.h> - #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> - # include <wchar.h> - #endif + if test "$ac_cv_have_decl_copysignf" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignf can be used without linking with libm" >&5 +$as_echo_n "checking whether copysignf can be used without linking with libm... " >&6; } +if test "${gl_cv_func_copysignf_no_libm+set}" = set; then + $as_echo_n "(cached) " >&6 +else -#include <limits.h> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + float x, y; int main () { -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; -test_array [0] = 0 - +return copysignf (x, y) < 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_copysignf_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_func_copysignf_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignf_no_libm" >&5 +$as_echo "$gl_cv_func_copysignf_no_libm" >&6; } + if test $gl_cv_func_copysignf_no_libm = yes; then -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done +$as_echo "#define HAVE_COPYSIGNF_IN_LIBC 1" >>confdefs.h + + fi + fi + fi + if test "$gl_cv_cc_double_signbit" = unknown; then + ac_fn_c_check_decl "$LINENO" "copysign" "ac_cv_have_decl_copysign" "#include <math.h> +" +if test "x$ac_cv_have_decl_copysign" = x""yes; then + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_have_decl=0 +fi - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_COPYSIGN $ac_have_decl _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ - #include <stddef.h> - #include <signal.h> - #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> - # include <wchar.h> - #endif + if test "$ac_cv_have_decl_copysign" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysign can be used without linking with libm" >&5 +$as_echo_n "checking whether copysign can be used without linking with libm... " >&6; } +if test "${gl_cv_func_copysign_no_libm+set}" = set; then + $as_echo_n "(cached) " >&6 +else -#include <limits.h> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + double x, y; int main () { -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) < 0)]; -test_array [0] = 0 - +return copysign (x, y) < 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_copysign_no_libm=yes +else + gl_cv_func_copysign_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysign_no_libm" >&5 +$as_echo "$gl_cv_func_copysign_no_libm" >&6; } + if test $gl_cv_func_copysign_no_libm = yes; then + +$as_echo "#define HAVE_COPYSIGN_IN_LIBC 1" >>confdefs.h + + fi + fi + fi + if test "$gl_cv_cc_long_double_signbit" = unknown; then + ac_fn_c_check_decl "$LINENO" "copysignl" "ac_cv_have_decl_copysignl" "#include <math.h> +" +if test "x$ac_cv_have_decl_copysignl" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_COPYSIGNL $ac_have_decl _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ - #include <stddef.h> - #include <signal.h> - #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> - # include <wchar.h> - #endif + if test "$ac_cv_have_decl_copysignl" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignl can be used without linking with libm" >&5 +$as_echo_n "checking whether copysignl can be used without linking with libm... " >&6; } +if test "${gl_cv_func_copysignl_no_libm+set}" = set; then + $as_echo_n "(cached) " >&6 +else -#include <limits.h> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <math.h> + long double x, y; int main () { -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= $ac_mid)]; -test_array [0] = 0 - +return copysignl (x, y) < 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break +if ac_fn_c_try_link "$LINENO"; then + gl_cv_func_copysignl_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_func_copysignl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignl_no_libm" >&5 +$as_echo "$gl_cv_func_copysignl_no_libm" >&6; } + if test $gl_cv_func_copysignl_no_libm = yes; then -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define HAVE_COPYSIGNL_IN_LIBC 1" >>confdefs.h - ac_lo= ac_hi= -fi + fi + fi + fi + fi + 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: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ - #include <stddef.h> - #include <signal.h> - #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> - # include <wchar.h> - #endif + GNULIB_SIGNBIT=1 -#include <limits.h> -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} + + signals_not_posix= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <signal.h> + _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sigset_t" >/dev/null 2>&1; then + : else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + signals_not_posix=1 +fi +rm -f conftest* + + if test -z "$signals_not_posix"; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = x""yes; then + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + + + + - 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: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ - #include <stddef.h> - #include <signal.h> - #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> - # include <wchar.h> - #endif -#include <limits.h> -static long int longval () { return sizeof ($gltype) * CHAR_BIT; } -static unsigned long int ulongval () { return sizeof ($gltype) * CHAR_BIT; } -#include <stdio.h> -#include <stdlib.h> -int -main () -{ + M4_LIBOBJS="$M4_LIBOBJS sigprocmask.$ac_objext" - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if ((sizeof ($gltype) * CHAR_BIT) < 0) - { - long int i = longval (); - if (i != (sizeof ($gltype) * CHAR_BIT)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (sizeof ($gltype) * CHAR_BIT)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - ; - return 0; -} + + ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "#include <signal.h> +/* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ +#include <sys/types.h> +" +if test "x$ac_cv_type_sigset_t" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGSET_T 1 _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - result=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -result=unknown -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +gl_cv_type_sigset_t=yes +else + gl_cv_type_sigset_t=no fi -rm -f conftest.val - eval gl_cv_bitsizeof_${gltype}=\$result -fi -ac_res=`eval 'as_val=${'gl_cv_bitsizeof_${gltype}'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval result=\$gl_cv_bitsizeof_${gltype} - if test $result = unknown; then - result=0 - fi - GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` - cat >>confdefs.h <<_ACEOF -#define BITSIZEOF_${GLTYPE} $result -_ACEOF + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi - eval BITSIZEOF_${GLTYPE}=\$result - done + + fi + GNULIB_SIGPROCMASK=1 + for ac_header in stdint.h +do + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF +fi - for gltype in sig_atomic_t wchar_t wint_t ; do - { $as_echo "$as_me:$LINENO: checking whether $gltype is signed" >&5 -$as_echo_n "checking whether $gltype is signed... " >&6; } -if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +$as_echo_n "checking for SIZE_MAX... " >&6; } + if test "${gl_cv_size_max+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + gl_cv_size_max= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ - #include <stddef.h> - #include <signal.h> - #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> - # include <wchar.h> - #endif +#include <limits.h> +#if HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Found it" >/dev/null 2>&1; then + gl_cv_size_max=yes +fi +rm -f conftest* + + if test -z "$gl_cv_size_max"; then + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include <stddef.h> +#include <limits.h>"; then + : +else + size_t_bits_minus_1= +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include <stddef.h>"; then + : +else + fits_in_uint= +fi + + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stddef.h> + extern size_t foo; + extern unsigned long foo; - int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; int main () { @@ -29388,167 +19765,117 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - result=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - result=no +if ac_fn_c_try_compile "$LINENO"; then + fits_in_uint=0 fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - eval gl_cv_type_${gltype}_signed=\$result + 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 -ac_res=`eval 'as_val=${'gl_cv_type_${gltype}_signed'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +$as_echo "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then +cat >>confdefs.h <<_ACEOF +#define SIZE_MAX $gl_cv_size_max +_ACEOF - gl_cv_type_ptrdiff_t_signed=yes - gl_cv_type_size_t_signed=no + fi + gl_cv_func_snprintf_usable=no + for ac_func in snprintf +do + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SNPRINTF 1 +_ACEOF +fi +done + if test $ac_cv_func_snprintf = yes; then - for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do - { $as_echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 -$as_echo_n "checking for $gltype integer literal suffix... " >&6; } -if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +$as_echo_n "checking whether snprintf respects a size of 1... " >&6; } +if test "${gl_cv_func_snprintf_size1+set}" = set; then $as_echo_n "(cached) " >&6 else - 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: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ - #include <stddef.h> - #include <signal.h> - #if HAVE_WCHAR_H - # include <stdio.h> - # include <time.h> - # include <wchar.h> - #endif + if test "$cross_compiling" = yes; then + gl_cv_func_snprintf_size1="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - extern $gltype foo; - extern $gltype1 foo; -int -main () +#include <stdio.h> +int main() { - - ; - return 0; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval gl_cv_type_${gltype}_suffix=\$glsuf +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_snprintf_size1=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_func_snprintf_size1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +$as_echo "$gl_cv_func_snprintf_size1" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - eval result=\$gl_cv_type_${gltype}_suffix - test "$result" != no && break - done -fi -ac_res=`eval 'as_val=${'gl_cv_type_${gltype}_suffix'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` - eval result=\$gl_cv_type_${gltype}_suffix - test "$result" = no && result= - eval ${GLTYPE}_SUFFIX=\$result - cat >>confdefs.h <<_ACEOF -#define ${GLTYPE}_SUFFIX $result -_ACEOF + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then - done - STDINT_H=stdint.h + + + + + + + M4_LIBOBJS="$M4_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + : + fi + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + GNULIB_SNPRINTF=1 @@ -29560,61 +19887,139 @@ _ACEOF if test $gl_cv_have_include_next = yes; then - gl_cv_next_stdio_h='<'stdio.h'>' + gl_cv_next_spawn_h='<'spawn.h'>' else - { $as_echo "$as_me:$LINENO: checking absolute name of <stdio.h>" >&5 -$as_echo_n "checking absolute name of <stdio.h>... " >&6; } -if test "${gl_cv_next_stdio_h+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <spawn.h>" >&5 +$as_echo_n "checking absolute name of <spawn.h>... " >&6; } +if test "${gl_cv_next_spawn_h+set}" = set; then $as_echo_n "(cached) " >&6 else - if test $ac_cv_header_stdio_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_spawn_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdio.h> +#include <spawn.h> _ACEOF - gl_cv_next_stdio_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/stdio.h#{ - s#.*"\(.*/stdio.h\)".*#\1# + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_spawn_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/spawn.h#{ + s#.*"\(.*/spawn.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else - gl_cv_next_stdio_h='<'stdio.h'>' + gl_cv_next_spawn_h='<'spawn.h'>' fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdio_h" >&5 -$as_echo "$gl_cv_next_stdio_h" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_spawn_h" >&5 +$as_echo "$gl_cv_next_spawn_h" >&6; } fi - NEXT_STDIO_H=$gl_cv_next_stdio_h + NEXT_SPAWN_H=$gl_cv_next_spawn_h - GNULIB_FPRINTF=1 - GNULIB_PRINTF=1 - GNULIB_VFPRINTF=1 - GNULIB_VPRINTF=1 - GNULIB_FPUTC=1 - GNULIB_PUTC=1 - GNULIB_PUTCHAR=1 - GNULIB_FPUTS=1 - GNULIB_PUTS=1 - GNULIB_FWRITE=1 + if test $ac_cv_header_spawn_h = yes; then + HAVE_SPAWN_H=1 + else + HAVE_SPAWN_H=0 + fi + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } +if test "${gt_cv_ssize_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +int +main () +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gt_cv_ssize_t=yes +else + gt_cv_ssize_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 +$as_echo "$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then + +$as_echo "#define ssize_t int" >>confdefs.h + + fi + STDARG_H=''; + NEXT_STDARG_H='<stdarg.h>'; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +$as_echo_n "checking for va_copy... " >&6; } + if test "${gl_cv_func_va_copy+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +int +main () +{ + +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_func_va_copy=yes +else + gl_cv_func_va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 +$as_echo "$gl_cv_func_va_copy" >&6; } + if test $gl_cv_func_va_copy = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "vaccine" >/dev/null 2>&1; then + gl_aixcc=yes +else + gl_aixcc=no +fi +rm -f conftest* + if test $gl_aixcc = yes; then + STDARG_H=stdarg.h @@ -29622,610 +20027,848 @@ $as_echo "$gl_cv_next_stdio_h" >&6; } if test $gl_cv_have_include_next = yes; then - gl_cv_next_stdlib_h='<'stdlib.h'>' + gl_cv_next_stdarg_h='<'stdarg.h'>' else - { $as_echo "$as_me:$LINENO: checking absolute name of <stdlib.h>" >&5 -$as_echo_n "checking absolute name of <stdlib.h>... " >&6; } -if test "${gl_cv_next_stdlib_h+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5 +$as_echo_n "checking absolute name of <stdarg.h>... " >&6; } +if test "${gl_cv_next_stdarg_h+set}" = set; then $as_echo_n "(cached) " >&6 else - if test $ac_cv_header_stdlib_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_stdarg_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdlib.h> +#include <stdarg.h> _ACEOF - gl_cv_next_stdlib_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/stdlib.h#{ - s#.*"\(.*/stdlib.h\)".*#\1# + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdarg_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdarg.h#{ + s#.*"\(.*/stdarg.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else - gl_cv_next_stdlib_h='<'stdlib.h'>' + gl_cv_next_stdarg_h='<'stdarg.h'>' fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdlib_h" >&5 -$as_echo "$gl_cv_next_stdlib_h" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5 +$as_echo "$gl_cv_next_stdarg_h" >&6; } fi - NEXT_STDLIB_H=$gl_cv_next_stdlib_h + NEXT_STDARG_H=$gl_cv_next_stdarg_h + + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if test "${gl_cv_func___va_copy+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +int +main () +{ +#ifndef __va_copy +error, bail out +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gl_cv_func___va_copy=yes +else + gl_cv_func___va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + as_echo_n="$saved_as_echo_n" + if test $gl_cv_func___va_copy = yes; then +$as_echo "#define va_copy __va_copy" >>confdefs.h + else +$as_echo "#define va_copy gl_va_copy" >>confdefs.h - M4_LIBOBJS="$M4_LIBOBJS mkstemp-safer.$ac_objext" + fi + fi + fi - if test $REPLACE_STRERROR = 1; then + # 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 - M4_LIBOBJS="$M4_LIBOBJS strerror.$ac_objext" + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 + fi -cat >>confdefs.h <<_ACEOF -#define REPLACE_STRERROR $REPLACE_STRERROR -_ACEOF + 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 + - GNULIB_STRERROR=1 + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5 +$as_echo_n "checking absolute name of <stdint.h>... " >&6; } +if test "${gl_cv_next_stdint_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test $ac_cv_header_stdint_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdint.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdint.h#{ + s#.*"\(.*/stdint.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +$as_echo "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h - if test $ac_cv_have_decl_strndup = no; then - HAVE_DECL_STRNDUP=0 + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 fi - # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. - { $as_echo "$as_me:$LINENO: checking for working strndup" >&5 -$as_echo_n "checking for working strndup... " >&6; } -if test "${gl_cv_func_strndup+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - { $as_echo "$as_me:$LINENO: checking for strndup" >&5 -$as_echo_n "checking for strndup... " >&6; } -if test "${ac_cv_func_strndup+set}" = set; then + + if test $ac_cv_header_stdint_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 +$as_echo_n "checking whether stdint.h conforms to C99... " >&6; } +if test "${gl_cv_header_working_stdint_h+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + gl_cv_header_working_stdint_h=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define strndup to an innocuous variant, in case <limits.h> declares strndup. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define strndup innocuous_strndup -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char strndup (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ -#ifdef __STDC__ -# include <limits.h> +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>" +#endif + + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + +#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 -# include <assert.h> +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; + +#include <limits.h> /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) +struct s { + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; -#undef strndup + /* 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; -/* 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" + /* Detect bugs in OpenBSD 3.9 stdint.h. */ +#ifdef UINT8_MAX + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; #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 +#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 strndup (); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_strndup=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_strndup=no -fi +if ac_fn_c_try_compile "$LINENO"; then + if test "$cross_compiling" = yes; then + gl_cv_header_working_stdint_h=yes -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strndup" >&5 -$as_echo "$ac_cv_func_strndup" >&6; } -if test "x$ac_cv_func_strndup" = x""yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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* +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> -else - gl_cv_func_strndup=no -fi -else - cat >conftest.$ac_ext <<_ACEOF + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + +#include <stdio.h> #include <string.h> - #include <stdlib.h> +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + int main () { -#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'; + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return 1; + } + return 0; + ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_strndup=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_strndup=no +if ac_fn_c_try_run "$LINENO"; then + gl_cv_header_working_stdint_h=yes fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_strndup" >&5 -$as_echo "$gl_cv_func_strndup" >&6; } - if test $gl_cv_func_strndup = yes; then +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRNDUP 1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 +$as_echo "$gl_cv_header_working_stdint_h" >&6; } + fi + if test "$gl_cv_header_working_stdint_h" = yes; then + STDINT_H= + else + for ac_header in sys/inttypes.h sys/bitypes.h +do + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - else - HAVE_STRNDUP=0 +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 + if test $APPLE_UNIVERSAL_BUILD = 0; then - M4_LIBOBJS="$M4_LIBOBJS strndup.$ac_objext" - : - fi + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif +#include <limits.h>"; then + : +else + result=unknown +fi + eval gl_cv_bitsizeof_${gltype}=\$result - GNULIB_STRNDUP=1 +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif +#include <limits.h>"; then + : +else + result=unknown +fi + eval gl_cv_bitsizeof_${gltype}=\$result +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + eval BITSIZEOF_${GLTYPE}=\$result + done - if test $ac_cv_have_decl_strnlen = no; then - HAVE_DECL_STRNLEN=0 - fi - { $as_echo "$as_me:$LINENO: checking for working strnlen" >&5 -$as_echo_n "checking for working strnlen... " >&6; } -if test "${ac_cv_func_strnlen_working+set}" = set; then + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 +$as_echo_n "checking whether $gltype is signed... " >&6; } +if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_strnlen_working=yes +if ac_fn_c_try_compile "$LINENO"; then + result=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_strnlen_working=no + result=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval gl_cv_type_${gltype}_signed=\$result fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strnlen_working" >&5 -$as_echo "$ac_cv_func_strnlen_working" >&6; } -test $ac_cv_func_strnlen_working = no && - - +eval ac_res=\$gl_cv_type_${gltype}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + 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 + if test $APPLE_UNIVERSAL_BUILD = 0; then - M4_LIBOBJS="$M4_LIBOBJS strnlen.$ac_objext" + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif - if test $ac_cv_func_strnlen_working = no; then - # This is necessary because automake-1.6.1 doesn't understand - # that the above use of AC_FUNC_STRNLEN means we may have to use - # lib/strnlen.c. - #AC_LIBOBJ(strnlen) + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ -cat >>confdefs.h <<\_ACEOF -#define strnlen rpl_strnlen + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result _ACEOF - : - fi - - - - GNULIB_STRNLEN=1 - - - - - - - - + done - if test $ac_cv_have_decl_strsignal = no; then - HAVE_DECL_STRSIGNAL=0 fi -for ac_func in strsignal -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#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 + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ + #include <stddef.h> + #include <signal.h> + #if HAVE_WCHAR_H + # include <stdio.h> + # include <time.h> + # include <wchar.h> + #endif + extern $gltype foo; + extern $gltype1 foo; int main () { -return $ac_func (); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" +if ac_fn_c_try_compile "$LINENO"; then + eval gl_cv_type_${gltype}_suffix=\$glsuf fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + 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 -fi -done + done - if test $ac_cv_func_strsignal = yes; then - { $as_echo "$as_me:$LINENO: checking whether strsignal always returns a string" >&5 -$as_echo_n "checking whether strsignal always returns a string... " >&6; } -if test "${gl_cv_func_working_strsignal+set}" = set; then + + + STDINT_H=stdint.h + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5 +$as_echo_n "checking absolute name of <stdio.h>... " >&6; } +if test "${gl_cv_next_stdio_h+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - case "$host_os" in - solaris* | aix*) gl_cv_func_working_strsignal=no;; - *) gl_cv_func_working_strsignal="guessing yes";; - esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + if test $ac_cv_header_stdio_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <string.h> +#include <stdio.h> -int -main () -{ -char *s = strsignal (-1); - return !(s != (char *) 0 && s != (char *) -1); - ; - return 0; -} _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_working_strsignal=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdio.h#{ + s#.*"\(.*/stdio.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdio_h='<'stdio.h'>' + fi -( exit $ac_status ) -gl_cv_func_working_strsignal=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 +$as_echo "$gl_cv_next_stdio_h" >&6; } + fi + NEXT_STDIO_H=$gl_cv_next_stdio_h -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_working_strsignal" >&5 -$as_echo "$gl_cv_func_working_strsignal" >&6; } - else - gl_cv_func_working_strsignal=no - fi - if test "$gl_cv_func_working_strsignal" = no; then - if test $ac_cv_func_strsignal = yes; then - REPLACE_STRSIGNAL=1 - fi + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 @@ -30233,778 +20876,335 @@ $as_echo "$gl_cv_func_working_strsignal" - M4_LIBOBJS="$M4_LIBOBJS strsignal.$ac_objext" - { $as_echo "$as_me:$LINENO: checking whether _sys_siglist is declared" >&5 -$as_echo_n "checking whether _sys_siglist is declared... " >&6; } -if test "${ac_cv_have_decl__sys_siglist+set}" = set; then + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdlib_h='<'stdlib.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5 +$as_echo_n "checking absolute name of <stdlib.h>... " >&6; } +if test "${gl_cv_next_stdlib_h+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> -int -main () -{ -#ifndef _sys_siglist - (void) _sys_siglist; -#endif + if test $ac_cv_header_stdlib_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl__sys_siglist=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdlib.h#{ + s#.*"\(.*/stdlib.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdlib_h='<'stdlib.h'>' + fi - ac_cv_have_decl__sys_siglist=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 +$as_echo "$gl_cv_next_stdlib_h" >&6; } + fi + NEXT_STDLIB_H=$gl_cv_next_stdlib_h + + + + for ac_header in random.h +do + ac_fn_c_check_header_compile "$LINENO" "random.h" "ac_cv_header_random_h" "$ac_includes_default +" +if test "x$ac_cv_header_random_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_RANDOM_H 1 +_ACEOF -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl__sys_siglist" >&5 -$as_echo "$ac_cv_have_decl__sys_siglist" >&6; } -if test "x$ac_cv_have_decl__sys_siglist" = x""yes; then + +done + + if test $ac_cv_header_random_h = yes; then + HAVE_RANDOM_H=1 + else + HAVE_RANDOM_H=0 + fi + + ac_fn_c_check_type "$LINENO" "struct random_data" "ac_cv_type_struct_random_data" "#include <stdlib.h> + #if HAVE_RANDOM_H + # include <random.h> + #endif + +" +if test "x$ac_cv_type_struct_random_data" = x""yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SYS_SIGLIST 1 +#define HAVE_STRUCT_RANDOM_DATA 1 _ACEOF else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SYS_SIGLIST 0 -_ACEOF + HAVE_STRUCT_RANDOM_DATA=0 +fi -fi - fi - GNULIB_STRSIGNAL=1 - { $as_echo "$as_me:$LINENO: checking whether strstr works in linear time" >&5 -$as_echo_n "checking whether strstr works in linear time... " >&6; } -if test "${gl_cv_func_strstr_linear+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + M4_LIBOBJS="$M4_LIBOBJS mkstemp-safer.$ac_objext" -#include <features.h> -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2) - Lucky user - #endif -#endif -#ifdef __CYGWIN__ - #include <cygwin/version.h> - #if CYGWIN_VERSION_DLL_MAJOR >= 1007 - Lucky user - #endif -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Lucky user" >/dev/null 2>&1; then - gl_cv_func_strstr_linear=yes -else - gl_cv_func_strstr_linear="guessing no" -fi -rm -f conftest* -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <signal.h> /* for signal */ -#include <string.h> /* for memmem */ -#include <stdlib.h> /* for malloc */ -#include <unistd.h> /* for alarm */ -int -main () -{ -size_t m = 1000000; - char *haystack = (char *) malloc (2 * m + 2); - char *needle = (char *) malloc (m + 2); - void *result = 0; - /* Failure to compile this test due to missing alarm is okay, - since all such platforms (mingw) also have quadratic strstr. */ - signal (SIGALRM, SIG_DFL); - alarm (5); - /* Check for quadratic performance. */ - if (haystack && needle) - { - memset (haystack, 'A', 2 * m); - haystack[2 * m] = 'B'; - haystack[2 * m + 1] = 0; - memset (needle, 'A', m); - needle[m] = 'B'; - needle[m + 1] = 0; - result = strstr (haystack, needle); - } - return !result; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_strstr_linear=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -gl_cv_func_strstr_linear=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_strstr_linear" >&5 -$as_echo "$gl_cv_func_strstr_linear" >&6; } - if test "$gl_cv_func_strstr_linear" != yes; then - REPLACE_STRSTR=1 + for ac_func in strchrnul +do + ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul" +if test "x$ac_cv_func_strchrnul" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_STRCHRNUL 1 +_ACEOF +else + M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" +fi +done - M4_LIBOBJS="$M4_LIBOBJS strstr.$ac_objext" + if test $ac_cv_func_strchrnul = no; then + HAVE_STRCHRNUL=0 + : fi - GNULIB_STRSTR=1 + GNULIB_STRCHRNUL=1 - { $as_echo "$as_me:$LINENO: checking for working strtod" >&5 -$as_echo_n "checking for working strtod... " >&6; } -if test "${ac_cv_func_strtod+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_strtod=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + if test $REPLACE_STRERROR = 1; then -$ac_includes_default -#ifndef strtod -double strtod (); -#endif -int -main() -{ - { - /* Some versions of Linux strtod mis-parse strings with leading '+'. */ - char *string = " +69"; - char *term; - double value; - value = strtod (string, &term); - if (value != 69 || term != (string + 4)) - return 1; - } - { - /* Under Solaris 2.4, strtod returns the wrong value for the - terminating character under some conditions. */ - char *string = "NaN"; - char *term; - strtod (string, &term); - if (term != string && *(term - 1) == 0) - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_strtod=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_func_strtod=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5 -$as_echo "$ac_cv_func_strtod" >&6; } -if test $ac_cv_func_strtod = no; then + M4_LIBOBJS="$M4_LIBOBJS strerror.$ac_objext" +cat >>confdefs.h <<_ACEOF +#define REPLACE_STRERROR $REPLACE_STRERROR +_ACEOF + fi - M4_LIBOBJS="$M4_LIBOBJS strtod.$ac_objext" + GNULIB_STRERROR=1 -{ $as_echo "$as_me:$LINENO: checking for pow" >&5 -$as_echo_n "checking for pow... " >&6; } -if test "${ac_cv_func_pow+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define pow to an innocuous variant, in case <limits.h> declares pow. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define pow innocuous_pow -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char pow (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif -#undef pow -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pow (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_pow || defined __stub___pow -choke me -#endif -int -main () -{ -return pow (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_pow=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_pow=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5 -$as_echo "$ac_cv_func_pow" >&6; } -if test $ac_cv_func_pow = no; then - { $as_echo "$as_me:$LINENO: checking for pow in -lm" >&5 -$as_echo_n "checking for pow in -lm... " >&6; } -if test "${ac_cv_lib_m_pow+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + if test $ac_cv_have_decl_strndup = no; then + HAVE_DECL_STRNDUP=0 + fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pow (); -int -main () -{ -return pow (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_m_pow=yes + # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5 +$as_echo_n "checking for working strndup... " >&6; } +if test "${gl_cv_func_strndup+set}" = set; then + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test "$cross_compiling" = yes; then + ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" +if test "x$ac_cv_func_strndup" = x""yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ac_cv_lib_m_pow=no -fi +#ifdef _AIX + too risky +#endif -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 -$as_echo "$ac_cv_lib_m_pow" >&6; } -if test "x$ac_cv_lib_m_pow" = x""yes; then - POW_LIB=-lm +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "too risky" >/dev/null 2>&1; then + gl_cv_func_strndup=no else - { $as_echo "$as_me:$LINENO: WARNING: cannot find library containing definition of pow" >&5 -$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} -fi - + gl_cv_func_strndup=yes fi +rm -f conftest* +else + gl_cv_func_strndup=no fi - if test $ac_cv_func_strtod = no; then - HAVE_STRTOD=0 - REPLACE_STRTOD=1 - : - else - { $as_echo "$as_me:$LINENO: checking whether strtod obeys C99" >&5 -$as_echo_n "checking whether strtod obeys C99... " >&6; } -if test "${gl_cv_func_strtod_works+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - gl_cv_func_strtod_works="guessing no" else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdlib.h> -#include <math.h> -/* Compare two numbers with ==. - This is a separate function because IRIX 6.5 "cc -O" miscompiles an - 'x == x' test. */ -static int -numeric_equal (double x, double y) -{ - return x == y; -} - + #include <string.h> + #include <stdlib.h> int main () { - { - /* Older glibc and Cygwin mis-parse "-0x". */ - const char *string = "-0x"; - char *term; - double value = strtod (string, &term); - double zero = 0.0; - if (1.0 / value != -1.0 / zero || term != (string + 2)) - return 1; - } - { - /* Many platforms do not parse hex floats. */ - const char *string = "0XaP+1"; - char *term; - double value = strtod (string, &term); - if (value != 20.0 || term != (string + 6)) - return 1; - } - { - /* Many platforms do not parse infinities. */ - const char *string = "inf"; - char *term; - double value = strtod (string, &term); - if (value != HUGE_VAL || term != (string + 3)) - return 1; - } - { - /* glibc 2.7 and cygwin 1.5.24 misparse "nan()". */ - const char *string = "nan()"; - char *term; - double value = strtod (string, &term); - if (numeric_equal (value, value) || term != (string + 5)) - return 1; - } - +#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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_strtod_works=yes +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_strndup=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_strtod_works=no + gl_cv_func_strndup=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_strtod_works" >&5 -$as_echo "$gl_cv_func_strtod_works" >&6; } - if test "$gl_cv_func_strtod_works" != yes; then - REPLACE_STRTOD=1 - : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup" >&5 +$as_echo "$gl_cv_func_strndup" >&6; } + if test $gl_cv_func_strndup = yes; then +$as_echo "#define HAVE_STRNDUP 1" >>confdefs.h + else + HAVE_STRNDUP=0 - M4_LIBOBJS="$M4_LIBOBJS strtod.$ac_objext" -{ $as_echo "$as_me:$LINENO: checking for pow" >&5 -$as_echo_n "checking for pow... " >&6; } -if test "${ac_cv_func_pow+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define pow to an innocuous variant, in case <limits.h> declares pow. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define pow innocuous_pow -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char pow (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ + M4_LIBOBJS="$M4_LIBOBJS strndup.$ac_objext" -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif + : + fi -#undef pow -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pow (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_pow || defined __stub___pow -choke me -#endif -int -main () -{ -return pow (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_pow=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + GNULIB_STRNDUP=1 - ac_cv_func_pow=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5 -$as_echo "$ac_cv_func_pow" >&6; } -if test $ac_cv_func_pow = no; then - { $as_echo "$as_me:$LINENO: checking for pow in -lm" >&5 -$as_echo_n "checking for pow in -lm... " >&6; } -if test "${ac_cv_lib_m_pow+set}" = set; then + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +$as_echo_n "checking for working strnlen... " >&6; } +if test "${ac_cv_func_strnlen_working+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + ac_cv_func_strnlen_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pow (); +$ac_includes_default int main () { -return pow (); + +#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_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_m_pow=yes +if ac_fn_c_try_run "$LINENO"; then + ac_cv_func_strnlen_working=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_m_pow=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_cv_func_strnlen_working=no fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 -$as_echo "$ac_cv_lib_m_pow" >&6; } -if test "x$ac_cv_lib_m_pow" = x""yes; then - POW_LIB=-lm -else - { $as_echo "$as_me:$LINENO: WARNING: cannot find library containing definition of pow" >&5 -$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 +$as_echo "$ac_cv_func_strnlen_working" >&6; } +test $ac_cv_func_strnlen_working = no && + + + + - fi - fi + M4_LIBOBJS="$M4_LIBOBJS strnlen.$ac_objext" + + + if test $ac_cv_func_strnlen_working = no; then + # This is necessary because automake-1.6.1 doesn't understand + # that the above use of AC_FUNC_STRNLEN means we may have to use + # lib/strnlen.c. + #AC_LIBOBJ([strnlen]) + +$as_echo "#define strnlen rpl_strnlen" >>confdefs.h - GNULIB_STRTOD=1 + : + fi + GNULIB_STRNLEN=1 @@ -31012,136 +21212,182 @@ fi + if test $ac_cv_have_decl_strsignal = no; then + HAVE_DECL_STRSIGNAL=0 + fi -for ac_func in strtol + for ac_func in strsignal do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal" +if test "x$ac_cv_func_strsignal" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_STRSIGNAL 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $ac_func +fi +done -/* 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 + if test $ac_cv_func_strsignal = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strsignal always returns a string" >&5 +$as_echo_n "checking whether strsignal always returns a string... " >&6; } +if test "${gl_cv_func_working_strsignal+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + case "$host_os" in + solaris* | aix*) gl_cv_func_working_strsignal=no;; + *) gl_cv_func_working_strsignal="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> int main () { -return $ac_func (); +char *s = strsignal (-1); + return !(s != (char *) 0 && s != (char *) -1); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_working_strsignal=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + gl_cv_func_working_strsignal=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strsignal" >&5 +$as_echo "$gl_cv_func_working_strsignal" >&6; } + else + gl_cv_func_working_strsignal=no + fi -else + if test "$gl_cv_func_working_strsignal" = no; then + if test $ac_cv_func_strsignal = yes; then + REPLACE_STRSIGNAL=1 + fi - M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" -fi -done + M4_LIBOBJS="$M4_LIBOBJS strsignal.$ac_objext" + ac_fn_c_check_decl "$LINENO" "_sys_siglist" "ac_cv_have_decl__sys_siglist" "#include <signal.h> +" +if test "x$ac_cv_have_decl__sys_siglist" = x""yes; then + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SYS_SIGLIST $ac_have_decl +_ACEOF - if test $ac_cv_func_lstat = yes; then - HAVE_LSTAT=1 - else - HAVE_LSTAT=0 fi + GNULIB_STRSIGNAL=1 + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5 +$as_echo_n "checking whether strstr works in linear time... " >&6; } +if test "${gl_cv_func_strstr_linear+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2) + Lucky user + #endif +#endif +#ifdef __CYGWIN__ + #include <cygwin/version.h> + #if CYGWIN_VERSION_DLL_MAJOR >= 1007 + Lucky user + #endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky user" >/dev/null 2>&1; then + gl_cv_func_strstr_linear=yes +else + gl_cv_func_strstr_linear="guessing no" +fi +rm -f conftest* +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <signal.h> /* for signal */ +#include <string.h> /* for memmem */ +#include <stdlib.h> /* for malloc */ +#include <unistd.h> /* for alarm */ +int +main () +{ +size_t m = 1000000; + char *haystack = (char *) malloc (2 * m + 2); + char *needle = (char *) malloc (m + 2); + void *result = 0; + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also have quadratic strstr. */ + signal (SIGALRM, SIG_DFL); + alarm (5); + /* Check for quadratic performance. */ + if (haystack && needle) + { + memset (haystack, 'A', 2 * m); + haystack[2 * m] = 'B'; + haystack[2 * m + 1] = 0; + memset (needle, 'A', m); + needle[m] = 'B'; + needle[m + 1] = 0; + result = strstr (haystack, needle); + } + return !result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_strstr_linear=yes +else + gl_cv_func_strstr_linear=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5 +$as_echo "$gl_cv_func_strstr_linear" >&6; } + if test "$gl_cv_func_strstr_linear" != yes; then + REPLACE_STRSTR=1 @@ -31149,248 +21395,222 @@ done - if test $gl_cv_have_include_next = yes; then - gl_cv_next_sys_stat_h='<'sys/stat.h'>' - else - { $as_echo "$as_me:$LINENO: checking absolute name of <sys/stat.h>" >&5 -$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } -if test "${gl_cv_next_sys_stat_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test $ac_cv_header_sys_stat_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/stat.h> + M4_LIBOBJS="$M4_LIBOBJS strstr.$ac_objext" -_ACEOF - gl_cv_next_sys_stat_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/sys/stat.h#{ - s#.*"\(.*/sys/stat.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_sys_stat_h='<'sys/stat.h'>' - fi + fi -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_stat_h" >&5 -$as_echo "$gl_cv_next_sys_stat_h" >&6; } - fi - NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h + GNULIB_STRSTR=1 - SYS_STAT_H='sys/stat.h' - { $as_echo "$as_me:$LINENO: checking for nlink_t" >&5 -$as_echo_n "checking for nlink_t... " >&6; } -if test "${ac_cv_type_nlink_t+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if test "${ac_cv_func_strtod+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_nlink_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sys/types.h> - #include <sys/stat.h> +$ac_includes_default +#ifndef strtod +double strtod (); +#endif int -main () +main() { -if (sizeof (nlink_t)) - return 0; - ; + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } return 0; } + _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_run "$LINENO"; then + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + + + + + + + + + M4_LIBOBJS="$M4_LIBOBJS strtod.$ac_objext" + +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = x""yes; then + : +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if test "${ac_cv_lib_m_pow+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <sys/types.h> - #include <sys/stat.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 pow (); int main () { -if (sizeof ((nlink_t))) - return 0; +return pow (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : +if ac_fn_c_try_link "$LINENO"; then + ac_cv_lib_m_pow=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_nlink_t=yes + ac_cv_lib_m_pow=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = x""yes; then + POW_LIB=-lm else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_nlink_t" >&5 -$as_echo "$ac_cv_type_nlink_t" >&6; } -if test "x$ac_cv_type_nlink_t" = x""yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define nlink_t int -_ACEOF fi - - - { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then + if test $ac_cv_func_strtod = no; then + HAVE_STRTOD=0 + REPLACE_STRTOD=1 + : + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtod obeys C99" >&5 +$as_echo_n "checking whether strtod obeys C99... " >&6; } +if test "${gl_cv_func_strtod_works+set}" = set; then $as_echo_n "(cached) " >&6 else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS - -fi - - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } + if test "$cross_compiling" = yes; then + gl_cv_func_strtod_works="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <math.h> +#include <errno.h> +/* Compare two numbers with ==. + This is a separate function because IRIX 6.5 "cc -O" miscompiles an + 'x == x' test. */ +static int +numeric_equal (double x, double y) +{ + return x == y; +} +int +main () +{ + { + /* Older glibc and Cygwin mis-parse "-0x". */ + const char *string = "-0x"; + char *term; + double value = strtod (string, &term); + double zero = 0.0; + if (1.0 / value != -1.0 / zero || term != (string + 2)) + return 1; + } + { + /* Many platforms do not parse hex floats. */ + const char *string = "0XaP+1"; + char *term; + double value = strtod (string, &term); + if (value != 20.0 || term != (string + 6)) + return 1; + } + { + /* Many platforms do not parse infinities. HP-UX 11.31 parses inf, + but mistakenly sets errno. */ + const char *string = "inf"; + char *term; + double value; + errno = 0; + value = strtod (string, &term); + if (value != HUGE_VAL || term != (string + 3) || errno) + return 1; + } + { + /* glibc 2.7 and cygwin 1.5.24 misparse "nan()". */ + const char *string = "nan()"; + char *term; + double value = strtod (string, &term); + if (numeric_equal (value, value) || term != (string + 5)) + return 1; + } - { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - $as_echo_n "(cached) " >&6 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_strtod_works=yes else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS - + gl_cv_func_strtod_works=no 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 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - - - - +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtod_works" >&5 +$as_echo "$gl_cv_func_strtod_works" >&6; } + if test "$gl_cv_func_strtod_works" != yes; then + REPLACE_STRTOD=1 + : @@ -31398,51 +21618,24 @@ $as_echo "$MKDIR_P" >&6; } - M4_LIBOBJS="$M4_LIBOBJS tempname.$ac_objext" + M4_LIBOBJS="$M4_LIBOBJS strtod.$ac_objext" +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = x""yes; then : +fi - - - - - - - - - - -for ac_func in __secure_getenv -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if test "${ac_cv_lib_m_pow+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#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 @@ -31450,72 +21643,41 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +char pow (); int main () { -return $ac_func (); +return pow (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then + ac_cv_lib_m_pow=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + ac_cv_lib_m_pow=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = x""yes; then + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF fi -done + fi + fi + GNULIB_STRTOD=1 @@ -31526,45 +21688,20 @@ done + for ac_func in strtol +do + ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" +if test "x$ac_cv_func_strtol" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_STRTOL 1 +_ACEOF - if test $gl_cv_have_include_next = yes; then - gl_cv_next_unistd_h='<'unistd.h'>' - else - { $as_echo "$as_me:$LINENO: checking absolute name of <unistd.h>" >&5 -$as_echo_n "checking absolute name of <unistd.h>... " >&6; } -if test "${gl_cv_next_unistd_h+set}" = set; then - $as_echo_n "(cached) " >&6 else - if test $ac_cv_header_unistd_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <unistd.h> - -_ACEOF - gl_cv_next_unistd_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | - sed -n '\#/unistd.h#{ - s#.*"\(.*/unistd.h\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"' - else - gl_cv_next_unistd_h='<'unistd.h'>' - fi + M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_unistd_h" >&5 -$as_echo "$gl_cv_next_unistd_h" >&6; } - fi - NEXT_UNISTD_H=$gl_cv_next_unistd_h - - - +done @@ -31572,10 +21709,10 @@ $as_echo "$gl_cv_next_unistd_h" >&6; } - if test $ac_cv_header_unistd_h = yes; then - HAVE_UNISTD_H=1 + if test $ac_cv_func_lstat = yes; then + HAVE_LSTAT=1 else - HAVE_UNISTD_H=0 + HAVE_LSTAT=0 fi @@ -31589,22 +21726,61 @@ $as_echo "$gl_cv_next_unistd_h" >&6; } + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 +$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } +if test "${gl_cv_next_sys_stat_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test $ac_cv_header_sys_stat_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/stat.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/stat.h#{ + s#.*"\(.*/sys/stat.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +$as_echo "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h - M4_LIBOBJS="$M4_LIBOBJS dup-safer.$ac_objext" + SYS_STAT_H='sys/stat.h' + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> + #include <sys/stat.h> +" +if test "x$ac_cv_type_nlink_t" = x""yes; then + : +else +$as_echo "#define nlink_t int" >>confdefs.h +fi - M4_LIBOBJS="$M4_LIBOBJS fd-safer.$ac_objext" @@ -31614,20 +21790,49 @@ $as_echo "$gl_cv_next_unistd_h" >&6; } - M4_LIBOBJS="$M4_LIBOBJS pipe-safer.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define USE_UNLOCKED_IO 1 -_ACEOF + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5 +$as_echo_n "checking absolute name of <sys/wait.h>... " >&6; } +if test "${gl_cv_next_sys_wait_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test $ac_cv_header_sys_wait_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/wait.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_wait_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/wait.h#{ + s#.*"\(.*/sys/wait.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5 +$as_echo "$gl_cv_next_sys_wait_h" >&6; } + fi + NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h + SYS_WAIT_H='sys/wait.h' @@ -31642,8 +21847,10 @@ _ACEOF + M4_LIBOBJS="$M4_LIBOBJS tempname.$ac_objext" + : @@ -31654,7 +21861,16 @@ _ACEOF + for ac_func in __secure_getenv +do + ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv" +if test "x$ac_cv_func___secure_getenv" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE___SECURE_GETENV 1 +_ACEOF +fi +done @@ -31666,14 +21882,51 @@ _ACEOF + if test $gl_cv_have_include_next = yes; then + gl_cv_next_unistd_h='<'unistd.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5 +$as_echo_n "checking absolute name of <unistd.h>... " >&6; } +if test "${gl_cv_next_unistd_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test $ac_cv_header_unistd_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/unistd.h#{ + s#.*"\(.*/unistd.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_unistd_h='<'unistd.h'>' + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 +$as_echo "$gl_cv_next_unistd_h" >&6; } + fi + NEXT_UNISTD_H=$gl_cv_next_unistd_h + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi @@ -31686,7 +21939,7 @@ _ACEOF - if test $ac_cv_func_vasnprintf = no; then + M4_LIBOBJS="$M4_LIBOBJS dup-safer.$ac_objext" @@ -31696,23 +21949,24 @@ _ACEOF + M4_LIBOBJS="$M4_LIBOBJS fd-safer.$ac_objext" - M4_LIBOBJS="$M4_LIBOBJS vasnprintf.$ac_objext" + M4_LIBOBJS="$M4_LIBOBJS pipe-safer.$ac_objext" +$as_echo "#define USE_UNLOCKED_IO 1" >>confdefs.h - M4_LIBOBJS="$M4_LIBOBJS printf-args.$ac_objext" @@ -31722,7 +21976,6 @@ _ACEOF - M4_LIBOBJS="$M4_LIBOBJS printf-parse.$ac_objext" @@ -31732,15 +21985,10 @@ _ACEOF - M4_LIBOBJS="$M4_LIBOBJS asnprintf.$ac_objext" + if test $ac_cv_func_vasnprintf = no; then - if test $ac_cv_func_vasnprintf = yes; then -cat >>confdefs.h <<\_ACEOF -#define REPLACE_VASNPRINTF 1 -_ACEOF - fi @@ -31748,113 +21996,19 @@ _ACEOF + M4_LIBOBJS="$M4_LIBOBJS vasnprintf.$ac_objext" - { $as_echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 -$as_echo_n "checking for ptrdiff_t... " >&6; } -if test "${ac_cv_type_ptrdiff_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_ptrdiff_t=no -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 () -{ -if (sizeof (ptrdiff_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - 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 () -{ -if (sizeof ((ptrdiff_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_ptrdiff_t=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 -$as_echo "$ac_cv_type_ptrdiff_t" >&6; } -if test "x$ac_cv_type_ptrdiff_t" = x""yes; then - : -else -cat >>confdefs.h <<\_ACEOF -#define ptrdiff_t long -_ACEOF + M4_LIBOBJS="$M4_LIBOBJS printf-args.$ac_objext" -fi @@ -31862,282 +22016,88 @@ fi + M4_LIBOBJS="$M4_LIBOBJS printf-parse.$ac_objext" -for ac_func in snprintf wcslen -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi + M4_LIBOBJS="$M4_LIBOBJS asnprintf.$ac_objext" -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi -fi -done - { $as_echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 -$as_echo_n "checking whether _snprintf is declared... " >&6; } -if test "${ac_cv_have_decl__snprintf+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -#ifndef _snprintf - (void) _snprintf; -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl__snprintf=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl__snprintf=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 -$as_echo "$ac_cv_have_decl__snprintf" >&6; } -if test "x$ac_cv_have_decl__snprintf" = x""yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SNPRINTF 1 -_ACEOF + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = x""yes; then + : else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SNPRINTF 0 -_ACEOF +$as_echo "#define ptrdiff_t long" >>confdefs.h -fi +fi - fi -for ac_func in vasprintf + for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h> +" +if test "x$ac_cv_have_decl__snprintf" = x""yes; then + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF $ac_have_decl _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + fi - eval "$as_ac_var=no" -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + for ac_func in vasprintf +do + ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_VASPRINTF 1 _ACEOF fi @@ -32187,9 +22147,11 @@ done + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format" + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format" @@ -32200,103 +22162,19 @@ done - gl_cv_func_vasprintf_posix=no - -for ac_func in vasprintf -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + gl_cv_func_vasprintf_posix=no + for ac_func in vasprintf +do + ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_VASPRINTF 1 _ACEOF fi @@ -32316,23 +22194,27 @@ done *yes) case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - if test $ac_cv_func_vasprintf = yes; then - # vasprintf exists and is - # already POSIX compliant. - gl_cv_func_vasprintf_posix=yes - fi + case "$gl_cv_func_printf_enomem" in + *yes) + if test $ac_cv_func_vasprintf = yes; then + # vasprintf exists and is + # already POSIX compliant. + gl_cv_func_vasprintf_posix=yes + fi + ;; + esac ;; esac ;; @@ -32367,9 +22249,7 @@ done ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_LONG_DOUBLE 1 -_ACEOF +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h ;; esac @@ -32381,9 +22261,7 @@ _ACEOF ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_INFINITE_DOUBLE 1 -_ACEOF +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h ;; esac @@ -32398,9 +22276,7 @@ _ACEOF ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1 -_ACEOF +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h ;; esac @@ -32414,124 +22290,42 @@ _ACEOF ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_DIRECTIVE_A 1 -_ACEOF - +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h -for ac_func in nl_langinfo + for ac_func in nl_langinfo do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif -#undef $ac_func +fi +done -/* 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 + ;; + esac -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) -fi -done +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h ;; esac - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_ls" in *yes) ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_DIRECTIVE_F 1 -_ACEOF +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h ;; esac @@ -32543,9 +22337,7 @@ _ACEOF ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_FLAG_GROUPING 1 -_ACEOF +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h ;; esac @@ -32557,9 +22349,7 @@ _ACEOF ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_FLAG_LEFTADJUST 1 -_ACEOF +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h ;; esac @@ -32571,9 +22361,7 @@ _ACEOF ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_FLAG_ZERO 1 -_ACEOF +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h ;; esac @@ -32585,19 +22373,13 @@ _ACEOF ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_UNBOUNDED_PRECISION 1 -_ACEOF +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_DOUBLE 1 -_ACEOF +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_LONG_DOUBLE 1 -_ACEOF +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h ;; esac @@ -32609,19 +22391,13 @@ _ACEOF ;; *) -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_ENOMEM 1 -_ACEOF +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_DOUBLE 1 -_ACEOF +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define NEED_PRINTF_LONG_DOUBLE 1 -_ACEOF +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h ;; esac @@ -32636,11 +22412,6 @@ _ACEOF - - - - - M4_LIBOBJS="$M4_LIBOBJS vasnprintf.$ac_objext" @@ -32675,9 +22446,7 @@ _ACEOF if test $ac_cv_func_vasnprintf = yes; then -cat >>confdefs.h <<\_ACEOF -#define REPLACE_VASNPRINTF 1 -_ACEOF +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h fi @@ -32690,107 +22459,12 @@ _ACEOF - { $as_echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 -$as_echo_n "checking for ptrdiff_t... " >&6; } -if test "${ac_cv_type_ptrdiff_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_ptrdiff_t=no -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 () -{ -if (sizeof (ptrdiff_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - 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 () -{ -if (sizeof ((ptrdiff_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_ptrdiff_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 -$as_echo "$ac_cv_type_ptrdiff_t" >&6; } + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" if test "x$ac_cv_type_ptrdiff_t" = x""yes; then : else -cat >>confdefs.h <<\_ACEOF -#define ptrdiff_t long -_ACEOF +$as_echo "#define ptrdiff_t long" >>confdefs.h fi @@ -32802,100 +22476,11 @@ fi - - -for ac_func in snprintf wcslen + for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -32904,77 +22489,19 @@ _ACEOF fi done - { $as_echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 -$as_echo_n "checking whether _snprintf is declared... " >&6; } -if test "${ac_cv_have_decl__snprintf+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdio.h> - -int -main () -{ -#ifndef _snprintf - (void) _snprintf; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl__snprintf=yes + ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h> +" +if test "x$ac_cv_have_decl__snprintf" = x""yes; then + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl__snprintf=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_have_decl=0 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 -$as_echo "$ac_cv_have_decl__snprintf" >&6; } -if test "x$ac_cv_have_decl__snprintf" = x""yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SNPRINTF 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SNPRINTF 0 +#define HAVE_DECL__SNPRINTF $ac_have_decl _ACEOF -fi - - - @@ -33017,45 +22544,46 @@ fi + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror:3:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror_at_line:5:c-format" + + - { $as_echo "$as_me:$LINENO: checking whether <wchar.h> is standalone" >&5 + for ac_func in waitid +do + ac_fn_c_check_func "$LINENO" "waitid" "ac_cv_func_waitid" +if test "x$ac_cv_func_waitid" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_WAITID 1 +_ACEOF + +fi +done + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> is standalone" >&5 $as_echo_n "checking whether <wchar.h> is standalone... " >&6; } if test "${gl_cv_header_wchar_h_standalone+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ #include <wchar.h> wchar_t w; _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then gl_cv_header_wchar_h_standalone=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_header_wchar_h_standalone=no + gl_cv_header_wchar_h_standalone=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_standalone" >&5 $as_echo "$gl_cv_header_wchar_h_standalone" >&6; } @@ -33071,11 +22599,6 @@ $as_echo "$gl_cv_header_wchar_h_standalo fi - - - - - if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 else @@ -33088,30 +22611,26 @@ $as_echo "$gl_cv_header_wchar_h_standalo - - - - if test $gl_cv_have_include_next = yes; then gl_cv_next_wchar_h='<'wchar.h'>' else - { $as_echo "$as_me:$LINENO: checking absolute name of <wchar.h>" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5 $as_echo_n "checking absolute name of <wchar.h>... " >&6; } if test "${gl_cv_next_wchar_h+set}" = set; then $as_echo_n "(cached) " >&6 else if test $ac_cv_header_wchar_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <wchar.h> _ACEOF - gl_cv_next_wchar_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/wchar.h#{ s#.*"\(.*/wchar.h\)".*#\1# s#^/[^/]#//&# @@ -33123,7 +22642,7 @@ _ACEOF fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_wchar_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 $as_echo "$gl_cv_next_wchar_h" >&6; } fi NEXT_WCHAR_H=$gl_cv_next_wchar_h @@ -33136,6 +22655,109 @@ $as_echo "$gl_cv_next_wchar_h" >&6; } + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + else + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5 +$as_echo_n "checking whether wcrtomb return value is correct... " >&6; } +if test "${gl_cv_func_wcrtomb_retval+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on OSF/1 and Solaris. + osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdio.h> +#include <string.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_wcrtomb_retval=yes +else + gl_cv_func_wcrtomb_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5 +$as_echo "$gl_cv_func_wcrtomb_retval" >&6; } + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + M4_LIBOBJS="$M4_LIBOBJS wcrtomb.$ac_objext" + + + : + + fi + + + + GNULIB_WCRTOMB=1 + @@ -33149,11 +22771,6 @@ $as_echo "$gl_cv_next_wchar_h" >&6; } - - - - - if test $gt_cv_c_wint_t = yes; then HAVE_WINT_T=1 else @@ -33164,18 +22781,14 @@ $as_echo "$gl_cv_next_wchar_h" >&6; } WCTYPE_H=wctype.h if test $ac_cv_header_wctype_h = yes; then if test $ac_cv_func_iswcntrl = yes; then - { $as_echo "$as_me:$LINENO: checking whether iswcntrl works" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 $as_echo_n "checking whether iswcntrl works... " >&6; } if test "${gl_cv_func_iswcntrl_works+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> #if __GNU_LIBRARY__ == 1 @@ -33189,40 +22802,15 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then gl_cv_func_iswcntrl_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_iswcntrl_works=no + gl_cv_func_iswcntrl_works=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stddef.h> #include <stdio.h> @@ -33231,45 +22819,18 @@ cat >>conftest.$ac_ext <<_ACEOF #include <wctype.h> int main () { return iswprint ('x') == 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then gl_cv_func_iswcntrl_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_iswcntrl_works=no + gl_cv_func_iswcntrl_works=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_iswcntrl_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 $as_echo "$gl_cv_func_iswcntrl_works" >&6; } if test $gl_cv_func_iswcntrl_works = yes; then WCTYPE_H= @@ -33281,30 +22842,26 @@ $as_echo "$gl_cv_func_iswcntrl_works" >& - - - - if test $gl_cv_have_include_next = yes; then gl_cv_next_wctype_h='<'wctype.h'>' else - { $as_echo "$as_me:$LINENO: checking absolute name of <wctype.h>" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 $as_echo_n "checking absolute name of <wctype.h>... " >&6; } if test "${gl_cv_next_wctype_h+set}" = set; then $as_echo_n "(cached) " >&6 else if test $ac_cv_header_wctype_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <wctype.h> _ACEOF - gl_cv_next_wctype_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/wctype.h#{ s#.*"\(.*/wctype.h\)".*#\1# s#^/[^/]#//&# @@ -33316,7 +22873,7 @@ _ACEOF fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_wctype_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 $as_echo "$gl_cv_next_wctype_h" >&6; } fi NEXT_WCTYPE_H=$gl_cv_next_wctype_h @@ -33359,153 +22916,29 @@ $as_echo "$gl_cv_next_wctype_h" >&6; } + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xprintf:1:c-format" -for ac_header in stdint.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvprintf:1:c-format" - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xfprintf:2:c-format" - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvfprintf:2:c-format" -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + + + + for ac_header in stdint.h +do + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_STDINT_H 1 _ACEOF fi @@ -33523,6 +22956,9 @@ done + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format" + + @@ -33541,9 +22977,211 @@ done + gl_source_base='tests' - { $as_echo "$as_me:$LINENO: checking where to find the exponent in a 'double'" >&5 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 $as_echo_n "checking where to find the exponent in a 'double'... " >&6; } if test "${gl_cv_cc_double_expbit0+set}" = set; then $as_echo_n "(cached) " >&6 @@ -33551,11 +23189,7 @@ else if test "$cross_compiling" = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined arm || defined __arm || defined __arm__ @@ -33568,18 +23202,13 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>& gl_cv_cc_double_expbit0="unknown" else - - : + : if test "${ac_cv_c_bigendian+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler @@ -33587,46 +23216,34 @@ cat >>conftest.$ac_ext <<_ACEOF typedef int dummy; _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then # Check for potential -arch flags. It is not universal unless - # there are some -arch flags. Note that *ppc* also matches - # ppc64. This check is also rather less than ideal. - case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( - *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; - esac -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> @@ -33644,30 +23261,9 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then # It does; now see whether it defined to BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> @@ -33683,49 +23279,18 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> @@ -33734,36 +23299,15 @@ main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + #endif + + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> @@ -33778,51 +23322,20 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then # Try to guess by grepping values from an object file. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; @@ -33848,24 +23361,7 @@ return use_ascii (foo) == use_ebcdic (fo return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -33877,20 +23373,10 @@ $as_echo "$ac_try_echo") >&5 ac_cv_c_bigendian=unknown fi fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -33910,42 +23396,15 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then ac_cv_c_bigendian=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes + ac_cv_c_bigendian=yes fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi fi : @@ -33956,26 +23415,240 @@ fi gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( universal) -cat >>confdefs.h <<\_ACEOF -#define AC_APPLE_UNIVERSAL_BUILD 1 +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_double_expbit0=`cat conftest.out` +else + gl_cv_cc_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +$as_echo "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if test "${gl_cv_cc_float_expbit0+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then + gl_cv_cc_float_expbit0="word 0 bit 23" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <float.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (float x) +{ + memory_float m; + size_t i; + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_float_expbit0=`cat conftest.out` +else + gl_cv_cc_float_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_BIT $bit _ACEOF - ;; #( - *) - gl_cv_cc_double_expbit0="unknown" ;; - esac + ;; + esac -fi -rm -f conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 +$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } +if test "${gl_cv_cc_long_double_expbit0+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then + + gl_cv_cc_long_double_expbit0="unknown" else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <float.h> @@ -33983,16 +23656,18 @@ cat >>conftest.$ac_ext <<_ACEOF #include <stdio.h> #include <string.h> #define NWORDS \ - ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { double value; unsigned int word[NWORDS]; } memory_double; + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { long double value; unsigned int word[NWORDS]; } + memory_long_double; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (double x) +static void add_to_ored_words (long double x) { - memory_double m; + memory_long_double m; size_t i; - /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ - memset (&m, 0, sizeof (memory_double)); + /* Clear it first, in case + sizeof (long double) < sizeof (memory_long_double). */ + memset (&m, 0, sizeof (memory_long_double)); m.value = x; for (i = 0; i < NWORDS; i++) { @@ -34008,11 +23683,11 @@ int main () return 1; for (j = 0; j < NWORDS; j++) anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25); - add_to_ored_words (0.5); - add_to_ored_words (1.0); - add_to_ored_words (2.0); - add_to_ored_words (4.0); + add_to_ored_words (0.25L); + add_to_ored_words (0.5L); + add_to_ored_words (1.0L); + add_to_ored_words (2.0L); + add_to_ored_words (4.0L); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) @@ -34042,362 +23717,818 @@ int main () } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 +if ac_fn_c_try_run "$LINENO"; then + gl_cv_cc_long_double_expbit0=`cat conftest.out` +else + gl_cv_cc_long_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5 +$as_echo "$gl_cv_cc_long_double_expbit0" >&6; } + case "$gl_cv_cc_long_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +$as_echo_n "checking for a traditional japanese locale... " >&6; } +if test "${gt_cv_locale_ja+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +$as_echo "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if test "${gt_cv_locale_zh_CN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_double_expbit0=`cat conftest.out` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* -( exit $ac_status ) -gl_cv_cc_double_expbit0="unknown" fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - rm -f conftest.out +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_double_expbit0" >&5 -$as_echo "$gl_cv_cc_double_expbit0" >&6; } - case "$gl_cv_cc_double_expbit0" in - word*bit*) - word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` -cat >>confdefs.h <<_ACEOF -#define DBL_EXPBIT0_WORD $word + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +[ + #if defined _MSC_VER || defined __MINGW32__ + notposix + #endif + ] _ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "notposix" >/dev/null 2>&1; then + posix_spawn_ported=no +else + posix_spawn_ported=yes +fi +rm -f conftest* + if test $posix_spawn_ported = yes; then + POSIX_SPAWN_PORTED_TRUE= + POSIX_SPAWN_PORTED_FALSE='#' +else + POSIX_SPAWN_PORTED_TRUE='#' + POSIX_SPAWN_PORTED_FALSE= +fi -cat >>confdefs.h <<_ACEOF -#define DBL_EXPBIT0_BIT $bit -_ACEOF - ;; - esac - { $as_echo "$as_me:$LINENO: checking where to find the exponent in a 'float'" >&5 -$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } -if test "${gl_cv_cc_float_expbit0+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - gl_cv_cc_float_expbit0="word 0 bit 23" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <float.h> -#include <stddef.h> -#include <stdio.h> +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> #include <string.h> -#define NWORDS \ - ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { float value; unsigned int word[NWORDS]; } memory_float; -static unsigned int ored_words[NWORDS]; -static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (float x) -{ - memory_float m; - size_t i; - /* Clear it first, in case - sizeof (float) < sizeof (memory_float). */ - memset (&m, 0, sizeof (memory_float)); - m.value = x; - for (i = 0; i < NWORDS; i++) - { - ored_words[i] |= m.word[i]; - anded_words[i] &= m.word[i]; - } -} -int main () -{ - size_t j; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - for (j = 0; j < NWORDS; j++) - anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25f); - add_to_ored_words (0.5f); - add_to_ored_words (1.0f); - add_to_ored_words (2.0f); - add_to_ored_words (4.0f); - /* Remove bits that are common (e.g. if representation of the first mantissa - bit is explicit). */ - for (j = 0; j < NWORDS; j++) - ored_words[j] &= ~anded_words[j]; - /* Now find the nonzero word. */ - for (j = 0; j < NWORDS; j++) - if (ored_words[j] != 0) - break; - if (j < NWORDS) - { - size_t i; - for (i = j + 1; i < NWORDS; i++) - if (ored_words[i] != 0) - { - fprintf (fp, "unknown"); - return (fclose (fp) != 0); - } - for (i = 0; ; i++) - if ((ored_words[j] >> i) & 1) - { - fprintf (fp, "word %d bit %d", (int) j, (int) i); - return (fclose (fp) != 0); - } - } - fprintf (fp, "unknown"); - return (fclose (fp) != 0); +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_float_expbit0=`cat conftest.out` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* -( exit $ac_status ) -gl_cv_cc_float_expbit0="unknown" -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr - rm -f conftest.out -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_float_expbit0" >&5 -$as_echo "$gl_cv_cc_float_expbit0" >&6; } - case "$gl_cv_cc_float_expbit0" in - word*bit*) - word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` -cat >>confdefs.h <<_ACEOF -#define FLT_EXPBIT0_WORD $word -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define FLT_EXPBIT0_BIT $bit -_ACEOF +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} - ;; - esac +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 - { $as_echo "$as_me:$LINENO: checking where to find the exponent in a 'long double'" >&5 -$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } -if test "${gl_cv_cc_long_double_expbit0+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - gl_cv_cc_long_double_expbit0="unknown" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 -#include <float.h> -#include <stddef.h> -#include <stdio.h> -#include <string.h> -#define NWORDS \ - ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { long double value; unsigned int word[NWORDS]; } - memory_long_double; -static unsigned int ored_words[NWORDS]; -static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (long double x) -{ - memory_long_double m; - size_t i; - /* Clear it first, in case - sizeof (long double) < sizeof (memory_long_double). */ - memset (&m, 0, sizeof (memory_long_double)); - m.value = x; - for (i = 0; i < NWORDS; i++) - { - ored_words[i] |= m.word[i]; - anded_words[i] &= m.word[i]; - } -} -int main () -{ - size_t j; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - for (j = 0; j < NWORDS; j++) - anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25L); - add_to_ored_words (0.5L); - add_to_ored_words (1.0L); - add_to_ored_words (2.0L); - add_to_ored_words (4.0L); - /* Remove bits that are common (e.g. if representation of the first mantissa - bit is explicit). */ - for (j = 0; j < NWORDS; j++) - ored_words[j] &= ~anded_words[j]; - /* Now find the nonzero word. */ - for (j = 0; j < NWORDS; j++) - if (ored_words[j] != 0) - break; - if (j < NWORDS) - { - size_t i; - for (i = j + 1; i < NWORDS; i++) - if (ored_words[i] != 0) - { - fprintf (fp, "unknown"); - return (fclose (fp) != 0); - } - for (i = 0; ; i++) - if ((ored_words[j] >> i) & 1) - { - fprintf (fp, "word %d bit %d", (int) j, (int) i); - return (fclose (fp) != 0); - } - } - fprintf (fp, "unknown"); - return (fclose (fp) != 0); -} + + + + + + + M4tests_LIBOBJS="$M4tests_LIBOBJS setenv.$ac_objext" + + + + + + for ac_header in search.h +do + ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" +if test "x$ac_cv_header_search_h" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SEARCH_H 1 _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_cc_long_double_expbit0=`cat conftest.out` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -gl_cv_cc_long_double_expbit0="unknown" -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +done - rm -f conftest.out + for ac_func in tsearch +do + ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" +if test "x$ac_cv_func_tsearch" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_TSEARCH 1 +_ACEOF fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_cc_long_double_expbit0" >&5 -$as_echo "$gl_cv_cc_long_double_expbit0" >&6; } - case "$gl_cv_cc_long_double_expbit0" in - word*bit*) - word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` +done -cat >>confdefs.h <<_ACEOF -#define LDBL_EXPBIT0_WORD $word -_ACEOF + fi -cat >>confdefs.h <<_ACEOF -#define LDBL_EXPBIT0_BIT $bit -_ACEOF - ;; - esac + + GNULIB_SETENV=1 - { $as_echo "$as_me:$LINENO: checking for wchar_t" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 $as_echo_n "checking for wchar_t... " >&6; } if test "${gt_cv_c_wchar_t+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stddef.h> wchar_t foo = (wchar_t)'\0'; @@ -34409,55 +24540,28 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then gt_cv_c_wchar_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_c_wchar_t=no + gt_cv_c_wchar_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 $as_echo "$gt_cv_c_wchar_t" >&6; } if test $gt_cv_c_wchar_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WCHAR_T 1 -_ACEOF +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for wint_t" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 $as_echo_n "checking for wint_t... " >&6; } if test "${gt_cv_c_wint_t+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before @@ -34477,47 +24581,38 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then gt_cv_c_wint_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_c_wint_t=no + gt_cv_c_wint_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 $as_echo "$gt_cv_c_wint_t" >&6; } if test $gt_cv_c_wint_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WINT_T 1 -_ACEOF +$as_echo "#define HAVE_WINT_T 1" >>confdefs.h fi + for ac_func in unsetenv +do + ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_UNSETENV 1 +_ACEOF + +fi +done + + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + @@ -34525,387 +24620,600 @@ _ACEOF + M4tests_LIBOBJS="$M4tests_LIBOBJS unsetenv.$ac_objext" -for ac_func in strdup -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + + + + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 +$as_echo_n "checking for unsetenv() return type... " >&6; } +if test "${gt_cv_func_unsetenv_ret+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +int unsetenv (const char *name); +#else +int unsetenv(); +#endif + +int +main () +{ + + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then + gt_cv_func_unsetenv_ret='int' +else + gt_cv_func_unsetenv_ret='void' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 +$as_echo "$gt_cv_func_unsetenv_ret" >&6; } + if test $gt_cv_func_unsetenv_ret = 'void'; then + VOID_UNSETENV=1 + fi + fi + + + + GNULIB_UNSETENV=1 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; #endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} -#undef $ac_func +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* -/* 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" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +$as_echo_n "checking for a traditional japanese locale... " >&6; } +if test "${gt_cv_locale_ja+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> #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 +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } #endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} -int -main () +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +$as_echo "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if test "${gt_cv_locale_zh_CN+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { -return $ac_func (); - ; + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; return 0; } + _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* - eval "$as_ac_var=no" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -else - M4tests_LIBOBJS="$M4tests_LIBOBJS $ac_func.$ac_objext" -fi -done + if test $ac_cv_func_wctob = no; then + HAVE_DECL_WCTOB=0 + WCHAR_H=wchar.h - if test $ac_cv_have_decl_strdup = no; then - HAVE_DECL_STRDUP=0 - fi - : - GNULIB_STRDUP=1 + M4tests_LIBOBJS="$M4tests_LIBOBJS wctob.$ac_objext" + : + else - if test $gl_threads_api = posix; then - gl_save_LIBS="$LIBS" - LIBS="$LIBS $LIBMULTITHREAD" -for ac_func in pthread_atfork -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5 +$as_echo_n "checking whether wctob works... " >&6; } +if test "${gl_cv_func_wctob_works+set}" = set; then $as_echo_n "(cached) " >&6 else - 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 <limits.h> declares $ac_func. - For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#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 + case "$host_os" in + # Guess no on Solaris <= 9. + solaris2.[1-9] | solaris2.[1-9].*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac + if test $LOCALE_FR != none; then + if test "$cross_compiling" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -int -main () +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () { -return $ac_func (); - ; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_run "$LINENO"; then + gl_cv_func_wctob_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + gl_cv_func_wctob_works=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + + fi fi -done +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5 +$as_echo "$gl_cv_func_wctob_works" >&6; } + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 1; then - LIBS="$gl_save_LIBS" - fi + WCHAR_H=wchar.h - YIELD_LIB= - if test $gl_threads_api = posix; then - { $as_echo "$as_me:$LINENO: checking for sched_yield in -lrt" >&5 -$as_echo_n "checking for sched_yield in -lrt... " >&6; } -if test "${ac_cv_lib_rt_sched_yield+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lrt $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 sched_yield (); -int -main () -{ -return sched_yield (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_rt_sched_yield=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_rt_sched_yield=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rt_sched_yield" >&5 -$as_echo "$ac_cv_lib_rt_sched_yield" >&6; } -if test "x$ac_cv_lib_rt_sched_yield" = x""yes; then - YIELD_LIB=-lrt -else - { $as_echo "$as_me:$LINENO: checking for sched_yield in -lposix4" >&5 -$as_echo_n "checking for sched_yield in -lposix4... " >&6; } -if test "${ac_cv_lib_posix4_sched_yield+set}" = set; then - $as_echo_n "(cached) " >&6 + + + + + M4tests_LIBOBJS="$M4tests_LIBOBJS wctob.$ac_objext" + + + : + + else + + ac_fn_c_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" " +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> + +" +if test "x$ac_cv_have_decl_wctob" = x""yes; then + ac_have_decl=1 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lposix4 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + ac_have_decl=0 +fi -/* 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 sched_yield (); -int -main () -{ -return sched_yield (); - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_WCTOB $ac_have_decl _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_posix4_sched_yield=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_posix4_sched_yield=no -fi + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix4_sched_yield" >&5 -$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } -if test "x$ac_cv_lib_posix4_sched_yield" = x""yes; then - YIELD_LIB=-lposix4 -fi -fi + WCHAR_H=wchar.h + fi + fi fi + GNULIB_WCTOB=1 + + @@ -34922,171 +25230,134 @@ fi -{ $as_echo "$as_me:$LINENO: checking if system() agrees with pclose()" >&5 -$as_echo_n "checking if system() agrees with pclose()... " >&6; } -if test "${M4_cv_func_system_consistent+set}" = set; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether an open file can be renamed" >&5 +$as_echo_n "checking whether an open file can be renamed... " >&6; } +if test "${M4_cv_func_rename_open_file_works+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then - cat >conftest.$ac_ext <<_ACEOF - -/* EMX on OS/2 defines WEXITSTATUS to be (x>>8)&0xff, and uses that for - pclose(), but for system() it uses x&0xff instead. Otherwise, we assume - your system is sane and that pclose() and system() are consistent in their - values. If this heuristic is wrong for your platform, report it as a bug - to bug-m4@gnu.org. */ -#ifdef __EMX__ -choke me -#endif - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - M4_cv_func_system_consistent=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - M4_cv_func_system_consistent=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + M4_cv_func_rename_open_file_works='guessing no' else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> - -int -main () -{ -int i1, i2; - FILE *f; - i1 = system ("exit 2"); - if (i1 == -1) - return 1; - f = popen ("exit 2", "r"); - if (!f) - return 1; - i2 = pclose (f); - return i1 != i2; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - M4_cv_func_system_consistent=yes +$ac_includes_default +int +main () +{ +FILE *f = fopen ("conftest.1", "w+"); + int result = rename ("conftest.1", "conftest.2"); + fclose (f); remove ("conftest.1"); remove ("conftest.2"); + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then + M4_cv_func_rename_open_file_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -M4_cv_func_system_consistent=no + M4_cv_func_rename_open_file_works=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $M4_cv_func_system_consistent" >&5 -$as_echo "$M4_cv_func_system_consistent" >&6; } -if test "$M4_cv_func_system_consistent" = no ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $M4_cv_func_rename_open_file_works" >&5 +$as_echo "$M4_cv_func_rename_open_file_works" >&6; } +if test "$M4_cv_func_rename_open_file_works" = yes ; then + M4_rename_open_works=1 +else + M4_rename_open_works=0 +fi -cat >>confdefs.h <<\_ACEOF -#define FUNC_SYSTEM_BROKEN 1 +cat >>confdefs.h <<_ACEOF +#define RENAME_OPEN_FILE_WORKS $M4_rename_open_works _ACEOF -fi -{ $as_echo "$as_me:$LINENO: checking if changeword is wanted" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if changeword is wanted" >&5 $as_echo_n "checking if changeword is wanted... " >&6; } # Check whether --enable-changeword was given. if test "${enable_changeword+set}" = set; then enableval=$enable_changeword; if test "$enableval" = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -cat >>confdefs.h <<\_ACEOF -#define ENABLE_CHANGEWORD 1 -_ACEOF +$as_echo "#define ENABLE_CHANGEWORD 1" >>confdefs.h else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -{ $as_echo "$as_me:$LINENO: checking if malloc debugging is wanted" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which shell to use for syscmd" >&5 +$as_echo_n "checking which shell to use for syscmd... " >&6; } + +# Check whether --with-syscmd-shell was given. +if test "${with_syscmd_shell+set}" = set; then + withval=$with_syscmd_shell; case $withval in + yes) with_syscmd_shell=no;; + esac +else + with_syscmd_shell=no +fi + +if test "$with_syscmd_shell" = no ; then + with_syscmd_shell=/bin/sh + if test "$cross_compiling" != yes ; then + if { test -f /bin/sh && $as_test_x /bin/sh; }; then + : +else + if (cmd /c) 2>/dev/null; then with_syscmd_shell=cmd; fi +fi + M4_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for M4_dir in `if (command -p getconf PATH) 2>/dev/null ; then + command -p getconf PATH + else + echo "/bin$PATH_SEPARATOR$PATH" + fi` + do + IFS=$M4_save_IFS + test -z "$M4_dir" && continue + { test -f "$M4_dir/sh" && $as_test_x "$M4_dir/sh"; } \ + && { with_syscmd_shell=$M4_dir/sh; break; } + done + IFS=$M4_save_IFS + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_syscmd_shell" >&5 +$as_echo "$with_syscmd_shell" >&6; } + +cat >>confdefs.h <<_ACEOF +#define SYSCMD_SHELL "$with_syscmd_shell" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if malloc debugging is wanted" >&5 $as_echo_n "checking if malloc debugging is wanted... " >&6; } # Check whether --with-dmalloc was given. if test "${with_dmalloc+set}" = set; then withval=$with_dmalloc; if test "$withval" = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -cat >>confdefs.h <<\_ACEOF -#define WITH_DMALLOC 1 -_ACEOF +$as_echo "#define WITH_DMALLOC 1" >>confdefs.h LIBS="$LIBS -ldmalloc" LDFLAGS="$LDFLAGS -g" else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -35124,13 +25395,13 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -35138,8 +25409,8 @@ $as_echo "$as_me: WARNING: cache variabl (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -35162,11 +25433,11 @@ $as_echo "$as_me: WARNING: cache variabl if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -35186,8 +25457,8 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -35195,29 +25466,21 @@ LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"GL_COND_LIBTOOL\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"GL_COND_LIBTOOL\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "conditional \"GL_COND_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS= + M4_libobjs= M4_ltlibobjs= if test -n "$M4_LIBOBJS"; then @@ -35234,6 +25497,10 @@ test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS +if test -z "${POSIX_SPAWN_PORTED_TRUE}" && test -z "${POSIX_SPAWN_PORTED_FALSE}"; then + as_fn_error "conditional \"POSIX_SPAWN_PORTED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi M4tests_libobjs= M4tests_ltlibobjs= @@ -35255,9 +25522,10 @@ test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -35267,13 +25535,14 @@ cat >$CONFIG_STATUS <<_ACEOF || ac_write debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh @@ -35285,23 +25554,13 @@ if test -n "${ZSH_VERSION+set}" && (emul alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) set -o posix ;; #( + *) : ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -35309,7 +25568,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -35320,7 +25585,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -35343,13 +25608,6 @@ if test "${PATH_SEPARATOR+set}" != set; } 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 @@ -35359,15 +25617,15 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -35379,12 +25637,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -35396,7 +25658,90 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit [STATUS=$?] +# ---------------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + as_status=$? + set +e + as_fn_set_status ${1-$as_status} + exit ${1-$as_status} +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -35410,8 +25755,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -35431,62 +25780,15 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #(((( -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. @@ -35495,12 +25797,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -35529,8 +25825,56 @@ fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -35549,10 +25893,10 @@ else if test -d "$1"; then test -d "$1/."; else - case $1 in + case $1 in #( -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -35567,13 +25911,19 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Save the log message, to keep $[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU M4 $as_me 1.4.12, which was -generated by GNU Autoconf 2.63. Invocation command line was +This file was extended by GNU M4 $as_me 1.4.13, which was +generated by GNU Autoconf 2.63b. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -35634,16 +25984,18 @@ $config_links Configuration commands: $config_commands -Report bugs to <bug-autoconf@gnu.org>." +Report bugs to <bug-m4@gnu.org>. +GNU M4 home page: <http://www.gnu.org/software/m4/>. +General help using GNU software: <http://www.gnu.org/gethelp/>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -GNU M4 config.status 1.4.12 -configured by $0, generated by GNU Autoconf 2.63, +GNU M4 config.status 1.4.13 +configured by $0, generated by GNU Autoconf 2.63b, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -35686,20 +26038,19 @@ do case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -35707,11 +26058,10 @@ Try \`$0 --help' for more information." ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" + *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac @@ -35775,9 +26125,7 @@ do "checks/Makefile") CONFIG_FILES="$CONFIG_FILES checks/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -35805,7 +26153,7 @@ $debug || trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -35816,11 +26164,7 @@ $debug || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -35828,10 +26172,16 @@ $debug || if test -n "$CONFIG_FILES"; then -ac_cr=' ' +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' + ac_cs_awk_cr='\r' else ac_cs_awk_cr=$ac_cr fi @@ -35845,24 +26195,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -35951,9 +26295,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), @@ -35994,9 +26336,7 @@ for ac_last_try in false false :; do if test -z "$ac_t"; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -36081,9 +26421,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -36096,9 +26434,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -36126,12 +26462,10 @@ $as_echo "$as_me: error: invalid tag $ac [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -36142,7 +26476,7 @@ $as_echo "$as_me: error: cannot find inp `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. @@ -36155,9 +26489,7 @@ $as_echo "$as_me: creating $ac_file" >&6 case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -36185,47 +26517,7 @@ $as_echo X"$ac_file" | q } s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in @@ -36282,7 +26574,6 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # 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= - ac_sed_dataroot=' /datarootdir/ { p @@ -36292,12 +26583,11 @@ ac_sed_dataroot=' /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p -' +/@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -36307,7 +26597,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -36336,14 +26626,12 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} @@ -36353,9 +26641,7 @@ which seems to be undefined. Please mak -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -36366,25 +26652,19 @@ $as_echo "$as_me: error: could not creat $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -36434,13 +26714,11 @@ $as_echo X"$_am_arg" | ac_source=$srcdir/$ac_source fi - { $as_echo "$as_me:$LINENO: linking $ac_source to $ac_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;} if test ! -r "$ac_source"; then - { { $as_echo "$as_me:$LINENO: error: $ac_source: file not found" >&5 -$as_echo "$as_me: error: $ac_source: file not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$ac_source: file not found" "$LINENO" 5 fi rm -f "$ac_file" @@ -36452,30 +26730,38 @@ $as_echo "$as_me: error: $ac_source: fil ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || ln "$ac_source" "$ac_file" 2>/dev/null || cp -p "$ac_source" "$ac_file" || - { { $as_echo "$as_me:$LINENO: error: cannot link or copy $ac_source to $ac_file" >&5 -$as_echo "$as_me: error: cannot link or copy $ac_source to $ac_file" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 fi ;; - :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ @@ -36498,28 +26784,28 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ @@ -36542,51 +26828,12 @@ $as_echo X"$file" | q } s/.*/./; q'` - { as_dir=$dirpart/$fdir - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" done -done +} ;; "stamp-h":C) test -z "$CONFIG_HEADERS" || date > stamp-h ;; @@ -36594,15 +26841,12 @@ done done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -36623,10 +26867,10 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff -ruNp m4-1.4.12/configure.ac m4-1.4.13/configure.ac --- m4-1.4.12/configure.ac 2008-08-11 20:48:22.000000000 -0600 +++ m4-1.4.13/configure.ac 2009-03-23 05:45:45.000000000 -0600 @@ -1,6 +1,6 @@ # Configure template for GNU M4. -*-Autoconf-*- -# Copyright (C) 1991, 1993, 1994, 2004, 2005, 2006, 2007, 2008 Free -# Software Foundation, Inc. +# Copyright (C) 1991, 1993, 1994, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. # # This file is part of GNU M4. # @@ -22,7 +22,7 @@ AC_INIT([GNU M4], m4_esyscmd([build-aux/ [bug-m4@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) -AM_INIT_AUTOMAKE([1.10.1 dist-bzip2 dist-lzma gnu]) +AM_INIT_AUTOMAKE([1.10.1 dist-bzip2 gnu]) m4_pattern_forbid([^M4_[A-Z]]) @@ -49,37 +49,23 @@ fi M4_INIT -AC_CACHE_CHECK([if system() agrees with pclose()], - [M4_cv_func_system_consistent], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([ -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> -], [int i1, i2; - FILE *f; - i1 = system ("exit 2"); - if (i1 == -1) - return 1; - f = popen ("exit 2", "r"); - if (!f) - return 1; - i2 = pclose (f); - return i1 != i2;])], - [M4_cv_func_system_consistent=yes], [M4_cv_func_system_consistent=no], - [AC_COMPILE_IFELSE([ -/* EMX on OS/2 defines WEXITSTATUS to be (x>>8)&0xff, and uses that for - pclose(), but for system() it uses x&0xff instead. Otherwise, we assume - your system is sane and that pclose() and system() are consistent in their - values. If this heuristic is wrong for your platform, report it as a bug - to bug-m4@gnu.org. */ -#ifdef __EMX__ -choke me -#endif -], [M4_cv_func_system_consistent=yes], [M4_cv_func_system_consistent=no])])]) -if test "$M4_cv_func_system_consistent" = no ; then - AC_DEFINE([FUNC_SYSTEM_BROKEN], [1], - [Define to 1 if the return value of system() disagrees with pclose().]) +AC_CACHE_CHECK([whether an open file can be renamed], + [M4_cv_func_rename_open_file_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], + [FILE *f = fopen ("conftest.1", "w+"); + int result = rename ("conftest.1", "conftest.2"); + fclose (f); remove ("conftest.1"); remove ("conftest.2"); + return result;])], + [M4_cv_func_rename_open_file_works=yes], + [M4_cv_func_rename_open_file_works=no], + [M4_cv_func_rename_open_file_works='guessing no'])]) +if test "$M4_cv_func_rename_open_file_works" = yes ; then + M4_rename_open_works=1 +else + M4_rename_open_works=0 fi +AC_DEFINE_UNQUOTED([RENAME_OPEN_FILE_WORKS], [$M4_rename_open_works], + [Define to 1 if a file can be renamed while open, or to 0 if not.]) dnl Don't let changeword get in our way, if bootstrapping with a version of dnl m4 that already turned the feature on. @@ -97,6 +83,38 @@ AC_ARG_ENABLE([changeword], AC_MSG_RESULT([no]) fi], [AC_MSG_RESULT([no])]) +AC_MSG_CHECKING([[which shell to use for syscmd]]) +AC_ARG_WITH([syscmd-shell], + [AS_HELP_STRING([--with-syscmd-shell], [shell used by syscmd [/bin/sh]])], + [case $withval in + yes[)] with_syscmd_shell=no;; + esac], [with_syscmd_shell=no]) +if test "$with_syscmd_shell" = no ; then + with_syscmd_shell=/bin/sh + if test "$cross_compiling" != yes ; then +dnl Give mingw a default that is more likely to be available. + AS_IF([AS_EXECUTABLE_P([/bin/sh])], [], + [if (cmd /c) 2>/dev/null; then with_syscmd_shell=cmd; fi]) +dnl Too bad _AS_PATH_WALK is not public. + M4_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for M4_dir in `if (command -p getconf PATH) 2>/dev/null ; then + command -p getconf PATH + else + echo "/bin$PATH_SEPARATOR$PATH" + fi` + do + IFS=$M4_save_IFS + test -z "$M4_dir" && continue + AS_EXECUTABLE_P(["$M4_dir/sh"]) \ + && { with_syscmd_shell=$M4_dir/sh; break; } + done + IFS=$M4_save_IFS + fi +fi +AC_MSG_RESULT([$with_syscmd_shell]) +AC_DEFINE_UNQUOTED([SYSCMD_SHELL], ["$with_syscmd_shell"], + [Shell used by syscmd and esyscmd, must accept -c argument.]) + M4_WITH_DMALLOC AC_CONFIG_COMMANDS([stamp-h], [[test -z "$CONFIG_HEADERS" || date > stamp-h]]) diff -ruNp m4-1.4.12/doc/Makefile.am m4-1.4.13/doc/Makefile.am --- m4-1.4.12/doc/Makefile.am 2008-09-24 20:29:55.000000000 -0600 +++ m4-1.4.13/doc/Makefile.am 2008-12-11 21:58:57.000000000 -0700 @@ -20,7 +20,7 @@ ## This file written by Eric Blake <ebb9@byu.net> info_TEXINFOS = m4.texinfo -m4_TEXINFOS = fdl.texi gpl-3.0.texi +m4_TEXINFOS = fdl-1.3.texi gpl-3.0.texi man_MANS = $(srcdir)/m4.1 EXTRA_DIST = $(man_MANS) gendocs_template MAINTAINERCLEANFILES = $(man_MANS) gendocs_template diff -ruNp m4-1.4.12/doc/Makefile.in m4-1.4.13/doc/Makefile.in --- m4-1.4.12/doc/Makefile.in 2008-10-10 21:03:06.000000000 -0600 +++ m4-1.4.13/doc/Makefile.in 2009-03-31 20:11:41.000000000 -0600 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10b from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,8 +16,9 @@ @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -36,15 +38,17 @@ DIST_COMMON = $(m4_TEXINFOS) $(srcdir)/M $(srcdir)/Makefile.in $(srcdir)/stamp-vti \ $(srcdir)/version.texi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/autobuild.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/assert.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/cloexec.m4 \ $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/dirname.m4 \ $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \ $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl_h.m4 \ @@ -54,7 +58,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \ $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ $(top_srcdir)/m4/fseeko.m4 $(top_srcdir)/m4/ftello.m4 \ - $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/glibc21.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ @@ -64,48 +69,62 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/lock.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lseek.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memset.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ - $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/open.m4 \ - $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/posix_spawn.m4 \ + $(top_srcdir)/m4/printf-frexp.m4 \ $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ - $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/regex.m4 \ - $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \ - $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sched_h.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/snprintf.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-safer.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib-safer.m4 \ - $(top_srcdir)/m4/stdlib_h.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/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \ - $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ - $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/thread.m4 \ - $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/tls.m4 \ - $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/spawn_h.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-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strchrnul.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/strsignal.m4 \ + $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtod.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \ + $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \ + $(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/tmpdir.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unistd-safer.m4 \ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \ $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf-posix.m4 \ - $(top_srcdir)/m4/vasprintf.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/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yield.m4 \ + $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wait-process.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = @ +am__v_at_0 = @ SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/m4.info @@ -127,7 +146,22 @@ am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) @@ -136,6 +170,7 @@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -169,14 +204,19 @@ FCNTL_H = @FCNTL_H@ FLOAT_H = @FLOAT_H@ GETOPT_H = @GETOPT_H@ GLIBC21 = @GLIBC21@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ @@ -197,29 +237,44 @@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ GNULIB_ISINF = @GNULIB_ISINF@ GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -233,12 +288,34 @@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ +GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ +GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ +GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ +GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ +GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ +GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ +GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -269,6 +346,8 @@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ @@ -276,15 +355,22 @@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ @@ -295,6 +381,7 @@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ @@ -314,28 +401,48 @@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCHED_H = @HAVE_SCHED_H@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ @@ -344,6 +451,7 @@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_SPAWN_H = @HAVE_SPAWN_H@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ @@ -353,23 +461,34 @@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -389,6 +508,10 @@ LIBSIGSEGV = @LIBSIGSEGV@ LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIBTHREAD = @LIBTHREAD@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBCSTACK = @LTLIBCSTACK@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -406,7 +529,9 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_SCHED_H = @NEXT_SCHED_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_SPAWN_H = @NEXT_SPAWN_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ @@ -414,6 +539,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -423,17 +549,21 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -458,6 +588,13 @@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ @@ -465,6 +602,7 @@ REPLACE_NAN = @REPLACE_NAN@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -483,22 +621,29 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TRUNCL = @REPLACE_TRUNCL@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ +SCHED_H = @SCHED_H@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SPAWN_H = @SPAWN_H@ STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +SYS_WAIT_H = @SYS_WAIT_H@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ @@ -506,7 +651,6 @@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ -YIELD_LIB = @YIELD_LIB@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -558,7 +702,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ info_TEXINFOS = m4.texinfo -m4_TEXINFOS = fdl.texi gpl-3.0.texi +m4_TEXINFOS = fdl-1.3.texi gpl-3.0.texi man_MANS = $(srcdir)/m4.1 EXTRA_DIST = $(man_MANS) gendocs_template MAINTAINERCLEANFILES = $(man_MANS) gendocs_template @@ -572,14 +716,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu doc/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --silent-rules doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu --silent-rules doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -597,10 +741,11 @@ $(top_srcdir)/configure: $(am__configur cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): .texinfo.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ + am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ @@ -612,10 +757,10 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) -o $@ $<; \ then \ rc=0; \ - cd $(srcdir); \ + $(am__cd) $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ + $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc @@ -672,16 +817,18 @@ maintainer-clean-vti: uninstall-dvi-am: @$(NORMAL_UNINSTALL) - @list='$(DVIS)'; for p in $$list; do \ - f=$(am__strip_dir) \ + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) - @list='$(HTMLS)'; for p in $$list; do \ - f=$(am__strip_dir) \ + @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done @@ -695,7 +842,8 @@ uninstall-info-am: for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ - install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @@ -711,16 +859,18 @@ uninstall-info-am: uninstall-pdf-am: @$(NORMAL_UNINSTALL) - @list='$(PDFS)'; for p in $$list; do \ - f=$(am__strip_dir) \ + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) - @list='$(PSS)'; for p in $$list; do \ - f=$(am__strip_dir) \ + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done @@ -737,8 +887,8 @@ dist-info: $(INFO_DEPS) for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ - test -f $(distdir)/$$relfile || \ - cp -p $$file $(distdir)/$$relfile; \ + test -f "$(distdir)/$$relfile" || \ + cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done @@ -754,51 +904,44 @@ maintainer-clean-aminfo: 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) +install-man1: $(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; \ + @list=''; test -n "$(man1dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ - done + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + uninstall-man1: @$(NORMAL_UNINSTALL) - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ - done + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man1dir)" && rm -f $$files tags: TAGS TAGS: @@ -807,6 +950,19 @@ CTAGS: distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -822,13 +978,17 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -862,6 +1022,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -894,11 +1055,14 @@ install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" - @list='$(DVIS)'; for p in $$list; do \ + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: @@ -907,26 +1071,31 @@ install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" - @list='$(HTMLS)'; for p in $$list; do \ + @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ + $(am__strip_dir) \ if test -d "$$d$$p"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \ + $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ + list2="$$list2 $$d$$p"; \ fi; \ - done + done; \ + test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ + done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - list='$(INFO_DEPS)'; \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ @@ -936,16 +1105,17 @@ install-info-am: $(INFO_DEPS) 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"; \ + echo "$$ifile"; \ else : ; fi; \ done; \ - done + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ - list='$(INFO_DEPS)'; \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ @@ -959,23 +1129,27 @@ install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" - @list='$(PDFS)'; for p in $$list; do \ + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \ - done + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" - @list='$(PSS)'; for p in $$list; do \ + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(psdir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(psdir)/$$f"; \ - done + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am @@ -1031,6 +1205,7 @@ $(srcdir)/m4.1: $(top_srcdir)/.version $ echo "WARNING: The \`man' page \`$@' cannot be updated yet."; \ echo " Retry once the program executable is ready."; \ fi + # 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 -ruNp m4-1.4.12/doc/fdl-1.3.texi m4-1.4.13/doc/fdl-1.3.texi --- m4-1.4.12/doc/fdl-1.3.texi 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/doc/fdl-1.3.texi 2008-12-11 22:14:17.000000000 -0700 @@ -0,0 +1,506 @@ +@c The GNU Free Documentation License. +@center Version 1.3, 3 November 2008 + +@c This file is intended to be included within another document, +@c hence no sectioning command or @node. + +@display +Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. +@uref{http://fsf.org/} + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document @dfn{free} in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +@sc{ascii} without markup, Texinfo input format, La@TeX{} input +format, @acronym{SGML} or @acronym{XML} using a publicly available +@acronym{DTD}, and standard-conforming simple @acronym{HTML}, +PostScript or @acronym{PDF} designed for human modification. Examples +of transparent image formats include @acronym{PNG}, @acronym{XCF} and +@acronym{JPG}. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, @acronym{SGML} or +@acronym{XML} for which the @acronym{DTD} and/or processing tools are +not generally available, and the machine-generated @acronym{HTML}, +PostScript or @acronym{PDF} produced by some word processors for +output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The ``publisher'' means any person or entity that distributes copies +of the Document to the public. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section Entitled ``History'', Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section Entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section to be Entitled ``Endorsements'' or +to conflict in title with any Invariant Section. + +@item +Preserve any Warranty Disclaimers. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all +sections Entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation 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. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +@item +RELICENSING + +``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the +site means any set of copyrightable works thus published on the MMC +site. + +``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +``Incorporate'' means to publish or republish a Document, in whole or +in part, as part of another Document. + +An MMC is ``eligible for relicensing'' if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + +@end enumerate + +@page +@heading ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group + Copyright (C) @var{year} @var{your name}. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with@dots{}Texts.'' line with this: + +@smallexample +@group + with the Invariant Sections being @var{list their titles}, with + the Front-Cover Texts being @var{list}, and with the Back-Cover Texts + being @var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@c Local Variables: +@c ispell-local-pdict: "ispell-dict" +@c End: + diff -ruNp m4-1.4.12/doc/fdl.texi m4-1.4.13/doc/fdl.texi --- m4-1.4.12/doc/fdl.texi 2008-02-23 10:29:35.000000000 -0700 +++ m4-1.4.13/doc/fdl.texi 1969-12-31 17:00:00.000000000 -0700 @@ -1,451 +0,0 @@ -@c The GNU Free Documentation License. -@center Version 1.2, November 2002 - -@c This file is intended to be included within another document, -@c hence no sectioning command or @node. - -@display -Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. -51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. -@end display - -@enumerate 0 -@item -PREAMBLE - -The purpose of this License is to make a manual, textbook, or other -functional and useful document @dfn{free} in the sense of freedom: to -assure everyone the effective freedom to copy and redistribute it, -with or without modifying it, either commercially or noncommercially. -Secondarily, this License preserves for the author and publisher a way -to get credit for their work, while not being considered responsible -for modifications made by others. - -This License is a kind of ``copyleft'', which means that derivative -works of the document must themselves be free in the same sense. It -complements the GNU General Public License, which is a copyleft -license designed for free software. - -We have designed this License in order to use it for manuals for free -software, because free software needs free documentation: a free -program should come with manuals providing the same freedoms that the -software does. But this License is not limited to software manuals; -it can be used for any textual work, regardless of subject matter or -whether it is published as a printed book. We recommend this License -principally for works whose purpose is instruction or reference. - -@item -APPLICABILITY AND DEFINITIONS - -This License applies to any manual or other work, in any medium, that -contains a notice placed by the copyright holder saying it can be -distributed under the terms of this License. Such a notice grants a -world-wide, royalty-free license, unlimited in duration, to use that -work under the conditions stated herein. The ``Document'', below, -refers to any such manual or work. Any member of the public is a -licensee, and is addressed as ``you''. You accept the license if you -copy, modify or distribute the work in a way requiring permission -under copyright law. - -A ``Modified Version'' of the Document means any work containing the -Document or a portion of it, either copied verbatim, or with -modifications and/or translated into another language. - -A ``Secondary Section'' is a named appendix or a front-matter section -of the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall -subject (or to related matters) and contains nothing that could fall -directly within that overall subject. (Thus, if the Document is in -part a textbook of mathematics, a Secondary Section may not explain -any mathematics.) The relationship could be a matter of historical -connection with the subject or with related matters, or of legal, -commercial, philosophical, ethical or political position regarding -them. - -The ``Invariant Sections'' are certain Secondary Sections whose titles -are designated, as being those of Invariant Sections, in the notice -that says that the Document is released under this License. If a -section does not fit the above definition of Secondary then it is not -allowed to be designated as Invariant. The Document may contain zero -Invariant Sections. If the Document does not identify any Invariant -Sections then there are none. - -The ``Cover Texts'' are certain short passages of text that are listed, -as Front-Cover Texts or Back-Cover Texts, in the notice that says that -the Document is released under this License. A Front-Cover Text may -be at most 5 words, and a Back-Cover Text may be at most 25 words. - -A ``Transparent'' copy of the Document means a machine-readable copy, -represented in a format whose specification is available to the -general public, that is suitable for revising the document -straightforwardly with generic text editors or (for images composed of -pixels) generic paint programs or (for drawings) some widely available -drawing editor, and that is suitable for input to text formatters or -for automatic translation to a variety of formats suitable for input -to text formatters. A copy made in an otherwise Transparent file -format whose markup, or absence of markup, has been arranged to thwart -or discourage subsequent modification by readers is not Transparent. -An image format is not Transparent if used for any substantial amount -of text. A copy that is not ``Transparent'' is called ``Opaque''. - -Examples of suitable formats for Transparent copies include plain -@sc{ascii} without markup, Texinfo input format, La@TeX{} input -format, @acronym{SGML} or @acronym{XML} using a publicly available -@acronym{DTD}, and standard-conforming simple @acronym{HTML}, -PostScript or @acronym{PDF} designed for human modification. Examples -of transparent image formats include @acronym{PNG}, @acronym{XCF} and -@acronym{JPG}. Opaque formats include proprietary formats that can be -read and edited only by proprietary word processors, @acronym{SGML} or -@acronym{XML} for which the @acronym{DTD} and/or processing tools are -not generally available, and the machine-generated @acronym{HTML}, -PostScript or @acronym{PDF} produced by some word processors for -output purposes only. - -The ``Title Page'' means, for a printed book, the title page itself, -plus such following pages as are needed to hold, legibly, the material -this License requires to appear in the title page. For works in -formats which do not have any title page as such, ``Title Page'' means -the text near the most prominent appearance of the work's title, -preceding the beginning of the body of the text. - -A section ``Entitled XYZ'' means a named subunit of the Document whose -title either is precisely XYZ or contains XYZ in parentheses following -text that translates XYZ in another language. (Here XYZ stands for a -specific section name mentioned below, such as ``Acknowledgements'', -``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' -of such a section when you modify the Document means that it remains a -section ``Entitled XYZ'' according to this definition. - -The Document may include Warranty Disclaimers next to the notice which -states that this License applies to the Document. These Warranty -Disclaimers are considered to be included by reference in this -License, but only as regards disclaiming warranties: any other -implication that these Warranty Disclaimers may have is void and has -no effect on the meaning of this License. - -@item -VERBATIM COPYING - -You may copy and distribute the Document in any medium, either -commercially or noncommercially, provided that this License, the -copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no other -conditions whatsoever to those of this License. You may not use -technical measures to obstruct or control the reading or further -copying of the copies you make or distribute. However, you may accept -compensation in exchange for copies. If you distribute a large enough -number of copies you must also follow the conditions in section 3. - -You may also lend copies, under the same conditions stated above, and -you may publicly display copies. - -@item -COPYING IN QUANTITY - -If you publish printed copies (or copies in media that commonly have -printed covers) of the Document, numbering more than 100, and the -Document's license notice requires Cover Texts, you must enclose the -copies in covers that carry, clearly and legibly, all these Cover -Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -the back cover. Both covers must also clearly and legibly identify -you as the publisher of these copies. The front cover must present -the full title with all words of the title equally prominent and -visible. You may add other material on the covers in addition. -Copying with changes limited to the covers, as long as they preserve -the title of the Document and satisfy these conditions, can be treated -as verbatim copying in other respects. - -If the required texts for either cover are too voluminous to fit -legibly, you should put the first ones listed (as many as fit -reasonably) on the actual cover, and continue the rest onto adjacent -pages. - -If you publish or distribute Opaque copies of the Document numbering -more than 100, you must either include a machine-readable Transparent -copy along with each Opaque copy, or state in or with each Opaque copy -a computer-network location from which the general network-using -public has access to download using public-standard network protocols -a complete Transparent copy of the Document, free of added material. -If you use the latter option, you must take reasonably prudent steps, -when you begin distribution of Opaque copies in quantity, to ensure -that this Transparent copy will remain thus accessible at the stated -location until at least one year after the last time you distribute an -Opaque copy (directly or through your agents or retailers) of that -edition to the public. - -It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to give -them a chance to provide you with an updated version of the Document. - -@item -MODIFICATIONS - -You may copy and distribute a Modified Version of the Document under -the conditions of sections 2 and 3 above, provided that you release -the Modified Version under precisely this License, with the Modified -Version filling the role of the Document, thus licensing distribution -and modification of the Modified Version to whoever possesses a copy -of it. In addition, you must do these things in the Modified Version: - -@enumerate A -@item -Use in the Title Page (and on the covers, if any) a title distinct -from that of the Document, and from those of previous versions -(which should, if there were any, be listed in the History section -of the Document). You may use the same title as a previous version -if the original publisher of that version gives permission. - -@item -List on the Title Page, as authors, one or more persons or entities -responsible for authorship of the modifications in the Modified -Version, together with at least five of the principal authors of the -Document (all of its principal authors, if it has fewer than five), -unless they release you from this requirement. - -@item -State on the Title page the name of the publisher of the -Modified Version, as the publisher. - -@item -Preserve all the copyright notices of the Document. - -@item -Add an appropriate copyright notice for your modifications -adjacent to the other copyright notices. - -@item -Include, immediately after the copyright notices, a license notice -giving the public permission to use the Modified Version under the -terms of this License, in the form shown in the Addendum below. - -@item -Preserve in that license notice the full lists of Invariant Sections -and required Cover Texts given in the Document's license notice. - -@item -Include an unaltered copy of this License. - -@item -Preserve the section Entitled ``History'', Preserve its Title, and add -to it an item stating at least the title, year, new authors, and -publisher of the Modified Version as given on the Title Page. If -there is no section Entitled ``History'' in the Document, create one -stating the title, year, authors, and publisher of the Document as -given on its Title Page, then add an item describing the Modified -Version as stated in the previous sentence. - -@item -Preserve the network location, if any, given in the Document for -public access to a Transparent copy of the Document, and likewise -the network locations given in the Document for previous versions -it was based on. These may be placed in the ``History'' section. -You may omit a network location for a work that was published at -least four years before the Document itself, or if the original -publisher of the version it refers to gives permission. - -@item -For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve -the Title of the section, and preserve in the section all the -substance and tone of each of the contributor acknowledgements and/or -dedications given therein. - -@item -Preserve all the Invariant Sections of the Document, -unaltered in their text and in their titles. Section numbers -or the equivalent are not considered part of the section titles. - -@item -Delete any section Entitled ``Endorsements''. Such a section -may not be included in the Modified Version. - -@item -Do not retitle any existing section to be Entitled ``Endorsements'' or -to conflict in title with any Invariant Section. - -@item -Preserve any Warranty Disclaimers. -@end enumerate - -If the Modified Version includes new front-matter sections or -appendices that qualify as Secondary Sections and contain no material -copied from the Document, you may at your option designate some or all -of these sections as invariant. To do this, add their titles to the -list of Invariant Sections in the Modified Version's license notice. -These titles must be distinct from any other section titles. - -You may add a section Entitled ``Endorsements'', provided it contains -nothing but endorsements of your Modified Version by various -parties---for example, statements of peer review or that the text has -been approved by an organization as the authoritative definition of a -standard. - -You may add a passage of up to five words as a Front-Cover Text, and a -passage of up to 25 words as a Back-Cover Text, to the end of the list -of Cover Texts in the Modified Version. Only one passage of -Front-Cover Text and one of Back-Cover Text may be added by (or -through arrangements made by) any one entity. If the Document already -includes a cover text for the same cover, previously added by you or -by arrangement made by the same entity you are acting on behalf of, -you may not add another; but you may replace the old one, on explicit -permission from the previous publisher that added the old one. - -The author(s) and publisher(s) of the Document do not by this License -give permission to use their names for publicity for or to assert or -imply endorsement of any Modified Version. - -@item -COMBINING DOCUMENTS - -You may combine the Document with other documents released under this -License, under the terms defined in section 4 above for modified -versions, provided that you include in the combination all of the -Invariant Sections of all of the original documents, unmodified, and -list them all as Invariant Sections of your combined work in its -license notice, and that you preserve all their Warranty Disclaimers. - -The combined work need only contain one copy of this License, and -multiple identical Invariant Sections may be replaced with a single -copy. If there are multiple Invariant Sections with the same name but -different contents, make the title of each such section unique by -adding at the end of it, in parentheses, the name of the original -author or publisher of that section if known, or else a unique number. -Make the same adjustment to the section titles in the list of -Invariant Sections in the license notice of the combined work. - -In the combination, you must combine any sections Entitled ``History'' -in the various original documents, forming one section Entitled -``History''; likewise combine any sections Entitled ``Acknowledgements'', -and any sections Entitled ``Dedications''. You must delete all -sections Entitled ``Endorsements.'' - -@item -COLLECTIONS OF DOCUMENTS - -You may make a collection consisting of the Document and other documents -released under this License, and replace the individual copies of this -License in the various documents with a single copy that is included in -the collection, provided that you follow the rules of this License for -verbatim copying of each of the documents in all other respects. - -You may extract a single document from such a collection, and distribute -it individually under this License, provided you insert a copy of this -License into the extracted document, and follow this License in all -other respects regarding verbatim copying of that document. - -@item -AGGREGATION WITH INDEPENDENT WORKS - -A compilation of the Document or its derivatives with other separate -and independent documents or works, in or on a volume of a storage or -distribution medium, is called an ``aggregate'' if the copyright -resulting from the compilation is not used to limit the legal rights -of the compilation's users beyond what the individual works permit. -When the Document is included in an aggregate, this License does not -apply to the other works in the aggregate which are not themselves -derivative works of the Document. - -If the Cover Text requirement of section 3 is applicable to these -copies of the Document, then if the Document is less than one half of -the entire aggregate, the Document's Cover Texts may be placed on -covers that bracket the Document within the aggregate, or the -electronic equivalent of covers if the Document is in electronic form. -Otherwise they must appear on printed covers that bracket the whole -aggregate. - -@item -TRANSLATION - -Translation is considered a kind of modification, so you may -distribute translations of the Document under the terms of section 4. -Replacing Invariant Sections with translations requires special -permission from their copyright holders, but you may include -translations of some or all Invariant Sections in addition to the -original versions of these Invariant Sections. You may include a -translation of this License, and all the license notices in the -Document, and any Warranty Disclaimers, provided that you also include -the original English version of this License and the original versions -of those notices and disclaimers. In case of a disagreement between -the translation and the original version of this License or a notice -or disclaimer, the original version will prevail. - -If a section in the Document is Entitled ``Acknowledgements'', -``Dedications'', or ``History'', the requirement (section 4) to Preserve -its Title (section 1) will typically require changing the actual -title. - -@item -TERMINATION - -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. - -@item -FUTURE REVISIONS OF THIS LICENSE - -The Free Software Foundation may publish new, revised versions -of the GNU Free Documentation 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. See -@uref{http://www.gnu.org/copyleft/}. - -Each version of the License is given a distinguishing version number. -If the Document specifies that a particular numbered version of this -License ``or any later version'' applies to it, you have the option of -following the terms and conditions either of that specified version or -of any later version that has been published (not as a draft) by the -Free Software Foundation. If the Document does not specify a version -number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. -@end enumerate - -@page -@heading ADDENDUM: How to use this License for your documents - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and -license notices just after the title page: - -@smallexample -@group - Copyright (C) @var{year} @var{your name}. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 - or any later version published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover - Texts. A copy of the license is included in the section entitled ``GNU - Free Documentation License''. -@end group -@end smallexample - -If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, -replace the ``with@dots{}Texts.'' line with this: - -@smallexample -@group - with the Invariant Sections being @var{list their titles}, with - the Front-Cover Texts being @var{list}, and with the Back-Cover Texts - being @var{list}. -@end group -@end smallexample - -If you have Invariant Sections without Cover Texts, or some other -combination of the three, merge those two alternatives to suit the -situation. - -If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, -to permit their use in free software. - -@c Local Variables: -@c ispell-local-pdict: "ispell-dict" -@c End: - diff -ruNp m4-1.4.12/doc/gendocs_template m4-1.4.13/doc/gendocs_template --- m4-1.4.12/doc/gendocs_template 2008-08-05 07:16:37.000000000 -0600 +++ m4-1.4.13/doc/gendocs_template 2009-01-04 19:07:47.000000000 -0700 @@ -83,16 +83,14 @@ There are also <a href="/contact/">other the FSF. <br /> Please send broken links and other corrections or suggestions to -<a href="mailto:webmasters@gnu.org"><em>webmasters@gnu.org</em></a>. +<a href="mailto:%%EMAIL%%"><em>%%EMAIL%%</em></a>. </p> -<p> -Copyright © 2008 Free Software Foundation, Inc., -</p> -<address>51 Franklin Street, Fifth Floor, Boston, MA 02111, USA</address> +<p>Copyright © 2009 Free Software Foundation, Inc.</p> + <p>Verbatim copying and distribution of this entire article is -permitted in any medium, provided this notice is preserved. -</p> +permitted in any medium, provided this notice is preserved.</p> + </div> </div> diff -ruNp m4-1.4.12/doc/m4.1 m4-1.4.13/doc/m4.1 --- m4-1.4.12/doc/m4.1 2008-10-10 21:21:18.000000000 -0600 +++ m4-1.4.13/doc/m4.1 2009-03-31 21:41:19.000000000 -0600 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH M4 "1" "October 2008" "GNU M4 1.4.12" "User Commands" +.TH M4 "1" "March 2009" "GNU M4 1.4.13" "User Commands" .SH NAME m4 \- macro processor .SH SYNOPSIS @@ -34,6 +34,7 @@ suppress some warnings for builtins .TP \fB\-\-warn\-macro\-sequence\fR[=\fIREGEXP\fR] warn if macro definition matches REGEXP, +.IP default \e$\e({[^}]*}\e|[0\-9][0\-9]+\e) .SS "Preprocessor features:" .TP @@ -73,8 +74,9 @@ reload a frozen state from FILE at start \fB\-d\fR, \fB\-\-debug\fR[=\fIFLAGS\fR] set debug level (no FLAGS implies `aeq') .TP -\fB\-\-debugfile\fR=\fIFILE\fR -redirect debug and trace output +\fB\-\-debugfile\fR[=\fIFILE\fR] +redirect debug and trace output to FILE +(default stderr, discard if empty string) .TP \fB\-l\fR, \fB\-\-arglength\fR=\fINUM\fR restrict macro tracing size @@ -125,9 +127,11 @@ mismatch, or whatever value was passed t Written by Rene' Seindal. .SH "REPORTING BUGS" Report bugs to <bug\-m4@gnu.org>. +GNU M4 home page: <http://www.gnu.org/software/m4/>. +General help using GNU software: <http://www.gnu.org/gethelp/>. .SH COPYRIGHT -Copyright \(co 2008 Free Software Foundation, Inc. -License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. .br This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. diff -ruNp m4-1.4.12/doc/m4.info m4-1.4.13/doc/m4.info --- m4-1.4.12/doc/m4.info 2008-10-10 21:21:24.000000000 -0600 +++ m4-1.4.13/doc/m4.info 2009-03-31 20:22:01.000000000 -0600 @@ -1,10 +1,10 @@ -This is m4.info, produced by makeinfo version 4.8 from m4.texinfo. +This is m4.info, produced by makeinfo version 4.13 from m4.texinfo. - This manual (25 September 2008) is for GNU M4 (version 1.4.12), a -package containing an implementation of the m4 macro language. +This manual (5 March 2009) is for GNU M4 (version 1.4.13), a package +containing an implementation of the m4 macro language. Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, -2007, 2008 Free Software Foundation, Inc. +2007, 2008, 2009 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -20,113 +20,116 @@ END-INFO-DIR-ENTRY  Indirect: -m4.info-1: 864 -m4.info-2: 285796 +m4.info-1: 863 +m4.info-2: 300311  Tag Table: (Indirect) -Node: Top864 -Node: Preliminaries9542 -Node: Intro10228 -Node: History11860 -Node: Bugs14619 -Node: Manual15870 -Node: Invoking m419268 -Node: Operation modes21414 -Node: Preprocessor features24386 -Node: Limits control27483 -Node: Frozen state31385 -Node: Debugging options32184 -Node: Command line files33923 -Node: Syntax35496 -Node: Names36615 -Node: Quoted strings37077 -Node: Comments37726 -Node: Other tokens38603 -Node: Input processing39181 -Ref: Input processing-Footnote-146854 -Node: Macros47049 -Node: Invocation47543 -Node: Inhibiting Invocation48344 -Node: Macro Arguments52475 -Node: Quoting Arguments55537 -Node: Macro expansion57660 -Node: Definitions58361 -Node: Define59146 -Node: Arguments61584 -Node: Pseudo Arguments65256 -Node: Undefine68798 -Node: Defn69928 -Node: Pushdef74378 -Node: Indir77004 -Node: Builtin79132 -Node: Conditionals81358 -Node: Ifdef82177 -Node: Ifelse83040 -Node: Shift88321 -Node: Forloop98870 -Node: Foreach101506 -Node: Debugging106979 -Node: Dumpdef107564 -Node: Trace108974 -Node: Debug Levels112547 -Node: Debug Output117251 -Node: Input Control118535 -Node: Dnl119072 -Node: Changequote120973 -Node: Changecom127070 -Node: Changeword130766 -Node: M4wrap136207 -Node: File Inclusion140203 -Node: Include140520 -Node: Search Path143231 -Node: Diversions144148 -Node: Divert145939 -Node: Undivert148465 -Node: Divnum151629 -Node: Cleardivert152093 -Node: Text handling153298 -Node: Len154021 -Node: Index macro154406 -Node: Regexp155279 -Node: Substr157820 -Node: Translit158871 -Node: Patsubst161593 -Node: Format166119 -Node: Arithmetic169312 -Node: Incr169761 -Node: Eval170536 -Node: Shell commands178499 -Node: Platform macros179421 -Node: Syscmd181536 -Node: Esyscmd183355 -Node: Sysval184403 -Node: Mkstemp186021 -Node: Miscellaneous189976 -Node: Errprint190409 -Node: Location191628 -Node: M4exit194402 -Node: Frozen files196489 -Node: Using frozen files197270 -Node: Frozen file format200534 -Node: Compatibility203598 -Node: Extensions204664 -Node: Incompatibilities208531 -Node: Other Incompatibilities217457 -Node: Answers220103 -Node: Improved exch220833 -Node: Improved forloop221371 -Node: Improved foreach224888 -Node: Improved m4wrap237907 -Node: Improved cleardivert240334 -Node: Improved capitalize241315 -Node: Improved fatal_error246177 -Node: Copying This Package247238 -Node: GNU General Public License247717 -Node: Copying This Manual285276 -Node: GNU Free Documentation License285796 -Node: Indices308192 -Node: Macro index308472 -Node: Concept index314198 +Node: Top863 +Node: Preliminaries9717 +Node: Intro10403 +Node: History12035 +Node: Bugs14838 +Node: Manual16089 +Node: Invoking m419487 +Node: Operation modes21633 +Node: Preprocessor features24605 +Node: Limits control27702 +Node: Frozen state31604 +Node: Debugging options32403 +Node: Command line files34387 +Node: Syntax35960 +Node: Names37079 +Node: Quoted strings37541 +Node: Comments38190 +Node: Other tokens39067 +Node: Input processing39645 +Ref: Input processing-Footnote-147318 +Node: Macros47513 +Node: Invocation48007 +Node: Inhibiting Invocation48808 +Node: Macro Arguments52939 +Node: Quoting Arguments56001 +Node: Macro expansion58124 +Node: Definitions58825 +Node: Define59610 +Node: Arguments62048 +Node: Pseudo Arguments65720 +Node: Undefine69262 +Node: Defn70392 +Node: Pushdef74842 +Node: Indir77468 +Node: Builtin79596 +Node: Conditionals81822 +Node: Ifdef82764 +Node: Ifelse83627 +Node: Shift86945 +Node: Forloop97494 +Node: Foreach100130 +Node: Stacks105618 +Node: Composition108657 +Node: Debugging114597 +Node: Dumpdef115182 +Node: Trace116592 +Node: Debug Levels120165 +Node: Debug Output124869 +Node: Input Control126153 +Node: Dnl126690 +Node: Changequote128591 +Node: Changecom134688 +Node: Changeword138384 +Node: M4wrap143825 +Node: File Inclusion147821 +Node: Include148138 +Node: Search Path150849 +Node: Diversions151766 +Node: Divert153557 +Node: Undivert156083 +Node: Divnum159406 +Node: Cleardivert159870 +Node: Text handling161075 +Node: Len161798 +Node: Index macro162183 +Node: Regexp163056 +Node: Substr165597 +Node: Translit166648 +Node: Patsubst169370 +Node: Format173896 +Node: Arithmetic177089 +Node: Incr177538 +Node: Eval178313 +Node: Shell commands186276 +Node: Platform macros187198 +Node: Syscmd189313 +Node: Esyscmd191593 +Node: Sysval193102 +Node: Mkstemp194720 +Node: Miscellaneous198675 +Node: Errprint199108 +Node: Location200327 +Node: M4exit203101 +Node: Frozen files205188 +Node: Using frozen files205969 +Node: Frozen file format209233 +Node: Compatibility212297 +Node: Extensions213363 +Node: Incompatibilities217230 +Node: Other Incompatibilities226156 +Node: Answers228802 +Node: Improved exch229584 +Node: Improved forloop230122 +Node: Improved foreach235454 +Node: Improved copy248471 +Node: Improved m4wrap252425 +Node: Improved cleardivert254849 +Node: Improved capitalize255830 +Node: Improved fatal_error260692 +Node: Copying This Package261753 +Node: GNU General Public License262232 +Node: Copying This Manual299791 +Node: GNU Free Documentation License300311 +Node: Indices325442 +Node: Macro index325722 +Node: Concept index331959  End Tag Table diff -ruNp m4-1.4.12/doc/m4.info-1 m4-1.4.13/doc/m4.info-1 --- m4-1.4.12/doc/m4.info-1 2008-10-10 21:21:24.000000000 -0600 +++ m4-1.4.13/doc/m4.info-1 2009-03-31 20:22:01.000000000 -0600 @@ -1,10 +1,10 @@ -This is m4.info, produced by makeinfo version 4.8 from m4.texinfo. +This is m4.info, produced by makeinfo version 4.13 from m4.texinfo. - This manual (25 September 2008) is for GNU M4 (version 1.4.12), a -package containing an implementation of the m4 macro language. +This manual (5 March 2009) is for GNU M4 (version 1.4.13), a package +containing an implementation of the m4 macro language. Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, -2007, 2008 Free Software Foundation, Inc. +2007, 2008, 2009 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -24,11 +24,11 @@ File: m4.info, Node: Top, Next: Prelim GNU M4 ****** -This manual (25 September 2008) is for GNU M4 (version 1.4.12), a -package containing an implementation of the m4 macro language. +This manual (5 March 2009) is for GNU M4 (version 1.4.13), a package +containing an implementation of the m4 macro language. Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, -2007, 2008 Free Software Foundation, Inc. +2007, 2008, 2009 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -46,10 +46,10 @@ generating `configure' scripts, but not GNU `m4' was originally written by Rene' Seindal, with subsequent changes by Franc,ois Pinard and other volunteers on the Internet. All -names and email addresses can be found in the files `m4-1.4.12/AUTHORS' -and `m4-1.4.12/THANKS' from the GNU M4 distribution. +names and email addresses can be found in the files `m4-1.4.13/AUTHORS' +and `m4-1.4.13/THANKS' from the GNU M4 distribution. - This is release 1.4.12. It is now considered stable: future + This is release 1.4.13. It is now considered stable: future releases in the 1.4.x series are only meant to fix bugs, increase speed, or improve documentation. However... @@ -144,6 +144,8 @@ Conditionals, loops, and recursion * Shift:: Recursion in `m4' * Forloop:: Iteration by counting * Foreach:: Iteration by list contents +* Stacks:: Working with definition stacks +* Composition:: Building macros with macros How to debug macros and input @@ -217,6 +219,7 @@ Correct version of some examples * Improved exch:: Solution for `exch' * Improved forloop:: Solution for `forloop' * Improved foreach:: Solution for `foreach' +* Improved copy:: Solution for `copy' * Improved m4wrap:: Solution for `m4wrap' * Improved cleardivert:: Solution for `cleardivert' * Improved capitalize:: Solution for `capitalize' @@ -340,8 +343,9 @@ addressed some long standing bugs in the 1.4 that were floating around the net and released 1.4.3 and 1.4.4. And in 2006, Eric Blake joined the team and prepared patches for the release of 1.4.5, 1.4.6, 1.4.7, and 1.4.8. More bug fixes were -incorporated in 2007, with releases 1.4.9 and 1.4.10, closing the -series with 1.4.11 and 1.4.12 in 2008. +incorporated in 2007, with releases 1.4.9 and 1.4.10. Eric continued +with some portability fixes for 1.4.11 and 1.4.12 in 2008, and 1.4.13 +in 2009. Meanwhile, development has continued on new features for `m4', such as dynamic module loading and additional builtins. When complete, GNU @@ -408,7 +412,7 @@ the examples assume that your current di unpacked the installation, so if you plan on following along, you may find it helpful to do this now: - $ cd m4-1.4.12 + $ cd m4-1.4.13 As each of the predefined macros in `m4' is described, a prototype call of the macro will be shown, giving descriptive names to the @@ -768,18 +772,21 @@ Finally, there are several options for a the format and meaning of FLAGS. If omitted, FLAGS defaults to `aeq'. -`--debugfile=FILE' +`--debugfile[=FILE]' `-o FILE' `--error-output=FILE' Redirect `dumpdef' output, debug messages, and trace output to the named FILE. Warnings, error messages, and `errprint' output are - still printed to standard error. If unspecified, debug output goes - to standard error; if empty, debug output is discarded. *Note - Debug Output::, for more details. The spellings `-o' and + still printed to standard error. If these options are not used, or + if FILE is unspecified (only possible for `--debugfile'), debug + output goes to standard error; if FILE is the empty string, debug + output is discarded. *Note Debug Output::, for more details. The + option `--debugfile' may be given more than once, and order is + significant with respect to file names. The spellings `-o' and `--error-output' are misleading and inconsistent with other GNU tools; for now they are silently accepted as synonyms of - `--debugfile', but in a future version of M4, using them will - cause a warning to be issued. + `--debugfile' and only recognized once, but in a future version of + M4, using them will cause a warning to be issued. `-l NUM' `--arglength=NUM' @@ -2199,6 +2206,8 @@ true. * Shift:: Recursion in `m4' * Forloop:: Iteration by counting * Foreach:: Iteration by list contents +* Stacks:: Working with definition stacks +* Composition:: Building macros with macros  File: m4.info, Node: Ifdef, Next: Ifelse, Up: Conditionals @@ -2292,60 +2301,10 @@ recognized only with arguments. foo(`a', `b', `c') =>arguments:3 - Since m4 is a macro language, it is even possible to write a macro -that makes defining blind macros easier: + For an example of a way to make defining blind macros easier, see +*note Composition::. - -- Composite: define_blind (NAME, [VALUE]) - Defines NAME as a blind macro, such that NAME will expand to VALUE - only when given explicit arguments. VALUE should not be the - result of `defn' (*note Defn::). This macro is only recognized - with parameters, and results in an empty string. - - Defining a macro to define another macro can be a bit tricky. We -want to use a literal `$#' in the argument to the nested `define'. -However, if `$' and `#' are adjacent in the definition of -`define_blind', then it would be expanded as the number of arguments to -`define_blind' rather than the intended number of arguments to NAME. -The solution is to pass the difficult characters through extra -arguments to a helper macro `_define_blind'. - - As for the limitation against using `defn', there are two reasons. -If a macro was previously defined with `define_blind', then it can -safely be renamed to a new blind macro using plain `define'; using -`define_blind' to rename it just adds another layer of `ifelse', -occupying memory and slowing down execution. And if a macro is a -builtin, then it would result in an attempt to define a macro -consisting of both text and a builtin token; this is not supported, and -the builtin token is flattened to an empty string. - - With that explanation, here's the definition, and some sample usage. -Notice that `define_blind' is itself a blind macro. - - $ m4 -d - define(`define_blind', `ifelse(`$#', `0', ``$0'', - `_$0(`$1', `$2', `$'`#', `$'`0')')') - => - define(`_define_blind', `define(`$1', - `ifelse(`$3', `0', ``$4'', `$2')')') - => - define_blind - =>define_blind - define_blind(`foo', `arguments were $*') - => - foo - =>foo - foo(`bar') - =>arguments were bar - define(`blah', defn(`foo')) - => - blah - =>blah - blah(`a', `b') - =>arguments were a,b - defn(`blah') - =>ifelse(`$#', `0', ``$0'', `arguments were $*') - - However, `ifelse' can take more than four arguments. If given more + The macro `ifelse' can take more than four arguments. If given more than four arguments, `ifelse' works like a `case' or `switch' statement in traditional programming languages. If STRING-1 and STRING-2 are equal, `ifelse' expands into EQUAL-1, otherwise the procedure is @@ -2477,7 +2436,7 @@ arguments into a single string. arguments, `join' avoids the SEPARATOR for an empty ARG. Here are some examples of its usage, based on the implementation -`m4-1.4.12/examples/join.m4' distributed in this package: +`m4-1.4.13/examples/join.m4' distributed in this package: $ m4 -I examples include(`join.m4') @@ -2572,7 +2531,7 @@ element, or treating multiple arguments levels of quoting are added around each element. An actual implementation of these three macros is distributed as -`m4-1.4.12/examples/quote.m4' in this package. First, let's examine +`m4-1.4.13/examples/quote.m4' in this package. First, let's examine their usage: $ m4 -I examples @@ -2688,7 +2647,7 @@ finished, it increments the iterator (us `incr', *note Incr::), and recurses. Here is an actual implementation of `forloop', distributed as -`m4-1.4.12/examples/forloop.m4' in this package: +`m4-1.4.13/examples/forloop.m4' in this package: $ m4 -I examples undivert(`forloop.m4')dnl @@ -2709,7 +2668,7 @@ See if you can improve these macros; or forloop.).  -File: m4.info, Node: Foreach, Prev: Forloop, Up: Conditionals +File: m4.info, Node: Foreach, Next: Stacks, Prev: Forloop, Up: Conditionals 6.5 Iteration by list contents ============================== @@ -2729,8 +2688,8 @@ Here is an example of a loop macro that As an example, this displays each word in a list inside of a sentence, using an implementation of `foreach' distributed as -`m4-1.4.12/examples/foreach.m4', and `foreachq' in -`m4-1.4.12/examples/foreachq.m4'. +`m4-1.4.13/examples/foreach.m4', and `foreachq' in +`m4-1.4.13/examples/foreachq.m4'. $ m4 -I examples include(`foreach.m4') @@ -2859,6 +2818,233 @@ best elements of both of these implement (or *note Answers: Improved foreach.).  +File: m4.info, Node: Stacks, Next: Composition, Prev: Foreach, Up: Conditionals + +6.6 Working with definition stacks +================================== + +Thanks to `pushdef', manipulation of a stack is an intrinsic operation +in `m4'. Normally, only the topmost definition in a stack is +important, but sometimes, it is desirable to manipulate the entire +definition stack. + + -- Composite: stack_foreach (MACRO, ACTION) + -- Composite: stack_foreach_lifo (MACRO, ACTION) + For each of the `pushdef' definitions associated with MACRO, + invoke the macro ACTION with a single argument of that definition. + `stack_foreach' visits the oldest definition first, while + `stack_foreach_lifo' visits the current definition first. ACTION + should not modify or dereference MACRO. There are a few special + macros, such as `defn', which cannot be used as the MACRO + parameter. + + A sample implementation of these macros is distributed in the file +`m4-1.4.13/examples/stack.m4'. + + $ m4 -I examples + include(`stack.m4') + => + pushdef(`a', `1')pushdef(`a', `2')pushdef(`a', `3') + => + define(`show', ``$1' + ') + => + stack_foreach(`a', `show')dnl + =>1 + =>2 + =>3 + stack_foreach_lifo(`a', `show')dnl + =>3 + =>2 + =>1 + + Now for the implementation. Note the definition of a helper macro, +`_stack_reverse', which destructively swaps the contents of one stack +of definitions into the reverse order in the temporary macro `tmp-$1'. +By calling the helper twice, the original order is restored back into +the macro `$1'; since the operation is destructive, this explains why +`$1' must not be modified or dereferenced during the traversal. The +caller can then inject additional code to pass the definition currently +being visited to `$2'. The choice of helper names is intentional; +since `-' is not valid as part of a macro name, there is no risk of +conflict with a valid macro name, and the code is guaranteed to use +`defn' where necessary. Finally, note that any macro used in the +traversal of a `pushdef' stack, such as `pushdef' or `defn', cannot be +handled by `stack_foreach', since the macro would temporarily be +undefined during the algorithm. + + $ m4 -I examples + undivert(`stack.m4')dnl + =>divert(`-1') + =># stack_foreach(macro, action) + =># Invoke ACTION with a single argument of each definition + =># from the definition stack of MACRO, starting with the oldest. + =>define(`stack_foreach', + =>`_stack_reverse(`$1', `tmp-$1')'dnl + =>`_stack_reverse(`tmp-$1', `$1', `$2(defn(`$1'))')') + =># stack_foreach_lifo(macro, action) + =># Invoke ACTION with a single argument of each definition + =># from the definition stack of MACRO, starting with the newest. + =>define(`stack_foreach_lifo', + =>`_stack_reverse(`$1', `tmp-$1', `$2(defn(`$1'))')'dnl + =>`_stack_reverse(`tmp-$1', `$1')') + =>define(`_stack_reverse', + =>`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0($@)')') + =>divert`'dnl + + +File: m4.info, Node: Composition, Prev: Stacks, Up: Conditionals + +6.7 Building macros with macros +=============================== + +Since m4 is a macro language, it is possible to write macros that can +build other macros. First on the list is a way to automate the +creation of blind macros. + + -- Composite: define_blind (NAME, [VALUE]) + Defines NAME as a blind macro, such that NAME will expand to VALUE + only when given explicit arguments. VALUE should not be the + result of `defn' (*note Defn::). This macro is only recognized + with parameters, and results in an empty string. + + Defining a macro to define another macro can be a bit tricky. We +want to use a literal `$#' in the argument to the nested `define'. +However, if `$' and `#' are adjacent in the definition of +`define_blind', then it would be expanded as the number of arguments to +`define_blind' rather than the intended number of arguments to NAME. +The solution is to pass the difficult characters through extra +arguments to a helper macro `_define_blind'. When composing macros, it +is a common idiom to need a helper macro to concatenate text that forms +parameters in the composed macro, rather than interpreting the text as +a parameter of the composing macro. + + As for the limitation against using `defn', there are two reasons. +If a macro was previously defined with `define_blind', then it can +safely be renamed to a new blind macro using plain `define'; using +`define_blind' to rename it just adds another layer of `ifelse', +occupying memory and slowing down execution. And if a macro is a +builtin, then it would result in an attempt to define a macro +consisting of both text and a builtin token; this is not supported, and +the builtin token is flattened to an empty string. + + With that explanation, here's the definition, and some sample usage. +Notice that `define_blind' is itself a blind macro. + + $ m4 -d + define(`define_blind', `ifelse(`$#', `0', ``$0'', + `_$0(`$1', `$2', `$'`#', `$'`0')')') + => + define(`_define_blind', `define(`$1', + `ifelse(`$3', `0', ``$4'', `$2')')') + => + define_blind + =>define_blind + define_blind(`foo', `arguments were $*') + => + foo + =>foo + foo(`bar') + =>arguments were bar + define(`blah', defn(`foo')) + => + blah + =>blah + blah(`a', `b') + =>arguments were a,b + defn(`blah') + =>ifelse(`$#', `0', ``$0'', `arguments were $*') + + Another interesting composition tactic is argument "currying", or +factoring a macro that takes multiple arguments for use in a context +that provides exactly one argument. + + -- Composite: curry (MACRO, ...) + Expand to a macro call that takes exactly one argument, then + appends that argument to the original arguments and invokes MACRO + with the resulting list of arguments. + + A demonstration of currying makes the intent of this macro a little +more obvious. The macro `stack_foreach' mentioned earlier is an example +of a context that provides exactly one argument to a macro name. But +coupled with currying, we can invoke `reverse' with two arguments for +each definition of a macro stack. This example uses the file +`m4-1.4.13/examples/curry.m4' included in the distribution. + + $ m4 -I examples + include(`curry.m4')include(`stack.m4') + => + define(`reverse', `ifelse(`$#', `0', , `$#', `1', ``$1'', + `reverse(shift($@)), `$1'')') + => + pushdef(`a', `1')pushdef(`a', `2')pushdef(`a', `3') + => + stack_foreach(`a', `:curry(`reverse', `4')') + =>:1, 4:2, 4:3, 4 + curry(`curry', `reverse', `1')(`2')(`3') + =>3, 2, 1 + + Now for the implementation. Notice how `curry' leaves off with a +macro name but no open parenthesis, while still in the middle of +collecting arguments for `$1'. The macro `_curry' is the helper macro +that takes one argument, then adds it to the list and finally supplies +the closing parenthesis. The use of a comma inside the `shift' call +allows currying to also work for a macro that takes one argument, +although it often makes more sense to invoke that macro directly rather +than going through `curry'. + + $ m4 -I examples + undivert(`curry.m4')dnl + =>divert(`-1') + =># curry(macro, args) + =># Expand to a macro call that takes one argument, then invoke + =># macro(args, extra). + =>define(`curry', `$1(shift($@,)_$0') + =>define(`_curry', ``$1')') + =>divert`'dnl + + Unfortunately, with M4 1.4.x, `curry' is unable to handle builtin +tokens, which are silently flattened to the empty string when passed +through another text macro. This limitation will be lifted in a future +release of M4. + + Putting the last few concepts together, it is possible to copy or +rename an entire stack of macro definitions. + + -- Composite: copy (SOURCE, DEST) + -- Composite: rename (SOURCE, DEST) + Ensure that DEST is undefined, then define it to the same stack of + definitions currently in SOURCE. `copy' leaves SOURCE unchanged, + while `rename' undefines SOURCE. There are only a few macros, + such as `copy' or `defn', which cannot be copied via this macro. + + The implementation is relatively straightforward (although since it +uses `curry', it is unable to copy builtin macros, such as the second +definition of `a' as a synonym for `divnum'. See if you can design a +version that works around this limitation, or *note Answers: Improved +copy.). + + $ m4 -I examples + include(`curry.m4')include(`stack.m4') + => + define(`rename', `copy($@)undefine(`$1')')dnl + define(`copy', `ifdef(`$2', `errprint(`$2 already defined + ')m4exit(`1')', + `stack_foreach(`$1', `curry(`pushdef', `$2')')')')dnl + pushdef(`a', `1')pushdef(`a', defn(`divnum'))pushdef(`a', `2') + => + copy(`a', `b') + => + rename(`b', `c') + => + a b c + =>2 b 2 + popdef(`a', `c')c a + => 0 + popdef(`a', `c')a c + =>1 1 + + File: m4.info, Node: Debugging, Next: Input Control, Prev: Conditionals, Up: Top 7 How to debug macros and input @@ -3811,7 +3997,7 @@ behavior is likely to change in a future you should not depend on this order. It is possible to emulate POSIX behavior even with older versions of -GNU M4 by including the file `m4-1.4.12/examples/wrapfifo.m4' from the +GNU M4 by including the file `m4-1.4.13/examples/wrapfifo.m4' from the distribution: $ m4 -I examples @@ -3836,7 +4022,7 @@ distribution: It is likewise possible to emulate LIFO behavior without resorting to the GNU M4 extension of `builtin', by including the file -`m4-1.4.12/examples/wraplifo.m4' from the distribution. +`m4-1.4.13/examples/wraplifo.m4' from the distribution. (Unfortunately, both examples shown here share some subtle bugs. See if you can find and correct them; or *note Answers: Improved m4wrap.). @@ -3942,8 +4128,8 @@ There are two builtin macros in `m4' for The rest of this section assumes that `m4' is invoked with the `-I' option (*note Invoking m4: Preprocessor features.) pointing to the -`m4-1.4.12/examples' directory shipped as part of the GNU `m4' package. -The file `m4-1.4.12/examples/incl.m4' in the distribution contains the +`m4-1.4.13/examples' directory shipped as part of the GNU `m4' package. +The file `m4-1.4.13/examples/incl.m4' in the distribution contains the lines: $ cat examples/incl.m4 @@ -4181,6 +4367,14 @@ since the output has already been flushe undivert =>diverted text => + divert(`1')more + divert(`2')undivert(`1')diverted text`'divert + => + undivert(`1') + => + undivert(`2') + =>more + =>diverted text When a diversion has been undiverted, the diverted text is discarded, and it is not possible to bring back diverted text more than once. @@ -4593,7 +4787,7 @@ individual words or whole sentences, by upper case and the remaining characters to lower case. First, an example of their usage, using implementations distributed -in `m4-1.4.12/examples/capitalize.m4'. +in `m4-1.4.13/examples/capitalize.m4'. $ m4 -I examples include(`capitalize.m4') @@ -5143,6 +5337,14 @@ Any shell command can be executed, using default standard input, output and error of SHELL-COMMAND are the same as those of `m4'. + By default, the SHELL-COMMAND will be used as the argument to the + `-c' option of the `/bin/sh' shell (or the version of `sh' + specified by `command -p getconf PATH', if your system supports + that). If you prefer a different shell, the `configure' script + can be given the option `--with-syscmd-shell=LOCATION' to set the + location of an alternative shell at GNU `m4' installation; the + alternative shell must still support `-c'. + The macro `syscmd' is recognized only with parameters. define(`foo', `FOO') @@ -5188,6 +5390,14 @@ If you want `m4' to read the output of a part of the expansion: it will appear along with the error output of `m4'. + By default, the SHELL-COMMAND will be used as the argument to the + `-c' option of the `/bin/sh' shell (or the version of `sh' + specified by `command -p getconf PATH', if your system supports + that). If you prefer a different shell, the `configure' script + can be given the option `--with-syscmd-shell=LOCATION' to set the + location of an alternative shell at GNU `m4' installation; the + alternative shell must still support `-c'. + The macro `esyscmd' is recognized only with parameters. define(`foo', `FOO') @@ -5716,7 +5926,7 @@ characters. The directives are: the same name, and its order, along with `F', is important. `V NUMBER <NL>' - Confirms the format of the file. `m4' 1.4.12 only creates and + Confirms the format of the file. `m4' 1.4.13 only creates and understands frozen files where NUMBER is 1. This directive must be the first non-comment in the file, and may not appear more than once. @@ -6080,6 +6290,7 @@ presented here. * Improved exch:: Solution for `exch' * Improved forloop:: Solution for `forloop' * Improved foreach:: Solution for `foreach' +* Improved copy:: Solution for `copy' * Improved m4wrap:: Solution for `m4wrap' * Improved cleardivert:: Solution for `cleardivert' * Improved capitalize:: Solution for `capitalize' @@ -6114,7 +6325,7 @@ The `forloop' macro (*note Forloop::) as an infinite loop if given an iterator that is not parsed as a macro name. It does not do any sanity checking on its numeric bounds, and only permits decimal numbers for bounds. Here is an improved version, -shipped as `m4-1.4.12/examples/forloop2.m4'; this version also +shipped as `m4-1.4.13/examples/forloop2.m4'; this version also optimizes overhead by calling four macros instead of six per iteration (excluding those in TEXT), by not dereferencing the ITERATOR in the helper `_forloop'. @@ -6182,13 +6393,62 @@ this example. forloop2(i, 1, 5, ``ifelse('')forloop2(i, 1, 5, ``)'') error-->m4:stdin:12: recursion limit of 9 exceeded, use -L<N> to change it + One more optimization is still possible. Instead of repeatedly +assigning a variable then invoking or dereferencing it, it is possible +to pass the current iterator value as a single argument. Coupled with +`curry' if other arguments are needed (*note Composition::), or with +helper macros if the argument is needed in more than one place in the +expansion, the output can be generated with three, rather than four, +macros of overhead per iteration. Notice how the file +`m4-1.4.13/examples/forloop3.m4' rearranges the arguments of the helper +`_forloop' to take two arguments that are placed around the current +value. By splitting a balanced set of parantheses across multiple +arguments, the helper macro can now be shared by `forloop' and the new +`forloop_arg'. + + $ m4 -I examples + include(`forloop3.m4') + => + undivert(`forloop3.m4')dnl + =>divert(`-1') + =># forloop_arg(from, to, macro) - invoke MACRO(value) for + =># each value between FROM and TO, without define overhead + =>define(`forloop_arg', `ifelse(eval(`($1) <= ($2)'), `1', + => `_forloop(`$1', eval(`$2'), `$3(', `)')')') + =># forloop(var, from, to, stmt) - refactored to share code + =>define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', + => `pushdef(`$1')_forloop(eval(`$2'), eval(`$3'), + => `define(`$1',', `)$4')popdef(`$1')')') + =>define(`_forloop', + => `$3`$1'$4`'ifelse(`$1', `$2', `', + => `$0(incr(`$1'), `$2', `$3', `$4')')') + =>divert`'dnl + forloop(`i', `1', `3', ` i') + => 1 2 3 + define(`echo', `$@') + => + forloop_arg(`1', `3', ` echo') + => 1 2 3 + include(`curry.m4') + => + forloop_arg(`1', `3', `curry(`pushdef', `a')') + => + a + =>3 + popdef(`a')a + =>2 + popdef(`a')a + =>1 + popdef(`a')a + =>a + Of course, it is possible to make even more improvements, such as adding an optional step argument, or allowing iteration through descending sequences. GNU Autoconf provides some of these additional bells and whistles in its `m4_for' macro.  -File: m4.info, Node: Improved foreach, Next: Improved m4wrap, Prev: Improved forloop, Up: Answers +File: m4.info, Node: Improved foreach, Next: Improved copy, Prev: Improved forloop, Up: Answers 17.3 Solution for `foreach' =========================== @@ -6232,7 +6492,7 @@ recursion use fewer arguments, rather th uses of `shift'. By doing so, `m4' uses less memory, invokes fewer macros, is less likely to run into machine limits, and most importantly, performs faster. The fixed version of `foreachq' can be -found in `m4-1.4.12/examples/foreachq2.m4': +found in `m4-1.4.13/examples/foreachq2.m4': $ m4 -I examples include(`foreachq2.m4') @@ -6281,7 +6541,7 @@ operate on an unboxed list in the first fixed-length `$#' instead of an arbitrary length list as the key to end recursion. The result is an overhead of six macro invocations per loop (excluding any macros in TEXT), instead of eight. This alternative -approach is available as `m4-1.4.12/examples/foreach3.m4': +approach is available as `m4-1.4.13/examples/foreach3.m4': $ m4 -I examples include(`foreachq3.m4') @@ -6390,7 +6650,7 @@ supported. =>4 For yet another approach, the improved version of `foreach', -available in `m4-1.4.12/examples/foreach2.m4', simply overquotes the +available in `m4-1.4.13/examples/foreach2.m4', simply overquotes the arguments to `_foreach' to begin with, using `dquote_elt'. Then `_foreach' can just use `_arg1' to remove the extra layer of quoting that was added up front: @@ -6515,9 +6775,95 @@ will have any detrimental effects. =><active>  -File: m4.info, Node: Improved m4wrap, Next: Improved cleardivert, Prev: Improved foreach, Up: Answers +File: m4.info, Node: Improved copy, Next: Improved m4wrap, Prev: Improved foreach, Up: Answers + +17.4 Solution for `copy' +======================== + +The macro `copy' presented above is unable to handle builtin tokens +with M4 1.4.x, because it tries to pass the builtin token through the +macro `curry', where it is silently flattened to an empty string (*note +Composition::). Rather than using the problematic `curry' to work +around the limitation that `stack_foreach' expects to invoke a macro +that takes exactly one argument, we can write a new macro that lets us +form the exact two-argument `pushdef' call sequence needed, so that we +are no longer passing a builtin token through a text macro. + + -- Composite: stack_foreach_sep (MACRO, PRE, POST, SEP) + -- Composite: stack_foreach_sep_lifo (MACRO, PRE, POST, SEP) + For each of the `pushdef' definitions associated with MACRO, + expand the sequence `PRE`'definition`'POST'. Additionally, expand + SEP between definitions. `stack_foreach_sep' visits the oldest + definition first, while `stack_foreach_sep_lifo' visits the + current definition first. The expansion may dereference MACRO, + but should not modify it. There are a few special macros, such as + `defn', which cannot be used as the MACRO parameter. + + Note that `stack_foreach(`MACRO', `ACTION')' is equivalent to +`stack_foreach_sep(`MACRO', `ACTION(', `)')'. By supplying explicit +parentheses, split among the PRE and POST arguments to +`stack_foreach_sep', it is now possible to construct macro calls with +more than one argument, without passing builtin tokens through a macro +call. It is likewise possible to directly reference the stack +definitions without a macro call, by leaving PRE and POST empty. Thus, +in addition to fixing `copy' on builtin tokens, it also executes with +fewer macro invocations. + + The new macro also adds a separator that is only output after the +first iteration of the helper `_stack_reverse_sep', implemented by +prepending the original SEP to PRE and omitting a SEP argument in +subsequent iterations. Note that the empty string that separates SEP +from PRE is provided as part of the fourth argument when originally +calling `_stack_reverse_sep', and not by writing `$4`'$3' as the third +argument in the recursive call; while the other approach would give the +same output, it does so at the expense of increasing the argument size +on each iteration of `_stack_reverse_sep', which results in quadratic +instead of linear execution time. The improved stack walking macros +are available in `m4-1.4.13/examples/stack_sep.m4': + + $ m4 -I examples + include(`stack_sep.m4') + => + define(`copy', `ifdef(`$2', `errprint(`$2 already defined + ')m4exit(`1')', + `stack_foreach_sep(`$1', `pushdef(`$2',', `)')')')dnl + pushdef(`a', `1')pushdef(`a', defn(`divnum')) + => + copy(`a', `b') + => + b + =>0 + popdef(`b') + => + b + =>1 + pushdef(`c', `1')pushdef(`c', `2') + => + stack_foreach_sep_lifo(`c', `', `', `, ') + =>2, 1 + undivert(`stack_sep.m4')dnl + =>divert(`-1') + =># stack_foreach_sep(macro, pre, post, sep) + =># Invoke PRE`'defn`'POST with a single argument of each definition + =># from the definition stack of MACRO, starting with the oldest, and + =># separated by SEP between definitions. + =>define(`stack_foreach_sep', + =>`_stack_reverse_sep(`$1', `tmp-$1')'dnl + =>`_stack_reverse_sep(`tmp-$1', `$1', `$2`'defn(`$1')$3', `$4`'')') + =># stack_foreach_sep_lifo(macro, pre, post, sep) + =># Like stack_foreach_sep, but starting with the newest definition. + =>define(`stack_foreach_sep_lifo', + =>`_stack_reverse_sep(`$1', `tmp-$1', `$2`'defn(`$1')$3', `$4`'')'dnl + =>`_stack_reverse_sep(`tmp-$1', `$1')') + =>define(`_stack_reverse_sep', + =>`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0( + => `$1', `$2', `$4$3')')') + =>divert`'dnl + + +File: m4.info, Node: Improved m4wrap, Next: Improved cleardivert, Prev: Improved copy, Up: Answers -17.4 Solution for `m4wrap' +17.5 Solution for `m4wrap' ========================== The replacement `m4wrap' versions presented above, designed to @@ -6553,7 +6899,7 @@ in an undefined state. arguments to `m4wrap', separated by a space, rather than saving just the first argument. This is done with the `join' macro documented previously (*note Shift::). The improved LIFO example is shipped as -`m4-1.4.12/examples/wraplifo2.m4', and can easily be converted to a +`m4-1.4.13/examples/wraplifo2.m4', and can easily be converted to a FIFO solution by swapping the adjacent invocations of `joinall' and `defn'. @@ -6585,7 +6931,7 @@ FIFO solution by swapping the adjacent i  File: m4.info, Node: Improved cleardivert, Next: Improved capitalize, Prev: Improved m4wrap, Up: Answers -17.5 Solution for `cleardivert' +17.6 Solution for `cleardivert' =============================== The `cleardivert' macro (*note Cleardivert::) cannot, as it stands, be @@ -6620,7 +6966,7 @@ with one that takes the number of argume  File: m4.info, Node: Improved capitalize, Next: Improved fatal_error, Prev: Improved cleardivert, Up: Answers -17.6 Solution for `capitalize' +17.7 Solution for `capitalize' ============================== The `capitalize' macro (*note Patsubst::) as presented earlier does not @@ -6689,7 +7035,7 @@ string. In turn, that means the replace necessitating another round of `changequote'. In the fixed version below, (also shipped as -`m4-1.4.12/examples/capitalize.m4'), `capitalize' uses the alternate +`m4-1.4.13/examples/capitalize.m4'), `capitalize' uses the alternate quotes of `<<[' and `]>>' (the longer strings are chosen so as to be less likely to appear in the text being converted). The helpers `_to_alt' and `_from_alt' merely reduce the number of characters @@ -6733,7 +7079,7 @@ are invoked with the alternate quoting s  File: m4.info, Node: Improved fatal_error, Prev: Improved capitalize, Up: Answers -17.7 Solution for `fatal_error' +17.8 Solution for `fatal_error' =============================== The `fatal_error' macro (*note M4exit::) is not robust to versions of @@ -7503,7 +7849,7 @@ Appendix B How to make copies of this ma This appendix covers the license for copying this manual. Note that some of the longer examples in this manual are also distributed in the -directory `m4-1.4.12/examples/', where a more permissive license is in +directory `m4-1.4.13/examples/', where a more permissive license is in effect when copying just the examples. * Menu: Files m4-1.4.12/doc/m4.info-2 and m4-1.4.13/doc/m4.info-2 differ diff -ruNp m4-1.4.12/doc/m4.texinfo m4-1.4.13/doc/m4.texinfo --- m4-1.4.12/doc/m4.texinfo 2008-09-25 19:33:03.000000000 -0600 +++ m4-1.4.13/doc/m4.texinfo 2009-03-05 05:46:01.000000000 -0700 @@ -44,7 +44,7 @@ This manual (@value{UPDATED}) is for @ac language. Copyright @copyright{} 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, -2006, 2007, 2008 Free Software Foundation, Inc. +2006, 2007, 2008, 2009 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -197,6 +197,8 @@ Conditionals, loops, and recursion * Shift:: Recursion in @code{m4} * Forloop:: Iteration by counting * Foreach:: Iteration by list contents +* Stacks:: Working with definition stacks +* Composition:: Building macros with macros How to debug macros and input @@ -270,6 +272,7 @@ Correct version of some examples * Improved exch:: Solution for @code{exch} * Improved forloop:: Solution for @code{forloop} * Improved foreach:: Solution for @code{foreach} +* Improved copy:: Solution for @code{copy} * Improved m4wrap:: Solution for @code{m4wrap} * Improved cleardivert:: Solution for @code{cleardivert} * Improved capitalize:: Solution for @code{capitalize} @@ -395,7 +398,8 @@ addressed some long standing bugs in the released 1.4.3 and 1.4.4. And in 2006, Eric Blake joined the team and prepared patches for the release of 1.4.5, 1.4.6, 1.4.7, and 1.4.8. More bug fixes were incorporated in 2007, with releases 1.4.9 and -1.4.10, closing the series with 1.4.11 and 1.4.12 in 2008. +1.4.10. Eric continued with some portability fixes for 1.4.11 and +1.4.12 in 2008, and 1.4.13 in 2009. Meanwhile, development has continued on new features for @code{m4}, such as dynamic module loading and additional builtins. When complete, @@ -617,12 +621,12 @@ is also specified. Suppress warnings, such as missing or superfluous arguments in macro calls, or treating the empty string as zero. -@item --warn-macro-sequence@r{[}=@var{REGEXP}@r{]} -Issue a warning if the regular expression @var{REGEXP} has a non-empty +@item --warn-macro-sequence@r{[}=@var{regexp}@r{]} +Issue a warning if the regular expression @var{regexp} has a non-empty match in any macro definition (either by @code{define} or @code{pushdef}). Empty matches are ignored; therefore, supplying the -empty string as @var{REGEXP} disables any warning. If the optional -@var{REGEXP} is not supplied, then the default regular expression is +empty string as @var{regexp} disables any warning. If the optional +@var{regexp} is not supplied, then the default regular expression is @samp{\$\(@{[^@}]*@}\|[0-9][0-9]+\)} (a literal @samp{$} followed by multiple digits or by an open brace), since these sequences will change semantics in the default operation of @acronym{GNU} M4 2.0 (due @@ -631,9 +635,9 @@ handled, @pxref{Arguments}). Providing expression can provide a useful reverse lookup feature of finding where a macro is defined to have a given definition. -@item -W @var{REGEXP} -@itemx --word-regexp=@var{REGEXP} -Use @var{REGEXP} as an alternative syntax for macro names. This +@item -W @var{regexp} +@itemx --word-regexp=@var{regexp} +Use @var{regexp} as an alternative syntax for macro names. This experimental option will not be present in all @acronym{GNU} @code{m4} implementations (@pxref{Changeword}). @end table @@ -650,18 +654,18 @@ search path can be altered, and the outp input came from. These features occur with the following options: @table @code -@item -D @var{NAME}@r{[}=@var{VALUE}@r{]} -@itemx --define=@var{NAME}@r{[}=@var{VALUE}@r{]} -This enters @var{NAME} into the symbol table. If @samp{=@var{VALUE}} is -missing, the value is taken to be the empty string. The @var{VALUE} can +@item -D @var{name}@r{[}=@var{value}@r{]} +@itemx --define=@var{name}@r{[}=@var{value}@r{]} +This enters @var{name} into the symbol table. If @samp{=@var{value}} is +missing, the value is taken to be the empty string. The @var{value} can be any string, and the macro can be defined to take arguments, just as if it was defined from within the input. This option may be given more than once; order with respect to file names is significant, and -redefining the same @var{NAME} loses the previous value. +redefining the same @var{name} loses the previous value. -@item -I @var{DIRECTORY} -@itemx --include=@var{DIRECTORY} -Make @code{m4} search @var{DIRECTORY} for included files that are not +@item -I @var{directory} +@itemx --include=@var{directory} +Make @code{m4} search @var{directory} for included files that are not found in the current working directory. @xref{Search Path}, for more details. This option may be given more than once. @@ -721,11 +725,11 @@ goodbye @result{}goodbye @end example -@item -U @var{NAME} -@itemx --undefine=@var{NAME} -This deletes any predefined meaning @var{NAME} might have. Obviously, +@item -U @var{name} +@itemx --undefine=@var{name} +This deletes any predefined meaning @var{name} might have. Obviously, only predefined macros can be deleted in this way. This option may be -given more than once; undefining a @var{NAME} that does not have a +given more than once; undefining a @var{name} that does not have a definition is silently ignored. Order is significant with respect to file names. @end table @@ -762,18 +766,18 @@ environment. Suppress all the extensions made in this implementation, compared to the System V version. @xref{Compatibility}, for a list of these. -@item -H @var{NUM} -@itemx --hashsize=@var{NUM} -Make the internal hash table for symbol lookup be @var{NUM} entries big. +@item -H @var{num} +@itemx --hashsize=@var{num} +Make the internal hash table for symbol lookup be @var{num} entries big. For better performance, the number should be prime, but this is not checked. The default is 509 entries. It should not be necessary to increase this value, unless you define an excessive number of macros. -@item -L @var{NUM} -@itemx --nesting-limit=@var{NUM} +@item -L @var{num} +@itemx --nesting-limit=@var{num} @cindex nesting limit @cindex limit, nesting -Artificially limit the nesting of macro calls to @var{NUM} levels, +Artificially limit the nesting of macro calls to @var{num} levels, stopping program execution if this limit is ever exceeded. When not specified, nesting defaults to unlimited on platforms that can detect stack overflow, and to 1024 levels otherwise. A value of zero means @@ -798,15 +802,15 @@ only the simplest example (but @pxref{Co system to detect and diagnose endless loops: it is a quite @emph{hard} problem in general, if not undecidable! -@item -B @var{NUM} -@itemx -S @var{NUM} -@itemx -T @var{NUM} +@item -B @var{num} +@itemx -S @var{num} +@itemx -T @var{num} These options are present for compatibility with System V @code{m4}, but do nothing in this implementation. They may disappear in future releases, and issue a warning to that effect. -@item -N @var{NUM} -@itemx --diversions=@var{NUM} +@item -N @var{num} +@itemx --diversions=@var{num} These options are present only for compatibility with previous versions of @acronym{GNU} @code{m4}, and were controlling the number of possible diversions which could be used at the same time. They do nothing, @@ -822,16 +826,16 @@ releases, and issue a warning to that ef execution when reusing a common initialization script. @table @code -@item -F @var{FILE} -@itemx --freeze-state=@var{FILE} +@item -F @var{file} +@itemx --freeze-state=@var{file} Once execution is finished, write out the frozen state on the specified -@var{FILE}. It is conventional, but not required, for @var{FILE} to end +@var{file}. It is conventional, but not required, for @var{file} to end in @samp{.m4f}. -@item -R @var{FILE} -@itemx --reload-state=@var{FILE} +@item -R @var{file} +@itemx --reload-state=@var{file} Before execution starts, recover the internal state from the specified -frozen @var{FILE}. The options @option{-D}, @option{-U}, and +frozen @var{file}. The options @option{-D}, @option{-U}, and @option{-t} take effect after state is reloaded, but before the input files are read. @end table @@ -843,36 +847,56 @@ Finally, there are several options for a scripts. @table @code -@item -d@r{[}@var{FLAGS}@r{]} -@itemx --debug@r{[}=@var{FLAGS}@r{]} -Set the debug-level according to the flags @var{FLAGS}. The debug-level +@item -d@r{[}@var{flags}@r{]} +@itemx --debug@r{[}=@var{flags}@r{]} +Set the debug-level according to the flags @var{flags}. The debug-level controls the format and amount of information presented by the debugging functions. @xref{Debug Levels}, for more details on the format and -meaning of @var{FLAGS}. If omitted, @var{FLAGS} defaults to @samp{aeq}. +meaning of @var{flags}. If omitted, @var{flags} defaults to @samp{aeq}. -@item --debugfile=@var{FILE} -@itemx -o @var{FILE} -@itemx --error-output=@var{FILE} +@item --debugfile@r{[}=@var{file}@r{]} +@itemx -o @var{file} +@itemx --error-output=@var{file} Redirect @code{dumpdef} output, debug messages, and trace output to the -named @var{FILE}. Warnings, error messages, and @code{errprint} output -are still printed to standard error. If unspecified, debug output goes -to standard error; if empty, debug output is discarded. @xref{Debug -Output}, for more details. The spellings @option{-o} and +named @var{file}. Warnings, error messages, and @code{errprint} output +are still printed to standard error. If these options are not used, or +if @var{file} is unspecified (only possible for @option{--debugfile}), +debug output goes to standard error; if @var{file} is the empty string, +debug output is discarded. @xref{Debug Output}, for more details. The +option @option{--debugfile} may be given more than once, and order is +significant with respect to file names. The spellings @option{-o} and @option{--error-output} are misleading and inconsistent with other @acronym{GNU} tools; for now they are silently accepted as synonyms of -@option{--debugfile}, but in a future version of M4, using them will -cause a warning to be issued. +@option{--debugfile} and only recognized once, but in a future version +of M4, using them will cause a warning to be issued. -@item -l @var{NUM} -@itemx --arglength=@var{NUM} -Restrict the size of the output generated by macro tracing to @var{NUM} +@ignore +@comment not worth including in the manual, but provides a good test + +@comment examples +@comment options: -Dbar=hello -tbar --debugfile= foo --debugfile - +@example +$ @kbd{m4 -d -Iexamples -Dbar=hello -tbar --debugfile= foo --debugfile - +@result{}hello +errprint(`hi +')dnl +@error{}hi +bar +@error{}m4trace: -1- bar -> `hello' +@result{}hello +@end example +@end ignore + +@item -l @var{num} +@itemx --arglength=@var{num} +Restrict the size of the output generated by macro tracing to @var{num} characters per trace line. If unspecified or zero, output is unlimited. @xref{Debug Levels}, for more details. -@item -t @var{NAME} -@itemx --trace=@var{NAME} -This enables tracing for the macro @var{NAME}, at any point where it is -defined. @var{NAME} need not be defined when this option is given. +@item -t @var{name} +@itemx --trace=@var{name} +This enables tracing for the macro @var{name}, at any point where it is +defined. @var{name} need not be defined when this option is given. This option may be given more than once, and order is significant with respect to file names. @xref{Trace}, for more details. @end table @@ -2295,6 +2319,7 @@ traceoff(`defn', `define') @cindex temporary redefinition of macros @cindex redefinition of macros, temporary @cindex definition stack +@cindex pushdef stack @cindex stack, macro definition It is possible to redefine a macro temporarily, reverting to the previous definition at a later time. This is done with the builtins @@ -2597,6 +2622,8 @@ something a number of times, or while so * Shift:: Recursion in @code{m4} * Forloop:: Iteration by counting * Foreach:: Iteration by list contents +* Stacks:: Working with definition stacks +* Composition:: Building macros with macros @end menu @node Ifdef @@ -2704,67 +2731,13 @@ foo(`a', `b', `c') @result{}arguments:3 @end example -Since m4 is a macro language, it is even possible to write a macro that -makes defining blind macros easier: - -@deffn Composite define_blind (@var{name}, @ovar{value}) -Defines @var{name} as a blind macro, such that @var{name} will expand to -@var{value} only when given explicit arguments. @var{value} should not -be the result of @code{defn} (@pxref{Defn}). This macro is only -recognized with parameters, and results in an empty string. -@end deffn - -Defining a macro to define another macro can be a bit tricky. We want -to use a literal @samp{$#} in the argument to the nested @code{define}. -However, if @samp{$} and @samp{#} are adjacent in the definition of -@code{define_blind}, then it would be expanded as the number of -arguments to @code{define_blind} rather than the intended number of -arguments to @var{name}. The solution is to pass the difficult -characters through extra arguments to a helper macro -@code{_define_blind}. - -As for the limitation against using @code{defn}, there are two reasons. -If a macro was previously defined with @code{define_blind}, then it can -safely be renamed to a new blind macro using plain @code{define}; using -@code{define_blind} to rename it just adds another layer of -@code{ifelse}, occupying memory and slowing down execution. And if a -macro is a builtin, then it would result in an attempt to define a macro -consisting of both text and a builtin token; this is not supported, and -the builtin token is flattened to an empty string. - -With that explanation, here's the definition, and some sample usage. -Notice that @code{define_blind} is itself a blind macro. - -@example -$ @kbd{m4 -d} -define(`define_blind', `ifelse(`$#', `0', ``$0'', -`_$0(`$1', `$2', `$'`#', `$'`0')')') -@result{} -define(`_define_blind', `define(`$1', -`ifelse(`$3', `0', ``$4'', `$2')')') -@result{} -define_blind -@result{}define_blind -define_blind(`foo', `arguments were $*') -@result{} -foo -@result{}foo -foo(`bar') -@result{}arguments were bar -define(`blah', defn(`foo')) -@result{} -blah -@result{}blah -blah(`a', `b') -@result{}arguments were a,b -defn(`blah') -@result{}ifelse(`$#', `0', ``$0'', `arguments were $*') -@end example +For an example of a way to make defining blind macros easier, see +@ref{Composition}. @cindex multibranches @cindex switch statement @cindex case statement -However, @code{ifelse} can take more than four arguments. If given more +The macro @code{ifelse} can take more than four arguments. If given more than four arguments, @code{ifelse} works like a @code{case} or @code{switch} statement in traditional programming languages. If @var{string-1} and @var{string-2} are equal, @code{ifelse} expands into @var{equal-1}, otherwise @@ -3417,6 +3390,264 @@ It is possible to have robust iteration from the best elements of both of these implementations to create robust macros (or @pxref{Improved foreach, , Answers}). +@node Stacks +@section Working with definition stacks + +@cindex definition stack +@cindex pushdef stack +@cindex stack, macro definition +Thanks to @code{pushdef}, manipulation of a stack is an intrinsic +operation in @code{m4}. Normally, only the topmost definition in a +stack is important, but sometimes, it is desirable to manipulate the +entire definition stack. + +@deffn Composite stack_foreach (@var{macro}, @var{action}) +@deffnx Composite stack_foreach_lifo (@var{macro}, @var{action}) +For each of the @code{pushdef} definitions associated with @var{macro}, +invoke the macro @var{action} with a single argument of that definition. +@code{stack_foreach} visits the oldest definition first, while +@code{stack_foreach_lifo} visits the current definition first. +@var{action} should not modify or dereference @var{macro}. There are a +few special macros, such as @code{defn}, which cannot be used as the +@var{macro} parameter. +@end deffn + +A sample implementation of these macros is distributed in the file +@file{m4-@value{VERSION}/@/examples/@/stack.m4}. + +@comment examples +@example +$ @kbd{m4 -I examples} +include(`stack.m4') +@result{} +pushdef(`a', `1')pushdef(`a', `2')pushdef(`a', `3') +@result{} +define(`show', ``$1' +') +@result{} +stack_foreach(`a', `show')dnl +@result{}1 +@result{}2 +@result{}3 +stack_foreach_lifo(`a', `show')dnl +@result{}3 +@result{}2 +@result{}1 +@end example + +Now for the implementation. Note the definition of a helper macro, +@code{_stack_reverse}, which destructively swaps the contents of one +stack of definitions into the reverse order in the temporary macro +@samp{tmp-$1}. By calling the helper twice, the original order is +restored back into the macro @samp{$1}; since the operation is +destructive, this explains why @samp{$1} must not be modified or +dereferenced during the traversal. The caller can then inject +additional code to pass the definition currently being visited to +@samp{$2}. The choice of helper names is intentional; since @samp{-} is +not valid as part of a macro name, there is no risk of conflict with a +valid macro name, and the code is guaranteed to use @code{defn} where +necessary. Finally, note that any macro used in the traversal of a +@code{pushdef} stack, such as @code{pushdef} or @code{defn}, cannot be +handled by @code{stack_foreach}, since the macro would temporarily be +undefined during the algorithm. + +@comment examples +@example +$ @kbd{m4 -I examples} +undivert(`stack.m4')dnl +@result{}divert(`-1') +@result{}# stack_foreach(macro, action) +@result{}# Invoke ACTION with a single argument of each definition +@result{}# from the definition stack of MACRO, starting with the oldest. +@result{}define(`stack_foreach', +@result{}`_stack_reverse(`$1', `tmp-$1')'dnl +@result{}`_stack_reverse(`tmp-$1', `$1', `$2(defn(`$1'))')') +@result{}# stack_foreach_lifo(macro, action) +@result{}# Invoke ACTION with a single argument of each definition +@result{}# from the definition stack of MACRO, starting with the newest. +@result{}define(`stack_foreach_lifo', +@result{}`_stack_reverse(`$1', `tmp-$1', `$2(defn(`$1'))')'dnl +@result{}`_stack_reverse(`tmp-$1', `$1')') +@result{}define(`_stack_reverse', +@result{}`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0($@@)')') +@result{}divert`'dnl +@end example + +@node Composition +@section Building macros with macros + +@cindex macro composition +@cindex composing macros +Since m4 is a macro language, it is possible to write macros that +can build other macros. First on the list is a way to automate the +creation of blind macros. + +@cindex macro, blind +@cindex blind macro +@deffn Composite define_blind (@var{name}, @ovar{value}) +Defines @var{name} as a blind macro, such that @var{name} will expand to +@var{value} only when given explicit arguments. @var{value} should not +be the result of @code{defn} (@pxref{Defn}). This macro is only +recognized with parameters, and results in an empty string. +@end deffn + +Defining a macro to define another macro can be a bit tricky. We want +to use a literal @samp{$#} in the argument to the nested @code{define}. +However, if @samp{$} and @samp{#} are adjacent in the definition of +@code{define_blind}, then it would be expanded as the number of +arguments to @code{define_blind} rather than the intended number of +arguments to @var{name}. The solution is to pass the difficult +characters through extra arguments to a helper macro +@code{_define_blind}. When composing macros, it is a common idiom to +need a helper macro to concatenate text that forms parameters in the +composed macro, rather than interpreting the text as a parameter of the +composing macro. + +As for the limitation against using @code{defn}, there are two reasons. +If a macro was previously defined with @code{define_blind}, then it can +safely be renamed to a new blind macro using plain @code{define}; using +@code{define_blind} to rename it just adds another layer of +@code{ifelse}, occupying memory and slowing down execution. And if a +macro is a builtin, then it would result in an attempt to define a macro +consisting of both text and a builtin token; this is not supported, and +the builtin token is flattened to an empty string. + +With that explanation, here's the definition, and some sample usage. +Notice that @code{define_blind} is itself a blind macro. + +@example +$ @kbd{m4 -d} +define(`define_blind', `ifelse(`$#', `0', ``$0'', +`_$0(`$1', `$2', `$'`#', `$'`0')')') +@result{} +define(`_define_blind', `define(`$1', +`ifelse(`$3', `0', ``$4'', `$2')')') +@result{} +define_blind +@result{}define_blind +define_blind(`foo', `arguments were $*') +@result{} +foo +@result{}foo +foo(`bar') +@result{}arguments were bar +define(`blah', defn(`foo')) +@result{} +blah +@result{}blah +blah(`a', `b') +@result{}arguments were a,b +defn(`blah') +@result{}ifelse(`$#', `0', ``$0'', `arguments were $*') +@end example + +@cindex currying arguments +@cindex argument currying +Another interesting composition tactic is argument @dfn{currying}, or +factoring a macro that takes multiple arguments for use in a context +that provides exactly one argument. + +@deffn Composite curry (@var{macro}, @dots{}) +Expand to a macro call that takes exactly one argument, then appends +that argument to the original arguments and invokes @var{macro} with the +resulting list of arguments. +@end deffn + +A demonstration of currying makes the intent of this macro a little more +obvious. The macro @code{stack_foreach} mentioned earlier is an example +of a context that provides exactly one argument to a macro name. But +coupled with currying, we can invoke @code{reverse} with two arguments +for each definition of a macro stack. This example uses the file +@file{m4-@value{VERSION}/@/examples/@/curry.m4} included in the +distribution. + +@comment examples +@example +$ @kbd{m4 -I examples} +include(`curry.m4')include(`stack.m4') +@result{} +define(`reverse', `ifelse(`$#', `0', , `$#', `1', ``$1'', + `reverse(shift($@@)), `$1'')') +@result{} +pushdef(`a', `1')pushdef(`a', `2')pushdef(`a', `3') +@result{} +stack_foreach(`a', `:curry(`reverse', `4')') +@result{}:1, 4:2, 4:3, 4 +curry(`curry', `reverse', `1')(`2')(`3') +@result{}3, 2, 1 +@end example + +Now for the implementation. Notice how @code{curry} leaves off with a +macro name but no open parenthesis, while still in the middle of +collecting arguments for @samp{$1}. The macro @code{_curry} is the +helper macro that takes one argument, then adds it to the list and +finally supplies the closing parenthesis. The use of a comma inside the +@code{shift} call allows currying to also work for a macro that takes +one argument, although it often makes more sense to invoke that macro +directly rather than going through @code{curry}. + +@comment examples +@example +$ @kbd{m4 -I examples} +undivert(`curry.m4')dnl +@result{}divert(`-1') +@result{}# curry(macro, args) +@result{}# Expand to a macro call that takes one argument, then invoke +@result{}# macro(args, extra). +@result{}define(`curry', `$1(shift($@@,)_$0') +@result{}define(`_curry', ``$1')') +@result{}divert`'dnl +@end example + +Unfortunately, with M4 1.4.x, @code{curry} is unable to handle builtin +tokens, which are silently flattened to the empty string when passed +through another text macro. This limitation will be lifted in a future +release of M4. + +@cindex renaming macros +@cindex copying macros +@cindex macros, copying +Putting the last few concepts together, it is possible to copy or rename +an entire stack of macro definitions. + +@deffn Composite copy (@var{source}, @var{dest}) +@deffnx Composite rename (@var{source}, @var{dest}) +Ensure that @var{dest} is undefined, then define it to the same stack of +definitions currently in @var{source}. @code{copy} leaves @var{source} +unchanged, while @code{rename} undefines @var{source}. There are only a +few macros, such as @code{copy} or @code{defn}, which cannot be copied +via this macro. +@end deffn + +The implementation is relatively straightforward (although since it uses +@code{curry}, it is unable to copy builtin macros, such as the second +definition of @code{a} as a synonym for @code{divnum}. See if you can +design a version that works around this limitation, or @pxref{Improved +copy, , Answers}). + +@comment examples +@example +$ @kbd{m4 -I examples} +include(`curry.m4')include(`stack.m4') +@result{} +define(`rename', `copy($@@)undefine(`$1')')dnl +define(`copy', `ifdef(`$2', `errprint(`$2 already defined +')m4exit(`1')', + `stack_foreach(`$1', `curry(`pushdef', `$2')')')')dnl +pushdef(`a', `1')pushdef(`a', defn(`divnum'))pushdef(`a', `2') +@result{} +copy(`a', `b') +@result{} +rename(`b', `c') +@result{} +a b c +@result{}2 b 2 +popdef(`a', `c')c a +@result{} 0 +popdef(`a', `c')a c +@result{}1 1 +@end example + @node Debugging @chapter How to debug macros and input @@ -4321,7 +4552,8 @@ changecom(`/*', `*/') @quotation The macro @code{changeword} and all associated functionality is experimental. It is only available if the @option{--enable-changeword} -option was given to @code{configure}, at @acronym{GNU} @code{m4} installation +option was given to @command{configure}, at @acronym{GNU} @code{m4} +installation time. The functionality will go away in the future, to be replaced by other new features that are more efficient at providing the same capabilities. @emph{Do not rely on it}. Please direct your comments @@ -4901,7 +5133,12 @@ len(f) @result{}1048576 divert(`1') f +divert(`2') +f divert(`-1')undivert +divert(`1')bye +^D +@result{}bye @end example @comment Another test of spilled diversions. @@ -4944,11 +5181,27 @@ ifdef(`__unix__', , ')m4exit(`77')')dnl changequote(`[', `]')dnl syscmd([echo 'divert(1)hi -format(%1000000d, 1)' | ]__program__[ | sed -n 1p])dnl +format(%1000000d, 1)' | ']__program__[' | sed -n 1p])dnl @result{}hi sysval @result{}0 @end example + +@comment Avoid quadratic copying time when transferring diversions; +@comment test both in-memory and spilled to file. + +@comment examples +@example +$ @kbd{m4 -I examples} +include(`forloop2.m4')dnl +divert(`1')format(`%10000s', `')dnl +forloop(`i', `1', `10000', + `divert(incr(i))undivert(i)')dnl +divert(`9001')format(`%1000000s', `')dnl +forloop(`i', `9001', `10000', + `divert(incr(i))undivert(i)')dnl +divert(`-1')undivert +@end example @end ignore Diversions make it possible to generate output in a different order than @@ -5117,6 +5370,14 @@ undivert(`0') undivert @result{}diverted text @result{} +divert(`1')more +divert(`2')undivert(`1')diverted text`'divert +@result{} +undivert(`1') +@result{} +undivert(`2') +@result{}more +@result{}diverted text @end example When a diversion has been undiverted, the diverted text is discarded, @@ -5520,6 +5781,33 @@ resulting @samp{b} is not further remapp translit(`«abc~', `~-»') @result{}abc @end example + +@comment Stress test short arguments, since they use a different code +@comment path. +@example +translit(`abcdeabcde', `a') +@result{}bcdebcde +translit(`abcdeabcde', `ab') +@result{}cdecde +translit(`abcdeabcde', `a', `f') +@result{}fbcdefbcde +translit(`abcdeabcde', `a', `f') +@result{}fbcdefbcde +translit(`abcdeabcde', `a', `fg') +@result{}fbcdefbcde +translit(`abcdeabcde', `ab', `f') +@result{}fcdefcde +translit(`abcdeabcde', `ab', `fg') +@result{}fgcdefgcde +translit(`abcdeabcde', `ab', `ba') +@result{}bacdebacde +translit(`abcdeabcde', `e', `f') +@result{}abcdfabcdf +translit(`abc', `', `cde') +@result{}abc +translit(`', `a', `bc') +@result{} +@end example @end ignore Omitting @var{chars} evokes a warning, but still produces output. @@ -6190,6 +6478,15 @@ Prior to executing the command, @code{m4 The default standard input, output and error of @var{shell-command} are the same as those of @code{m4}. +By default, the @var{shell-command} will be used as the argument to the +@option{-c} option of the @command{/bin/sh} shell (or the version of +@command{sh} specified by @samp{command -p getconf PATH}, if your system +supports that). If you prefer a different shell, the +@command{configure} script can be given the option +@option{--with-syscmd-shell=@var{location}} to set the location of an +alternative shell at @acronym{GNU} @code{m4} installation; the +alternative shell must still support @option{-c}. + The macro @code{syscmd} is recognized only with parameters. @end deffn @@ -6258,6 +6555,15 @@ the same as those of @code{m4}. The err is not a part of the expansion: it will appear along with the error output of @code{m4}. +By default, the @var{shell-command} will be used as the argument to the +@option{-c} option of the @command{/bin/sh} shell (or the version of +@command{sh} specified by @samp{command -p getconf PATH}, if your system +supports that). If you prefer a different shell, the +@command{configure} script can be given the option +@option{--with-syscmd-shell=@var{location}} to set the location of an +alternative shell at @acronym{GNU} @code{m4} installation; the +alternative shell must still support @option{-c}. + The macro @code{esyscmd} is recognized only with parameters. @end deffn @@ -6828,17 +7134,19 @@ ifdef(`__unix__', , ')m4exit(`77')')dnl changequote(`[', `]')dnl syscmd([echo 'changequote([,])pushdef([divnum],[hi])dnl' \ - | ]__program__[ -F in.m4f \ + | ']__program__[' -F in.m4f \ && echo 'divnum popdef([divnum])divnum' \ - | ]__program__[ -R in.m4f \ + | ']__program__[' -R in.m4f \ && rm in.m4f])status sysval @result{}hi 0 @result{}status 0 @end example @c Detect inability to freeze. +@c Some systems harden /, and fail with EACCES rather than ENOENT. @comment options: -F /none/such +@comment xerr: ignore @comment status: 1 @example $ @kbd{m4 -F /none/such} @@ -7333,6 +7641,7 @@ presented here. * Improved exch:: Solution for @code{exch} * Improved forloop:: Solution for @code{forloop} * Improved foreach:: Solution for @code{foreach} +* Improved copy:: Solution for @code{copy} * Improved m4wrap:: Solution for @code{m4wrap} * Improved cleardivert:: Solution for @code{cleardivert} * Improved capitalize:: Solution for @code{capitalize} @@ -7440,6 +7749,58 @@ forloop2(i, 1, 5, ``ifelse('')forloop2(i @error{}m4:stdin:12: recursion limit of 9 exceeded, use -L<N> to change it @end example +One more optimization is still possible. Instead of repeatedly +assigning a variable then invoking or dereferencing it, it is possible +to pass the current iterator value as a single argument. Coupled with +@code{curry} if other arguments are needed (@pxref{Composition}), or +with helper macros if the argument is needed in more than one place in +the expansion, the output can be generated with three, rather than four, +macros of overhead per iteration. Notice how the file +@file{m4-@value{VERSION}/@/examples/@/forloop3.m4} rearranges the +arguments of the helper @code{_forloop} to take two arguments that are +placed around the current value. By splitting a balanced set of +parantheses across multiple arguments, the helper macro can now be +shared by @code{forloop} and the new @code{forloop_arg}. + +@comment examples +@example +$ @kbd{m4 -I examples} +include(`forloop3.m4') +@result{} +undivert(`forloop3.m4')dnl +@result{}divert(`-1') +@result{}# forloop_arg(from, to, macro) - invoke MACRO(value) for +@result{}# each value between FROM and TO, without define overhead +@result{}define(`forloop_arg', `ifelse(eval(`($1) <= ($2)'), `1', +@result{} `_forloop(`$1', eval(`$2'), `$3(', `)')')') +@result{}# forloop(var, from, to, stmt) - refactored to share code +@result{}define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', +@result{} `pushdef(`$1')_forloop(eval(`$2'), eval(`$3'), +@result{} `define(`$1',', `)$4')popdef(`$1')')') +@result{}define(`_forloop', +@result{} `$3`$1'$4`'ifelse(`$1', `$2', `', +@result{} `$0(incr(`$1'), `$2', `$3', `$4')')') +@result{}divert`'dnl +forloop(`i', `1', `3', ` i') +@result{} 1 2 3 +define(`echo', `$@@') +@result{} +forloop_arg(`1', `3', ` echo') +@result{} 1 2 3 +include(`curry.m4') +@result{} +forloop_arg(`1', `3', `curry(`pushdef', `a')') +@result{} +a +@result{}3 +popdef(`a')a +@result{}2 +popdef(`a')a +@result{}1 +popdef(`a')a +@result{}a +@end example + Of course, it is possible to make even more improvements, such as adding an optional step argument, or allowing iteration through descending sequences. @acronym{GNU} Autoconf provides some of these @@ -7852,6 +8213,116 @@ include(`loop.m4')dnl @end ignore +@node Improved copy +@section Solution for @code{copy} + +The macro @code{copy} presented above +is unable to handle builtin tokens with M4 1.4.x, because it tries to +pass the builtin token through the macro @code{curry}, where it is +silently flattened to an empty string (@pxref{Composition}). Rather +than using the problematic @code{curry} to work around the limitation +that @code{stack_foreach} expects to invoke a macro that takes exactly +one argument, we can write a new macro that lets us form the exact +two-argument @code{pushdef} call sequence needed, so that we are no +longer passing a builtin token through a text macro. + +@deffn Composite stack_foreach_sep (@var{macro}, @var{pre}, @var{post}, @ + @var{sep}) +@deffnx Composite stack_foreach_sep_lifo (@var{macro}, @var{pre}, @ + @var{post}, @var{sep}) +For each of the @code{pushdef} definitions associated with @var{macro}, +expand the sequence @samp{@var{pre}`'definition`'@var{post}}. +Additionally, expand @var{sep} between definitions. +@code{stack_foreach_sep} visits the oldest definition first, while +@code{stack_foreach_sep_lifo} visits the current definition first. The +expansion may dereference @var{macro}, but should not modify it. There +are a few special macros, such as @code{defn}, which cannot be used as +the @var{macro} parameter. +@end deffn + +Note that @code{stack_foreach(`@var{macro}', `@var{action}')} is +equivalent to @code{stack_foreach_sep(`@var{macro}', `@var{action}(', +`)')}. By supplying explicit parentheses, split among the @var{pre} and +@var{post} arguments to @code{stack_foreach_sep}, it is now possible to +construct macro calls with more than one argument, without passing +builtin tokens through a macro call. It is likewise possible to +directly reference the stack definitions without a macro call, by +leaving @var{pre} and @var{post} empty. Thus, in addition to fixing +@code{copy} on builtin tokens, it also executes with fewer macro +invocations. + +The new macro also adds a separator that is only output after the first +iteration of the helper @code{_stack_reverse_sep}, implemented by +prepending the original @var{sep} to @var{pre} and omitting a @var{sep} +argument in subsequent iterations. Note that the empty string that +separates @var{sep} from @var{pre} is provided as part of the fourth +argument when originally calling @code{_stack_reverse_sep}, and not by +writing @code{$4`'$3} as the third argument in the recursive call; while +the other approach would give the same output, it does so at the expense +of increasing the argument size on each iteration of +@code{_stack_reverse_sep}, which results in quadratic instead of linear +execution time. The improved stack walking macros are available in +@file{m4-@value{VERSION}/@/examples/@/stack_sep.m4}: + +@comment examples +@example +$ @kbd{m4 -I examples} +include(`stack_sep.m4') +@result{} +define(`copy', `ifdef(`$2', `errprint(`$2 already defined +')m4exit(`1')', + `stack_foreach_sep(`$1', `pushdef(`$2',', `)')')')dnl +pushdef(`a', `1')pushdef(`a', defn(`divnum')) +@result{} +copy(`a', `b') +@result{} +b +@result{}0 +popdef(`b') +@result{} +b +@result{}1 +pushdef(`c', `1')pushdef(`c', `2') +@result{} +stack_foreach_sep_lifo(`c', `', `', `, ') +@result{}2, 1 +undivert(`stack_sep.m4')dnl +@result{}divert(`-1') +@result{}# stack_foreach_sep(macro, pre, post, sep) +@result{}# Invoke PRE`'defn`'POST with a single argument of each definition +@result{}# from the definition stack of MACRO, starting with the oldest, and +@result{}# separated by SEP between definitions. +@result{}define(`stack_foreach_sep', +@result{}`_stack_reverse_sep(`$1', `tmp-$1')'dnl +@result{}`_stack_reverse_sep(`tmp-$1', `$1', `$2`'defn(`$1')$3', `$4`'')') +@result{}# stack_foreach_sep_lifo(macro, pre, post, sep) +@result{}# Like stack_foreach_sep, but starting with the newest definition. +@result{}define(`stack_foreach_sep_lifo', +@result{}`_stack_reverse_sep(`$1', `tmp-$1', `$2`'defn(`$1')$3', `$4`'')'dnl +@result{}`_stack_reverse_sep(`tmp-$1', `$1')') +@result{}define(`_stack_reverse_sep', +@result{}`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0( +@result{} `$1', `$2', `$4$3')')') +@result{}divert`'dnl +@end example + +@ignore +@comment Not worth putting in the manual, but make sure that +@comment stack_foreach_sep has linear performance. + +@comment examples +@example +$ @kbd {m4 -I examples} +include(`forloop3.m4')include(`stack_sep.m4')dnl +forloop(`i', `1', `10000', `pushdef(`s', i)') +@result{} +define(`colon', `:')define(`dash', `-') +@result{} +len(stack_foreach_sep(`s', `dash', `', `colon')) +@result{}58893 +@end example +@end ignore + @node Improved m4wrap @section Solution for @code{m4wrap} @@ -8144,7 +8615,7 @@ permissive license is in effect when cop @cindex FDL, GNU Free Documentation License @cindex GNU Free Documentation License @cindex Free Documentation License (FDL), GNU -@include fdl.texi +@include fdl-1.3.texi @node Indices @appendix Indices of concepts and macros diff -ruNp m4-1.4.12/doc/stamp-vti m4-1.4.13/doc/stamp-vti --- m4-1.4.12/doc/stamp-vti 2008-10-10 21:21:16.000000000 -0600 +++ m4-1.4.13/doc/stamp-vti 2009-03-31 20:21:40.000000000 -0600 @@ -1,4 +1,4 @@ -@set UPDATED 25 September 2008 -@set UPDATED-MONTH September 2008 -@set EDITION 1.4.12 -@set VERSION 1.4.12 +@set UPDATED 5 March 2009 +@set UPDATED-MONTH March 2009 +@set EDITION 1.4.13 +@set VERSION 1.4.13 diff -ruNp m4-1.4.12/doc/version.texi m4-1.4.13/doc/version.texi --- m4-1.4.12/doc/version.texi 2008-10-10 21:21:16.000000000 -0600 +++ m4-1.4.13/doc/version.texi 2009-03-31 20:21:40.000000000 -0600 @@ -1,4 +1,4 @@ -@set UPDATED 25 September 2008 -@set UPDATED-MONTH September 2008 -@set EDITION 1.4.12 -@set VERSION 1.4.12 +@set UPDATED 5 March 2009 +@set UPDATED-MONTH March 2009 +@set EDITION 1.4.13 +@set VERSION 1.4.13 diff -ruNp m4-1.4.12/examples/Makefile.am m4-1.4.13/examples/Makefile.am --- m4-1.4.12/examples/Makefile.am 2008-08-11 20:48:22.000000000 -0600 +++ m4-1.4.13/examples/Makefile.am 2009-02-16 21:53:05.000000000 -0700 @@ -23,6 +23,7 @@ EXTRA_DIST =\ capitalize.m4 \ capitalize2.m4 \ comments.m4 \ +curry.m4 \ ddivert.m4 \ debug.m4 \ esyscmd.m4 \ @@ -37,6 +38,7 @@ foreachq3.m4 \ foreachq4.m4 \ forloop.m4 \ forloop2.m4 \ +forloop3.m4 \ fstab.m4 \ hanoi.m4 \ incl-test.m4 \ @@ -52,6 +54,8 @@ pushpop.m4 \ quote.m4 \ regexp.m4 \ reverse.m4 \ +stack.m4 \ +stack_sep.m4 \ sync-lines.m4 \ sysv-args.m4 \ trace.m4 \ diff -ruNp m4-1.4.12/examples/Makefile.in m4-1.4.13/examples/Makefile.in --- m4-1.4.12/examples/Makefile.in 2008-10-10 21:03:06.000000000 -0600 +++ m4-1.4.13/examples/Makefile.in 2009-03-31 20:11:41.000000000 -0600 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10b from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,8 +16,9 @@ @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -34,15 +36,17 @@ host_triplet = @host@ subdir = examples DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/autobuild.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/assert.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/cloexec.m4 \ $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/dirname.m4 \ $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \ $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl_h.m4 \ @@ -52,7 +56,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \ $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ $(top_srcdir)/m4/fseeko.m4 $(top_srcdir)/m4/ftello.m4 \ - $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/glibc21.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ @@ -62,48 +67,62 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/lock.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lseek.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memset.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ - $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/open.m4 \ - $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/posix_spawn.m4 \ + $(top_srcdir)/m4/printf-frexp.m4 \ $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ - $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/regex.m4 \ - $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \ - $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sched_h.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/snprintf.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-safer.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib-safer.m4 \ - $(top_srcdir)/m4/stdlib_h.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/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \ - $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ - $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/thread.m4 \ - $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/tls.m4 \ - $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/spawn_h.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-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strchrnul.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/strsignal.m4 \ + $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtod.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \ + $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \ + $(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/tmpdir.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unistd-safer.m4 \ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \ $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf-posix.m4 \ - $(top_srcdir)/m4/vasprintf.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/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yield.m4 \ + $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wait-process.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = @ +am__v_at_0 = @ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -111,6 +130,7 @@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -144,14 +164,19 @@ FCNTL_H = @FCNTL_H@ FLOAT_H = @FLOAT_H@ GETOPT_H = @GETOPT_H@ GLIBC21 = @GLIBC21@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ @@ -172,29 +197,44 @@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ GNULIB_ISINF = @GNULIB_ISINF@ GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -208,12 +248,34 @@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ +GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ +GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ +GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ +GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ +GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ +GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ +GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -244,6 +306,8 @@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ @@ -251,15 +315,22 @@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ @@ -270,6 +341,7 @@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ @@ -289,28 +361,48 @@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCHED_H = @HAVE_SCHED_H@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ @@ -319,6 +411,7 @@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_SPAWN_H = @HAVE_SPAWN_H@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ @@ -328,23 +421,34 @@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -364,6 +468,10 @@ LIBSIGSEGV = @LIBSIGSEGV@ LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIBTHREAD = @LIBTHREAD@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBCSTACK = @LTLIBCSTACK@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -381,7 +489,9 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_SCHED_H = @NEXT_SCHED_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_SPAWN_H = @NEXT_SPAWN_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ @@ -389,6 +499,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -398,17 +509,21 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -433,6 +548,13 @@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ @@ -440,6 +562,7 @@ REPLACE_NAN = @REPLACE_NAN@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -458,22 +581,29 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TRUNCL = @REPLACE_TRUNCL@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ +SCHED_H = @SCHED_H@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SPAWN_H = @SPAWN_H@ STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +SYS_WAIT_H = @SYS_WAIT_H@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ @@ -481,7 +611,6 @@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ -YIELD_LIB = @YIELD_LIB@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -536,6 +665,7 @@ EXTRA_DIST = \ capitalize.m4 \ capitalize2.m4 \ comments.m4 \ +curry.m4 \ ddivert.m4 \ debug.m4 \ esyscmd.m4 \ @@ -550,6 +680,7 @@ foreachq3.m4 \ foreachq4.m4 \ forloop.m4 \ forloop2.m4 \ +forloop3.m4 \ fstab.m4 \ hanoi.m4 \ incl-test.m4 \ @@ -565,6 +696,8 @@ pushpop.m4 \ quote.m4 \ regexp.m4 \ reverse.m4 \ +stack.m4 \ +stack_sep.m4 \ sync-lines.m4 \ sysv-args.m4 \ trace.m4 \ @@ -583,14 +716,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu examples/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --silent-rules examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu --silent-rules examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -608,6 +741,7 @@ $(top_srcdir)/configure: $(am__configur cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): tags: TAGS TAGS: @@ -631,13 +765,17 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -665,6 +803,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -683,6 +822,8 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: @@ -691,18 +832,28 @@ install-data-am: install-dvi: install-dvi-am +install-dvi-am: + install-exec-am: install-html: install-html-am +install-html-am: + install-info: install-info-am +install-info-am: + install-man: install-pdf: install-pdf-am +install-pdf-am: + install-ps: install-ps-am +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -735,6 +886,7 @@ uninstall-am: 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 -ruNp m4-1.4.12/examples/curry.m4 m4-1.4.13/examples/curry.m4 --- m4-1.4.12/examples/curry.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/examples/curry.m4 2009-02-16 21:53:05.000000000 -0700 @@ -0,0 +1,7 @@ +divert(`-1') +# curry(macro, args) +# Expand to a macro call that takes one argument, then invoke +# macro(args, extra). +define(`curry', `$1(shift($@,)_$0') +define(`_curry', ``$1')') +divert`'dnl diff -ruNp m4-1.4.12/examples/forloop3.m4 m4-1.4.13/examples/forloop3.m4 --- m4-1.4.12/examples/forloop3.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/examples/forloop3.m4 2008-12-18 21:07:51.000000000 -0700 @@ -0,0 +1,13 @@ +divert(`-1') +# forloop_arg(from, to, macro) - invoke MACRO(value) for +# each value between FROM and TO, without define overhead +define(`forloop_arg', `ifelse(eval(`($1) <= ($2)'), `1', + `_forloop(`$1', eval(`$2'), `$3(', `)')')') +# forloop(var, from, to, stmt) - refactored to share code +define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', + `pushdef(`$1')_forloop(eval(`$2'), eval(`$3'), + `define(`$1',', `)$4')popdef(`$1')')') +define(`_forloop', + `$3`$1'$4`'ifelse(`$1', `$2', `', + `$0(incr(`$1'), `$2', `$3', `$4')')') +divert`'dnl diff -ruNp m4-1.4.12/examples/stack.m4 m4-1.4.13/examples/stack.m4 --- m4-1.4.12/examples/stack.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/examples/stack.m4 2008-12-18 06:20:46.000000000 -0700 @@ -0,0 +1,16 @@ +divert(`-1') +# stack_foreach(macro, action) +# Invoke ACTION with a single argument of each definition +# from the definition stack of MACRO, starting with the oldest. +define(`stack_foreach', +`_stack_reverse(`$1', `tmp-$1')'dnl +`_stack_reverse(`tmp-$1', `$1', `$2(defn(`$1'))')') +# stack_foreach_lifo(macro, action) +# Invoke ACTION with a single argument of each definition +# from the definition stack of MACRO, starting with the newest. +define(`stack_foreach_lifo', +`_stack_reverse(`$1', `tmp-$1', `$2(defn(`$1'))')'dnl +`_stack_reverse(`tmp-$1', `$1')') +define(`_stack_reverse', +`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0($@)')') +divert`'dnl diff -ruNp m4-1.4.12/examples/stack_sep.m4 m4-1.4.13/examples/stack_sep.m4 --- m4-1.4.12/examples/stack_sep.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/examples/stack_sep.m4 2009-02-16 21:53:05.000000000 -0700 @@ -0,0 +1,17 @@ +divert(`-1') +# stack_foreach_sep(macro, pre, post, sep) +# Invoke PRE`'defn`'POST with a single argument of each definition +# from the definition stack of MACRO, starting with the oldest, and +# separated by SEP between definitions. +define(`stack_foreach_sep', +`_stack_reverse_sep(`$1', `tmp-$1')'dnl +`_stack_reverse_sep(`tmp-$1', `$1', `$2`'defn(`$1')$3', `$4`'')') +# stack_foreach_sep_lifo(macro, pre, post, sep) +# Like stack_foreach_sep, but starting with the newest definition. +define(`stack_foreach_sep_lifo', +`_stack_reverse_sep(`$1', `tmp-$1', `$2`'defn(`$1')$3', `$4`'')'dnl +`_stack_reverse_sep(`tmp-$1', `$1')') +define(`_stack_reverse_sep', +`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0( + `$1', `$2', `$4$3')')') +divert`'dnl diff -ruNp m4-1.4.12/lib/Makefile.am m4-1.4.13/lib/Makefile.am --- m4-1.4.12/lib/Makefile.am 2008-10-09 21:06:40.000000000 -0600 +++ m4-1.4.13/lib/Makefile.am 2009-03-21 18:08:07.000000000 -0600 @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2008 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname error fdl fflush filenamecat fopen fopen-safer fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 intprops mkstemp obstack progname regex sigaction stdbool stdint stdlib-safer strsignal strstr strtod strtol unlocked-io verror version-etc version-etc-fsf xalloc xprintf xvasprintf-posix +# Reproduce by: gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --avoid=lock-tests --avoid=tls-tests --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname error execute fdl-1.3 fflush filenamecat fopen fopen-safer fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 intprops memchr2 mkstemp obstack pipe progname regex sigaction stdbool stdint stdlib-safer strsignal strstr strtod strtol unlocked-io verror version-etc version-etc-fsf wait-process xalloc xprintf xvasprintf-posix AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects @@ -27,6 +27,7 @@ DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = +AM_CFLAGS = noinst_LIBRARIES += libm4.a @@ -82,6 +83,15 @@ libm4_a_SOURCES += binary-io.h ## end gnulib module binary-io +## begin gnulib module btowc + + +EXTRA_DIST += btowc.c + +EXTRA_libm4_a_SOURCES += btowc.c + +## end gnulib module btowc + ## begin gnulib module c-ctype libm4_a_SOURCES += c-ctype.h c-ctype.c @@ -237,6 +247,12 @@ EXTRA_libm4_a_SOURCES += error.c ## end gnulib module error +## begin gnulib module execute + +libm4_a_SOURCES += execute.h execute.c w32spawn.h + +## end gnulib module execute + ## begin gnulib module exitfail @@ -415,6 +431,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/ge ## end gnulib module gendocs +## begin gnulib module getdtablesize + + +EXTRA_DIST += getdtablesize.c + +EXTRA_libm4_a_SOURCES += getdtablesize.c + +## end gnulib module getdtablesize + ## begin gnulib module getopt BUILT_SOURCES += $(GETOPT_H) @@ -550,13 +575,27 @@ all-local: charset.alias ref-add.sed ref charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_tmp = $(DESTDIR)$(libdir)/charset.tmp install-exec-local: all-local - test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ if test -f $(charset_alias); then \ sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ else \ - if test $(GLIBC21) = no; then \ + if $$need_charset_alias; then \ sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ @@ -607,6 +646,15 @@ EXTRA_libm4_a_SOURCES += lseek.c ## end gnulib module lseek +## begin gnulib module lstat + + +EXTRA_DIST += lstat.c + +EXTRA_libm4_a_SOURCES += lstat.c + +## end gnulib module lstat + ## begin gnulib module malloc @@ -642,7 +690,7 @@ BUILT_SOURCES += math.h math.h: math.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_MATH_H''@|$(NEXT_MATH_H)|g' \ -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \ @@ -654,6 +702,9 @@ math.h: math.in.h -e 's|@''GNULIB_ISFINITE''@|$(GNULIB_ISFINITE)|g' \ -e 's|@''GNULIB_ISINF''@|$(GNULIB_ISINF)|g' \ -e 's|@''GNULIB_ISNAN''@|$(GNULIB_ISNAN)|g' \ + -e 's|@''GNULIB_ISNANF''@|$(GNULIB_ISNANF)|g' \ + -e 's|@''GNULIB_ISNAND''@|$(GNULIB_ISNAND)|g' \ + -e 's|@''GNULIB_ISNANL''@|$(GNULIB_ISNANL)|g' \ -e 's|@''GNULIB_LDEXPL''@|$(GNULIB_LDEXPL)|g' \ -e 's|@''GNULIB_MATHL''@|$(GNULIB_MATHL)|g' \ -e 's|@''GNULIB_ROUND''@|$(GNULIB_ROUND)|g' \ @@ -663,6 +714,9 @@ math.h: math.in.h -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \ -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \ -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \ + -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \ + -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \ + -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \ -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ @@ -704,32 +758,29 @@ EXTRA_DIST += math.in.h ## end gnulib module math -## begin gnulib module memchr - +## begin gnulib module mbrtowc -EXTRA_DIST += memchr.c -EXTRA_libm4_a_SOURCES += memchr.c +EXTRA_DIST += mbrtowc.c -## end gnulib module memchr +EXTRA_libm4_a_SOURCES += mbrtowc.c -## begin gnulib module memcmp +## end gnulib module mbrtowc +## begin gnulib module mbsinit -EXTRA_DIST += memcmp.c -EXTRA_libm4_a_SOURCES += memcmp.c +EXTRA_DIST += mbsinit.c -## end gnulib module memcmp +EXTRA_libm4_a_SOURCES += mbsinit.c -## begin gnulib module memset +## end gnulib module mbsinit +## begin gnulib module memchr2 -EXTRA_DIST += memset.c +libm4_a_SOURCES += memchr2.h memchr2.c -EXTRA_libm4_a_SOURCES += memset.c - -## end gnulib module memset +## end gnulib module memchr2 ## begin gnulib module mkdtemp @@ -780,6 +831,111 @@ EXTRA_DIST += pathmax.h ## end gnulib module pathmax +## begin gnulib module pipe + +libm4_a_SOURCES += pipe.h pipe.c w32spawn.h + +## end gnulib module pipe + +## begin gnulib module posix_spawn-internal + + +EXTRA_DIST += spawn_int.h spawni.c + +EXTRA_libm4_a_SOURCES += spawni.c + +## end gnulib module posix_spawn-internal + +## begin gnulib module posix_spawn_file_actions_addclose + + +EXTRA_DIST += spawn_faction_addclose.c spawn_int.h + +EXTRA_libm4_a_SOURCES += spawn_faction_addclose.c + +## end gnulib module posix_spawn_file_actions_addclose + +## begin gnulib module posix_spawn_file_actions_adddup2 + + +EXTRA_DIST += spawn_faction_adddup2.c spawn_int.h + +EXTRA_libm4_a_SOURCES += spawn_faction_adddup2.c + +## end gnulib module posix_spawn_file_actions_adddup2 + +## begin gnulib module posix_spawn_file_actions_addopen + + +EXTRA_DIST += spawn_faction_addopen.c spawn_int.h + +EXTRA_libm4_a_SOURCES += spawn_faction_addopen.c + +## end gnulib module posix_spawn_file_actions_addopen + +## begin gnulib module posix_spawn_file_actions_destroy + + +EXTRA_DIST += spawn_faction_destroy.c + +EXTRA_libm4_a_SOURCES += spawn_faction_destroy.c + +## end gnulib module posix_spawn_file_actions_destroy + +## begin gnulib module posix_spawn_file_actions_init + + +EXTRA_DIST += spawn_faction_init.c spawn_int.h + +EXTRA_libm4_a_SOURCES += spawn_faction_init.c + +## end gnulib module posix_spawn_file_actions_init + +## begin gnulib module posix_spawnattr_destroy + + +EXTRA_DIST += spawnattr_destroy.c + +EXTRA_libm4_a_SOURCES += spawnattr_destroy.c + +## end gnulib module posix_spawnattr_destroy + +## begin gnulib module posix_spawnattr_init + + +EXTRA_DIST += spawnattr_init.c + +EXTRA_libm4_a_SOURCES += spawnattr_init.c + +## end gnulib module posix_spawnattr_init + +## begin gnulib module posix_spawnattr_setflags + + +EXTRA_DIST += spawnattr_setflags.c + +EXTRA_libm4_a_SOURCES += spawnattr_setflags.c + +## end gnulib module posix_spawnattr_setflags + +## begin gnulib module posix_spawnattr_setsigmask + + +EXTRA_DIST += spawnattr_setsigmask.c + +EXTRA_libm4_a_SOURCES += spawnattr_setsigmask.c + +## end gnulib module posix_spawnattr_setsigmask + +## begin gnulib module posix_spawnp + + +EXTRA_DIST += spawnp.c + +EXTRA_libm4_a_SOURCES += spawnp.c + +## end gnulib module posix_spawnp + ## begin gnulib module printf-frexp libm4_a_SOURCES += printf-frexp.c @@ -813,14 +969,14 @@ EXTRA_libm4_a_SOURCES += quotearg.c ## end gnulib module quotearg -## begin gnulib module raise +## begin gnulib module rawmemchr -EXTRA_DIST += raise.c +EXTRA_DIST += rawmemchr.c rawmemchr.valgrind -EXTRA_libm4_a_SOURCES += raise.c +EXTRA_libm4_a_SOURCES += rawmemchr.c -## end gnulib module raise +## end gnulib module rawmemchr ## begin gnulib module regex @@ -831,6 +987,29 @@ EXTRA_libm4_a_SOURCES += regcomp.c regex ## end gnulib module regex +## begin gnulib module sched + +BUILT_SOURCES += $(SCHED_H) + +# We need the following in order to create a replacement for <sched.h> when +# the system doesn't have one. +sched.h: sched.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \ + -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \ + < $(srcdir)/sched.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += sched.h sched.h-t + +EXTRA_DIST += sched.in.h + +## end gnulib module sched + ## begin gnulib module sigaction @@ -860,6 +1039,7 @@ signal.h: signal.in.h -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ + -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/signal.in.h; \ } > $@-t @@ -903,6 +1083,52 @@ EXTRA_libm4_a_SOURCES += snprintf.c ## end gnulib module snprintf +## begin gnulib module spawn + +BUILT_SOURCES += $(SPAWN_H) + +# We need the following in order to create a replacement for <spawn.h> when +# the system doesn't have one. +spawn.h: spawn.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SPAWN_H''@|$(HAVE_SPAWN_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SPAWN_H''@|$(NEXT_SPAWN_H)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN''@|$(GNULIB_POSIX_SPAWN)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNP''@|$(GNULIB_POSIX_SPAWNP)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_INIT''@|$(GNULIB_POSIX_SPAWNATTR_INIT)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETFLAGS''@|$(GNULIB_POSIX_SPAWNATTR_GETFLAGS)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETFLAGS''@|$(GNULIB_POSIX_SPAWNATTR_SETFLAGS)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETPGROUP''@|$(GNULIB_POSIX_SPAWNATTR_GETPGROUP)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETPGROUP''@|$(GNULIB_POSIX_SPAWNATTR_SETPGROUP)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM''@|$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM''@|$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY''@|$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY''@|$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT''@|$(GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT''@|$(GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETSIGMASK''@|$(GNULIB_POSIX_SPAWNATTR_GETSIGMASK)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETSIGMASK''@|$(GNULIB_POSIX_SPAWNATTR_SETSIGMASK)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_DESTROY''@|$(GNULIB_POSIX_SPAWNATTR_DESTROY)|g' \ + -e 's|@''HAVE_POSIX_SPAWN''@|$(HAVE_POSIX_SPAWN)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/spawn.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += spawn.h spawn.h-t + +EXTRA_DIST += spawn.in.h + +## end gnulib module spawn + ## begin gnulib module stdarg BUILT_SOURCES += $(STDARG_H) @@ -961,6 +1187,7 @@ stdint.h: stdint.in.h -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ @@ -1007,6 +1234,8 @@ stdio.h: stdio.in.h -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ + -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ @@ -1017,6 +1246,7 @@ stdio.h: stdio.in.h -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \ -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \ -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \ + -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \ -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \ -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \ -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \ @@ -1038,6 +1268,10 @@ stdio.h: stdio.in.h -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ @@ -1049,6 +1283,7 @@ stdio.h: stdio.in.h -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ @@ -1077,26 +1312,39 @@ stdlib.h: stdlib.in.h sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ + -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ + -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ + -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ + -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ + -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ @@ -1120,6 +1368,22 @@ EXTRA_libm4_a_SOURCES += mkstemp-safer.c ## end gnulib module stdlib-safer +## begin gnulib module strchrnul + + +EXTRA_DIST += strchrnul.c strchrnul.valgrind + +EXTRA_libm4_a_SOURCES += strchrnul.c + +## end gnulib module strchrnul + +## begin gnulib module streq + + +EXTRA_DIST += streq.h + +## end gnulib module streq + ## begin gnulib module strerror @@ -1275,8 +1539,13 @@ sys/stat.h: sys_stat.in.h sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \ + -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \ + -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/sys_stat.in.h; \ } > $@-t mv $@-t $@ @@ -1312,6 +1581,30 @@ EXTRA_DIST += sys_time.in.h ## end gnulib module sys_time +## begin gnulib module sys_wait + +BUILT_SOURCES += $(SYS_WAIT_H) + +# We need the following in order to create <sys/wait.h> when the system +# has one that is incomplete. +sys/wait.h: sys_wait.in.h + @MKDIR_P@ sys + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/sys_wait.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += sys/wait.h sys/wait.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_wait.in.h + +## end gnulib module sys_wait + ## begin gnulib module tempname @@ -1358,24 +1651,34 @@ unistd.h: unistd.in.h -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ + -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ + -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ + -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ + -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ @@ -1435,6 +1738,12 @@ EXTRA_libm4_a_SOURCES += asprintf.c vasp ## end gnulib module vasprintf +## begin gnulib module verify + +libm4_a_SOURCES += verify.h + +## end gnulib module verify + ## begin gnulib module verror libm4_a_SOURCES += verror.h verror.c @@ -1453,6 +1762,12 @@ libm4_a_SOURCES += version-etc-fsf.c ## end gnulib module version-etc-fsf +## begin gnulib module wait-process + +libm4_a_SOURCES += wait-process.h wait-process.c + +## end gnulib module wait-process + ## begin gnulib module wchar BUILT_SOURCES += $(WCHAR_H) @@ -1465,10 +1780,40 @@ wchar.h: wchar.in.h sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ - -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \ + -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \ + -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \ + -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \ + -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \ + -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \ + -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \ + -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \ + -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \ + -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \ -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ - -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ + -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ + -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ + -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ + -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \ + -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ + -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ + -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ + -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ + -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ + -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \ + -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \ + -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \ + -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \ + -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \ + -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/wchar.in.h; \ @@ -1480,6 +1825,15 @@ EXTRA_DIST += wchar.in.h ## end gnulib module wchar +## begin gnulib module wcrtomb + + +EXTRA_DIST += wcrtomb.c + +EXTRA_libm4_a_SOURCES += wcrtomb.c + +## end gnulib module wcrtomb + ## begin gnulib module wctype BUILT_SOURCES += $(WCTYPE_H) diff -ruNp m4-1.4.12/lib/Makefile.in m4-1.4.13/lib/Makefile.in --- m4-1.4.12/lib/Makefile.in 2008-10-10 21:03:08.000000000 -0600 +++ m4-1.4.13/lib/Makefile.in 2009-03-31 20:11:42.000000000 -0600 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10b from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +15,7 @@ @SET_MAKE@ -# Copyright (C) 2002-2008 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -23,14 +24,15 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname error fdl fflush filenamecat fopen fopen-safer fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 intprops mkstemp obstack progname regex sigaction stdbool stdint stdlib-safer strsignal strstr strtod strtol unlocked-io verror version-etc version-etc-fsf xalloc xprintf xvasprintf-posix +# Reproduce by: gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --avoid=lock-tests --avoid=tls-tests --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname error execute fdl-1.3 fflush filenamecat fopen fopen-safer fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 intprops memchr2 mkstemp obstack pipe progname regex sigaction stdbool stdint stdlib-safer strsignal strstr strtod strtol unlocked-io verror version-etc version-etc-fsf wait-process xalloc xprintf xvasprintf-posix VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -49,15 +51,17 @@ subdir = lib DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.hin alloca.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/autobuild.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/assert.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/cloexec.m4 \ $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/dirname.m4 \ $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \ $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl_h.m4 \ @@ -67,7 +71,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \ $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ $(top_srcdir)/m4/fseeko.m4 $(top_srcdir)/m4/ftello.m4 \ - $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/glibc21.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ @@ -77,75 +82,100 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/lock.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lseek.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memset.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ - $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/open.m4 \ - $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/posix_spawn.m4 \ + $(top_srcdir)/m4/printf-frexp.m4 \ $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ - $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/regex.m4 \ - $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \ - $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sched_h.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/snprintf.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-safer.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib-safer.m4 \ - $(top_srcdir)/m4/stdlib_h.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/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \ - $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ - $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/thread.m4 \ - $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/tls.m4 \ - $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/spawn_h.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-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strchrnul.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/strsignal.m4 \ + $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtod.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \ + $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \ + $(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/tmpdir.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unistd-safer.m4 \ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \ $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf-posix.m4 \ - $(top_srcdir)/m4/vasprintf.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/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yield.m4 \ + $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wait-process.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru +AM_V_AR = $(am__v_AR_$(V)) +am__v_AR_ = @echo " AR " $@; +am__v_AR_0 = @echo " AR " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = @ +am__v_at_0 = @ libm4_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = am__dirstamp = $(am__leading_dot)dirstamp am_libm4_a_OBJECTS = gl_avltree_oset.$(OBJEXT) c-ctype.$(OBJEXT) \ - c-stack.$(OBJEXT) clean-temp.$(OBJEXT) fatal-signal.$(OBJEXT) \ - fpurge.$(OBJEXT) freadahead.$(OBJEXT) freading.$(OBJEXT) \ - gl_linkedhash_list.$(OBJEXT) gl_list.$(OBJEXT) \ - localcharset.$(OBJEXT) glthread/lock.$(OBJEXT) \ - malloca.$(OBJEXT) gl_oset.$(OBJEXT) printf-frexp.$(OBJEXT) \ + c-stack.$(OBJEXT) clean-temp.$(OBJEXT) execute.$(OBJEXT) \ + fatal-signal.$(OBJEXT) fpurge.$(OBJEXT) freadahead.$(OBJEXT) \ + freading.$(OBJEXT) gl_linkedhash_list.$(OBJEXT) \ + gl_list.$(OBJEXT) localcharset.$(OBJEXT) \ + glthread/lock.$(OBJEXT) malloca.$(OBJEXT) memchr2.$(OBJEXT) \ + gl_oset.$(OBJEXT) pipe.$(OBJEXT) printf-frexp.$(OBJEXT) \ printf-frexpl.$(OBJEXT) progname.$(OBJEXT) \ glthread/threadlib.$(OBJEXT) glthread/tls.$(OBJEXT) \ tmpdir.$(OBJEXT) verror.$(OBJEXT) version-etc.$(OBJEXT) \ - version-etc-fsf.$(OBJEXT) xalloc-die.$(OBJEXT) \ - xmalloca.$(OBJEXT) xprintf.$(OBJEXT) xstrndup.$(OBJEXT) \ - xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT) + version-etc-fsf.$(OBJEXT) wait-process.$(OBJEXT) \ + xalloc-die.$(OBJEXT) xmalloca.$(OBJEXT) xprintf.$(OBJEXT) \ + xstrndup.$(OBJEXT) xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT) libm4_a_OBJECTS = $(am_libm4_a_OBJECTS) LTLIBRARIES = $(noinst_LTLIBRARIES) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = @echo " CC " $@; +am__v_CC_0 = @echo " CC " $@; CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = @echo " CCLD " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libm4_a_SOURCES) $(EXTRA_libm4_a_SOURCES) DIST_SOURCES = $(libm4_a_SOURCES) $(EXTRA_libm4_a_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -158,14 +188,43 @@ RECURSIVE_TARGETS = all-recursive check- HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -199,14 +258,19 @@ FCNTL_H = @FCNTL_H@ FLOAT_H = @FLOAT_H@ GETOPT_H = @GETOPT_H@ GLIBC21 = @GLIBC21@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ @@ -227,29 +291,44 @@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ GNULIB_ISINF = @GNULIB_ISINF@ GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -263,12 +342,34 @@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ +GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ +GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ +GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ +GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ +GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ +GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ +GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -299,6 +400,8 @@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ @@ -306,15 +409,22 @@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ @@ -325,6 +435,7 @@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ @@ -344,28 +455,48 @@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCHED_H = @HAVE_SCHED_H@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ @@ -374,6 +505,7 @@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_SPAWN_H = @HAVE_SPAWN_H@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ @@ -383,23 +515,34 @@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -419,6 +562,10 @@ LIBSIGSEGV = @LIBSIGSEGV@ LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIBTHREAD = @LIBTHREAD@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBCSTACK = @LTLIBCSTACK@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -436,7 +583,9 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_SCHED_H = @NEXT_SCHED_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_SPAWN_H = @NEXT_SPAWN_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ @@ -444,6 +593,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -453,17 +603,21 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -488,6 +642,13 @@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ @@ -495,6 +656,7 @@ REPLACE_NAN = @REPLACE_NAN@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -513,22 +675,29 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TRUNCL = @REPLACE_TRUNCL@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ +SCHED_H = @SCHED_H@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SPAWN_H = @SPAWN_H@ STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +SYS_WAIT_H = @SYS_WAIT_H@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ @@ -536,7 +705,6 @@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ -YIELD_LIB = @YIELD_LIB@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -593,88 +761,105 @@ noinst_HEADERS = noinst_LIBRARIES = libm4.a noinst_LTLIBRARIES = EXTRA_DIST = alloca.c alloca.in.h $(top_srcdir)/build-aux/announce-gen \ - cloexec.c cloexec.h close-stream.c close-stream.h closein.c \ - closein.h closeout.c closeout.h basename.c dirname.c dirname.h \ - stripslash.c errno.in.h error.c error.h exitfail.c exitfail.h \ - fcntl.in.h fflush.c stdio-impl.h filenamecat.c filenamecat.h \ - float.in.h fopen.c fopen-safer.c stdio--.h stdio-safer.h \ - fpending.c fpending.h fpucw.h fpurge.h stdio-impl.h \ - freadahead.h stdio-impl.h freading.h stdio-impl.h frexp.c \ - frexp.c frexpl.c fseeko.c stdio-impl.h ftello.c \ - $(top_srcdir)/build-aux/gendocs.sh getopt.c getopt.in.h \ - getopt1.c getopt_int.h gettimeofday.c \ + btowc.c cloexec.c cloexec.h close-stream.c close-stream.h \ + closein.c closein.h closeout.c closeout.h basename.c dirname.c \ + dirname.h stripslash.c errno.in.h error.c error.h exitfail.c \ + exitfail.h fcntl.in.h fflush.c stdio-impl.h filenamecat.c \ + filenamecat.h float.in.h fopen.c fopen-safer.c stdio--.h \ + stdio-safer.h fpending.c fpending.h fpucw.h fpurge.h \ + stdio-impl.h freadahead.h stdio-impl.h freading.h stdio-impl.h \ + frexp.c frexp.c frexpl.c fseeko.c stdio-impl.h ftello.c \ + $(top_srcdir)/build-aux/gendocs.sh getdtablesize.c getopt.c \ + getopt.in.h getopt1.c getopt_int.h gettimeofday.c \ $(top_srcdir)/build-aux/git-version-gen \ $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \ $(top_srcdir)/build-aux/config.rpath intprops.h float+.h \ isnan.c isnand-nolibm.h isnand.c float+.h isnan.c \ isnanf-nolibm.h isnanf.c float+.h isnan.c isnanl-nolibm.h \ isnanl.c $(top_srcdir)/build-aux/link-warning.h config.charset \ - ref-add.sin ref-del.sin lseek.c malloc.c malloc.c malloca.h \ - malloca.valgrind math.in.h memchr.c memcmp.c memset.c \ + ref-add.sin ref-del.sin lseek.c lstat.c malloc.c malloc.c \ + malloca.h malloca.valgrind math.in.h mbrtowc.c mbsinit.c \ mkdtemp.c mkstemp.c obstack.c obstack.h open.c pathmax.h \ + spawn_int.h spawni.c spawn_faction_addclose.c spawn_int.h \ + spawn_faction_adddup2.c spawn_int.h spawn_faction_addopen.c \ + spawn_int.h spawn_faction_destroy.c spawn_faction_init.c \ + spawn_int.h spawnattr_destroy.c spawnattr_init.c \ + spawnattr_setflags.c spawnattr_setsigmask.c spawnp.c \ printf-frexp.h printf-frexp.c printf-frexpl.h quotearg.c \ - quotearg.h raise.c regcomp.c regex.c regex.h regex_internal.c \ - regex_internal.h regexec.c sig-handler.h sigaction.c \ - signal.in.h float+.h signbitd.c signbitf.c signbitl.c \ - sigprocmask.c snprintf.c stdarg.in.h stdbool.in.h stdint.in.h \ - stdio-write.c stdio.in.h stdlib.in.h mkstemp-safer.c \ - stdlib--.h stdlib-safer.h strerror.c string.in.h strndup.c \ - strnlen.c siglist.h strsignal.c str-two-way.h strstr.c \ - strtod.c strtol.c sys_stat.in.h sys_time.in.h tempname.c \ - tempname.h $(top_srcdir)/build-aux/config.rpath unistd.in.h \ - dup-safer.c fd-safer.c pipe-safer.c unistd--.h unistd-safer.h \ + quotearg.h rawmemchr.c rawmemchr.valgrind regcomp.c regex.c \ + regex.h regex_internal.c regex_internal.h regexec.c sched.in.h \ + sig-handler.h sigaction.c signal.in.h float+.h signbitd.c \ + signbitf.c signbitl.c sigprocmask.c snprintf.c spawn.in.h \ + stdarg.in.h stdbool.in.h stdint.in.h stdio-write.c stdio.in.h \ + stdlib.in.h mkstemp-safer.c stdlib--.h stdlib-safer.h \ + strchrnul.c strchrnul.valgrind streq.h strerror.c string.in.h \ + strndup.c strnlen.c siglist.h strsignal.c str-two-way.h \ + strstr.c strtod.c strtol.c sys_stat.in.h sys_time.in.h \ + sys_wait.in.h tempname.c tempname.h \ + $(top_srcdir)/build-aux/config.rpath unistd.in.h dup-safer.c \ + fd-safer.c pipe-safer.c unistd--.h unistd-safer.h \ unlocked-io.h asnprintf.c float+.h printf-args.c printf-args.h \ printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h \ - asprintf.c vasprintf.c wchar.in.h wctype.in.h xalloc.h \ - xmalloc.c xmalloca.h xalloc.h + asprintf.c vasprintf.c wchar.in.h wcrtomb.c wctype.in.h \ + xalloc.h xmalloc.c xmalloca.h xalloc.h BUILT_SOURCES = $(ALLOCA_H) configmake.h $(ERRNO_H) $(FCNTL_H) \ - $(FLOAT_H) $(GETOPT_H) math.h signal.h $(STDARG_H) \ - $(STDBOOL_H) $(STDINT_H) stdio.h stdlib.h string.h \ - $(SYS_STAT_H) $(SYS_TIME_H) unistd.h $(WCHAR_H) $(WCTYPE_H) + $(FLOAT_H) $(GETOPT_H) math.h $(SCHED_H) signal.h $(SPAWN_H) \ + $(STDARG_H) $(STDBOOL_H) $(STDINT_H) stdio.h stdlib.h string.h \ + $(SYS_STAT_H) $(SYS_TIME_H) $(SYS_WAIT_H) unistd.h $(WCHAR_H) \ + $(WCTYPE_H) SUFFIXES = .sed .sin MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t errno.h \ errno.h-t fcntl.h fcntl.h-t float.h float.h-t getopt.h \ - getopt.h-t math.h math.h-t signal.h signal.h-t stdarg.h \ - stdarg.h-t stdbool.h stdbool.h-t stdint.h stdint.h-t stdio.h \ - stdio.h-t stdlib.h stdlib.h-t string.h string.h-t sys/stat.h \ - sys/stat.h-t sys/time.h sys/time.h-t unistd.h unistd.h-t \ - wchar.h wchar.h-t wctype.h wctype.h-t -MOSTLYCLEANDIRS = sys + getopt.h-t math.h math.h-t sched.h sched.h-t signal.h \ + signal.h-t spawn.h spawn.h-t stdarg.h stdarg.h-t stdbool.h \ + stdbool.h-t stdint.h stdint.h-t stdio.h stdio.h-t stdlib.h \ + stdlib.h-t string.h string.h-t sys/stat.h sys/stat.h-t \ + sys/time.h sys/time.h-t sys/wait.h sys/wait.h-t unistd.h \ + unistd.h-t wchar.h wchar.h-t wctype.h wctype.h-t +MOSTLYCLEANDIRS = sys sys CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \ ref-del.sed DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = +AM_CFLAGS = libm4_a_SOURCES = gl_avltree_oset.h gl_avltree_oset.c \ gl_anytree_oset.h binary-io.h c-ctype.h c-ctype.c c-stack.h \ - c-stack.c clean-temp.h clean-temp.c fatal-signal.h \ - fatal-signal.c fpurge.c freadahead.c freading.c gettext.h \ - gl_linkedhash_list.h gl_linkedhash_list.c gl_anyhash_list1.h \ - gl_anyhash_list2.h gl_anylinked_list1.h gl_anylinked_list2.h \ - gl_list.h gl_list.c localcharset.h localcharset.c \ - glthread/lock.h glthread/lock.c malloca.c gl_oset.h gl_oset.c \ - printf-frexp.c printf-frexpl.c progname.h progname.c \ - size_max.h glthread/threadlib.c glthread/tls.h glthread/tls.c \ - tmpdir.h tmpdir.c verror.h verror.c version-etc.h \ - version-etc.c version-etc-fsf.c xalloc-die.c xmalloca.c \ - xprintf.h xprintf.c xsize.h xstrndup.h xstrndup.c xvasprintf.h \ - xvasprintf.c xasprintf.c + c-stack.c clean-temp.h clean-temp.c execute.h execute.c \ + w32spawn.h fatal-signal.h fatal-signal.c fpurge.c freadahead.c \ + freading.c gettext.h gl_linkedhash_list.h gl_linkedhash_list.c \ + gl_anyhash_list1.h gl_anyhash_list2.h gl_anylinked_list1.h \ + gl_anylinked_list2.h gl_list.h gl_list.c localcharset.h \ + localcharset.c glthread/lock.h glthread/lock.c malloca.c \ + memchr2.h memchr2.c gl_oset.h gl_oset.c pipe.h pipe.c \ + w32spawn.h printf-frexp.c printf-frexpl.c progname.h \ + progname.c size_max.h glthread/threadlib.c glthread/tls.h \ + glthread/tls.c tmpdir.h tmpdir.c verify.h verror.h verror.c \ + version-etc.h version-etc.c version-etc-fsf.c wait-process.h \ + wait-process.c xalloc-die.c xmalloca.c xprintf.h xprintf.c \ + xsize.h xstrndup.h xstrndup.c xvasprintf.h xvasprintf.c \ + xasprintf.c libm4_a_LIBADD = $(M4_LIBOBJS) @ALLOCA@ libm4_a_DEPENDENCIES = $(M4_LIBOBJS) @ALLOCA@ -EXTRA_libm4_a_SOURCES = alloca.c cloexec.c close-stream.c closein.c \ - closeout.c basename.c dirname.c stripslash.c error.c \ +EXTRA_libm4_a_SOURCES = alloca.c btowc.c cloexec.c close-stream.c \ + closein.c closeout.c basename.c dirname.c stripslash.c error.c \ exitfail.c fflush.c filenamecat.c fopen.c fopen-safer.c \ - fpending.c frexp.c frexp.c frexpl.c fseeko.c ftello.c getopt.c \ - getopt1.c gettimeofday.c isnan.c isnand.c isnan.c isnanf.c \ - isnan.c isnanl.c lseek.c malloc.c malloc.c memchr.c memcmp.c \ - memset.c mkdtemp.c mkstemp.c obstack.c open.c printf-frexp.c \ - quotearg.c raise.c regcomp.c regex.c regex_internal.c \ - regexec.c sigaction.c signbitd.c signbitf.c signbitl.c \ - sigprocmask.c snprintf.c stdio-write.c mkstemp-safer.c \ + fpending.c frexp.c frexp.c frexpl.c fseeko.c ftello.c \ + getdtablesize.c getopt.c getopt1.c gettimeofday.c isnan.c \ + isnand.c isnan.c isnanf.c isnan.c isnanl.c lseek.c lstat.c \ + malloc.c malloc.c mbrtowc.c mbsinit.c mkdtemp.c mkstemp.c \ + obstack.c open.c spawni.c spawn_faction_addclose.c \ + spawn_faction_adddup2.c spawn_faction_addopen.c \ + spawn_faction_destroy.c spawn_faction_init.c \ + spawnattr_destroy.c spawnattr_init.c spawnattr_setflags.c \ + spawnattr_setsigmask.c spawnp.c printf-frexp.c quotearg.c \ + rawmemchr.c regcomp.c regex.c regex_internal.c regexec.c \ + sigaction.c signbitd.c signbitf.c signbitl.c sigprocmask.c \ + snprintf.c stdio-write.c mkstemp-safer.c strchrnul.c \ strerror.c strndup.c strnlen.c strsignal.c strstr.c strtod.c \ strtol.c tempname.c dup-safer.c fd-safer.c pipe-safer.c \ asnprintf.c printf-args.c printf-parse.c vasnprintf.c \ - asprintf.c vasprintf.c xmalloc.c + asprintf.c vasprintf.c wcrtomb.c xmalloc.c LINK_WARNING_H = $(top_srcdir)/build-aux/link-warning.h charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_tmp = $(DESTDIR)$(libdir)/charset.tmp @@ -687,14 +872,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits lib/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits --silent-rules lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits --silent-rules lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -712,6 +897,7 @@ $(top_srcdir)/configure: $(am__configur cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ @@ -723,7 +909,7 @@ stamp-h1: $(srcdir)/config.hin $(top_bui @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status lib/config.h $(srcdir)/config.hin: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) + $(am__cd) $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ @@ -745,9 +931,9 @@ glthread/threadlib.$(OBJEXT): glthread/$ glthread/tls.$(OBJEXT): glthread/$(am__dirstamp) \ glthread/$(DEPDIR)/$(am__dirstamp) libm4.a: $(libm4_a_OBJECTS) $(libm4_a_DEPENDENCIES) - -rm -f libm4.a - $(libm4_a_AR) libm4.a $(libm4_a_OBJECTS) $(libm4_a_LIBADD) - $(RANLIB) libm4.a + $(AM_V_at)-rm -f libm4.a + $(AM_V_AR)$(libm4_a_AR) libm4.a $(libm4_a_OBJECTS) $(libm4_a_LIBADD) + $(AM_V_at)$(RANLIB) libm4.a clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @@ -772,6 +958,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-stack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clean-temp.Po@am__quote@ @@ -782,6 +969,7 @@ distclean-compile: @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)/error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execute.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fatal-signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-safer.Po@am__quote@ @@ -797,6 +985,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexpl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseeko.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftello.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdtablesize.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)/gettimeofday.Po@am__quote@ @@ -810,24 +999,26 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnanl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcmp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdtemp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp-safer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obstack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-frexp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-frexpl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotearg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raise.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawmemchr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_internal.Po@am__quote@ @@ -838,7 +1029,19 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_addclose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_adddup2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_addopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_destroy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_destroy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_setflags.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_setsigmask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawni.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio-write.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strchrnul.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)/strndup.Po@am__quote@ @@ -854,6 +1057,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc-fsf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait-process.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcrtomb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xasprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @@ -866,17 +1071,19 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/tls.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @@ -905,7 +1112,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -939,16 +1146,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -956,14 +1163,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -975,7 +1182,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \ @@ -984,29 +1191,34 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -1027,27 +1239,41 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ @@ -1084,6 +1310,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f glthread/$(DEPDIR)/$(am__dirstamp) -rm -f glthread/$(am__dirstamp) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) @@ -1110,6 +1337,8 @@ dvi-am: html: html-recursive +html-am: + info: info-recursive info-am: @@ -1118,18 +1347,28 @@ install-data-am: install-dvi: install-dvi-recursive +install-dvi-am: + install-exec-am: install-exec-local install-html: install-html-recursive +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: install-pdf: install-pdf-recursive +install-pdf-am: + install-ps: install-ps-recursive +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -1152,8 +1391,9 @@ ps-am: uninstall-am: uninstall-local -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + ctags-recursive install install-am install-strip \ + tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-generic \ @@ -1295,13 +1535,27 @@ clean-GNUmakefile: all-local: charset.alias ref-add.sed ref-del.sed install-exec-local: all-local - test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ if test -f $(charset_alias); then \ sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ else \ - if test $(GLIBC21) = no; then \ + if $$need_charset_alias; then \ sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ @@ -1334,7 +1588,7 @@ charset.alias: config.charset math.h: math.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_MATH_H''@|$(NEXT_MATH_H)|g' \ -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \ @@ -1346,6 +1600,9 @@ math.h: math.in.h -e 's|@''GNULIB_ISFINITE''@|$(GNULIB_ISFINITE)|g' \ -e 's|@''GNULIB_ISINF''@|$(GNULIB_ISINF)|g' \ -e 's|@''GNULIB_ISNAN''@|$(GNULIB_ISNAN)|g' \ + -e 's|@''GNULIB_ISNANF''@|$(GNULIB_ISNANF)|g' \ + -e 's|@''GNULIB_ISNAND''@|$(GNULIB_ISNAND)|g' \ + -e 's|@''GNULIB_ISNANL''@|$(GNULIB_ISNANL)|g' \ -e 's|@''GNULIB_LDEXPL''@|$(GNULIB_LDEXPL)|g' \ -e 's|@''GNULIB_MATHL''@|$(GNULIB_MATHL)|g' \ -e 's|@''GNULIB_ROUND''@|$(GNULIB_ROUND)|g' \ @@ -1355,6 +1612,9 @@ math.h: math.in.h -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \ -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \ -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \ + -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \ + -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \ + -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \ -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ @@ -1391,6 +1651,20 @@ math.h: math.in.h } > $@-t mv $@-t $@ +# We need the following in order to create a replacement for <sched.h> when +# the system doesn't have one. +sched.h: sched.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \ + -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \ + < $(srcdir)/sched.in.h; \ + } > $@-t + mv $@-t $@ + # We need the following in order to create <signal.h> when the system # doesn't have a complete one. signal.h: signal.in.h @@ -1407,11 +1681,49 @@ signal.h: signal.in.h -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ + -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/signal.in.h; \ } > $@-t mv $@-t $@ +# We need the following in order to create a replacement for <spawn.h> when +# the system doesn't have one. +spawn.h: spawn.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SPAWN_H''@|$(HAVE_SPAWN_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SPAWN_H''@|$(NEXT_SPAWN_H)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN''@|$(GNULIB_POSIX_SPAWN)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNP''@|$(GNULIB_POSIX_SPAWNP)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)|g' \ + -e 's|@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@|$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_INIT''@|$(GNULIB_POSIX_SPAWNATTR_INIT)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETFLAGS''@|$(GNULIB_POSIX_SPAWNATTR_GETFLAGS)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETFLAGS''@|$(GNULIB_POSIX_SPAWNATTR_SETFLAGS)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETPGROUP''@|$(GNULIB_POSIX_SPAWNATTR_GETPGROUP)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETPGROUP''@|$(GNULIB_POSIX_SPAWNATTR_SETPGROUP)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM''@|$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM''@|$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY''@|$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY''@|$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT''@|$(GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT''@|$(GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_GETSIGMASK''@|$(GNULIB_POSIX_SPAWNATTR_GETSIGMASK)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_SETSIGMASK''@|$(GNULIB_POSIX_SPAWNATTR_SETSIGMASK)|g' \ + -e 's|@''GNULIB_POSIX_SPAWNATTR_DESTROY''@|$(GNULIB_POSIX_SPAWNATTR_DESTROY)|g' \ + -e 's|@''HAVE_POSIX_SPAWN''@|$(HAVE_POSIX_SPAWN)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/spawn.in.h; \ + } > $@-t + mv $@-t $@ + # We need the following in order to create <stdarg.h> when the system # doesn't have one that works with the given compiler. stdarg.h: stdarg.in.h @@ -1448,6 +1760,7 @@ stdint.h: stdint.in.h -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ @@ -1485,6 +1798,8 @@ stdio.h: stdio.in.h -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ + -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ @@ -1495,6 +1810,7 @@ stdio.h: stdio.in.h -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \ -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \ -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \ + -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \ -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \ -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \ -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \ @@ -1516,6 +1832,10 @@ stdio.h: stdio.in.h -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ @@ -1527,6 +1847,7 @@ stdio.h: stdio.in.h -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ @@ -1544,26 +1865,39 @@ stdlib.h: stdlib.in.h sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ + -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ + -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ + -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ + -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ + -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ @@ -1651,8 +1985,13 @@ sys/stat.h: sys_stat.in.h sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \ + -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \ + -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/sys_stat.in.h; \ } > $@-t mv $@-t $@ @@ -1673,6 +2012,20 @@ sys/time.h: sys_time.in.h } > $@-t mv $@-t $@ +# We need the following in order to create <sys/wait.h> when the system +# has one that is incomplete. +sys/wait.h: sys_wait.in.h + @MKDIR_P@ sys + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/sys_wait.in.h; \ + } > $@-t + mv $@-t $@ + # We need the following in order to create an empty placeholder for # <unistd.h> when the system doesn't have one. unistd.h: unistd.in.h @@ -1686,24 +2039,34 @@ unistd.h: unistd.in.h -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ + -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ + -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ + -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ + -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ @@ -1732,10 +2095,40 @@ wchar.h: wchar.in.h sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ - -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \ + -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \ + -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \ + -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \ + -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \ + -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \ + -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \ + -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \ + -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \ + -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \ -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ - -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ + -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ + -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ + -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ + -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \ + -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ + -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ + -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ + -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ + -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ + -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \ + -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \ + -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \ + -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \ + -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \ + -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/wchar.in.h; \ @@ -1765,6 +2158,7 @@ mostlyclean-local: mostlyclean-generic fi; \ done; \ : + # 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 -ruNp m4-1.4.12/lib/binary-io.h m4-1.4.13/lib/binary-io.h --- m4-1.4.12/lib/binary-io.h 2008-08-05 07:16:38.000000000 -0600 +++ m4-1.4.13/lib/binary-io.h 2008-12-11 22:14:20.000000000 -0700 @@ -30,8 +30,8 @@ # 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. */ +#if defined __BEOS__ || defined __HAIKU__ + /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif diff -ruNp m4-1.4.12/lib/btowc.c m4-1.4.13/lib/btowc.c --- m4-1.4.12/lib/btowc.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/btowc.c 2008-12-24 06:20:30.000000000 -0700 @@ -0,0 +1,38 @@ +/* Convert unibyte character to wide character. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include <stdio.h> + +wint_t +btowc (int c) +{ + if (c != EOF) + { + char buf[1]; + wchar_t wc; + + buf[0] = c; + if (mbtowc (&wc, buf, 1) >= 0) + return wc; + } + return WEOF; +} diff -ruNp m4-1.4.12/lib/c-stack.c m4-1.4.13/lib/c-stack.c --- m4-1.4.12/lib/c-stack.c 2008-09-24 06:25:08.000000000 -0600 +++ m4-1.4.13/lib/c-stack.c 2009-01-24 12:01:51.000000000 -0700 @@ -1,6 +1,7 @@ /* Stack overflow handling. - Copyright (C) 2002, 2004, 2006, 2008 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2006, 2008, 2009 Free Software + Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -67,9 +68,6 @@ typedef struct sigaltstack stack_t; #endif #include <unistd.h> -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif #if HAVE_LIBSIGSEGV # include <sigsegv.h> @@ -82,6 +80,9 @@ typedef struct sigaltstack stack_t; # define SIGACTION_WORKS 1 #else # define SIGACTION_WORKS 0 +# ifndef SA_ONSTACK +# define SA_ONSTACK 0 +# endif #endif extern char *program_name; @@ -238,21 +239,21 @@ segv_handler (int signo, siginfo_t *info void *context __attribute__ ((unused))) { /* Clear SIGNO if it seems to have been a stack overflow. */ - if (0 < info->si_code) - { # if ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC - /* We can't easily determine whether it is a stack overflow; so - assume that the rest of our program is perfect (!) and that - this segmentation violation is a stack overflow. - - Note that although both Linux and Solaris provide - sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only - Solaris satisfies the XSI heueristic. This is because - Solaris populates uc_stack with the details of the - interrupted stack, while Linux populates it with the details - of the current stack. */ - signo = 0; + /* We can't easily determine whether it is a stack overflow; so + assume that the rest of our program is perfect (!) and that + this segmentation violation is a stack overflow. + + Note that although both Linux and Solaris provide + sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only + Solaris satisfies the XSI heueristic. This is because + Solaris populates uc_stack with the details of the + interrupted stack, while Linux populates it with the details + of the current stack. */ + signo = 0; # else + if (0 < info->si_code) + { /* If the faulting address is within the stack, or within one page of the stack end, assume that it is a stack overflow. */ @@ -277,8 +278,8 @@ segv_handler (int signo, siginfo_t *info write (STDERR_FILENO, buf, strlen (buf)); } # endif -# endif } +# endif die (signo); } @@ -317,10 +318,14 @@ c_stack_action (void (*action) (int)) act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; act.sa_sigaction = segv_handler; # else - act.sa_flags = SA_NODEFER | SA_RESETHAND; + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; act.sa_handler = die; # endif +# if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, NULL) < 0) + return -1; +# endif return sigaction (SIGSEGV, &act, NULL); } diff -ruNp m4-1.4.12/lib/c-stack.h m4-1.4.13/lib/c-stack.h --- m4-1.4.12/lib/c-stack.h 2008-08-06 23:29:09.000000000 -0600 +++ m4-1.4.13/lib/c-stack.h 2008-12-11 22:14:21.000000000 -0700 @@ -36,6 +36,9 @@ ACTION must be async-signal-safe. ACTION together with its callees must not require more than SIGSTKSZ bytes of stack space. Also, ACTION should not call longjmp, because this implementation does - not guarantee that it is safe to return to the original stack. */ + not guarantee that it is safe to return to the original stack. + + This function may install a handler for the SIGSEGV signal or for the SIGBUS + signal or exercise other system dependent exception handling APIs. */ extern int c_stack_action (void (* /*action*/) (int)); diff -ruNp m4-1.4.12/lib/config.charset m4-1.4.13/lib/config.charset --- m4-1.4.12/lib/config.charset 2008-02-23 10:29:38.000000000 -0700 +++ m4-1.4.13/lib/config.charset 2009-01-25 19:37:37.000000000 -0700 @@ -1,7 +1,7 @@ #! /bin/sh # Output a system dependent table of character encoding aliases. # -# Copyright (C) 2000-2004, 2006-2007 Free Software Foundation, Inc. +# Copyright (C) 2000-2004, 2006-2009 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -63,12 +63,13 @@ # CP922 aix # CP932 aix woe32 dos # CP943 aix -# CP949 osf woe32 dos +# CP949 osf darwin woe32 dos # CP950 woe32 dos # CP1046 aix # CP1124 aix # CP1125 dos # CP1129 aix +# CP1131 darwin # CP1250 woe32 # CP1251 glibc solaris netbsd openbsd darwin woe32 # CP1252 aix woe32 @@ -82,15 +83,17 @@ # EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin # EUC-TW glibc aix hpux irix osf solaris netbsd # BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin -# BIG5-HKSCS glibc solaris -# GBK glibc aix osf solaris woe32 dos -# GB18030 glibc solaris netbsd +# BIG5-HKSCS glibc solaris darwin +# GBK glibc aix osf solaris darwin woe32 dos +# GB18030 glibc solaris netbsd darwin # SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin # JOHAB glibc solaris woe32 # TIS-620 glibc aix hpux osf solaris # VISCII Y glibc # TCVN5712-1 glibc +# ARMSCII-8 glibc darwin # GEORGIAN-PS glibc +# PT154 glibc # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux @@ -449,7 +452,8 @@ case "$os" in echo "ko_KR.EUC EUC-KR" ;; darwin*) - # Darwin 7.5 has nl_langinfo(CODESET), but it is useless: + # Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is + # useless: # - It returns the empty string when LANG is set to a locale of the # form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8 # LC_CTYPE file. @@ -476,10 +480,40 @@ case "$os" in # minimize the use of decomposed Unicode. Unfortunately, through the # Darwin file system, decomposed UTF-8 strings are leaked into user # space nevertheless. + # Then there are also the locales with encodings other than US-ASCII + # and UTF-8. These locales can be occasionally useful to users (e.g. + # when grepping through ISO-8859-1 encoded text files), when all their + # file names are in US-ASCII. + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-13 ISO-8859-13" + echo "ISO8859-15 ISO-8859-15" + echo "KOI8-R KOI8-R" + echo "KOI8-U KOI8-U" + echo "CP866 CP866" + echo "CP949 CP949" + echo "CP1131 CP1131" + echo "CP1251 CP1251" + echo "eucCN GB2312" + echo "GB2312 GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "Big5 BIG5" + echo "Big5HKSCS BIG5-HKSCS" + echo "GBK GBK" + echo "GB18030 GB18030" + echo "SJIS SHIFT_JIS" + echo "ARMSCII-8 ARMSCII-8" + echo "PT154 PT154" + #echo "ISCII-DEV ?" echo "* UTF-8" ;; - beos*) - # BeOS has a single locale, and it has UTF-8 encoding. + beos* | haiku*) + # BeOS and Haiku have a single locale, and it has UTF-8 encoding. echo "* UTF-8" ;; msdosdjgpp*) diff -ruNp m4-1.4.12/lib/config.hin m4-1.4.13/lib/config.hin --- m4-1.4.12/lib/config.hin 2008-10-10 21:02:42.000000000 -0600 +++ m4-1.4.13/lib/config.hin 2009-03-31 19:47:21.000000000 -0600 @@ -1,5 +1,9 @@ /* lib/config.hin. Generated from configure.ac by autoheader. */ +/* Define if the compiler is building for multiple architectures of Apple + platforms at once. */ +#undef AA_APPLE_UNIVERSAL_BUILD + /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD @@ -49,6 +53,9 @@ /* Define to 1 if the changeword(REGEXP) functionality is wanted */ #undef ENABLE_CHANGEWORD +/* Define to 1 if an invalid memory address access may yield a SIGBUS. */ +#undef FAULT_YIELDS_SIGBUS + /* 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. */ @@ -78,8 +85,8 @@ /* Define to 1 if fopen() fails to recognize a trailing slash. */ #undef FOPEN_TRAILING_SLASH_BUG -/* Define to 1 if the return value of system() disagrees with pclose(). */ -#undef FUNC_SYSTEM_BROKEN +/* Define to 1 if ungetc is broken when used on arbitrary bytes. */ +#undef FUNC_UNGETC_BROKEN /* Define if gettimeofday clobbers the localtime buffer. */ #undef GETTIMEOFDAY_CLOBBERS_LOCALTIME @@ -104,8 +111,11 @@ */ #undef HAVE_ALLOCA_H -/* Define to 1 if you have the <bp-sym.h> header file. */ -#undef HAVE_BP_SYM_H +/* Define to 1 if you have the `btowc' function. */ +#undef HAVE_BTOWC + +/* Define to 1 if you have the `confstr' function. */ +#undef HAVE_CONFSTR /* Define if the copysignf function is declared in <math.h> and available in libc. */ @@ -207,10 +217,6 @@ don't. */ #undef HAVE_DECL_SNPRINTF -/* 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 @@ -235,6 +241,10 @@ don't. */ #undef HAVE_DECL_SYS_SIGLIST +/* Define to 1 if you have the declaration of `wctob', and to 0 if you don't. + */ +#undef HAVE_DECL_WCTOB + /* Define to 1 if you have the declaration of `_snprintf', and to 0 if you don't. */ #undef HAVE_DECL__SNPRINTF @@ -247,6 +257,9 @@ don't. */ #undef HAVE_DECL___FPENDING +/* Define if you have the declaration of environ. */ +#undef HAVE_ENVIRON_DECL + /* Define to 1 if you have the <errno.h> header file. */ #undef HAVE_ERRNO_H @@ -268,6 +281,9 @@ /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO +/* Define to 1 if you have the `getdtablesize' function. */ +#undef HAVE_GETDTABLESIZE + /* Define to 1 if you have the <getopt.h> header file. */ #undef HAVE_GETOPT_H @@ -353,18 +369,12 @@ /* Define to 1 if <wchar.h> declares mbstate_t. */ #undef HAVE_MBSTATE_T -/* Define to 1 if you have the `memchr' function. */ -#undef HAVE_MEMCHR - /* Define to 1 if you have the <memory.h> 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 `memset' function. */ -#undef HAVE_MEMSET - /* Define to 1 if you have the `mkdtemp' function. */ #undef HAVE_MKDTEMP @@ -374,11 +384,17 @@ /* Define to 1 if libc includes obstacks. */ #undef HAVE_OBSTACK +/* Define to 1 if you have the `pathconf' function. */ +#undef HAVE_PATHCONF + +/* Define to 1 if you have the <paths.h> header file. */ +#undef HAVE_PATHS_H + /* Define to 1 if you have the `pipe' function. */ #undef HAVE_PIPE -/* Define to 1 if you have the `pthread_atfork' function. */ -#undef HAVE_PTHREAD_ATFORK +/* Define to 1 if you have the `posix_spawn' function. */ +#undef HAVE_POSIX_SPAWN /* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */ #undef HAVE_PTHREAD_MUTEX_RECURSIVE @@ -386,8 +402,32 @@ /* Define if the POSIX multithreading library has read/write locks. */ #undef HAVE_PTHREAD_RWLOCK -/* Define to 1 if you have the `raise' function. */ -#undef HAVE_RAISE +/* Define to 1 if you have the <random.h> header file. */ +#undef HAVE_RANDOM_H + +/* Define to 1 if you have the `rawmemchr' function. */ +#undef HAVE_RAWMEMCHR + +/* Define to 1 if you have the <sched.h> header file. */ +#undef HAVE_SCHED_H + +/* Define to 1 if you have the `sched_setparam' function. */ +#undef HAVE_SCHED_SETPARAM + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#undef HAVE_SCHED_SETSCHEDULER + +/* Define to 1 if you have the <search.h> header file. */ +#undef HAVE_SEARCH_H + +/* Define to 1 if you have the `setegid' function. */ +#undef HAVE_SETEGID + +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the `seteuid' function. */ +#undef HAVE_SETEUID /* Define to 1 if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT @@ -425,6 +465,9 @@ /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF +/* Define to 1 if you have the <spawn.h> header file. */ +#undef HAVE_SPAWN_H + /* Define to 1 if extending the stack slightly past the limit causes a SIGSEGV which can be handled on an alternate stack established with sigaltstack. */ #undef HAVE_STACK_OVERFLOW_HANDLING @@ -454,8 +497,8 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP +/* Define to 1 if you have the `strchrnul' function. */ +#undef HAVE_STRCHRNUL /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R @@ -469,13 +512,19 @@ /* Define if you have the strndup() function and it works. */ #undef HAVE_STRNDUP +/* Define to 1 if you have the `strnlen' function. */ +#undef HAVE_STRNLEN + /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL -/* Define to 1 if `sa_sigaction' is member of `struct sigaction'. */ +/* Define to 1 if the system has the type `struct random_data'. */ +#undef HAVE_STRUCT_RANDOM_DATA + +/* Define to 1 if `struct sigaction' is a member of `sa_sigaction'. */ #undef HAVE_STRUCT_SIGACTION_SA_SIGACTION /* Define to 1 if you have the <sys/bitypes.h> header file. */ @@ -502,12 +551,21 @@ /* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the <sys/wait.h> header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the `tsearch' function. */ +#undef HAVE_TSEARCH + /* Define to 1 if you have the <ucontext.h> header file. */ #undef HAVE_UCONTEXT_H /* Define to 1 if you have the <unistd.h> 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 @@ -517,6 +575,12 @@ /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + +/* Define to 1 if you have the `waitid' function. */ +#undef HAVE_WAITID + /* Define to 1 if you have the <wchar.h> header file. */ #undef HAVE_WCHAR_H @@ -532,6 +596,12 @@ /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN +/* Define to 1 if you have the `wcsnlen' function. */ +#undef HAVE_WCSNLEN + +/* Define to 1 if you have the `wctob' function. */ +#undef HAVE_WCTOB + /* Define to 1 if you have the <wctype.h> header file. */ #undef HAVE_WCTYPE_H @@ -596,9 +666,22 @@ /* Define to 1 if lseek does not detect pipes. */ #undef LSEEK_PIPE_BROKEN +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + /* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ #undef MALLOC_0_IS_NONNULL +/* Define if the mbrtowc function has the NULL string argument bug. */ +#undef MBRTOWC_NULL_ARG_BUG + +/* Define if the mbrtowc function does not return 0 for a NUL character. */ +#undef MBRTOWC_NUL_RETVAL_BUG + +/* Define if the mbrtowc function returns a wrong return value. */ +#undef MBRTOWC_RETVAL_BUG + /* Define to 1 if assertions should be disabled. */ #undef NDEBUG @@ -610,6 +693,10 @@ directive. */ #undef NEED_PRINTF_DIRECTIVE_F +/* Define if the vasnprintf implementation needs special code for the 'ls' + directive. */ +#undef NEED_PRINTF_DIRECTIVE_LS + /* Define if the vasnprintf implementation needs special code for 'double' arguments. */ #undef NEED_PRINTF_DOUBLE @@ -667,6 +754,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -680,6 +770,9 @@ 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX +/* Define to 1 if a file can be renamed while open, or to 0 if not. */ +#undef RENAME_OPEN_FILE_WORKS + /* Define this to 1 if strerror is broken. */ #undef REPLACE_STRERROR @@ -723,6 +816,9 @@ /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P +/* Shell used by syscmd and esyscmd, must accept -c argument. */ +#undef SYSCMD_SHELL + /* Define if the POSIX multithreading library can be used. */ #undef USE_POSIX_THREADS @@ -800,6 +896,9 @@ /* Define if you want regoff_t to be at least as wide POSIX requires. */ #undef _REGEX_LARGE_OFFSETS +/* Define to 500 only on HP-UX. */ +#undef _XOPEN_SOURCE + /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE @@ -863,8 +962,8 @@ /* Define to a type if <wchar.h> does not define. */ #undef mbstate_t -/* Define to rpl_memcmp if the replacement function should be used. */ -#undef memcmp +/* Define to `int' if <sys/types.h> does not define. */ +#undef mode_t /* Define to the type of st_nlink in struct stat, or a supertype. */ #undef nlink_t @@ -947,5 +1046,15 @@ /* Define to `int' if <sys/types.h> doesn't define. */ #undef uid_t +/* Define as a marker that can be attached to function parameter declarations + for parameters that are not used. This helps to reduce warnings, such as + from GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) +#else +# define _UNUSED_PARAMETER_ +#endif + + /* Define as a macro for copying va_list variables. */ #undef va_copy diff -ruNp m4-1.4.12/lib/dup-safer.c m4-1.4.13/lib/dup-safer.c --- m4-1.4.12/lib/dup-safer.c 2008-02-23 10:29:38.000000000 -0700 +++ m4-1.4.13/lib/dup-safer.c 2009-01-24 12:01:54.000000000 -0700 @@ -1,6 +1,7 @@ /* Invoke dup, but avoid some glitches. - Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2004, 2005, 2006, 2009 Free Software + Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,9 +25,6 @@ #include <fcntl.h> #include <unistd.h> -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif /* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. */ diff -ruNp m4-1.4.12/lib/errno.in.h m4-1.4.13/lib/errno.in.h --- m4-1.4.12/lib/errno.in.h 2008-10-09 21:04:20.000000000 -0600 +++ m4-1.4.13/lib/errno.in.h 2008-12-11 22:14:23.000000000 -0700 @@ -18,7 +18,9 @@ #ifndef _GL_ERRNO_H +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_ERRNO_H@ diff -ruNp m4-1.4.12/lib/execute.c m4-1.4.13/lib/execute.c --- m4-1.4.12/lib/execute.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/execute.c 2009-03-08 20:14:33.000000000 -0600 @@ -0,0 +1,278 @@ +/* Creation of autonomous subprocesses. + Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + +#include <config.h> + +/* Specification. */ +#include "execute.h" + +#include <errno.h> +#include <fcntl.h> +#include <stdbool.h> +#include <stdlib.h> +#include <signal.h> +#include <unistd.h> + +#include "error.h" +#include "fatal-signal.h" +#include "wait-process.h" +#include "gettext.h" + +#define _(str) gettext (str) + +#if defined _MSC_VER || defined __MINGW32__ + +/* Native Woe32 API. */ +# include <process.h> +# include "w32spawn.h" + +#else + +/* Unix API. */ +# include <spawn.h> + +#endif + +/* The results of open() in this file are not used with fchdir, + therefore save some unnecessary work in fchdir.c. */ +#undef open +#undef close + + +#ifdef EINTR + +/* EINTR handling for close(), open(). + These functions can return -1/EINTR even though we don't have any + signal handlers set up, namely when we get interrupted via SIGSTOP. */ + +static inline int +nonintr_close (int fd) +{ + int retval; + + do + retval = close (fd); + while (retval < 0 && errno == EINTR); + + return retval; +} +#define close nonintr_close + +static inline int +nonintr_open (const char *pathname, int oflag, mode_t mode) +{ + int retval; + + do + retval = open (pathname, oflag, mode); + while (retval < 0 && errno == EINTR); + + return retval; +} +#undef open /* avoid warning on VMS */ +#define open nonintr_open + +#endif + + +/* Execute a command, optionally redirecting any of the three standard file + descriptors to /dev/null. Return its exit code. + If it didn't terminate correctly, exit if exit_on_error is true, otherwise + return 127. + If slave_process is true, the child process will be terminated when its + creator receives a catchable fatal signal. */ +int +execute (const char *progname, + const char *prog_path, char **prog_argv, + bool ignore_sigpipe, + bool null_stdin, bool null_stdout, bool null_stderr, + bool slave_process, bool exit_on_error, + int *termsigp) +{ +#if defined _MSC_VER || defined __MINGW32__ + + /* Native Woe32 API. */ + int orig_stdin; + int orig_stdout; + int orig_stderr; + int exitcode; + int nullinfd; + int nulloutfd; + + /* FIXME: Need to free memory allocated by prepare_spawn. */ + prog_argv = prepare_spawn (prog_argv); + + /* Save standard file handles of parent process. */ + if (null_stdin) + orig_stdin = dup_noinherit (STDIN_FILENO); + if (null_stdout) + orig_stdout = dup_noinherit (STDOUT_FILENO); + if (null_stderr) + orig_stderr = dup_noinherit (STDERR_FILENO); + exitcode = -1; + + /* Create standard file handles of child process. */ + nullinfd = -1; + nulloutfd = -1; + if ((!null_stdin + || ((nullinfd = open ("NUL", O_RDONLY, 0)) >= 0 + && (nullinfd == STDIN_FILENO + || (dup2 (nullinfd, STDIN_FILENO) >= 0 + && close (nullinfd) >= 0)))) + && (!(null_stdout || null_stderr) + || ((nulloutfd = open ("NUL", O_RDWR, 0)) >= 0 + && (!null_stdout + || nulloutfd == STDOUT_FILENO + || dup2 (nulloutfd, STDOUT_FILENO) >= 0) + && (!null_stderr + || nulloutfd == STDERR_FILENO + || dup2 (nulloutfd, STDERR_FILENO) >= 0) + && ((null_stdout && nulloutfd == STDOUT_FILENO) + || (null_stderr && nulloutfd == STDERR_FILENO) + || close (nulloutfd) >= 0)))) + /* Use spawnvpe and pass the environment explicitly. This is needed if + the program has modified the environment using putenv() or [un]setenv(). + On Windows, programs have two environments, one in the "environment + block" of the process and managed through SetEnvironmentVariable(), and + one inside the process, in the location retrieved by the 'environ' + macro. When using spawnvp() without 'e', the child process inherits a + copy of the environment block - ignoring the effects of putenv() and + [un]setenv(). */ + { + exitcode = spawnvpe (P_WAIT, prog_path, (const char **) prog_argv, + (const char **) environ); + if (exitcode < 0 && errno == ENOEXEC) + { + /* prog is not an native executable. Try to execute it as a + shell script. Note that prepare_spawn() has already prepended + a hidden element "sh.exe" to prog_argv. */ + --prog_argv; + exitcode = spawnvpe (P_WAIT, prog_argv[0], (const char **) prog_argv, + (const char **) environ); + } + } + if (nulloutfd >= 0) + close (nulloutfd); + if (nullinfd >= 0) + close (nullinfd); + + /* Restore standard file handles of parent process. */ + if (null_stderr) + dup2 (orig_stderr, STDERR_FILENO), close (orig_stderr); + if (null_stdout) + dup2 (orig_stdout, STDOUT_FILENO), close (orig_stdout); + if (null_stdin) + dup2 (orig_stdin, STDIN_FILENO), close (orig_stdin); + + if (termsigp != NULL) + *termsigp = 0; + + if (exitcode == -1) + { + if (exit_on_error || !null_stderr) + error (exit_on_error ? EXIT_FAILURE : 0, errno, + _("%s subprocess failed"), progname); + return 127; + } + + return exitcode; + +#else + + /* Unix API. */ + /* Note about 127: Some errors during posix_spawnp() cause the function + posix_spawnp() to return an error code; some other errors cause the + subprocess to exit with return code 127. It is implementation + dependent which error is reported which way. We treat both cases as + equivalent. */ + sigset_t blocked_signals; + posix_spawn_file_actions_t actions; + bool actions_allocated; + posix_spawnattr_t attrs; + bool attrs_allocated; + int err; + pid_t child; + + if (slave_process) + { + sigprocmask (SIG_SETMASK, NULL, &blocked_signals); + block_fatal_signals (); + } + actions_allocated = false; + attrs_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (null_stdin + && (err = posix_spawn_file_actions_addopen (&actions, + STDIN_FILENO, + "/dev/null", O_RDONLY, + 0)) + != 0) + || (null_stdout + && (err = posix_spawn_file_actions_addopen (&actions, + STDOUT_FILENO, + "/dev/null", O_RDWR, + 0)) + != 0) + || (null_stderr + && (err = posix_spawn_file_actions_addopen (&actions, + STDERR_FILENO, + "/dev/null", O_RDWR, + 0)) + != 0) + || (slave_process + && ((err = posix_spawnattr_init (&attrs)) != 0 + || (attrs_allocated = true, + (err = posix_spawnattr_setsigmask (&attrs, + &blocked_signals)) + != 0 + || (err = posix_spawnattr_setflags (&attrs, + POSIX_SPAWN_SETSIGMASK)) + != 0))) + || (err = posix_spawnp (&child, prog_path, &actions, + attrs_allocated ? &attrs : NULL, prog_argv, + environ)) + != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + if (attrs_allocated) + posix_spawnattr_destroy (&attrs); + if (slave_process) + unblock_fatal_signals (); + if (termsigp != NULL) + *termsigp = 0; + if (exit_on_error || !null_stderr) + error (exit_on_error ? EXIT_FAILURE : 0, err, + _("%s subprocess failed"), progname); + return 127; + } + posix_spawn_file_actions_destroy (&actions); + if (attrs_allocated) + posix_spawnattr_destroy (&attrs); + if (slave_process) + { + register_slave_subprocess (child); + unblock_fatal_signals (); + } + + return wait_subprocess (child, progname, ignore_sigpipe, null_stderr, + slave_process, exit_on_error, termsigp); + +#endif +} diff -ruNp m4-1.4.12/lib/execute.h m4-1.4.13/lib/execute.h --- m4-1.4.12/lib/execute.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/execute.h 2009-02-28 08:25:54.000000000 -0700 @@ -0,0 +1,44 @@ +/* Creation of autonomous subprocesses. + Copyright (C) 2001-2003, 2008 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _EXECUTE_H +#define _EXECUTE_H + +#include <stdbool.h> + +/* Execute a command, optionally redirecting any of the three standard file + descriptors to /dev/null. Return its exit code. + If it didn't terminate correctly, exit if exit_on_error is true, otherwise + return 127. + If ignore_sigpipe is true, consider a subprocess termination due to SIGPIPE + as equivalent to a success. This is suitable for processes whose only + purpose is to write to standard output. + If slave_process is true, the child process will be terminated when its + creator receives a catchable fatal signal. + If termsigp is not NULL, *termsig will be set to the signal that terminated + the subprocess (if supported by the platform: not on native Windows + platforms), otherwise 0. + It is recommended that no signal is blocked or ignored while execute() + is called. See pipe.h for the reason. */ +extern int execute (const char *progname, + const char *prog_path, char **prog_argv, + bool ignore_sigpipe, + bool null_stdin, bool null_stdout, bool null_stderr, + bool slave_process, bool exit_on_error, + int *termsigp); + +#endif /* _EXECUTE_H */ diff -ruNp m4-1.4.12/lib/fcntl.in.h m4-1.4.13/lib/fcntl.in.h --- m4-1.4.12/lib/fcntl.in.h 2008-10-09 21:04:21.000000000 -0600 +++ m4-1.4.13/lib/fcntl.in.h 2008-12-11 22:14:25.000000000 -0700 @@ -17,7 +17,9 @@ /* written by Paul Eggert */ +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif #if defined __need_system_fcntl_h /* Special invocation convention. */ @@ -125,8 +127,8 @@ extern void _gl_register_fd (int fd, con # define O_TEXT _O_TEXT #endif -#ifdef __BEOS__ - /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +#if defined __BEOS__ || defined __HAIKU__ + /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif diff -ruNp m4-1.4.12/lib/fd-safer.c m4-1.4.13/lib/fd-safer.c --- m4-1.4.12/lib/fd-safer.c 2008-02-23 10:29:40.000000000 -0700 +++ m4-1.4.13/lib/fd-safer.c 2009-01-24 12:01:55.000000000 -0700 @@ -1,6 +1,6 @@ /* Return a safer copy of a file descriptor. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,12 +24,6 @@ #include <errno.h> #include <unistd.h> -#ifndef STDIN_FILENO -# define STDIN_FILENO 0 -#endif -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif /* Return FD, unless FD would be a copy of standard input, output, or error; in that case, return a duplicate of FD, closing FD. On diff -ruNp m4-1.4.12/lib/fflush.c m4-1.4.13/lib/fflush.c --- m4-1.4.12/lib/fflush.c 2008-08-05 07:16:41.000000000 -0600 +++ m4-1.4.13/lib/fflush.c 2009-01-28 06:24:13.000000000 -0700 @@ -1,5 +1,5 @@ /* fflush.c -- allow flushing input streams - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,18 +31,45 @@ #undef fflush + +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + +/* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ +static inline void +clear_ungetc_buffer_preserving_position (FILE *fp) +{ + if (fp->_flags & _IO_IN_BACKUP) + /* _IO_free_backup_area is a bit complicated. Simply call fseek. */ + fseek (fp, 0, SEEK_CUR); +} + +#else + +/* Clear the stream's ungetc buffer. May modify the value of ftello (fp). */ static inline void clear_ungetc_buffer (FILE *fp) { -#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ +# if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ if (HASUB (fp)) { fp_->_p += fp_->_r; fp_->_r = 0; } -#endif +# elif defined __EMX__ /* emx+gcc */ + if (fp->_ungetc_count > 0) + { + fp->_ungetc_count = 0; + fp->_rcount = - fp->_rcount; + } +# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + /* Nothing to do. */ +# else /* other implementations */ + fseek (fp, 0, SEEK_CUR); +# endif } +#endif + #if (defined __sferror || defined __DragonFly__) && defined __SNPT /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ static inline int @@ -75,9 +102,6 @@ update_fpos_cache (FILE *fp, off_t pos) int rpl_fflush (FILE *stream) { - int result; - off_t pos; - /* When stream is NULL, POSIX and C99 only require flushing of "output streams and update streams in which the most recent operation was not input", and all implementations do this. @@ -100,70 +124,81 @@ rpl_fflush (FILE *stream) if (stream == NULL || ! freading (stream)) return fflush (stream); - /* Clear the ungetc buffer. +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - This is needed before fetching the file-position indicator, because - 1) The file position indicator is incremented by fgetc() and decremented - by ungetc(): - <http://www.opengroup.org/susv3/functions/fgetc.html> - "... the fgetc() function shall ... advance the associated file - position indicator for the stream ..." - <http://www.opengroup.org/susv3/functions/ungetc.html> - "The file-position indicator is decremented by each successful - call to ungetc()..." - 2) <http://www.opengroup.org/susv3/functions/ungetc.html> says: - "The value of the file-position indicator for the stream after - reading or discarding all pushed-back bytes shall be the same - as it was before the bytes were pushed back." - 3) Here we are discarding all pushed-back bytes. - - Unfortunately it is impossible to implement this on platforms with - _IOERR, because an ungetc() on this platform prepends the pushed-back - bytes to the buffer without an indication of the limit between the - pushed-back bytes and the read-ahead bytes. */ - clear_ungetc_buffer (stream); - - /* POSIX does not specify fflush behavior for non-seekable input - streams. Some implementations purge unread data, some return - EBADF, some do nothing. */ - pos = ftello (stream); - if (pos == -1) - { - errno = EBADF; - return EOF; - } - - /* To get here, we must be flushing a seekable input stream, so the - semantics of fpurge are now appropriate to clear the buffer. To - avoid losing data, the lseek is also necessary. */ - result = fpurge (stream); - if (result != 0) - return result; + clear_ungetc_buffer_preserving_position (stream); -#if (defined __sferror || defined __DragonFly__) && defined __SNPT /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + return fflush (stream); +#else { - /* Disable seek optimization for the next fseeko call. This tells the - following fseeko call to seek to the desired position directly, rather - than to seek to a block-aligned boundary. */ - int saved_flags = disable_seek_optimization (stream); + /* Notes about the file-position indicator: + 1) The file position indicator is incremented by fgetc() and decremented + by ungetc(): + <http://www.opengroup.org/susv3/functions/fgetc.html> + "... the fgetc() function shall ... advance the associated file + position indicator for the stream ..." + <http://www.opengroup.org/susv3/functions/ungetc.html> + "The file-position indicator is decremented by each successful + call to ungetc()..." + 2) <http://www.opengroup.org/susv3/functions/ungetc.html> says: + "The value of the file-position indicator for the stream after + reading or discarding all pushed-back bytes shall be the same + as it was before the bytes were pushed back." + Here we are discarding all pushed-back bytes. But more specifically, + 3) <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> says: + "[After fflush(),] the file offset of the underlying open file + description shall be set to the file position of the stream, and + any characters pushed back onto the stream by ungetc() ... shall + be discarded." */ + + /* POSIX does not specify fflush behavior for non-seekable input + streams. Some implementations purge unread data, some return + EBADF, some do nothing. */ + off_t pos = ftello (stream); + if (pos == -1) + { + errno = EBADF; + return EOF; + } + + /* Clear the ungetc buffer. */ + clear_ungetc_buffer (stream); + + /* To get here, we must be flushing a seekable input stream, so the + semantics of fpurge are now appropriate to clear the buffer. To + avoid losing data, the lseek is also necessary. */ + { + int result = fpurge (stream); + if (result != 0) + return result; + } - result = fseeko (stream, pos, SEEK_SET); +# if (defined __sferror || defined __DragonFly__) && defined __SNPT /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ - restore_seek_optimization (stream, saved_flags); - } - return result; + { + /* Disable seek optimization for the next fseeko call. This tells the + following fseeko call to seek to the desired position directly, rather + than to seek to a block-aligned boundary. */ + int saved_flags = disable_seek_optimization (stream); + int result = fseeko (stream, pos, SEEK_SET); -#else + restore_seek_optimization (stream, saved_flags); + return result; + } - pos = lseek (fileno (stream), pos, SEEK_SET); - if (pos == -1) - return EOF; - /* After a successful lseek, update the file descriptor's position cache - in the stream. */ - update_fpos_cache (stream, pos); +# else - return 0; + pos = lseek (fileno (stream), pos, SEEK_SET); + if (pos == -1) + return EOF; + /* After a successful lseek, update the file descriptor's position cache + in the stream. */ + update_fpos_cache (stream, pos); + + return 0; +# endif + } #endif } diff -ruNp m4-1.4.12/lib/float.in.h m4-1.4.13/lib/float.in.h --- m4-1.4.12/lib/float.in.h 2008-08-31 08:31:21.000000000 -0600 +++ m4-1.4.13/lib/float.in.h 2008-12-11 22:14:26.000000000 -0700 @@ -17,7 +17,9 @@ #ifndef _GL_FLOAT_H +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_FLOAT_H@ diff -ruNp m4-1.4.12/lib/fopen-safer.c m4-1.4.13/lib/fopen-safer.c --- m4-1.4.12/lib/fopen-safer.c 2008-02-23 10:29:40.000000000 -0700 +++ m4-1.4.13/lib/fopen-safer.c 2009-01-24 12:01:56.000000000 -0700 @@ -1,6 +1,7 @@ /* Invoke fopen, but avoid some glitches. - Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2004, 2005, 2006, 2009 Free Software + Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,10 +26,6 @@ #include <unistd.h> #include "unistd-safer.h" -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif - /* Like fopen, but do not return stdin, stdout, or stderr. */ FILE * diff -ruNp m4-1.4.12/lib/fopen.c m4-1.4.13/lib/fopen.c --- m4-1.4.12/lib/fopen.c 2008-09-28 14:06:36.000000000 -0600 +++ m4-1.4.13/lib/fopen.c 2009-01-24 12:01:56.000000000 -0700 @@ -1,5 +1,5 @@ /* Open a stream to a file. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,6 +36,8 @@ orig_fopen (const char *filename, const #include <fcntl.h> #include <string.h> #include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> FILE * rpl_fopen (const char *filename, const char *mode) diff -ruNp m4-1.4.12/lib/fpurge.c m4-1.4.13/lib/fpurge.c --- m4-1.4.12/lib/fpurge.c 2008-08-05 07:16:43.000000000 -0600 +++ m4-1.4.13/lib/fpurge.c 2009-03-01 08:29:10.000000000 -0700 @@ -1,5 +1,5 @@ /* Flushing buffers of a FILE stream. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ /* Specification. */ #include "fpurge.h" -#if HAVE___FPURGE /* glibc >= 2.2, Solaris >= 7 */ +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7 */ # include <stdio_ext.h> #endif #include <stdlib.h> @@ -29,7 +29,7 @@ int fpurge (FILE *fp) { -#if HAVE___FPURGE /* glibc >= 2.2, Solaris >= 7 */ +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7 */ __fpurge (fp); /* The __fpurge function does not have a return value. */ @@ -61,7 +61,7 @@ fpurge (FILE *fp) /* Most systems provide FILE as a struct and the necessary bitmask in <stdio.h>, because they need it for implementing getc() and putc() as fast macros. */ -# if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */ +# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_IO_read_end = fp->_IO_read_ptr; fp->_IO_write_ptr = fp->_IO_write_base; /* Avoid memory leak when there is an active ungetc buffer. */ @@ -114,6 +114,21 @@ fpurge (FILE *fp) /* fp->_Buf <= fp->_Next <= fp->_Rend */ fp->_Rend = fp->_Next; return 0; +# elif defined __MINT__ /* Atari FreeMiNT */ + if (fp->__pushed_back) + { + fp->__bufp = fp->__pushback_bufp; + fp->__pushed_back = 0; + } + /* Preserve the current file position. */ + if (fp->__target != -1) + fp->__target += fp->__bufp - fp->__buffer; + fp->__bufp = fp->__buffer; + /* Nothing in the buffer, next getc is nontrivial. */ + fp->__get_limit = fp->__bufp; + /* Nothing in the buffer, next putc is nontrivial. */ + fp->__put_limit = fp->__buffer; + return 0; # else #error "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib." # endif diff -ruNp m4-1.4.12/lib/freadahead.c m4-1.4.13/lib/freadahead.c --- m4-1.4.12/lib/freadahead.c 2008-09-12 20:45:53.000000000 -0600 +++ m4-1.4.13/lib/freadahead.c 2009-03-01 08:29:11.000000000 -0700 @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ size_t freadahead (FILE *fp) { -#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ if (fp->_IO_write_ptr > fp->_IO_write_base) return 0; return (fp->_IO_read_end - fp->_IO_read_ptr) @@ -70,6 +70,12 @@ freadahead (FILE *fp) + (fp->_Mode & 0x4000 /* _MBYTE */ ? (fp->_Back + sizeof (fp->_Back)) - fp->_Rback : 0); +#elif defined __MINT__ /* Atari FreeMiNT */ + if (!fp->__mode.__read) + return 0; + return (fp->__pushed_back + ? fp->__get_limit - fp->__pushback_bufp + 1 + : fp->__get_limit - fp->__bufp); #elif defined SLOW_BUT_NO_HACKS /* users can define this */ abort (); return 0; diff -ruNp m4-1.4.12/lib/freading.c m4-1.4.13/lib/freading.c --- m4-1.4.12/lib/freading.c 2008-08-05 07:16:44.000000000 -0600 +++ m4-1.4.13/lib/freading.c 2009-03-01 08:29:11.000000000 -0700 @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ freading (FILE *fp) /* Most systems provide FILE as a struct and the necessary bitmask in <stdio.h>, because they need it for implementing getc() and putc() as fast macros. */ -#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ return ((fp->_flags & _IO_NO_WRITES) != 0 || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 && fp->_IO_read_base != NULL)); @@ -46,6 +46,16 @@ freading (FILE *fp) #elif defined __QNX__ /* QNX */ return ((fp->_Mode & 0x2 /* _MOPENW */) == 0 || (fp->_Mode & 0x1000 /* _MREAD */) != 0); +#elif defined __MINT__ /* Atari FreeMiNT */ + if (!fp->__mode.__write) + return 1; + if (!fp->__mode.__read) + return 0; +# ifdef _IO_CURRENTLY_GETTING /* Flag added on 2009-02-28 */ + return (fp->__flags & _IO_CURRENTLY_GETTING) != 0; +# else + return (fp->__buffer < fp->__get_limit /*|| fp->__bufp == fp->__put_limit ??*/); +# endif #else #error "Please port gnulib freading.c to your platform!" #endif diff -ruNp m4-1.4.12/lib/fseeko.c m4-1.4.13/lib/fseeko.c --- m4-1.4.12/lib/fseeko.c 2008-08-05 07:16:44.000000000 -0600 +++ m4-1.4.13/lib/fseeko.c 2009-03-01 08:29:12.000000000 -0700 @@ -1,5 +1,5 @@ /* An fseeko() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ rpl_fseeko (FILE *fp, off_t offset, int #endif /* These tests are based on fpurge.c. */ -#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ if (fp->_IO_read_end == fp->_IO_read_ptr && fp->_IO_write_ptr == fp->_IO_write_base && fp->_IO_save_base == NULL) @@ -82,11 +82,23 @@ rpl_fseeko (FILE *fp, off_t offset, int if ((fp->_Mode & _MWRITE ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend) && fp->_Rback == fp->_Back + sizeof (fp->_Back) && fp->_Rsave == NULL) +#elif defined __MINT__ /* Atari FreeMiNT */ + if (fp->__bufp == fp->__buffer + && fp->__get_limit == fp->__bufp + && fp->__put_limit == fp->__bufp + && !fp->__pushed_back) #else #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib." #endif { - off_t pos = lseek (fileno (fp), offset, whence); + /* We get here when an fflush() call immediately preceded this one. We + know there are no buffers. + POSIX requires us to modify the file descriptor's position. + But we cannot position beyond end of file here. */ + off_t pos = + lseek (fileno (fp), + whence == SEEK_END && offset > 0 ? 0 : offset, + whence); if (pos == -1) { #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ @@ -94,20 +106,25 @@ rpl_fseeko (FILE *fp, off_t offset, int #endif return -1; } - else - { -#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ - fp_->_offset = pos; - fp_->_flags |= __SOFF; - fp_->_flags &= ~__SEOF; + +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_offset = pos; + fp_->_flags |= __SOFF; + fp_->_flags &= ~__SEOF; #elif defined __EMX__ /* emx+gcc */ - fp->_flags &= ~_IOEOF; + fp->_flags &= ~_IOEOF; #elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ - fp->_flag &= ~_IOEOF; + fp->_flag &= ~_IOEOF; +#elif defined __MINT__ /* Atari FreeMiNT */ + fp->__offset = pos; + fp->__eof = 0; #endif - return 0; - } + /* If we were not requested to position beyond end of file, we're + done. */ + if (!(whence == SEEK_END && offset > 0)) + return 0; } - else - return fseeko (fp, offset, whence); + return fseeko (fp, offset, whence); } diff -ruNp m4-1.4.12/lib/getdtablesize.c m4-1.4.13/lib/getdtablesize.c --- m4-1.4.12/lib/getdtablesize.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/getdtablesize.c 2009-02-28 08:25:54.000000000 -0700 @@ -0,0 +1,33 @@ +/* getdtablesize() function for platforms that don't have it. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +#include <stdio.h> + +int +getdtablesize (void) +{ + return _getmaxstdio (); +} + +#endif diff -ruNp m4-1.4.12/lib/gettimeofday.c m4-1.4.13/lib/gettimeofday.c --- m4-1.4.12/lib/gettimeofday.c 2008-02-23 10:29:44.000000000 -0700 +++ m4-1.4.13/lib/gettimeofday.c 2009-01-24 12:01:59.000000000 -0700 @@ -41,6 +41,12 @@ static struct tm tm_zero_buffer; static struct tm *localtime_buffer_addr = &tm_zero_buffer; +#undef localtime +extern struct tm *localtime (time_t const *); + +#undef gmtime +extern struct tm *gmtime (time_t const *); + /* This is a wrapper for localtime. It is used only on systems for which gettimeofday clobbers the static buffer used for localtime's result. @@ -50,8 +56,6 @@ static struct tm *localtime_buffer_addr struct tm * rpl_localtime (time_t const *timep) { -#undef localtime - extern struct tm *localtime (time_t const *); struct tm *tm = localtime (timep); if (localtime_buffer_addr == &tm_zero_buffer) @@ -64,8 +68,6 @@ rpl_localtime (time_t const *timep) struct tm * rpl_gmtime (time_t const *timep) { -#undef gmtime - extern struct tm *gmtime (time_t const *); struct tm *tm = gmtime (timep); if (localtime_buffer_addr == &tm_zero_buffer) @@ -77,14 +79,15 @@ rpl_gmtime (time_t const *timep) #endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */ #if TZSET_CLOBBERS_LOCALTIME + +#undef tzset +extern void tzset (void); + /* This is a wrapper for tzset, for systems on which tzset may clobber the static buffer used for localtime's result. */ void rpl_tzset (void) { -#undef tzset - extern void tzset (void); - /* Save and restore the contents of the buffer used for localtime's result around the call to tzset. */ struct tm save = *localtime_buffer_addr; diff -ruNp m4-1.4.12/lib/glthread/lock.c m4-1.4.13/lib/glthread/lock.c --- m4-1.4.12/lib/glthread/lock.c 2008-08-25 21:06:39.000000000 -0600 +++ m4-1.4.13/lib/glthread/lock.c 2008-12-11 22:14:32.000000000 -0700 @@ -680,6 +680,9 @@ glthread_lock_destroy_func (gl_lock_t *l /* ------------------------- gl_rwlock_t datatype ------------------------- */ +/* In this file, the waitqueues are implemented as circular arrays. */ +#define gl_waitqueue_t gl_carray_waitqueue_t + static inline void gl_waitqueue_init (gl_waitqueue_t *wq) { @@ -726,6 +729,8 @@ gl_waitqueue_add (gl_waitqueue_t *wq) wq->array = new_array; wq->alloc = new_alloc; } + /* Whether the created event is a manual-reset one or an auto-reset one, + does not matter, since we will wait on it only once. */ event = CreateEvent (NULL, TRUE, FALSE, NULL); if (event == INVALID_HANDLE_VALUE) /* No way to allocate an event. */ diff -ruNp m4-1.4.12/lib/glthread/lock.h m4-1.4.13/lib/glthread/lock.h --- m4-1.4.12/lib/glthread/lock.h 2008-08-25 21:06:39.000000000 -0600 +++ m4-1.4.13/lib/glthread/lock.h 2008-12-11 22:14:32.000000000 -0700 @@ -675,13 +675,13 @@ typedef struct unsigned int alloc; /* length of allocated array */ unsigned int offset; /* index of first waiting thread in array */ } - gl_waitqueue_t; + gl_carray_waitqueue_t; typedef struct { gl_spinlock_t guard; /* protects the initialization */ CRITICAL_SECTION lock; /* protects the remaining fields */ - gl_waitqueue_t waiting_readers; /* waiting readers */ - gl_waitqueue_t waiting_writers; /* waiting writers */ + gl_carray_waitqueue_t waiting_readers; /* waiting readers */ + gl_carray_waitqueue_t waiting_writers; /* waiting writers */ int runcount; /* number of readers running, or -1 when a writer runs */ } gl_rwlock_t; diff -ruNp m4-1.4.12/lib/glthread/threadlib.c m4-1.4.13/lib/glthread/threadlib.c --- m4-1.4.12/lib/glthread/threadlib.c 2008-08-25 21:06:40.000000000 -0600 +++ m4-1.4.13/lib/glthread/threadlib.c 2009-01-25 19:37:45.000000000 -0700 @@ -1,5 +1,5 @@ /* Multithreading primitives. - Copyright (C) 2005-2008 Free Software Foundation, Inc. + Copyright (C) 2005-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ /* Use the POSIX threads library. */ # include <pthread.h> +# include <stdlib.h> # if PTHREAD_IN_USE_DETECTION_HARD @@ -67,3 +68,7 @@ glthread_in_use (void) #endif /* ========================================================================= */ + +/* This declaration is solely to ensure that after preprocessing + this file is never empty. */ +typedef int dummy; diff -ruNp m4-1.4.12/lib/localcharset.c m4-1.4.13/lib/localcharset.c --- m4-1.4.12/lib/localcharset.c 2008-08-05 07:16:49.000000000 -0600 +++ m4-1.4.13/lib/localcharset.c 2009-01-25 19:37:47.000000000 -0700 @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006, 2008 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,6 +28,10 @@ #include <string.h> #include <stdlib.h> +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */ +#endif + #if defined _WIN32 || defined __WIN32__ # define WIN32_NATIVE #endif @@ -112,7 +116,7 @@ get_charset_aliases (void) cp = charset_aliases; if (cp == NULL) { -#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) +#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) FILE *fp; const char *dir; const char *base = "charset.alias"; @@ -213,6 +217,39 @@ get_charset_aliases (void) #else +# if defined DARWIN7 + /* To avoid the trouble of installing a file that is shared by many + GNU packages -- many packaging systems have problems with this --, + simply inline the aliases here. */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-4" "\0" "ISO-8859-4" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + "ISO8859-13" "\0" "ISO-8859-13" "\0" + "ISO8859-15" "\0" "ISO-8859-15" "\0" + "KOI8-R" "\0" "KOI8-R" "\0" + "KOI8-U" "\0" "KOI8-U" "\0" + "CP866" "\0" "CP866" "\0" + "CP949" "\0" "CP949" "\0" + "CP1131" "\0" "CP1131" "\0" + "CP1251" "\0" "CP1251" "\0" + "eucCN" "\0" "GB2312" "\0" + "GB2312" "\0" "GB2312" "\0" + "eucJP" "\0" "EUC-JP" "\0" + "eucKR" "\0" "EUC-KR" "\0" + "Big5" "\0" "BIG5" "\0" + "Big5HKSCS" "\0" "BIG5-HKSCS" "\0" + "GBK" "\0" "GBK" "\0" + "GB18030" "\0" "GB18030" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "ARMSCII-8" "\0" "ARMSCII-8" "\0" + "PT154" "\0" "PT154" "\0" + /*"ISCII-DEV" "\0" "?" "\0"*/ + "*" "\0" "UTF-8" "\0"; +# endif + # if defined VMS /* To avoid the troubles of an extra file charset.alias_vms in the sources of many GNU packages, simply inline the aliases here. */ diff -ruNp m4-1.4.12/lib/lstat.c m4-1.4.13/lib/lstat.c --- m4-1.4.12/lib/lstat.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/lstat.c 2008-12-11 22:14:17.000000000 -0700 @@ -0,0 +1,82 @@ +/* Work around a bug of lstat on some systems + + Copyright (C) 1997-1999, 2000-2006, 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* written by Jim Meyering */ + +#include <config.h> + +/* Get the original definition of open. It might be defined as a macro. */ +#define __need_system_sys_stat_h +#include <sys/types.h> +#include <sys/stat.h> +#undef __need_system_sys_stat_h + +static inline int +orig_lstat (const char *filename, struct stat *buf) +{ + return lstat (filename, buf); +} + +/* Specification. */ +#include <sys/stat.h> + +#include <string.h> +#include <errno.h> + +/* 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 = orig_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 -ruNp m4-1.4.12/lib/math.in.h m4-1.4.13/lib/math.in.h --- m4-1.4.12/lib/math.in.h 2008-08-31 08:31:29.000000000 -0600 +++ m4-1.4.13/lib/math.in.h 2008-12-11 22:14:35.000000000 -0700 @@ -17,10 +17,12 @@ #ifndef _GL_MATH_H +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif /* The include_next requires a split double-inclusion guard. */ -#@INCLUDE_NEXT@ @NEXT_MATH_H@ +#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_MATH_H@ #ifndef _GL_MATH_H #define _GL_MATH_H @@ -399,25 +401,92 @@ extern int gl_isinfl (long double x); #endif +#if @GNULIB_ISNANF@ +/* Test for NaN for 'float' numbers. */ +# if @HAVE_ISNANF@ +/* The original <math.h> included above provides a declaration of isnan macro + or (older) isnanf function. */ +# include <math.h> +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnanf +# define isnanf(x) __builtin_isnanf ((float)(x)) +# elif defined isnan +# undef isnanf +# define isnanf(x) isnan ((float)(x)) +# endif +# else +/* Test whether X is a NaN. */ +# undef isnanf +# define isnanf rpl_isnanf +extern int isnanf (float x); +# endif +#endif + +#if @GNULIB_ISNAND@ +/* Test for NaN for 'double' numbers. + This function is a gnulib extension, unlike isnan() which applied only + to 'double' numbers earlier but now is a type-generic macro. */ +# if @HAVE_ISNAND@ +/* The original <math.h> included above provides a declaration of isnan macro. */ +# include <math.h> +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnand +# define isnand(x) __builtin_isnan ((double)(x)) +# else +# undef isnand +# define isnand(x) isnan ((double)(x)) +# endif +# else +/* Test whether X is a NaN. */ +# undef isnand +# define isnand rpl_isnand +extern int isnand (double x); +# endif +#endif + +#if @GNULIB_ISNANL@ +/* Test for NaN for 'long double' numbers. */ +# if @HAVE_ISNANL@ +/* The original <math.h> included above provides a declaration of isnan macro or (older) isnanl function. */ +# include <math.h> +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnanl +# define isnanl(x) __builtin_isnanl ((long double)(x)) +# elif defined isnan +# undef isnanl +# define isnanl(x) isnan ((long double)(x)) +# endif +# else +/* Test whether X is a NaN. */ +# undef isnanl +# define isnanl rpl_isnanl +extern int isnanl (long double x); +# endif +#endif + +/* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL! */ #if @GNULIB_ISNAN@ # if @REPLACE_ISNAN@ /* We can't just use the isnanf macro (e.g.) as exposed by isnanf.h (e.g.) here, because those may end up being macros that recursively expand back to isnan. So use the gnulib replacements for them directly. */ -# if HAVE_ISNANF && __GNUC__ >= 4 +# if @HAVE_ISNANF@ && __GNUC__ >= 4 # define gl_isnan_f(x) __builtin_isnan ((float)(x)) # else extern int rpl_isnanf (float x); # define gl_isnan_f(x) rpl_isnanf (x) # endif -# if HAVE_ISNAND && __GNUC__ >= 4 +# if @HAVE_ISNAND@ && __GNUC__ >= 4 # define gl_isnan_d(x) __builtin_isnan ((double)(x)) # else extern int rpl_isnand (double x); # define gl_isnan_d(x) rpl_isnand (x) # endif -# if HAVE_ISNANL && __GNUC__ >= 4 +# if @HAVE_ISNANL@ && __GNUC__ >= 4 # define gl_isnan_l(x) __builtin_isnan ((long double)(x)) # else extern int rpl_isnanl (long double x); diff -ruNp m4-1.4.12/lib/mbrtowc.c m4-1.4.13/lib/mbrtowc.c --- m4-1.4.12/lib/mbrtowc.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/mbrtowc.c 2009-02-28 08:26:15.000000000 -0700 @@ -0,0 +1,386 @@ +/* Convert multibyte character to wide character. + Copyright (C) 1999-2002, 2005-2009 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#if GNULIB_defined_mbstate_t +/* Implement mbrtowc() on top of mbtowc(). */ + +# include <errno.h> +# include <stdlib.h> + +# include "localcharset.h" +# include "streq.h" +# include "verify.h" + + +verify (sizeof (mbstate_t) >= 4); + +static char internal_state[4]; + +size_t +mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) +{ + char *pstate = (char *)ps; + + if (pstate == NULL) + pstate = internal_state; + + if (s == NULL) + { + pwc = NULL; + s = ""; + n = 1; + } + + if (n == 0) + return (size_t)(-2); + + /* Here n > 0. */ + { + size_t nstate = pstate[0]; + char buf[4]; + const char *p; + size_t m; + + switch (nstate) + { + case 0: + p = s; + m = n; + break; + case 3: + buf[2] = pstate[3]; + /*FALLTHROUGH*/ + case 2: + buf[1] = pstate[2]; + /*FALLTHROUGH*/ + case 1: + buf[0] = pstate[1]; + p = buf; + m = nstate; + buf[m++] = s[0]; + if (n >= 2 && m < 4) + { + buf[m++] = s[1]; + if (n >= 3 && m < 4) + buf[m++] = s[2]; + } + break; + default: + errno = EINVAL; + return (size_t)(-1); + } + + /* Here m > 0. */ + +# if __GLIBC__ + /* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */ + mbtowc (NULL, NULL, 0); +# endif + { + int res = mbtowc (pwc, p, m); + + if (res >= 0) + { + if (pwc != NULL && ((*pwc == 0) != (res == 0))) + abort (); + if (nstate >= (res > 0 ? res : 1)) + abort (); + res -= nstate; + pstate[0] = 0; + return res; + } + + /* mbtowc does not distinguish between invalid and incomplete multibyte + sequences. But mbrtowc needs to make this distinction. + There are two possible approaches: + - Use iconv() and its return value. + - Use built-in knowledge about the possible encodings. + Given the low quality of implementation of iconv() on the systems that + lack mbrtowc(), we use the second approach. + The possible encodings are: + - 8-bit encodings, + - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS, + - UTF-8. + Use specialized code for each. */ + if (m >= 4 || m >= MB_CUR_MAX) + goto invalid; + /* Here MB_CUR_MAX > 1 and 0 < m < 4. */ + { + const char *encoding = locale_charset (); + + if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0)) + { + /* Cf. unistr/u8-mblen.c. */ + unsigned char c = (unsigned char) p[0]; + + if (c >= 0xc2) + { + if (c < 0xe0) + { + if (m == 1) + goto incomplete; + } + else if (c < 0xf0) + { + if (m == 1) + goto incomplete; + if (m == 2) + { + unsigned char c2 = (unsigned char) p[1]; + + if ((c2 ^ 0x80) < 0x40 + && (c >= 0xe1 || c2 >= 0xa0) + && (c != 0xed || c2 < 0xa0)) + goto incomplete; + } + } + else if (c <= 0xf4) + { + if (m == 1) + goto incomplete; + else /* m == 2 || m == 3 */ + { + unsigned char c2 = (unsigned char) p[1]; + + if ((c2 ^ 0x80) < 0x40 + && (c >= 0xf1 || c2 >= 0x90) + && (c < 0xf4 || (c == 0xf4 && c2 < 0x90))) + { + if (m == 2) + goto incomplete; + else /* m == 3 */ + { + unsigned char c3 = (unsigned char) p[2]; + + if ((c3 ^ 0x80) < 0x40) + goto incomplete; + } + } + } + } + } + goto invalid; + } + + /* As a reference for this code, you can use the GNU libiconv + implementation. Look for uses of the RET_TOOFEW macro. */ + + if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f) + goto incomplete; + } + if (m == 2) + { + unsigned char c = (unsigned char) p[0]; + + if (c == 0x8f) + { + unsigned char c2 = (unsigned char) p[1]; + + if (c2 >= 0xa1 && c2 < 0xff) + goto incomplete; + } + } + goto invalid; + } + if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) + || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if (c >= 0xa1 && c < 0xff) + goto incomplete; + } + goto invalid; + } + if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0xa1 && c < 0xff) || c == 0x8e) + goto incomplete; + } + else /* m == 2 || m == 3 */ + { + unsigned char c = (unsigned char) p[0]; + + if (c == 0x8e) + goto incomplete; + } + goto invalid; + } + if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe)) + goto incomplete; + } + else /* m == 2 || m == 3 */ + { + unsigned char c = (unsigned char) p[0]; + + if (c >= 0x90 && c <= 0xe3) + { + unsigned char c2 = (unsigned char) p[1]; + + if (c2 >= 0x30 && c2 <= 0x39) + { + if (m == 2) + goto incomplete; + else /* m == 3 */ + { + unsigned char c3 = (unsigned char) p[2]; + + if (c3 >= 0x81 && c3 <= 0xfe) + goto incomplete; + } + } + } + } + goto invalid; + } + if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea) + || (c >= 0xf0 && c <= 0xf9)) + goto incomplete; + } + goto invalid; + } + + /* An unknown multibyte encoding. */ + goto incomplete; + } + + incomplete: + { + size_t k = nstate; + /* Here 0 <= k < m < 4. */ + pstate[++k] = s[0]; + if (k < m) + { + pstate[++k] = s[1]; + if (k < m) + pstate[++k] = s[2]; + } + if (k != m) + abort (); + } + pstate[0] = m; + return (size_t)(-2); + + invalid: + errno = EILSEQ; + /* The conversion state is undefined, says POSIX. */ + return (size_t)(-1); + } + } +} + +#else +/* Override the system's mbrtowc() function. */ + +# undef mbrtowc + +size_t +rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) +{ +# if MBRTOWC_NULL_ARG_BUG || MBRTOWC_RETVAL_BUG + if (s == NULL) + { + pwc = NULL; + s = ""; + n = 1; + } +# endif + +# if MBRTOWC_RETVAL_BUG + { + static mbstate_t internal_state; + + /* Override mbrtowc's internal state. We can not call mbsinit() on the + hidden internal state, but we can call it on our variable. */ + if (ps == NULL) + ps = &internal_state; + + if (!mbsinit (ps)) + { + /* Parse the rest of the multibyte character byte for byte. */ + size_t count = 0; + for (; n > 0; s++, n--) + { + wchar_t wc; + size_t ret = mbrtowc (&wc, s, 1, ps); + + if (ret == (size_t)(-1)) + return (size_t)(-1); + count++; + if (ret != (size_t)(-2)) + { + /* The multibyte character has been completed. */ + if (pwc != NULL) + *pwc = wc; + return (wc == 0 ? 0 : count); + } + } + return (size_t)(-2); + } + } +# endif + +# if MBRTOWC_NUL_RETVAL_BUG + { + wchar_t wc; + size_t ret = mbrtowc (&wc, s, n, ps); + + if (ret != (size_t)(-1) && ret != (size_t)(-2)) + { + if (pwc != NULL) + *pwc = wc; + if (wc == 0) + ret = 0; + } + return ret; + } +# else + return mbrtowc (pwc, s, n, ps); +# endif +} + +#endif diff -ruNp m4-1.4.12/lib/mbsinit.c m4-1.4.13/lib/mbsinit.c --- m4-1.4.12/lib/mbsinit.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/mbsinit.c 2008-12-24 06:20:31.000000000 -0700 @@ -0,0 +1,47 @@ +/* Test for initial conversion state. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include "verify.h" + +/* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs() + and wcrtomb(), wcsrtombs(). + We assume that + - sizeof (mbstate_t) >= 4, + - only stateless encodings are supported (such as UTF-8 and EUC-JP, but + not ISO-2022 variants), + - for each encoding, the number of bytes for a wide character is <= 4. + (This maximum is attained for UTF-8, GB18030, EUC-TW.) + We define the meaning of mbstate_t as follows: + - In mb -> wc direction, mbstate_t's first byte contains the number of + buffered bytes (in the range 0..3), followed by up to 3 buffered bytes. + - In wc -> mb direction, mbstate_t contains no information. In other + words, it is always in the initial state. */ + +verify (sizeof (mbstate_t) >= 4); + +int +mbsinit (const mbstate_t *ps) +{ + const char *pstate = (const char *)ps; + + return pstate[0] == 0; +} diff -ruNp m4-1.4.12/lib/memchr.c m4-1.4.13/lib/memchr.c --- m4-1.4.12/lib/memchr.c 2008-08-05 07:16:31.000000000 -0600 +++ m4-1.4.13/lib/memchr.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,172 +0,0 @@ -/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2006, 2008 - Free Software Foundation, Inc. - - Based on strlen implementation by Torbjorn Granlund (tege@sics.se), - with help from Dan Sahlin (dan@sics.se) and - commentary by Jim Blandy (jimb@ai.mit.edu); - adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), - and implemented by Roland McGrath (roland@ai.mit.edu). - -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 3 of the License, or any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -#ifndef _LIBC -# include <config.h> -#endif - -#include <string.h> - -#include <stddef.h> - -#if defined _LIBC -# include <memcopy.h> -#else -# define reg_char char -#endif - -#include <limits.h> - -#if HAVE_BP_SYM_H || defined _LIBC -# include <bp-sym.h> -#else -# define BP_SYM(sym) sym -#endif - -#undef __memchr -#ifdef _LIBC -# undef memchr -#endif - -#ifndef weak_alias -# define __memchr memchr -#endif - -/* Search no more than N bytes of S for C. */ -void * -__memchr (void const *s, int c_in, size_t n) -{ - /* On 32-bit hardware, choosing longword to be a 32-bit unsigned - long instead of a 64-bit uintmax_t tends to give better - performance. On 64-bit hardware, unsigned long is generally 64 - bits already. Change this typedef to experiment with - performance. */ - typedef unsigned long int longword; - - const unsigned char *char_ptr; - const longword *longword_ptr; - longword repeated_one; - longword repeated_c; - unsigned reg_char c; - - c = (unsigned char) c_in; - - /* Handle the first few bytes by reading one byte at a time. - Do this until CHAR_PTR is aligned on a longword boundary. */ - for (char_ptr = (const unsigned char *) s; - n > 0 && (size_t) char_ptr % sizeof (longword) != 0; - --n, ++char_ptr) - if (*char_ptr == c) - return (void *) char_ptr; - - longword_ptr = (const longword *) char_ptr; - - /* All these elucidatory comments refer to 4-byte longwords, - but the theory applies equally well to any size longwords. */ - - /* Compute auxiliary longword values: - repeated_one is a value which has a 1 in every byte. - repeated_c has c in every byte. */ - repeated_one = 0x01010101; - repeated_c = c | (c << 8); - repeated_c |= repeated_c << 16; - if (0xffffffffU < (longword) -1) - { - repeated_one |= repeated_one << 31 << 1; - repeated_c |= repeated_c << 31 << 1; - if (8 < sizeof (longword)) - { - size_t i; - - for (i = 64; i < sizeof (longword) * 8; i *= 2) - { - repeated_one |= repeated_one << i; - repeated_c |= repeated_c << i; - } - } - } - - /* Instead of the traditional loop which tests each byte, we will test a - longword at a time. The tricky part is testing if *any of the four* - bytes in the longword in question are equal to c. We first use an xor - with repeated_c. This reduces the task to testing whether *any of the - four* bytes in longword1 is zero. - - We compute tmp = - ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). - That is, we perform the following operations: - 1. Subtract repeated_one. - 2. & ~longword1. - 3. & a mask consisting of 0x80 in every byte. - Consider what happens in each byte: - - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, - and step 3 transforms it into 0x80. A carry can also be propagated - to more significant bytes. - - If a byte of longword1 is nonzero, let its lowest 1 bit be at - position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, - the byte ends in a single bit of value 0 and k bits of value 1. - After step 2, the result is just k bits of value 1: 2^k - 1. After - step 3, the result is 0. And no carry is produced. - So, if longword1 has only non-zero bytes, tmp is zero. - Whereas if longword1 has a zero byte, call j the position of the least - significant zero byte. Then the result has a zero at positions 0, ..., - j-1 and a 0x80 at position j. We cannot predict the result at the more - significant bytes (positions j+1..3), but it does not matter since we - already have a non-zero bit at position 8*j+7. - - So, the test whether any byte in longword1 is zero is equivalent to - testing whether tmp is nonzero. */ - - while (n >= sizeof (longword)) - { - longword longword1 = *longword_ptr ^ repeated_c; - - if ((((longword1 - repeated_one) & ~longword1) - & (repeated_one << 7)) != 0) - break; - longword_ptr++; - n -= sizeof (longword); - } - - char_ptr = (const unsigned char *) longword_ptr; - - /* At this point, we know that either n < sizeof (longword), or one of the - sizeof (longword) bytes starting at char_ptr is == c. On little-endian - machines, we could determine the first such byte without any further - memory accesses, just by looking at the tmp result from the last loop - iteration. But this does not work on big-endian machines. Choose code - that works in both cases. */ - - for (; n > 0; --n, ++char_ptr) - { - if (*char_ptr == c) - return (void *) char_ptr; - } - - return NULL; -} -#ifdef weak_alias -weak_alias (__memchr, BP_SYM (memchr)) -#endif diff -ruNp m4-1.4.12/lib/memchr2.c m4-1.4.13/lib/memchr2.c --- m4-1.4.12/lib/memchr2.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/memchr2.c 2009-02-18 19:13:15.000000000 -0700 @@ -0,0 +1,164 @@ +/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2006, + 2008 Free Software Foundation, Inc. + + Based on strlen implementation by Torbjorn Granlund (tege@sics.se), + with help from Dan Sahlin (dan@sics.se) and + commentary by Jim Blandy (jimb@ai.mit.edu); + adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), + and implemented in glibc by Roland McGrath (roland@ai.mit.edu). + Extension to memchr2 implemented by Eric Blake (ebb9@byu.net). + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "memchr2.h" + +#include <limits.h> +#include <stdint.h> +#include <string.h> + +/* Return the first address of either C1 or C2 (treated as unsigned + char) that occurs within N bytes of the memory region S. If + neither byte appears, return NULL. */ +void * +memchr2 (void const *s, int c1_in, int c2_in, size_t n) +{ + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + + const unsigned char *char_ptr; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c1; + longword repeated_c2; + unsigned char c1; + unsigned char c2; + + c1 = (unsigned char) c1_in; + c2 = (unsigned char) c2_in; + + if (c1 == c2) + return memchr (s, c1, n); + + /* Handle the first few bytes by reading one byte at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = (const unsigned char *) s; + n > 0 && (size_t) char_ptr % sizeof (longword) != 0; + --n, ++char_ptr) + if (*char_ptr == c1 || *char_ptr == c2) + return (void *) char_ptr; + + longword_ptr = (const longword *) char_ptr; + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to any size longwords. */ + + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c1 has c1 in every byte. + repeated_c2 has c2 in every byte. */ + repeated_one = 0x01010101; + repeated_c1 = c1 | (c1 << 8); + repeated_c2 = c2 | (c2 << 8); + repeated_c1 |= repeated_c1 << 16; + repeated_c2 |= repeated_c2 << 16; + if (0xffffffffU < (longword) -1) + { + repeated_one |= repeated_one << 31 << 1; + repeated_c1 |= repeated_c1 << 31 << 1; + repeated_c2 |= repeated_c2 << 31 << 1; + if (8 < sizeof (longword)) + { + size_t i; + + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c1 |= repeated_c1 << i; + repeated_c2 |= repeated_c2 << i; + } + } + } + + /* Instead of the traditional loop which tests each byte, we will test a + longword at a time. The tricky part is testing if *any of the four* + bytes in the longword in question are equal to c1 or c2. We first use + an xor with repeated_c1 and repeated_c2, respectively. This reduces + the task to testing whether *any of the four* bytes in longword1 or + longword2 is zero. + + Let's consider longword1. We compute tmp1 = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp1 is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + Similary, we compute tmp2 = + ((longword2 - repeated_one) & ~longword2) & (repeated_one << 7). + + The test whether any byte in longword1 or longword2 is zero is equivalent + to testing whether tmp1 is nonzero or tmp2 is nonzero. We can combine + this into a single test, whether (tmp1 | tmp2) is nonzero. */ + + while (n >= sizeof (longword)) + { + longword longword1 = *longword_ptr ^ repeated_c1; + longword longword2 = *longword_ptr ^ repeated_c2; + + if (((((longword1 - repeated_one) & ~longword1) + | ((longword2 - repeated_one) & ~longword2)) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + n -= sizeof (longword); + } + + char_ptr = (const unsigned char *) longword_ptr; + + /* At this point, we know that either n < sizeof (longword), or one of the + sizeof (longword) bytes starting at char_ptr is == c1 or == c2. On + little-endian machines, we could determine the first such byte without + any further memory accesses, just by looking at the (tmp1 | tmp2) result + from the last loop iteration. But this does not work on big-endian + machines. Choose code that works in both cases. */ + + for (; n > 0; --n, ++char_ptr) + { + if (*char_ptr == c1 || *char_ptr == c2) + return (void *) char_ptr; + } + + return NULL; +} diff -ruNp m4-1.4.12/lib/memchr2.h m4-1.4.13/lib/memchr2.h --- m4-1.4.12/lib/memchr2.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/memchr2.h 2009-02-18 19:13:15.000000000 -0700 @@ -0,0 +1,31 @@ +/* Scan memory for the first of two bytes. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return the first address of either C1 or C2 (treated as unsigned + char) that occurs within N bytes of the memory region S. If + neither byte appears, return NULL. */ + +extern void *memchr2 (void const *s, int c1, int c2, size_t n); + +#ifdef __cplusplus +} +#endif diff -ruNp m4-1.4.12/lib/memcmp.c m4-1.4.13/lib/memcmp.c --- m4-1.4.12/lib/memcmp.c 2008-08-05 07:16:32.000000000 -0600 +++ m4-1.4.13/lib/memcmp.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,361 +0,0 @@ -/* Copyright (C) 1991, 1993, 1995, 1997, 1998, 2003, 2006 Free Software - Foundation, Inc. - - Contributed by Torbjorn Granlund (tege@sics.se). - - 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 3 of the License, or any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -#ifndef _LIBC -# include <config.h> -#endif - -#include <string.h> - -#undef memcmp - -#ifdef _LIBC - -# include <memcopy.h> -# include <endian.h> - -# if __BYTE_ORDER == __BIG_ENDIAN -# define WORDS_BIGENDIAN -# endif - -#else /* Not in the GNU C library. */ - -# include <sys/types.h> - -/* Type to use for aligned memory operations. - This should normally be the biggest type supported by a single load - and store. Must be an unsigned type. */ -# define op_t unsigned long int -# define OPSIZ (sizeof(op_t)) - -/* Threshold value for when to enter the unrolled loops. */ -# define OP_T_THRES 16 - -/* Type to use for unaligned operations. */ -typedef unsigned char byte; - -# ifndef WORDS_BIGENDIAN -# define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2))) -# else -# define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2))) -# endif - -#endif /* In the GNU C library. */ - -#ifdef WORDS_BIGENDIAN -# define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1) -#else -# define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b)) -#endif - -/* BE VERY CAREFUL IF YOU CHANGE THIS CODE! */ - -/* The strategy of this memcmp is: - - 1. Compare bytes until one of the block pointers is aligned. - - 2. Compare using memcmp_common_alignment or - memcmp_not_common_alignment, regarding the alignment of the other - block after the initial byte operations. The maximum number of - full words (of type op_t) are compared in this way. - - 3. Compare the few remaining bytes. */ - -#ifndef WORDS_BIGENDIAN -/* memcmp_bytes -- Compare A and B bytewise in the byte order of the machine. - A and B are known to be different. - This is needed only on little-endian machines. */ - -# ifdef __GNUC__ -__inline -# endif -static int -memcmp_bytes (long unsigned int a, long unsigned int b) -{ - long int srcp1 = (long int) &a; - long int srcp2 = (long int) &b; - op_t a0, b0; - - do - { - a0 = ((byte *) srcp1)[0]; - b0 = ((byte *) srcp2)[0]; - srcp1 += 1; - srcp2 += 1; - } - while (a0 == b0); - return a0 - b0; -} -#endif - -/* memcmp_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN `op_t' - objects (not LEN bytes!). Both SRCP1 and SRCP2 should be aligned for - memory operations on `op_t's. */ -#ifdef __GNUC__ -__inline -#endif -static int -memcmp_common_alignment (long int srcp1, long int srcp2, size_t len) -{ - op_t a0, a1; - op_t b0, b1; - - switch (len % 4) - { - default: /* Avoid warning about uninitialized local variables. */ - case 2: - a0 = ((op_t *) srcp1)[0]; - b0 = ((op_t *) srcp2)[0]; - srcp1 -= 2 * OPSIZ; - srcp2 -= 2 * OPSIZ; - len += 2; - goto do1; - case 3: - a1 = ((op_t *) srcp1)[0]; - b1 = ((op_t *) srcp2)[0]; - srcp1 -= OPSIZ; - srcp2 -= OPSIZ; - len += 1; - goto do2; - case 0: - if (OP_T_THRES <= 3 * OPSIZ && len == 0) - return 0; - a0 = ((op_t *) srcp1)[0]; - b0 = ((op_t *) srcp2)[0]; - goto do3; - case 1: - a1 = ((op_t *) srcp1)[0]; - b1 = ((op_t *) srcp2)[0]; - srcp1 += OPSIZ; - srcp2 += OPSIZ; - len -= 1; - if (OP_T_THRES <= 3 * OPSIZ && len == 0) - goto do0; - /* Fall through. */ - } - - do - { - a0 = ((op_t *) srcp1)[0]; - b0 = ((op_t *) srcp2)[0]; - if (a1 != b1) - return CMP_LT_OR_GT (a1, b1); - - do3: - a1 = ((op_t *) srcp1)[1]; - b1 = ((op_t *) srcp2)[1]; - if (a0 != b0) - return CMP_LT_OR_GT (a0, b0); - - do2: - a0 = ((op_t *) srcp1)[2]; - b0 = ((op_t *) srcp2)[2]; - if (a1 != b1) - return CMP_LT_OR_GT (a1, b1); - - do1: - a1 = ((op_t *) srcp1)[3]; - b1 = ((op_t *) srcp2)[3]; - if (a0 != b0) - return CMP_LT_OR_GT (a0, b0); - - srcp1 += 4 * OPSIZ; - srcp2 += 4 * OPSIZ; - len -= 4; - } - while (len != 0); - - /* This is the right position for do0. Please don't move - it into the loop. */ - do0: - if (a1 != b1) - return CMP_LT_OR_GT (a1, b1); - return 0; -} - -/* memcmp_not_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN - `op_t' objects (not LEN bytes!). SRCP2 should be aligned for memory - operations on `op_t', but SRCP1 *should be unaligned*. */ -#ifdef __GNUC__ -__inline -#endif -static int -memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len) -{ - op_t a0, a1, a2, a3; - op_t b0, b1, b2, b3; - op_t x; - int shl, shr; - - /* Calculate how to shift a word read at the memory operation - aligned srcp1 to make it aligned for comparison. */ - - shl = 8 * (srcp1 % OPSIZ); - shr = 8 * OPSIZ - shl; - - /* Make SRCP1 aligned by rounding it down to the beginning of the `op_t' - it points in the middle of. */ - srcp1 &= -OPSIZ; - - switch (len % 4) - { - default: /* Avoid warning about uninitialized local variables. */ - case 2: - a1 = ((op_t *) srcp1)[0]; - a2 = ((op_t *) srcp1)[1]; - b2 = ((op_t *) srcp2)[0]; - srcp1 -= 1 * OPSIZ; - srcp2 -= 2 * OPSIZ; - len += 2; - goto do1; - case 3: - a0 = ((op_t *) srcp1)[0]; - a1 = ((op_t *) srcp1)[1]; - b1 = ((op_t *) srcp2)[0]; - srcp2 -= 1 * OPSIZ; - len += 1; - goto do2; - case 0: - if (OP_T_THRES <= 3 * OPSIZ && len == 0) - return 0; - a3 = ((op_t *) srcp1)[0]; - a0 = ((op_t *) srcp1)[1]; - b0 = ((op_t *) srcp2)[0]; - srcp1 += 1 * OPSIZ; - goto do3; - case 1: - a2 = ((op_t *) srcp1)[0]; - a3 = ((op_t *) srcp1)[1]; - b3 = ((op_t *) srcp2)[0]; - srcp1 += 2 * OPSIZ; - srcp2 += 1 * OPSIZ; - len -= 1; - if (OP_T_THRES <= 3 * OPSIZ && len == 0) - goto do0; - /* Fall through. */ - } - - do - { - a0 = ((op_t *) srcp1)[0]; - b0 = ((op_t *) srcp2)[0]; - x = MERGE(a2, shl, a3, shr); - if (x != b3) - return CMP_LT_OR_GT (x, b3); - - do3: - a1 = ((op_t *) srcp1)[1]; - b1 = ((op_t *) srcp2)[1]; - x = MERGE(a3, shl, a0, shr); - if (x != b0) - return CMP_LT_OR_GT (x, b0); - - do2: - a2 = ((op_t *) srcp1)[2]; - b2 = ((op_t *) srcp2)[2]; - x = MERGE(a0, shl, a1, shr); - if (x != b1) - return CMP_LT_OR_GT (x, b1); - - do1: - a3 = ((op_t *) srcp1)[3]; - b3 = ((op_t *) srcp2)[3]; - x = MERGE(a1, shl, a2, shr); - if (x != b2) - return CMP_LT_OR_GT (x, b2); - - srcp1 += 4 * OPSIZ; - srcp2 += 4 * OPSIZ; - len -= 4; - } - while (len != 0); - - /* This is the right position for do0. Please don't move - it into the loop. */ - do0: - x = MERGE(a2, shl, a3, shr); - if (x != b3) - return CMP_LT_OR_GT (x, b3); - return 0; -} - -int -rpl_memcmp (const void *s1, const void *s2, size_t len) -{ - op_t a0; - op_t b0; - long int srcp1 = (long int) s1; - long int srcp2 = (long int) s2; - op_t res; - - if (len >= OP_T_THRES) - { - /* There are at least some bytes to compare. No need to test - for LEN == 0 in this alignment loop. */ - while (srcp2 % OPSIZ != 0) - { - a0 = ((byte *) srcp1)[0]; - b0 = ((byte *) srcp2)[0]; - srcp1 += 1; - srcp2 += 1; - res = a0 - b0; - if (res != 0) - return res; - len -= 1; - } - - /* SRCP2 is now aligned for memory operations on `op_t'. - SRCP1 alignment determines if we can do a simple, - aligned compare or need to shuffle bits. */ - - if (srcp1 % OPSIZ == 0) - res = memcmp_common_alignment (srcp1, srcp2, len / OPSIZ); - else - res = memcmp_not_common_alignment (srcp1, srcp2, len / OPSIZ); - if (res != 0) - return res; - - /* Number of bytes remaining in the interval [0..OPSIZ-1]. */ - srcp1 += len & -OPSIZ; - srcp2 += len & -OPSIZ; - len %= OPSIZ; - } - - /* There are just a few bytes to compare. Use byte memory operations. */ - while (len != 0) - { - a0 = ((byte *) srcp1)[0]; - b0 = ((byte *) srcp2)[0]; - srcp1 += 1; - srcp2 += 1; - res = a0 - b0; - if (res != 0) - return res; - len -= 1; - } - - return 0; -} - -#ifdef weak_alias -# undef bcmp -weak_alias (memcmp, bcmp) -#endif diff -ruNp m4-1.4.12/lib/memset.c m4-1.4.13/lib/memset.c --- m4-1.4.12/lib/memset.c 2008-08-06 23:55:59.000000000 -0600 +++ m4-1.4.13/lib/memset.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,28 +0,0 @@ -/* memset.c -- set an area of memory to a given value - Copyright (C) 1991, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include <stddef.h> - -void * -memset (void *str, int c, size_t len) -{ - register char *st = str; - - while (len-- > 0) - *st++ = c; - return str; -} diff -ruNp m4-1.4.12/lib/pathmax.h m4-1.4.13/lib/pathmax.h --- m4-1.4.12/lib/pathmax.h 2008-02-23 10:29:50.000000000 -0700 +++ m4-1.4.13/lib/pathmax.h 2009-03-23 05:55:41.000000000 -0600 @@ -1,5 +1,5 @@ /* Define PATH_MAX somehow. Requires sys/types.h. - Copyright (C) 1992, 1999, 2001, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ # define _POSIX_PATH_MAX 256 # endif -# if !defined PATH_MAX && defined _PC_PATH_MAX +# if !defined PATH_MAX && defined _PC_PATH_MAX && defined HAVE_PATHCONF # define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \ : pathconf ("/", _PC_PATH_MAX)) # endif diff -ruNp m4-1.4.12/lib/pipe.c m4-1.4.13/lib/pipe.c --- m4-1.4.12/lib/pipe.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/pipe.c 2009-03-08 20:14:46.000000000 -0600 @@ -0,0 +1,451 @@ +/* Creation of subprocesses, communicating via pipes. + Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + +#include <config.h> + +/* Specification. */ +#include "pipe.h" + +#include <errno.h> +#include <fcntl.h> +#include <stdlib.h> +#include <signal.h> +#include <unistd.h> + +#include "error.h" +#include "fatal-signal.h" +#include "unistd-safer.h" +#include "wait-process.h" +#include "gettext.h" + +#define _(str) gettext (str) + +#if defined _MSC_VER || defined __MINGW32__ + +/* Native Woe32 API. */ +# include <process.h> +# include "w32spawn.h" + +#else + +/* Unix API. */ +# include <spawn.h> + +#endif + +/* The results of open() in this file are not used with fchdir, + therefore save some unnecessary work in fchdir.c. */ +#undef open +#undef close + + +#ifdef EINTR + +/* EINTR handling for close(). + These functions can return -1/EINTR even though we don't have any + signal handlers set up, namely when we get interrupted via SIGSTOP. */ + +static inline int +nonintr_close (int fd) +{ + int retval; + + do + retval = close (fd); + while (retval < 0 && errno == EINTR); + + return retval; +} +#define close nonintr_close + +static inline int +nonintr_open (const char *pathname, int oflag, mode_t mode) +{ + int retval; + + do + retval = open (pathname, oflag, mode); + while (retval < 0 && errno == EINTR); + + return retval; +} +#undef open /* avoid warning on VMS */ +#define open nonintr_open + +#endif + + +/* Open a pipe connected to a child process. + * + * write system read + * parent -> fd[1] -> STDIN_FILENO -> child if pipe_stdin + * parent <- fd[0] <- STDOUT_FILENO <- child if pipe_stdout + * read system write + * + * At least one of pipe_stdin, pipe_stdout must be true. + * pipe_stdin and prog_stdin together determine the child's standard input. + * pipe_stdout and prog_stdout together determine the child's standard output. + * If pipe_stdin is true, prog_stdin is ignored. + * If pipe_stdout is true, prog_stdout is ignored. + */ +static pid_t +create_pipe (const char *progname, + const char *prog_path, char **prog_argv, + bool pipe_stdin, bool pipe_stdout, + const char *prog_stdin, const char *prog_stdout, + bool null_stderr, + bool slave_process, bool exit_on_error, + int fd[2]) +{ +#if defined _MSC_VER || defined __MINGW32__ + + /* Native Woe32 API. + This uses _pipe(), dup2(), and spawnv(). It could also be implemented + using the low-level functions CreatePipe(), DuplicateHandle(), + CreateProcess() and _open_osfhandle(); see the GNU make and GNU clisp + and cvs source code. */ + int ifd[2]; + int ofd[2]; + int orig_stdin; + int orig_stdout; + int orig_stderr; + int child; + int nulloutfd; + int stdinfd; + int stdoutfd; + + /* FIXME: Need to free memory allocated by prepare_spawn. */ + prog_argv = prepare_spawn (prog_argv); + + if (pipe_stdout) + if (_pipe (ifd, 4096, O_BINARY | O_NOINHERIT) < 0 + || (ifd[0] = fd_safer (ifd[0])) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + if (pipe_stdin) + if (_pipe (ofd, 4096, O_BINARY | O_NOINHERIT) < 0 + || (ofd[1] = fd_safer (ofd[1])) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); +/* Data flow diagram: + * + * write system read + * parent -> ofd[1] -> ofd[0] -> child if pipe_stdin + * parent <- ifd[0] <- ifd[1] <- child if pipe_stdout + * read system write + * + */ + + /* Save standard file handles of parent process. */ + if (pipe_stdin || prog_stdin != NULL) + orig_stdin = dup_noinherit (STDIN_FILENO); + if (pipe_stdout || prog_stdout != NULL) + orig_stdout = dup_noinherit (STDOUT_FILENO); + if (null_stderr) + orig_stderr = dup_noinherit (STDERR_FILENO); + child = -1; + + /* Create standard file handles of child process. */ + nulloutfd = -1; + stdinfd = -1; + stdoutfd = -1; + if ((!pipe_stdin || dup2 (ofd[0], STDIN_FILENO) >= 0) + && (!pipe_stdout || dup2 (ifd[1], STDOUT_FILENO) >= 0) + && (!null_stderr + || ((nulloutfd = open ("NUL", O_RDWR, 0)) >= 0 + && (nulloutfd == STDERR_FILENO + || (dup2 (nulloutfd, STDERR_FILENO) >= 0 + && close (nulloutfd) >= 0)))) + && (pipe_stdin + || prog_stdin == NULL + || ((stdinfd = open (prog_stdin, O_RDONLY, 0)) >= 0 + && (stdinfd == STDIN_FILENO + || (dup2 (stdinfd, STDIN_FILENO) >= 0 + && close (stdinfd) >= 0)))) + && (pipe_stdout + || prog_stdout == NULL + || ((stdoutfd = open (prog_stdout, O_WRONLY, 0)) >= 0 + && (stdoutfd == STDOUT_FILENO + || (dup2 (stdoutfd, STDOUT_FILENO) >= 0 + && close (stdoutfd) >= 0))))) + /* The child process doesn't inherit ifd[0], ifd[1], ofd[0], ofd[1], + but it inherits all open()ed or dup2()ed file handles (which is what + we want in the case of STD*_FILENO) and also orig_stdin, + orig_stdout, orig_stderr (which is not explicitly wanted but + harmless). */ + /* Use spawnvpe and pass the environment explicitly. This is needed if + the program has modified the environment using putenv() or [un]setenv(). + On Windows, programs have two environments, one in the "environment + block" of the process and managed through SetEnvironmentVariable(), and + one inside the process, in the location retrieved by the 'environ' + macro. When using spawnvp() without 'e', the child process inherits a + copy of the environment block - ignoring the effects of putenv() and + [un]setenv(). */ + { + child = spawnvpe (P_NOWAIT, prog_path, (const char **) prog_argv, + (const char **) environ); + if (child < 0 && errno == ENOEXEC) + { + /* prog is not an native executable. Try to execute it as a + shell script. Note that prepare_spawn() has already prepended + a hidden element "sh.exe" to prog_argv. */ + --prog_argv; + child = spawnvpe (P_NOWAIT, prog_argv[0], (const char **) prog_argv, + (const char **) environ); + } + } + if (stdinfd >= 0) + close (stdinfd); + if (stdoutfd >= 0) + close (stdoutfd); + if (nulloutfd >= 0) + close (nulloutfd); + + /* Restore standard file handles of parent process. */ + if (null_stderr) + dup2 (orig_stderr, STDERR_FILENO), close (orig_stderr); + if (pipe_stdout || prog_stdout != NULL) + dup2 (orig_stdout, STDOUT_FILENO), close (orig_stdout); + if (pipe_stdin || prog_stdin != NULL) + dup2 (orig_stdin, STDIN_FILENO), close (orig_stdin); + + if (pipe_stdin) + close (ofd[0]); + if (pipe_stdout) + close (ifd[1]); + if (child == -1) + { + if (exit_on_error || !null_stderr) + error (exit_on_error ? EXIT_FAILURE : 0, errno, + _("%s subprocess failed"), progname); + if (pipe_stdout) + close (ifd[0]); + if (pipe_stdin) + close (ofd[1]); + return -1; + } + + if (pipe_stdout) + fd[0] = ifd[0]; + if (pipe_stdin) + fd[1] = ofd[1]; + return child; + +#else + + /* Unix API. */ + int ifd[2]; + int ofd[2]; + sigset_t blocked_signals; + posix_spawn_file_actions_t actions; + bool actions_allocated; + posix_spawnattr_t attrs; + bool attrs_allocated; + int err; + pid_t child; + + if (pipe_stdout) + if (pipe (ifd) < 0 + || (ifd[0] = fd_safer (ifd[0])) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + if (pipe_stdin) + if (pipe (ofd) < 0 + || (ofd[1] = fd_safer (ofd[1])) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); +/* Data flow diagram: + * + * write system read + * parent -> ofd[1] -> ofd[0] -> child if pipe_stdin + * parent <- ifd[0] <- ifd[1] <- child if pipe_stdout + * read system write + * + */ + + if (slave_process) + { + sigprocmask (SIG_SETMASK, NULL, &blocked_signals); + block_fatal_signals (); + } + actions_allocated = false; + attrs_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (pipe_stdin + && (err = posix_spawn_file_actions_adddup2 (&actions, + ofd[0], STDIN_FILENO)) + != 0) + || (pipe_stdout + && (err = posix_spawn_file_actions_adddup2 (&actions, + ifd[1], STDOUT_FILENO)) + != 0) + || (pipe_stdin + && (err = posix_spawn_file_actions_addclose (&actions, ofd[0])) + != 0) + || (pipe_stdout + && (err = posix_spawn_file_actions_addclose (&actions, ifd[1])) + != 0) + || (pipe_stdin + && (err = posix_spawn_file_actions_addclose (&actions, ofd[1])) + != 0) + || (pipe_stdout + && (err = posix_spawn_file_actions_addclose (&actions, ifd[0])) + != 0) + || (null_stderr + && (err = posix_spawn_file_actions_addopen (&actions, + STDERR_FILENO, + "/dev/null", O_RDWR, + 0)) + != 0) + || (!pipe_stdin + && prog_stdin != NULL + && (err = posix_spawn_file_actions_addopen (&actions, + STDIN_FILENO, + prog_stdin, O_RDONLY, + 0)) + != 0) + || (!pipe_stdout + && prog_stdout != NULL + && (err = posix_spawn_file_actions_addopen (&actions, + STDOUT_FILENO, + prog_stdout, O_WRONLY, + 0)) + != 0) + || (slave_process + && ((err = posix_spawnattr_init (&attrs)) != 0 + || (attrs_allocated = true, + (err = posix_spawnattr_setsigmask (&attrs, + &blocked_signals)) + != 0 + || (err = posix_spawnattr_setflags (&attrs, + POSIX_SPAWN_SETSIGMASK)) + != 0))) + || (err = posix_spawnp (&child, prog_path, &actions, + attrs_allocated ? &attrs : NULL, prog_argv, + environ)) + != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + if (attrs_allocated) + posix_spawnattr_destroy (&attrs); + if (slave_process) + unblock_fatal_signals (); + if (exit_on_error || !null_stderr) + error (exit_on_error ? EXIT_FAILURE : 0, err, + _("%s subprocess failed"), progname); + if (pipe_stdout) + { + close (ifd[0]); + close (ifd[1]); + } + if (pipe_stdin) + { + close (ofd[0]); + close (ofd[1]); + } + return -1; + } + posix_spawn_file_actions_destroy (&actions); + if (attrs_allocated) + posix_spawnattr_destroy (&attrs); + if (slave_process) + { + register_slave_subprocess (child); + unblock_fatal_signals (); + } + if (pipe_stdin) + close (ofd[0]); + if (pipe_stdout) + close (ifd[1]); + + if (pipe_stdout) + fd[0] = ifd[0]; + if (pipe_stdin) + fd[1] = ofd[1]; + return child; + +#endif +} + +/* Open a bidirectional pipe. + * + * write system read + * parent -> fd[1] -> STDIN_FILENO -> child + * parent <- fd[0] <- STDOUT_FILENO <- child + * read system write + * + */ +pid_t +create_pipe_bidi (const char *progname, + const char *prog_path, char **prog_argv, + bool null_stderr, + bool slave_process, bool exit_on_error, + int fd[2]) +{ + pid_t result = create_pipe (progname, prog_path, prog_argv, + true, true, NULL, NULL, + null_stderr, slave_process, exit_on_error, + fd); + return result; +} + +/* Open a pipe for input from a child process. + * The child's stdin comes from a file. + * + * read system write + * parent <- fd[0] <- STDOUT_FILENO <- child + * + */ +pid_t +create_pipe_in (const char *progname, + const char *prog_path, char **prog_argv, + const char *prog_stdin, bool null_stderr, + bool slave_process, bool exit_on_error, + int fd[1]) +{ + int iofd[2]; + pid_t result = create_pipe (progname, prog_path, prog_argv, + false, true, prog_stdin, NULL, + null_stderr, slave_process, exit_on_error, + iofd); + if (result != -1) + fd[0] = iofd[0]; + return result; +} + +/* Open a pipe for output to a child process. + * The child's stdout goes to a file. + * + * write system read + * parent -> fd[0] -> STDIN_FILENO -> child + * + */ +pid_t +create_pipe_out (const char *progname, + const char *prog_path, char **prog_argv, + const char *prog_stdout, bool null_stderr, + bool slave_process, bool exit_on_error, + int fd[1]) +{ + int iofd[2]; + pid_t result = create_pipe (progname, prog_path, prog_argv, + true, false, NULL, prog_stdout, + null_stderr, slave_process, exit_on_error, + iofd); + if (result != -1) + fd[0] = iofd[1]; + return result; +} diff -ruNp m4-1.4.12/lib/pipe.h m4-1.4.13/lib/pipe.h --- m4-1.4.12/lib/pipe.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/pipe.h 2009-03-02 06:04:40.000000000 -0700 @@ -0,0 +1,134 @@ +/* Creation of subprocesses, communicating via pipes. + Copyright (C) 2001-2003, 2006, 2008 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _PIPE_H +#define _PIPE_H + +/* Get pid_t. */ +#include <stdlib.h> +#include <unistd.h> +#include <sys/types.h> + +#include <stdbool.h> + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* All these functions create a subprocess and don't wait for its termination. + They return the process id of the subprocess. They also return in fd[] + one or two file descriptors for communication with the subprocess. + If the subprocess creation fails: if exit_on_error is true, the main + process exits with an error message; otherwise, an error message is given + if null_stderr is false, then -1 is returned and fd[] remain uninitialized. + + After finishing communication, the caller should call wait_subprocess() + to get rid of the subprocess in the process table. + + If slave_process is true, the child process will be terminated when its + creator receives a catchable fatal signal or exits normally. If + slave_process is false, the child process will continue running in this + case, until it is lucky enough to attempt to communicate with its creator + and thus get a SIGPIPE signal. + + If exit_on_error is false, a child process id of -1 should be treated the + same way as a subprocess which accepts no input, produces no output and + terminates with exit code 127. Why? Some errors during posix_spawnp() + cause the function posix_spawnp() to return an error code; some other + errors cause the subprocess to exit with return code 127. It is + implementation dependent which error is reported which way. The caller + must treat both cases as equivalent. + + It is recommended that no signal is blocked or ignored (i.e. have a + signal handler with value SIG_IGN) while any of these functions is called. + The reason is that child processes inherit the mask of blocked signals + from their parent (both through posix_spawn() and fork()/exec()); + likewise, signals ignored in the parent are also ignored in the child + (except possibly for SIGCHLD). And POSIX:2001 says [in the description + of exec()]: + "it should be noted that many existing applications wrongly + assume that they start with certain signals set to the default + action and/or unblocked. In particular, applications written + with a simpler signal model that does not include blocking of + signals, such as the one in the ISO C standard, may not behave + properly if invoked with some signals blocked. Therefore, it is + best not to block or ignore signals across execs without explicit + reason to do so, and especially not to block signals across execs + of arbitrary (not closely co-operating) programs." */ + +/* Open a pipe for output to a child process. + * The child's stdout goes to a file. + * + * write system read + * parent -> fd[0] -> STDIN_FILENO -> child + * + * Note: When writing to a child process, it is useful to ignore the SIGPIPE + * signal and the EPIPE error code. + */ +extern pid_t create_pipe_out (const char *progname, + const char *prog_path, char **prog_argv, + const char *prog_stdout, bool null_stderr, + bool slave_process, bool exit_on_error, + int fd[1]); + +/* Open a pipe for input from a child process. + * The child's stdin comes from a file. + * + * read system write + * parent <- fd[0] <- STDOUT_FILENO <- child + * + */ +extern pid_t create_pipe_in (const char *progname, + const char *prog_path, char **prog_argv, + const char *prog_stdin, bool null_stderr, + bool slave_process, bool exit_on_error, + int fd[1]); + +/* Open a bidirectional pipe. + * + * write system read + * parent -> fd[1] -> STDIN_FILENO -> child + * parent <- fd[0] <- STDOUT_FILENO <- child + * read system write + * + * Note: When writing to a child process, it is useful to ignore the SIGPIPE + * signal and the EPIPE error code. + */ +extern pid_t create_pipe_bidi (const char *progname, + const char *prog_path, char **prog_argv, + bool null_stderr, + bool slave_process, bool exit_on_error, + int fd[2]); + +/* The name of the "always silent" device. */ +#if defined _MSC_VER || defined __MINGW32__ +/* Native Woe32 API. */ +# define DEV_NULL "NUL" +#else +/* Unix API. */ +# define DEV_NULL "/dev/null" +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* _PIPE_H */ diff -ruNp m4-1.4.12/lib/progname.c m4-1.4.13/lib/progname.c --- m4-1.4.12/lib/progname.c 2008-08-06 07:30:09.000000000 -0600 +++ m4-1.4.13/lib/progname.c 2009-01-16 06:26:12.000000000 -0700 @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2003, 2005-2008 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software: you can redistribute it and/or modify @@ -35,6 +35,8 @@ set_program_name (const char *argv0) { /* libtool creates a temporary executable whose name is sometimes prefixed with "lt-" (depends on the platform). It also makes argv[0] absolute. + But the name of the temporary executable is a detail that should not be + visible to the end user and to the test suite. Remove this "<dirname>/.libs/" or "<dirname>/.libs/lt-" prefix here. */ const char *slash; const char *base; @@ -47,5 +49,15 @@ set_program_name (const char *argv0) if (strncmp (base, "lt-", 3) == 0) argv0 = base + 3; } + + /* But don't strip off a leading <dirname>/ in general, because when the user + runs + /some/hidden/place/bin/cp foo foo + he should get the error message + /some/hidden/place/bin/cp: `foo' and `foo' are the same file + not + cp: `foo' and `foo' are the same file + */ + program_name = argv0; } diff -ruNp m4-1.4.12/lib/quotearg.c m4-1.4.13/lib/quotearg.c --- m4-1.4.12/lib/quotearg.c 2008-02-23 10:29:52.000000000 -0700 +++ m4-1.4.13/lib/quotearg.c 2008-12-24 06:20:55.000000000 -0700 @@ -37,23 +37,6 @@ #define _(msgid) gettext (msgid) #define N_(msgid) msgid -#if !HAVE_MBRTOWC -/* Disable multibyte processing entirely. Since MB_CUR_MAX is 1, the - other macros are defined only for documentation and to satisfy C - syntax. */ -# undef MB_CUR_MAX -# define MB_CUR_MAX 1 -# undef mbstate_t -# define mbstate_t int -# define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0) -# define iswprint(wc) isprint ((unsigned char) (wc)) -# undef HAVE_MBSINIT -#endif - -#if !defined mbsinit && !HAVE_MBSINIT -# define mbsinit(ps) 1 -#endif - #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif diff -ruNp m4-1.4.12/lib/raise.c m4-1.4.13/lib/raise.c --- m4-1.4.12/lib/raise.c 2008-08-05 07:16:32.000000000 -0600 +++ m4-1.4.13/lib/raise.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,30 +0,0 @@ -/* Provide a non-threads replacement for the POSIX raise function. - - Copyright (C) 2002, 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* written by Jim Meyering */ - -#include <config.h> - -#include <sys/types.h> -#include <signal.h> -#include <unistd.h> - -int -raise (int sig) -{ - return kill (getpid (), sig); -} diff -ruNp m4-1.4.12/lib/rawmemchr.c m4-1.4.13/lib/rawmemchr.c --- m4-1.4.12/lib/rawmemchr.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/rawmemchr.c 2009-02-28 08:25:54.000000000 -0700 @@ -0,0 +1,136 @@ +/* Searching in a string. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <string.h> + +/* Find the first occurrence of C in S. */ +void * +rawmemchr (const void *s, int c_in) +{ + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + + const unsigned char *char_ptr; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c; + unsigned char c; + + c = (unsigned char) c_in; + + /* Handle the first few bytes by reading one byte at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = (const unsigned char *) s; + (size_t) char_ptr % sizeof (longword) != 0; + ++char_ptr) + if (*char_ptr == c) + return (void *) char_ptr; + + longword_ptr = (const longword *) char_ptr; + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to any size longwords. */ + + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c has c in every byte. */ + repeated_one = 0x01010101; + repeated_c = c | (c << 8); + repeated_c |= repeated_c << 16; + if (0xffffffffU < (longword) -1) + { + repeated_one |= repeated_one << 31 << 1; + repeated_c |= repeated_c << 31 << 1; + if (8 < sizeof (longword)) + { + size_t i; + + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c |= repeated_c << i; + } + } + } + + /* Instead of the traditional loop which tests each byte, we will + test a longword at a time. The tricky part is testing if *any of + the four* bytes in the longword in question are equal to NUL or + c. We first use an xor with repeated_c. This reduces the task + to testing whether *any of the four* bytes in longword1 is zero. + + We compute tmp = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + The test whether any byte in longword1 is zero is equivalent + to testing whether tmp is nonzero. + + This test can read beyond the end of a string, depending on where + C_IN is encountered. However, this is considered safe since the + initialization phase ensured that the read will be aligned, + therefore, the read will not cross page boundaries and will not + cause a fault. */ + + while (1) + { + longword longword1 = *longword_ptr ^ repeated_c; + + if ((((longword1 - repeated_one) & ~longword1) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + } + + char_ptr = (const unsigned char *) longword_ptr; + + /* At this point, we know that one of the sizeof (longword) bytes + starting at char_ptr is == c. On little-endian machines, we + could determine the first such byte without any further memory + accesses, just by looking at the tmp result from the last loop + iteration. But this does not work on big-endian machines. + Choose code that works in both cases. */ + + char_ptr = (unsigned char *) longword_ptr; + while (*char_ptr != c) + char_ptr++; + return (void *) char_ptr; +} diff -ruNp m4-1.4.12/lib/rawmemchr.valgrind m4-1.4.13/lib/rawmemchr.valgrind --- m4-1.4.12/lib/rawmemchr.valgrind 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/rawmemchr.valgrind 2009-02-28 08:25:54.000000000 -0700 @@ -0,0 +1,12 @@ +# Suppress a valgrind message about use of uninitialized memory in rawmemchr(). +# This use is OK because it provides only a speedup. +{ + rawmemchr-value4 + Memcheck:Value4 + fun:rawmemchr +} +{ + rawmemchr-value8 + Memcheck:Value8 + fun:rawmemchr +} diff -ruNp m4-1.4.12/lib/regcomp.c m4-1.4.13/lib/regcomp.c --- m4-1.4.12/lib/regcomp.c 2008-08-05 07:16:54.000000000 -0600 +++ m4-1.4.13/lib/regcomp.c 2009-01-16 06:26:13.000000000 -0700 @@ -1,5 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -333,8 +334,8 @@ re_compile_fastmap_iter (regex_t *bufp, && dfa->nodes[node].mb_partial) *p++ = dfa->nodes[node].opr.c; memset (&state, '\0', sizeof (state)); - if (mbrtowc (&wc, (const char *) buf, p - buf, - &state) == p - buf + if (__mbrtowc (&wc, (const char *) buf, p - buf, + &state) == p - buf && (__wcrtomb ((char *) buf, towlower (wc), &state) != (size_t) -1)) re_set_fastmap (fastmap, false, buf[0]); @@ -356,45 +357,65 @@ re_compile_fastmap_iter (regex_t *bufp, #ifdef RE_ENABLE_I18N else if (type == COMPLEX_BRACKET) { - Idx i; re_charset_t *cset = dfa->nodes[node].opr.mbcset; - if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes - || cset->nranges || cset->nchar_classes) - { + Idx i; + # ifdef _LIBC - if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0) + /* See if we have to try all bytes which start multiple collation + elements. + e.g. In da_DK, we want to catch 'a' since "aa" is a valid + collation element, and don't catch 'b' since 'b' is + the only collation element which starts from 'b' (and + it is caught by SIMPLE_BRACKET). */ + if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0 + && (cset->ncoll_syms || cset->nranges)) { - /* In this case we want to catch the bytes which are - the first byte of any collation elements. - e.g. In da_DK, we want to catch 'a' since "aa" - is a valid collation element, and don't catch - 'b' since 'b' is the only collation element - which starts from 'b'. */ const int32_t *table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); for (i = 0; i < SBC_MAX; ++i) if (table[i] < 0) re_set_fastmap (fastmap, icase, i); } -# else - if (dfa->mb_cur_max > 1) - for (i = 0; i < SBC_MAX; ++i) - if (__btowc (i) == WEOF) - re_set_fastmap (fastmap, icase, i); -# endif /* not _LIBC */ +# endif /* _LIBC */ + + /* See if we have to start the match at all multibyte characters, + i.e. where we would not find an invalid sequence. This only + applies to multibyte character sets; for single byte character + sets, the SIMPLE_BRACKET again suffices. */ + if (dfa->mb_cur_max > 1 + && (cset->nchar_classes || cset->non_match +# ifdef _LIBC + || cset->nequiv_classes +# endif /* _LIBC */ + )) + { + unsigned char c = 0; + do + { + mbstate_t mbs; + memset (&mbs, 0, sizeof (mbs)); + if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2) + re_set_fastmap (fastmap, false, (int) c); + } + while (++c != 0); } - for (i = 0; i < cset->nmbchars; ++i) + + else { - char buf[256]; - mbstate_t state; - memset (&state, '\0', sizeof (state)); - if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1) - re_set_fastmap (fastmap, icase, *(unsigned char *) buf); - if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) + /* ... Else catch all bytes which can start the mbchars. */ + for (i = 0; i < cset->nmbchars; ++i) { - if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state) - != (size_t) -1) - re_set_fastmap (fastmap, false, *(unsigned char *) buf); + char buf[256]; + mbstate_t state; + memset (&state, '\0', sizeof (state)); + if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1) + re_set_fastmap (fastmap, icase, *(unsigned char *) buf); + if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) + { + if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state) + != (size_t) -1) + re_set_fastmap (fastmap, false, *(unsigned char *) buf); + } } } } diff -ruNp m4-1.4.12/lib/regex_internal.c m4-1.4.13/lib/regex_internal.c --- m4-1.4.12/lib/regex_internal.c 2008-08-05 07:16:54.000000000 -0600 +++ m4-1.4.13/lib/regex_internal.c 2009-01-16 06:26:13.000000000 -0700 @@ -1,6 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software - Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -236,7 +236,7 @@ build_wcs_buffer (re_string_t *pstr) } else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx; - mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); if (BE (mbclen == (size_t) -2, 0)) { /* The buffer doesn't have enough space, finish to build. */ @@ -306,9 +306,9 @@ build_wcs_upper_buffer (re_string_t *pst remain_len = end_idx - byte_idx; prev_st = pstr->cur_state; - mbclen = mbrtowc (&wc, - ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx - + byte_idx), remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc, + ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx + + byte_idx), remain_len, &pstr->cur_state); if (BE (mbclen < (size_t) -2, 1)) { wchar_t wcu = wc; @@ -376,7 +376,7 @@ build_wcs_upper_buffer (re_string_t *pst } else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx; - mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); if (BE (mbclen < (size_t) -2, 1)) { wchar_t wcu = wc; @@ -499,8 +499,8 @@ re_string_skip_chars (re_string_t *pstr, Idx remain_len; remain_len = pstr->len - rawbuf_idx; prev_st = pstr->cur_state; - mbclen = mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, - remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, + remain_len, &pstr->cur_state); if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0)) { /* We treat these cases as a single byte character. */ @@ -687,10 +687,10 @@ re_string_reconstruct (re_string_t *pstr } else { +#ifdef RE_ENABLE_I18N /* No, skip all characters until IDX. */ Idx prev_valid_len = pstr->valid_len; -#ifdef RE_ENABLE_I18N if (BE (pstr->offsets_needed, 0)) { pstr->len = pstr->raw_len - idx + offset; @@ -745,8 +745,8 @@ re_string_reconstruct (re_string_t *pstr /* XXX Don't use mbrtowc, we know which conversion to use (UTF-8 -> UCS4). */ memset (&cur_state, 0, sizeof (cur_state)); - mbclen = mbrtowc (&wc2, (const char *) p, mlen, - &cur_state); + mbclen = __mbrtowc (&wc2, (const char *) p, mlen, + &cur_state); if (raw + offset - p <= mbclen && mbclen < (size_t) -2) { diff -ruNp m4-1.4.12/lib/regex_internal.h m4-1.4.13/lib/regex_internal.h --- m4-1.4.12/lib/regex_internal.h 2008-08-05 07:16:55.000000000 -0600 +++ m4-1.4.13/lib/regex_internal.h 2009-02-18 19:13:34.000000000 -0700 @@ -1,5 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -84,7 +85,7 @@ # define SIZE_MAX ((size_t) -1) #endif -#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC +#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCSCOLL) || _LIBC # define RE_ENABLE_I18N #endif @@ -115,6 +116,7 @@ # define __iswctype iswctype # define __btowc btowc # define __wcrtomb wcrtomb +# define __mbrtowc mbrtowc # define __regfree regfree # define attribute_hidden #endif /* not _LIBC */ @@ -182,10 +184,6 @@ typedef unsigned long int bitset_word_t; # if BITSET_WORD_BITS <= SBC_MAX # error "Invalid SBC_MAX" # endif -#elif BITSET_WORD_MAX == (0xffffffff + 2) * 0xffffffff -/* Work around a bug in 64-bit PGC (before version 6.1-2), where the - preprocessor mishandles large unsigned values as if they were signed. */ -# define BITSET_WORD_BITS 64 #else # error "Add case for new bitset_word_t size" #endif diff -ruNp m4-1.4.12/lib/regexec.c m4-1.4.13/lib/regexec.c --- m4-1.4.12/lib/regexec.c 2008-08-05 07:16:55.000000000 -0600 +++ m4-1.4.13/lib/regexec.c 2009-01-16 06:26:14.000000000 -0700 @@ -1,6 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, - Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. @@ -1045,6 +1045,11 @@ prune_impossible_nodes (re_match_context re_node_set_free (&sctx.limits); if (BE (ret != REG_NOERROR, 0)) goto free_return; + if (sifted_states[0] == NULL) + { + ret = REG_NOMATCH; + goto free_return; + } } re_free (mctx->state_log); mctx->state_log = sifted_states; @@ -3079,7 +3084,9 @@ check_arrival_add_next_nodes (re_match_c const re_dfa_t *const dfa = mctx->dfa; bool ok; Idx cur_idx; +#ifdef RE_ENABLE_I18N reg_errcode_t err = REG_NOERROR; +#endif re_node_set union_set; re_node_set_init_empty (&union_set); for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx) diff -ruNp m4-1.4.12/lib/sched.in.h m4-1.4.13/lib/sched.in.h --- m4-1.4.12/lib/sched.in.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/sched.in.h 2009-02-28 08:25:54.000000000 -0700 @@ -0,0 +1,47 @@ +/* Replacement <sched.h> for platforms that lack it. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_SCHED_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_SCHED_H@ +# @INCLUDE_NEXT@ @NEXT_SCHED_H@ +#endif + +#ifndef _GL_SCHED_H +#define _GL_SCHED_H + +#if !@HAVE_STRUCT_SCHED_PARAM@ + +struct sched_param +{ + int sched_priority; +}; + +#endif + +#if !(defined SCHED_FIFO && defined SCHED_RR && defined SCHED_OTHER) +# define SCHED_FIFO 1 +# define SCHED_RR 2 +# define SCHED_OTHER 0 +#endif + +#endif /* _GL_SCHED_H */ +#endif /* _GL_SCHED_H */ diff -ruNp m4-1.4.12/lib/sigaction.c m4-1.4.13/lib/sigaction.c --- m4-1.4.12/lib/sigaction.c 2008-08-05 07:16:32.000000000 -0600 +++ m4-1.4.13/lib/sigaction.c 2008-12-11 22:14:40.000000000 -0700 @@ -64,6 +64,14 @@ # define SIGSTOP (-1) #endif +/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias + for the signal SIGABRT. Only one signal handler is stored for both + SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef SIGABRT_COMPAT +# define SIGABRT_COMPAT 6 +#endif + /* A signal handler. */ typedef void (*handler_t) (int signal); @@ -134,6 +142,11 @@ sigaction (int sig, const struct sigacti return -1; } + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + /* POSIX requires sigaction() to be async-signal-safe. In other words, if an asynchronous signal can occur while we are anywhere inside this function, the user's handler could then call diff -ruNp m4-1.4.12/lib/signal.in.h m4-1.4.13/lib/signal.in.h --- m4-1.4.12/lib/signal.in.h 2008-09-26 06:32:24.000000000 -0600 +++ m4-1.4.13/lib/signal.in.h 2009-03-21 18:05:50.000000000 -0600 @@ -1,6 +1,6 @@ /* A GNU-like <signal.h>. - Copyright (C) 2006-2008 Free Software Foundation, Inc. + Copyright (C) 2006-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,7 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif #if defined __need_sig_atomic_t || defined __need_sigset_t /* Special invocation convention inside glibc header files. */ @@ -39,6 +41,15 @@ Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ #include <sys/types.h> +/* On AIX, sig_atomic_t already includes volatile. C99 requires that + 'volatile sig_atomic_t' ignore the extra modifier, but C89 did not. + Hence, redefine this to a non-volatile type as needed. */ +#if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +typedef int rpl_sig_atomic_t; +# undef sig_atomic_t +# define sig_atomic_t rpl_sig_atomic_t +#endif + #ifdef __cplusplus extern "C" { #endif @@ -176,6 +187,12 @@ extern int sigaction (int, const struct #endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */ +/* Some systems don't have SA_NODEFER. */ +#ifndef SA_NODEFER +# define SA_NODEFER 0 +#endif + + #ifdef __cplusplus } #endif diff -ruNp m4-1.4.12/lib/sigprocmask.c m4-1.4.13/lib/sigprocmask.c --- m4-1.4.12/lib/sigprocmask.c 2008-09-26 06:32:24.000000000 -0600 +++ m4-1.4.13/lib/sigprocmask.c 2008-12-11 22:14:41.000000000 -0700 @@ -43,6 +43,19 @@ # define SIGSTOP (-1) #endif +/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias + for the signal SIGABRT. Only one signal handler is stored for both + SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef SIGABRT_COMPAT +# define SIGABRT_COMPAT 6 +#endif +#ifdef SIGABRT_COMPAT +# define SIGABRT_COMPAT_MASK (1U << SIGABRT_COMPAT) +#else +# define SIGABRT_COMPAT_MASK 0 +#endif + typedef void (*handler_t) (int); /* Handling of gnulib defined signals. */ @@ -74,7 +87,14 @@ int sigismember (const sigset_t *set, int sig) { if (sig >= 0 && sig < NSIG) - return (*set >> sig) & 1; + { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + return (*set >> sig) & 1; + } else return 0; } @@ -91,6 +111,11 @@ sigaddset (sigset_t *set, int sig) { if (sig >= 0 && sig < NSIG) { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + *set |= 1U << sig; return 0; } @@ -106,6 +131,11 @@ sigdelset (sigset_t *set, int sig) { if (sig >= 0 && sig < NSIG) { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + *set &= ~(1U << sig); return 0; } @@ -116,10 +146,11 @@ sigdelset (sigset_t *set, int sig) } } + int sigfillset (sigset_t *set) { - *set = (2U << (NSIG - 1)) - 1; + *set = ((2U << (NSIG - 1)) - 1) & ~ SIGABRT_COMPAT_MASK; return 0; } @@ -241,6 +272,11 @@ rpl_signal (int sig, handler_t handler) if (sig >= 0 && sig < NSIG && sig != SIGKILL && sig != SIGSTOP && handler != SIG_ERR) { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + if (blocked_set & (1U << sig)) { /* POSIX states that sigprocmask and signal are both diff -ruNp m4-1.4.12/lib/spawn.in.h m4-1.4.13/lib/spawn.in.h --- m4-1.4.12/lib/spawn.in.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawn.in.h 2009-02-28 08:25:54.000000000 -0700 @@ -0,0 +1,397 @@ +/* Definitions for POSIX spawn interface. + Copyright (C) 2000, 2003, 2004, 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _GL_SPAWN_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_SPAWN_H@ +# @INCLUDE_NEXT@ @NEXT_SPAWN_H@ +#endif + +#ifndef _GL_SPAWN_H +#define _GL_SPAWN_H + +#include <sched.h> +#include <signal.h> +#include <sys/types.h> + +#ifndef __THROW +# define __THROW +#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, so pick a + different name. */ +#ifndef _Restrict_ +# if 199901L <= __STDC_VERSION__ +# define _Restrict_ restrict +# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__) +# define _Restrict_ __restrict +# else +# define _Restrict_ +# endif +#endif +/* gcc 3.1 and up support the [restrict] syntax. Don't trust + sys/cdefs.h's definition of __restrict_arr, though, as it + mishandles gcc -ansi -pedantic. */ +#ifndef _Restrict_arr_ +# if ((199901L <= __STDC_VERSION__ \ + || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \ + && !__STRICT_ANSI__)) \ + && !defined __GNUG__) +# define _Restrict_arr_ _Restrict_ +# else +# define _Restrict_arr_ +# endif +#endif + +/* The definition of GL_LINK_WARNING is copied here. */ + + +/* Data structure to contain attributes for thread creation. */ +#if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_t rpl_posix_spawnattr_t +#endif +typedef struct +{ + short int _flags; + pid_t _pgrp; + sigset_t _sd; + sigset_t _ss; + struct sched_param _sp; + int _policy; + int __pad[16]; +} posix_spawnattr_t; + + +/* Data structure to contain information about the actions to be + performed in the new process with respect to file descriptors. */ +#if @REPLACE_POSIX_SPAWN@ +# define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t +#endif +typedef struct +{ + int _allocated; + int _used; + struct __spawn_action *_actions; + int __pad[16]; +} posix_spawn_file_actions_t; + + +/* Flags to be set in the `posix_spawnattr_t'. */ +#if @REPLACE_POSIX_SPAWN@ +/* Use the values from the system, for better compatibility. */ +/* But this implementation does not support AIX extensions. */ +# undef POSIX_SPAWN_FORK_HANDLERS +#else +# define POSIX_SPAWN_RESETIDS 0x01 +# define POSIX_SPAWN_SETPGROUP 0x02 +# define POSIX_SPAWN_SETSIGDEF 0x04 +# define POSIX_SPAWN_SETSIGMASK 0x08 +# define POSIX_SPAWN_SETSCHEDPARAM 0x10 +# define POSIX_SPAWN_SETSCHEDULER 0x20 +#endif +/* A GNU extension. Use the next free bit position. */ +#define POSIX_SPAWN_USEVFORK \ + ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1) \ + | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1) \ + | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1) \ + | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1) \ + | POSIX_SPAWN_SETSCHEDPARAM | (POSIX_SPAWN_SETSCHEDPARAM - 1) \ + | POSIX_SPAWN_SETSCHEDULER | (POSIX_SPAWN_SETSCHEDULER - 1)) \ + + 1) +typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap + [2 * (((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP + | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK + | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER) + & POSIX_SPAWN_USEVFORK) == 0) - 1]; + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_POSIX_SPAWN@ +/* Spawn a new process executing PATH with the attributes describes in *ATTRP. + Before running the process perform the actions described in FILE-ACTIONS. + + This function is a possible cancellation points and therefore not + marked with __THROW. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawn rpl_posix_spawn +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawn (pid_t *_Restrict_ __pid, + const char *_Restrict_ __path, + const posix_spawn_file_actions_t *_Restrict_ __file_actions, + const posix_spawnattr_t *_Restrict_ __attrp, + char *const argv[_Restrict_arr_], + char *const envp[_Restrict_arr_]); +# endif +#endif + +#if @GNULIB_POSIX_SPAWNP@ +/* Similar to `posix_spawn' but search for FILE in the PATH. + + This function is a possible cancellation points and therefore not + marked with __THROW. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnp rpl_posix_spawnp +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnp (pid_t *__pid, const char *__file, + const posix_spawn_file_actions_t *__file_actions, + const posix_spawnattr_t *__attrp, + char *const argv[], char *const envp[]); +# endif +#endif + + +#if @GNULIB_POSIX_SPAWNATTR_INIT@ +/* Initialize data structure with attributes for `spawn' to default values. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_init rpl_posix_spawnattr_init +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_init (posix_spawnattr_t *__attr) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_DESTROY@ +/* Free resources associated with ATTR. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_destroy rpl_posix_spawnattr_destroy +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ +/* Store signal mask for signals with default handling from ATTR in + SIGDEFAULT. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __attr, + sigset_t *_Restrict_ __sigdefault) + __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ +/* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr, + const sigset_t *_Restrict_ __sigdefault) + __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ +/* Store signal mask for the new process from ATTR in SIGMASK. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __attr, + sigset_t *_Restrict_ __sigmask) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ +/* Set signal mask for the new process in ATTR to SIGMASK. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr, + const sigset_t *_Restrict_ __sigmask) + __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ +/* Get flag word from the attribute structure. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_getflags rpl_posix_spawnattr_getflags +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr, + short int *_Restrict_ __flags) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ +/* Store flags in the attribute structure. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_setflags rpl_posix_spawnattr_setflags +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr, + short int __flags) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ +/* Get process group ID from the attribute structure. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr, + pid_t *_Restrict_ __pgroup) + __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ +/* Store process group ID in the attribute structure. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr, + pid_t __pgroup) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ +/* Get scheduling policy from the attribute structure. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ __attr, + int *_Restrict_ __schedpolicy) + __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ +/* Store scheduling policy in the attribute structure. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr, + int __schedpolicy) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ +/* Get scheduling parameters from the attribute structure. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __attr, + struct sched_param *_Restrict_ __schedparam) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ +/* Store scheduling parameters in the attribute structure. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr, + const struct sched_param *_Restrict_ __schedparam) __THROW; +# endif +#endif + + +#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ +/* Initialize data structure for file attribute for `spawn' call. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_actions) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ +/* Free resources associated with FILE-ACTIONS. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_actions) __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ +/* Add an action to FILE-ACTIONS which tells the implementation to call + `open' for the given file during the `spawn' call. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *_Restrict_ __file_actions, + int __fd, + const char *_Restrict_ __path, + int __oflag, mode_t __mode) + __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ +/* Add an action to FILE-ACTIONS which tells the implementation to call + `close' for the given file descriptor during the `spawn' call. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file_actions, + int __fd) + __THROW; +# endif +#endif + +#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ +/* Add an action to FILE-ACTIONS which tells the implementation to call + `dup2' for the given file descriptors during the `spawn' call. */ +# if @REPLACE_POSIX_SPAWN@ +# define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2 +# endif +# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ +extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *__file_actions, + int __fd, int __newfd) __THROW; +# endif +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* _GL_SPAWN_H */ +#endif /* _GL_SPAWN_H */ diff -ruNp m4-1.4.12/lib/spawn_faction_addclose.c m4-1.4.13/lib/spawn_faction_addclose.c --- m4-1.4.12/lib/spawn_faction_addclose.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawn_faction_addclose.c 2009-03-02 06:04:40.000000000 -0700 @@ -0,0 +1,59 @@ +/* Copyright (C) 2000 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +#include <errno.h> +#include <unistd.h> + +#if !_LIBC +# define __sysconf(open_max) getdtablesize () +#endif + +#include "spawn_int.h" + +/* Add an action to FILE-ACTIONS which tells the implementation to call + `close' for the given file descriptor during the `spawn' call. */ +int +posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *file_actions, + int fd) +{ + int maxfd = __sysconf (_SC_OPEN_MAX); + struct __spawn_action *rec; + + /* Test for the validity of the file descriptor. */ + if (fd < 0 || fd >= maxfd) + return EBADF; + + /* Allocate more memory if needed. */ + if (file_actions->_used == file_actions->_allocated + && __posix_spawn_file_actions_realloc (file_actions) != 0) + /* This can only mean we ran out of memory. */ + return ENOMEM; + + /* Add the new value. */ + rec = &file_actions->_actions[file_actions->_used]; + rec->tag = spawn_do_close; + rec->action.open_action.fd = fd; + + /* Account for the new entry. */ + ++file_actions->_used; + + return 0; +} diff -ruNp m4-1.4.12/lib/spawn_faction_adddup2.c m4-1.4.13/lib/spawn_faction_adddup2.c --- m4-1.4.12/lib/spawn_faction_adddup2.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawn_faction_adddup2.c 2009-03-02 06:04:40.000000000 -0700 @@ -0,0 +1,60 @@ +/* Copyright (C) 2000 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +#include <errno.h> +#include <unistd.h> + +#if !_LIBC +# define __sysconf(open_max) getdtablesize () +#endif + +#include "spawn_int.h" + +/* Add an action to FILE-ACTIONS which tells the implementation to call + `dup2' for the given file descriptors during the `spawn' call. */ +int +posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *file_actions, + int fd, int newfd) +{ + int maxfd = __sysconf (_SC_OPEN_MAX); + struct __spawn_action *rec; + + /* Test for the validity of the file descriptor. */ + if (fd < 0 || newfd < 0 || fd >= maxfd || newfd >= maxfd) + return EBADF; + + /* Allocate more memory if needed. */ + if (file_actions->_used == file_actions->_allocated + && __posix_spawn_file_actions_realloc (file_actions) != 0) + /* This can only mean we ran out of memory. */ + return ENOMEM; + + /* Add the new value. */ + rec = &file_actions->_actions[file_actions->_used]; + rec->tag = spawn_do_dup2; + rec->action.dup2_action.fd = fd; + rec->action.dup2_action.newfd = newfd; + + /* Account for the new entry. */ + ++file_actions->_used; + + return 0; +} diff -ruNp m4-1.4.12/lib/spawn_faction_addopen.c m4-1.4.13/lib/spawn_faction_addopen.c --- m4-1.4.12/lib/spawn_faction_addopen.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawn_faction_addopen.c 2009-02-28 08:25:54.000000000 -0700 @@ -0,0 +1,63 @@ +/* Copyright (C) 2000 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +#include <errno.h> +#include <unistd.h> + +#if !_LIBC +# define __sysconf(open_max) getdtablesize () +#endif + +#include "spawn_int.h" + +/* Add an action to FILE-ACTIONS which tells the implementation to call + `open' for the given file during the `spawn' call. */ +int +posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *file_actions, + int fd, const char *path, int oflag, + mode_t mode) +{ + int maxfd = __sysconf (_SC_OPEN_MAX); + struct __spawn_action *rec; + + /* Test for the validity of the file descriptor. */ + if (fd < 0 || fd >= maxfd) + return EBADF; + + /* Allocate more memory if needed. */ + if (file_actions->_used == file_actions->_allocated + && __posix_spawn_file_actions_realloc (file_actions) != 0) + /* This can only mean we ran out of memory. */ + return ENOMEM; + + /* Add the new value. */ + rec = &file_actions->_actions[file_actions->_used]; + rec->tag = spawn_do_open; + rec->action.open_action.fd = fd; + rec->action.open_action.path = path; + rec->action.open_action.oflag = oflag; + rec->action.open_action.mode = mode; + + /* Account for the new entry. */ + ++file_actions->_used; + + return 0; +} diff -ruNp m4-1.4.12/lib/spawn_faction_destroy.c m4-1.4.13/lib/spawn_faction_destroy.c --- m4-1.4.12/lib/spawn_faction_destroy.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawn_faction_destroy.c 2009-02-28 08:25:55.000000000 -0700 @@ -0,0 +1,31 @@ +/* Copyright (C) 2000 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +#include <stdlib.h> + +/* Initialize data structure for file attribute for `spawn' call. */ +int +posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *file_actions) +{ + /* Free the memory allocated. */ + free (file_actions->_actions); + return 0; +} diff -ruNp m4-1.4.12/lib/spawn_faction_init.c m4-1.4.13/lib/spawn_faction_init.c --- m4-1.4.12/lib/spawn_faction_init.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawn_faction_init.c 2009-02-28 08:25:55.000000000 -0700 @@ -0,0 +1,56 @@ +/* Copyright (C) 2000 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +#include <errno.h> +#include <stdlib.h> +#include <string.h> + +#include "spawn_int.h" + + +/* Function used to increase the size of the allocated array. This + function is called from the `add'-functions. */ +int +__posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *file_actions) +{ + int newalloc = file_actions->_allocated + 8; + void *newmem = realloc (file_actions->_actions, + newalloc * sizeof (struct __spawn_action)); + + if (newmem == NULL) + /* Not enough memory. */ + return ENOMEM; + + file_actions->_actions = (struct __spawn_action *) newmem; + file_actions->_allocated = newalloc; + + return 0; +} + + +/* Initialize data structure for file attribute for `spawn' call. */ +int +posix_spawn_file_actions_init (posix_spawn_file_actions_t *file_actions) +{ + /* Simply clear all the elements. */ + memset (file_actions, '\0', sizeof (*file_actions)); + return 0; +} diff -ruNp m4-1.4.12/lib/spawn_int.h m4-1.4.13/lib/spawn_int.h --- m4-1.4.12/lib/spawn_int.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawn_int.h 2009-02-28 08:25:55.000000000 -0700 @@ -0,0 +1,62 @@ +/* Copyright (C) 2000, 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> + +/* Data structure to contain the action information. */ +struct __spawn_action +{ + enum + { + spawn_do_close, + spawn_do_dup2, + spawn_do_open + } tag; + + union + { + struct + { + int fd; + } close_action; + struct + { + int fd; + int newfd; + } dup2_action; + struct + { + int fd; + const char *path; + int oflag; + mode_t mode; + } open_action; + } action; +}; + +#if !_LIBC +# define __posix_spawn_file_actions_realloc gl_posix_spawn_file_actions_realloc +#endif +extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t * + file_actions); + +#if !_LIBC +# define __spawni gl_posix_spawn_internal +#endif +extern int __spawni (pid_t *pid, const char *path, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, char *const argv[], + char *const envp[], int use_path); diff -ruNp m4-1.4.12/lib/spawnattr_destroy.c m4-1.4.13/lib/spawnattr_destroy.c --- m4-1.4.12/lib/spawnattr_destroy.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawnattr_destroy.c 2009-02-28 08:25:55.000000000 -0700 @@ -0,0 +1,28 @@ +/* Copyright (C) 2000 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +/* Initialize data structure for file attribute for `spawn' call. */ +int +posix_spawnattr_destroy (posix_spawnattr_t *attr) +{ + /* Nothing to do in the moment. */ + return 0; +} diff -ruNp m4-1.4.12/lib/spawnattr_init.c m4-1.4.13/lib/spawnattr_init.c --- m4-1.4.12/lib/spawnattr_init.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawnattr_init.c 2009-02-28 08:25:55.000000000 -0700 @@ -0,0 +1,33 @@ +/* Copyright (C) 2000 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +#include <string.h> + +/* Initialize data structure for file attribute for `spawn' call. */ +int +posix_spawnattr_init (posix_spawnattr_t *attr) +{ + /* All elements have to be initialized to the default values which + is generally zero. */ + memset (attr, '\0', sizeof (*attr)); + + return 0; +} diff -ruNp m4-1.4.12/lib/spawnattr_setflags.c m4-1.4.13/lib/spawnattr_setflags.c --- m4-1.4.12/lib/spawnattr_setflags.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawnattr_setflags.c 2009-02-28 08:25:55.000000000 -0700 @@ -0,0 +1,45 @@ +/* Copyright (C) 2000, 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +#include <errno.h> +#include <string.h> + +#define ALL_FLAGS (POSIX_SPAWN_RESETIDS \ + | POSIX_SPAWN_SETPGROUP \ + | POSIX_SPAWN_SETSIGDEF \ + | POSIX_SPAWN_SETSIGMASK \ + | POSIX_SPAWN_SETSCHEDPARAM \ + | POSIX_SPAWN_SETSCHEDULER \ + | POSIX_SPAWN_USEVFORK) + +/* Store flags in the attribute structure. */ +int +posix_spawnattr_setflags (posix_spawnattr_t *attr, short int flags) +{ + /* Check no invalid bits are set. */ + if (flags & ~ALL_FLAGS) + return EINVAL; + + /* Store the flag word. */ + attr->_flags = flags; + + return 0; +} diff -ruNp m4-1.4.12/lib/spawnattr_setsigmask.c m4-1.4.13/lib/spawnattr_setsigmask.c --- m4-1.4.12/lib/spawnattr_setsigmask.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawnattr_setsigmask.c 2009-02-28 08:25:55.000000000 -0700 @@ -0,0 +1,33 @@ +/* Copyright (C) 2000 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +#include <string.h> + +/* Set signal mask for the new process in ATTR to SIGMASK. */ +int +posix_spawnattr_setsigmask (posix_spawnattr_t *attr, + const sigset_t *sigmask) +{ + /* Copy the sigset_t data to the user buffer. */ + memcpy (&attr->_ss, sigmask, sizeof (sigset_t)); + + return 0; +} diff -ruNp m4-1.4.12/lib/spawni.c m4-1.4.13/lib/spawni.c --- m4-1.4.12/lib/spawni.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawni.c 2009-03-08 20:14:53.000000000 -0600 @@ -0,0 +1,374 @@ +/* Guts of POSIX spawn interface. Generic POSIX.1 version. + Copyright (C) 2000-2006, 2008-2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> +#include "spawn_int.h" + +#include <alloca.h> +#include <errno.h> + +#include <fcntl.h> +#ifndef O_LARGEFILE +# define O_LARGEFILE 0 +#endif + +#if _LIBC || HAVE_PATHS_H +# include <paths.h> +#else +# define _PATH_BSHELL "/bin/sh" +#endif + +#include <signal.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#if _LIBC +# include <not-cancel.h> +#else +# define close_not_cancel close +# define open_not_cancel open +#endif + +#if _LIBC +# include <local-setxid.h> +#else +# if !HAVE_SETEUID +# define seteuid(id) setresuid (-1, id, -1) +# endif +# if !HAVE_SETEGID +# define setegid(id) setresgid (-1, id, -1) +# endif +# define local_seteuid(id) seteuid (id) +# define local_setegid(id) setegid (id) +#endif + +#if _LIBC +# define alloca __alloca +# define execve __execve +# define dup2 __dup2 +# define fork __fork +# define getgid __getgid +# define getuid __getuid +# define sched_setparam __sched_setparam +# define sched_setscheduler __sched_setscheduler +# define setpgid __setpgid +# define sigaction __sigaction +# define sigismember __sigismember +# define sigprocmask __sigprocmask +# define strchrnul __strchrnul +# define vfork __vfork +#else +# undef internal_function +# define internal_function /* empty */ +#endif + + +/* The Unix standard contains a long explanation of the way to signal + an error after the fork() was successful. Since no new wait status + was wanted there is no way to signal an error using one of the + available methods. The committee chose to signal an error by a + normal program exit with the exit code 127. */ +#define SPAWN_ERROR 127 + + +#if defined _MSC_VER || defined __MINGW32__ + +/* Native Woe32 API. */ +int +__spawni (pid_t *pid, const char *file, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, char *const argv[], + char *const envp[], int use_path) +{ + /* Not yet implemented. */ + return ENOSYS; +} + +#else + + +/* The file is accessible but it is not an executable file. Invoke + the shell to interpret it as a script. */ +static void +internal_function +script_execute (const char *file, char *const argv[], char *const envp[]) +{ + /* Count the arguments. */ + int argc = 0; + while (argv[argc++]) + ; + + /* Construct an argument list for the shell. */ + { + char **new_argv = (char **) alloca ((argc + 1) * sizeof (char *)); + new_argv[0] = (char *) _PATH_BSHELL; + new_argv[1] = (char *) file; + while (argc > 1) + { + new_argv[argc] = argv[argc - 1]; + --argc; + } + + /* Execute the shell. */ + execve (new_argv[0], new_argv, envp); + } +} + + +/* Spawn a new process executing PATH with the attributes describes in *ATTRP. + Before running the process perform the actions described in FILE-ACTIONS. */ +int +__spawni (pid_t *pid, const char *file, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, char *const argv[], + char *const envp[], int use_path) +{ + pid_t new_pid; + char *path, *p, *name; + size_t len; + size_t pathlen; + + /* Do this once. */ + short int flags = attrp == NULL ? 0 : attrp->_flags; + + /* Avoid gcc warning + "variable 'flags' might be clobbered by 'longjmp' or 'vfork'" */ + (void) &flags; + + /* Generate the new process. */ +#if HAVE_VFORK + if ((flags & POSIX_SPAWN_USEVFORK) != 0 + /* If no major work is done, allow using vfork. Note that we + might perform the path searching. But this would be done by + a call to execvp(), too, and such a call must be OK according + to POSIX. */ + || ((flags & (POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF + | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER + | POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_RESETIDS)) == 0 + && file_actions == NULL)) + new_pid = vfork (); + else +#endif + new_pid = fork (); + + if (new_pid != 0) + { + if (new_pid < 0) + return errno; + + /* The call was successful. Store the PID if necessary. */ + if (pid != NULL) + *pid = new_pid; + + return 0; + } + + /* Set signal mask. */ + if ((flags & POSIX_SPAWN_SETSIGMASK) != 0 + && sigprocmask (SIG_SETMASK, &attrp->_ss, NULL) != 0) + _exit (SPAWN_ERROR); + + /* Set signal default action. */ + if ((flags & POSIX_SPAWN_SETSIGDEF) != 0) + { + /* We have to iterate over all signals. This could possibly be + done better but it requires system specific solutions since + the sigset_t data type can be very different on different + architectures. */ + int sig; + struct sigaction sa; + + memset (&sa, '\0', sizeof (sa)); + sa.sa_handler = SIG_DFL; + + for (sig = 1; sig <= NSIG; ++sig) + if (sigismember (&attrp->_sd, sig) != 0 + && sigaction (sig, &sa, NULL) != 0) + _exit (SPAWN_ERROR); + + } + +#if (_LIBC ? defined _POSIX_PRIORITY_SCHEDULING : HAVE_SCHED_SETPARAM && HAVE_SCHED_SETSCHEDULER) + /* Set the scheduling algorithm and parameters. */ + if ((flags & (POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)) + == POSIX_SPAWN_SETSCHEDPARAM) + { + if (sched_setparam (0, &attrp->_sp) == -1) + _exit (SPAWN_ERROR); + } + else if ((flags & POSIX_SPAWN_SETSCHEDULER) != 0) + { + if (sched_setscheduler (0, attrp->_policy, + (flags & POSIX_SPAWN_SETSCHEDPARAM) != 0 + ? &attrp->_sp : NULL) == -1) + _exit (SPAWN_ERROR); + } +#endif + + /* Set the process group ID. */ + if ((flags & POSIX_SPAWN_SETPGROUP) != 0 + && setpgid (0, attrp->_pgrp) != 0) + _exit (SPAWN_ERROR); + + /* Set the effective user and group IDs. */ + if ((flags & POSIX_SPAWN_RESETIDS) != 0 + && (local_seteuid (getuid ()) != 0 + || local_setegid (getgid ()) != 0)) + _exit (SPAWN_ERROR); + + /* Execute the file actions. */ + if (file_actions != NULL) + { + int cnt; + + for (cnt = 0; cnt < file_actions->_used; ++cnt) + { + struct __spawn_action *action = &file_actions->_actions[cnt]; + + switch (action->tag) + { + case spawn_do_close: + if (close_not_cancel (action->action.close_action.fd) != 0) + /* Signal the error. */ + _exit (SPAWN_ERROR); + break; + + case spawn_do_open: + { + int new_fd = open_not_cancel (action->action.open_action.path, + action->action.open_action.oflag + | O_LARGEFILE, + action->action.open_action.mode); + + if (new_fd == -1) + /* The `open' call failed. */ + _exit (SPAWN_ERROR); + + /* Make sure the desired file descriptor is used. */ + if (new_fd != action->action.open_action.fd) + { + if (dup2 (new_fd, action->action.open_action.fd) + != action->action.open_action.fd) + /* The `dup2' call failed. */ + _exit (SPAWN_ERROR); + + if (close_not_cancel (new_fd) != 0) + /* The `close' call failed. */ + _exit (SPAWN_ERROR); + } + } + break; + + case spawn_do_dup2: + if (dup2 (action->action.dup2_action.fd, + action->action.dup2_action.newfd) + != action->action.dup2_action.newfd) + /* The `dup2' call failed. */ + _exit (SPAWN_ERROR); + break; + } + } + } + + if (! use_path || strchr (file, '/') != NULL) + { + /* The FILE parameter is actually a path. */ + execve (file, argv, envp); + + if (errno == ENOEXEC) + script_execute (file, argv, envp); + + /* Oh, oh. `execve' returns. This is bad. */ + _exit (SPAWN_ERROR); + } + + /* We have to search for FILE on the path. */ + path = getenv ("PATH"); + if (path == NULL) + { +#if HAVE_CONFSTR + /* There is no `PATH' in the environment. + The default search path is the current directory + followed by the path `confstr' returns for `_CS_PATH'. */ + len = confstr (_CS_PATH, (char *) NULL, 0); + path = (char *) alloca (1 + len); + path[0] = ':'; + (void) confstr (_CS_PATH, path + 1, len); +#else + /* Pretend that the PATH contains only the current directory. */ + path = ""; +#endif + } + + len = strlen (file) + 1; + pathlen = strlen (path); + name = alloca (pathlen + len + 1); + /* Copy the file name at the top. */ + name = (char *) memcpy (name + pathlen + 1, file, len); + /* And add the slash. */ + *--name = '/'; + + p = path; + do + { + char *startp; + + path = p; + p = strchrnul (path, ':'); + + if (p == path) + /* Two adjacent colons, or a colon at the beginning or the end + of `PATH' means to search the current directory. */ + startp = name + 1; + else + startp = (char *) memcpy (name - (p - path), path, p - path); + + /* Try to execute this name. If it works, execv will not return. */ + execve (startp, argv, envp); + + if (errno == ENOEXEC) + script_execute (startp, argv, envp); + + switch (errno) + { + case EACCES: + case ENOENT: + case ESTALE: + case ENOTDIR: + /* Those errors indicate the file is missing or not executable + by us, in which case we want to just try the next path + directory. */ + break; + + default: + /* Some other error means we found an executable file, but + something went wrong executing it; return the error to our + caller. */ + _exit (SPAWN_ERROR); + } + } + while (*p++ != '\0'); + + /* Return with an error. */ + _exit (SPAWN_ERROR); +} + +#endif diff -ruNp m4-1.4.12/lib/spawnp.c m4-1.4.13/lib/spawnp.c --- m4-1.4.12/lib/spawnp.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/spawnp.c 2009-02-28 08:25:56.000000000 -0700 @@ -0,0 +1,33 @@ +/* Copyright (C) 2000 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <spawn.h> + +#include "spawn_int.h" + +/* Spawn a new process executing FILE with the attributes describes in *ATTRP. + Before running the process perform the actions described in FILE-ACTIONS. */ +int +posix_spawnp (pid_t *pid, const char *file, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, char *const argv[], + char *const envp[]) +{ + return __spawni (pid, file, file_actions, attrp, argv, envp, 1); +} diff -ruNp m4-1.4.12/lib/stdarg.in.h m4-1.4.13/lib/stdarg.in.h --- m4-1.4.12/lib/stdarg.in.h 2008-08-31 08:31:35.000000000 -0600 +++ m4-1.4.13/lib/stdarg.in.h 2008-12-11 22:14:42.000000000 -0700 @@ -17,7 +17,9 @@ #ifndef _GL_STDARG_H +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STDARG_H@ diff -ruNp m4-1.4.12/lib/stdint.in.h m4-1.4.13/lib/stdint.in.h --- m4-1.4.12/lib/stdint.in.h 2008-08-31 08:31:36.000000000 -0600 +++ m4-1.4.13/lib/stdint.in.h 2009-02-28 08:26:21.000000000 -0700 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2008 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -49,7 +49,9 @@ in <inttypes.h> would reinclude us, skipping our contents because _GL_STDINT_H is defined. The include_next requires a split double-inclusion guard. */ +# if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +# endif # @INCLUDE_NEXT@ @NEXT_STDINT_H@ #endif @@ -87,15 +89,6 @@ # include <sys/bitypes.h> #endif -#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS - -/* Get WCHAR_MIN, WCHAR_MAX. */ -# if ! (defined WCHAR_MIN && defined WCHAR_MAX) -# include <wchar.h> -# endif - -#endif - #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* Minimum and maximum values for a integer type under the usual assumption. @@ -120,46 +113,58 @@ #undef int8_t #undef uint8_t -#define int8_t signed char -#define uint8_t unsigned char +typedef signed char gl_int8_t; +typedef unsigned char gl_uint8_t; +#define int8_t gl_int8_t +#define uint8_t gl_uint8_t #undef int16_t #undef uint16_t -#define int16_t short int -#define uint16_t unsigned short int +typedef short int gl_int16_t; +typedef unsigned short int gl_uint16_t; +#define int16_t gl_int16_t +#define uint16_t gl_uint16_t #undef int32_t #undef uint32_t -#define int32_t int -#define uint32_t unsigned int +typedef int gl_int32_t; +typedef unsigned int gl_uint32_t; +#define int32_t gl_int32_t +#define uint32_t gl_uint32_t /* Do not undefine int64_t if gnulib is not being used with 64-bit types, since otherwise it breaks platforms like Tandem/NSK. */ #if LONG_MAX >> 31 >> 31 == 1 # undef int64_t -# define int64_t long int +typedef long int gl_int64_t; +# define int64_t gl_int64_t # define GL_INT64_T #elif defined _MSC_VER # undef int64_t -# define int64_t __int64 +typedef __int64 gl_int64_t; +# define int64_t gl_int64_t # define GL_INT64_T #elif @HAVE_LONG_LONG_INT@ # undef int64_t -# define int64_t long long int +typedef long long int gl_int64_t; +# define int64_t gl_int64_t # define GL_INT64_T #endif #if ULONG_MAX >> 31 >> 31 >> 1 == 1 # undef uint64_t -# define uint64_t unsigned long int +typedef unsigned long int gl_uint64_t; +# define uint64_t gl_uint64_t # define GL_UINT64_T #elif defined _MSC_VER # undef uint64_t -# define uint64_t unsigned __int64 +typedef unsigned __int64 gl_uint64_t; +# define uint64_t gl_uint64_t # define GL_UINT64_T #elif @HAVE_UNSIGNED_LONG_LONG_INT@ # undef uint64_t -# define uint64_t unsigned long long int +typedef unsigned long long int gl_uint64_t; +# define uint64_t gl_uint64_t # define GL_UINT64_T #endif @@ -214,12 +219,18 @@ #undef uint_fast32_t #undef int_fast64_t #undef uint_fast64_t -#define int_fast8_t long int -#define uint_fast8_t unsigned int_fast8_t -#define int_fast16_t long int -#define uint_fast16_t unsigned int_fast16_t -#define int_fast32_t long int -#define uint_fast32_t unsigned int_fast32_t +typedef long int gl_int_fast8_t; +typedef unsigned long int gl_uint_fast8_t; +typedef long int gl_int_fast16_t; +typedef unsigned long int gl_uint_fast16_t; +typedef long int gl_int_fast32_t; +typedef unsigned long int gl_uint_fast32_t; +#define int_fast8_t gl_int_fast8_t +#define uint_fast8_t gl_uint_fast8_t +#define int_fast16_t gl_int_fast16_t +#define uint_fast16_t gl_uint_fast16_t +#define int_fast32_t gl_int_fast32_t +#define uint_fast32_t gl_uint_fast32_t #ifdef GL_INT64_T # define int_fast64_t int64_t #endif @@ -231,8 +242,10 @@ #undef intptr_t #undef uintptr_t -#define intptr_t long int -#define uintptr_t unsigned long int +typedef long int gl_intptr_t; +typedef unsigned long int gl_uintptr_t; +#define intptr_t gl_intptr_t +#define uintptr_t gl_uintptr_t /* 7.18.1.5. Greatest-width integer types */ @@ -241,20 +254,24 @@ #undef intmax_t #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define intmax_t long long int +typedef long long int gl_intmax_t; +# define intmax_t gl_intmax_t #elif defined GL_INT64_T # define intmax_t int64_t #else -# define intmax_t long int +typedef long int gl_intmax_t; +# define intmax_t gl_intmax_t #endif #undef uintmax_t #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define uintmax_t unsigned long long int +typedef unsigned long long int gl_uintmax_t; +# define uintmax_t gl_uintmax_t #elif defined GL_UINT64_T # define uintmax_t uint64_t #else -# define uintmax_t unsigned long int +typedef unsigned long int gl_uintmax_t; +# define uintmax_t gl_uintmax_t #endif /* Verify that intmax_t and uintmax_t have the same size. Too much code @@ -417,10 +434,20 @@ typedef int _verify_intmax_size[2 * (siz /* ptrdiff_t limits */ #undef PTRDIFF_MIN #undef PTRDIFF_MAX -#define PTRDIFF_MIN \ - _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -#define PTRDIFF_MAX \ - _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +#if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) +# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# else +# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) +# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) +# endif +#else +# define PTRDIFF_MIN \ + _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +# define PTRDIFF_MAX \ + _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +#endif /* sig_atomic_t limits */ #undef SIG_ATOMIC_MIN @@ -435,9 +462,26 @@ typedef int _verify_intmax_size[2 * (siz /* size_t limit */ #undef SIZE_MAX -#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) +#if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# else +# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# endif +#else +# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) +#endif /* wchar_t limits */ +/* Get WCHAR_MIN, WCHAR_MAX. + This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested + includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes + <stdint.h> and assumes its types are already defined. */ +#if ! (defined WCHAR_MIN && defined WCHAR_MAX) +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# include <wchar.h> +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +#endif #undef WCHAR_MIN #undef WCHAR_MAX #define WCHAR_MIN \ diff -ruNp m4-1.4.12/lib/stdio.in.h m4-1.4.13/lib/stdio.in.h --- m4-1.4.12/lib/stdio.in.h 2008-09-28 14:07:10.000000000 -0600 +++ m4-1.4.13/lib/stdio.in.h 2009-01-24 12:02:12.000000000 -0700 @@ -16,7 +16,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif #if defined __need_FILE || defined __need___FILE /* Special invocation convention inside glibc header files. */ @@ -214,6 +216,38 @@ extern int vsprintf (char *str, const ch vsprintf (b, f, a)) #endif +#if @GNULIB_DPRINTF@ +# if @REPLACE_DPRINTF@ +# define dprintf rpl_dprintf +# endif +# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@ +extern int dprintf (int fd, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dprintf +# define dprintf(d,f,a) \ + (GL_LINK_WARNING ("dprintf is unportable - " \ + "use gnulib module dprintf for portability"), \ + dprintf (d, f, a)) +#endif + +#if @GNULIB_VDPRINTF@ +# if @REPLACE_VDPRINTF@ +# define vdprintf rpl_vdprintf +# endif +# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@ +extern int vdprintf (int fd, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vdprintf +# define vdprintf(d,f,a) \ + (GL_LINK_WARNING ("vdprintf is unportable - " \ + "use gnulib module vdprintf for portability"), \ + vdprintf (d, f, a)) +#endif + #if @GNULIB_VASPRINTF@ # if @REPLACE_VASPRINTF@ # define asprintf rpl_asprintf @@ -373,6 +407,21 @@ extern long rpl_ftell (FILE *fp); fflush (f)) #endif +#if @GNULIB_FCLOSE@ +# if @REPLACE_FCLOSE@ +# define fclose rpl_fclose + /* Close STREAM and its underlying file descriptor. */ +extern int fclose (FILE *stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fclose +# define fclose(f) \ + (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \ + "use gnulib module fclose for portable " \ + "POSIX compliance"), \ + fclose (f)) +#endif + #if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ # undef fputc # define fputc rpl_fputc diff -ruNp m4-1.4.12/lib/stdlib.in.h m4-1.4.13/lib/stdlib.in.h --- m4-1.4.12/lib/stdlib.in.h 2008-08-31 08:31:37.000000000 -0600 +++ m4-1.4.13/lib/stdlib.in.h 2009-01-25 19:37:55.000000000 -0700 @@ -1,6 +1,6 @@ /* A GNU-like <stdlib.h>. - Copyright (C) 1995, 2001-2004, 2006-2008 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,7 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif #if defined __need_malloc_and_calloc /* Special invocation convention inside glibc header files. */ @@ -34,6 +36,34 @@ #define _GL_STDLIB_H +/* Solaris declares getloadavg() in <sys/loadavg.h>. */ +#if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@ +# include <sys/loadavg.h> +#endif + +/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included + from <stdlib.h> if _REENTRANT is defined. Include it always. */ +#if @HAVE_RANDOM_H@ +# include <random.h> +#endif + +#if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@ +# include <stdint.h> +#endif + +#if !@HAVE_STRUCT_RANDOM_DATA@ +struct random_data +{ + int32_t *fptr; /* Front pointer. */ + int32_t *rptr; /* Rear pointer. */ + int32_t *state; /* Array of state values. */ + int rand_type; /* Type of random number generator. */ + int rand_deg; /* Degree of random number generator. */ + int rand_sep; /* Distance between front and rear. */ + int32_t *end_ptr; /* Pointer behind state table. */ +}; +#endif + /* The definition of GL_LINK_WARNING is copied here. */ @@ -101,6 +131,38 @@ extern void * calloc (size_t nmemb, size #endif +#if @GNULIB_ATOLL@ +# if !@HAVE_ATOLL@ +/* Parse a signed decimal integer. + Returns the value of the integer. Errors are not detected. */ +extern long long atoll (const char *string); +# endif +#elif defined GNULIB_POSIXCHECK +# undef atoll +# define atoll(s) \ + (GL_LINK_WARNING ("atoll is unportable - " \ + "use gnulib module atoll for portability"), \ + atoll (s)) +#endif + + +#if @GNULIB_GETLOADAVG@ +# if !@HAVE_DECL_GETLOADAVG@ +/* Store max(NELEM,3) load average numbers in LOADAVG[]. + The three numbers are the load average of the last 1 minute, the last 5 + minutes, and the last 15 minutes, respectively. + LOADAVG is an array of NELEM numbers. */ +extern int getloadavg (double loadavg[], int nelem); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getloadavg +# define getloadavg(l,n) \ + (GL_LINK_WARNING ("getloadavg is not portable - " \ + "use gnulib module getloadavg for portability"), \ + getloadavg (l, n)) +#endif + + #if @GNULIB_GETSUBOPT@ /* Assuming *OPTIONP is a comma separated list of elements of the form "token" or "token=value", getsubopt parses the first of these elements. @@ -178,6 +240,43 @@ extern int putenv (char *string); #endif +#if @GNULIB_RANDOM_R@ +# if !@HAVE_RANDOM_R@ + +# ifndef RAND_MAX +# define RAND_MAX 2147483647 +# endif + +int srandom_r (unsigned int seed, struct random_data *rand_state); +int initstate_r (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state); +int setstate_r (char *arg_state, struct random_data *rand_state); +int random_r (struct random_data *buf, int32_t *result); +# endif +#elif defined GNULIB_POSIXCHECK +# undef random_r +# define random_r(b,r) \ + (GL_LINK_WARNING ("random_r is unportable - " \ + "use gnulib module random_r for portability"), \ + random_r (b,r)) +# undef initstate_r +# define initstate_r(s,b,sz,r) \ + (GL_LINK_WARNING ("initstate_r is unportable - " \ + "use gnulib module random_r for portability"), \ + initstate_r (s,b,sz,r)) +# undef srandom_r +# define srandom_r(s,r) \ + (GL_LINK_WARNING ("srandom_r is unportable - " \ + "use gnulib module random_r for portability"), \ + srandom_r (s,r)) +# undef setstate_r +# define setstate_r(a,r) \ + (GL_LINK_WARNING ("setstate_r is unportable - " \ + "use gnulib module random_r for portability"), \ + setstate_r (a,r)) +#endif + + #if @GNULIB_RPMATCH@ # if !@HAVE_RPMATCH@ /* Test a user response to a question. @@ -233,6 +332,48 @@ extern double strtod (const char *str, c #endif +#if @GNULIB_STRTOLL@ +# if !@HAVE_STRTOLL@ +/* Parse a signed integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set + to ERANGE. */ +extern long long strtoll (const char *string, char **endptr, int base); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtoll +# define strtoll(s,e,b) \ + (GL_LINK_WARNING ("strtoll is unportable - " \ + "use gnulib module strtoll for portability"), \ + strtoll (s, e, b)) +#endif + + +#if @GNULIB_STRTOULL@ +# if !@HAVE_STRTOULL@ +/* Parse an unsigned integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is ULLONG_MAX, and errno is set to + ERANGE. */ +extern unsigned long long strtoull (const char *string, char **endptr, int base); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtoull +# define strtoull(s,e,b) \ + (GL_LINK_WARNING ("strtoull is unportable - " \ + "use gnulib module strtoull for portability"), \ + strtoull (s, e, b)) +#endif + + #ifdef __cplusplus } #endif diff -ruNp m4-1.4.12/lib/strchrnul.c m4-1.4.13/lib/strchrnul.c --- m4-1.4.12/lib/strchrnul.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/strchrnul.c 2009-02-28 08:25:56.000000000 -0700 @@ -0,0 +1,142 @@ +/* Searching in a string. + Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <string.h> + +/* Find the first occurrence of C in S or the final NUL byte. */ +char * +strchrnul (const char *s, int c_in) +{ + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + + const unsigned char *char_ptr; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c; + unsigned char c; + + c = (unsigned char) c_in; + if (!c) + return rawmemchr (s, 0); + + /* Handle the first few bytes by reading one byte at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = (const unsigned char *) s; + (size_t) char_ptr % sizeof (longword) != 0; + ++char_ptr) + if (!*char_ptr || *char_ptr == c) + return (char *) char_ptr; + + longword_ptr = (const longword *) char_ptr; + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to any size longwords. */ + + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c has c in every byte. */ + repeated_one = 0x01010101; + repeated_c = c | (c << 8); + repeated_c |= repeated_c << 16; + if (0xffffffffU < (longword) -1) + { + repeated_one |= repeated_one << 31 << 1; + repeated_c |= repeated_c << 31 << 1; + if (8 < sizeof (longword)) + { + size_t i; + + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c |= repeated_c << i; + } + } + } + + /* Instead of the traditional loop which tests each byte, we will + test a longword at a time. The tricky part is testing if *any of + the four* bytes in the longword in question are equal to NUL or + c. We first use an xor with repeated_c. This reduces the task + to testing whether *any of the four* bytes in longword1 or + longword2 is zero. + + Let's consider longword1. We compute tmp = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + The test whether any byte in longword1 or longword2 is zero is equivalent + to testing whether tmp1 is nonzero or tmp2 is nonzero. We can combine + this into a single test, whether (tmp1 | tmp2) is nonzero. + + This test can read more than one byte beyond the end of a string, + depending on where the terminating NUL is encountered. However, + this is considered safe since the initialization phase ensured + that the read will be aligned, therefore, the read will not cross + page boundaries and will not cause a fault. */ + + while (1) + { + longword longword1 = *longword_ptr ^ repeated_c; + longword longword2 = *longword_ptr; + + if (((((longword1 - repeated_one) & ~longword1) + | ((longword2 - repeated_one) & ~longword2)) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + } + + char_ptr = (const unsigned char *) longword_ptr; + + /* At this point, we know that one of the sizeof (longword) bytes + starting at char_ptr is == 0 or == c. On little-endian machines, + we could determine the first such byte without any further memory + accesses, just by looking at the tmp result from the last loop + iteration. But this does not work on big-endian machines. + Choose code that works in both cases. */ + + char_ptr = (unsigned char *) longword_ptr; + while (*char_ptr && (*char_ptr != c)) + char_ptr++; + return (char *) char_ptr; +} diff -ruNp m4-1.4.12/lib/strchrnul.valgrind m4-1.4.13/lib/strchrnul.valgrind --- m4-1.4.12/lib/strchrnul.valgrind 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/strchrnul.valgrind 2009-02-28 08:25:56.000000000 -0700 @@ -0,0 +1,12 @@ +# Suppress a valgrind message about use of uninitialized memory in strchrnul(). +# This use is OK because it provides only a speedup. +{ + strchrnul-value4 + Memcheck:Value4 + fun:strchrnul +} +{ + strchrnul-value8 + Memcheck:Value8 + fun:strchrnul +} diff -ruNp m4-1.4.12/lib/streq.h m4-1.4.13/lib/streq.h --- m4-1.4.12/lib/streq.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/streq.h 2008-12-24 06:20:31.000000000 -0700 @@ -0,0 +1,176 @@ +/* Optimized string comparison. + Copyright (C) 2001-2002, 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>. */ + +#ifndef _GL_STREQ_H +#define _GL_STREQ_H + +#include <string.h> + +/* STREQ allows to optimize string comparison with a small literal string. + STREQ (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + is semantically equivalent to + strcmp (s, "EUC-KR") == 0 + just faster. */ + +/* Help GCC to generate good code for string comparisons with + immediate strings. */ +#if defined (__GNUC__) && defined (__OPTIMIZE__) + +static inline int +streq9 (const char *s1, const char *s2) +{ + return strcmp (s1 + 9, s2 + 9) == 0; +} + +static inline int +streq8 (const char *s1, const char *s2, char s28) +{ + if (s1[8] == s28) + { + if (s28 == 0) + return 1; + else + return streq9 (s1, s2); + } + else + return 0; +} + +static inline int +streq7 (const char *s1, const char *s2, char s27, char s28) +{ + if (s1[7] == s27) + { + if (s27 == 0) + return 1; + else + return streq8 (s1, s2, s28); + } + else + return 0; +} + +static inline int +streq6 (const char *s1, const char *s2, char s26, char s27, char s28) +{ + if (s1[6] == s26) + { + if (s26 == 0) + return 1; + else + return streq7 (s1, s2, s27, s28); + } + else + return 0; +} + +static inline int +streq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28) +{ + if (s1[5] == s25) + { + if (s25 == 0) + return 1; + else + return streq6 (s1, s2, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[4] == s24) + { + if (s24 == 0) + return 1; + else + return streq5 (s1, s2, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[3] == s23) + { + if (s23 == 0) + return 1; + else + return streq4 (s1, s2, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[2] == s22) + { + if (s22 == 0) + return 1; + else + return streq3 (s1, s2, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[1] == s21) + { + if (s21 == 0) + return 1; + else + return streq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[0] == s20) + { + if (s20 == 0) + return 1; + else + return streq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ + streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28) + +#else + +#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ + (strcmp (s1, s2) == 0) + +#endif + +#endif /* _GL_STREQ_H */ diff -ruNp m4-1.4.12/lib/strerror.c m4-1.4.13/lib/strerror.c --- m4-1.4.12/lib/strerror.c 2008-10-09 21:04:37.000000000 -0600 +++ m4-1.4.13/lib/strerror.c 2009-01-16 06:26:17.000000000 -0700 @@ -1,6 +1,6 @@ /* strerror.c --- POSIX compatible system error routine - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,94 +40,133 @@ char * rpl_strerror (int n) { + char const *msg = NULL; /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */ switch (n) { # if GNULIB_defined_ETXTBSY case ETXTBSY: - return "Text file busy"; + msg = "Text file busy"; + break; # endif # if GNULIB_defined_ESOCK /* native Windows platforms */ /* EWOULDBLOCK is the same as EAGAIN. */ case EINPROGRESS: - return "Operation now in progress"; + msg = "Operation now in progress"; + break; case EALREADY: - return "Operation already in progress"; + msg = "Operation already in progress"; + break; case ENOTSOCK: - return "Socket operation on non-socket"; + msg = "Socket operation on non-socket"; + break; case EDESTADDRREQ: - return "Destination address required"; + msg = "Destination address required"; + break; case EMSGSIZE: - return "Message too long"; + msg = "Message too long"; + break; case EPROTOTYPE: - return "Protocol wrong type for socket"; + msg = "Protocol wrong type for socket"; + break; case ENOPROTOOPT: - return "Protocol not available"; + msg = "Protocol not available"; + break; case EPROTONOSUPPORT: - return "Protocol not supported"; + msg = "Protocol not supported"; + break; case ESOCKTNOSUPPORT: - return "Socket type not supported"; + msg = "Socket type not supported"; + break; case EOPNOTSUPP: - return "Operation not supported"; + msg = "Operation not supported"; + break; case EPFNOSUPPORT: - return "Protocol family not supported"; + msg = "Protocol family not supported"; + break; case EAFNOSUPPORT: - return "Address family not supported by protocol"; + msg = "Address family not supported by protocol"; + break; case EADDRINUSE: - return "Address already in use"; + msg = "Address already in use"; + break; case EADDRNOTAVAIL: - return "Cannot assign requested address"; + msg = "Cannot assign requested address"; + break; case ENETDOWN: - return "Network is down"; + msg = "Network is down"; + break; case ENETUNREACH: - return "Network is unreachable"; + msg = "Network is unreachable"; + break; case ENETRESET: - return "Network dropped connection on reset"; + msg = "Network dropped connection on reset"; + break; case ECONNABORTED: - return "Software caused connection abort"; + msg = "Software caused connection abort"; + break; case ECONNRESET: - return "Connection reset by peer"; + msg = "Connection reset by peer"; + break; case ENOBUFS: - return "No buffer space available"; + msg = "No buffer space available"; + break; case EISCONN: - return "Transport endpoint is already connected"; + msg = "Transport endpoint is already connected"; + break; case ENOTCONN: - return "Transport endpoint is not connected"; + msg = "Transport endpoint is not connected"; + break; case ESHUTDOWN: - return "Cannot send after transport endpoint shutdown"; + msg = "Cannot send after transport endpoint shutdown"; + break; case ETOOMANYREFS: - return "Too many references: cannot splice"; + msg = "Too many references: cannot splice"; + break; case ETIMEDOUT: - return "Connection timed out"; + msg = "Connection timed out"; + break; case ECONNREFUSED: - return "Connection refused"; + msg = "Connection refused"; + break; case ELOOP: - return "Too many levels of symbolic links"; + msg = "Too many levels of symbolic links"; + break; case EHOSTDOWN: - return "Host is down"; + msg = "Host is down"; + break; case EHOSTUNREACH: - return "No route to host"; + msg = "No route to host"; + break; case EPROCLIM: - return "Too many processes"; + msg = "Too many processes"; + break; case EUSERS: - return "Too many users"; + msg = "Too many users"; + break; case EDQUOT: - return "Disk quota exceeded"; + msg = "Disk quota exceeded"; + break; case ESTALE: - return "Stale NFS file handle"; + msg = "Stale NFS file handle"; + break; case EREMOTE: - return "Object is remote"; + msg = "Object is remote"; + break; # if HAVE_WINSOCK2_H /* WSA_INVALID_HANDLE maps to EBADF */ /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */ /* WSA_INVALID_PARAMETER maps to EINVAL */ case WSA_OPERATION_ABORTED: - return "Overlapped operation aborted"; + msg = "Overlapped operation aborted"; + break; case WSA_IO_INCOMPLETE: - return "Overlapped I/O event object not in signaled state"; + msg = "Overlapped I/O event object not in signaled state"; + break; case WSA_IO_PENDING: - return "Overlapped operations will complete later"; + msg = "Overlapped operations will complete later"; + break; /* WSAEINTR maps to EINTR */ /* WSAEBADF maps to EBADF */ /* WSAEACCES maps to EACCES */ @@ -172,98 +211,127 @@ rpl_strerror (int n) /* WSAESTALE is ESTALE */ /* WSAEREMOTE is EREMOTE */ case WSASYSNOTREADY: - return "Network subsystem is unavailable"; + msg = "Network subsystem is unavailable"; + break; case WSAVERNOTSUPPORTED: - return "Winsock.dll version out of range"; + msg = "Winsock.dll version out of range"; + break; case WSANOTINITIALISED: - return "Successful WSAStartup not yet performed"; + msg = "Successful WSAStartup not yet performed"; + break; case WSAEDISCON: - return "Graceful shutdown in progress"; + msg = "Graceful shutdown in progress"; + break; case WSAENOMORE: case WSA_E_NO_MORE: - return "No more results"; + msg = "No more results"; + break; case WSAECANCELLED: case WSA_E_CANCELLED: - return "Call was canceled"; + msg = "Call was canceled"; + break; case WSAEINVALIDPROCTABLE: - return "Procedure call table is invalid"; + msg = "Procedure call table is invalid"; + break; case WSAEINVALIDPROVIDER: - return "Service provider is invalid"; + msg = "Service provider is invalid"; + break; case WSAEPROVIDERFAILEDINIT: - return "Service provider failed to initialize"; + msg = "Service provider failed to initialize"; + break; case WSASYSCALLFAILURE: - return "System call failure"; + msg = "System call failure"; + break; case WSASERVICE_NOT_FOUND: - return "Service not found"; + msg = "Service not found"; + break; case WSATYPE_NOT_FOUND: - return "Class type not found"; + msg = "Class type not found"; + break; case WSAEREFUSED: - return "Database query was refused"; + msg = "Database query was refused"; + break; case WSAHOST_NOT_FOUND: - return "Host not found"; + msg = "Host not found"; + break; case WSATRY_AGAIN: - return "Nonauthoritative host not found"; + msg = "Nonauthoritative host not found"; + break; case WSANO_RECOVERY: - return "Nonrecoverable error"; + msg = "Nonrecoverable error"; + break; case WSANO_DATA: - return "Valid name, no data record of requested type"; + msg = "Valid name, no data record of requested type"; + break; /* WSA_QOS_* omitted */ # endif # endif # if GNULIB_defined_ENOMSG case ENOMSG: - return "No message of desired type"; + msg = "No message of desired type"; + break; # endif # if GNULIB_defined_EIDRM case EIDRM: - return "Identifier removed"; + msg = "Identifier removed"; + break; # endif # if GNULIB_defined_ENOLINK case ENOLINK: - return "Link has been severed"; + msg = "Link has been severed"; + break; # endif # if GNULIB_defined_EPROTO case EPROTO: - return "Protocol error"; + msg = "Protocol error"; + break; # endif # if GNULIB_defined_EMULTIHOP case EMULTIHOP: - return "Multihop attempted"; + msg = "Multihop attempted"; + break; # endif # if GNULIB_defined_EBADMSG case EBADMSG: - return "Bad message"; + msg = "Bad message"; + break; # endif # if GNULIB_defined_EOVERFLOW case EOVERFLOW: - return "Value too large for defined data type"; + msg = "Value too large for defined data type"; + break; # endif # if GNULIB_defined_ENOTSUP case ENOTSUP: - return "Not supported"; + msg = "Not supported"; + break; # endif # if GNULIB_defined_ case ECANCELED: - return "Operation canceled"; + msg = "Operation canceled"; + break; # endif } + if (msg) + return (char *) msg; + { char *result = strerror (n); if (result == NULL || result[0] == '\0') { static char const fmt[] = "Unknown error (%d)"; - static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)]; - sprintf (mesg, fmt, n); - return mesg; + static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)]; + sprintf (msg_buf, fmt, n); + return msg_buf; } return result; diff -ruNp m4-1.4.12/lib/string.in.h m4-1.4.13/lib/string.in.h --- m4-1.4.12/lib/string.in.h 2008-09-21 20:33:02.000000000 -0600 +++ m4-1.4.13/lib/string.in.h 2008-12-11 22:14:44.000000000 -0700 @@ -18,7 +18,9 @@ #ifndef _GL_STRING_H +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STRING_H@ diff -ruNp m4-1.4.12/lib/sys_stat.in.h m4-1.4.13/lib/sys_stat.in.h --- m4-1.4.12/lib/sys_stat.in.h 2008-08-31 08:31:38.000000000 -0600 +++ m4-1.4.13/lib/sys_stat.in.h 2009-01-16 06:26:18.000000000 -0700 @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat header file. - Copyright (C) 2006-2008 Free Software Foundation, Inc. + Copyright (C) 2005-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,9 +21,22 @@ incomplete. It is intended to provide definitions and prototypes needed by an application. Start with what the system provides. */ +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +#if defined __need_system_sys_stat_h +/* Special invocation convention. */ + +#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ + +#else +/* Normal invocation convention. */ + #ifndef _GL_SYS_STAT_H -@PRAGMA_SYSTEM_HEADER@ +/* Get nlink_t. */ +#include <sys/types.h> /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ @@ -31,6 +44,8 @@ #ifndef _GL_SYS_STAT_H #define _GL_SYS_STAT_H +/* The definition of GL_LINK_WARNING is copied here. */ + /* Before doing "#define mkdir rpl_mkdir" below, we need to include all headers that may declare mkdir(). */ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ @@ -263,12 +278,31 @@ # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #endif + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_LSTAT@ +# if ! @HAVE_LSTAT@ /* mingw does not support symlinks, therefore it does not have lstat. But without links, stat does just fine. */ -#if ! @HAVE_LSTAT@ -# define lstat stat +# define lstat stat +# elif @REPLACE_LSTAT@ +# undef lstat +# define lstat rpl_lstat +extern int rpl_lstat (const char *name, struct stat *buf); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lstat +# define lstat(p,b) \ + (GL_LINK_WARNING ("lstat is unportable - " \ + "use gnulib module lstat for portability"), \ + lstat (p, b)) #endif + #if @REPLACE_MKDIR@ # undef mkdir # define mkdir rpl_mkdir @@ -289,5 +323,39 @@ rpl_mkdir (char const *name, mode_t mode # endif #endif + +/* Declare BSD extensions. */ + +#if @GNULIB_LCHMOD@ +/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME + denotes a symbolic link. */ +# if !@HAVE_LCHMOD@ +/* The lchmod replacement follows symbolic links. Callers should take + this into account; lchmod should be applied only to arguments that + are known to not be symbolic links. On hosts that lack lchmod, + this can lead to race conditions between the check and the + invocation of lchmod, but we know of no workarounds that are + reliable in general. You might try requesting support for lchmod + from your operating system supplier. */ +# define lchmod chmod +# endif +# if 0 /* assume already declared */ +extern int lchmod (const char *filename, mode_t mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lchmod +# define lchmod(f,m) \ + (GL_LINK_WARNING ("lchmod is unportable - " \ + "use gnulib module lchmod for portability"), \ + lchmod (f, m)) +#endif + + +#ifdef __cplusplus +} +#endif + + #endif /* _GL_SYS_STAT_H */ #endif /* _GL_SYS_STAT_H */ +#endif diff -ruNp m4-1.4.12/lib/sys_time.in.h m4-1.4.13/lib/sys_time.in.h --- m4-1.4.12/lib/sys_time.in.h 2008-08-31 08:31:38.000000000 -0600 +++ m4-1.4.13/lib/sys_time.in.h 2008-12-11 22:14:46.000000000 -0700 @@ -18,7 +18,9 @@ /* Written by Paul Eggert. */ +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif #if defined _GL_SYS_TIME_H @@ -37,6 +39,10 @@ # include <time.h> # endif +#ifdef __cplusplus +extern "C" { +#endif + # if ! @HAVE_STRUCT_TIMEVAL@ struct timeval { @@ -51,4 +57,8 @@ struct timeval int gettimeofday (struct timeval *restrict, void *restrict); # endif +#ifdef __cplusplus +} +#endif + #endif /* _GL_SYS_TIME_H */ diff -ruNp m4-1.4.12/lib/sys_wait.in.h m4-1.4.13/lib/sys_wait.in.h --- m4-1.4.12/lib/sys_wait.in.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/sys_wait.in.h 2009-02-28 08:25:56.000000000 -0700 @@ -0,0 +1,108 @@ +/* A POSIX-like <sys/wait.h>. + Copyright (C) 2001-2003, 2005-2008 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + + +#ifndef _GL_SYS_WAIT_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@ +#endif + +#ifndef _GL_SYS_WAIT_H +#define _GL_SYS_WAIT_H + +/* The definition of GL_LINK_WARNING is copied here. */ + +#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +/* Unix API. */ + +/* The following macros apply to an argument x, that is a status of a process, + as returned by waitpid(). + On nearly all systems, including Linux/x86, WEXITSTATUS are bits 15..8 and + WTERMSIG are bits 7..0, while BeOS uses the opposite. Therefore programs + have to use the abstract macros. */ + +/* For valid x, exactly one of WIFSIGNALED(x), WIFEXITED(x), WIFSTOPPED(x) + is true. */ +# ifndef WIFSIGNALED +# define WIFSIGNALED(x) (WTERMSIG (x) != 0 && WTERMSIG(x) != 0x7f) +# endif +# ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +# endif +# ifndef WIFSTOPPED +# define WIFSTOPPED(x) (WTERMSIG (x) == 0x7f) +# endif + +/* The termination signal. Only to be accessed if WIFSIGNALED(x) is true. */ +# ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +# endif + +/* The exit status. Only to be accessed if WIFEXITED(x) is true. */ +# ifndef WEXITSTATUS +# define WEXITSTATUS(x) (((x) >> 8) & 0xff) +# endif + +/* True if the process dumped core. Not standardized by POSIX. */ +# ifndef WCOREDUMP +# define WCOREDUMP(x) ((x) & 0x80) +# endif + +# ifdef __cplusplus +extern "C" { +# endif + +/* Declarations of functions. */ + +# ifdef __cplusplus +} +# endif + +#else +/* Native Windows API. */ + +# include <process.h> + +# define waitpid(pid,statusp,options) _cwait (statusp, pid, WAIT_CHILD) + +/* The following macros apply to an argument x, that is a status of a process, + as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess(). + This value is simply an 'int', not composed of bit fields. */ + +/* When an unhandled fatal signal terminates a process, the exit code is 3. */ +# define WIFSIGNALED(x) ((x) == 3) +# define WIFEXITED(x) ((x) != 3) +# define WIFSTOPPED(x) 0 + +/* The signal that terminated a process is not known posthum. */ +# define WTERMSIG(x) SIGTERM + +# define WEXITSTATUS(x) (x) + +/* There are no core dumps. */ +# define WCOREDUMP(x) 0 + +#endif + +#endif /* _GL_SYS_WAIT_H */ +#endif /* _GL_SYS_WAIT_H */ diff -ruNp m4-1.4.12/lib/unistd.in.h m4-1.4.13/lib/unistd.in.h --- m4-1.4.12/lib/unistd.in.h 2008-10-09 21:04:39.000000000 -0600 +++ m4-1.4.13/lib/unistd.in.h 2009-03-29 21:17:23.000000000 -0600 @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <unistd.h>. - Copyright (C) 2004-2008 Free Software Foundation, Inc. + Copyright (C) 2003-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,9 @@ #ifndef _GL_UNISTD_H +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif /* The include_next requires a split double-inclusion guard. */ #if @HAVE_UNISTD_H@ @@ -27,12 +29,13 @@ #ifndef _GL_UNISTD_H #define _GL_UNISTD_H -/* mingw doesn't define the SEEK_* macros in <unistd.h>. */ +/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */ #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) # include <stdio.h> #endif /* mingw fails to declare _exit in <unistd.h>. */ +/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ #include <stdlib.h> #if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ @@ -40,9 +43,61 @@ # include <sys/types.h> #endif +#if @GNULIB_GETHOSTNAME@ +/* Get all possible declarations of gethostname(). */ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +# include <winsock2.h> +# if !defined _GL_SYS_SOCKET_H +# undef socket +# define socket socket_used_without_including_sys_socket_h +# undef connect +# define connect connect_used_without_including_sys_socket_h +# undef accept +# define accept accept_used_without_including_sys_socket_h +# undef bind +# define bind bind_used_without_including_sys_socket_h +# undef getpeername +# define getpeername getpeername_used_without_including_sys_socket_h +# undef getsockname +# define getsockname getsockname_used_without_including_sys_socket_h +# undef getsockopt +# define getsockopt getsockopt_used_without_including_sys_socket_h +# undef listen +# define listen listen_used_without_including_sys_socket_h +# undef recv +# define recv recv_used_without_including_sys_socket_h +# undef send +# define send send_used_without_including_sys_socket_h +# undef recvfrom +# define recvfrom recvfrom_used_without_including_sys_socket_h +# undef sendto +# define sendto sendto_used_without_including_sys_socket_h +# undef setsockopt +# define setsockopt setsockopt_used_without_including_sys_socket_h +# undef shutdown +# define shutdown shutdown_used_without_including_sys_socket_h +# endif +# if !defined _GL_SYS_SELECT_H +# undef select +# define select select_used_without_including_sys_select_h +# endif +# endif +#endif + /* The definition of GL_LINK_WARNING is copied here. */ +/* OS/2 EMX lacks these macros. */ +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + /* Declare overridden functions. */ #ifdef __cplusplus @@ -132,6 +187,21 @@ extern char **environ; #endif +#if @GNULIB_EUIDACCESS@ +# if !@HAVE_EUIDACCESS@ +/* Like access(), except that is uses the effective user id and group id of + the current process. */ +extern int euidaccess (const char *filename, int mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef euidaccess +# define euidaccess(f,m) \ + (GL_LINK_WARNING ("euidaccess is unportable - " \ + "use gnulib module euidaccess for portability"), \ + euidaccess (f, m)) +#endif + + #if @GNULIB_FCHDIR@ # if @REPLACE_FCHDIR@ @@ -218,6 +288,29 @@ extern char * getcwd (char *buf, size_t #endif +#if @GNULIB_GETDOMAINNAME@ +/* Return the NIS domain name of the machine. + WARNING! The NIS domain name is unrelated to the fully qualified host name + of the machine. It is also unrelated to email addresses. + WARNING! The NIS domain name is usually the empty string or "(none)" when + not using NIS. + + Put up to LEN bytes of the NIS domain name into NAME. + Null terminate it if the name is shorter than LEN. + If the NIS domain name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if !@HAVE_GETDOMAINNAME@ +extern int getdomainname(char *name, size_t len); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getdomainname +# define getdomainname(n,l) \ + (GL_LINK_WARNING ("getdomainname is unportable - " \ + "use gnulib module getdomainname for portability"), \ + getdomainname (n, l)) +#endif + + #if @GNULIB_GETDTABLESIZE@ # if !@HAVE_GETDTABLESIZE@ /* Return the maximum number of file descriptors in the current process. */ @@ -232,6 +325,33 @@ extern int getdtablesize (void); #endif +#if @GNULIB_GETHOSTNAME@ +/* Return the standard host name of the machine. + WARNING! The host name may or may not be fully qualified. + + Put up to LEN bytes of the host name into NAME. + Null terminate it if the name is shorter than LEN. + If the host name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define gethostname rpl_gethostname +# endif +# if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@ +extern int gethostname(char *name, size_t len); +# endif +#elif @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname +#elif defined GNULIB_POSIXCHECK +# undef gethostname +# define gethostname(n,l) \ + (GL_LINK_WARNING ("gethostname is unportable - " \ + "use gnulib module gethostname for portability"), \ + gethostname (n, l)) +#endif + + #if @GNULIB_GETLOGIN_R@ /* Copies the user's login name to NAME. The array pointed to by NAME has room for SIZE bytes. @@ -313,6 +433,36 @@ extern int getpagesize (void); #endif +#if @GNULIB_GETUSERSHELL@ +# if !@HAVE_GETUSERSHELL@ +/* Return the next valid login shell on the system, or NULL when the end of + the list has been reached. */ +extern char *getusershell (void); +/* Rewind to pointer that is advanced at each getusershell() call. */ +extern void setusershell (void); +/* Free the pointer that is advanced at each getusershell() call and + associated resources. */ +extern void endusershell (void); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getusershell +# define getusershell() \ + (GL_LINK_WARNING ("getusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + getusershell ()) +# undef setusershell +# define setusershell() \ + (GL_LINK_WARNING ("setusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + setusershell ()) +# undef endusershell +# define endusershell() \ + (GL_LINK_WARNING ("endusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + endusershell ()) +#endif + + #if @GNULIB_LCHOWN@ # if @REPLACE_LCHOWN@ /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE @@ -332,6 +482,23 @@ extern int lchown (char const *file, uid #endif +#if @GNULIB_LINK@ +/* Create a new hard link for an existing file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2001 specification + <http://www.opengroup.org/susv3xsh/link.html>. */ +# if !@HAVE_LINK@ +extern int link (const char *path1, const char *path2); +# endif +#elif defined GNULIB_POSIXCHECK +# undef link +# define link(path1,path2) \ + (GL_LINK_WARNING ("link is unportable - " \ + "use gnulib module link for portability"), \ + link (path1, path2)) +#endif + + #if @GNULIB_LSEEK@ # if @REPLACE_LSEEK@ /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. diff -ruNp m4-1.4.12/lib/vasnprintf.c m4-1.4.13/lib/vasnprintf.c --- m4-1.4.12/lib/vasnprintf.c 2008-09-22 20:20:56.000000000 -0600 +++ m4-1.4.13/lib/vasnprintf.c 2009-03-23 05:56:10.000000000 -0600 @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2008 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -117,29 +117,6 @@ # include "fpucw.h" #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 - /* Default parameters. */ #ifndef VASNPRINTF # if WIDE_CHAR_VERSION @@ -152,6 +129,7 @@ local_wcslen (const wchar_t *s) # define DIRECTIVES wchar_t_directives # define PRINTF_PARSE wprintf_parse # define DCHAR_CPY wmemcpy +# define DCHAR_SET wmemset # else # define VASNPRINTF vasnprintf # define FCHAR_T char @@ -162,6 +140,7 @@ local_wcslen (const wchar_t *s) # define DIRECTIVES char_directives # define PRINTF_PARSE printf_parse # define DCHAR_CPY memcpy +# define DCHAR_SET memset # endif #endif #if WIDE_CHAR_VERSION @@ -215,6 +194,64 @@ local_wcslen (const wchar_t *s) #undef remainder #define remainder rem +#if !USE_SNPRINTF && !WIDE_CHAR_VERSION +# if (HAVE_STRNLEN && !defined _AIX) +# define local_strnlen strnlen +# else +# ifndef local_strnlen_defined +# define local_strnlen_defined 1 +static size_t +local_strnlen (const char *string, size_t maxlen) +{ + const char *end = memchr (string, '\0', maxlen); + return end ? (size_t) (end - string) : maxlen; +} +# endif +# endif +#endif + +#if (!USE_SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T && (WIDE_CHAR_VERSION || DCHAR_IS_TCHAR) +# if HAVE_WCSLEN +# define local_wcslen wcslen +# else + /* 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 !USE_SNPRINTF && HAVE_WCHAR_T && WIDE_CHAR_VERSION +# if HAVE_WCSNLEN +# define local_wcsnlen wcsnlen +# else +# ifndef local_wcsnlen_defined +# define local_wcsnlen_defined 1 +static size_t +local_wcsnlen (const wchar_t *s, size_t maxlen) +{ + const wchar_t *ptr; + + for (ptr = s; maxlen > 0 && *ptr != (wchar_t) 0; ptr++, maxlen--) + ; + return ptr - s; +} +# endif +# endif +#endif + #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL /* Determine the decimal-point character according to the current locale. */ # ifndef decimal_point_char_defined @@ -376,7 +413,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) Normalise [q[m-1],...,q[0]], yields q. If m>=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<intDsize. + s:=intDsize-1-(highest bit in b[n-1]), 0<=s<intDsize. Shift a and b left by s bits, copying them. r:=a. r=[r[m],...,r[0]], b=[b[n-1],...,b[0]] with b[n-1]>=beta/2. For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).} @@ -2066,6 +2103,523 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t * } } #endif +#if (!USE_SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T + else if (dp->conversion == 's' +# if WIDE_CHAR_VERSION + && a.arg[dp->arg_index].type != TYPE_WIDE_STRING +# else + && a.arg[dp->arg_index].type == TYPE_WIDE_STRING +# endif + ) + { + /* The normal handling of the 's' directive below requires + allocating a temporary buffer. The determination of its + length (tmp_length), in the case when a precision is + specified, below requires a conversion between a char[] + string and a wchar_t[] wide string. It could be done, but + we have no guarantee that the implementation of sprintf will + use the exactly same algorithm. Without this guarantee, it + is possible to have buffer overrun bugs. In order to avoid + such bugs, we implement the entire processing of the 's' + directive ourselves. */ + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = (unsigned int) (-arg); + } + else + width = arg; + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + +# if WIDE_CHAR_VERSION + /* %s in vasnwprintf. See the specification of fwprintf. */ + { + const char *arg = a.arg[dp->arg_index].a.a_string; + const char *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only as many bytes as needed to produce PRECISION + wide characters, from the left. */ +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count; +# if HAVE_MBRTOWC + count = mbrlen (arg_end, MB_CUR_MAX, &state); +# else + count = mblen (arg_end, MB_CUR_MAX); +# endif + if (count == 0) + /* Found the terminating NUL. */ + break; + if (count < 0) + { + /* Invalid or incomplete multibyte character. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of wide + characters. */ +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (;;) + { + int count; +# if HAVE_MBRTOWC + count = mbrlen (arg_end, MB_CUR_MAX, &state); +# else + count = mblen (arg_end, MB_CUR_MAX); +# endif + if (count == 0) + /* Found the terminating NUL. */ + break; + if (count < 0) + { + /* Invalid or incomplete multibyte character. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (has_width && width > characters + && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + + if (has_precision || has_width) + { + /* We know the number of wide characters in advance. */ + size_t remaining; +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + ENSURE_ALLOCATION (xsum (length, characters)); + for (remaining = characters; remaining > 0; remaining--) + { + wchar_t wc; + int count; +# if HAVE_MBRTOWC + count = mbrtowc (&wc, arg, arg_end - arg, &state); +# else + count = mbtowc (&wc, arg, arg_end - arg); +# endif + if (count <= 0) + /* mbrtowc not consistent with mbrlen, or mbtowc + not consistent with mblen. */ + abort (); + result[length++] = wc; + arg += count; + } + if (!(arg == arg_end)) + abort (); + } + else + { +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + while (arg < arg_end) + { + wchar_t wc; + int count; +# if HAVE_MBRTOWC + count = mbrtowc (&wc, arg, arg_end - arg, &state); +# else + count = mbtowc (&wc, arg, arg_end - arg); +# endif + if (count <= 0) + /* mbrtowc not consistent with mbrlen, or mbtowc + not consistent with mblen. */ + abort (); + ENSURE_ALLOCATION (xsum (length, 1)); + result[length++] = wc; + arg += count; + } + } + + if (has_width && width > characters + && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } +# else + /* %ls in vasnprintf. See the specification of fprintf. */ + { + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; + const wchar_t *arg_end; + size_t characters; +# if !DCHAR_IS_TCHAR + /* This code assumes that TCHAR_T is 'char'. */ + typedef int TCHAR_T_verify[2 * (sizeof (TCHAR_T) == 1) - 1]; + TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t tmpdst_len; +# endif + size_t w; + + if (has_precision) + { + /* Use only as many wide characters as needed to produce + at most PRECISION bytes, from the left. */ +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + while (precision > 0) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg_end, &state); +# else + count = wctomb (buf, *arg_end); +# endif + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + if (precision < count) + break; + arg_end++; + characters += count; + precision -= count; + } + } +# if DCHAR_IS_TCHAR + else if (has_width) +# else + else +# endif + { + /* Use the entire string, and count the number of + bytes. */ +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (;;) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg_end, &state); +# else + count = wctomb (buf, *arg_end); +# endif + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end++; + characters += count; + } + } +# if DCHAR_IS_TCHAR + else + { + /* Use the entire string. */ + arg_end = arg + local_wcslen (arg); + /* The number of bytes doesn't matter. */ + characters = 0; + } +# endif + +# if !DCHAR_IS_TCHAR + /* Convert the string into a piece of temporary memory. */ + tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T)); + if (tmpsrc == NULL) + goto out_of_memory; + { + TCHAR_T *tmpptr = tmpsrc; + size_t remaining; +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + for (remaining = characters; remaining > 0; ) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg, &state); +# else + count = wctomb (buf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (tmpptr, buf, count); + tmpptr += count; + arg++; + remaining -= count; + } + if (!(arg == arg_end)) + abort (); + } + + /* Convert from TCHAR_T[] to DCHAR_T[]. */ + tmpdst = NULL; + tmpdst_len = 0; + if (DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, characters, + NULL, + &tmpdst, &tmpdst_len) + < 0) + { + int saved_errno = errno; + free (tmpsrc); + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + free (tmpsrc); +# endif + + if (has_width) + { +# if ENABLE_UNISTDIO + /* Outside POSIX, it's preferrable to compare the width + against the number of _characters_ of the converted + value. */ + w = DCHAR_MBSNLEN (result + length, characters); +# else + /* The width is compared against the number of _bytes_ + of the converted value, says POSIX. */ + w = characters; +# endif + } + else + /* w doesn't matter. */ + w = 0; + + if (has_width && width > w + && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_TCHAR + if (has_precision || has_width) + { + /* We know the number of bytes in advance. */ + size_t remaining; +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + ENSURE_ALLOCATION (xsum (length, characters)); + for (remaining = characters; remaining > 0; ) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg, &state); +# else + count = wctomb (buf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (result + length, buf, count); + length += count; + arg++; + remaining -= count; + } + if (!(arg == arg_end)) + abort (); + } + else + { +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + while (arg < arg_end) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg, &state); +# else + count = wctomb (buf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + ENSURE_ALLOCATION (xsum (length, count)); + memcpy (result + length, buf, count); + length += count; + arg++; + } + } +# else + ENSURE_ALLOCATION (xsum (length, tmpdst_len)); + DCHAR_CPY (result + length, tmpdst, tmpdst_len); + free (tmpdst); + length += tmpdst_len; +# endif + + if (has_width && width > w + && (dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + } +# endif +#endif #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL else if ((dp->conversion == 'a' || dp->conversion == 'A') # if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE)) @@ -4032,16 +4586,64 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t * # 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); +# if WIDE_CHAR_VERSION + /* ISO C says about %ls in fwprintf: + "If the precision is not specified or is greater + than the size of the array, the array shall + contain a null wide character." + So if there is a precision, we must not use + wcslen. */ + const wchar_t *arg = + a.arg[dp->arg_index].a.a_wide_string; + + if (has_precision) + tmp_length = local_wcsnlen (arg, precision); + else + tmp_length = local_wcslen (arg); +# else + /* ISO C says about %ls in fprintf: + "If a precision is specified, no more than that + many bytes are written (including shift + sequences, if any), and the array shall contain + a null wide character if, to equal the + multibyte character sequence length given by + the precision, the function would need to + access a wide character one past the end of the + array." + So if there is a precision, we must not use + wcslen. */ + /* This case has already been handled above. */ + abort (); # endif } else # endif - tmp_length = strlen (a.arg[dp->arg_index].a.a_string); + { +# if WIDE_CHAR_VERSION + /* ISO C says about %s in fwprintf: + "If the precision is not specified or is greater + than the size of the converted array, the + converted array shall contain a null wide + character." + So if there is a precision, we must not use + strlen. */ + /* This case has already been handled above. */ + abort (); +# else + /* ISO C says about %s in fprintf: + "If the precision is not specified or greater + than the size of the array, the array shall + contain a null character." + So if there is a precision, we must not use + strlen. */ + const char *arg = a.arg[dp->arg_index].a.a_string; + + if (has_precision) + tmp_length = local_strnlen (arg, precision); + else + tmp_length = strlen (arg); +# endif + } break; case 'p': diff -ruNp m4-1.4.12/lib/verify.h m4-1.4.13/lib/verify.h --- m4-1.4.12/lib/verify.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/verify.h 2008-12-24 06:20:31.000000000 -0700 @@ -0,0 +1,140 @@ +/* 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* 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 <int w> + 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 -ruNp m4-1.4.12/lib/version-etc.c m4-1.4.13/lib/version-etc.c --- m4-1.4.12/lib/version-etc.c 2008-02-23 10:30:01.000000000 -0700 +++ m4-1.4.13/lib/version-etc.c 2009-01-28 06:24:35.000000000 -0700 @@ -1,5 +1,5 @@ -/* Utility to help print --version output in a consistent format. - Copyright (C) 1999-2008 Free Software Foundation, Inc. +/* Print --version and bug-reporting information in a consistent format. + Copyright (C) 1999-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ #include "gettext.h" #define _(msgid) gettext (msgid) -enum { COPYRIGHT_YEAR = 2008 }; +enum { COPYRIGHT_YEAR = 2009 }; /* Like version_etc, below, but with the NULL-terminated author list provided via a variable of type va_list. */ @@ -66,7 +66,7 @@ version_etc_va (FILE *stream, fputs (_("\ \n\ -License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\ +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\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\ @@ -170,3 +170,17 @@ version_etc (FILE *stream, va_start (authors, version); version_etc_va (stream, command_name, package, version, authors); } + +void +emit_bug_reporting_address (void) +{ + /* TRANSLATORS: The placeholder indicates the bug-reporting address + for this package. Please add _another line_ saying + "Report translation bugs to <...>\n" with the address for translation + bugs (typically your translation team's web or email address). */ + printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + printf (_("%s home page: <http://www.gnu.org/software/%s/>.\n"), + PACKAGE_NAME, PACKAGE); + fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>.\n"), + stdout); +} diff -ruNp m4-1.4.12/lib/version-etc.h m4-1.4.13/lib/version-etc.h --- m4-1.4.12/lib/version-etc.h 2008-02-23 10:30:01.000000000 -0700 +++ m4-1.4.13/lib/version-etc.h 2009-01-24 12:02:17.000000000 -0700 @@ -1,5 +1,5 @@ -/* Utility to help print --version output in a consistent format. - Copyright (C) 1999, 2003, 2005 Free Software Foundation, Inc. +/* Print --version and bug-reporting information in a consistent format. + Copyright (C) 1999, 2003, 2005, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,8 @@ extern void version_etc_va (FILE *stream extern void version_etc (FILE *stream, const char *command_name, const char *package, const char *version, - /* const char *author1, ...*/ ...); + /* const char *author1, ...*/ ...); + +extern void emit_bug_reporting_address (void); #endif /* VERSION_ETC_H */ diff -ruNp m4-1.4.12/lib/w32spawn.h m4-1.4.13/lib/w32spawn.h --- m4-1.4.12/lib/w32spawn.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/w32spawn.h 2009-03-08 20:15:00.000000000 -0600 @@ -0,0 +1,176 @@ +/* Auxiliary functions for the creation of subprocesses. Native Woe32 API. + Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Get declarations of the Win32 API functions. */ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +/* Get _get_osfhandle() and _open_osfhandle(). */ +#include <io.h> + +#include <stdbool.h> +#include <string.h> +#include <errno.h> + +#include "xalloc.h" + +/* Duplicates a file handle, making the copy uninheritable. */ +static int +dup_noinherit (int fd) +{ + HANDLE curr_process = GetCurrentProcess (); + HANDLE old_handle = (HANDLE) _get_osfhandle (fd); + HANDLE new_handle; + int nfd; + + if (!DuplicateHandle (curr_process, /* SourceProcessHandle */ + old_handle, /* SourceHandle */ + curr_process, /* TargetProcessHandle */ + (PHANDLE) &new_handle, /* TargetHandle */ + (DWORD) 0, /* DesiredAccess */ + FALSE, /* InheritHandle */ + DUPLICATE_SAME_ACCESS)) /* Options */ + error (EXIT_FAILURE, 0, _("DuplicateHandle failed with error code 0x%08x"), + (unsigned int) GetLastError ()); + + nfd = _open_osfhandle ((long) new_handle, O_BINARY); + if (nfd < 0) + error (EXIT_FAILURE, errno, _("_open_osfhandle failed")); + + return nfd; +} + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +static char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XNMALLOC (1 + argc + 1, char *); + + /* Add an element upfront that can be used when argv[0] turns out to be a + script, not a program. + On Unix, this would be "/bin/sh". On native Windows, "sh" is actually + "sh.exe". We have to omit the directory part and rely on the search in + PATH, because the mingw "mount points" are not visible inside Win32 + CreateProcess(). */ + *new_argv++ = "sh.exe"; + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + bool quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = (char *) xmalloc (length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} diff -ruNp m4-1.4.12/lib/wait-process.c m4-1.4.13/lib/wait-process.c --- m4-1.4.12/lib/wait-process.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/wait-process.c 2009-03-01 16:12:03.000000000 -0700 @@ -0,0 +1,361 @@ +/* Waiting for a subprocess to finish. + Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + +#include <config.h> + +/* Specification. */ +#include "wait-process.h" + +#include <errno.h> +#include <stdlib.h> +#include <string.h> +#include <signal.h> + +#include <sys/types.h> +#include <sys/wait.h> + +#include "error.h" +#include "fatal-signal.h" +#include "xalloc.h" +#include "gettext.h" + +#define _(str) gettext (str) + +#define SIZEOF(a) (sizeof(a) / sizeof(a[0])) + + +#if defined _MSC_VER || defined __MINGW32__ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +/* The return value of spawnvp() is really a process handle as returned + by CreateProcess(). Therefore we can kill it using TerminateProcess. */ +#define kill(pid,sig) TerminateProcess ((HANDLE) (pid), sig) + +#endif + + +/* Type of an entry in the slaves array. + The 'used' bit determines whether this entry is currently in use. + (If pid_t was an atomic type like sig_atomic_t, we could just set the + 'child' field to 0 when unregistering a slave process, and wouldn't need + the 'used' field.) + The 'used' and 'child' fields are accessed from within the cleanup_slaves() + action, therefore we mark them as 'volatile'. */ +typedef struct +{ + volatile sig_atomic_t used; + volatile pid_t child; +} +slaves_entry_t; + +/* The registered slave subprocesses. */ +static slaves_entry_t static_slaves[32]; +static slaves_entry_t * volatile slaves = static_slaves; +static sig_atomic_t volatile slaves_count = 0; +static size_t slaves_allocated = SIZEOF (static_slaves); + +/* The termination signal for slave subprocesses. + 2003-10-07: Terminator becomes Governator. */ +#ifdef SIGHUP +# define TERMINATOR SIGHUP +#else +# define TERMINATOR SIGTERM +#endif + +/* The cleanup action. It gets called asynchronously. */ +static void +cleanup_slaves (void) +{ + for (;;) + { + /* Get the last registered slave. */ + size_t n = slaves_count; + if (n == 0) + break; + n--; + slaves_count = n; + /* Skip unused entries in the slaves array. */ + if (slaves[n].used) + { + pid_t slave = slaves[n].child; + + /* Kill the slave. */ + kill (slave, TERMINATOR); + } + } +} + +/* Register a subprocess as being a slave process. This means that the + subprocess will be terminated when its creator receives a catchable fatal + signal or exits normally. Registration ends when wait_subprocess() + notices that the subprocess has exited. */ +void +register_slave_subprocess (pid_t child) +{ + static bool cleanup_slaves_registered = false; + if (!cleanup_slaves_registered) + { + atexit (cleanup_slaves); + at_fatal_signal (cleanup_slaves); + cleanup_slaves_registered = true; + } + + /* Try to store the new slave in an unused entry of the slaves array. */ + { + slaves_entry_t *s = slaves; + slaves_entry_t *s_end = s + slaves_count; + + for (; s < s_end; s++) + if (!s->used) + { + /* The two uses of 'volatile' in the slaves_entry_t type above + (and ISO C 99 section 5.1.2.3.(5)) ensure that we mark the + entry as used only after the child pid has been written to the + memory location s->child. */ + s->child = child; + s->used = 1; + return; + } + } + + if (slaves_count == slaves_allocated) + { + /* Extend the slaves array. Note that we cannot use xrealloc(), + because then the cleanup_slaves() function could access an already + deallocated array. */ + slaves_entry_t *old_slaves = slaves; + size_t new_slaves_allocated = 2 * slaves_allocated; + slaves_entry_t *new_slaves = + (slaves_entry_t *) + malloc (new_slaves_allocated * sizeof (slaves_entry_t)); + if (new_slaves == NULL) + { + /* xalloc_die() will call exit() which will invoke cleanup_slaves(). + Additionally we need to kill child, because it's not yet among + the slaves list. */ + kill (child, TERMINATOR); + xalloc_die (); + } + memcpy (new_slaves, old_slaves, + slaves_allocated * sizeof (slaves_entry_t)); + slaves = new_slaves; + slaves_allocated = new_slaves_allocated; + /* Now we can free the old slaves array. */ + if (old_slaves != static_slaves) + free (old_slaves); + } + /* The three uses of 'volatile' in the types above (and ISO C 99 section + 5.1.2.3.(5)) ensure that we increment the slaves_count only after the + new slave and its 'used' bit have been written to the memory locations + that make up slaves[slaves_count]. */ + slaves[slaves_count].child = child; + slaves[slaves_count].used = 1; + slaves_count++; +} + +/* Unregister a child from the list of slave subprocesses. */ +static inline void +unregister_slave_subprocess (pid_t child) +{ + /* The easiest way to remove an entry from a list that can be used by + an asynchronous signal handler is just to mark it as unused. For this, + we rely on sig_atomic_t. */ + slaves_entry_t *s = slaves; + slaves_entry_t *s_end = s + slaves_count; + + for (; s < s_end; s++) + if (s->used && s->child == child) + s->used = 0; +} + + +/* Wait for a subprocess to finish. Return its exit code. + If it didn't terminate correctly, exit if exit_on_error is true, otherwise + return 127. */ +int +wait_subprocess (pid_t child, const char *progname, + bool ignore_sigpipe, bool null_stderr, + bool slave_process, bool exit_on_error, + int *termsigp) +{ +#if HAVE_WAITID && defined WNOWAIT && 0 + /* Commented out because waitid() without WEXITED and with WNOWAIT doesn't + work: On Solaris 7 and OSF/1 4.0, it returns -1 and sets errno = ECHILD, + and on HP-UX 10.20 it just hangs. */ + /* Use of waitid() with WNOWAIT avoids a race condition: If slave_process is + true, and this process sleeps a very long time between the return from + waitpid() and the execution of unregister_slave_subprocess(), and + meanwhile another process acquires the same PID as child, and then - still + before unregister_slave_subprocess() - this process gets a fatal signal, + it would kill the other totally unrelated process. */ + siginfo_t info; + + if (termsigp != NULL) + *termsigp = 0; + for (;;) + { + if (waitid (P_PID, child, &info, WEXITED | (slave_process ? WNOWAIT : 0)) + < 0) + { +# ifdef EINTR + if (errno == EINTR) + continue; +# endif + if (exit_on_error || !null_stderr) + error (exit_on_error ? EXIT_FAILURE : 0, errno, + _("%s subprocess"), progname); + return 127; + } + + /* info.si_code is set to one of CLD_EXITED, CLD_KILLED, CLD_DUMPED, + CLD_TRAPPED, CLD_STOPPED, CLD_CONTINUED. Loop until the program + terminates. */ + if (info.si_code == CLD_EXITED + || info.si_code == CLD_KILLED || info.si_code == CLD_DUMPED) + break; + } + + /* The child process has exited or was signalled. */ + + if (slave_process) + { + /* Unregister the child from the list of slave subprocesses, so that + later, when we exit, we don't kill a totally unrelated process which + may have acquired the same pid. */ + unregister_slave_subprocess (child); + + /* Now remove the zombie from the process list. */ + for (;;) + { + if (waitid (P_PID, child, &info, WEXITED) < 0) + { +# ifdef EINTR + if (errno == EINTR) + continue; +# endif + if (exit_on_error || !null_stderr) + error (exit_on_error ? EXIT_FAILURE : 0, errno, + _("%s subprocess"), progname); + return 127; + } + break; + } + } + + switch (info.si_code) + { + case CLD_KILLED: + case CLD_DUMPED: + if (termsigp != NULL) + *termsigp = info.si_status; /* TODO: or info.si_signo? */ +# ifdef SIGPIPE + if (info.si_status == SIGPIPE && ignore_sigpipe) + return 0; +# endif + if (exit_on_error || (!null_stderr && termsigp == NULL)) + error (exit_on_error ? EXIT_FAILURE : 0, 0, + _("%s subprocess got fatal signal %d"), + progname, info.si_status); + return 127; + case CLD_EXITED: + if (info.si_status == 127) + { + if (exit_on_error || !null_stderr) + error (exit_on_error ? EXIT_FAILURE : 0, 0, + _("%s subprocess failed"), progname); + return 127; + } + return info.si_status; + default: + abort (); + } +#else + /* waitpid() is just as portable as wait() nowadays. */ + int status; + + if (termsigp != NULL) + *termsigp = 0; + status = 0; + for (;;) + { + int result = waitpid (child, &status, 0); + + if (result != child) + { +# ifdef EINTR + if (errno == EINTR) + continue; +# endif +# if 0 /* defined ECHILD */ + if (errno == ECHILD) + { + /* Child process nonexistent?! Assume it terminated + successfully. */ + status = 0; + break; + } +# endif + if (exit_on_error || !null_stderr) + error (exit_on_error ? EXIT_FAILURE : 0, errno, + _("%s subprocess"), progname); + return 127; + } + + /* One of WIFSIGNALED (status), WIFEXITED (status), WIFSTOPPED (status) + must always be true, since we did not specify WCONTINUED in the + waitpid() call. Loop until the program terminates. */ + if (!WIFSTOPPED (status)) + break; + } + + /* The child process has exited or was signalled. */ + + if (slave_process) + /* Unregister the child from the list of slave subprocesses, so that + later, when we exit, we don't kill a totally unrelated process which + may have acquired the same pid. */ + unregister_slave_subprocess (child); + + if (WIFSIGNALED (status)) + { + if (termsigp != NULL) + *termsigp = WTERMSIG (status); +# ifdef SIGPIPE + if (WTERMSIG (status) == SIGPIPE && ignore_sigpipe) + return 0; +# endif + if (exit_on_error || (!null_stderr && termsigp == NULL)) + error (exit_on_error ? EXIT_FAILURE : 0, 0, + _("%s subprocess got fatal signal %d"), + progname, (int) WTERMSIG (status)); + return 127; + } + if (!WIFEXITED (status)) + abort (); + if (WEXITSTATUS (status) == 127) + { + if (exit_on_error || !null_stderr) + error (exit_on_error ? EXIT_FAILURE : 0, 0, + _("%s subprocess failed"), progname); + return 127; + } + return WEXITSTATUS (status); +#endif +} diff -ruNp m4-1.4.12/lib/wait-process.h m4-1.4.13/lib/wait-process.h --- m4-1.4.12/lib/wait-process.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/wait-process.h 2009-03-01 16:12:03.000000000 -0700 @@ -0,0 +1,74 @@ +/* Waiting for a subprocess to finish. + Copyright (C) 2001-2003, 2006, 2008-2009 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _WAIT_PROCESS_H +#define _WAIT_PROCESS_H + +/* Get pid_t. */ +#include <stdlib.h> +#include <unistd.h> +#include <sys/types.h> + +#include <stdbool.h> + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Wait for a subprocess to finish. Return its exit code. + If it didn't terminate correctly, exit if exit_on_error is true, otherwise + return 127. + Arguments: + - child is the pid of the subprocess. + - progname is the name of the program executed by the subprocess, used for + error messages. + - If ignore_sigpipe is true, consider a subprocess termination due to + SIGPIPE as equivalent to a success. This is suitable for processes whose + only purpose is to write to standard output. This flag can be safely set + to false when the process' standard output is known to go to DEV_NULL. + - If null_stderr is true, the usual error message to stderr will be omitted. + This is suitable when the subprocess does not fulfill an important task. + - slave_process should be set to true if the process has been launched as a + slave process. + - If exit_on_error is true, any error will cause the main process to exit + with an error status. + - If termsigp is not NULL: *termsig will be set to the signal that + terminated the subprocess (if supported by the platform: not on native + Windows platforms), otherwise 0, and the error message about the signal + that terminated the subprocess will be omitted. + Prerequisites: The signal handler for SIGCHLD should not be set to SIG_IGN, + otherwise this function will not work. */ +extern int wait_subprocess (pid_t child, const char *progname, + bool ignore_sigpipe, bool null_stderr, + bool slave_process, bool exit_on_error, + int *termsigp); + +/* Register a subprocess as being a slave process. This means that the + subprocess will be terminated when its creator receives a catchable fatal + signal or exits normally. Registration ends when wait_subprocess() + notices that the subprocess has exited. */ +extern void register_slave_subprocess (pid_t child); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _WAIT_PROCESS_H */ diff -ruNp m4-1.4.12/lib/wchar.in.h m4-1.4.13/lib/wchar.in.h --- m4-1.4.12/lib/wchar.in.h 2008-09-20 09:57:56.000000000 -0600 +++ m4-1.4.13/lib/wchar.in.h 2009-01-17 06:24:27.000000000 -0700 @@ -1,6 +1,6 @@ /* A substitute for ISO C99 <wchar.h>, for platforms that have issues. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,10 +26,22 @@ * the declaration of wcwidth(). */ +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif -#ifdef __need_mbstate_t -/* Special invocation convention inside uClibc header files. */ +#if defined __need_mbstate_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H +/* Special invocation convention: + - Inside uClibc header files. + - On HP-UX 11.00 we have a sequence of nested includes + <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>, + once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h> + and once directly. In both situations 'wint_t' is not yet defined, + therefore we cannot provide the function overrides; instead include only + the system's <wchar.h>. + - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and + the latter includes <wchar.h>. But here, we have no way to detect whether + <wctype.h> is completely included or is still being included. */ #@INCLUDE_NEXT@ @NEXT_WCHAR_H@ @@ -38,6 +50,8 @@ #ifndef _GL_WCHAR_H +#define _GL_ALREADY_INCLUDING_WCHAR_H + /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before <wchar.h>. BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be @@ -53,6 +67,8 @@ # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ #endif +#undef _GL_ALREADY_INCLUDING_WCHAR_H + #ifndef _GL_WCHAR_H #define _GL_WCHAR_H @@ -66,6 +82,197 @@ extern "C" { /* Define wint_t. (Also done in wctype.in.h.) */ #if !@HAVE_WINT_T@ && !defined wint_t # define wint_t int +# ifndef WEOF +# define WEOF -1 +# endif +#endif + + +/* Override mbstate_t if it is too small. + On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for + implementing mbrtowc for encodings like UTF-8. */ +#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ +typedef int rpl_mbstate_t; +# undef mbstate_t +# define mbstate_t rpl_mbstate_t +# define GNULIB_defined_mbstate_t 1 +#endif + + +/* Convert a single-byte character to a wide character. */ +#if @GNULIB_BTOWC@ +# if @REPLACE_BTOWC@ +# undef btowc +# define btowc rpl_btowc +# endif +# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@ +extern wint_t btowc (int c); +# endif +#elif defined GNULIB_POSIXCHECK +# undef btowc +# define btowc(c) \ + (GL_LINK_WARNING ("btowc is unportable - " \ + "use gnulib module btowc for portability"), \ + btowc (c)) +#endif + + +/* Convert a wide character to a single-byte character. */ +#if @GNULIB_WCTOB@ +# if @REPLACE_WCTOB@ +# undef wctob +# define wctob rpl_wctob +# endif +# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@ +/* wctob is provided by gnulib, or wctob exists but is not declared. */ +extern int wctob (wint_t wc); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wctob +# define wctob(w) \ + (GL_LINK_WARNING ("wctob is unportable - " \ + "use gnulib module wctob for portability"), \ + wctob (w)) +#endif + + +/* Test whether *PS is in the initial state. */ +#if @GNULIB_MBSINIT@ +# if @REPLACE_MBSINIT@ +# undef mbsinit +# define mbsinit rpl_mbsinit +# endif +# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@ +extern int mbsinit (const mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbsinit +# define mbsinit(p) \ + (GL_LINK_WARNING ("mbsinit is unportable - " \ + "use gnulib module mbsinit for portability"), \ + mbsinit (p)) +#endif + + +/* Convert a multibyte character to a wide character. */ +#if @GNULIB_MBRTOWC@ +# if @REPLACE_MBRTOWC@ +# undef mbrtowc +# define mbrtowc rpl_mbrtowc +# endif +# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@ +extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbrtowc +# define mbrtowc(w,s,n,p) \ + (GL_LINK_WARNING ("mbrtowc is unportable - " \ + "use gnulib module mbrtowc for portability"), \ + mbrtowc (w, s, n, p)) +#endif + + +/* Recognize a multibyte character. */ +#if @GNULIB_MBRLEN@ +# if @REPLACE_MBRLEN@ +# undef mbrlen +# define mbrlen rpl_mbrlen +# endif +# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@ +extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbrlen +# define mbrlen(s,n,p) \ + (GL_LINK_WARNING ("mbrlen is unportable - " \ + "use gnulib module mbrlen for portability"), \ + mbrlen (s, n, p)) +#endif + + +/* Convert a string to a wide string. */ +#if @GNULIB_MBSRTOWCS@ +# if @REPLACE_MBSRTOWCS@ +# undef mbsrtowcs +# define mbsrtowcs rpl_mbsrtowcs +# endif +# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@ +extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbsrtowcs +# define mbsrtowcs(d,s,l,p) \ + (GL_LINK_WARNING ("mbsrtowcs is unportable - " \ + "use gnulib module mbsrtowcs for portability"), \ + mbsrtowcs (d, s, l, p)) +#endif + + +/* Convert a string to a wide string. */ +#if @GNULIB_MBSNRTOWCS@ +# if @REPLACE_MBSNRTOWCS@ +# undef mbsnrtowcs +# define mbsnrtowcs rpl_mbsnrtowcs +# endif +# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@ +extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbsnrtowcs +# define mbsnrtowcs(d,s,n,l,p) \ + (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \ + "use gnulib module mbsnrtowcs for portability"), \ + mbsnrtowcs (d, s, n, l, p)) +#endif + + +/* Convert a wide character to a multibyte character. */ +#if @GNULIB_WCRTOMB@ +# if @REPLACE_WCRTOMB@ +# undef wcrtomb +# define wcrtomb rpl_wcrtomb +# endif +# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@ +extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcrtomb +# define wcrtomb(s,w,p) \ + (GL_LINK_WARNING ("wcrtomb is unportable - " \ + "use gnulib module wcrtomb for portability"), \ + wcrtomb (s, w, p)) +#endif + + +/* Convert a wide string to a string. */ +#if @GNULIB_WCSRTOMBS@ +# if @REPLACE_WCSRTOMBS@ +# undef wcsrtombs +# define wcsrtombs rpl_wcsrtombs +# endif +# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@ +extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsrtombs +# define wcsrtombs(d,s,l,p) \ + (GL_LINK_WARNING ("wcsrtombs is unportable - " \ + "use gnulib module wcsrtombs for portability"), \ + wcsrtombs (d, s, l, p)) +#endif + + +/* Convert a wide string to a string. */ +#if @GNULIB_WCSNRTOMBS@ +# if !@HAVE_WCSNRTOMBS@ +extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsnrtombs +# define wcsnrtombs(d,s,n,l,p) \ + (GL_LINK_WARNING ("wcsnrtombs is unportable - " \ + "use gnulib module wcsnrtombs for portability"), \ + wcsnrtombs (d, s, n, l, p)) #endif diff -ruNp m4-1.4.12/lib/wcrtomb.c m4-1.4.13/lib/wcrtomb.c --- m4-1.4.12/lib/wcrtomb.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/lib/wcrtomb.c 2008-12-24 06:20:31.000000000 -0700 @@ -0,0 +1,53 @@ +/* Convert wide character to multibyte character. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include <errno.h> +#include <stdlib.h> + + +size_t +wcrtomb (char *s, wchar_t wc, mbstate_t *ps) +{ + /* This implementation of wcrtomb on top of wctomb() supports only + stateless encodings. ps must be in the initial state. */ + if (ps != NULL && !mbsinit (ps)) + { + errno = EINVAL; + return (size_t)(-1); + } + + if (s == NULL) + /* We know the NUL wide character corresponds to the NUL character. */ + return 1; + else + { + int ret = wctomb (s, wc); + + if (ret >= 0) + return ret; + else + { + errno = EILSEQ; + return (size_t)(-1); + } + } +} diff -ruNp m4-1.4.12/lib/wctype.in.h m4-1.4.13/lib/wctype.in.h --- m4-1.4.12/lib/wctype.in.h 2008-09-20 09:57:56.000000000 -0600 +++ m4-1.4.13/lib/wctype.in.h 2009-01-01 19:41:09.000000000 -0700 @@ -28,7 +28,9 @@ #ifndef _GL_WCTYPE_H +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif #if @HAVE_WINT_T@ /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. @@ -55,6 +57,9 @@ /* Define wint_t. (Also done in wchar.in.h.) */ #if !@HAVE_WINT_T@ && !defined wint_t # define wint_t int +# ifndef WEOF +# define WEOF -1 +# endif #endif /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions. diff -ruNp m4-1.4.12/lib/xmalloc.c m4-1.4.13/lib/xmalloc.c --- m4-1.4.12/lib/xmalloc.c 2008-08-05 07:17:03.000000000 -0600 +++ m4-1.4.13/lib/xmalloc.c 2009-03-21 18:06:01.000000000 -0600 @@ -1,7 +1,7 @@ /* 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, 2008 Free Software Foundation, + 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2008-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -28,10 +28,6 @@ #include <stdlib.h> #include <string.h> -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - /* 1 if calloc is known to be compatible with GNU calloc. This matters if we are not also using the calloc module, which defines HAVE_CALLOC and supports the GNU API even on non-GNU platforms. */ diff -ruNp m4-1.4.12/m4/00gnulib.m4 m4-1.4.13/m4/00gnulib.m4 --- m4-1.4.12/m4/00gnulib.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/00gnulib.m4 2009-01-28 06:24:38.000000000 -0700 @@ -0,0 +1,30 @@ +# 00gnulib.m4 serial 2 +dnl Copyright (C) 2009 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 This file must be named something that sorts before all other +dnl gnulib-provided .m4 files. It is needed until such time as we can +dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE semantics. + +# AC_DEFUN_ONCE([NAME], VALUE) +# ---------------------------- +# Define NAME to expand to VALUE on the first use (whether by direct +# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses. +# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This +# definition is slower than the version in Autoconf 2.64, because it +# can only use interfaces that existed since 2.59; but it achieves the +# same effect. Quoting is necessary to avoid confusing Automake. +m4_version_prereq([2.63.263], [], +[m4_define([AC][_DEFUN_ONCE], + [AC][_DEFUN([$1], + [AC_REQUIRE([_gl_DEFUN_ONCE([$1])], + [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl +[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) + +# gl_00GNULIB +# ----------- +# Witness macro that this file has been included. Needed to force +# Automake to include this file prior to all other gnulib .m4 files. +AC_DEFUN([gl_00GNULIB]) diff -ruNp m4-1.4.12/m4/alloca.m4 m4-1.4.13/m4/alloca.m4 --- m4-1.4.12/m4/alloca.m4 2008-02-23 10:30:04.000000000 -0700 +++ m4-1.4.13/m4/alloca.m4 2009-01-16 06:26:23.000000000 -0700 @@ -1,5 +1,5 @@ -# alloca.m4 serial 8 -dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc. +# alloca.m4 serial 9 +dnl Copyright (C) 2002-2004, 2006, 2007, 2009 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. @@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_ALLOCA], ]) if test $gl_cv_rpl_alloca = yes; then dnl OK, alloca can be implemented through a compiler built-in. - AC_DEFINE([HAVE_ALLOCA], 1, + AC_DEFINE([HAVE_ALLOCA], [1], [Define to 1 if you have 'alloca' after including <alloca.h>, a header that may be supplied by this distribution.]) ALLOCA_H=alloca.h diff -ruNp m4-1.4.12/m4/assert.m4 m4-1.4.13/m4/assert.m4 --- m4-1.4.12/m4/assert.m4 2008-02-23 10:30:04.000000000 -0700 +++ m4-1.4.13/m4/assert.m4 2008-12-11 22:14:51.000000000 -0700 @@ -1,19 +1,24 @@ -#serial 5 +#serial 7 -# Copyright (C) 1998, 1999, 2001, 2004 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999, 2001, 2004, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. dnl based on code from Eleftherios Gkioulekas - +dnl Autoconf 2.60 provides AC_HEADER_ASSERT for the same purpose, but +dnl it has broken semantics for --enable-assert until 2.64. AC_DEFUN([gl_ASSERT], [ - AC_MSG_CHECKING(whether to enable assertions) - AC_ARG_ENABLE(assert, - [ --disable-assert turn off assertions], - [ AC_MSG_RESULT(no) - AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ], - [ AC_MSG_RESULT(yes) ] - ) + AC_MSG_CHECKING([whether to enable assertions]) + AC_ARG_ENABLE([assert], + [AS_HELP_STRING([--disable-assert], [turn off assertions])], + [AS_IF([test "x$enableval" = xno], + [AC_DEFINE([NDEBUG], [1], + [Define to 1 if assertions should be disabled.])], + [test "x$enableval" != xyes], + [AC_MSG_WARN([invalid argument supplied to --enable-assert]) + enable_assert=yes])], + [enable_assert=yes]) + AC_MSG_RESULT([$enable_assert]) ]) diff -ruNp m4-1.4.12/m4/btowc.m4 m4-1.4.13/m4/btowc.m4 --- m4-1.4.12/m4/btowc.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/btowc.m4 2008-12-24 06:20:31.000000000 -0700 @@ -0,0 +1,68 @@ +# btowc.m4 serial 3 +dnl Copyright (C) 2008 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_BTOWC], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_CHECK_FUNCS_ONCE([btowc]) + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF. + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether btowc(EOF) is correct], + [gl_cv_func_btowc_eof], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none; then + AC_TRY_RUN([ +#include <locale.h> +#include <stdio.h> +#include <string.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +}], + [gl_cv_func_btowc_eof=yes], + [gl_cv_func_btowc_eof=no], + []) + fi + ]) + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([btowc]) + gl_PREREQ_BTOWC + fi +]) + +# Prerequisites of lib/btowc.c. +AC_DEFUN([gl_PREREQ_BTOWC], [ + : +]) diff -ruNp m4-1.4.12/m4/c-stack.m4 m4-1.4.13/m4/c-stack.m4 --- m4-1.4.12/m4/c-stack.m4 2008-09-24 06:26:02.000000000 -0600 +++ m4-1.4.13/m4/c-stack.m4 2009-01-16 06:26:24.000000000 -0700 @@ -1,20 +1,39 @@ # Check prerequisites for compiling lib/c-stack.c. -# Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2004, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. -# serial 7 +# serial 9 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC], [# for STACK_DIRECTION AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS_ONCE([setrlimit]) AC_CHECK_HEADERS_ONCE([ucontext.h]) + dnl List of signals that are sent when an invalid virtual memory address + dnl is accessed, or when the stack overflows. + dnl Either { SIGSEGV } or { SIGSEGV, SIGBUS }. + case "$host_os" in + sunos4* | freebsd* | dragonfly* | openbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems + FAULT_YIELDS_SIGBUS=1 ;; + hpux*) # HP-UX + FAULT_YIELDS_SIGBUS=1 ;; + macos* | darwin*) # MacOS X + FAULT_YIELDS_SIGBUS=1 ;; + gnu*) # Hurd + FAULT_YIELDS_SIGBUS=1 ;; + *) + FAULT_YIELDS_SIGBUS=0 ;; + esac + AC_DEFINE_UNQUOTED([FAULT_YIELDS_SIGBUS], [$FAULT_YIELDS_SIGBUS], + [Define to 1 if an invalid memory address access may yield a SIGBUS.]) + AC_CACHE_CHECK([for working C stack overflow detection], [ac_cv_sys_stack_overflow_works], [AC_TRY_RUN( @@ -62,6 +81,10 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEUR sigemptyset (&act.sa_mask); act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND; act.sa_handler = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return -1; + #endif return sigaction (SIGSEGV, &act, 0); } static volatile int * @@ -244,6 +267,10 @@ int main () sigemptyset (&act.sa_mask); act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; act.sa_sigaction = segv_handler; + #if FAULT_YIELDS_SIGBUS + if (sigaction (SIGBUS, &act, 0) < 0) + return -1; + #endif return sigaction (SIGSEGV, &act, 0); } static volatile int * @@ -280,7 +307,7 @@ int main () [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])]) if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then - AC_DEFINE(HAVE_XSI_STACK_OVERFLOW_HEURISTIC, 1, + AC_DEFINE([HAVE_XSI_STACK_OVERFLOW_HEURISTIC], [1], [Define to 1 if extending the stack slightly past the limit causes a SIGSEGV, and an alternate stack can be established with sigaltstack, and the signal handler is passed a context that specifies the diff -ruNp m4-1.4.12/m4/codeset.m4 m4-1.4.13/m4/codeset.m4 --- m4-1.4.12/m4/codeset.m4 2008-02-23 10:30:04.000000000 -0700 +++ m4-1.4.13/m4/codeset.m4 2009-01-16 06:26:24.000000000 -0700 @@ -1,5 +1,5 @@ -# codeset.m4 serial 2 (gettext-0.16) -dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc. +# codeset.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 2000-2002, 2006, 2008, 2009 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. @@ -8,14 +8,14 @@ dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ - AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], [AC_TRY_LINK([#include <langinfo.h>], [char* cs = nl_langinfo(CODESET); return !cs;], - am_cv_langinfo_codeset=yes, - am_cv_langinfo_codeset=no) + [am_cv_langinfo_codeset=yes], + [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then - AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + AC_DEFINE([HAVE_LANGINFO_CODESET], [1], [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) fi ]) diff -ruNp m4-1.4.12/m4/double-slash-root.m4 m4-1.4.13/m4/double-slash-root.m4 --- m4-1.4.12/m4/double-slash-root.m4 2008-09-22 20:20:30.000000000 -0600 +++ m4-1.4.13/m4/double-slash-root.m4 2009-01-16 06:26:24.000000000 -0700 @@ -1,5 +1,5 @@ -# double-slash-root.m4 serial 3 -*- Autoconf -*- -dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# double-slash-root.m4 serial 4 -*- Autoconf -*- +dnl Copyright (C) 2006, 2008, 2009 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. @@ -32,7 +32,7 @@ AC_DEFUN([gl_DOUBLE_SLASH_ROOT], fi fi]) if test "$gl_cv_double_slash_root" = yes; then - AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], 1, + AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1], [Define to 1 if // is a file system root distinct from /.]) fi ]) diff -ruNp m4-1.4.12/m4/eealloc.m4 m4-1.4.13/m4/eealloc.m4 --- m4-1.4.12/m4/eealloc.m4 2008-02-23 10:30:05.000000000 -0700 +++ m4-1.4.13/m4/eealloc.m4 2009-01-16 06:26:25.000000000 -0700 @@ -1,5 +1,5 @@ -# eealloc.m4 serial 1 -dnl Copyright (C) 2003 Free Software Foundation, Inc. +# eealloc.m4 serial 2 +dnl Copyright (C) 2003, 2009 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. @@ -16,7 +16,7 @@ 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, + 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.]) ]) @@ -26,7 +26,7 @@ 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, + 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 -ruNp m4-1.4.12/m4/environ.m4 m4-1.4.13/m4/environ.m4 --- m4-1.4.12/m4/environ.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/environ.m4 2009-01-25 19:37:29.000000000 -0700 @@ -0,0 +1,36 @@ +# environ.m4 serial 2 +dnl Copyright (C) 2001-2004, 2006-2009 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_ENVIRON], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + dnl Persuade glibc <unistd.h> to declare environ. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + gt_CHECK_VAR_DECL([#include <unistd.h>], environ) + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + 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 + undefine([gt_cv_var]) +]) diff -ruNp m4-1.4.12/m4/errno_h.m4 m4-1.4.13/m4/errno_h.m4 --- m4-1.4.12/m4/errno_h.m4 2008-09-15 21:41:47.000000000 -0600 +++ m4-1.4.13/m4/errno_h.m4 2009-01-24 12:02:21.000000000 -0700 @@ -1,21 +1,15 @@ -# errno_h.m4 serial 1 -dnl Copyright (C) 2004, 2006, 2008 Free Software Foundation, Inc. +# errno_h.m4 serial 4 +dnl Copyright (C) 2004, 2006, 2008, 2009 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_HEADER_ERRNO_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_ERRNO_H_BODY]) -]) - -AC_DEFUN([gl_HEADER_ERRNO_H_BODY], +dnl This macro must pass through AC_REQUIRE (never directly invoke it). +AC_DEFUN_ONCE([gl_HEADER_ERRNO_H], [ AC_REQUIRE([AC_PROG_CC]) - AC_CACHE_CHECK([for complete errno.h], gl_cv_header_errno_h_complete, [ - AC_EGREP_CPP(booboo,[ + AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ + AC_EGREP_CPP([booboo],[ #include <errno.h> #if !defined ENOMSG booboo @@ -70,7 +64,7 @@ AC_DEFUN([gl_REPLACE_ERRNO_VALUE], [ if test -n "$ERRNO_H"; then AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ - AC_EGREP_CPP(yes,[ + AC_EGREP_CPP([yes],[ #include <errno.h> #ifdef ]$1[ yes @@ -79,7 +73,7 @@ yes [gl_cv_header_errno_h_]$1[=yes], [gl_cv_header_errno_h_]$1[=no]) if test $gl_cv_header_errno_h_]$1[ = no; then - AC_EGREP_CPP(yes,[ + AC_EGREP_CPP([yes],[ #define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> #ifdef ]$1[ @@ -111,3 +105,9 @@ yes AC_SUBST($1[_VALUE]) 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 -ruNp m4-1.4.12/m4/execute.m4 m4-1.4.13/m4/execute.m4 --- m4-1.4.12/m4/execute.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/execute.m4 2009-02-28 08:25:57.000000000 -0700 @@ -0,0 +1,12 @@ +# execute.m4 serial 4 +dnl Copyright (C) 2003, 2008, 2009 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_EXECUTE], +[ + dnl Prerequisites of lib/execute.c. + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([AC_TYPE_MODE_T]) +]) diff -ruNp m4-1.4.12/m4/exponentl.m4 m4-1.4.13/m4/exponentl.m4 --- m4-1.4.12/m4/exponentl.m4 2008-08-05 07:16:33.000000000 -0600 +++ m4-1.4.13/m4/exponentl.m4 2009-01-24 12:02:22.000000000 -0700 @@ -1,11 +1,11 @@ -# exponentl.m4 serial 1 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# exponentl.m4 serial 2 +dnl Copyright (C) 2007-2009 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_LONG_DOUBLE_EXPONENT_LOCATION], [ - AC_REQUIRE([AC_C_BIGENDIAN]) + AC_REQUIRE([gl_BIGENDIAN]) AC_CACHE_CHECK([where to find the exponent in a 'long double'], [gl_cv_cc_long_double_expbit0], [ diff -ruNp m4-1.4.12/m4/extensions.m4 m4-1.4.13/m4/extensions.m4 --- m4-1.4.12/m4/extensions.m4 2008-08-05 07:17:07.000000000 -0600 +++ m4-1.4.13/m4/extensions.m4 2009-01-28 06:24:41.000000000 -0700 @@ -1,7 +1,7 @@ -# serial 5 -*- Autoconf -*- +# serial 8 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -20,10 +20,12 @@ # AC_DEFINE. The goal here is to define all known feature-enabling # macros, then, if reports of conflicts are made, disable macros that # cause problems on some platforms (such as __EXTENSIONS__). -AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], +AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl AC_BEFORE([$0], [AC_RUN_IFELSE])dnl + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) if test "$MINIX" = yes; then AC_DEFINE([_POSIX_SOURCE], [1], @@ -36,6 +38,16 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl [Define to 1 if on MINIX.]) fi + dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, + dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already + dnl provided. + case "$host_os" in + hpux*) + AC_DEFINE([_XOPEN_SOURCE], [500], + [Define to 500 only on HP-UX.]) + ;; + esac + AH_VERBATIM([__EXTENSIONS__], [/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE @@ -78,5 +90,15 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl # ------------------------ # 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])]) +AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], +[ + dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. + dnl gnulib does not need it. But if it gets required by third-party macros + dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a + dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". + dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, + dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +]) diff -ruNp m4-1.4.12/m4/fatal-signal.m4 m4-1.4.13/m4/fatal-signal.m4 --- m4-1.4.12/m4/fatal-signal.m4 2008-08-05 07:17:07.000000000 -0600 +++ m4-1.4.13/m4/fatal-signal.m4 2009-01-16 06:26:26.000000000 -0700 @@ -1,5 +1,5 @@ -# fatal-signal.m4 serial 6 -dnl Copyright (C) 2003-2004, 2006, 2008 Free Software Foundation, Inc. +# fatal-signal.m4 serial 7 +dnl Copyright (C) 2003-2004, 2006, 2008, 2009 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. @@ -7,6 +7,6 @@ dnl with or without modifications, as lo AC_DEFUN([gl_FATAL_SIGNAL], [ AC_REQUIRE([gt_TYPE_SIG_ATOMIC_T]) - AC_CHECK_HEADERS_ONCE(unistd.h) + AC_CHECK_HEADERS_ONCE([unistd.h]) gl_PREREQ_SIG_HANDLER_H ]) diff -ruNp m4-1.4.12/m4/fcntl_h.m4 m4-1.4.13/m4/fcntl_h.m4 --- m4-1.4.12/m4/fcntl_h.m4 2008-08-05 07:16:33.000000000 -0600 +++ m4-1.4.13/m4/fcntl_h.m4 2009-01-16 06:26:26.000000000 -0700 @@ -1,5 +1,5 @@ # Configure fcntl.h. -dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2007, 2009 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. @@ -9,7 +9,7 @@ dnl Written by Paul Eggert. AC_DEFUN([gl_FCNTL_H], [ AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) - AC_CACHE_CHECK([for working fcntl.h], gl_cv_header_working_fcntl_h, + AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include <sys/types.h> diff -ruNp m4-1.4.12/m4/fflush.m4 m4-1.4.13/m4/fflush.m4 --- m4-1.4.12/m4/fflush.m4 2008-08-05 07:17:07.000000000 -0600 +++ m4-1.4.13/m4/fflush.m4 2009-01-16 06:26:26.000000000 -0700 @@ -1,6 +1,6 @@ -# fflush.m4 serial 6 +# fflush.m4 serial 7 -# Copyright (C) 2007-2008 Free Software Foundation, Inc. +# Copyright (C) 2007-2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -22,6 +22,7 @@ AC_DEFUN([gl_FUNC_FFLUSH], ]], [[FILE *f = fopen ("conftest.txt", "r"); char buffer[10]; int fd; + int c; if (f == NULL) return 1; fd = fileno (f); @@ -30,17 +31,31 @@ AC_DEFUN([gl_FUNC_FFLUSH], /* For deterministic results, ensure f read a bigger buffer. */ if (lseek (fd, 0, SEEK_CUR) == 5) return 3; - /* POSIX requires fflush-fseek to set file offset of fd. */ + /* POSIX requires fflush-fseek to set file offset of fd. This fails + on BSD systems and on mingw. */ if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0) return 4; if (lseek (fd, 0, SEEK_CUR) != 5) return 5; - /* TODO: Verify behaviour of fflush after ungetc, see - <http://lists.gnu.org/archive/html/bug-gnulib/2008-03/msg00131.html>. */ + /* Verify behaviour of fflush after ungetc. See + <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */ + /* Verify behaviour of fflush after a backup ungetc. This fails on + mingw. */ + c = fgetc (f); + ungetc (c, f); + fflush (f); + if (fgetc (f) != c) + return 6; + /* Verify behaviour of fflush after a non-backup ungetc. This fails + on glibc 2.8 and on BSD systems. */ + c = fgetc (f); + ungetc ('@', f); + fflush (f); + if (fgetc (f) != c) + return 7; return 0; ]])], [gl_cv_func_fflush_stdin=yes], [gl_cv_func_fflush_stdin=no], - [dnl Pessimistically assume fflush is broken. This is wrong for - dnl at least glibc and cygwin; but lib/fflush.c takes this into account. + [dnl Pessimistically assume fflush is broken. gl_cv_func_fflush_stdin=no]) rm conftest.txt ]) diff -ruNp m4-1.4.12/m4/filenamecat.m4 m4-1.4.13/m4/filenamecat.m4 --- m4-1.4.12/m4/filenamecat.m4 2008-09-22 20:38:31.000000000 -0600 +++ m4-1.4.13/m4/filenamecat.m4 2009-01-16 06:26:26.000000000 -0700 @@ -1,5 +1,5 @@ -# filenamecat.m4 serial 8 -dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# filenamecat.m4 serial 9 +dnl Copyright (C) 2002-2006, 2009 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. @@ -9,5 +9,5 @@ AC_DEFUN([gl_FILE_NAME_CONCAT], AC_LIBOBJ([filenamecat]) dnl Prerequisites of lib/filenamecat.c. - AC_CHECK_FUNCS_ONCE(mempcpy) + AC_CHECK_FUNCS_ONCE([mempcpy]) ]) diff -ruNp m4-1.4.12/m4/fopen.m4 m4-1.4.13/m4/fopen.m4 --- m4-1.4.12/m4/fopen.m4 2008-09-28 14:07:31.000000000 -0600 +++ m4-1.4.13/m4/fopen.m4 2009-01-24 12:02:22.000000000 -0700 @@ -1,5 +1,5 @@ -# fopen.m4 serial 3 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# fopen.m4 serial 5 +dnl Copyright (C) 2007-2009 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. @@ -10,8 +10,10 @@ AC_DEFUN([gl_FUNC_FOPEN], AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in mingw* | pw*) + dnl Replace fopen, for handling of "/dev/null". REPLACE_FOPEN=1 - AC_LIBOBJ([fopen]) + dnl fopen on mingw also has the trailing slash bug. + gl_cv_func_fopen_slash="guessing no" ;; *) dnl fopen("foo/", "w") should not create a file when the file name has a @@ -37,17 +39,19 @@ changequote([,])dnl ]) rm -f conftest.sl ]) - case "$gl_cv_func_fopen_slash" in - *no) - AC_DEFINE([FOPEN_TRAILING_SLASH_BUG], 1, - [Define to 1 if fopen() fails to recognize a trailing slash.]) - REPLACE_FOPEN=1 - AC_LIBOBJ([fopen]) - gl_PREREQ_FOPEN - ;; - esac ;; esac + case "$gl_cv_func_fopen_slash" in + *no) + AC_DEFINE([FOPEN_TRAILING_SLASH_BUG], [1], + [Define to 1 if fopen() fails to recognize a trailing slash.]) + REPLACE_FOPEN=1 + ;; + esac + if test $REPLACE_FOPEN = 1; then + AC_LIBOBJ([fopen]) + gl_PREREQ_FOPEN + fi ]) # Prerequisites of lib/fopen.c. diff -ruNp m4-1.4.12/m4/fpending.m4 m4-1.4.13/m4/fpending.m4 --- m4-1.4.12/m4/fpending.m4 2008-08-05 07:17:08.000000000 -0600 +++ m4-1.4.13/m4/fpending.m4 2009-01-16 06:26:26.000000000 -0700 @@ -1,7 +1,6 @@ -#serial 13 +# serial 14 -# Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007, 2008 Free Software -# Foundation, Inc. +# Copyright (C) 2000-2001, 2004-2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,7 +15,7 @@ dnl we have to grub around in the FILE s AC_DEFUN([gl_FUNC_FPENDING], [ - AC_CHECK_HEADERS_ONCE(stdio_ext.h) + AC_CHECK_HEADERS_ONCE([stdio_ext.h]) AC_CHECK_FUNCS_ONCE([__fpending]) fp_headers=' # include <stdio.h> @@ -78,7 +77,7 @@ AC_DEFUN([gl_FUNC_FPENDING], ac_cv_sys_pending_output_n_bytes=$ac_expr ] ) - AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES, + AC_DEFINE_UNQUOTED([PENDING_OUTPUT_N_BYTES], $ac_cv_sys_pending_output_n_bytes, [the number of pending output bytes on stream `fp']) AC_LIBOBJ([fpending]) diff -ruNp m4-1.4.12/m4/frexp.m4 m4-1.4.13/m4/frexp.m4 --- m4-1.4.12/m4/frexp.m4 2008-09-12 20:46:15.000000000 -0600 +++ m4-1.4.13/m4/frexp.m4 2009-01-16 06:26:27.000000000 -0700 @@ -1,5 +1,5 @@ -# frexp.m4 serial 6 -dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc. +# frexp.m4 serial 7 +dnl Copyright (C) 2007, 2008, 2009 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. @@ -48,7 +48,7 @@ AC_DEFUN([gl_FUNC_FREXP], gl_func_frexp=no fi if test $gl_func_frexp = yes; then - AC_DEFINE([HAVE_FREXP], 1, + AC_DEFINE([HAVE_FREXP], [1], [Define if the frexp() function is available and works.]) else AC_LIBOBJ([frexp]) @@ -80,7 +80,7 @@ AC_DEFUN([gl_FUNC_FREXP_NO_LIBM], REPLACE_FREXP=1 fi if test $gl_func_frexp_no_libm = yes; then - AC_DEFINE([HAVE_FREXP_IN_LIBC], 1, + AC_DEFINE([HAVE_FREXP_IN_LIBC], [1], [Define if the frexp() function is available in libc.]) else AC_LIBOBJ([frexp]) diff -ruNp m4-1.4.12/m4/frexpl.m4 m4-1.4.13/m4/frexpl.m4 --- m4-1.4.12/m4/frexpl.m4 2008-02-23 10:30:07.000000000 -0700 +++ m4-1.4.13/m4/frexpl.m4 2009-01-16 06:26:27.000000000 -0700 @@ -1,5 +1,5 @@ -# frexpl.m4 serial 8 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# frexpl.m4 serial 9 +dnl Copyright (C) 2007-2009 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. @@ -48,7 +48,7 @@ AC_DEFUN([gl_FUNC_FREXPL], gl_func_frexpl=no fi if test $gl_func_frexpl = yes; then - AC_DEFINE([HAVE_FREXPL], 1, + AC_DEFINE([HAVE_FREXPL], [1], [Define if the frexpl() function is available.]) dnl Also check whether it's declared. dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. @@ -84,7 +84,7 @@ AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM], REPLACE_FREXPL=1 fi if test $gl_func_frexpl_no_libm = yes; then - AC_DEFINE([HAVE_FREXPL_IN_LIBC], 1, + AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1], [Define if the frexpl() function is available in libc.]) dnl Also check whether it's declared. dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. diff -ruNp m4-1.4.12/m4/getdtablesize.m4 m4-1.4.13/m4/getdtablesize.m4 --- m4-1.4.12/m4/getdtablesize.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/getdtablesize.m4 2009-02-28 08:25:57.000000000 -0700 @@ -0,0 +1,15 @@ +# getdtablesize.m4 serial 1 +dnl Copyright (C) 2008 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_GETDTABLESIZE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([getdtablesize]) + if test $ac_cv_func_getdtablesize != yes; then + HAVE_GETDTABLESIZE=0 + AC_LIBOBJ([getdtablesize]) + fi +]) diff -ruNp m4-1.4.12/m4/gettext.m4 m4-1.4.13/m4/gettext.m4 --- m4-1.4.12/m4/gettext.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/gettext.m4 2009-01-25 19:37:30.000000000 -0700 @@ -0,0 +1,381 @@ +# gettext.m4 serial 62 (gettext-0.18) +dnl Copyright (C) 1995-2009 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 <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 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 <inttypes.h> 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 <libintl.h> +$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 <libintl.h> +$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 <libintl.h> +$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 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], []) diff -ruNp m4-1.4.12/m4/gettimeofday.m4 m4-1.4.13/m4/gettimeofday.m4 --- m4-1.4.12/m4/gettimeofday.m4 2008-02-23 10:30:07.000000000 -0700 +++ m4-1.4.13/m4/gettimeofday.m4 2009-01-16 06:26:27.000000000 -0700 @@ -1,6 +1,6 @@ -#serial 11 +# serial 12 -# Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -34,7 +34,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY], REPLACE_GETTIMEOFDAY=1 SYS_TIME_H=sys/time.h if test $gl_cv_func_gettimeofday_clobber != yes; then - AC_LIBOBJ(gettimeofday) + AC_LIBOBJ([gettimeofday]) gl_PREREQ_GETTIMEOFDAY fi fi @@ -80,13 +80,13 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], REPLACE_GETTIMEOFDAY=1 SYS_TIME_H=sys/time.h gl_GETTIMEOFDAY_REPLACE_LOCALTIME - AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], 1, + AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], [Define if gettimeofday clobbers the localtime buffer.]) fi ]) AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ - AC_LIBOBJ(gettimeofday) + AC_LIBOBJ([gettimeofday]) gl_PREREQ_GETTIMEOFDAY AC_DEFINE([gmtime], [rpl_gmtime], [Define to rpl_gmtime if the replacement function should be used.]) diff -ruNp m4-1.4.12/m4/glibc21.m4 m4-1.4.13/m4/glibc21.m4 --- m4-1.4.12/m4/glibc21.m4 2008-02-23 10:30:08.000000000 -0700 +++ m4-1.4.13/m4/glibc21.m4 2009-01-01 19:41:16.000000000 -0700 @@ -1,5 +1,5 @@ -# glibc21.m4 serial 3 -dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. +# glibc21.m4 serial 4 +dnl Copyright (C) 2000-2002, 2004, 2008 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. @@ -9,8 +9,8 @@ dnl with or without modifications, as lo AC_DEFUN([gl_GLIBC21], [ - AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, - ac_cv_gnu_library_2_1, + AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer], + [ac_cv_gnu_library_2_1], [AC_EGREP_CPP([Lucky GNU user], [ #include <features.h> @@ -20,11 +20,11 @@ AC_DEFUN([gl_GLIBC21], #endif #endif ], - ac_cv_gnu_library_2_1=yes, - ac_cv_gnu_library_2_1=no) + [ac_cv_gnu_library_2_1=yes], + [ac_cv_gnu_library_2_1=no]) ] ) - AC_SUBST(GLIBC21) + AC_SUBST([GLIBC21]) GLIBC21="$ac_cv_gnu_library_2_1" ] ) diff -ruNp m4-1.4.12/m4/gnulib-cache.m4 m4-1.4.13/m4/gnulib-cache.m4 --- m4-1.4.12/m4/gnulib-cache.m4 2008-09-25 06:12:52.000000000 -0600 +++ m4-1.4.13/m4/gnulib-cache.m4 2009-03-05 05:45:32.000000000 -0700 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2008 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -15,7 +15,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname error fdl fflush filenamecat fopen fopen-safer fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 intprops mkstemp obstack progname regex sigaction stdbool stdint stdlib-safer strsignal strstr strtod strtol unlocked-io verror version-etc version-etc-fsf xalloc xprintf xvasprintf-posix +# gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --avoid=lock-tests --avoid=tls-tests --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname error execute fdl-1.3 fflush filenamecat fopen fopen-safer fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 intprops memchr2 mkstemp obstack pipe progname regex sigaction stdbool stdint stdlib-safer strsignal strstr strtod strtol unlocked-io verror version-etc version-etc-fsf wait-process xalloc xprintf xvasprintf-posix # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([local]) @@ -33,7 +33,8 @@ gl_MODULES([ config-h dirname error - fdl + execute + fdl-1.3 fflush filenamecat fopen @@ -46,8 +47,10 @@ gl_MODULES([ gnupload gpl-3.0 intprops + memchr2 mkstemp obstack + pipe progname regex sigaction @@ -62,11 +65,12 @@ gl_MODULES([ verror version-etc version-etc-fsf + wait-process xalloc xprintf xvasprintf-posix ]) -gl_AVOID([]) +gl_AVOID([lock-tests tls-tests]) gl_SOURCE_BASE([lib]) gl_M4_BASE([m4]) gl_PO_BASE([]) diff -ruNp m4-1.4.12/m4/gnulib-common.m4 m4-1.4.13/m4/gnulib-common.m4 --- m4-1.4.12/m4/gnulib-common.m4 2008-08-05 07:17:10.000000000 -0600 +++ m4-1.4.13/m4/gnulib-common.m4 2009-02-28 08:26:38.000000000 -0700 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 5 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# gnulib-common.m4 serial 11 +dnl Copyright (C) 2007-2009 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. @@ -8,6 +8,7 @@ dnl with or without modifications, as lo # is expanded unconditionally through gnulib-tool magic. AC_DEFUN([gl_COMMON], [ dnl Use AC_REQUIRE here, so that the code is expanded once only. + AC_REQUIRE([gl_00GNULIB]) AC_REQUIRE([gl_COMMON_BODY]) ]) AC_DEFUN([gl_COMMON_BODY], [ @@ -21,6 +22,16 @@ AC_DEFUN([gl_COMMON_BODY], [ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif]) + AH_VERBATIM([unused_parameter], +[/* Define as a marker that can be attached to function parameter declarations + for parameters that are not used. This helps to reduce warnings, such as + from GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) +#else +# define _UNUSED_PARAMETER_ +#endif +]) ]) # gl_MODULE_INDICATOR([modulename]) @@ -42,7 +53,7 @@ m4_ifndef([m4_foreach_w], # 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_DEFUN_ONCE([AC_PROG_MKDIR_P], [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake MKDIR_P='$(mkdir_p)' AC_SUBST([MKDIR_P])])]) @@ -53,7 +64,7 @@ m4_ifdef([AC_PROG_MKDIR_P], [], [ # works. # This definition can be removed once autoconf >= 2.62 can be assumed. AC_DEFUN([AC_C_RESTRICT], -[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, +[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do @@ -89,3 +100,25 @@ AC_DEFUN([AC_C_RESTRICT], *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ]) + +# gl_BIGENDIAN +# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. +# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some +# macros invoke AC_C_BIGENDIAN with arguments. +AC_DEFUN([gl_BIGENDIAN], +[ + AC_C_BIGENDIAN +]) + +# gl_CACHE_VAL_SILENT(cache-id, command-to-set-it) +# is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not +# output a spurious "(cached)" mark in the midst of other configure output. +# This macro should be used instead of AC_CACHE_VAL when it is not surrounded +# by an AC_MSG_CHECKING/AC_MSG_RESULT pair. +AC_DEFUN([gl_CACHE_VAL_SILENT], +[ + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + AC_CACHE_VAL([$1], [$2]) + as_echo_n="$saved_as_echo_n" +]) diff -ruNp m4-1.4.12/m4/gnulib-comp.m4 m4-1.4.13/m4/gnulib-comp.m4 --- m4-1.4.12/m4/gnulib-comp.m4 2008-10-09 21:07:01.000000000 -0600 +++ m4-1.4.13/m4/gnulib-comp.m4 2009-03-23 06:02:59.000000000 -0600 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2008 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -26,7 +26,6 @@ AC_DEFUN([M4_EARLY], m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable AC_REQUIRE([AC_PROG_RANLIB]) AC_REQUIRE([AM_PROG_CC_C_O]) - AC_REQUIRE([AC_GNU_SOURCE]) AB_INIT AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([AC_FUNC_FSEEKO]) @@ -58,6 +57,8 @@ AC_DEFUN([M4_INIT], gl_source_base='lib' gl_FUNC_ALLOCA gl_ASSERT + gl_FUNC_BTOWC + gl_WCHAR_MODULE_INDICATOR([btowc]) gl_C_STACK AC_DEFINE([SIGNAL_SAFE_LIST], [1], [Define if lists must be signal-safe.]) gl_CLOEXEC @@ -68,11 +69,14 @@ AC_DEFUN([M4_INIT], gl_CONFIG_H gl_DIRNAME gl_DOUBLE_SLASH_ROOT - gl_HEADER_ERRNO_H + gl_ENVIRON + gl_UNISTD_MODULE_INDICATOR([environ]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) gl_ERROR m4_ifdef([AM_XGETTEXT_OPTION], [AM_XGETTEXT_OPTION([--flag=error:3:c-format]) AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) + gl_EXECUTE gl_EXITFAIL gl_FATAL_SIGNAL gl_FCNTL_H @@ -95,6 +99,8 @@ AC_DEFUN([M4_INIT], gl_STDIO_MODULE_INDICATOR([fseeko]) gl_FUNC_FTELLO gl_STDIO_MODULE_INDICATOR([ftello]) + gl_FUNC_GETDTABLESIZE + gl_UNISTD_MODULE_INDICATOR([getdtablesize]) gl_GETOPT AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) @@ -121,19 +127,23 @@ AC_DEFUN([M4_INIT], gl_LOCK gl_FUNC_LSEEK gl_UNISTD_MODULE_INDICATOR([lseek]) + gl_FUNC_LSTAT + gl_SYS_STAT_MODULE_INDICATOR([lstat]) AC_FUNC_MALLOC AC_DEFINE([GNULIB_MALLOC_GNU], 1, [Define to indicate the 'malloc' module.]) gl_FUNC_MALLOC_POSIX gl_STDLIB_MODULE_INDICATOR([malloc-posix]) gl_MALLOCA gl_MATH_H - gl_FUNC_MEMCHR - gl_FUNC_MEMCMP - gl_FUNC_MEMSET + gl_FUNC_MBRTOWC + gl_WCHAR_MODULE_INDICATOR([mbrtowc]) + gl_FUNC_MBSINIT + gl_WCHAR_MODULE_INDICATOR([mbsinit]) gt_FUNC_MKDTEMP gl_STDLIB_MODULE_INDICATOR([mkdtemp]) gl_FUNC_MKSTEMP gl_STDLIB_MODULE_INDICATOR([mkstemp]) + AC_REQUIRE([gl_MULTIARCH]) AC_FUNC_OBSTACK dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]). gl_FUNC_OPEN @@ -141,12 +151,76 @@ AC_DEFUN([M4_INIT], gl_FCNTL_MODULE_INDICATOR([open]) gl_LIST gl_PATHMAX + gl_PIPE + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawn_faction_addclose]) + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addclose]) + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawn_faction_adddup2]) + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_adddup2]) + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawn_faction_addopen]) + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addopen]) + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawn_faction_destroy]) + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_destroy]) + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawn_faction_init]) + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_init]) + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawnattr_destroy]) + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_destroy]) + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawnattr_init]) + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_init]) + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawnattr_setflags]) + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setflags]) + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawnattr_setsigmask]) + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setsigmask]) + gl_POSIX_SPAWN + if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then + gl_REPLACE_SPAWN_H + AC_LIBOBJ([spawnp]) + gl_POSIX_SPAWN_INTERNAL + fi + gl_SPAWN_MODULE_INDICATOR([posix_spawnp]) gl_FUNC_PRINTF_FREXP gl_FUNC_PRINTF_FREXPL m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes]) gl_QUOTEARG - AC_REPLACE_FUNCS(raise) + gl_FUNC_RAWMEMCHR + gl_STRING_MODULE_INDICATOR([rawmemchr]) gl_REGEX + gl_SCHED_H gl_SIGACTION gl_SIGNAL_MODULE_INDICATOR([sigaction]) gl_SIGNAL_H @@ -157,6 +231,7 @@ AC_DEFUN([M4_INIT], gl_SIZE_MAX gl_FUNC_SNPRINTF gl_STDIO_MODULE_INDICATOR([snprintf]) + gl_SPAWN_H gt_TYPE_SSIZE_T gl_STDARG_H AM_STDBOOL_H @@ -164,6 +239,8 @@ AC_DEFUN([M4_INIT], gl_STDIO_H gl_STDLIB_H gl_STDLIB_SAFER + gl_FUNC_STRCHRNUL + gl_STRING_MODULE_INDICATOR([strchrnul]) gl_FUNC_STRERROR gl_STRING_MODULE_INDICATOR([strerror]) gl_HEADER_STRING_H @@ -182,6 +259,8 @@ AC_DEFUN([M4_INIT], AC_PROG_MKDIR_P gl_HEADER_SYS_TIME_H AC_PROG_MKDIR_P + gl_SYS_WAIT_H + AC_PROG_MKDIR_P gl_FUNC_GEN_TEMPNAME gl_THREADLIB gl_TLS @@ -199,7 +278,10 @@ AC_DEFUN([M4_INIT], m4_ifdef([AM_XGETTEXT_OPTION], [AM_XGETTEXT_OPTION([--flag=verror:3:c-format]) AM_XGETTEXT_OPTION([--flag=verror_at_line:5:c-format])]) + gl_WAIT_PROCESS gl_WCHAR_H + gl_FUNC_WCRTOMB + gl_WCHAR_MODULE_INDICATOR([wcrtomb]) gl_WCTYPE_H gl_XALLOC m4_ifdef([AM_XGETTEXT_OPTION], @@ -251,19 +333,46 @@ AC_DEFUN([M4_INIT], m4_pushdef([M4tests_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='tests' + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gl_FUNC_UNGETC_WORKS + gl_FUNC_UNGETC_WORKS + dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. + AM_GNU_GETTEXT_VERSION([0.17]) gl_DOUBLE_EXPONENT_LOCATION gl_FLOAT_EXPONENT_LOCATION gl_LONG_DOUBLE_EXPONENT_LOCATION + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + gt_LOCALE_FR_UTF8 + AC_EGREP_CPP([notposix], [[ + #if defined _MSC_VER || defined __MINGW32__ + notposix + #endif + ]], + [posix_spawn_ported=no], + [posix_spawn_ported=yes]) + AM_CONDITIONAL([POSIX_SPAWN_PORTED], [test $posix_spawn_ported = yes]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gl_FUNC_SETENV + gl_STDLIB_MODULE_INDICATOR([setenv]) AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION]) AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION]) gt_TYPE_WCHAR_T gt_TYPE_WINT_T - gl_FUNC_STRDUP - gl_STRING_MODULE_INDICATOR([strdup]) AC_CHECK_DECLS_ONCE([alarm]) - gl_THREAD - gl_YIELD + gl_FUNC_UNSETENV + gl_STDLIB_MODULE_INDICATOR([unsetenv]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN + gl_FUNC_WCTOB + gl_WCHAR_MODULE_INDICATOR([wctob]) m4_ifval(M4tests_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([M4tests_LIBSOURCES_DIR])[ || for gl_file in ]M4tests_LIBSOURCES_LIST[ ; do @@ -365,7 +474,7 @@ AC_DEFUN([M4_FILE_LIST], [ build-aux/git-version-gen build-aux/gnupload build-aux/link-warning.h - doc/fdl.texi + doc/fdl-1.3.texi doc/gendocs_template doc/gpl-3.0.texi lib/alloca.c @@ -374,6 +483,7 @@ AC_DEFUN([M4_FILE_LIST], [ lib/asprintf.c lib/basename.c lib/binary-io.h + lib/btowc.c lib/c-ctype.c lib/c-ctype.h lib/c-stack.c @@ -395,6 +505,8 @@ AC_DEFUN([M4_FILE_LIST], [ lib/errno.in.h lib/error.c lib/error.h + lib/execute.c + lib/execute.h lib/exitfail.c lib/exitfail.h lib/fatal-signal.c @@ -421,6 +533,7 @@ AC_DEFUN([M4_FILE_LIST], [ lib/frexpl.c lib/fseeko.c lib/ftello.c + lib/getdtablesize.c lib/getopt.c lib/getopt.in.h lib/getopt1.c @@ -456,14 +569,16 @@ AC_DEFUN([M4_FILE_LIST], [ lib/localcharset.c lib/localcharset.h lib/lseek.c + lib/lstat.c lib/malloc.c lib/malloca.c lib/malloca.h lib/malloca.valgrind lib/math.in.h - lib/memchr.c - lib/memcmp.c - lib/memset.c + lib/mbrtowc.c + lib/mbsinit.c + lib/memchr2.c + lib/memchr2.h lib/mkdtemp.c lib/mkstemp-safer.c lib/mkstemp.c @@ -472,6 +587,8 @@ AC_DEFUN([M4_FILE_LIST], [ lib/open.c lib/pathmax.h lib/pipe-safer.c + lib/pipe.c + lib/pipe.h lib/printf-args.c lib/printf-args.h lib/printf-frexp.c @@ -484,7 +601,8 @@ AC_DEFUN([M4_FILE_LIST], [ lib/progname.h lib/quotearg.c lib/quotearg.h - lib/raise.c + lib/rawmemchr.c + lib/rawmemchr.valgrind lib/ref-add.sin lib/ref-del.sin lib/regcomp.c @@ -493,6 +611,7 @@ AC_DEFUN([M4_FILE_LIST], [ lib/regex_internal.c lib/regex_internal.h lib/regexec.c + lib/sched.in.h lib/sig-handler.h lib/sigaction.c lib/siglist.h @@ -503,6 +622,19 @@ AC_DEFUN([M4_FILE_LIST], [ lib/sigprocmask.c lib/size_max.h lib/snprintf.c + lib/spawn.in.h + lib/spawn_faction_addclose.c + lib/spawn_faction_adddup2.c + lib/spawn_faction_addopen.c + lib/spawn_faction_destroy.c + lib/spawn_faction_init.c + lib/spawn_int.h + lib/spawnattr_destroy.c + lib/spawnattr_init.c + lib/spawnattr_setflags.c + lib/spawnattr_setsigmask.c + lib/spawni.c + lib/spawnp.c lib/stdarg.in.h lib/stdbool.in.h lib/stdint.in.h @@ -515,6 +647,9 @@ AC_DEFUN([M4_FILE_LIST], [ lib/stdlib-safer.h lib/stdlib.in.h lib/str-two-way.h + lib/strchrnul.c + lib/strchrnul.valgrind + lib/streq.h lib/strerror.c lib/string.in.h lib/stripslash.c @@ -526,6 +661,7 @@ AC_DEFUN([M4_FILE_LIST], [ lib/strtol.c lib/sys_stat.in.h lib/sys_time.in.h + lib/sys_wait.in.h lib/tempname.c lib/tempname.h lib/tmpdir.c @@ -537,12 +673,17 @@ AC_DEFUN([M4_FILE_LIST], [ lib/vasnprintf.c lib/vasnprintf.h lib/vasprintf.c + lib/verify.h lib/verror.c lib/verror.h lib/version-etc-fsf.c lib/version-etc.c lib/version-etc.h + lib/w32spawn.h + lib/wait-process.c + lib/wait-process.h lib/wchar.in.h + lib/wcrtomb.c lib/wctype.in.h lib/xalloc-die.c lib/xalloc.h @@ -557,9 +698,11 @@ AC_DEFUN([M4_FILE_LIST], [ lib/xstrndup.h lib/xvasprintf.c lib/xvasprintf.h + m4/00gnulib.m4 m4/alloca.m4 m4/assert.m4 m4/autobuild.m4 + m4/btowc.m4 m4/c-stack.m4 m4/cloexec.m4 m4/close-stream.m4 @@ -571,8 +714,10 @@ AC_DEFUN([M4_FILE_LIST], [ m4/dos.m4 m4/double-slash-root.m4 m4/eealloc.m4 + m4/environ.m4 m4/errno_h.m4 m4/error.m4 + m4/execute.m4 m4/exitfail.m4 m4/exponentd.m4 m4/exponentf.m4 @@ -592,45 +737,68 @@ AC_DEFUN([M4_FILE_LIST], [ m4/frexpl.m4 m4/fseeko.m4 m4/ftello.m4 + m4/getdtablesize.m4 m4/getopt.m4 + m4/gettext.m4 m4/gettimeofday.m4 m4/gl_list.m4 + m4/glibc2.m4 m4/glibc21.m4 m4/gnulib-common.m4 + m4/iconv.m4 m4/include_next.m4 m4/inline.m4 + m4/intdiv0.m4 + m4/intl.m4 + m4/intldir.m4 + m4/intlmacosx.m4 + m4/intmax.m4 m4/intmax_t.m4 + m4/inttypes-pri.m4 m4/inttypes_h.m4 m4/isnand.m4 m4/isnanf.m4 m4/isnanl.m4 + m4/lcmessage.m4 m4/ldexpl.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/libsigsegv.m4 m4/localcharset.m4 + m4/locale-fr.m4 + m4/locale-ja.m4 + m4/locale-zh.m4 m4/lock.m4 m4/longlong.m4 m4/lseek.m4 + m4/lstat.m4 m4/malloc.m4 m4/malloca.m4 m4/math_h.m4 m4/mbrtowc.m4 + m4/mbsinit.m4 m4/mbstate_t.m4 - m4/memchr.m4 - m4/memcmp.m4 - m4/memset.m4 m4/mkdtemp.m4 m4/mkstemp.m4 + m4/multiarch.m4 + m4/nls.m4 m4/nocrash.m4 m4/open.m4 m4/pathmax.m4 + m4/pipe.m4 + m4/po.m4 + m4/posix_spawn.m4 m4/printf-frexp.m4 m4/printf-frexpl.m4 + m4/printf-posix.m4 m4/printf.m4 + m4/progtest.m4 m4/quotearg.m4 + m4/rawmemchr.m4 m4/regex.m4 + m4/sched_h.m4 + m4/setenv.m4 m4/sig_atomic_t.m4 m4/sigaction.m4 m4/signal_h.m4 @@ -638,6 +806,7 @@ AC_DEFUN([M4_FILE_LIST], [ m4/signbit.m4 m4/size_max.m4 m4/snprintf.m4 + m4/spawn_h.m4 m4/ssize_t.m4 m4/stdarg.m4 m4/stdbool.m4 @@ -647,7 +816,7 @@ AC_DEFUN([M4_FILE_LIST], [ m4/stdio_h.m4 m4/stdlib-safer.m4 m4/stdlib_h.m4 - m4/strdup.m4 + m4/strchrnul.m4 m4/strerror.m4 m4/string_h.m4 m4/strndup.m4 @@ -658,26 +827,33 @@ AC_DEFUN([M4_FILE_LIST], [ m4/strtol.m4 m4/sys_stat_h.m4 m4/sys_time_h.m4 + m4/sys_wait_h.m4 m4/tempname.m4 - m4/thread.m4 m4/threadlib.m4 m4/tls.m4 m4/tmpdir.m4 + m4/uintmax_t.m4 + m4/ungetc.m4 m4/unistd-safer.m4 m4/unistd_h.m4 m4/unlocked-io.m4 m4/vasnprintf.m4 m4/vasprintf-posix.m4 m4/vasprintf.m4 + m4/visibility.m4 + m4/wait-process.m4 m4/wchar.m4 m4/wchar_t.m4 + m4/wcrtomb.m4 + m4/wctob.m4 m4/wctype.m4 m4/wint_t.m4 m4/xalloc.m4 m4/xsize.m4 m4/xstrndup.m4 m4/xvasprintf.m4 - m4/yield.m4 + tests/locale/fr/LC_MESSAGES/test-quotearg.mo + tests/locale/fr/LC_MESSAGES/test-quotearg.po tests/nan.h tests/test-alloca-opt.c tests/test-array_list.c @@ -685,6 +861,9 @@ AC_DEFUN([M4_FILE_LIST], [ tests/test-avltree_oset.c tests/test-binary-io.c tests/test-binary-io.sh + tests/test-btowc.c + tests/test-btowc1.sh + tests/test-btowc2.sh tests/test-c-ctype.c tests/test-c-stack.c tests/test-c-stack.sh @@ -692,6 +871,7 @@ AC_DEFUN([M4_FILE_LIST], [ tests/test-closein.c tests/test-closein.sh tests/test-dirname.c + tests/test-environ.c tests/test-errno.c tests/test-fcntl.c tests/test-fflush.c @@ -709,8 +889,11 @@ AC_DEFUN([M4_FILE_LIST], [ tests/test-frexpl.c tests/test-fseeko.c tests/test-fseeko.sh + tests/test-fseeko2.sh tests/test-ftello.c tests/test-ftello.sh + tests/test-ftello2.sh + tests/test-getdtablesize.c tests/test-gettimeofday.c tests/test-isnand-nolibm.c tests/test-isnand.h @@ -719,24 +902,39 @@ AC_DEFUN([M4_FILE_LIST], [ tests/test-isnanl-nolibm.c tests/test-isnanl.h tests/test-linkedhash_list.c - tests/test-lock.c tests/test-lseek.c tests/test-lseek.sh + tests/test-lstat.c tests/test-malloca.c tests/test-math.c - tests/test-memchr.c - tests/test-memcmp.c + tests/test-mbrtowc.c + tests/test-mbrtowc1.sh + tests/test-mbrtowc2.sh + tests/test-mbrtowc3.sh + tests/test-mbrtowc4.sh + tests/test-mbsinit.c + tests/test-mbsinit.sh + tests/test-memchr2.c tests/test-open.c + tests/test-posix_spawn1.c + tests/test-posix_spawn1.in.sh + tests/test-posix_spawn2.c + tests/test-posix_spawn2.in.sh tests/test-printf-frexp.c tests/test-printf-frexpl.c tests/test-quotearg.c + tests/test-quotearg.sh + tests/test-rawmemchr.c + tests/test-sched.c tests/test-sigaction.c + tests/test-signal.c tests/test-signbit.c tests/test-snprintf.c tests/test-stdbool.c tests/test-stdint.c tests/test-stdio.c tests/test-stdlib.c + tests/test-strchrnul.c tests/test-strerror.c tests/test-string.c tests/test-strsignal.c @@ -744,22 +942,21 @@ AC_DEFUN([M4_FILE_LIST], [ tests/test-strtod.c tests/test-sys_stat.c tests/test-sys_time.c - tests/test-tls.c tests/test-unistd.c tests/test-vasnprintf.c tests/test-vasprintf-posix.c tests/test-vasprintf.c tests/test-wchar.c + tests/test-wcrtomb.c + tests/test-wcrtomb.sh tests/test-wctype.c tests/test-xvasprintf.c tests=lib/gl_array_list.c tests=lib/gl_array_list.h tests=lib/gl_array_oset.c tests=lib/gl_array_oset.h - tests=lib/glthread/thread.c - tests=lib/glthread/thread.h - tests=lib/glthread/yield.h - tests=lib/strdup.c - tests=lib/verify.h + tests=lib/setenv.c + tests=lib/unsetenv.c + tests=lib/wctob.c top/GNUmakefile ]) diff -ruNp m4-1.4.12/m4/include_next.m4 m4-1.4.13/m4/include_next.m4 --- m4-1.4.12/m4/include_next.m4 2008-09-12 20:46:16.000000000 -0600 +++ m4-1.4.13/m4/include_next.m4 2009-02-18 19:13:48.000000000 -0700 @@ -1,5 +1,5 @@ -# include_next.m4 serial 8 -dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. +# include_next.m4 serial 12 +dnl Copyright (C) 2006-2009 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. @@ -11,6 +11,10 @@ dnl dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to dnl 'include' otherwise. dnl +dnl INCLUDE_NEXT_AS_FIRST_DIRECTIVE expands to 'include_next' if the compiler +dnl supports it in the special case that it is the first include directive in +dnl the given file, or to 'include' otherwise. +dnl dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next, dnl so as to avoid GCC warnings when the gcc option -pedantic is used. dnl '#pragma GCC system_header' has the same effect as if the file was found @@ -26,12 +30,27 @@ AC_DEFUN([gl_INCLUDE_NEXT], AC_LANG_PREPROC_REQUIRE() AC_CACHE_CHECK([whether the preprocessor supports include_next], [gl_cv_have_include_next], - [rm -rf conftestd1 conftestd2 - mkdir conftestd1 conftestd2 - dnl The include of <stdio.h> is because IBM C 9.0 on AIX 6.1 supports - dnl include_next when used as first preprocessor directive in a file, - dnl but not when preceded by another include directive. - cat <<EOF > conftestd1/conftest.h + [rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + dnl IBM C 9.0, 10.1 (original versions, prior to the 2009-01 updates) on + dnl AIX 6.1 support include_next when used as first preprocessor directive + dnl in a file, but not when preceded by another include directive. Check + dnl for this bug by including <stdio.h>. + dnl Additionally, with this same compiler, include_next is a no-op when + dnl used in a header file that was included by specifying its absolute + dnl file name. Despite these two bugs, include_next is used in the + dnl compiler's <math.h>. By virtue of the second bug, we need to use + dnl include_next as well in this case. + cat <<EOF > conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next <conftest.h> +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat <<EOF > conftestd1b/conftest.h #define DEFINED_IN_CONFTESTD1 #include <stdio.h> #include_next <conftest.h> @@ -47,24 +66,36 @@ EOF #endif #define DEFINED_IN_CONFTESTD2 EOF - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" AC_COMPILE_IFELSE([#include <conftest.h>], [gl_cv_have_include_next=yes], - [gl_cv_have_include_next=no]) - CPPFLAGS="$save_CPPFLAGS" - rm -rf conftestd1 conftestd2 + [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + AC_COMPILE_IFELSE([#include <conftest.h>], + [gl_cv_have_include_next=buggy], + [gl_cv_have_include_next=no]) + ]) + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 ]) PRAGMA_SYSTEM_HEADER= if test $gl_cv_have_include_next = yes; then INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next if test -n "$GCC"; then PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' fi else - INCLUDE_NEXT=include + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi fi AC_SUBST([INCLUDE_NEXT]) + AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) AC_SUBST([PRAGMA_SYSTEM_HEADER]) ]) @@ -87,6 +118,7 @@ EOF AC_DEFUN([gl_CHECK_NEXT_HEADERS], [ AC_REQUIRE([gl_INCLUDE_NEXT]) + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_HEADERS_ONCE([$1]) m4_foreach_w([gl_HEADER_NAME], [$1], @@ -105,11 +137,22 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS], [AC_LANG_SOURCE( [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]] )]) - dnl eval is necessary to expand ac_cpp. + dnl AIX "xlc -E" and "cc -E" omit #line directives for header files + dnl that contain only a #include of other header files and no + dnl non-comment tokens of their own. This leads to a failure to + dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h> + dnl and others. The workaround is to force preservation of comments + dnl through option -C. This ensures all necessary #line directives + dnl are present. GCC supports option -C as well. + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + dnl eval is necessary to expand gl_absname_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, dnl so use subshell. AS_VAR_SET([gl_next_header], - ['"'`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + ['"'`(eval "$gl_absname_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#^/[^/]#//&# diff -ruNp m4-1.4.12/m4/inline.m4 m4-1.4.13/m4/inline.m4 --- m4-1.4.12/m4/inline.m4 2008-02-23 10:30:08.000000000 -0700 +++ m4-1.4.13/m4/inline.m4 2009-01-16 06:26:28.000000000 -0700 @@ -1,5 +1,5 @@ -# inline.m4 serial 3 -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# inline.m4 serial 4 +dnl Copyright (C) 2006, 2009 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. @@ -32,7 +32,7 @@ AC_DEFUN([gl_INLINE], fi ]) if test $gl_cv_c_inline_effective = yes; then - AC_DEFINE([HAVE_INLINE], 1, + 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.]) diff -ruNp m4-1.4.12/m4/intmax_t.m4 m4-1.4.13/m4/intmax_t.m4 --- m4-1.4.12/m4/intmax_t.m4 2008-02-23 10:30:08.000000000 -0700 +++ m4-1.4.13/m4/intmax_t.m4 2009-01-16 06:26:28.000000000 -0700 @@ -1,12 +1,12 @@ -# intmax_t.m4 serial 6 -dnl Copyright (C) 1997-2004, 2006-2007 Free Software Foundation, Inc. +# intmax_t.m4 serial 7 +dnl Copyright (C) 1997-2004, 2006-2007, 2009 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) +AC_PREREQ([2.13]) # Define intmax_t to 'long' or 'long long' # if it is not already defined in <stdint.h> or <inttypes.h>. @@ -22,10 +22,10 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T], test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if <inttypes.h> and <stdint.h> don't define.]) else - AC_DEFINE(HAVE_INTMAX_T, 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) fi ]) @@ -36,7 +36,7 @@ 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_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], [AC_TRY_COMPILE([ #include <stddef.h> #include <stdlib.h> @@ -48,14 +48,14 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], #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, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) else AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if <stdint.h> and <inttypes.h> don't define.]) fi ]) diff -ruNp m4-1.4.12/m4/inttypes_h.m4 m4-1.4.13/m4/inttypes_h.m4 --- m4-1.4.12/m4/inttypes_h.m4 2008-02-23 10:30:08.000000000 -0700 +++ m4-1.4.13/m4/inttypes_h.m4 2009-01-16 06:26:29.000000000 -0700 @@ -1,5 +1,5 @@ -# inttypes_h.m4 serial 7 -dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. +# inttypes_h.m4 serial 9 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 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. @@ -11,15 +11,15 @@ dnl From Paul Eggert. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ - AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, + AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], [AC_TRY_COMPILE( [#include <sys/types.h> #include <inttypes.h>], [uintmax_t i = (uintmax_t) -1; return !i;], - gl_cv_header_inttypes_h=yes, - gl_cv_header_inttypes_h=no)]) + [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, + AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and declares uintmax_t. ]) fi diff -ruNp m4-1.4.12/m4/isnand.m4 m4-1.4.13/m4/isnand.m4 --- m4-1.4.12/m4/isnand.m4 2008-08-05 07:17:11.000000000 -0600 +++ m4-1.4.13/m4/isnand.m4 2009-01-16 06:26:29.000000000 -0700 @@ -1,12 +1,14 @@ -# isnand.m4 serial 4 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# isnand.m4 serial 6 +dnl Copyright (C) 2007-2009 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 Check how to get or define isnand(). + AC_DEFUN([gl_FUNC_ISNAND], [ + AC_REQUIRE([gl_MATH_H_DEFAULTS]) ISNAND_LIBM= gl_HAVE_ISNAND_NO_LIBM if test $gl_cv_func_isnand_no_libm = no; then @@ -19,10 +21,9 @@ AC_DEFUN([gl_FUNC_ISNAND], if test $gl_cv_func_isnand_no_libm = yes \ || test $gl_cv_func_isnand_in_libm = yes; then gl_func_isnand=yes - AC_DEFINE([HAVE_ISNAND], 1, - [Define if the isnan(double) function is available.]) else gl_func_isnand=no + HAVE_ISNAND=0 gl_BUILD_ISNAND fi AC_SUBST([ISNAND_LIBM]) @@ -34,7 +35,7 @@ AC_DEFUN([gl_FUNC_ISNAND_NO_LIBM], [ gl_HAVE_ISNAND_NO_LIBM if test $gl_cv_func_isnand_no_libm = yes; then - AC_DEFINE([HAVE_ISNAND_IN_LIBC], 1, + AC_DEFINE([HAVE_ISNAND_IN_LIBC], [1], [Define if the isnan(double) function is available in libc.]) else gl_BUILD_ISNAND diff -ruNp m4-1.4.12/m4/isnanf.m4 m4-1.4.13/m4/isnanf.m4 --- m4-1.4.12/m4/isnanf.m4 2008-08-05 07:17:11.000000000 -0600 +++ m4-1.4.13/m4/isnanf.m4 2009-01-16 06:26:29.000000000 -0700 @@ -1,5 +1,5 @@ -# isnanf.m4 serial 8 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# isnanf.m4 serial 10 +dnl Copyright (C) 2007-2009 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. @@ -8,6 +8,7 @@ dnl Check how to get or define isnanf(). AC_DEFUN([gl_FUNC_ISNANF], [ + AC_REQUIRE([gl_MATH_H_DEFAULTS]) ISNANF_LIBM= gl_HAVE_ISNANF_NO_LIBM if test $gl_cv_func_isnanf_no_libm = no; then @@ -29,10 +30,8 @@ AC_DEFUN([gl_FUNC_ISNANF], else gl_func_isnanf=no fi - if test $gl_func_isnanf = yes; then - AC_DEFINE([HAVE_ISNANF], 1, - [Define if the isnan(float) function is available.]) - else + if test $gl_func_isnanf != yes; then + HAVE_ISNANF=0 gl_BUILD_ISNANF fi AC_SUBST([ISNANF_LIBM]) @@ -52,7 +51,7 @@ AC_DEFUN([gl_FUNC_ISNANF_NO_LIBM], *) false;; esac }; then - AC_DEFINE([HAVE_ISNANF_IN_LIBC], 1, + AC_DEFINE([HAVE_ISNANF_IN_LIBC], [1], [Define if the isnan(float) function is available in libc.]) else gl_BUILD_ISNANF diff -ruNp m4-1.4.12/m4/isnanl.m4 m4-1.4.13/m4/isnanl.m4 --- m4-1.4.12/m4/isnanl.m4 2008-08-05 07:17:11.000000000 -0600 +++ m4-1.4.13/m4/isnanl.m4 2009-02-28 08:26:41.000000000 -0700 @@ -1,11 +1,12 @@ -# isnanl.m4 serial 8 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# isnanl.m4 serial 12 +dnl Copyright (C) 2007-2009 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_ISNANL], [ + AC_REQUIRE([gl_MATH_H_DEFAULTS]) ISNANL_LIBM= gl_HAVE_ISNANL_NO_LIBM if test $gl_cv_func_isnanl_no_libm = no; then @@ -27,10 +28,8 @@ AC_DEFUN([gl_FUNC_ISNANL], else gl_func_isnanl=no fi - if test $gl_func_isnanl = yes; then - AC_DEFINE([HAVE_ISNANL], 1, - [Define if the isnan(long double) function is available.]) - else + if test $gl_func_isnanl != yes; then + HAVE_ISNANL=0 gl_BUILD_ISNANL fi AC_SUBST([ISNANL_LIBM]) @@ -48,7 +47,7 @@ AC_DEFUN([gl_FUNC_ISNANL_NO_LIBM], esac fi if test $gl_func_isnanl_no_libm = yes; then - AC_DEFINE([HAVE_ISNANL_IN_LIBC], 1, + AC_DEFINE([HAVE_ISNANL_IN_LIBC], [1], [Define if the isnan(long double) function is available in libc.]) else gl_BUILD_ISNANL @@ -115,7 +114,7 @@ dnl - for pseudo-zeroes, unnormalized nu AC_DEFUN([gl_FUNC_ISNANL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_C_BIGENDIAN]) + AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works], [ @@ -134,20 +133,30 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS], ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) typedef union { unsigned int word[NWORDS]; long double value; } memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif int main () { memory_long_double m; unsigned int i; - /* gcc-3.4.3 on IRIX 6.5 appears to have a problem with this. */ - if (!isnanl (0.0L / 0.0L)) + if (!isnanl (NaNl ())) return 1; /* The isnanl function should be immune against changes in the sign bit and in the mantissa bits. The xor operation twiddles a bit that can only be a sign bit or a mantissa bit (since the exponent never extends to bit 31). */ - m.value = 0.0L / 0.0L; + m.value = NaNl (); m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); for (i = 0; i < NWORDS; i++) m.word[i] |= 1; diff -ruNp m4-1.4.12/m4/ldexpl.m4 m4-1.4.13/m4/ldexpl.m4 --- m4-1.4.12/m4/ldexpl.m4 2008-02-23 10:30:09.000000000 -0700 +++ m4-1.4.13/m4/ldexpl.m4 2009-01-16 06:26:29.000000000 -0700 @@ -1,5 +1,5 @@ -# ldexpl.m4 serial 2 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# ldexpl.m4 serial 4 +dnl Copyright (C) 2007-2009 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. @@ -48,7 +48,7 @@ AC_DEFUN([gl_FUNC_LDEXPL], gl_func_ldexpl=no fi if test $gl_func_ldexpl = yes; then - AC_DEFINE([HAVE_LDEXPL], 1, + AC_DEFINE([HAVE_LDEXPL], [1], [Define if the ldexpl() function is available.]) dnl Also check whether it's declared. dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>. @@ -60,7 +60,8 @@ AC_DEFUN([gl_FUNC_LDEXPL], AC_SUBST([LDEXPL_LIBM]) ]) -dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1). +dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1 +dnl and MacOS X 10.4/PowerPC). AC_DEFUN([gl_FUNC_LDEXPL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) @@ -72,9 +73,11 @@ AC_DEFUN([gl_FUNC_LDEXPL_WORKS], extern long double ldexpl (long double, int); int main() { - volatile long double x = 1.0; - volatile long double y = ldexpl (x, -1); - return (y != 0.5L); + volatile long double x1 = 1.0; + volatile long double y1 = ldexpl (x1, -1); + volatile long double x2 = 1.73205L; + volatile long double y2 = ldexpl (x2, 0); + return (y1 != 0.5L) || (y2 != x2); }], [gl_cv_func_ldexpl_works=yes], [gl_cv_func_ldexpl_works=no], [case "$host_os" in aix*) gl_cv_func_ldexpl_works="guessing no";; diff -ruNp m4-1.4.12/m4/lib-ld.m4 m4-1.4.13/m4/lib-ld.m4 --- m4-1.4.12/m4/lib-ld.m4 2008-08-06 23:29:09.000000000 -0600 +++ m4-1.4.13/m4/lib-ld.m4 2009-01-16 06:26:30.000000000 -0700 @@ -1,5 +1,5 @@ -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +# lib-ld.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2009 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. @@ -10,7 +10,7 @@ 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, +[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 </dev/null` in *GNU* | *'with BFD'*) @@ -23,7 +23,7 @@ with_gnu_ld=$acl_cv_prog_gnu_ld dnl From libtool-1.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, +[AC_ARG_WITH([gnu-ld], [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl @@ -77,7 +77,7 @@ elif test "$with_gnu_ld" = yes; then else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL(acl_cv_path_LD, +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 @@ -101,9 +101,9 @@ else fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then - AC_MSG_RESULT($LD) + AC_MSG_RESULT([$LD]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU diff -ruNp m4-1.4.12/m4/lib-link.m4 m4-1.4.13/m4/lib-link.m4 --- m4-1.4.12/m4/lib-link.m4 2008-09-12 20:46:17.000000000 -0600 +++ m4-1.4.13/m4/lib-link.m4 2009-01-16 06:26:30.000000000 -0700 @@ -1,12 +1,12 @@ -# lib-link.m4 serial 16 (gettext-0.18) -dnl Copyright (C) 2001-2008 Free Software Foundation, Inc. +# lib-link.m4 serial 18 (gettext-0.18) +dnl Copyright (C) 2001-2009 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) +AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. @@ -114,7 +114,7 @@ AC_DEFUN([AC_LIB_RPATH], 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, [ + 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 @@ -131,7 +131,7 @@ AC_DEFUN([AC_LIB_RPATH], 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, + AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) @@ -446,12 +446,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], 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" + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - LIB[]NAME[]_PREFIX="$basedir" + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi additional_includedir="$basedir/include" ;; esac diff -ruNp m4-1.4.12/m4/libsigsegv.m4 m4-1.4.13/m4/libsigsegv.m4 --- m4-1.4.12/m4/libsigsegv.m4 2008-08-06 23:29:09.000000000 -0600 +++ m4-1.4.13/m4/libsigsegv.m4 2009-01-16 06:26:30.000000000 -0700 @@ -1,5 +1,5 @@ -# libsigsegv.m4 serial 2 -dnl Copyright (C) 2002-2003, 2008 Free Software Foundation, Inc. +# libsigsegv.m4 serial 3 +dnl Copyright (C) 2002-2003, 2008, 2009 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. @@ -22,7 +22,7 @@ AC_DEFUN([gl_LIBSIGSEGV], gl_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCSIGSEGV]) - AC_CACHE_CHECK([for libsigsegv], gl_cv_lib_sigsegv, [ + AC_CACHE_CHECK([for libsigsegv], [gl_cv_lib_sigsegv], [ gl_cv_lib_sigsegv="no, consider installing GNU libsigsegv" gl_save_LIBS="$LIBS" LIBS="$LIBS $LIBSIGSEGV" @@ -32,7 +32,7 @@ AC_DEFUN([gl_LIBSIGSEGV], LIBS="$gl_save_LIBS" ]) if test "$gl_cv_lib_sigsegv" = yes; then - AC_DEFINE([HAVE_LIBSIGSEGV], 1, + AC_DEFINE([HAVE_LIBSIGSEGV], [1], [Define if you have the libsigsegv library.]) AC_MSG_CHECKING([how to link with libsigsegv]) AC_MSG_RESULT([$LIBSIGSEGV]) @@ -43,6 +43,6 @@ AC_DEFUN([gl_LIBSIGSEGV], LIBSIGSEGV= LTLIBSIGSEGV= fi - AC_SUBST(LIBSIGSEGV) - AC_SUBST(LTLIBSIGSEGV) + AC_SUBST([LIBSIGSEGV]) + AC_SUBST([LTLIBSIGSEGV]) ]) diff -ruNp m4-1.4.12/m4/localcharset.m4 m4-1.4.13/m4/localcharset.m4 --- m4-1.4.12/m4/localcharset.m4 2008-02-23 10:30:09.000000000 -0700 +++ m4-1.4.13/m4/localcharset.m4 2009-01-16 06:26:30.000000000 -0700 @@ -1,5 +1,5 @@ -# localcharset.m4 serial 5 -dnl Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. +# localcharset.m4 serial 6 +dnl Copyright (C) 2002, 2004, 2006, 2009 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. @@ -8,7 +8,7 @@ AC_DEFUN([gl_LOCALCHARSET], [ dnl Prerequisites of lib/localcharset.c. AC_REQUIRE([AM_LANGINFO_CODESET]) - AC_CHECK_DECLS_ONCE(getc_unlocked) + AC_CHECK_DECLS_ONCE([getc_unlocked]) dnl Prerequisites of the lib/Makefile.am snippet. AC_REQUIRE([AC_CANONICAL_HOST]) diff -ruNp m4-1.4.12/m4/locale-fr.m4 m4-1.4.13/m4/locale-fr.m4 --- m4-1.4.12/m4/locale-fr.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/locale-fr.m4 2009-01-25 19:38:07.000000000 -0700 @@ -0,0 +1,185 @@ +# locale-fr.m4 serial 11 +dnl Copyright (C) 2003, 2005-2009 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 Determine the name of a french locale with traditional encoding. +AC_DEFUN([gt_LOCALE_FR], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + ]) + LOCALE_FR=$gt_cv_locale_fr + AC_SUBST([LOCALE_FR]) +]) + +dnl Determine the name of a french locale with UTF-8 encoding. +AC_DEFUN([gt_LOCALE_FR_UTF8], +[ + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + ]) + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + AC_SUBST([LOCALE_FR_UTF8]) +]) diff -ruNp m4-1.4.12/m4/locale-ja.m4 m4-1.4.13/m4/locale-ja.m4 --- m4-1.4.12/m4/locale-ja.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/locale-ja.m4 2009-01-25 19:38:08.000000000 -0700 @@ -0,0 +1,107 @@ +# locale-ja.m4 serial 7 +dnl Copyright (C) 2003, 2005-2009 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 Determine the name of a japanese locale with EUC-JP encoding. +AC_DEFUN([gt_LOCALE_JA], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + fi + rm -fr conftest* + ]) + LOCALE_JA=$gt_cv_locale_ja + AC_SUBST([LOCALE_JA]) +]) diff -ruNp m4-1.4.12/m4/locale-zh.m4 m4-1.4.13/m4/locale-zh.m4 --- m4-1.4.12/m4/locale-zh.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/locale-zh.m4 2009-01-25 19:38:08.000000000 -0700 @@ -0,0 +1,92 @@ +# locale-zh.m4 serial 6 +dnl Copyright (C) 2003, 2005-2009 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 Determine the name of a chinese locale with GB18030 encoding. +AC_DEFUN([gt_LOCALE_ZH_CN], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <stdlib.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + ]) + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + AC_SUBST([LOCALE_ZH_CN]) +]) diff -ruNp m4-1.4.12/m4/lock.m4 m4-1.4.13/m4/lock.m4 --- m4-1.4.12/m4/lock.m4 2008-08-17 19:08:53.000000000 -0600 +++ m4-1.4.13/m4/lock.m4 2009-01-16 06:26:31.000000000 -0700 @@ -1,5 +1,5 @@ -# lock.m4 serial 9 (gettext-0.18) -dnl Copyright (C) 2005-2008 Free Software Foundation, Inc. +# lock.m4 serial 10 (gettext-0.18) +dnl Copyright (C) 2005-2009 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. @@ -13,7 +13,7 @@ AC_DEFUN([gl_LOCK], # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. AC_CHECK_TYPE([pthread_rwlock_t], - [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1, + [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1], [Define if the POSIX multithreading library has read/write locks.])], [], [#include <pthread.h>]) @@ -25,7 +25,7 @@ error "No, in FreeBSD 4.0 recursive mute int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; #endif], - [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, + [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])]) fi gl_PREREQ_LOCK diff -ruNp m4-1.4.12/m4/longlong.m4 m4-1.4.13/m4/longlong.m4 --- m4-1.4.12/m4/longlong.m4 2008-02-23 10:30:09.000000000 -0700 +++ m4-1.4.13/m4/longlong.m4 2009-01-16 06:26:31.000000000 -0700 @@ -1,5 +1,5 @@ -# longlong.m4 serial 13 -dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. +# longlong.m4 serial 14 +dnl Copyright (C) 1999-2007, 2009 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. @@ -46,7 +46,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], [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, + AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type `long long int'.]) fi ]) @@ -69,7 +69,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT [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, + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) diff -ruNp m4-1.4.12/m4/lstat.m4 m4-1.4.13/m4/lstat.m4 --- m4-1.4.12/m4/lstat.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/lstat.m4 2009-01-16 06:26:31.000000000 -0700 @@ -0,0 +1,26 @@ +# serial 19 + +# Copyright (C) 1997-2001, 2003-2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. + +AC_DEFUN([gl_FUNC_LSTAT], +[ + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + dnl If lstat does not exist, the replacement <sys/stat.h> does + dnl "#define lstat stat", and lstat.c does not need to be compiled. + AC_CHECK_FUNCS_ONCE([lstat]) + if test $ac_cv_func_lstat = yes; then + AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK + dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]). + if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + REPLACE_LSTAT=1 + fi + # Prerequisites of lib/lstat.c. + AC_REQUIRE([AC_C_INLINE]) + fi +]) diff -ruNp m4-1.4.12/m4/malloc.m4 m4-1.4.13/m4/malloc.m4 --- m4-1.4.12/m4/malloc.m4 2008-02-23 10:30:10.000000000 -0700 +++ m4-1.4.13/m4/malloc.m4 2009-01-16 06:26:32.000000000 -0700 @@ -1,5 +1,5 @@ -# malloc.m4 serial 8 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# malloc.m4 serial 9 +dnl Copyright (C) 2007, 2009 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. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX], AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then HAVE_MALLOC_POSIX=1 - AC_DEFINE([HAVE_MALLOC_POSIX], 1, + AC_DEFINE([HAVE_MALLOC_POSIX], [1], [Define if the 'malloc' function is POSIX compliant.]) else AC_LIBOBJ([malloc]) diff -ruNp m4-1.4.12/m4/math_h.m4 m4-1.4.13/m4/math_h.m4 --- m4-1.4.12/m4/math_h.m4 2008-08-05 07:17:13.000000000 -0600 +++ m4-1.4.13/m4/math_h.m4 2008-12-11 22:14:59.000000000 -0700 @@ -1,4 +1,4 @@ -# math_h.m4 serial 13 +# math_h.m4 serial 14 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -53,6 +53,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE]) GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF]) GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN]) + GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF]) + GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND]) + GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL]) GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL]) GNULIB_MATHL=0; AC_SUBST([GNULIB_MATHL]) GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND]) @@ -63,6 +66,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF]) + HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND]) + HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL]) HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) diff -ruNp m4-1.4.12/m4/mbrtowc.m4 m4-1.4.13/m4/mbrtowc.m4 --- m4-1.4.12/m4/mbrtowc.m4 2008-02-23 10:30:10.000000000 -0700 +++ m4-1.4.13/m4/mbrtowc.m4 2009-02-28 08:26:43.000000000 -0700 @@ -1,15 +1,365 @@ -# mbrtowc.m4 serial 8 -dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc. +# mbrtowc.m4 serial 14 +dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 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_MBRTOWC], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + fi + AC_CHECK_FUNCS_ONCE([mbrtowc]) + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + fi + if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then + gl_MBRTOWC_NULL_ARG + gl_MBRTOWC_RETVAL + gl_MBRTOWC_NUL_RETVAL + case "$gl_cv_func_mbrtowc_null_arg" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1], + [Define if the mbrtowc function has the NULL string argument bug.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1], + [Define if the mbrtowc function returns a wrong return value.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1], + [Define if the mbrtowc function does not return 0 for a NUL character.]) + REPLACE_MBRTOWC=1 + ;; + esac + fi + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([mbrtowc]) + gl_PREREQ_MBRTOWC + fi +]) + +dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that +dnl redefines the semantics of the given mbstate_t type. +dnl Result is REPLACE_MBSTATE_T. +dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to +dnl avoid inconsistencies. + +AC_DEFUN([gl_MBSTATE_T_BROKEN], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_CHECK_FUNCS_ONCE([mbsinit]) + AC_CHECK_FUNCS_ONCE([mbrtowc]) + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + gl_MBRTOWC_INCOMPLETE_STATE + gl_MBRTOWC_SANITYCHECK + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + if test $REPLACE_MBSTATE_T = 1; then + gl_REPLACE_WCHAR_H + fi +]) + +dnl Test whether mbrtowc puts the state into non-initial state when parsing an +dnl incomplete multibyte character. +dnl Result is gl_cv_func_mbrtowc_incomplete_state. + +AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles incomplete characters], + [gl_cv_func_mbrtowc_incomplete_state], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on AIX and OSF/1. + osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_JA != none; then + AC_TRY_RUN([ +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } + return 0; +}], + [gl_cv_func_mbrtowc_incomplete_state=yes], + [gl_cv_func_mbrtowc_incomplete_state=no], + []) + fi + ]) +]) + +dnl Test whether mbrtowc works not worse than mbtowc. +dnl Result is gl_cv_func_mbrtowc_sanitycheck. + +AC_DEFUN([gl_MBRTOWC_SANITYCHECK], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc works as well as mbtowc], + [gl_cv_func_mbrtowc_sanitycheck], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_ZH_CN != none; then + AC_TRY_RUN([ +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +}], + [gl_cv_func_mbrtowc_sanitycheck=yes], + [gl_cv_func_mbrtowc_sanitycheck=no], + []) + fi + ]) +]) + +dnl Test whether mbrtowc supports a NULL string argument correctly. +dnl Result is gl_cv_func_mbrtowc_null_arg. + +AC_DEFUN([gl_MBRTOWC_NULL_ARG], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument], + [gl_cv_func_mbrtowc_null_arg], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none; then + AC_TRY_RUN([ +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 1; + } + return 0; +}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], []) + fi + ]) +]) + +dnl Test whether mbrtowc, when parsing the end of a multibyte character, +dnl correctly returns the number of bytes that were needed to complete the +dnl character (not the total number of bytes of the multibyte character). +dnl Result is gl_cv_func_mbrtowc_retval. + +AC_DEFUN([gl_MBRTOWC_RETVAL], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc has a correct return value], + [gl_cv_func_mbrtowc_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on HP-UX and Solaris. + hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then + AC_TRY_RUN([ +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + return 1; + } + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + return 1; + } + } + return 0; +}], + [gl_cv_func_mbrtowc_retval=yes], + [gl_cv_func_mbrtowc_retval=no], + []) + fi + ]) +]) + +dnl Test whether mbrtowc, when parsing a NUL character, correctly returns 0. +dnl Result is gl_cv_func_mbrtowc_nul_retval. + +AC_DEFUN([gl_MBRTOWC_NUL_RETVAL], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc returns 0 when parsing a NUL character], + [gl_cv_func_mbrtowc_nul_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_ZH_CN != none; then + AC_TRY_RUN([ +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 1; + } + return 0; +}], + [gl_cv_func_mbrtowc_nul_retval=yes], + [gl_cv_func_mbrtowc_nul_retval=no], + []) + fi + ]) +]) + +# Prerequisites of lib/mbrtowc.c. +AC_DEFUN([gl_PREREQ_MBRTOWC], [ + : +]) + + 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. +dnl This override of an autoconf macro can be removed when autoconf 2.60 or +dnl newer can be assumed everywhere. -AC_DEFUN([gl_FUNC_MBRTOWC], +m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.60]),[-1],[ +AC_DEFUN([AC_FUNC_MBRTOWC], [ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], @@ -25,7 +375,8 @@ AC_DEFUN([gl_FUNC_MBRTOWC], gl_cv_func_mbrtowc=yes, gl_cv_func_mbrtowc=no)]) if test $gl_cv_func_mbrtowc = yes; then - AC_DEFINE([HAVE_MBRTOWC], 1, + AC_DEFINE([HAVE_MBRTOWC], [1], [Define to 1 if mbrtowc and mbstate_t are properly declared.]) fi ]) +]) diff -ruNp m4-1.4.12/m4/mbsinit.m4 m4-1.4.13/m4/mbsinit.m4 --- m4-1.4.12/m4/mbsinit.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/mbsinit.m4 2008-12-24 06:20:32.000000000 -0700 @@ -0,0 +1,30 @@ +# mbsinit.m4 serial 3 +dnl Copyright (C) 2008 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_MBSINIT], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + fi + AC_CHECK_FUNCS_ONCE([mbsinit]) + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + fi + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([mbsinit]) + gl_PREREQ_MBSINIT + fi +]) + +# Prerequisites of lib/mbsinit.c. +AC_DEFUN([gl_PREREQ_MBSINIT], [ + : +]) diff -ruNp m4-1.4.12/m4/mbstate_t.m4 m4-1.4.13/m4/mbstate_t.m4 --- m4-1.4.12/m4/mbstate_t.m4 2008-08-05 07:17:13.000000000 -0600 +++ m4-1.4.13/m4/mbstate_t.m4 2009-01-16 06:26:32.000000000 -0700 @@ -1,5 +1,5 @@ -# mbstate_t.m4 serial 10 -dnl Copyright (C) 2000-2002, 2008 Free Software Foundation, Inc. +# mbstate_t.m4 serial 12 +dnl Copyright (C) 2000-2002, 2008, 2009 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. @@ -13,7 +13,10 @@ dnl with or without modifications, as lo # AC_TYPE_MBSTATE_T # ----------------- AC_DEFUN([AC_TYPE_MBSTATE_T], - [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, +[ + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11 + + AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT[ @@ -22,9 +25,10 @@ AC_DEFUN([AC_TYPE_MBSTATE_T], [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, + AC_DEFINE([HAVE_MBSTATE_T], [1], [Define to 1 if <wchar.h> declares mbstate_t.]) else - AC_DEFINE([mbstate_t], int, + AC_DEFINE([mbstate_t], [int], [Define to a type if <wchar.h> does not define.]) - fi]) + fi +]) diff -ruNp m4-1.4.12/m4/memchr.m4 m4-1.4.13/m4/memchr.m4 --- m4-1.4.12/m4/memchr.m4 2008-08-05 07:16:33.000000000 -0600 +++ m4-1.4.13/m4/memchr.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -# memchr.m4 serial 4 -dnl Copyright (C) 2002, 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_FUNC_MEMCHR], -[ - AC_REPLACE_FUNCS(memchr) - if test $ac_cv_func_memchr = no; then - gl_PREREQ_MEMCHR - fi -]) - -# Prerequisites of lib/memchr.c. -AC_DEFUN([gl_PREREQ_MEMCHR], [ - AC_CHECK_HEADERS(bp-sym.h) -]) diff -ruNp m4-1.4.12/m4/memcmp.m4 m4-1.4.13/m4/memcmp.m4 --- m4-1.4.12/m4/memcmp.m4 2008-10-09 21:04:48.000000000 -0600 +++ m4-1.4.13/m4/memcmp.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,31 +0,0 @@ -# memcmp.m4 serial 13 -dnl Copyright (C) 2002, 2003, 2004, 2007, 2008 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_MEMCMP], -[ - if test $cross_compiling != no; then - # AC_FUNC_MEMCMP as of 2.62 defaults to 'no' when cross compiling. - # We default to yes if memcmp appears to exist, which works - # better for MinGW. - AC_CACHE_CHECK([whether cross-compiling target has memcmp], - [ac_cv_func_memcmp_working], - [AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[#include <string.h> - ]], [[int ret = memcmp ("foo", "bar", 0);]])], - [ac_cv_func_memcmp_working=yes], - [ac_cv_func_memcmp_working=no])]) - fi - AC_FUNC_MEMCMP - dnl Note: AC_FUNC_MEMCMP does AC_LIBOBJ(memcmp). - if test $ac_cv_func_memcmp_working = no; then - AC_DEFINE(memcmp, rpl_memcmp, - [Define to rpl_memcmp if the replacement function should be used.]) - gl_PREREQ_MEMCMP - fi -]) - -# Prerequisites of lib/memcmp.c. -AC_DEFUN([gl_PREREQ_MEMCMP], [:]) diff -ruNp m4-1.4.12/m4/memset.m4 m4-1.4.13/m4/memset.m4 --- m4-1.4.12/m4/memset.m4 2008-08-06 23:56:00.000000000 -0600 +++ m4-1.4.13/m4/memset.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -# memset.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_FUNC_MEMSET], -[ - AC_REPLACE_FUNCS(memset) - if test $ac_cv_func_memset = no; then - gl_PREREQ_MEMSET - fi -]) - -# Prerequisites of lib/memset.c. -AC_DEFUN([gl_PREREQ_MEMSET], [ - : -]) diff -ruNp m4-1.4.12/m4/mkdtemp.m4 m4-1.4.13/m4/mkdtemp.m4 --- m4-1.4.12/m4/mkdtemp.m4 2008-02-23 10:30:11.000000000 -0700 +++ m4-1.4.13/m4/mkdtemp.m4 2009-01-16 06:26:32.000000000 -0700 @@ -1,5 +1,5 @@ -# mkdtemp.m4 serial 5 -dnl Copyright (C) 2001-2003, 2006-2007 Free Software Foundation, Inc. +# mkdtemp.m4 serial 6 +dnl Copyright (C) 2001-2003, 2006-2007, 2009 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. @@ -7,7 +7,7 @@ dnl with or without modifications, as lo AC_DEFUN([gt_FUNC_MKDTEMP], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - AC_REPLACE_FUNCS(mkdtemp) + AC_REPLACE_FUNCS([mkdtemp]) if test $ac_cv_func_mkdtemp = no; then HAVE_MKDTEMP=0 gl_PREREQ_MKDTEMP diff -ruNp m4-1.4.12/m4/multiarch.m4 m4-1.4.13/m4/multiarch.m4 --- m4-1.4.12/m4/multiarch.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/multiarch.m4 2009-01-24 12:02:27.000000000 -0700 @@ -0,0 +1,66 @@ +# multiarch.m4 serial 4 +dnl Copyright (C) 2008, 2009 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. + +# Determine whether the compiler is or may be producing universal binaries. +# +# On MacOS X 10.5 and later systems, the user can create libraries and +# executables that work on multiple system types--known as "fat" or +# "universal" binaries--by specifying multiple '-arch' options to the +# compiler but only a single '-arch' option to the preprocessor. Like +# this: +# +# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ +# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ +# CPP="gcc -E" CXXCPP="g++ -E" +# +# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the +# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly. + +dnl This macro must pass through AC_REQUIRE (never directly invoke it). +AC_DEFUN_ONCE([gl_MULTIARCH], +[ + dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. + gl_cv_c_multiarch=no + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + ]])], + [ + dnl Check for potential -arch flags. It is not universal unless + dnl there are at least two -arch flags with different values. + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + ]) + if test $gl_cv_c_multiarch = yes; then + AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1], + [Define if the compiler is building for multiple architectures of Apple platforms at once.]) + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + AC_SUBST([APPLE_UNIVERSAL_BUILD]) +]) diff -ruNp m4-1.4.12/m4/nocrash.m4 m4-1.4.13/m4/nocrash.m4 --- m4-1.4.12/m4/nocrash.m4 2008-02-23 10:30:11.000000000 -0700 +++ m4-1.4.13/m4/nocrash.m4 2009-01-16 06:26:33.000000000 -0700 @@ -1,12 +1,12 @@ -# nocrash.m4 serial 1 -dnl Copyright (C) 2005 Free Software Foundation, Inc. +# nocrash.m4 serial 2 +dnl Copyright (C) 2005, 2009 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 Based on libsigsegv, from Bruno Haible and Paolo Bonzini. -AC_PREREQ(2.13) +AC_PREREQ([2.13]) dnl Expands to some code for use in .c programs that will cause the configure dnl test to exit instead of crashing. This is useful to avoid triggering diff -ruNp m4-1.4.12/m4/open.m4 m4-1.4.13/m4/open.m4 --- m4-1.4.12/m4/open.m4 2008-10-09 21:04:49.000000000 -0600 +++ m4-1.4.13/m4/open.m4 2009-01-16 06:26:33.000000000 -0700 @@ -1,5 +1,5 @@ -# open.m4 serial 4 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# open.m4 serial 5 +dnl Copyright (C) 2007-2009 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. @@ -39,7 +39,7 @@ changequote([,])dnl ]) case "$gl_cv_func_open_slash" in *no) - AC_DEFINE([OPEN_TRAILING_SLASH_BUG], 1, + AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], [Define to 1 if open() fails to recognize a trailing slash.]) gl_REPLACE_OPEN ;; diff -ruNp m4-1.4.12/m4/pathmax.m4 m4-1.4.13/m4/pathmax.m4 --- m4-1.4.12/m4/pathmax.m4 2008-02-23 10:30:11.000000000 -0700 +++ m4-1.4.13/m4/pathmax.m4 2009-03-23 05:56:47.000000000 -0600 @@ -1,5 +1,5 @@ -# pathmax.m4 serial 6 -dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# pathmax.m4 serial 8 +dnl Copyright (C) 2002, 2003, 2005, 2006, 2009 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. @@ -7,5 +7,6 @@ dnl with or without modifications, as lo AC_DEFUN([gl_PATHMAX], [ dnl Prerequisites of lib/pathmax.h. - AC_CHECK_HEADERS_ONCE(sys/param.h) + AC_CHECK_FUNCS_ONCE([pathconf]) + AC_CHECK_HEADERS_ONCE([sys/param.h]) ]) diff -ruNp m4-1.4.12/m4/pipe.m4 m4-1.4.13/m4/pipe.m4 --- m4-1.4.12/m4/pipe.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/pipe.m4 2009-03-02 06:04:40.000000000 -0700 @@ -0,0 +1,12 @@ +# pipe.m4 serial 4 +dnl Copyright (C) 2004, 2008, 2009 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_PIPE], +[ + dnl Prerequisites of lib/pipe.c. + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([AC_TYPE_MODE_T]) +]) diff -ruNp m4-1.4.12/m4/po.m4 m4-1.4.13/m4/po.m4 --- m4-1.4.12/m4/po.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/po.m4 2009-01-25 19:37:31.000000000 -0700 @@ -0,0 +1,449 @@ +# po.m4 serial 17 (gettext-0.18) +dnl Copyright (C) 1995-2009 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 <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 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 Release version of the gettext macros. This is used to ensure that + dnl the gettext macros and po/Makefile.in.in are in sync. + AC_SUBST([GETTEXT_MACRO_VERSION], [0.17]) + + 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]) + + dnl Support for AM_XGETTEXT_OPTION. + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) + + 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 <<EOT +$* +EOT + } + gt_echo='echo_func' + fi + fi + + # A sed script that extracts the value of VARIABLE from a Makefile. + sed_x_variable=' +# Test if the hold space is empty. +x +s/P/P/ +x +ta +# Yes it was empty. Look if we have the expected variable definition. +/^[ ]*VARIABLE[ ]*=/{ + # Seen the first line of the variable definition. + s/^[ ]*VARIABLE[ ]*=// + ba +} +bd +:a +# Here we are processing a line from the variable definition. +# Remove comment, more precisely replace it with a space. +s/#.*$/ / +# See if the line ends in a backslash. +tb +:b +s/\\$// +# Print the line, without the trailing backslash. +p +tc +# There was no trailing backslash. The end of the variable definition is +# reached. Clear the hold space. +s/^.*$// +x +bd +:c +# A trailing backslash means that the variable definition continues in the +# next line. Put a nonempty string into the hold space to indicate this. +s/^.*$/P/ +x +:d +' +changequote([,])dnl + + # Set POTFILES to the value of the Makefile variable POTFILES. + sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'` + POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"` + # Compute POTFILES_DEPS as + # $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) + POTFILES_DEPS= + for file in $POTFILES; do + POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file" + done + POMAKEFILEDEPS="" + + 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 + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. + sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` + ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` + fi + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + # 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) + # Compute PROPERTIESFILES + # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) + # Compute CLASSFILES + # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) + # Compute QMFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm) + # Compute MSGFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) + # Compute RESOURCESDLLFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + PROPERTIESFILES= + CLASSFILES= + QMFILES= + MSGFILES= + RESOURCESDLLFILES= + 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" + PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties" + CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class" + QMFILES="$QMFILES $srcdirpre$lang.qm" + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg" + 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/'` + RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll" + 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= + JAVACATALOGS= + QTCATALOGS= + TCLCATALOGS= + CSHARPCATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties" + QTCATALOGS="$QTCATALOGS $lang.qm" + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg" + 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/'` + CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll" + done + fi + + sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$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" <<EOF +$frobbedlang.msg: $lang.po + @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \ + \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } +EOF + done + fi + if grep -l '@CSHARPCATALOGS@' "$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/_/-/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" <<EOF +$frobbedlang/\$(DOMAIN).resources.dll: $lang.po + @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \ + \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } +EOF + done + fi + if test -n "$POMAKEFILEDEPS"; then + cat >> "$ac_file.tmp" <<EOF +Makefile: $POMAKEFILEDEPS +EOF + fi + mv "$ac_file.tmp" "$ac_file" +]) + +dnl Initializes the accumulator used by AM_XGETTEXT_OPTION. +AC_DEFUN([AM_XGETTEXT_OPTION_INIT], +[ + XGETTEXT_EXTRA_OPTIONS= +]) + +dnl Registers an option to be passed to xgettext in the po subdirectory. +AC_DEFUN([AM_XGETTEXT_OPTION], +[ + AC_REQUIRE([AM_XGETTEXT_OPTION_INIT]) + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1" +]) diff -ruNp m4-1.4.12/m4/posix_spawn.m4 m4-1.4.13/m4/posix_spawn.m4 --- m4-1.4.12/m4/posix_spawn.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/posix_spawn.m4 2009-02-28 08:25:57.000000000 -0700 @@ -0,0 +1,375 @@ +# posix_spawn.m4 serial 4 +dnl Copyright (C) 2008 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 Tests whether the entire posix_spawn facility is available. +AC_DEFUN([gl_POSIX_SPAWN], +[ + AC_REQUIRE([gl_POSIX_SPAWN_BODY]) +]) + +AC_DEFUN([gl_POSIX_SPAWN_BODY], +[ + AC_REQUIRE([gl_SPAWN_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([posix_spawn]) + dnl Assume that when the main function exists, all the others are + dnl available as well. + dnl AC_CHECK_FUNCS_ONCE([posix_spawnp]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_init]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addclose]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_adddup2]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addopen]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_destroy]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_init]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getflags]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setflags]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getpgroup]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setpgroup]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getschedparam]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setschedparam]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getschedpolicy]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setschedpolicy]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getsigdefault]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setsigdefault]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getsigmask]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setsigmask]) + dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_destroy]) + if test $ac_cv_func_posix_spawn = yes; then + gl_POSIX_SPAWN_WORKS + case "$gl_cv_func_posix_spawn_works" in + *yes) ;; + *) REPLACE_POSIX_SPAWN=1 ;; + esac + else + HAVE_POSIX_SPAWN=0 + fi +]) + +dnl Test whether posix_spawn actually works. +dnl posix_spawn on AIX 5.3..6.1 has two bugs: +dnl 1) When it fails to execute the program, the child process exits with +dnl exit() rather than _exit(), which causes the stdio buffers to be +dnl flushed. Reported by Rainer Tammer. +dnl 2) The posix_spawn_file_actions_addopen function does not support file +dnl names that contain a '*'. +dnl posix_spawn on AIX 5.3..6.1 has also a third bug: It does not work +dnl when POSIX threads are used. But we don't test against this bug here. +AC_DEFUN([gl_POSIX_SPAWN_WORKS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether posix_spawn works], [gl_cv_func_posix_spawn_works], + [if test $cross_compiling = no; then + AC_LINK_IFELSE([AC_LANG_SOURCE([[ +#include <errno.h> +#include <fcntl.h> +#include <signal.h> +#include <spawn.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> + +extern char **environ; + +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + +#ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +#endif +#ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(x) (((x) >> 8) & 0xff) +#endif + +#define CHILD_PROGRAM_FILENAME "/non/exist/ent" + +static int +fd_safer (int fd) +{ + if (0 <= fd && fd <= 2) + { + int f = fd_safer (dup (fd)); + int e = errno; + close (fd); + errno = e; + fd = f; + } + + return fd; +} + +int +main () +{ + char *argv[2] = { CHILD_PROGRAM_FILENAME, NULL }; + int ofd[2]; + sigset_t blocked_signals; + sigset_t fatal_signal_set; + posix_spawn_file_actions_t actions; + bool actions_allocated; + posix_spawnattr_t attrs; + bool attrs_allocated; + int err; + pid_t child; + int status; + int exitstatus; + + setvbuf (stdout, NULL, _IOFBF, 0); + puts ("This should be seen only once."); + if (pipe (ofd) < 0 || (ofd[1] = fd_safer (ofd[1])) < 0) + { + perror ("cannot create pipe"); + exit (1); + } + sigprocmask (SIG_SETMASK, NULL, &blocked_signals); + sigemptyset (&fatal_signal_set); + sigaddset (&fatal_signal_set, SIGINT); + sigaddset (&fatal_signal_set, SIGTERM); + sigaddset (&fatal_signal_set, SIGHUP); + sigaddset (&fatal_signal_set, SIGPIPE); + sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL); + actions_allocated = false; + attrs_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (err = posix_spawn_file_actions_adddup2 (&actions, ofd[0], STDIN_FILENO)) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ofd[0])) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ofd[1])) != 0 + || (err = posix_spawnattr_init (&attrs)) != 0 + || (attrs_allocated = true, + (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0 + || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0) + || (err = posix_spawnp (&child, CHILD_PROGRAM_FILENAME, &actions, &attrs, argv, environ)) != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + if (attrs_allocated) + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + if (err == ENOENT) + return 0; + else + { + errno = err; + perror ("subprocess failed"); + exit (1); + } + } + posix_spawn_file_actions_destroy (&actions); + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + close (ofd[0]); + close (ofd[1]); + status = 0; + while (waitpid (child, &status, 0) != child) + ; + if (!WIFEXITED (status)) + { + fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status); + exit (1); + } + exitstatus = WEXITSTATUS (status); + if (exitstatus != 127) + { + fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus); + exit (1); + } + return 0; +} +]])], + [if test -s conftest$ac_exeext \ + && ./conftest$ac_exeext > conftest.out \ + && echo 'This should be seen only once.' > conftest.ok \ + && cmp conftest.out conftest.ok > /dev/null; then + gl_cv_func_posix_spawn_works=yes + else + gl_cv_func_posix_spawn_works=no + fi], + [gl_cv_func_posix_spawn_works=no]) + if test $gl_cv_func_posix_spawn_works = yes; then + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +/* Test whether posix_spawn_file_actions_addopen supports filename arguments + that contain special characters such as '*'. */ + +#include <errno.h> +#include <fcntl.h> +#include <signal.h> +#include <spawn.h> +#include <stdbool.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> + +extern char **environ; + +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + +#ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +#endif +#ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(x) (((x) >> 8) & 0xff) +#endif + +#define CHILD_PROGRAM_FILENAME "conftest" +#define DATA_FILENAME "conftest%=*#?" + +static int +parent_main (void) +{ + FILE *fp; + char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL }; + posix_spawn_file_actions_t actions; + bool actions_allocated; + int err; + pid_t child; + int status; + int exitstatus; + + /* Create a data file with specific contents. */ + fp = fopen (DATA_FILENAME, "wb"); + if (fp == NULL) + { + perror ("cannot create data file"); + return 1; + } + fwrite ("Halle Potta", 1, 11, fp); + if (fflush (fp) || fclose (fp)) + { + perror ("cannot prepare data file"); + return 1; + } + + /* Avoid reading from our stdin, as it could block. */ + freopen ("/dev/null", "rb", stdin); + + /* Test whether posix_spawn_file_actions_addopen with this file name + actually works, but spawning a child that reads from this file. */ + actions_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, DATA_FILENAME, O_RDONLY, 0600)) != 0 + || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + errno = err; + perror ("subprocess failed"); + return 1; + } + posix_spawn_file_actions_destroy (&actions); + status = 0; + while (waitpid (child, &status, 0) != child) + ; + if (!WIFEXITED (status)) + { + fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status); + return 1; + } + exitstatus = WEXITSTATUS (status); + if (exitstatus != 0) + { + fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus); + return 1; + } + return 0; +} + +static int +child_main (void) +{ + char buf[1024]; + + /* See if reading from STDIN_FILENO yields the expected contents. */ + if (fread (buf, 1, sizeof (buf), stdin) == 11 + && memcmp (buf, "Halle Potta", 11) == 0) + return 0; + else + return 2; +} + +static void +cleanup_then_die (int sig) +{ + /* Clean up data file. */ + unlink (DATA_FILENAME); + + /* Re-raise the signal and die from it. */ + signal (sig, SIG_DFL); + raise (sig); +} + +int +main (int argc, char *argv[]) +{ + int exitstatus; + + if (!(argc > 1 && strcmp (argv[1], "-child") == 0)) + { + /* This is the parent process. */ + signal (SIGINT, cleanup_then_die); + signal (SIGTERM, cleanup_then_die); + #ifdef SIGHUP + signal (SIGHUP, cleanup_then_die); + #endif + + exitstatus = parent_main (); + } + else + { + /* This is the child process. */ + + exitstatus = child_main (); + } + unlink (DATA_FILENAME); + return exitstatus; +} +]])], + [], + [gl_cv_func_posix_spawn_works=no]) + fi + else + case "$host_os" in + aix*) gl_cv_func_posix_spawn_works="guessing no";; + *) gl_cv_func_posix_spawn_works="guessing yes";; + esac + fi + ]) +]) + +AC_DEFUN([gl_POSIX_SPAWN_INTERNAL], +[ + AC_LIBOBJ([spawni]) + dnl Prerequisites of lib/spawni.c. + AC_CHECK_HEADERS([paths.h]) + AC_CHECK_FUNCS([confstr sched_setparam sched_setscheduler setegid seteuid vfork]) +]) diff -ruNp m4-1.4.12/m4/printf-frexp.m4 m4-1.4.13/m4/printf-frexp.m4 --- m4-1.4.12/m4/printf-frexp.m4 2008-02-23 10:30:11.000000000 -0700 +++ m4-1.4.13/m4/printf-frexp.m4 2009-01-16 06:26:33.000000000 -0700 @@ -1,5 +1,5 @@ -# printf-frexp.m4 serial 2 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# printf-frexp.m4 serial 3 +dnl Copyright (C) 2007, 2009 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. @@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXP], gl_FUNC_FREXP_WORKS case "$gl_cv_func_frexp_works" in *yes) - AC_DEFINE([HAVE_FREXP_IN_LIBC], 1, + AC_DEFINE([HAVE_FREXP_IN_LIBC], [1], [Define if the frexp function is available in libc.]) ;; esac @@ -39,7 +39,7 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXP], [gl_cv_func_ldexp_no_libm=no]) ]) if test $gl_cv_func_ldexp_no_libm = yes; then - AC_DEFINE([HAVE_LDEXP_IN_LIBC], 1, + AC_DEFINE([HAVE_LDEXP_IN_LIBC], [1], [Define if the ldexp function is available in libc.]) fi ]) diff -ruNp m4-1.4.12/m4/printf-frexpl.m4 m4-1.4.13/m4/printf-frexpl.m4 --- m4-1.4.12/m4/printf-frexpl.m4 2008-02-23 10:30:11.000000000 -0700 +++ m4-1.4.13/m4/printf-frexpl.m4 2009-01-16 06:26:33.000000000 -0700 @@ -1,5 +1,5 @@ -# printf-frexpl.m4 serial 5 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# printf-frexpl.m4 serial 6 +dnl Copyright (C) 2007, 2009 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. @@ -32,7 +32,7 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL], REPLACE_FREXPL=1 fi if test $gl_func_frexpl_no_libm = yes; then - AC_DEFINE([HAVE_FREXPL_IN_LIBC], 1, + AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1], [Define if the frexpl function is available in libc.]) dnl Also check whether it's declared. dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. @@ -53,7 +53,7 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL], gl_FUNC_LDEXPL_WORKS case "$gl_cv_func_ldexpl_works" in *yes) - AC_DEFINE([HAVE_LDEXPL_IN_LIBC], 1, + AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1], [Define if the ldexpl function is available in libc.]) dnl Also check whether it's declared. dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>. diff -ruNp m4-1.4.12/m4/printf.m4 m4-1.4.13/m4/printf.m4 --- m4-1.4.12/m4/printf.m4 2008-08-05 07:17:14.000000000 -0600 +++ m4-1.4.13/m4/printf.m4 2009-02-28 08:26:45.000000000 -0700 @@ -1,5 +1,5 @@ -# printf.m4 serial 23 -dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc. +# printf.m4 serial 33 +dnl Copyright (C) 2003, 2007-2009 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. @@ -125,7 +125,8 @@ changequote([,])dnl ]) dnl Test whether the *printf family of functions supports infinite and NaN -dnl 'double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001) +dnl 'double' arguments and negative zero arguments in the %f, %e, %g +dnl directives. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_infinite. AC_DEFUN([gl_PRINTF_INFINITE], @@ -156,6 +157,13 @@ strisnan (const char *string, size_t sta } return 0; } +static int +have_minus_zero () +{ + static double plus_zero = 0.0; + double minus_zero = - plus_zero; + return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0; +} static char buf[10000]; static double zero = 0.0; int main () @@ -187,6 +195,11 @@ int main () if (sprintf (buf, "%g", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) return 1; + /* This test fails on HP-UX 10.20. */ + if (have_minus_zero ()) + if (sprintf (buf, "%g", - zero) < 0 + || strcmp (buf, "-0") != 0) + return 1; return 0; }], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no], [ @@ -225,12 +238,12 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE [ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_C_BIGENDIAN]) + AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl The user can set or unset the variable gl_printf_safe to indicate dnl that he wishes a safe handling of non-IEEE-754 'long double' values. if test -n "$gl_printf_safe"; then - AC_DEFINE([CHECK_PRINTF_SAFE], 1, + AC_DEFINE([CHECK_PRINTF_SAFE], [1], [Define if you wish *printf() functions that have a safe handling of non-IEEE-754 'long double' values.]) fi @@ -545,7 +558,7 @@ int main () if (sprintf (buf, "%F", 1.0 / 0.0) < 0 || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) return 1; - /* This catches a Cygwin 2007 bug. */ + /* This catches a Cygwin 1.5.x bug. */ if (sprintf (buf, "%.F", 1234.0) < 0 || strcmp (buf, "1234") != 0) return 1; @@ -612,6 +625,84 @@ changequote([,])dnl ]) ]) +dnl Test whether the *printf family of functions supports the %ls format +dnl directive and in particular, when a precision is specified, whether +dnl the functions stop converting the wide string argument when the number +dnl of bytes that have been produced by this conversion equals or exceeds +dnl the precision. +dnl Result is gl_cv_func_printf_directive_ls. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_LS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'ls' directive], + [gl_cv_func_printf_directive_ls], + [ + AC_TRY_RUN([ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be + included before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +#include <string.h> +int main () +{ + char buf[100]; + /* Test whether %ls works at all. + This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on + Cygwin 1.5. */ + { + static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "abc") != 0) + return 1; + } + /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an + assertion failure inside libc), but not on OpenBSD 4.0. */ + { + static const wchar_t wstring[] = { 'a', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "a") != 0) + return 1; + } + /* Test whether precisions in %ls are supported as specified in ISO C 99 + section 7.19.6.1: + "If a precision is specified, no more than that many bytes are written + (including shift sequences, if any), and the array shall contain a + null wide character if, to equal the multibyte character sequence + length given by the precision, the function would need to access a + wide character one past the end of the array." + This test fails on Solaris 10. */ + { + static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%.2ls", wstring) < 0 + || strcmp (buf, "ab") != 0) + return 1; + } + return 0; +}], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no], + [ +changequote(,)dnl + case "$host_os" in + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + dnl Test whether the *printf family of functions supports POSIX/XSI format dnl strings with positions. (POSIX:2001) dnl Result is gl_cv_func_printf_positions. @@ -811,12 +902,15 @@ dnl Result is gl_cv_func_printf_enomem. AC_DEFUN([gl_PRINTF_ENOMEM], [ AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_MULTIARCH]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf survives out-of-memory conditions], [gl_cv_func_printf_enomem], [ + gl_cv_func_printf_enomem="guessing no" if test "$cross_compiling" = no; then - AC_LANG_CONFTEST([AC_LANG_SOURCE([ + if test $APPLE_UNIVERSAL_BUILD = 0; then + AC_LANG_CONFTEST([AC_LANG_SOURCE([ ]GL_NOCRASH[ changequote(,)dnl #include <stdio.h> @@ -865,22 +959,29 @@ int main() } changequote([,])dnl ])]) - if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - (./conftest - result=$? - if test $result != 0 && test $result != 77; then result=1; fi - exit $result - ) >/dev/null 2>/dev/null - case $? in - 0) gl_cv_func_printf_enomem="yes" ;; - 77) gl_cv_func_printf_enomem="guessing no" ;; - *) gl_cv_func_printf_enomem="no" ;; - esac + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + (./conftest + result=$? + if test $result != 0 && test $result != 77; then result=1; fi + exit $result + ) >/dev/null 2>/dev/null + case $? in + 0) gl_cv_func_printf_enomem="yes" ;; + 77) gl_cv_func_printf_enomem="guessing no" ;; + *) gl_cv_func_printf_enomem="no" ;; + esac + else + gl_cv_func_printf_enomem="guessing no" + fi + rm -fr conftest* else + dnl A universal build on Apple MacOS X platforms. + dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode. + dnl But we need a configuration result that is valid in both modes. gl_cv_func_printf_enomem="guessing no" fi - rm -fr conftest* - else + fi + if test "$gl_cv_func_printf_enomem" = "guessing no"; then changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. @@ -901,6 +1002,8 @@ changequote(,)dnl osf*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Haiku. + haiku*) gl_cv_func_printf_enomem="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_printf_enomem="guessing no";; esac @@ -1130,7 +1233,7 @@ AC_DEFUN([gl_SNPRINTF_SIZE1], #include <stdio.h> int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; snprintf (buf, 1, "%d", 12345); return buf[1] != 'E'; }], @@ -1148,7 +1251,7 @@ dnl -------------------------------- dnl #include <stdio.h> dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1169,7 +1272,7 @@ dnl return ret; dnl } dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl my_snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1197,7 +1300,7 @@ static int my_snprintf (char *buf, int s } int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 0, "%d", 12345); return buf[0] != 'D'; }], @@ -1249,18 +1352,19 @@ dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE dnl 5 = gl_PRINTF_DIRECTIVE_A dnl 6 = gl_PRINTF_DIRECTIVE_F dnl 7 = gl_PRINTF_DIRECTIVE_N -dnl 8 = gl_PRINTF_POSITIONS -dnl 9 = gl_PRINTF_FLAG_GROUPING -dnl 10 = gl_PRINTF_FLAG_LEFTADJUST -dnl 11 = gl_PRINTF_FLAG_ZERO -dnl 12 = gl_PRINTF_PRECISION -dnl 13 = gl_PRINTF_ENOMEM -dnl 14 = gl_SNPRINTF_PRESENCE -dnl 15 = gl_SNPRINTF_TRUNCATION_C99 -dnl 16 = gl_SNPRINTF_RETVAL_C99 -dnl 17 = gl_SNPRINTF_DIRECTIVE_N -dnl 18 = gl_SNPRINTF_SIZE1 -dnl 19 = gl_VSNPRINTF_ZEROSIZE_C99 +dnl 8 = gl_PRINTF_DIRECTIVE_LS +dnl 9 = gl_PRINTF_POSITIONS +dnl 10 = gl_PRINTF_FLAG_GROUPING +dnl 11 = gl_PRINTF_FLAG_LEFTADJUST +dnl 12 = gl_PRINTF_FLAG_ZERO +dnl 13 = gl_PRINTF_PRECISION +dnl 14 = gl_PRINTF_ENOMEM +dnl 15 = gl_SNPRINTF_PRESENCE +dnl 16 = gl_SNPRINTF_TRUNCATION_C99 +dnl 17 = gl_SNPRINTF_RETVAL_C99 +dnl 18 = gl_SNPRINTF_DIRECTIVE_N +dnl 19 = gl_SNPRINTF_SIZE1 +dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99 dnl dnl 1 = checking whether printf supports size specifiers as in C99... dnl 2 = checking whether printf supports 'long double' arguments... @@ -1269,41 +1373,44 @@ dnl 4 = checking whether printf supports dnl 5 = checking whether printf supports the 'a' and 'A' directives... dnl 6 = checking whether printf supports the 'F' directive... dnl 7 = checking whether printf supports the 'n' directive... -dnl 8 = checking whether printf supports POSIX/XSI format strings with positions... -dnl 9 = checking whether printf supports the grouping flag... -dnl 10 = checking whether printf supports the left-adjust flag correctly... -dnl 11 = checking whether printf supports the zero flag correctly... -dnl 12 = checking whether printf supports large precisions... -dnl 13 = checking whether printf survives out-of-memory conditions... -dnl 14 = checking for snprintf... -dnl 15 = checking whether snprintf truncates the result as in C99... -dnl 16 = checking whether snprintf returns a byte count as in C99... -dnl 17 = checking whether snprintf fully supports the 'n' directive... -dnl 18 = checking whether snprintf respects a size of 1... -dnl 19 = checking whether vsnprintf respects a zero size as in C99... +dnl 8 = checking whether printf supports the 'ls' directive... +dnl 9 = checking whether printf supports POSIX/XSI format strings with positions... +dnl 10 = checking whether printf supports the grouping flag... +dnl 11 = checking whether printf supports the left-adjust flag correctly... +dnl 12 = checking whether printf supports the zero flag correctly... +dnl 13 = checking whether printf supports large precisions... +dnl 14 = checking whether printf survives out-of-memory conditions... +dnl 15 = checking for snprintf... +dnl 16 = checking whether snprintf truncates the result as in C99... +dnl 17 = checking whether snprintf returns a byte count as in C99... +dnl 18 = checking whether snprintf fully supports the 'n' directive... +dnl 19 = checking whether snprintf respects a size of 1... +dnl 20 = checking whether vsnprintf respects a zero size as in C99... dnl dnl . = yes, # = no. dnl -dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 -dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . -dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . -dnl FreeBSD 5.4, 6.1 . . . . # . . . . . # . # . . . . . . -dnl MacOS X 10.3.9 . . . . # . . . . . # . # . . . . . . -dnl OpenBSD 3.9, 4.0 . . # # # # . . # . # . # . . . . . . -dnl Cygwin 2007 (= Cygwin 1.5.24) . . . . # # . . . ? # ? ? . . . . . . -dnl Cygwin 2006 (= Cygwin 1.5.19) # . . . # # . . # ? # ? ? . . . . . . -dnl Solaris 10 . . # # # . . . . . # . . . . . . . . -dnl Solaris 2.6 ... 9 # . # # # # . . . . # . . . . . . . . -dnl Solaris 2.5.1 # . # # # # . . . . # . . # # # # # # -dnl AIX 5.2 . . # # # . . . . . # . . . . . . . . -dnl AIX 4.3.2, 5.1 # . # # # # . . . . # . . . . . . . . -dnl HP-UX 11.31 . . . . # . . . . . # . . . . # # . . -dnl HP-UX 11.{00,11,23} # . . . # # . . . . # . . . . # # . # -dnl HP-UX 10.20 # . . . # # . . . # # . . . . # # ? # -dnl IRIX 6.5 # . # # # # . . . . # . . . . # . . . -dnl OSF/1 5.1 # . # # # # . . . . # . . . . # . . # -dnl OSF/1 4.0d # . # # # # . . . . # . . # # # # # # -dnl NetBSD 4.0 . ? ? ? ? ? . . ? ? ? ? ? . . . ? ? ? -dnl NetBSD 3.0 . . . . # # . # # ? # . # . . . . . . -dnl BeOS # # . # # # . # . ? . # ? . . . . . . -dnl mingw # # # # # # . # # . # # ? . # # # . . +dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . . +dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . . +dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . . +dnl MacOS X 10.3.9 . . . . # . . . . . . # . # . . . . . . +dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . . +dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . . +dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . . +dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . . +dnl Solaris 10 . . # # # . . # . . . # . . . . . . . . +dnl Solaris 2.6 ... 9 # . # # # # . # . . . # . . . . . . . . +dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # # +dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . . +dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . . . . . +dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . . +dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . # +dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? # +dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . . +dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . # +dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # # +dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ? +dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . . +dnl Haiku . . . # # # . # . . . . . ? . . . . . . +dnl BeOS # # . # # # . ? # . ? . # ? . . . . . . +dnl mingw # # # # # # . . # # . # # ? . # # # . . diff -ruNp m4-1.4.12/m4/quotearg.m4 m4-1.4.13/m4/quotearg.m4 --- m4-1.4.12/m4/quotearg.m4 2008-02-23 10:30:12.000000000 -0700 +++ m4-1.4.13/m4/quotearg.m4 2009-03-21 18:06:12.000000000 -0600 @@ -1,5 +1,5 @@ -# quotearg.m4 serial 6 -dnl Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# quotearg.m4 serial 8 +dnl Copyright (C) 2002, 2004-2009 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. @@ -7,9 +7,4 @@ dnl with or without modifications, as lo 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 -ruNp m4-1.4.12/m4/rawmemchr.m4 m4-1.4.13/m4/rawmemchr.m4 --- m4-1.4.12/m4/rawmemchr.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/rawmemchr.m4 2009-02-28 08:25:57.000000000 -0700 @@ -0,0 +1,21 @@ +# rawmemchr.m4 serial 1 +dnl Copyright (C) 2003, 2007, 2008 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_RAWMEMCHR], +[ + dnl Persuade glibc <string.h> to declare rawmemchr(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REPLACE_FUNCS([rawmemchr]) + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + gl_PREREQ_RAWMEMCHR + fi +]) + +# Prerequisites of lib/strchrnul.c. +AC_DEFUN([gl_PREREQ_RAWMEMCHR], [:]) diff -ruNp m4-1.4.12/m4/regex.m4 m4-1.4.13/m4/regex.m4 --- m4-1.4.12/m4/regex.m4 2008-08-05 07:17:15.000000000 -0600 +++ m4-1.4.13/m4/regex.m4 2009-03-21 18:06:12.000000000 -0600 @@ -1,7 +1,7 @@ -#serial 52 +# serial 54 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -18,12 +18,9 @@ AC_DEFUN([gl_REGEX], AC_ARG_WITH([included-regex], [AS_HELP_STRING([--without-included-regex], - [don't compile regex; this is the default on 32-bit - systems with recent-enough versions of the GNU C - Library (use with caution on other systems). - On systems with 64-bit ptrdiff_t and 32-bit int, - --with-included-regex is the default, in case - regex functions operate on very long strings (>2GB)])]) + [don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems).])]) case $with_included_regex in #( yes|no) ac_use_included_regex=$with_included_regex @@ -175,7 +172,7 @@ AC_DEFUN([gl_REGEX], esac if test $ac_use_included_regex = yes; then - AC_DEFINE([_REGEX_LARGE_OFFSETS], 1, + AC_DEFINE([_REGEX_LARGE_OFFSETS], [1], [Define if you want regoff_t to be at least as wide POSIX requires.]) AC_DEFINE([re_syntax_options], [rpl_re_syntax_options], [Define to rpl_re_syntax_options if the replacement should be used.]) @@ -219,6 +216,6 @@ AC_DEFUN([gl_PREREQ_REGEX], AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_CHECK_HEADERS([libintl.h]) - AC_CHECK_FUNCS_ONCE([isblank iswctype mbrtowc wcrtomb wcscoll]) + AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll]) AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>]) ]) diff -ruNp m4-1.4.12/m4/sched_h.m4 m4-1.4.13/m4/sched_h.m4 --- m4-1.4.12/m4/sched_h.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/sched_h.m4 2009-02-28 08:25:57.000000000 -0700 @@ -0,0 +1,36 @@ +# sched_h.m4 serial 2 +dnl Copyright (C) 2008 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 Bruno Haible. + +AC_DEFUN([gl_SCHED_H], +[ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include <sched.h> + struct sched_param a; + int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER }; + ]])], + [SCHED_H=''], + [SCHED_H='sched.h' + + gl_CHECK_NEXT_HEADERS([sched.h]) + + AC_CHECK_HEADERS_ONCE([sched.h]) + if test $ac_cv_header_sched_h = yes; then + HAVE_SCHED_H=1 + else + HAVE_SCHED_H=0 + fi + AC_SUBST([HAVE_SCHED_H]) + + AC_CHECK_TYPE([struct sched_param], + [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0], + [#include <sched.h>]) + AC_SUBST([HAVE_STRUCT_SCHED_PARAM]) + ]) + AC_SUBST([SCHED_H]) +]) diff -ruNp m4-1.4.12/m4/setenv.m4 m4-1.4.13/m4/setenv.m4 --- m4-1.4.12/m4/setenv.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/setenv.m4 2009-01-25 19:37:31.000000000 -0700 @@ -0,0 +1,71 @@ +# setenv.m4 serial 11 +dnl Copyright (C) 2001-2004, 2006-2009 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_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([setenv]) + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + 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_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([setenv]) + if test $ac_cv_func_setenv = no; then + HAVE_SETENV=0 + fi + gl_PREREQ_SETENV +]) + +AC_DEFUN([gl_FUNC_UNSETENV], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_FUNCS([unsetenv]) + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 + AC_LIBOBJ([unsetenv]) + gl_PREREQ_UNSETENV + else + AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret], + [AC_TRY_COMPILE([#include <stdlib.h> +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 + VOID_UNSETENV=1 + fi + fi +]) + +# Prerequisites of lib/setenv.c. +AC_DEFUN([gl_PREREQ_SETENV], +[ + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([gl_ENVIRON]) + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_HEADERS([search.h]) + AC_CHECK_FUNCS([tsearch]) +]) + +# Prerequisites of lib/unsetenv.c. +AC_DEFUN([gl_PREREQ_UNSETENV], +[ + AC_REQUIRE([gl_ENVIRON]) + AC_CHECK_HEADERS_ONCE([unistd.h]) +]) diff -ruNp m4-1.4.12/m4/sig_atomic_t.m4 m4-1.4.13/m4/sig_atomic_t.m4 --- m4-1.4.12/m4/sig_atomic_t.m4 2008-02-23 10:30:12.000000000 -0700 +++ m4-1.4.13/m4/sig_atomic_t.m4 2009-01-16 06:26:34.000000000 -0700 @@ -1,13 +1,13 @@ -# sig_atomic_t.m4 serial 1 (gettext-0.13) -dnl Copyright (C) 2003 Free Software Foundation, Inc. +# sig_atomic_t.m4 serial 2 +dnl Copyright (C) 2003, 2009 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([gt_TYPE_SIG_ATOMIC_T], [ - AC_CHECK_TYPES(sig_atomic_t, , - [AC_DEFINE(sig_atomic_t, int, + AC_CHECK_TYPES([sig_atomic_t], , + [AC_DEFINE([sig_atomic_t], [int], [Define as an integer type suitable for memory locations that can be accessed atomically even in the presence of asynchnonous signals.])], [#include <signal.h>]) diff -ruNp m4-1.4.12/m4/signal_h.m4 m4-1.4.13/m4/signal_h.m4 --- m4-1.4.12/m4/signal_h.m4 2008-09-26 06:32:43.000000000 -0600 +++ m4-1.4.13/m4/signal_h.m4 2009-03-23 05:56:50.000000000 -0600 @@ -1,5 +1,5 @@ -# signal_h.m4 serial 6 -dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc. +# signal_h.m4 serial 7 +dnl Copyright (C) 2007, 2008, 2009 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. @@ -8,6 +8,12 @@ AC_DEFUN([gl_SIGNAL_H], [ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([signal.h]) +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + AC_CHECK_TYPE([volatile sig_atomic_t], [], + [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[ +#include <signal.h> + ]]) ]) AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR], @@ -29,4 +35,6 @@ AC_DEFUN([gl_SIGNAL_H_DEFAULTS], HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION]) HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION]) + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T]) ]) diff -ruNp m4-1.4.12/m4/signalblocking.m4 m4-1.4.13/m4/signalblocking.m4 --- m4-1.4.12/m4/signalblocking.m4 2008-08-05 07:17:15.000000000 -0600 +++ m4-1.4.13/m4/signalblocking.m4 2009-01-16 06:26:34.000000000 -0700 @@ -1,5 +1,5 @@ -# signalblocking.m4 serial 9 -dnl Copyright (C) 2001-2002, 2006-2008 Free Software Foundation, Inc. +# signalblocking.m4 serial 10 +dnl Copyright (C) 2001-2002, 2006-2009 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. @@ -13,9 +13,9 @@ AC_DEFUN([gl_SIGNALBLOCKING], [ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) signals_not_posix= - AC_EGREP_HEADER(sigset_t, signal.h, , signals_not_posix=1) + AC_EGREP_HEADER([sigset_t], [signal.h], , [signals_not_posix=1]) if test -z "$signals_not_posix"; then - AC_CHECK_FUNC(sigprocmask, [gl_cv_func_sigprocmask=1]) + AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1]) fi if test -z "$gl_cv_func_sigprocmask"; then HAVE_POSIX_SIGNALBLOCKING=0 diff -ruNp m4-1.4.12/m4/signbit.m4 m4-1.4.13/m4/signbit.m4 --- m4-1.4.12/m4/signbit.m4 2008-10-09 21:04:50.000000000 -0600 +++ m4-1.4.13/m4/signbit.m4 2009-01-16 06:26:34.000000000 -0700 @@ -1,5 +1,5 @@ -# signbit.m4 serial 4 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# signbit.m4 serial 6 +dnl Copyright (C) 2007-2009 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. @@ -74,7 +74,7 @@ AC_DEFUN([gl_SIGNBIT], [gl_cv_func_copysignf_no_libm=no]) ]) if test $gl_cv_func_copysignf_no_libm = yes; then - AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], 1, + AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1], [Define if the copysignf function is declared in <math.h> and available in libc.]) fi fi @@ -94,7 +94,7 @@ AC_DEFUN([gl_SIGNBIT], [gl_cv_func_copysign_no_libm=no]) ]) if test $gl_cv_func_copysign_no_libm = yes; then - AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], 1, + AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1], [Define if the copysign function is declared in <math.h> and available in libc.]) fi fi @@ -114,7 +114,7 @@ AC_DEFUN([gl_SIGNBIT], [gl_cv_func_copysignl_no_libm=no]) ]) if test $gl_cv_func_copysignl_no_libm = yes; then - AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], 1, + AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1], [Define if the copysignl function is declared in <math.h> and available in libc.]) fi fi @@ -124,6 +124,14 @@ AC_DEFUN([gl_SIGNBIT], ]) AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[ +/* Global variables. + Needed because GCC 4 constant-folds __builtin_signbitl (literal) + but cannot constant-fold __builtin_signbitl (variable). */ +float vf; +double vd; +long double vl; +int main () +{ /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. So we use -p0f and -p0d instead. */ float p0f = 0.0f; @@ -131,15 +139,17 @@ float m0f = -p0f; double p0d = 0.0; double m0d = -p0d; /* On HP-UX 10.20, negating 0.0L does not yield -0.0L. - So we use another constant expression instead. */ + So we use another constant expression instead. + But that expression does not work on other platforms, such as when + cross-compiling to PowerPC on MacOS X 10.5. */ long double p0l = 0.0L; -#ifdef __hpux +#if defined __hpux || defined __sgi long double m0l = -LDBL_MIN * LDBL_MIN; #else long double m0l = -p0l; #endif -int main () -{ + if (signbit (vf)) + vf++; { float plus_inf = 1.0f / p0f; float minus_inf = -1.0f / p0f; @@ -151,6 +161,8 @@ int main () && signbit (minus_inf))) return 1; } + if (signbit (vd)) + vd++; { double plus_inf = 1.0 / p0d; double minus_inf = -1.0 / p0d; @@ -162,6 +174,8 @@ int main () && signbit (minus_inf))) return 1; } + if (signbit (vl)) + vl++; { long double plus_inf = 1.0L / p0l; long double minus_inf = -1.0L / p0l; diff -ruNp m4-1.4.12/m4/size_max.m4 m4-1.4.13/m4/size_max.m4 --- m4-1.4.12/m4/size_max.m4 2008-02-23 10:30:13.000000000 -0700 +++ m4-1.4.13/m4/size_max.m4 2009-01-01 19:41:21.000000000 -0700 @@ -1,5 +1,5 @@ -# size_max.m4 serial 6 -dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. +# size_max.m4 serial 7 +dnl Copyright (C) 2003, 2005-2006, 2008 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. @@ -8,7 +8,7 @@ dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ - AC_CHECK_HEADERS(stdint.h) + 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], [ @@ -21,16 +21,16 @@ AC_DEFUN([gl_SIZE_MAX], #ifdef SIZE_MAX Found it #endif -], gl_cv_size_max=yes) +], [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 <stddef.h> -#include <limits.h>], size_t_bits_minus_1=) +#include <limits.h>], [size_t_bits_minus_1=]) AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], - [#include <stddef.h>], fits_in_uint=) + [#include <stddef.h>], [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 @@ -38,7 +38,7 @@ Found it AC_TRY_COMPILE([#include <stddef.h> extern size_t foo; extern unsigned long foo; - ], [], fits_in_uint=0) + ], [], [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 diff -ruNp m4-1.4.12/m4/spawn_h.m4 m4-1.4.13/m4/spawn_h.m4 --- m4-1.4.12/m4/spawn_h.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/spawn_h.m4 2009-02-28 08:25:57.000000000 -0700 @@ -0,0 +1,69 @@ +# spawn_h.m4 serial 1 +dnl Copyright (C) 2008 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 Bruno Haible. + +AC_DEFUN([gl_SPAWN_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_SPAWN_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([spawn.h]) + + AC_CHECK_HEADERS_ONCE([spawn.h]) + if test $ac_cv_header_spawn_h = yes; then + HAVE_SPAWN_H=1 + else + HAVE_SPAWN_H=0 + fi + AC_SUBST([HAVE_SPAWN_H]) + + AC_REQUIRE([AC_C_RESTRICT]) +]) + +dnl Unconditionally enables the replacement of <spawn.h>. +AC_DEFUN([gl_REPLACE_SPAWN_H], +[ + AC_REQUIRE([gl_SPAWN_H_DEFAULTS]) + SPAWN_H='spawn.h' +]) + +AC_DEFUN([gl_SPAWN_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SPAWN_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_SPAWN_H_DEFAULTS], +[ + GNULIB_POSIX_SPAWN=0; AC_SUBST([GNULIB_POSIX_SPAWN]) + GNULIB_POSIX_SPAWNP=0; AC_SUBST([GNULIB_POSIX_SPAWNP]) + GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT]) + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE]) + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2]) + GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN]) + GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY]) + GNULIB_POSIX_SPAWNATTR_INIT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_INIT]) + GNULIB_POSIX_SPAWNATTR_GETFLAGS=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETFLAGS]) + GNULIB_POSIX_SPAWNATTR_SETFLAGS=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETFLAGS]) + GNULIB_POSIX_SPAWNATTR_GETPGROUP=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETPGROUP]) + GNULIB_POSIX_SPAWNATTR_SETPGROUP=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETPGROUP]) + GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM]) + GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM]) + GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY]) + GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY]) + GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT]) + GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT]) + GNULIB_POSIX_SPAWNATTR_GETSIGMASK=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGMASK]) + GNULIB_POSIX_SPAWNATTR_SETSIGMASK=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGMASK]) + GNULIB_POSIX_SPAWNATTR_DESTROY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_DESTROY]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_POSIX_SPAWN=1; AC_SUBST([HAVE_POSIX_SPAWN]) + REPLACE_POSIX_SPAWN=0; AC_SUBST([REPLACE_POSIX_SPAWN]) + SPAWN_H=''; AC_SUBST([SPAWN_H]) +]) diff -ruNp m4-1.4.12/m4/stdarg.m4 m4-1.4.13/m4/stdarg.m4 --- m4-1.4.12/m4/stdarg.m4 2008-03-27 20:45:05.000000000 -0600 +++ m4-1.4.13/m4/stdarg.m4 2009-02-28 08:26:46.000000000 -0700 @@ -1,5 +1,5 @@ -# stdarg.m4 serial 2 -dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# stdarg.m4 serial 3 +dnl Copyright (C) 2006, 2008-2009 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. @@ -46,7 +46,7 @@ void (*func) (va_list, va_list) = va_cop else dnl Provide a substitute in <config.h>, either __va_copy or as a simple dnl assignment. - AC_CACHE_VAL([gl_cv_func___va_copy], [ + gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [ AC_TRY_COMPILE([#include <stdarg.h>], [ #ifndef __va_copy error, bail out diff -ruNp m4-1.4.12/m4/stdbool.m4 m4-1.4.13/m4/stdbool.m4 --- m4-1.4.12/m4/stdbool.m4 2008-02-23 10:30:13.000000000 -0700 +++ m4-1.4.13/m4/stdbool.m4 2009-01-16 06:26:35.000000000 -0700 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009 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. @@ -111,5 +111,5 @@ AC_DEFUN([AC_HEADER_STDBOOL], [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.]) + AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.]) fi]) diff -ruNp m4-1.4.12/m4/stdint.m4 m4-1.4.13/m4/stdint.m4 --- m4-1.4.12/m4/stdint.m4 2008-08-05 07:17:16.000000000 -0600 +++ m4-1.4.13/m4/stdint.m4 2009-02-28 08:26:46.000000000 -0700 @@ -1,5 +1,5 @@ -# stdint.m4 serial 31 -dnl Copyright (C) 2001-2008 Free Software Foundation, Inc. +# stdint.m4 serial 34 +dnl Copyright (C) 2001-2009 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. @@ -9,7 +9,7 @@ dnl Test whether <stdint.h> is supported AC_DEFUN([gl_STDINT_H], [ - AC_PREREQ(2.59)dnl + AC_PREREQ([2.59])dnl dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) @@ -201,7 +201,75 @@ struct s { int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; ]])], - [gl_cv_header_working_stdint_h=yes])]) + [dnl Determine whether the various *_MIN, *_MAX macros are usable + dnl in preprocessor expression. We could do it by compiling a test + dnl program for each of these macros. It is faster to run a program + dnl that inspects the macro expansion. + dnl This detects a bug on HP-UX 11.23/ia64. + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> +] +gl_STDINT_INCLUDES +[ +#include <stdio.h> +#include <string.h> +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; +]], [[ + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return 1; + } + return 0; +]])], + [gl_cv_header_working_stdint_h=yes], + [], + [dnl When cross-compiling, assume it works. + gl_cv_header_working_stdint_h=yes + ]) + ]) + ]) fi if test "$gl_cv_header_working_stdint_h" = yes; then STDINT_H= @@ -229,7 +297,7 @@ struct s { gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi - AC_SUBST(STDINT_H) + AC_SUBST([STDINT_H]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) @@ -292,7 +360,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED], 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) + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 @@ -348,7 +416,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result - AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) done m4_foreach_w([gltype], [$1], [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) @@ -373,13 +441,22 @@ dnl Compute HAVE_SIGNED_t, BITSIZEOF_t a dnl of interest to stdint.in.h. AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], [ - gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], + AC_REQUIRE([gl_MULTIARCH]) + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_STDINT_BITSIZEOF([ptrdiff_t size_t], + [gl_STDINT_INCLUDES]) + fi + gl_STDINT_BITSIZEOF([sig_atomic_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], + if test $APPLE_UNIVERSAL_BUILD = 0; then + gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t], + [gl_STDINT_INCLUDES]) + fi + gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) ]) diff -ruNp m4-1.4.12/m4/stdint_h.m4 m4-1.4.13/m4/stdint_h.m4 --- m4-1.4.12/m4/stdint_h.m4 2008-02-23 10:30:13.000000000 -0700 +++ m4-1.4.13/m4/stdint_h.m4 2009-01-16 06:26:35.000000000 -0700 @@ -1,5 +1,5 @@ -# stdint_h.m4 serial 6 -dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. +# stdint_h.m4 serial 8 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 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. @@ -11,15 +11,15 @@ dnl From Paul Eggert. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ - AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, + AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], [AC_TRY_COMPILE( [#include <sys/types.h> #include <stdint.h>], [uintmax_t i = (uintmax_t) -1; return !i;], - gl_cv_header_stdint_h=yes, - gl_cv_header_stdint_h=no)]) + [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, + AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares uintmax_t. ]) fi diff -ruNp m4-1.4.12/m4/stdio_h.m4 m4-1.4.13/m4/stdio_h.m4 --- m4-1.4.12/m4/stdio_h.m4 2008-09-26 06:32:45.000000000 -0600 +++ m4-1.4.13/m4/stdio_h.m4 2009-01-24 12:02:30.000000000 -0700 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 13 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# stdio_h.m4 serial 15 +dnl Copyright (C) 2007-2009 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. @@ -53,6 +53,8 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], 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_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) + GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) @@ -63,6 +65,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) + GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE]) GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC]) GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC]) GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR]) @@ -85,6 +88,10 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) + HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) + REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) + HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) + REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) @@ -98,6 +105,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) + REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE]) HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) diff -ruNp m4-1.4.12/m4/stdlib_h.m4 m4-1.4.13/m4/stdlib_h.m4 --- m4-1.4.12/m4/stdlib_h.m4 2008-08-05 07:17:17.000000000 -0600 +++ m4-1.4.13/m4/stdlib_h.m4 2009-02-28 08:26:47.000000000 -0700 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 7 -dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc. +# stdlib_h.m4 serial 15 +dnl Copyright (C) 2007-2009 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. @@ -8,6 +8,20 @@ AC_DEFUN([gl_STDLIB_H], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([stdlib.h]) + AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT]) + if test $ac_cv_header_random_h = yes; then + HAVE_RANDOM_H=1 + else + HAVE_RANDOM_H=0 + fi + AC_SUBST([HAVE_RANDOM_H]) + AC_CHECK_TYPES([struct random_data], + [], [HAVE_STRUCT_RANDOM_DATA=0], + [[#include <stdlib.h> + #if HAVE_RANDOM_H + # include <random.h> + #endif + ]]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], @@ -22,26 +36,38 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) + GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) + GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) + GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) + GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) + GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) - HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) - HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) - HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) - HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) - HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) - HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) - HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) - HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV]) - REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) - REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) - REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) - VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV]) + HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) + HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) + HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) + HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) + HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) + HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) + HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) + HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) + HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) + HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) + HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) + HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) + HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) + HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) + HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV]) + HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) + REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) + REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) + VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV]) ]) diff -ruNp m4-1.4.12/m4/strchrnul.m4 m4-1.4.13/m4/strchrnul.m4 --- m4-1.4.12/m4/strchrnul.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/strchrnul.m4 2009-02-28 08:25:57.000000000 -0700 @@ -0,0 +1,21 @@ +# strchrnul.m4 serial 7 +dnl Copyright (C) 2003, 2007, 2009 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 <string.h> to declare strchrnul(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + 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 -ruNp m4-1.4.12/m4/strdup.m4 m4-1.4.13/m4/strdup.m4 --- m4-1.4.12/m4/strdup.m4 2008-09-22 20:20:30.000000000 -0600 +++ m4-1.4.13/m4/strdup.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,38 +0,0 @@ -# strdup.m4 serial 10 - -dnl Copyright (C) 2002-2008 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_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 -]) - -AC_DEFUN([gl_FUNC_STRDUP_POSIX], -[ - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) - if test $gl_cv_func_malloc_posix != yes; then - REPLACE_STRDUP=1 - AC_LIBOBJ([strdup]) - else - AC_REPLACE_FUNCS(strdup) - fi - 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 -ruNp m4-1.4.12/m4/strndup.m4 m4-1.4.13/m4/strndup.m4 --- m4-1.4.12/m4/strndup.m4 2008-09-22 20:20:30.000000000 -0600 +++ m4-1.4.13/m4/strndup.m4 2009-01-16 06:26:36.000000000 -0700 @@ -1,5 +1,5 @@ -# strndup.m4 serial 15 -dnl Copyright (C) 2002-2003, 2005-2008 Free Software Foundation, Inc. +# strndup.m4 serial 16 +dnl Copyright (C) 2002-2003, 2005-2009 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. @@ -16,7 +16,7 @@ AC_DEFUN([gl_FUNC_STRNDUP], 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_CACHE_CHECK([for working strndup], [gl_cv_func_strndup], [AC_RUN_IFELSE([ AC_LANG_PROGRAM([[#include <string.h> #include <stdlib.h>]], [[ @@ -40,7 +40,7 @@ AC_DEFUN([gl_FUNC_STRNDUP], [gl_cv_func_strndup=yes])], [gl_cv_func_strndup=no])])]) if test $gl_cv_func_strndup = yes; then - AC_DEFINE([HAVE_STRNDUP], 1, + AC_DEFINE([HAVE_STRNDUP], [1], [Define if you have the strndup() function and it works.]) else HAVE_STRNDUP=0 diff -ruNp m4-1.4.12/m4/strnlen.m4 m4-1.4.13/m4/strnlen.m4 --- m4-1.4.12/m4/strnlen.m4 2008-09-22 20:20:30.000000000 -0600 +++ m4-1.4.13/m4/strnlen.m4 2009-01-16 06:26:36.000000000 -0700 @@ -1,5 +1,5 @@ -# strnlen.m4 serial 9 -dnl Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc. +# strnlen.m4 serial 10 +dnl Copyright (C) 2002-2003, 2005-2007, 2009 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. @@ -20,8 +20,8 @@ AC_DEFUN([gl_FUNC_STRNLEN], # This is necessary because automake-1.6.1 doesn't understand # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. - #AC_LIBOBJ(strnlen) - AC_DEFINE(strnlen, rpl_strnlen, + #AC_LIBOBJ([strnlen]) + AC_DEFINE([strnlen], [rpl_strnlen], [Define to rpl_strnlen if the replacement function should be used.]) gl_PREREQ_STRNLEN fi diff -ruNp m4-1.4.12/m4/strtod.m4 m4-1.4.13/m4/strtod.m4 --- m4-1.4.12/m4/strtod.m4 2008-08-05 07:17:18.000000000 -0600 +++ m4-1.4.13/m4/strtod.m4 2009-02-28 08:26:48.000000000 -0700 @@ -1,6 +1,5 @@ -# strtod.m4 serial 9 -dnl Copyright (C) 2002, 2003, 2006, 2007, 2008 Free Software -dnl Foundation, Inc. +# strtod.m4 serial 12 +dnl Copyright (C) 2002-2003, 2006-2009 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. @@ -9,7 +8,7 @@ AC_DEFUN([gl_FUNC_STRTOD], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_FUNC_STRTOD - dnl Note: AC_FUNC_STRTOD does AC_LIBOBJ(strtod). + dnl Note: AC_FUNC_STRTOD does AC_LIBOBJ([strtod]). if test $ac_cv_func_strtod = no; then HAVE_STRTOD=0 REPLACE_STRTOD=1 @@ -19,6 +18,7 @@ AC_DEFUN([gl_FUNC_STRTOD], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdlib.h> #include <math.h> +#include <errno.h> /* Compare two numbers with ==. This is a separate function because IRIX 6.5 "cc -O" miscompiles an 'x == x' test. */ @@ -46,11 +46,14 @@ numeric_equal (double x, double y) return 1; } { - /* Many platforms do not parse infinities. */ + /* Many platforms do not parse infinities. HP-UX 11.31 parses inf, + but mistakenly sets errno. */ const char *string = "inf"; char *term; - double value = strtod (string, &term); - if (value != HUGE_VAL || term != (string + 3)) + double value; + errno = 0; + value = strtod (string, &term); + if (value != HUGE_VAL || term != (string + 3) || errno) return 1; } { diff -ruNp m4-1.4.12/m4/strtol.m4 m4-1.4.13/m4/strtol.m4 --- m4-1.4.12/m4/strtol.m4 2008-02-23 10:30:14.000000000 -0700 +++ m4-1.4.13/m4/strtol.m4 2009-01-16 06:26:37.000000000 -0700 @@ -1,10 +1,10 @@ -# strtol.m4 serial 4 -dnl Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. +# strtol.m4 serial 5 +dnl Copyright (C) 2002, 2003, 2006, 2009 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) + AC_REPLACE_FUNCS([strtol]) ]) diff -ruNp m4-1.4.12/m4/sys_stat_h.m4 m4-1.4.13/m4/sys_stat_h.m4 --- m4-1.4.12/m4/sys_stat_h.m4 2008-08-05 07:17:18.000000000 -0600 +++ m4-1.4.13/m4/sys_stat_h.m4 2008-12-11 22:15:04.000000000 -0700 @@ -1,4 +1,4 @@ -# sys_stat_h.m4 serial 8 -*- Autoconf -*- +# sys_stat_h.m4 serial 10 -*- Autoconf -*- dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -50,6 +50,10 @@ AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], [ + GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) + GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) + REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) ]) diff -ruNp m4-1.4.12/m4/sys_wait_h.m4 m4-1.4.13/m4/sys_wait_h.m4 --- m4-1.4.12/m4/sys_wait_h.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/sys_wait_h.m4 2009-02-28 08:25:57.000000000 -0700 @@ -0,0 +1,26 @@ +# sys_wait_h.m4 serial 1 +dnl Copyright (C) 2008 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_SYS_WAIT_H], +[ + AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([sys/wait.h]) + SYS_WAIT_H='sys/wait.h' + AC_SUBST([SYS_WAIT_H]) +]) + +AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS], +[ + dnl Assume proper GNU behavior unless another module says otherwise. +]) diff -ruNp m4-1.4.12/m4/thread.m4 m4-1.4.13/m4/thread.m4 --- m4-1.4.12/m4/thread.m4 2008-10-09 21:04:14.000000000 -0600 +++ m4-1.4.13/m4/thread.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -# thread.m4 serial 2 -dnl Copyright (C) 2008 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_THREAD], -[ - AC_REQUIRE([gl_THREADLIB]) - AC_REQUIRE([AC_C_INLINE]) - - if test $gl_threads_api = posix; then - gl_save_LIBS="$LIBS" - LIBS="$LIBS $LIBMULTITHREAD" - AC_CHECK_FUNCS([pthread_atfork]) - LIBS="$gl_save_LIBS" - fi -]) diff -ruNp m4-1.4.12/m4/threadlib.m4 m4-1.4.13/m4/threadlib.m4 --- m4-1.4.12/m4/threadlib.m4 2008-08-17 19:08:21.000000000 -0600 +++ m4-1.4.13/m4/threadlib.m4 2009-01-16 06:26:37.000000000 -0700 @@ -1,5 +1,5 @@ -# threadlib.m4 serial 1 (gettext-0.18) -dnl Copyright (C) 2005-2008 Free Software Foundation, Inc. +# threadlib.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2005-2009 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. @@ -45,7 +45,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY], [AC_REQUIRE([AC_GNU_SOURCE])]) dnl Check for multithreading. m4_divert_text([DEFAULTS], [gl_use_threads_default=]) - AC_ARG_ENABLE(threads, + AC_ARG_ENABLE([threads], AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) AC_HELP_STRING([--disable-threads], [build without multithread safety]), [gl_use_threads=$enableval], @@ -104,7 +104,8 @@ AC_DEFUN([gl_THREADLIB_BODY], if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY. - AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no) + AC_CHECK_HEADER([pthread.h], + [gl_have_pthread_h=yes], [gl_have_pthread_h=no]) if test "$gl_have_pthread_h" = yes; then # Other possible tests: # -lpthreads (FSU threads, PCthreads) @@ -122,7 +123,7 @@ AC_DEFUN([gl_THREADLIB_BODY], if test -n "$gl_have_pthread"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. - AC_CHECK_LIB(pthread, pthread_kill, + AC_CHECK_LIB([pthread], [pthread_kill], [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. # Therefore pthread_in_use() needs to actually try to create a @@ -130,19 +131,19 @@ AC_DEFUN([gl_THREADLIB_BODY], # pthread_create will actually create a thread. case "$host_os" in solaris* | hpux*) - AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1, + AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], [Define if the pthread_in_use() detection is hard.]) esac ]) else # Some library is needed. Try libpthread and libc_r. - AC_CHECK_LIB(pthread, pthread_kill, + AC_CHECK_LIB([pthread], [pthread_kill], [gl_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread]) if test -z "$gl_have_pthread"; then # For FreeBSD 4. - AC_CHECK_LIB(c_r, pthread_kill, + AC_CHECK_LIB([c_r], [pthread_kill], [gl_have_pthread=yes LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r]) @@ -150,11 +151,11 @@ AC_DEFUN([gl_THREADLIB_BODY], fi if test -n "$gl_have_pthread"; then gl_threads_api=posix - AC_DEFINE([USE_POSIX_THREADS], 1, + AC_DEFINE([USE_POSIX_THREADS], [1], [Define if the POSIX multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then - AC_DEFINE([USE_POSIX_THREADS_WEAK], 1, + AC_DEFINE([USE_POSIX_THREADS_WEAK], [1], [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= @@ -179,10 +180,10 @@ AC_DEFUN([gl_THREADLIB_BODY], LTLIBTHREAD=-lthread LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" - AC_DEFINE([USE_SOLARIS_THREADS], 1, + AC_DEFINE([USE_SOLARIS_THREADS], [1], [Define if the old Solaris multithreading library can be used.]) if test $gl_have_weak = yes; then - AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1, + AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1], [Define if references to the old Solaris multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= @@ -192,11 +193,11 @@ AC_DEFUN([gl_THREADLIB_BODY], fi if test "$gl_use_threads" = pth; then gl_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_LINKFLAGS(pth) + AC_LIB_LINKFLAGS([pth]) gl_have_pth= gl_save_LIBS="$LIBS" LIBS="$LIBS -lpth" - AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes) + AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then gl_threads_api=pth @@ -204,11 +205,11 @@ AC_DEFUN([gl_THREADLIB_BODY], LTLIBTHREAD="$LTLIBPTH" LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" - AC_DEFINE([USE_PTH_THREADS], 1, + AC_DEFINE([USE_PTH_THREADS], [1], [Define if the GNU Pth multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then - AC_DEFINE([USE_PTH_THREADS_WEAK], 1, + AC_DEFINE([USE_PTH_THREADS_WEAK], [1], [Define if references to the GNU Pth multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= @@ -226,7 +227,7 @@ AC_DEFUN([gl_THREADLIB_BODY], esac }; then gl_threads_api=win32 - AC_DEFINE([USE_WIN32_THREADS], 1, + AC_DEFINE([USE_WIN32_THREADS], [1], [Define if the Win32 multithreading API can be used.]) fi fi @@ -234,10 +235,10 @@ AC_DEFUN([gl_THREADLIB_BODY], fi AC_MSG_CHECKING([for multithread API to use]) AC_MSG_RESULT([$gl_threads_api]) - AC_SUBST(LIBTHREAD) - AC_SUBST(LTLIBTHREAD) - AC_SUBST(LIBMULTITHREAD) - AC_SUBST(LTLIBMULTITHREAD) + AC_SUBST([LIBTHREAD]) + AC_SUBST([LTLIBTHREAD]) + AC_SUBST([LIBMULTITHREAD]) + AC_SUBST([LTLIBMULTITHREAD]) ]) AC_DEFUN([gl_THREADLIB], diff -ruNp m4-1.4.12/m4/tmpdir.m4 m4-1.4.13/m4/tmpdir.m4 --- m4-1.4.12/m4/tmpdir.m4 2008-02-23 10:30:15.000000000 -0700 +++ m4-1.4.13/m4/tmpdir.m4 2009-01-16 06:26:38.000000000 -0700 @@ -1,5 +1,5 @@ -# tmpdir.m4 serial 2 (gettext-0.15) -dnl Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc. +# tmpdir.m4 serial 3 +dnl Copyright (C) 2001-2002, 2006, 2009 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. @@ -8,5 +8,5 @@ dnl with or without modifications, as lo AC_DEFUN([gt_TMPDIR], [ - AC_CHECK_FUNCS(__secure_getenv) + AC_CHECK_FUNCS([__secure_getenv]) ]) diff -ruNp m4-1.4.12/m4/ungetc.m4 m4-1.4.13/m4/ungetc.m4 --- m4-1.4.12/m4/ungetc.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/ungetc.m4 2009-02-28 08:25:58.000000000 -0700 @@ -0,0 +1,36 @@ +# ungetc.m4 serial 1 +dnl Copyright (C) 2009 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_ONCE([gl_FUNC_UNGETC_WORKS], +[ + AC_REQUIRE([AC_PROG_CC]) + + AC_CACHE_CHECK([whether ungetc works on arbitrary bytes], + [gl_cv_func_ungetc_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include <stdio.h> + ]], [FILE *f; long l; + if (!(f = fopen ("conftest.tmp", "w+"))) return 1; + if (fputs ("abc", f) < 0) return 2; + rewind (f); + if (fgetc (f) != 'a') return 3; + if (fgetc (f) != 'b') return 4; + if (ungetc ('d', f) != 'd') return 5; + if (ftell (f) != 1) return 6; + if (fgetc (f) != 'd') return 7; + if (ftell (f) != 2) return 8; + if (fseek (f, 0, SEEK_CUR) != 0) return 9; + if (ftell (f) != 2) return 10; + if (fgetc (f) != 'c') return 11; + fclose (f); remove ("conftest.tmp");])], + [gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no], + [gl_cv_func_ungetc_works='guessing no']) + ]) + if test "$gl_cv_func_ungetc_works" != yes; then + AC_DEFINE([FUNC_UNGETC_BROKEN], [1], + [Define to 1 if ungetc is broken when used on arbitrary bytes.]) + fi +]) diff -ruNp m4-1.4.12/m4/unistd_h.m4 m4-1.4.13/m4/unistd_h.m4 --- m4-1.4.12/m4/unistd_h.m4 2008-10-09 21:04:53.000000000 -0600 +++ m4-1.4.13/m4/unistd_h.m4 2009-01-24 12:02:32.000000000 -0700 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 14 -dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. +# unistd_h.m4 serial 17 +dnl Copyright (C) 2006-2009 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. @@ -36,14 +36,19 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) @@ -51,10 +56,15 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_GETDOMAINNAME=1; AC_SUBST([HAVE_GETDOMAINNAME]) HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) + HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) + HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) diff -ruNp m4-1.4.12/m4/unlocked-io.m4 m4-1.4.13/m4/unlocked-io.m4 --- m4-1.4.12/m4/unlocked-io.m4 2008-02-23 10:30:15.000000000 -0700 +++ m4-1.4.13/m4/unlocked-io.m4 2009-01-16 06:26:38.000000000 -0700 @@ -1,7 +1,6 @@ -# unlocked-io.m4 serial 14 +# unlocked-io.m4 serial 15 -# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. +# Copyright (C) 1998-2006, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,7 +16,7 @@ dnl on Solaris 2.6). AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO], [ - AC_DEFINE([USE_UNLOCKED_IO], 1, + 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.]) diff -ruNp m4-1.4.12/m4/vasnprintf.m4 m4-1.4.13/m4/vasnprintf.m4 --- m4-1.4.12/m4/vasnprintf.m4 2008-08-05 07:17:20.000000000 -0600 +++ m4-1.4.13/m4/vasnprintf.m4 2009-02-28 08:26:49.000000000 -0700 @@ -1,5 +1,5 @@ -# vasnprintf.m4 serial 25 -dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc. +# vasnprintf.m4 serial 28 +dnl Copyright (C) 2002-2004, 2006-2009 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. @@ -20,7 +20,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF], AC_LIBOBJ([printf-parse]) AC_LIBOBJ([asnprintf]) if test $ac_cv_func_vasnprintf = yes; then - AC_DEFINE([REPLACE_VASNPRINTF], 1, + AC_DEFINE([REPLACE_VASNPRINTF], [1], [Define if vasnprintf exists but is overridden by gnulib.]) fi gl_PREREQ_PRINTF_ARGS @@ -58,7 +58,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF], AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) - AC_CHECK_FUNCS(snprintf wcslen) + AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>]) @@ -73,7 +73,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUB *yes) ;; *) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -89,7 +89,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_ *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'double' arguments.]) ;; @@ -110,7 +110,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_ *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'long double' arguments.]) ;; @@ -127,7 +127,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1, + 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]) @@ -143,13 +143,28 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1, + 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 'ls' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1], + [Define if the vasnprintf implementation needs special code for + the 'ls' directive.]) + ;; + esac +]) + # Extra prerequisites of lib/vasnprintf.c for supporting the ' flag. AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], [ @@ -158,7 +173,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROU *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1, + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], [Define if the vasnprintf implementation needs special code for the ' flag.]) ;; @@ -173,7 +188,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFT *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1, + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], [Define if the vasnprintf implementation needs special code for the '-' flag.]) ;; @@ -188,7 +203,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1, + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], [Define if the vasnprintf implementation needs special code for the 0 flag.]) ;; @@ -203,13 +218,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION *yes) ;; *) - AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1, + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1], [Define if the vasnprintf implementation needs special code for supporting large precisions without arbitrary bounds.]) - AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -225,13 +240,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_ENOMEM], 1, + AC_DEFINE([NEED_PRINTF_ENOMEM], [1], [Define if the vasnprintf implementation needs special code for surviving out-of-memory conditions.]) - AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -247,6 +262,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTR gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A gl_PREREQ_VASNPRINTF_DIRECTIVE_F + gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST gl_PREREQ_VASNPRINTF_FLAG_ZERO diff -ruNp m4-1.4.12/m4/vasprintf-posix.m4 m4-1.4.13/m4/vasprintf-posix.m4 --- m4-1.4.12/m4/vasprintf-posix.m4 2008-08-05 07:17:20.000000000 -0600 +++ m4-1.4.13/m4/vasprintf-posix.m4 2009-02-28 08:26:49.000000000 -0700 @@ -1,5 +1,5 @@ -# vasprintf-posix.m4 serial 12 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# vasprintf-posix.m4 serial 13 +dnl Copyright (C) 2007-2009 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. @@ -13,6 +13,7 @@ AC_DEFUN([gl_FUNC_VASPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) AC_REQUIRE([gl_PRINTF_POSITIONS]) AC_REQUIRE([gl_PRINTF_FLAG_GROUPING]) AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST]) @@ -35,23 +36,27 @@ AC_DEFUN([gl_FUNC_VASPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - if test $ac_cv_func_vasprintf = yes; then - # vasprintf exists and is - # already POSIX compliant. - gl_cv_func_vasprintf_posix=yes - fi + case "$gl_cv_func_printf_enomem" in + *yes) + if test $ac_cv_func_vasprintf = yes; then + # vasprintf exists and is + # already POSIX compliant. + gl_cv_func_vasprintf_posix=yes + fi + ;; + esac ;; esac ;; @@ -84,6 +89,7 @@ AC_DEFUN([gl_FUNC_VASPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A gl_PREREQ_VASNPRINTF_DIRECTIVE_F + gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST gl_PREREQ_VASNPRINTF_FLAG_ZERO diff -ruNp m4-1.4.12/m4/wait-process.m4 m4-1.4.13/m4/wait-process.m4 --- m4-1.4.12/m4/wait-process.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/wait-process.m4 2009-02-28 08:25:58.000000000 -0700 @@ -0,0 +1,12 @@ +# wait-process.m4 serial 4 +dnl Copyright (C) 2003, 2008, 2009 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_WAIT_PROCESS], +[ + dnl Prerequisites of lib/wait-process.c. + AC_REQUIRE([gt_TYPE_SIG_ATOMIC_T]) + AC_CHECK_FUNCS([waitid]) +]) diff -ruNp m4-1.4.12/m4/wchar.m4 m4-1.4.13/m4/wchar.m4 --- m4-1.4.12/m4/wchar.m4 2008-09-28 14:07:51.000000000 -0600 +++ m4-1.4.13/m4/wchar.m4 2008-12-24 06:21:24.000000000 -0700 @@ -7,7 +7,7 @@ dnl with or without modifications, as lo dnl Written by Eric Blake. -# wchar.m4 serial 6 +# wchar.m4 serial 22 AC_DEFUN([gl_WCHAR_H], [ @@ -61,9 +61,39 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], AC_DEFUN([gl_WCHAR_H_DEFAULTS], [ - GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) + GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) + GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) + GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) + GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) + GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) + GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) + GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) + GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) + GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) + GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) + GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) + HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) + HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC]) + HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN]) + HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS]) + HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS]) + HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB]) + HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS]) + HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS]) + HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) + REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) + REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC]) + REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB]) + REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT]) + REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC]) + REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN]) + REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS]) + REPLACE_MBSNRTOWCS=0;AC_SUBST([REPLACE_MBSNRTOWCS]) + REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB]) + REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) WCHAR_H=''; AC_SUBST([WCHAR_H]) ]) diff -ruNp m4-1.4.12/m4/wchar_t.m4 m4-1.4.13/m4/wchar_t.m4 --- m4-1.4.12/m4/wchar_t.m4 2008-02-23 10:30:16.000000000 -0700 +++ m4-1.4.13/m4/wchar_t.m4 2009-01-16 06:26:39.000000000 -0700 @@ -1,5 +1,5 @@ -# wchar_t.m4 serial 1 (gettext-0.12) -dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +# wchar_t.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2002-2003, 2008, 2009 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. @@ -10,11 +10,11 @@ dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ - AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, + AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], [AC_TRY_COMPILE([#include <stddef.h> wchar_t foo = (wchar_t)'\0';], , - gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) + [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.]) + AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) fi ]) diff -ruNp m4-1.4.12/m4/wcrtomb.m4 m4-1.4.13/m4/wcrtomb.m4 --- m4-1.4.12/m4/wcrtomb.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/wcrtomb.m4 2008-12-24 06:20:32.000000000 -0700 @@ -0,0 +1,88 @@ +# wcrtomb.m4 serial 2 +dnl Copyright (C) 2008 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_WCRTOMB], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_CHECK_FUNCS_ONCE([wcrtomb]) + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + else + + dnl On OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes + dnl returns 0 instead of 1. + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether wcrtomb return value is correct], + [gl_cv_func_wcrtomb_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on OSF/1 and Solaris. + osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + AC_TRY_RUN([ +#include <locale.h> +#include <stdio.h> +#include <string.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + return 0; +}], + [gl_cv_func_wcrtomb_retval=yes], + [gl_cv_func_wcrtomb_retval=no], + []) + fi + ]) + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([wcrtomb]) + gl_PREREQ_WCRTOMB + fi +]) + +# Prerequisites of lib/wcrtomb.c. +AC_DEFUN([gl_PREREQ_WCRTOMB], [ + : +]) diff -ruNp m4-1.4.12/m4/wctob.m4 m4-1.4.13/m4/wctob.m4 --- m4-1.4.12/m4/wctob.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/m4/wctob.m4 2008-12-24 06:20:32.000000000 -0700 @@ -0,0 +1,91 @@ +# wctob.m4 serial 3 +dnl Copyright (C) 2008 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_WCTOB], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_CHECK_FUNCS_ONCE([wctob]) + if test $ac_cv_func_wctob = no; then + HAVE_DECL_WCTOB=0 + gl_REPLACE_WCHAR_H + AC_LIBOBJ([wctob]) + gl_PREREQ_WCTOB + else + + dnl Solaris 9 has the wctob() function but it does not work. + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether wctob works], + [gl_cv_func_wctob_works], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris <= 9. + solaris2.[1-9] | solaris2.[1-9].*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none; then + AC_TRY_RUN([ +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +}], + [gl_cv_func_wctob_works=yes], + [gl_cv_func_wctob_works=no], + []) + fi + ]) + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([wctob]) + gl_PREREQ_WCTOB + else + + dnl IRIX 6.5 has the wctob() function but does not declare it. + AC_CHECK_DECLS([wctob], [], [], [ +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before + <wchar.h>. + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included + before <wchar.h>. */ +#include <stddef.h> +#include <stdio.h> +#include <time.h> +#include <wchar.h> +]) + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + gl_REPLACE_WCHAR_H + fi + fi + fi +]) + +# Prerequisites of lib/wctob.c. +AC_DEFUN([gl_PREREQ_WCTOB], [ + : +]) diff -ruNp m4-1.4.12/m4/wint_t.m4 m4-1.4.13/m4/wint_t.m4 --- m4-1.4.12/m4/wint_t.m4 2008-02-23 10:30:16.000000000 -0700 +++ m4-1.4.13/m4/wint_t.m4 2009-01-16 06:26:39.000000000 -0700 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 2 (gettext-0.17) -dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. +# wint_t.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 2003, 2007-2009 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. @@ -10,7 +10,7 @@ dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ - AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, + AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], [AC_TRY_COMPILE([ /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before <wchar.h>. @@ -21,8 +21,8 @@ AC_DEFUN([gt_TYPE_WINT_T], #include <time.h> #include <wchar.h> wint_t foo = (wchar_t)'\0';], , - gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) + [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.]) + AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) fi ]) diff -ruNp m4-1.4.12/m4/xsize.m4 m4-1.4.13/m4/xsize.m4 --- m4-1.4.12/m4/xsize.m4 2008-02-23 10:30:17.000000000 -0700 +++ m4-1.4.13/m4/xsize.m4 2009-01-01 19:41:26.000000000 -0700 @@ -1,5 +1,5 @@ -# xsize.m4 serial 3 -dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. +# xsize.m4 serial 4 +dnl Copyright (C) 2003-2004, 2008 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. @@ -9,5 +9,5 @@ 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) + AC_CHECK_HEADERS([stdint.h]) ]) diff -ruNp m4-1.4.12/m4/yield.m4 m4-1.4.13/m4/yield.m4 --- m4-1.4.12/m4/yield.m4 2008-10-09 21:04:14.000000000 -0600 +++ m4-1.4.13/m4/yield.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -# yield.m4 serial 1 -dnl Copyright (C) 2005-2008 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_YIELD], -[ - AC_REQUIRE([gl_THREADLIB]) - dnl On some systems, sched_yield is in librt, rather than in libpthread. - YIELD_LIB= - if test $gl_threads_api = posix; then - dnl Solaris has sched_yield in librt, not in libpthread or libc. - AC_CHECK_LIB(rt, sched_yield, [YIELD_LIB=-lrt], - [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt. - AC_CHECK_LIB(posix4, sched_yield, [YIELD_LIB=-lposix4])]) - fi - AC_SUBST([YIELD_LIB]) -]) diff -ruNp m4-1.4.12/maint.mk m4-1.4.13/maint.mk --- m4-1.4.12/maint.mk 2008-08-06 23:24:44.000000000 -0600 +++ m4-1.4.13/maint.mk 2009-03-04 05:50:06.000000000 -0700 @@ -1,6 +1,7 @@ ## maint.mk -- Makefile rules for m4 maintainers -*-Makefile-*- ## -## Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation +## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software +## Foundation ## ## This file is part of GNU M4. ## @@ -170,18 +171,8 @@ new-tarball: if test -f $$ofile; then :; \ else echo "Cannot make deltas without $$ofile"; exit 1; fi -.PHONY: got-xdelta -got-xdelta: -## Make sure xdelta exists; - @if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \ - then :;\ - else \ - echo "Get xdelta from http://sourceforge.net/projects/xdelta."; \ - exit 1; \ - fi - .PHONY: deltas -deltas: delta-diff delta-xdelta +deltas: delta-diff DIFF = diff DIFF_OPTIONS = -ruNp @@ -200,23 +191,10 @@ delta-diff: prev-tarball new-tarball | GZIP=$(GZIP_ENV) gzip -c > $$ofile rm -rf delta-diff -XDELTA = xdelta -XDELTA_OPTIONS = -9 - -.PHONY: delta-xdelta -delta-xdelta: prev-tarball new-tarball got-xdelta -## Generate the delta file (xdelta has weird exit statuses, so we need to -## add some shell code to keep make happy), and then generate the signatures -## for FSF ftp-upload: - ofile="$(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta"; \ - ( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \ - $(PACKAGE)-$(PREV_VERSION).tar.gz $(PACKAGE)-$(VERSION).tar.gz \ - $$ofile 2>&1` \ - && : ) - .PHONY: web-manual web-manual: - @cd ./doc ; \ - $(SHELL) $(srcdir)/build-aux/gendocs.sh $(PACKAGE) \ - "GNU $(PACKAGE)- GNU macro processor" + @cd '$(srcdir)/doc' ; \ + $(SHELL) ../build-aux/gendocs.sh -o '$(abs_builddir)/doc/manual' \ + --email $(PACKAGE_BUGREPORT) $(PACKAGE) \ + "$(PACKAGE_NAME) - $(manual_title)" @echo " *** Upload the doc/manual directory to web-cvs." diff -ruNp m4-1.4.12/src/Makefile.in m4-1.4.13/src/Makefile.in --- m4-1.4.12/src/Makefile.in 2008-10-10 21:03:08.000000000 -0600 +++ m4-1.4.13/src/Makefile.in 2009-03-31 20:11:43.000000000 -0600 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10b from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,8 +17,9 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -36,15 +38,17 @@ bin_PROGRAMS = m4$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/autobuild.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/assert.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/cloexec.m4 \ $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/dirname.m4 \ $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \ $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl_h.m4 \ @@ -54,7 +58,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \ $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ $(top_srcdir)/m4/fseeko.m4 $(top_srcdir)/m4/ftello.m4 \ - $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/glibc21.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ @@ -64,50 +69,57 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/lock.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lseek.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memset.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ - $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/open.m4 \ - $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/posix_spawn.m4 \ + $(top_srcdir)/m4/printf-frexp.m4 \ $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ - $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/regex.m4 \ - $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \ - $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sched_h.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/snprintf.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-safer.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib-safer.m4 \ - $(top_srcdir)/m4/stdlib_h.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/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \ - $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ - $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/thread.m4 \ - $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/tls.m4 \ - $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/spawn_h.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-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strchrnul.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/strsignal.m4 \ + $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtod.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \ + $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \ + $(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/tmpdir.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unistd-safer.m4 \ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \ $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf-posix.m4 \ - $(top_srcdir)/m4/vasprintf.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/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yield.m4 \ + $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wait-process.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_m4_OBJECTS = m4.$(OBJEXT) builtin.$(OBJEXT) debug.$(OBJEXT) \ eval.$(OBJEXT) format.$(OBJEXT) freeze.$(OBJEXT) \ @@ -120,10 +132,23 @@ m4_DEPENDENCIES = ../lib/libm4.a $(am__D DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = @echo " CC " $@; +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = @ +am__v_at_0 = @ CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = @echo " CCLD " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(m4_SOURCES) DIST_SOURCES = $(m4_SOURCES) ETAGS = etags @@ -133,6 +158,7 @@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -166,14 +192,19 @@ FCNTL_H = @FCNTL_H@ FLOAT_H = @FLOAT_H@ GETOPT_H = @GETOPT_H@ GLIBC21 = @GLIBC21@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ @@ -194,29 +225,44 @@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ GNULIB_ISINF = @GNULIB_ISINF@ GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -230,12 +276,34 @@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ +GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ +GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ +GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ +GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ +GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ +GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ +GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -266,6 +334,8 @@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ @@ -273,15 +343,22 @@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ @@ -292,6 +369,7 @@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ @@ -311,28 +389,48 @@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCHED_H = @HAVE_SCHED_H@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ @@ -341,6 +439,7 @@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_SPAWN_H = @HAVE_SPAWN_H@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ @@ -350,23 +449,34 @@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -386,6 +496,10 @@ LIBSIGSEGV = @LIBSIGSEGV@ LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIBTHREAD = @LIBTHREAD@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBCSTACK = @LTLIBCSTACK@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -403,7 +517,9 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_SCHED_H = @NEXT_SCHED_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_SPAWN_H = @NEXT_SPAWN_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ @@ -411,6 +527,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -420,17 +537,21 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -455,6 +576,13 @@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ @@ -462,6 +590,7 @@ REPLACE_NAN = @REPLACE_NAN@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -480,22 +609,29 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TRUNCL = @REPLACE_TRUNCL@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ +SCHED_H = @SCHED_H@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SPAWN_H = @SPAWN_H@ STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +SYS_WAIT_H = @SYS_WAIT_H@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ @@ -503,7 +639,6 @@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ -YIELD_LIB = @YIELD_LIB@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -568,14 +703,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --silent-rules src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu --silent-rules src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -593,32 +728,47 @@ $(top_srcdir)/configure: $(am__configur cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) m4$(EXEEXT): $(m4_OBJECTS) $(m4_DEPENDENCIES) @rm -f m4$(EXEEXT) - $(LINK) $(m4_OBJECTS) $(m4_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(m4_OBJECTS) $(m4_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -639,15 +789,17 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symtab.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` @@ -657,14 +809,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -672,29 +824,34 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -715,13 +872,17 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -752,6 +913,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -772,6 +934,8 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: @@ -780,18 +944,28 @@ install-data-am: install-dvi: install-dvi-am +install-dvi-am: + install-exec-am: install-binPROGRAMS install-html: install-html-am +install-html-am: + install-info: install-info-am +install-info-am: + install-man: install-pdf: install-pdf-am +install-pdf-am: + install-ps: install-ps-am +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -828,6 +1002,7 @@ uninstall-am: uninstall-binPROGRAMS mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS + # 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 -ruNp m4-1.4.12/src/builtin.c m4-1.4.13/src/builtin.c --- m4-1.4.12/src/builtin.c 2008-09-01 06:36:28.000000000 -0600 +++ m4-1.4.13/src/builtin.c 2009-03-05 05:46:01.000000000 -0700 @@ -1,7 +1,7 @@ /* GNU m4 -- A simple macro processor Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2000, 2004, 2006, - 2007, 2008 Free Software Foundation, Inc. + 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GNU M4. @@ -24,13 +24,11 @@ #include "m4.h" -extern FILE *popen (); - +#include "execute.h" +#include "memchr2.h" +#include "pipe.h" #include "regex.h" - -#if HAVE_SYS_WAIT_H -# include <sys/wait.h> -#endif +#include "wait-process.h" #define ARG(i) (argc > (i) ? TOKEN_DATA_TEXT (argv[i]) : "") @@ -939,42 +937,17 @@ builtin `%s' requested by frozen file is | and "sysval". "esyscmd" is GNU specific. | `------------------------------------------------------------------------*/ -/* Helper macros for readability. */ -#if UNIX || defined WEXITSTATUS -# define M4SYSVAL_EXITBITS(status) \ - (WIFEXITED (status) ? WEXITSTATUS (status) : 0) -# define M4SYSVAL_TERMSIGBITS(status) \ - (WIFSIGNALED (status) ? WTERMSIG (status) << 8 : 0) - -#else /* ! UNIX && ! defined WEXITSTATUS */ -/* Platforms such as mingw do not support the notion of reporting - which signal terminated a process. Furthermore if WEXITSTATUS was - not provided, then the exit value is in the low eight bits. */ -# define M4SYSVAL_EXITBITS(status) status -# define M4SYSVAL_TERMSIGBITS(status) 0 -#endif /* ! UNIX && ! defined WEXITSTATUS */ - -/* Fallback definitions if <stdlib.h> or <sys/wait.h> are inadequate. */ -#ifndef WEXITSTATUS -# define WEXITSTATUS(status) (((status) >> 8) & 0xff) -#endif -#ifndef WTERMSIG -# define WTERMSIG(status) ((status) & 0x7f) -#endif -#ifndef WIFSIGNALED -# define WIFSIGNALED(status) (WTERMSIG (status) != 0) -#endif -#ifndef WIFEXITED -# define WIFEXITED(status) (WTERMSIG (status) == 0) -#endif - /* Exit code from last "syscmd" command. */ static int sysval; static void m4_syscmd (struct obstack *obs, int argc, token_data **argv) { - if (bad_argc (argv[0], argc, 2, 2)) + const char *cmd = ARG (1); + int status; + int sig_status; + const char *prog_args[4] = { "sh", "-c" }; + if (bad_argc (argv[0], argc, 2, 2) || !*cmd) { /* The empty command is successful. */ sysval = 0; @@ -982,26 +955,42 @@ m4_syscmd (struct obstack *obs, int argc } debug_flush_files (); - sysval = system (ARG (1)); -#if FUNC_SYSTEM_BROKEN - /* OS/2 has a buggy system() that returns exit status in the lowest eight - bits, although pclose() and WEXITSTATUS are defined to return exit - status in the next eight bits. This approach can't detect signals, but - at least syscmd(`ls') still works when stdout is a terminal. An - alternate approach is popen/insert_file/pclose, but that makes stdout - a pipe, which can change how some child processes behave. */ - if (sysval != -1) - sysval <<= 8; -#endif /* FUNC_SYSTEM_BROKEN */ +#if W32_NATIVE + if (strstr (SYSCMD_SHELL, "cmd")) + { + prog_args[0] = "cmd"; + prog_args[1] = "/c"; + } +#endif + prog_args[2] = cmd; + errno = 0; + status = execute (ARG (0), SYSCMD_SHELL, (char **) prog_args, false, + false, false, false, true, false, &sig_status); + if (sig_status) + { + assert (status == 127); + sysval = sig_status << 8; + } + else + { + if (status == 127 && errno) + M4ERROR ((warning_status, errno, "cannot run command `%s'", cmd)); + sysval = status; + } } static void m4_esyscmd (struct obstack *obs, int argc, token_data **argv) { + const char *cmd = ARG (1); + const char *prog_args[4] = { "sh", "-c" }; + pid_t child; + int fd; FILE *pin; - int ch; + int status; + int sig_status; - if (bad_argc (argv[0], argc, 2, 2)) + if (bad_argc (argv[0], argc, 2, 2) || !*cmd) { /* The empty command is successful. */ sysval = 0; @@ -1009,28 +998,69 @@ m4_esyscmd (struct obstack *obs, int arg } debug_flush_files (); +#if W32_NATIVE + if (strstr (SYSCMD_SHELL, "cmd")) + { + prog_args[0] = "cmd"; + prog_args[1] = "/c"; + } +#endif + prog_args[2] = cmd; errno = 0; - pin = popen (ARG (1), "r"); + child = create_pipe_in (ARG (0), SYSCMD_SHELL, (char **) prog_args, + NULL, false, true, false, &fd); + if (child == -1) + { + M4ERROR ((warning_status, errno, "cannot run command `%s'", cmd)); + sysval = 127; + return; + } + pin = fdopen (fd, "r"); if (pin == NULL) { - M4ERROR ((warning_status, errno, - "cannot open pipe to command `%s'", ARG (1))); - sysval = -1; + M4ERROR ((warning_status, errno, "cannot run command `%s'", cmd)); + sysval = 127; + close (fd); + return; + } + while (1) + { + size_t avail = obstack_room (obs); + size_t len; + if (!avail) + { + int ch = getc (pin); + if (ch == EOF) + break; + obstack_1grow (obs, ch); + continue; + } + len = fread (obstack_next_free (obs), 1, avail, pin); + if (len <= 0) + break; + obstack_blank_fast (obs, len); + } + if (ferror (pin) || fclose (pin)) + M4ERROR ((EXIT_FAILURE, errno, "cannot read pipe")); + status = wait_subprocess (child, ARG (0), false, false, true, false, + &sig_status); + if (sig_status) + { + assert (status == 127); + sysval = sig_status << 8; } else { - while ((ch = getc (pin)) != EOF) - obstack_1grow (obs, (char) ch); - sysval = pclose (pin); + if (status == 127 && errno) + M4ERROR ((warning_status, errno, "cannot run command `%s'", cmd)); + sysval = status; } } static void m4_sysval (struct obstack *obs, int argc, token_data **argv) { - shipout_int (obs, (sysval == -1 ? 127 - : (M4SYSVAL_EXITBITS (sysval) - | M4SYSVAL_TERMSIGBITS (sysval)))); + shipout_int (obs, sysval); } /*-------------------------------------------------------------------------. @@ -1662,7 +1692,7 @@ m4_debugfile (struct obstack *obs, int a debug_set_output (NULL); else if (!debug_set_output (ARG (1))) M4ERROR ((warning_status, errno, - "cannot set error file: `%s'", ARG (1))); + "cannot set debug file `%s'", ARG (1))); } /* This section contains text processing macros: "len", "index", @@ -1800,35 +1830,56 @@ expand_ranges (const char *s, struct obs static void m4_translit (struct obstack *obs, int argc, token_data **argv) { - const char *data; - const char *from; + const char *data = ARG (1); + const char *from = ARG (2); const char *to; - char map[256] = {0}; - char found[256] = {0}; + char map[UCHAR_MAX + 1]; + char found[UCHAR_MAX + 1]; unsigned char ch; - if (bad_argc (argv[0], argc, 3, 4)) + if (bad_argc (argv[0], argc, 3, 4) || !*data || !*from) { /* builtin(`translit') is blank, but translit(`abc') is abc. */ - if (argc == 2) - obstack_grow (obs, ARG (1), strlen (ARG (1))); + if (2 <= argc) + obstack_grow (obs, data, strlen (data)); return; } - from = ARG (2); - if (strchr (from, '-') != NULL) - { - from = expand_ranges (from, obs); - if (from == NULL) - return; - } - to = ARG (3); if (strchr (to, '-') != NULL) { to = expand_ranges (to, obs); - if (to == NULL) - return; + assert (to && *to); + } + + /* If there are only one or two bytes to replace, it is faster to + use memchr2. Using expand_ranges does nothing unless there are + at least three bytes. */ + if (!from[1] || !from[2]) + { + const char *p; + size_t len = strlen (data); + while ((p = (char *) memchr2 (data, from[0], from[1], len))) + { + obstack_grow (obs, data, p - data); + len -= p - data; + if (!len) + return; + data = p + 1; + len--; + if (*p == from[0] && to[0]) + obstack_1grow (obs, to[0]); + else if (*p == from[1] && to[0] && to[1]) + obstack_1grow (obs, to[1]); + } + obstack_grow (obs, data, len); + return; + } + + if (strchr (from, '-') != NULL) + { + from = expand_ranges (from, obs); + assert (from && *from); } /* Calling strchr(from) for each character in data is quadratic, @@ -1837,6 +1888,8 @@ m4_translit (struct obstack *obs, int ar pass of data, for linear behavior. Traditional behavior is that only the first instance of a character in from is consulted, hence the found map. */ + memset (map, 0, sizeof map); + memset (found, 0, sizeof found); for ( ; (ch = *from) != '\0'; from++) { if (! found[ch]) @@ -1886,17 +1939,18 @@ substitute (struct obstack *obs, const c struct re_registers *regs) { int ch; - - for (;;) + while (1) { - while ((ch = *repl++) != '\\') + const char *backslash = strchr (repl, '\\'); + if (!backslash) { - if (ch == '\0') - return; - obstack_1grow (obs, ch); + obstack_grow (obs, repl, strlen (repl)); + return; } - - switch ((ch = *repl++)) + obstack_grow (obs, repl, backslash - repl); + repl = backslash; + ch = *++repl; + switch (ch) { case '0': if (!substitute_warned) @@ -1910,6 +1964,7 @@ Warning: \\0 will disappear, use \\& ins case '&': obstack_grow (obs, victim + regs->start[0], regs->end[0] - regs->start[0]); + repl++; break; case '1': case '2': case '3': case '4': case '5': case '6': @@ -1921,6 +1976,7 @@ Warning: \\0 will disappear, use \\& ins else if (regs->end[ch] > 0) obstack_grow (obs, victim + regs->start[ch], regs->end[ch] - regs->start[ch]); + repl++; break; case '\0': @@ -1930,6 +1986,7 @@ Warning: \\0 will disappear, use \\& ins default: obstack_1grow (obs, ch); + repl++; break; } } @@ -2135,19 +2192,19 @@ void expand_user_macro (struct obstack *obs, symbol *sym, int argc, token_data **argv) { - const char *text; + const char *text = SYMBOL_TEXT (sym); int i; - - for (text = SYMBOL_TEXT (sym); *text != '\0';) + while (1) { - if (*text != '$') + const char *dollar = strchr (text, '$'); + if (!dollar) { - obstack_1grow (obs, *text); - text++; - continue; + obstack_grow (obs, text, strlen (text)); + return; } - text++; - switch (*text) + obstack_grow (obs, text, dollar - text); + text = dollar; + switch (*++text) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': diff -ruNp m4-1.4.12/src/format.c m4-1.4.13/src/format.c --- m4-1.4.12/src/format.c 2008-08-11 20:48:22.000000000 -0600 +++ m4-1.4.13/src/format.c 2009-02-18 18:19:05.000000000 -0700 @@ -1,7 +1,7 @@ /* GNU m4 -- A simple macro processor - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2006, 2007, 2008 - Free Software Foundation, Inc. + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2006, 2007, 2008, + 2009 Free Software Foundation, Inc. This file is part of GNU M4. @@ -89,14 +89,16 @@ expand_format (struct obstack *obs, int f = fmt = ARG_STR (argc, argv); memset (ok, 0, sizeof ok); - for (;;) + while (1) { - while ((c = *fmt++) != '%') + const char *percent = strchr (fmt, '%'); + if (!percent) { - if (c == '\0') - return; - obstack_1grow (obs, c); + obstack_grow (obs, fmt, strlen (fmt)); + return; } + obstack_grow (obs, fmt, percent - fmt); + fmt = percent + 1; if (*fmt == '%') { diff -ruNp m4-1.4.12/src/input.c m4-1.4.13/src/input.c --- m4-1.4.12/src/input.c 2008-09-01 07:00:04.000000000 -0600 +++ m4-1.4.13/src/input.c 2009-02-22 21:36:37.000000000 -0700 @@ -1,7 +1,7 @@ /* GNU m4 -- A simple macro processor Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, - 2007, 2008 Free Software Foundation, Inc. + 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GNU M4. @@ -23,6 +23,8 @@ #include "m4.h" +#include "memchr2.h" + /* Unread input can be either files, that should be read (eg. included files), strings, which should be rescanned (eg. macro expansion text), or quoted macro definitions (as returned by the builtin "defn"). @@ -82,6 +84,7 @@ struct input_block struct { char *string; /* remaining string value */ + char *end; /* terminating NUL of string */ } u_s; /* INPUT_STRING */ struct @@ -276,8 +279,10 @@ push_string_finish (void) if (obstack_object_size (current_input) > 0) { + size_t len = obstack_object_size (current_input); obstack_1grow (current_input, '\0'); next->u.u_s.string = (char *) obstack_finish (current_input); + next->u.u_s.end = next->u.u_s.string + len; next->prev = isp; isp = next; ret = isp->u.u_s.string; /* for immediate use only */ @@ -301,6 +306,7 @@ push_string_finish (void) void push_wrapup (const char *s) { + size_t len = strlen (s); input_block *i; i = (input_block *) obstack_alloc (wrapup_stack, sizeof (struct input_block)); @@ -308,7 +314,8 @@ push_wrapup (const char *s) i->type = INPUT_STRING; i->file = current_file; i->line = current_line; - i->u.u_s.string = (char *) obstack_copy0 (wrapup_stack, s, strlen (s)); + i->u.u_s.string = (char *) obstack_copy0 (wrapup_stack, s, len); + i->u.u_s.end = i->u.u_s.string + len; wsp = i; } @@ -951,10 +958,47 @@ next_token (token_data *td, int *line) } else { + bool fast = lquote.length == 1 && rquote.length == 1; quote_level = 1; while (1) { - ch = next_char (); + /* Try scanning a buffer first. */ + const char *buffer = (isp && isp->type == INPUT_STRING + ? isp->u.u_s.string : NULL); + if (buffer && *buffer) + { + size_t len = isp->u.u_s.end - buffer; + const char *p = buffer; + do + { + p = (char *) memchr2 (p, *lquote.string, *rquote.string, + buffer + len - p); + } + while (p && fast && (*p++ == *rquote.string + ? --quote_level : ++quote_level)); + if (p) + { + if (fast) + { + assert (!quote_level); + obstack_grow (&token_stack, buffer, p - buffer - 1); + isp->u.u_s.string += p - buffer; + break; + } + obstack_grow (&token_stack, buffer, p - buffer); + ch = to_uchar (*p); + isp->u.u_s.string += p - buffer + 1; + } + else + { + obstack_grow (&token_stack, buffer, len); + isp->u.u_s.string += len; + continue; + } + } + /* Fall back to a byte. */ + else + ch = next_char (); if (ch == CHAR_EOF) /* current_file changed to "" if we see CHAR_EOF, use the previous value we stored earlier. */ diff -ruNp m4-1.4.12/src/m4.c m4-1.4.13/src/m4.c --- m4-1.4.12/src/m4.c 2008-09-25 19:33:03.000000000 -0600 +++ m4-1.4.13/src/m4.c 2009-01-24 12:52:43.000000000 -0700 @@ -1,7 +1,7 @@ /* GNU m4 -- A simple macro processor Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, - 2007, 2008 Free Software Foundation, Inc. + 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GNU M4. @@ -79,7 +79,7 @@ int retcode; struct macro_definition { struct macro_definition *next; - int code; /* D, U, s, t, or '\1' */ + int code; /* D, U, s, t, '\1', or DEBUGFILE_OPTION. */ const char *arg; }; typedef struct macro_definition macro_definition; @@ -125,7 +125,7 @@ m4_error_at_line (int status, int errnum # define MAX(a,b) ((a) < (b) ? (b) : (a)) # endif # define NSIG (MAX (SIGABRT, MAX (SIGILL, MAX (SIGFPE, \ - MAX (SIGSEGV, SIGBUS)))) + 1) + MAX (SIGSEGV, SIGBUS)))) + 1) #endif /* Pre-translated messages for program errors. Do not translate in @@ -144,20 +144,20 @@ fault_handler (int signo) if (signo) { /* POSIX states that reading static memory is, in general, not - async-safe. However, the static variables that we read are - never modified once this handler is installed, so this - particular usage is safe. And it seems an oversight that - POSIX claims strlen is not async-safe. */ + async-safe. However, the static variables that we read are + never modified once this handler is installed, so this + particular usage is safe. And it seems an oversight that + POSIX claims strlen is not async-safe. */ write (STDERR_FILENO, program_name, strlen (program_name)); write (STDERR_FILENO, ": ", 2); write (STDERR_FILENO, program_error_message, - strlen (program_error_message)); + strlen (program_error_message)); if (signal_message[signo]) - { - write (STDERR_FILENO, ": ", 2); - write (STDERR_FILENO, signal_message[signo], - strlen (signal_message[signo])); - } + { + write (STDERR_FILENO, ": ", 2); + write (STDERR_FILENO, signal_message[signo], + strlen (signal_message[signo])); + } write (STDERR_FILENO, "\n", 1); _exit (EXIT_INTERNAL_ERROR); } @@ -191,13 +191,13 @@ Operation modes:\n\ ", stdout); xprintf ("\ -E, --fatal-warnings once: warnings become errors, twice: stop\n\ - execution at first error\n\ + execution at first error\n\ -i, --interactive unbuffer output, ignore interrupts\n\ -P, --prefix-builtins force a `m4_' prefix to all builtins\n\ -Q, --quiet, --silent suppress some warnings for builtins\n\ --warn-macro-sequence[=REGEXP]\n\ warn if macro definition matches REGEXP,\n\ - default %s\n\ + default %s\n\ ", DEFAULT_MACRO_SEQUENCE); #ifdef ENABLE_CHANGEWORD fputs ("\ @@ -230,7 +230,8 @@ Frozen state files:\n\ \n\ Debugging:\n\ -d, --debug[=FLAGS] set debug level (no FLAGS implies `aeq')\n\ - --debugfile=FILE redirect debug and trace output\n\ + --debugfile[=FILE] redirect debug and trace output to FILE\n\ + (default stderr, discard if empty string)\n\ -l, --arglength=NUM restrict macro tracing size\n\ -t, --trace=NAME trace NAME when it is defined\n\ ", stdout); @@ -259,7 +260,7 @@ of directories included after any specif Exit status is 0 for success, 1 for failure, 63 for frozen file version\n\ mismatch, or whatever value was passed to the m4exit macro.\n\ ", stdout); - xprintf ("\nReport bugs to <%s>.\n", PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -303,7 +304,7 @@ static const struct option long_options[ {"undefine", required_argument, NULL, 'U'}, {"word-regexp", required_argument, NULL, 'W'}, - {"debugfile", required_argument, NULL, DEBUGFILE_OPTION}, + {"debugfile", optional_argument, NULL, DEBUGFILE_OPTION}, {"diversions", required_argument, NULL, DIVERSIONS_OPTION}, {"warn-macro-sequence", optional_argument, NULL, WARN_MACRO_SEQUENCE_OPTION}, @@ -381,12 +382,13 @@ main (int argc, char *const *argv, char /* Stack overflow and program error handling. Ignore failure to install a handler, since this is merely for improved output on - crash, and we should never crash ;). */ - if (c_stack_action (fault_handler) == 0) - nesting_limit = 0; + crash, and we should never crash ;). We install SIGBUS and + SIGSEGV handlers prior to using the c-stack module; depending on + the platform, c-stack will then override none, SIGSEGV, or both + handlers. */ program_error_message = xasprintf (_("internal error detected; please report this bug to <%s>"), - PACKAGE_BUGREPORT); + PACKAGE_BUGREPORT); signal_message[SIGSEGV] = xstrdup (strsignal (SIGSEGV)); signal_message[SIGABRT] = xstrdup (strsignal (SIGABRT)); signal_message[SIGILL] = xstrdup (strsignal (SIGILL)); @@ -398,10 +400,13 @@ main (int argc, char *const *argv, char to default signal behavior. */ act.sa_flags = SA_NODEFER | SA_RESETHAND; act.sa_handler = fault_handler; + sigaction (SIGSEGV, &act, NULL); sigaction (SIGABRT, &act, NULL); sigaction (SIGILL, &act, NULL); sigaction (SIGFPE, &act, NULL); sigaction (SIGBUS, &act, NULL); + if (c_stack_action (fault_handler) == 0) + nesting_limit = 0; #ifdef DEBUG_STKOVF /* Make it easier to test our fault handlers. Exporting M4_CRASH=0 @@ -411,10 +416,10 @@ main (int argc, char *const *argv, char char *crash = getenv ("M4_CRASH"); if (crash) { - if (!atoi (crash)) - ++*(int *) 8; - assert (false); - abort (); + if (!atoi (crash)) + ++*(int *) 8; + assert (false); + abort (); } } #endif /* DEBUG_STKOVF */ @@ -451,6 +456,7 @@ main (int argc, char *const *argv, char case 's': case 't': case '\1': + case DEBUGFILE_OPTION: /* Arguments that cannot be handled until later are accumulated. */ defn = (macro_definition *) xmalloc (sizeof (macro_definition)); @@ -544,17 +550,16 @@ main (int argc, char *const *argv, char but don't issue a deprecation warning until autoconf 2.61 or later is more widely established, as such a warning would interfere with all earlier versions of autoconf. */ - case DEBUGFILE_OPTION: /* Don't call debug_set_output here, as it has side effects. */ debugfile = optarg; break; case WARN_MACRO_SEQUENCE_OPTION: - /* Don't call set_macro_sequence here, as it can exit. - --warn-macro-sequence sets optarg to NULL (which uses the - default regexp); --warn-macro-sequence= sets optarg to "" - (which disables these warnings). */ - macro_sequence = optarg; + /* Don't call set_macro_sequence here, as it can exit. + --warn-macro-sequence sets optarg to NULL (which uses the + default regexp); --warn-macro-sequence= sets optarg to "" + (which disables these warnings). */ + macro_sequence = optarg; break; case VERSION_OPTION: @@ -571,7 +576,7 @@ main (int argc, char *const *argv, char /* Do the basic initializations. */ if (debugfile && !debug_set_output (debugfile)) - M4ERROR ((0, errno, "cannot set debug file `%s'", debugfile)); + M4ERROR ((warning_status, errno, "cannot set debug file `%s'", debugfile)); input_init (); output_init (); @@ -629,7 +634,13 @@ main (int argc, char *const *argv, char case '\1': seen_file = true; - process_file (defines->arg); + process_file (defines->arg); + break; + + case DEBUGFILE_OPTION: + if (!debug_set_output (defines->arg)) + M4ERROR ((warning_status, errno, "cannot set debug file `%s'", + debugfile ? debugfile : _("stderr"))); break; default: diff -ruNp m4-1.4.12/src/m4.h m4-1.4.13/src/m4.h --- m4-1.4.12/src/m4.h 2008-09-22 20:35:23.000000000 -0600 +++ m4-1.4.13/src/m4.h 2008-12-12 06:11:39.000000000 -0700 @@ -25,6 +25,7 @@ #include <config.h> +#include <assert.h> #include <ctype.h> #include <errno.h> #include <limits.h> diff -ruNp m4-1.4.12/src/output.c m4-1.4.13/src/output.c --- m4-1.4.12/src/output.c 2008-08-11 20:48:22.000000000 -0600 +++ m4-1.4.13/src/output.c 2009-02-18 18:19:05.000000000 -0700 @@ -1,7 +1,7 @@ /* GNU m4 -- A simple macro processor Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, - 2007 Free Software Foundation, Inc. + 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GNU M4. @@ -58,13 +58,13 @@ struct m4_diversion { union { - FILE *file; /* diversion file on disk */ - char *buffer; /* in-memory diversion buffer */ - m4_diversion *next; /* free-list pointer */ + FILE *file; /* Diversion file on disk. */ + char *buffer; /* Malloc'd diversion buffer. */ + m4_diversion *next; /* Free-list pointer */ } u; - int divnum; /* which diversion this represents */ - int size; /* usable size before reallocation */ - int used; /* used length in characters */ + int divnum; /* Which diversion this represents. */ + int size; /* Usable size before reallocation. */ + int used; /* Used buffer length, or tmp file exists. */ }; /* Table of diversions 1 through INT_MAX. */ @@ -86,13 +86,25 @@ static int total_buffer_size; maintained for the `divnum' builtin function. */ int current_diversion; -/* Current output diversion, NULL if output is being currently discarded. */ +/* Current output diversion, NULL if output is being currently + discarded. output_diversion->u is guaranteed non-NULL except when + the diversion has never been used; use size to determine if it is a + malloc'd buffer or a FILE. output_diversion->used is 0 if u.file + is stdout, and non-zero if this is a malloc'd buffer or a temporary + diversion file. */ static m4_diversion *output_diversion; -/* Values of some output_diversion fields, cached out for speed. */ -static FILE *output_file; /* current value of (file) */ -static char *output_cursor; /* current value of (buffer + used) */ -static int output_unused; /* current value of (size - used) */ +/* Cache of output_diversion->u.file, only valid when + output_diversion->size is 0. */ +static FILE *output_file; + +/* Cache of output_diversion->u.buffer + output_diversion->used, only + valid when output_diversion->size is non-zero. */ +static char *output_cursor; + +/* Cache of output_diversion->size - output_diversion->used, only + valid when output_diversion->size is non-zero. */ +static int output_unused; /* Number of input line we are generating output for. */ int output_current_line; @@ -100,11 +112,19 @@ int output_current_line; /* Temporary directory holding all spilled diversion files. */ static m4_temp_dir *output_temp_dir; +/* Cache of most recently used spilled diversion files. */ +static FILE *tmp_file1; +static FILE *tmp_file2; + +/* Diversions that own tmp_file, or 0. */ +static int tmp_file1_owner; +static int tmp_file2_owner; + +/* True if tmp_file2 is more recently used. */ +static bool tmp_file2_recent; -/*------------------------. -| Output initialization. | -`------------------------*/ +/* Internal routines. */ /* Callback for comparing list elements ELT1 and ELT2 for order in diversion_table. */ @@ -128,28 +148,6 @@ threshold_diversion_CB (const void *elt, return diversion->divnum >= *(const int *) threshold; } -void -output_init (void) -{ - diversion_table = gl_oset_create_empty (GL_AVLTREE_OSET, cmp_diversion_CB, - NULL); - div0.u.file = stdout; - output_diversion = &div0; - output_file = stdout; - obstack_init (&diversion_storage); -} - -void -output_exit (void) -{ - /* Order is important, since we may have registered cleanup_tmpfile - as an atexit handler, and it must not traverse stale memory. */ - gl_oset_t table = diversion_table; - diversion_table = NULL; - gl_oset_free (table); - obstack_free (&diversion_storage, NULL); -} - /* Clean up any temporary directory. Designed for use as an atexit handler, where it is not safe to call exit() recursively; so this calls _exit if a problem is encountered. */ @@ -197,6 +195,7 @@ m4_tmpname (int divnum) free (tail); tail = strrchr (buffer, '-') + 1; } + assert (0 < divnum); sprintf (tail, "%d", divnum); return buffer; } @@ -204,9 +203,10 @@ m4_tmpname (int divnum) /* Create a temporary file for diversion DIVNUM open for reading and writing in a secure temp directory. The file will be automatically closed and deleted on a fatal signal. The file can be closed and - reopened with m4_tmpclose and m4_tmpopen; when finally done with - the file, close it with m4_tmpremove. Exits on failure, so the - return value is always an open file. */ + reopened with m4_tmpclose and m4_tmpopen, or moved with + m4_tmprename; when finally done with the file, close it with + m4_tmpremove. Exits on failure, so the return value is always an + open file. */ static FILE * m4_tmpfile (int divnum) { @@ -237,43 +237,175 @@ m4_tmpfile (int divnum) } /* Reopen a temporary file for diversion DIVNUM for reading and - writing in a secure temp directory. Exits on failure, so the - return value is always an open file. */ + writing in a secure temp directory. If REREAD, the file is + positioned at offset 0, otherwise the file is positioned at the + end. Exits on failure, so the return value is always an open + file. */ static FILE * -m4_tmpopen (int divnum) +m4_tmpopen (int divnum, bool reread) { - const char *name = m4_tmpname (divnum); + const char *name; FILE *file; - file = fopen_temp (name, O_BINARY ? "ab+" : "a+"); + if (tmp_file1_owner == divnum) + { + if (reread && fseeko (tmp_file1, 0, SEEK_SET) != 0) + m4_error (EXIT_FAILURE, errno, + _("cannot seek within diversion")); + tmp_file2_recent = false; + return tmp_file1; + } + else if (tmp_file2_owner == divnum) + { + if (reread && fseeko (tmp_file2, 0, SEEK_SET) != 0) + m4_error (EXIT_FAILURE, errno, + _("cannot seek within diversion")); + tmp_file2_recent = true; + return tmp_file2; + } + name = m4_tmpname (divnum); + /* We need update mode, to avoid truncation. */ + file = fopen_temp (name, O_BINARY ? "rb+" : "r+"); if (file == NULL) M4ERROR ((EXIT_FAILURE, errno, "cannot create temporary file for diversion")); else if (set_cloexec_flag (fileno (file), true) != 0) - M4ERROR ((warning_status, errno, - "Warning: cannot protect diversion across forks")); - /* POSIX states that it is undefined whether an append stream starts - at offset 0 or at the end. We want the beginning. */ - else if (fseeko (file, 0, SEEK_SET) != 0) - M4ERROR ((EXIT_FAILURE, errno, - "cannot seek to beginning of diversion")); + m4_error (0, errno, _("cannot protect diversion across forks")); + /* Update mode starts at the beginning of the stream, but sometimes + we want the end. */ + else if (!reread && fseeko (file, 0, SEEK_END) != 0) + m4_error (EXIT_FAILURE, errno, + _("cannot seek within diversion")); return file; } -/* Close, but don't delete, a temporary FILE. */ +/* Close, but don't delete, a temporary FILE for diversion DIVNUM. To + reduce the I/O overhead of repeatedly opening and closing the same + file, this implementation caches the most recent spilled diversion. + On the other hand, keeping every spilled diversion open would run + into EMFILE limits. */ static int -m4_tmpclose (FILE *file) +m4_tmpclose (FILE *file, int divnum) { - return close_stream_temp (file); + int result = 0; + if (divnum != tmp_file1_owner && divnum != tmp_file2_owner) + { + if (tmp_file2_recent) + { + if (tmp_file1_owner) + result = close_stream_temp (tmp_file1); + tmp_file1 = file; + tmp_file1_owner = divnum; + } + else + { + if (tmp_file2_owner) + result = close_stream_temp (tmp_file2); + tmp_file2 = file; + tmp_file2_owner = divnum; + } + } + return result; } /* Delete a closed temporary FILE for diversion DIVNUM. */ static int m4_tmpremove (int divnum) { + if (divnum == tmp_file1_owner) + { + int result = close_stream_temp (tmp_file1); + if (result) + return result; + tmp_file1_owner = 0; + } + else if (divnum == tmp_file2_owner) + { + int result = close_stream_temp (tmp_file2); + if (result) + return result; + tmp_file2_owner = 0; + } return cleanup_temp_file (output_temp_dir, m4_tmpname (divnum)); } +/* Transfer the temporary file for diversion OLDNUM to the previously + unused diversion NEWNUM. Return an open stream visiting the new + temporary file, positioned at the end, or exit on failure. */ +static FILE* +m4_tmprename (int oldnum, int newnum) +{ + /* m4_tmpname reuses its return buffer. */ + char *oldname = xstrdup (m4_tmpname (oldnum)); + const char *newname = m4_tmpname (newnum); + register_temp_file (output_temp_dir, newname); + if (oldnum == tmp_file1_owner) + { + /* Be careful of mingw, which can't rename an open file. */ + if (RENAME_OPEN_FILE_WORKS) + tmp_file1_owner = newnum; + else + { + if (close_stream_temp (tmp_file1)) + m4_error (EXIT_FAILURE, errno, + _("cannot close temporary file for diversion")); + tmp_file1_owner = 0; + } + } + else if (oldnum == tmp_file2_owner) + { + /* Be careful of mingw, which can't rename an open file. */ + if (RENAME_OPEN_FILE_WORKS) + tmp_file2_owner = newnum; + else + { + if (close_stream_temp (tmp_file2)) + m4_error (EXIT_FAILURE, errno, + _("cannot close temporary file for diversion")); + tmp_file2_owner = 0; + } + } + /* Either it is safe to rename an open file, or no one should have + oldname open at this point. */ + if (rename (oldname, newname)) + m4_error (EXIT_FAILURE, errno, + _("cannot create temporary file for diversion")); + unregister_temp_file (output_temp_dir, oldname); + free (oldname); + return m4_tmpopen (newnum, false); +} + + +/*------------------------. +| Output initialization. | +`------------------------*/ + +void +output_init (void) +{ + diversion_table = gl_oset_create_empty (GL_AVLTREE_OSET, cmp_diversion_CB, + NULL); + div0.u.file = stdout; + output_diversion = &div0; + output_file = stdout; + obstack_init (&diversion_storage); +} + +void +output_exit (void) +{ + /* Order is important, since we may have registered cleanup_tmpfile + as an atexit handler, and it must not traverse stale memory. */ + gl_oset_t table = diversion_table; + if (tmp_file1_owner) + m4_tmpremove (tmp_file1_owner); + if (tmp_file2_owner) + m4_tmpremove (tmp_file2_owner); + diversion_table = NULL; + gl_oset_free (table); + obstack_free (&diversion_storage, NULL); +} + /*-----------------------------------------------------------------------. | Reorganize in-memory diversion buffers so the current diversion can | | accomodate LENGTH more characters without further reorganization. The | @@ -376,13 +508,18 @@ make_room_for (int length) { FILE *file = selected_diversion->u.file; selected_diversion->u.file = NULL; - if (m4_tmpclose (file) != 0) - M4ERROR ((0, errno, "cannot close temporary file for diversion")); + if (m4_tmpclose (file, selected_diversion->divnum) != 0) + m4_error (0, errno, + _("cannot close temporary file for diversion")); } /* The current buffer may be safely reallocated. */ - output_diversion->u.buffer - = xrealloc (output_diversion->u.buffer, (size_t) wanted_size); + { + char *buffer = output_diversion->u.buffer; + output_diversion->u.buffer = xcharalloc ((size_t) wanted_size); + memcpy (output_diversion->u.buffer, buffer, output_diversion->used); + free (buffer); + } total_buffer_size += wanted_size - output_diversion->size; output_diversion->size = wanted_size; @@ -590,10 +727,10 @@ make_diversion (int divnum) { if (!output_diversion->size && !output_diversion->u.file) { + assert (!output_diversion->used); if (!gl_oset_remove (diversion_table, output_diversion)) error (EXIT_FAILURE, 0, "INTERNAL ERROR: make_diversion failed"); output_diversion->u.next = free_list; - output_diversion->used = 0; free_list = output_diversion; } else if (output_diversion->size) @@ -602,8 +739,9 @@ make_diversion (int divnum) { FILE *file = output_diversion->u.file; output_diversion->u.file = NULL; - if (m4_tmpclose (file) != 0) - M4ERROR ((0, errno, "cannot close temporary file for diversion")); + if (m4_tmpclose (file, output_diversion->divnum) != 0) + m4_error (0, errno, + _("cannot close temporary file for diversion")); } output_diversion = NULL; output_file = NULL; @@ -658,7 +796,8 @@ make_diversion (int divnum) else { if (!output_diversion->u.file && output_diversion->used) - output_diversion->u.file = m4_tmpopen (output_diversion->divnum); + output_diversion->u.file = m4_tmpopen (output_diversion->divnum, + false); output_file = output_diversion->u.file; } output_current_line = -1; @@ -673,21 +812,19 @@ make_diversion (int divnum) void insert_file (FILE *file) { - char buffer[COPY_BUFFER_SIZE]; + static char buffer[COPY_BUFFER_SIZE]; size_t length; /* Optimize out inserting into a sink. */ - if (!output_diversion) return; /* Insert output by big chunks. */ - - for (;;) + while (1) { - length = fread (buffer, 1, COPY_BUFFER_SIZE, file); + length = fread (buffer, 1, sizeof buffer, file); if (ferror (file)) - M4ERROR ((EXIT_FAILURE, errno, "ERROR: reading inserted file")); + M4ERROR ((EXIT_FAILURE, errno, "error reading inserted file")); if (length == 0) break; output_text (buffer, length); @@ -708,11 +845,45 @@ insert_diversion_helper (m4_diversion *d if (output_diversion) { if (diversion->size) - output_text (diversion->u.buffer, diversion->used); + { + if (!output_diversion->u.file) + { + /* Transferring diversion metadata is faster than + copying contents. */ + assert (!output_diversion->used && output_diversion != &div0 + && !output_file); + output_diversion->u.buffer = diversion->u.buffer; + output_diversion->size = diversion->size; + output_cursor = diversion->u.buffer + diversion->used; + output_unused = diversion->size - diversion->used; + diversion->u.buffer = NULL; + } + else + { + /* Avoid double-charging the total in-memory size when + transferring from one in-memory diversion to + another. */ + total_buffer_size -= diversion->size; + output_text (diversion->u.buffer, diversion->used); + } + } + else if (!output_diversion->u.file) + { + /* Transferring diversion metadata is faster than copying + contents. */ + assert (!output_diversion->used && output_diversion != &div0 + && !output_file); + output_diversion->u.file = m4_tmprename (diversion->divnum, + output_diversion->divnum); + output_diversion->used = 1; + output_file = output_diversion->u.file; + diversion->u.file = NULL; + diversion->size = 1; + } else { if (!diversion->u.file) - diversion->u.file = m4_tmpopen (diversion->divnum); + diversion->u.file = m4_tmpopen (diversion->divnum, true); insert_file (diversion->u.file); } @@ -722,9 +893,10 @@ insert_diversion_helper (m4_diversion *d /* Return all space used by the diversion. */ if (diversion->size) { + if (!output_diversion) + total_buffer_size -= diversion->size; free (diversion->u.buffer); diversion->size = 0; - diversion->used = 0; } else { @@ -732,13 +904,14 @@ insert_diversion_helper (m4_diversion *d { FILE *file = diversion->u.file; diversion->u.file = NULL; - diversion->used = 0; - if (m4_tmpclose (file) != 0) - M4ERROR ((0, errno, "cannot clean temporary file for diversion")); + if (m4_tmpclose (file, diversion->divnum) != 0) + m4_error (0, errno, + _("cannot clean temporary file for diversion")); } if (m4_tmpremove (diversion->divnum) != 0) M4ERROR ((0, errno, "cannot clean temporary file for diversion")); } + diversion->used = 0; gl_oset_remove (diversion_table, diversion); diversion->u.next = free_list; free_list = diversion; @@ -807,7 +980,7 @@ freeze_diversions (FILE *file) iter = gl_oset_iterator (diversion_table); while (gl_oset_iterator_next (&iter, &elt)) { - m4_diversion *diversion = (m4_diversion *) elt;; + m4_diversion *diversion = (m4_diversion *) elt; if (diversion->size || diversion->used) { if (diversion->size) @@ -815,7 +988,7 @@ freeze_diversions (FILE *file) else { struct stat file_stat; - diversion->u.file = m4_tmpopen (diversion->divnum); + diversion->u.file = m4_tmpopen (diversion->divnum, true); if (fstat (fileno (diversion->u.file), &file_stat) < 0) M4ERROR ((EXIT_FAILURE, errno, "cannot stat diversion")); if (file_stat.st_size < 0 diff -ruNp m4-1.4.12/tests/Makefile.am m4-1.4.13/tests/Makefile.am --- m4-1.4.12/tests/Makefile.am 2008-10-09 21:07:24.000000000 -0600 +++ m4-1.4.13/tests/Makefile.am 2009-03-23 06:04:05.000000000 -0600 @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2008 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -102,6 +102,16 @@ EXTRA_DIST += test-binary-io.sh test-bin ## end gnulib module binary-io-tests +## begin gnulib module btowc-tests + +TESTS += test-btowc1.sh test-btowc2.sh +TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' +check_PROGRAMS += test-btowc + +EXTRA_DIST += test-btowc1.sh test-btowc2.sh test-btowc.c + +## end gnulib module btowc-tests + ## begin gnulib module c-ctype-tests TESTS += test-c-ctype @@ -141,6 +151,15 @@ EXTRA_DIST += test-dirname.c ## end gnulib module dirname-tests +## begin gnulib module environ-tests + +TESTS += test-environ +check_PROGRAMS += test-environ + +EXTRA_DIST += test-environ.c + +## end gnulib module environ-tests + ## begin gnulib module errno-tests TESTS += test-errno @@ -226,8 +245,9 @@ EXTRA_DIST += test-freading.c ## begin gnulib module frexp-nolibm-tests -TESTS += test-frexp -check_PROGRAMS += test-frexp +TESTS += test-frexp-nolibm +check_PROGRAMS += test-frexp-nolibm +test_frexp_nolibm_SOURCES = test-frexp.c EXTRA_DIST += test-frexp.c @@ -235,8 +255,9 @@ EXTRA_DIST += test-frexp.c ## begin gnulib module frexpl-nolibm-tests -TESTS += test-frexpl -check_PROGRAMS += test-frexpl +TESTS += test-frexpl-nolibm +check_PROGRAMS += test-frexpl-nolibm +test_frexpl_nolibm_SOURCES = test-frexpl.c EXTRA_DIST += test-frexpl.c @@ -244,22 +265,46 @@ EXTRA_DIST += test-frexpl.c ## begin gnulib module fseeko-tests -TESTS += test-fseeko.sh +TESTS += test-fseeko.sh test-fseeko2.sh TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='$(srcdir)' check_PROGRAMS += test-fseeko -EXTRA_DIST += test-fseeko.c test-fseeko.sh +EXTRA_DIST += test-fseeko.c test-fseeko.sh test-fseeko2.sh ## end gnulib module fseeko-tests ## begin gnulib module ftello-tests -TESTS += test-ftello.sh +TESTS += test-ftello.sh test-ftello2.sh TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='$(srcdir)' check_PROGRAMS += test-ftello -EXTRA_DIST += test-ftello.c test-ftello.sh +EXTRA_DIST += test-ftello.c test-ftello.sh test-ftello2.sh ## end gnulib module ftello-tests +## begin gnulib module getdtablesize-tests + +TESTS += test-getdtablesize +check_PROGRAMS += test-getdtablesize +EXTRA_DIST += test-getdtablesize.c + +## end gnulib module getdtablesize-tests + +## 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 <libintl.h> 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 + +EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath + +## end gnulib module gettext + ## begin gnulib module gettimeofday-tests TESTS += test-gettimeofday @@ -292,7 +337,7 @@ EXTRA_DIST += test-isnanf-nolibm.c test- TESTS += test-isnanl-nolibm check_PROGRAMS += test-isnanl-nolibm -EXTRA_DIST += test-isnanl-nolibm.c test-isnanl.h +EXTRA_DIST += test-isnanl-nolibm.c test-isnanl.h nan.h ## end gnulib module isnanl-nolibm-tests @@ -305,15 +350,6 @@ EXTRA_DIST += test-linkedhash_list.c ## end gnulib module linkedhash-list-tests -## begin gnulib module lock-tests - -TESTS += test-lock -check_PROGRAMS += test-lock -test_lock_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@ -EXTRA_DIST += test-lock.c - -## end gnulib module lock-tests - ## begin gnulib module lseek-tests TESTS += test-lseek.sh @@ -323,6 +359,14 @@ EXTRA_DIST += test-lseek.c test-lseek.sh ## end gnulib module lseek-tests +## begin gnulib module lstat-tests + +TESTS += test-lstat +check_PROGRAMS += test-lstat +EXTRA_DIST += test-lstat.c + +## end gnulib module lstat-tests + ## begin gnulib module malloca-tests TESTS += test-malloca @@ -341,21 +385,38 @@ EXTRA_DIST += test-math.c ## end gnulib module math-tests -## begin gnulib module memchr-tests +## begin gnulib module mbrtowc-tests + +TESTS += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh +TESTS_ENVIRONMENT += \ + EXEEXT='@EXEEXT@' \ + LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_JA='@LOCALE_JA@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' +check_PROGRAMS += test-mbrtowc + +EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc.c + +## end gnulib module mbrtowc-tests -TESTS += test-memchr -check_PROGRAMS += test-memchr -EXTRA_DIST += test-memchr.c +## begin gnulib module mbsinit-tests -## end gnulib module memchr-tests +TESTS += test-mbsinit.sh +TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' +check_PROGRAMS += test-mbsinit -## begin gnulib module memcmp-tests +EXTRA_DIST += test-mbsinit.sh test-mbsinit.c -TESTS += test-memcmp -check_PROGRAMS += test-memcmp -EXTRA_DIST += test-memcmp.c +## end gnulib module mbsinit-tests -## end gnulib module memcmp-tests +## begin gnulib module memchr2-tests + +TESTS += test-memchr2 +check_PROGRAMS += test-memchr2 +EXTRA_DIST += test-memchr2.c + +## end gnulib module memchr2-tests ## begin gnulib module open-tests @@ -366,6 +427,28 @@ EXTRA_DIST += test-open.c ## end gnulib module open-tests +## begin gnulib module posix_spawnp-tests + +if POSIX_SPAWN_PORTED +TESTS += test-posix_spawn1 test-posix_spawn2 +check_PROGRAMS += test-posix_spawn1 test-posix_spawn2 + +BUILT_SOURCES += test-posix_spawn1.sh +test-posix_spawn1.sh: test-posix_spawn1.in.sh + cp $(srcdir)/test-posix_spawn1.in.sh $@-t + mv $@-t $@ +MOSTLYCLEANFILES += test-posix_spawn1.sh test-posix_spawn1.sh-t + +BUILT_SOURCES += test-posix_spawn2.sh +test-posix_spawn2.sh: test-posix_spawn2.in.sh + cp $(srcdir)/test-posix_spawn2.in.sh $@-t + mv $@-t $@ +MOSTLYCLEANFILES += test-posix_spawn2.sh test-posix_spawn2.sh-t +endif +EXTRA_DIST += test-posix_spawn1.c test-posix_spawn1.in.sh test-posix_spawn2.c test-posix_spawn2.in.sh + +## end gnulib module posix_spawnp-tests + ## begin gnulib module printf-frexp-tests TESTS += test-printf-frexp @@ -386,13 +469,39 @@ EXTRA_DIST += test-printf-frexpl.c ## begin gnulib module quotearg-tests -TESTS += test-quotearg +TESTS += test-quotearg.sh +TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='$(srcdir)' LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' check_PROGRAMS += test-quotearg test_quotearg_LDADD = $(LDADD) @LIBINTL@ -EXTRA_DIST += test-quotearg.c +EXTRA_DIST += test-quotearg.sh test-quotearg.c locale/fr/LC_MESSAGES/test-quotearg.po locale/fr/LC_MESSAGES/test-quotearg.mo ## end gnulib module quotearg-tests +## begin gnulib module rawmemchr-tests + +TESTS += test-rawmemchr +check_PROGRAMS += test-rawmemchr +EXTRA_DIST += test-rawmemchr.c + +## end gnulib module rawmemchr-tests + +## begin gnulib module sched-tests + +TESTS += test-sched +check_PROGRAMS += test-sched +EXTRA_DIST += test-sched.c + +## end gnulib module sched-tests + +## begin gnulib module setenv + + +EXTRA_DIST += setenv.c + +EXTRA_libtests_a_SOURCES += setenv.c + +## end gnulib module setenv + ## begin gnulib module sigaction-tests TESTS += test-sigaction @@ -401,6 +510,15 @@ EXTRA_DIST += test-sigaction.c ## end gnulib module sigaction-tests +## begin gnulib module signal-tests + +TESTS += test-signal +check_PROGRAMS += test-signal + +EXTRA_DIST += test-signal.c + +## end gnulib module signal-tests + ## begin gnulib module signbit-tests TESTS += test-signbit @@ -455,14 +573,13 @@ EXTRA_DIST += test-stdlib.c ## end gnulib module stdlib-tests -## begin gnulib module strdup - - -EXTRA_DIST += strdup.c +## begin gnulib module strchrnul-tests -EXTRA_libtests_a_SOURCES += strdup.c +TESTS += test-strchrnul +check_PROGRAMS += test-strchrnul +EXTRA_DIST += test-strchrnul.c -## end gnulib module strdup +## end gnulib module strchrnul-tests ## begin gnulib module strerror-tests @@ -526,22 +643,6 @@ EXTRA_DIST += test-sys_time.c ## end gnulib module sys_time-tests -## begin gnulib module thread - -libtests_a_SOURCES += glthread/thread.h glthread/thread.c - -## end gnulib module thread - -## begin gnulib module tls-tests - -TESTS += test-tls -check_PROGRAMS += test-tls -test_tls_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@ - -EXTRA_DIST += test-tls.c - -## end gnulib module tls-tests - ## begin gnulib module unistd-tests TESTS += test-unistd @@ -551,6 +652,15 @@ EXTRA_DIST += test-unistd.c ## end gnulib module unistd-tests +## begin gnulib module unsetenv + + +EXTRA_DIST += unsetenv.c + +EXTRA_libtests_a_SOURCES += unsetenv.c + +## end gnulib module unsetenv + ## begin gnulib module vasnprintf-tests TESTS += test-vasnprintf @@ -578,12 +688,6 @@ EXTRA_DIST += test-vasprintf.c ## end gnulib module vasprintf-tests -## begin gnulib module verify - -libtests_a_SOURCES += verify.h - -## end gnulib module verify - ## begin gnulib module wchar-tests TESTS += test-wchar @@ -593,6 +697,30 @@ EXTRA_DIST += test-wchar.c ## end gnulib module wchar-tests +## begin gnulib module wcrtomb-tests + +TESTS += test-wcrtomb.sh +TESTS_ENVIRONMENT += \ + EXEEXT='@EXEEXT@' \ + LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_JA='@LOCALE_JA@' \ + LOCALE_ZH_CN='@LOCALE_ZH_CN@' +check_PROGRAMS += test-wcrtomb + +EXTRA_DIST += test-wcrtomb.sh test-wcrtomb.c + +## end gnulib module wcrtomb-tests + +## begin gnulib module wctob + + +EXTRA_DIST += wctob.c + +EXTRA_libtests_a_SOURCES += wctob.c + +## end gnulib module wctob + ## begin gnulib module wctype-tests TESTS += test-wctype @@ -612,12 +740,6 @@ EXTRA_DIST += test-xvasprintf.c ## end gnulib module xvasprintf-tests -## begin gnulib module yield - -libtests_a_SOURCES += glthread/yield.h - -## end gnulib module yield - # Clean up after Solaris cc. clean-local: rm -rf SunWS_cache diff -ruNp m4-1.4.12/tests/Makefile.in m4-1.4.13/tests/Makefile.in --- m4-1.4.12/tests/Makefile.in 2008-10-10 21:03:09.000000000 -0600 +++ m4-1.4.13/tests/Makefile.in 2009-03-31 20:11:44.000000000 -0600 @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10b from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +15,7 @@ @SET_MAKE@ -# Copyright (C) 2002-2008 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -28,8 +29,9 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -46,71 +48,91 @@ build_triplet = @build@ host_triplet = @host@ TESTS = test-alloca-opt$(EXEEXT) test-array_list$(EXEEXT) \ test-array_oset$(EXEEXT) test-avltree_oset$(EXEEXT) \ - test-binary-io.sh test-c-ctype$(EXEEXT) test-c-stack.sh \ - test-c-stack2.sh test-closein.sh test-dirname$(EXEEXT) \ + test-binary-io.sh test-btowc1.sh test-btowc2.sh \ + test-c-ctype$(EXEEXT) test-c-stack.sh test-c-stack2.sh \ + test-closein.sh test-dirname$(EXEEXT) test-environ$(EXEEXT) \ test-errno$(EXEEXT) test-fcntl$(EXEEXT) test-fflush$(EXEEXT) \ test-fflush2.sh test-filenamecat$(EXEEXT) test-fopen$(EXEEXT) \ test-fpending.sh test-fpurge$(EXEEXT) test-freadahead.sh \ - test-freading$(EXEEXT) test-frexp$(EXEEXT) \ - test-frexpl$(EXEEXT) test-fseeko.sh test-ftello.sh \ + test-freading$(EXEEXT) test-frexp-nolibm$(EXEEXT) \ + test-frexpl-nolibm$(EXEEXT) test-fseeko.sh test-fseeko2.sh \ + test-ftello.sh test-ftello2.sh test-getdtablesize$(EXEEXT) \ test-gettimeofday$(EXEEXT) test-isnand-nolibm$(EXEEXT) \ test-isnanf-nolibm$(EXEEXT) test-isnanl-nolibm$(EXEEXT) \ - test-linkedhash_list$(EXEEXT) test-lock$(EXEEXT) test-lseek.sh \ - test-malloca$(EXEEXT) test-math$(EXEEXT) test-memchr$(EXEEXT) \ - test-memcmp$(EXEEXT) test-open$(EXEEXT) \ - test-printf-frexp$(EXEEXT) test-printf-frexpl$(EXEEXT) \ - test-quotearg$(EXEEXT) test-sigaction$(EXEEXT) \ + test-linkedhash_list$(EXEEXT) test-lseek.sh \ + test-lstat$(EXEEXT) test-malloca$(EXEEXT) test-math$(EXEEXT) \ + test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh \ + test-mbrtowc4.sh test-mbsinit.sh test-memchr2$(EXEEXT) \ + test-open$(EXEEXT) $(am__EXEEXT_1) test-printf-frexp$(EXEEXT) \ + test-printf-frexpl$(EXEEXT) test-quotearg.sh \ + test-rawmemchr$(EXEEXT) test-sched$(EXEEXT) \ + test-sigaction$(EXEEXT) test-signal$(EXEEXT) \ test-signbit$(EXEEXT) test-snprintf$(EXEEXT) \ test-stdbool$(EXEEXT) test-stdint$(EXEEXT) test-stdio$(EXEEXT) \ - test-stdlib$(EXEEXT) test-strerror$(EXEEXT) \ - test-string$(EXEEXT) test-strsignal$(EXEEXT) \ - test-strstr$(EXEEXT) test-strtod$(EXEEXT) \ - test-sys_stat$(EXEEXT) test-sys_time$(EXEEXT) \ - test-tls$(EXEEXT) test-unistd$(EXEEXT) \ + test-stdlib$(EXEEXT) test-strchrnul$(EXEEXT) \ + test-strerror$(EXEEXT) test-string$(EXEEXT) \ + test-strsignal$(EXEEXT) test-strstr$(EXEEXT) \ + test-strtod$(EXEEXT) test-sys_stat$(EXEEXT) \ + test-sys_time$(EXEEXT) test-unistd$(EXEEXT) \ test-vasnprintf$(EXEEXT) test-vasprintf-posix$(EXEEXT) \ - test-vasprintf$(EXEEXT) test-wchar$(EXEEXT) \ + test-vasprintf$(EXEEXT) test-wchar$(EXEEXT) test-wcrtomb.sh \ test-wctype$(EXEEXT) test-xvasprintf$(EXEEXT) noinst_PROGRAMS = check_PROGRAMS = test-alloca-opt$(EXEEXT) test-array_list$(EXEEXT) \ test-array_oset$(EXEEXT) test-avltree_oset$(EXEEXT) \ - test-binary-io$(EXEEXT) test-c-ctype$(EXEEXT) \ - test-c-stack$(EXEEXT) test-closein$(EXEEXT) \ - test-dirname$(EXEEXT) test-errno$(EXEEXT) test-fcntl$(EXEEXT) \ + test-binary-io$(EXEEXT) test-btowc$(EXEEXT) \ + test-c-ctype$(EXEEXT) test-c-stack$(EXEEXT) \ + test-closein$(EXEEXT) test-dirname$(EXEEXT) \ + test-environ$(EXEEXT) test-errno$(EXEEXT) test-fcntl$(EXEEXT) \ test-fflush$(EXEEXT) test-fflush2$(EXEEXT) \ test-filenamecat$(EXEEXT) test-fopen$(EXEEXT) \ test-fpending$(EXEEXT) test-fpurge$(EXEEXT) \ test-freadahead$(EXEEXT) test-freading$(EXEEXT) \ - test-frexp$(EXEEXT) test-frexpl$(EXEEXT) test-fseeko$(EXEEXT) \ - test-ftello$(EXEEXT) test-gettimeofday$(EXEEXT) \ + test-frexp-nolibm$(EXEEXT) test-frexpl-nolibm$(EXEEXT) \ + test-fseeko$(EXEEXT) test-ftello$(EXEEXT) \ + test-getdtablesize$(EXEEXT) test-gettimeofday$(EXEEXT) \ test-isnand-nolibm$(EXEEXT) test-isnanf-nolibm$(EXEEXT) \ test-isnanl-nolibm$(EXEEXT) test-linkedhash_list$(EXEEXT) \ - test-lock$(EXEEXT) test-lseek$(EXEEXT) test-malloca$(EXEEXT) \ - test-math$(EXEEXT) test-memchr$(EXEEXT) test-memcmp$(EXEEXT) \ - test-open$(EXEEXT) test-printf-frexp$(EXEEXT) \ - test-printf-frexpl$(EXEEXT) test-quotearg$(EXEEXT) \ - test-sigaction$(EXEEXT) test-signbit$(EXEEXT) \ + test-lseek$(EXEEXT) test-lstat$(EXEEXT) test-malloca$(EXEEXT) \ + test-math$(EXEEXT) test-mbrtowc$(EXEEXT) test-mbsinit$(EXEEXT) \ + test-memchr2$(EXEEXT) test-open$(EXEEXT) $(am__EXEEXT_1) \ + test-printf-frexp$(EXEEXT) test-printf-frexpl$(EXEEXT) \ + test-quotearg$(EXEEXT) test-rawmemchr$(EXEEXT) \ + test-sched$(EXEEXT) test-sigaction$(EXEEXT) \ + test-signal$(EXEEXT) test-signbit$(EXEEXT) \ test-snprintf$(EXEEXT) test-stdbool$(EXEEXT) \ test-stdint$(EXEEXT) test-stdio$(EXEEXT) test-stdlib$(EXEEXT) \ - test-strerror$(EXEEXT) test-string$(EXEEXT) \ - test-strsignal$(EXEEXT) test-strstr$(EXEEXT) \ - test-strtod$(EXEEXT) test-sys_stat$(EXEEXT) \ - test-sys_time$(EXEEXT) test-tls$(EXEEXT) test-unistd$(EXEEXT) \ - test-vasnprintf$(EXEEXT) test-vasprintf-posix$(EXEEXT) \ - test-vasprintf$(EXEEXT) test-wchar$(EXEEXT) \ - test-wctype$(EXEEXT) test-xvasprintf$(EXEEXT) + test-strchrnul$(EXEEXT) test-strerror$(EXEEXT) \ + test-string$(EXEEXT) test-strsignal$(EXEEXT) \ + test-strstr$(EXEEXT) test-strtod$(EXEEXT) \ + test-sys_stat$(EXEEXT) test-sys_time$(EXEEXT) \ + test-unistd$(EXEEXT) test-vasnprintf$(EXEEXT) \ + test-vasprintf-posix$(EXEEXT) test-vasprintf$(EXEEXT) \ + test-wchar$(EXEEXT) test-wcrtomb$(EXEEXT) test-wctype$(EXEEXT) \ + test-xvasprintf$(EXEEXT) +@POSIX_SPAWN_PORTED_TRUE@am__append_1 = test-posix_spawn1 test-posix_spawn2 +@POSIX_SPAWN_PORTED_TRUE@am__append_2 = test-posix_spawn1 test-posix_spawn2 +@POSIX_SPAWN_PORTED_TRUE@am__append_3 = test-posix_spawn1.sh \ +@POSIX_SPAWN_PORTED_TRUE@ test-posix_spawn2.sh +@POSIX_SPAWN_PORTED_TRUE@am__append_4 = test-posix_spawn1.sh \ +@POSIX_SPAWN_PORTED_TRUE@ test-posix_spawn1.sh-t \ +@POSIX_SPAWN_PORTED_TRUE@ test-posix_spawn2.sh \ +@POSIX_SPAWN_PORTED_TRUE@ test-posix_spawn2.sh-t subdir = tests DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/autobuild.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/assert.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-stack.m4 $(top_srcdir)/m4/cloexec.m4 \ $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/dirname.m4 \ $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \ $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl_h.m4 \ @@ -120,7 +142,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \ $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ $(top_srcdir)/m4/fseeko.m4 $(top_srcdir)/m4/ftello.m4 \ - $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/glibc21.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ @@ -130,56 +153,72 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/lock.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lseek.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ + $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memset.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ - $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/open.m4 \ - $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/posix_spawn.m4 \ + $(top_srcdir)/m4/printf-frexp.m4 \ $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ - $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/regex.m4 \ - $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \ - $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/rawmemchr.m4 \ + $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sched_h.m4 \ + $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ + $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/snprintf.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-safer.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib-safer.m4 \ - $(top_srcdir)/m4/stdlib_h.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/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \ - $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ - $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/thread.m4 \ - $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/tls.m4 \ - $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/spawn_h.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-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strchrnul.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/strsignal.m4 \ + $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtod.m4 \ + $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \ + $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \ + $(top_srcdir)/m4/tls.m4 $(top_srcdir)/m4/tmpdir.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unistd-safer.m4 \ $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \ $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf-posix.m4 \ - $(top_srcdir)/m4/vasprintf.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/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yield.m4 \ + $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wait-process.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ + $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru +AM_V_AR = $(am__v_AR_$(V)) +am__v_AR_ = @echo " AR " $@; +am__v_AR_0 = @echo " AR " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = @ +am__v_at_0 = @ libtests_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = am_libtests_a_OBJECTS = gl_array_list.$(OBJEXT) \ - gl_array_oset.$(OBJEXT) thread.$(OBJEXT) + gl_array_oset.$(OBJEXT) libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) +@POSIX_SPAWN_PORTED_TRUE@am__EXEEXT_1 = test-posix_spawn1$(EXEEXT) \ +@POSIX_SPAWN_PORTED_TRUE@ test-posix_spawn2$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) test_alloca_opt_SOURCES = test-alloca-opt.c test_alloca_opt_OBJECTS = test-alloca-opt.$(OBJEXT) @@ -202,6 +241,11 @@ test_binary_io_OBJECTS = test-binary-io. test_binary_io_LDADD = $(LDADD) test_binary_io_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) +test_btowc_SOURCES = test-btowc.c +test_btowc_OBJECTS = test-btowc.$(OBJEXT) +test_btowc_LDADD = $(LDADD) +test_btowc_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) test_c_ctype_SOURCES = test-c-ctype.c test_c_ctype_OBJECTS = test-c-ctype.$(OBJEXT) test_c_ctype_LDADD = $(LDADD) @@ -217,6 +261,11 @@ test_closein_DEPENDENCIES = $(am__DEPEND test_dirname_SOURCES = test-dirname.c test_dirname_OBJECTS = test-dirname.$(OBJEXT) test_dirname_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_environ_SOURCES = test-environ.c +test_environ_OBJECTS = test-environ.$(OBJEXT) +test_environ_LDADD = $(LDADD) +test_environ_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) test_errno_SOURCES = test-errno.c test_errno_OBJECTS = test-errno.$(OBJEXT) test_errno_LDADD = $(LDADD) @@ -265,15 +314,15 @@ test_freading_OBJECTS = test-freading.$( test_freading_LDADD = $(LDADD) test_freading_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) -test_frexp_SOURCES = test-frexp.c -test_frexp_OBJECTS = test-frexp.$(OBJEXT) -test_frexp_LDADD = $(LDADD) -test_frexp_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ - $(am__DEPENDENCIES_1) -test_frexpl_SOURCES = test-frexpl.c -test_frexpl_OBJECTS = test-frexpl.$(OBJEXT) -test_frexpl_LDADD = $(LDADD) -test_frexpl_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ +am_test_frexp_nolibm_OBJECTS = test-frexp.$(OBJEXT) +test_frexp_nolibm_OBJECTS = $(am_test_frexp_nolibm_OBJECTS) +test_frexp_nolibm_LDADD = $(LDADD) +test_frexp_nolibm_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) +am_test_frexpl_nolibm_OBJECTS = test-frexpl.$(OBJEXT) +test_frexpl_nolibm_OBJECTS = $(am_test_frexpl_nolibm_OBJECTS) +test_frexpl_nolibm_LDADD = $(LDADD) +test_frexpl_nolibm_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) test_fseeko_SOURCES = test-fseeko.c test_fseeko_OBJECTS = test-fseeko.$(OBJEXT) @@ -285,6 +334,11 @@ test_ftello_OBJECTS = test-ftello.$(OBJE test_ftello_LDADD = $(LDADD) test_ftello_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) +test_getdtablesize_SOURCES = test-getdtablesize.c +test_getdtablesize_OBJECTS = test-getdtablesize.$(OBJEXT) +test_getdtablesize_LDADD = $(LDADD) +test_getdtablesize_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) test_gettimeofday_SOURCES = test-gettimeofday.c test_gettimeofday_OBJECTS = test-gettimeofday.$(OBJEXT) test_gettimeofday_LDADD = $(LDADD) @@ -308,14 +362,16 @@ test_isnanl_nolibm_DEPENDENCIES = libtes test_linkedhash_list_SOURCES = test-linkedhash_list.c test_linkedhash_list_OBJECTS = test-linkedhash_list.$(OBJEXT) test_linkedhash_list_DEPENDENCIES = $(am__DEPENDENCIES_2) -test_lock_SOURCES = test-lock.c -test_lock_OBJECTS = test-lock.$(OBJEXT) -test_lock_DEPENDENCIES = $(am__DEPENDENCIES_2) test_lseek_SOURCES = test-lseek.c test_lseek_OBJECTS = test-lseek.$(OBJEXT) test_lseek_LDADD = $(LDADD) test_lseek_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) +test_lstat_SOURCES = test-lstat.c +test_lstat_OBJECTS = test-lstat.$(OBJEXT) +test_lstat_LDADD = $(LDADD) +test_lstat_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) test_malloca_SOURCES = test-malloca.c test_malloca_OBJECTS = test-malloca.$(OBJEXT) test_malloca_LDADD = $(LDADD) @@ -326,21 +382,36 @@ test_math_OBJECTS = test-math.$(OBJEXT) test_math_LDADD = $(LDADD) test_math_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) -test_memchr_SOURCES = test-memchr.c -test_memchr_OBJECTS = test-memchr.$(OBJEXT) -test_memchr_LDADD = $(LDADD) -test_memchr_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ - $(am__DEPENDENCIES_1) -test_memcmp_SOURCES = test-memcmp.c -test_memcmp_OBJECTS = test-memcmp.$(OBJEXT) -test_memcmp_LDADD = $(LDADD) -test_memcmp_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ +test_mbrtowc_SOURCES = test-mbrtowc.c +test_mbrtowc_OBJECTS = test-mbrtowc.$(OBJEXT) +test_mbrtowc_LDADD = $(LDADD) +test_mbrtowc_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) +test_mbsinit_SOURCES = test-mbsinit.c +test_mbsinit_OBJECTS = test-mbsinit.$(OBJEXT) +test_mbsinit_LDADD = $(LDADD) +test_mbsinit_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) +test_memchr2_SOURCES = test-memchr2.c +test_memchr2_OBJECTS = test-memchr2.$(OBJEXT) +test_memchr2_LDADD = $(LDADD) +test_memchr2_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) test_open_SOURCES = test-open.c test_open_OBJECTS = test-open.$(OBJEXT) test_open_LDADD = $(LDADD) test_open_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) +test_posix_spawn1_SOURCES = test-posix_spawn1.c +test_posix_spawn1_OBJECTS = test-posix_spawn1.$(OBJEXT) +test_posix_spawn1_LDADD = $(LDADD) +test_posix_spawn1_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) +test_posix_spawn2_SOURCES = test-posix_spawn2.c +test_posix_spawn2_OBJECTS = test-posix_spawn2.$(OBJEXT) +test_posix_spawn2_LDADD = $(LDADD) +test_posix_spawn2_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) test_printf_frexp_SOURCES = test-printf-frexp.c test_printf_frexp_OBJECTS = test-printf-frexp.$(OBJEXT) test_printf_frexp_LDADD = $(LDADD) @@ -354,11 +425,26 @@ test_printf_frexpl_DEPENDENCIES = libtes test_quotearg_SOURCES = test-quotearg.c test_quotearg_OBJECTS = test-quotearg.$(OBJEXT) test_quotearg_DEPENDENCIES = $(am__DEPENDENCIES_2) +test_rawmemchr_SOURCES = test-rawmemchr.c +test_rawmemchr_OBJECTS = test-rawmemchr.$(OBJEXT) +test_rawmemchr_LDADD = $(LDADD) +test_rawmemchr_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) +test_sched_SOURCES = test-sched.c +test_sched_OBJECTS = test-sched.$(OBJEXT) +test_sched_LDADD = $(LDADD) +test_sched_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) test_sigaction_SOURCES = test-sigaction.c test_sigaction_OBJECTS = test-sigaction.$(OBJEXT) test_sigaction_LDADD = $(LDADD) test_sigaction_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) +test_signal_SOURCES = test-signal.c +test_signal_OBJECTS = test-signal.$(OBJEXT) +test_signal_LDADD = $(LDADD) +test_signal_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) test_signbit_SOURCES = test-signbit.c test_signbit_OBJECTS = test-signbit.$(OBJEXT) test_signbit_LDADD = $(LDADD) @@ -389,6 +475,11 @@ test_stdlib_OBJECTS = test-stdlib.$(OBJE test_stdlib_LDADD = $(LDADD) test_stdlib_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) +test_strchrnul_SOURCES = test-strchrnul.c +test_strchrnul_OBJECTS = test-strchrnul.$(OBJEXT) +test_strchrnul_LDADD = $(LDADD) +test_strchrnul_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) test_strerror_SOURCES = test-strerror.c test_strerror_OBJECTS = test-strerror.$(OBJEXT) test_strerror_LDADD = $(LDADD) @@ -422,9 +513,6 @@ test_sys_time_OBJECTS = test-sys_time.$( test_sys_time_LDADD = $(LDADD) test_sys_time_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) -test_tls_SOURCES = test-tls.c -test_tls_OBJECTS = test-tls.$(OBJEXT) -test_tls_DEPENDENCIES = $(am__DEPENDENCIES_2) test_unistd_SOURCES = test-unistd.c test_unistd_OBJECTS = test-unistd.$(OBJEXT) test_unistd_LDADD = $(LDADD) @@ -450,6 +538,11 @@ test_wchar_OBJECTS = test-wchar.$(OBJEXT test_wchar_LDADD = $(LDADD) test_wchar_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ $(am__DEPENDENCIES_1) +test_wcrtomb_SOURCES = test-wcrtomb.c +test_wcrtomb_OBJECTS = test-wcrtomb.$(OBJEXT) +test_wcrtomb_LDADD = $(LDADD) +test_wcrtomb_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \ + $(am__DEPENDENCIES_1) test_wctype_SOURCES = test-wctype.c test_wctype_OBJECTS = test-wctype.$(OBJEXT) test_wctype_LDADD = $(LDADD) @@ -461,46 +554,62 @@ test_xvasprintf_DEPENDENCIES = $(am__DEP DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = @echo " CC " $@; +am__v_CC_0 = @echo " CC " $@; CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = @echo " CCLD " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ test-alloca-opt.c test-array_list.c test-array_oset.c \ - test-avltree_oset.c test-binary-io.c test-c-ctype.c \ - test-c-stack.c test-closein.c test-dirname.c test-errno.c \ - test-fcntl.c test-fflush.c test-fflush2.c test-filenamecat.c \ - test-fopen.c test-fpending.c test-fpurge.c test-freadahead.c \ - test-freading.c test-frexp.c test-frexpl.c test-fseeko.c \ - test-ftello.c test-gettimeofday.c test-isnand-nolibm.c \ - test-isnanf-nolibm.c test-isnanl-nolibm.c \ - test-linkedhash_list.c test-lock.c test-lseek.c test-malloca.c \ - test-math.c test-memchr.c test-memcmp.c test-open.c \ - test-printf-frexp.c test-printf-frexpl.c test-quotearg.c \ - test-sigaction.c test-signbit.c test-snprintf.c test-stdbool.c \ - test-stdint.c test-stdio.c test-stdlib.c test-strerror.c \ - test-string.c test-strsignal.c test-strstr.c test-strtod.c \ - test-sys_stat.c test-sys_time.c test-tls.c test-unistd.c \ + test-avltree_oset.c test-binary-io.c test-btowc.c \ + test-c-ctype.c test-c-stack.c test-closein.c test-dirname.c \ + test-environ.c test-errno.c test-fcntl.c test-fflush.c \ + test-fflush2.c test-filenamecat.c test-fopen.c test-fpending.c \ + test-fpurge.c test-freadahead.c test-freading.c \ + $(test_frexp_nolibm_SOURCES) $(test_frexpl_nolibm_SOURCES) \ + test-fseeko.c test-ftello.c test-getdtablesize.c \ + test-gettimeofday.c test-isnand-nolibm.c test-isnanf-nolibm.c \ + test-isnanl-nolibm.c test-linkedhash_list.c test-lseek.c \ + test-lstat.c test-malloca.c test-math.c test-mbrtowc.c \ + test-mbsinit.c test-memchr2.c test-open.c test-posix_spawn1.c \ + test-posix_spawn2.c test-printf-frexp.c test-printf-frexpl.c \ + test-quotearg.c test-rawmemchr.c test-sched.c test-sigaction.c \ + test-signal.c test-signbit.c test-snprintf.c test-stdbool.c \ + test-stdint.c test-stdio.c test-stdlib.c test-strchrnul.c \ + test-strerror.c test-string.c test-strsignal.c test-strstr.c \ + test-strtod.c test-sys_stat.c test-sys_time.c test-unistd.c \ test-vasnprintf.c test-vasprintf.c test-vasprintf-posix.c \ - test-wchar.c test-wctype.c test-xvasprintf.c + test-wchar.c test-wcrtomb.c test-wctype.c test-xvasprintf.c DIST_SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \ test-alloca-opt.c test-array_list.c test-array_oset.c \ - test-avltree_oset.c test-binary-io.c test-c-ctype.c \ - test-c-stack.c test-closein.c test-dirname.c test-errno.c \ - test-fcntl.c test-fflush.c test-fflush2.c test-filenamecat.c \ - test-fopen.c test-fpending.c test-fpurge.c test-freadahead.c \ - test-freading.c test-frexp.c test-frexpl.c test-fseeko.c \ - test-ftello.c test-gettimeofday.c test-isnand-nolibm.c \ - test-isnanf-nolibm.c test-isnanl-nolibm.c \ - test-linkedhash_list.c test-lock.c test-lseek.c test-malloca.c \ - test-math.c test-memchr.c test-memcmp.c test-open.c \ - test-printf-frexp.c test-printf-frexpl.c test-quotearg.c \ - test-sigaction.c test-signbit.c test-snprintf.c test-stdbool.c \ - test-stdint.c test-stdio.c test-stdlib.c test-strerror.c \ - test-string.c test-strsignal.c test-strstr.c test-strtod.c \ - test-sys_stat.c test-sys_time.c test-tls.c test-unistd.c \ + test-avltree_oset.c test-binary-io.c test-btowc.c \ + test-c-ctype.c test-c-stack.c test-closein.c test-dirname.c \ + test-environ.c test-errno.c test-fcntl.c test-fflush.c \ + test-fflush2.c test-filenamecat.c test-fopen.c test-fpending.c \ + test-fpurge.c test-freadahead.c test-freading.c \ + $(test_frexp_nolibm_SOURCES) $(test_frexpl_nolibm_SOURCES) \ + test-fseeko.c test-ftello.c test-getdtablesize.c \ + test-gettimeofday.c test-isnand-nolibm.c test-isnanf-nolibm.c \ + test-isnanl-nolibm.c test-linkedhash_list.c test-lseek.c \ + test-lstat.c test-malloca.c test-math.c test-mbrtowc.c \ + test-mbsinit.c test-memchr2.c test-open.c test-posix_spawn1.c \ + test-posix_spawn2.c test-printf-frexp.c test-printf-frexpl.c \ + test-quotearg.c test-rawmemchr.c test-sched.c test-sigaction.c \ + test-signal.c test-signbit.c test-snprintf.c test-stdbool.c \ + test-stdint.c test-stdio.c test-stdlib.c test-strchrnul.c \ + test-strerror.c test-string.c test-strsignal.c test-strstr.c \ + test-strtod.c test-sys_stat.c test-sys_time.c test-unistd.c \ test-vasnprintf.c test-vasprintf.c test-vasprintf-posix.c \ - test-wchar.c test-wctype.c test-xvasprintf.c + test-wchar.c test-wcrtomb.c test-wctype.c test-xvasprintf.c RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ @@ -511,14 +620,45 @@ RECURSIVE_TARGETS = all-recursive check- HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir ETAGS = etags CTAGS = ctags +am__tty_colors = \ +red=; grn=; lgn=; blu=; std= DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -552,14 +692,19 @@ FCNTL_H = @FCNTL_H@ FLOAT_H = @FLOAT_H@ GETOPT_H = @GETOPT_H@ GLIBC21 = @GLIBC21@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ @@ -580,29 +725,44 @@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_FWRITE = @GNULIB_FWRITE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ GNULIB_ISINF = @GNULIB_ISINF@ GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -616,12 +776,34 @@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ +GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ +GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ +GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ +GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ +GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ +GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ +GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ +GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ +GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ +GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ +GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ GNULIB_PUTC = @GNULIB_PUTC@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ @@ -652,6 +834,8 @@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ @@ -659,15 +843,22 @@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ @@ -678,6 +869,7 @@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ @@ -697,28 +889,48 @@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCHED_H = @HAVE_SCHED_H@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGACTION = @HAVE_SIGACTION@ HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ @@ -727,6 +939,7 @@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SIGSET_T = @HAVE_SIGSET_T@ HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_SPAWN_H = @HAVE_SPAWN_H@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ @@ -736,23 +949,34 @@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -772,6 +996,10 @@ LIBSIGSEGV = @LIBSIGSEGV@ LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIBTHREAD = @LIBTHREAD@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBCSTACK = @LTLIBCSTACK@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -789,7 +1017,9 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_SCHED_H = @NEXT_SCHED_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_SPAWN_H = @NEXT_SPAWN_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ @@ -797,6 +1027,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ @@ -806,17 +1037,21 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -841,6 +1076,13 @@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ @@ -848,6 +1090,7 @@ REPLACE_NAN = @REPLACE_NAN@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ REPLACE_OPEN = @REPLACE_OPEN@ REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -866,22 +1109,29 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TRUNCL = @REPLACE_TRUNCL@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ +SCHED_H = @SCHED_H@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SPAWN_H = @SPAWN_H@ STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +SYS_WAIT_H = @SYS_WAIT_H@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ @@ -889,7 +1139,6 @@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ -YIELD_LIB = @YIELD_LIB@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -943,55 +1192,79 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.5 foreign SUBDIRS = TESTS_ENVIRONMENT = EXEEXT='@EXEEXT@' EXEEXT='@EXEEXT@' \ - LIBSIGSEGV='@LIBSIGSEGV@' EXEEXT='@EXEEXT@' EXEEXT='@EXEEXT@' \ - srcdir='$(srcdir)' EXEEXT='@EXEEXT@' EXEEXT='@EXEEXT@' \ + LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + EXEEXT='@EXEEXT@' LIBSIGSEGV='@LIBSIGSEGV@' EXEEXT='@EXEEXT@' \ + EXEEXT='@EXEEXT@' srcdir='$(srcdir)' EXEEXT='@EXEEXT@' \ + EXEEXT='@EXEEXT@' srcdir='$(srcdir)' EXEEXT='@EXEEXT@' \ srcdir='$(srcdir)' EXEEXT='@EXEEXT@' srcdir='$(srcdir)' \ EXEEXT='@EXEEXT@' srcdir='$(srcdir)' EXEEXT='@EXEEXT@' \ - srcdir='$(srcdir)' + LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_JA='@LOCALE_JA@' LOCALE_ZH_CN='@LOCALE_ZH_CN@' \ + EXEEXT='@EXEEXT@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + EXEEXT='@EXEEXT@' srcdir='$(srcdir)' LOCALE_FR='@LOCALE_FR@' \ + LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' EXEEXT='@EXEEXT@' \ + LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ + LOCALE_JA='@LOCALE_JA@' LOCALE_ZH_CN='@LOCALE_ZH_CN@' noinst_HEADERS = noinst_LIBRARIES = check_LIBRARIES = libtests.a EXTRA_DIST = test-alloca-opt.c test-array_list.c test-array_oset.c \ test-avltree_oset.c test-binary-io.sh test-binary-io.c \ - test-c-ctype.c test-c-stack.c test-c-stack.sh test-c-stack2.sh \ - test-closein.sh test-closein.c test-dirname.c test-errno.c \ - test-fcntl.c test-fflush.c test-fflush2.sh test-fflush2.c \ - test-filenamecat.c test-fopen.c test-fpending.c \ + test-btowc1.sh test-btowc2.sh test-btowc.c test-c-ctype.c \ + test-c-stack.c test-c-stack.sh test-c-stack2.sh \ + test-closein.sh test-closein.c test-dirname.c test-environ.c \ + test-errno.c test-fcntl.c test-fflush.c test-fflush2.sh \ + test-fflush2.c test-filenamecat.c test-fopen.c test-fpending.c \ test-fpending.sh test-fpurge.c test-freadahead.c \ test-freadahead.sh test-freading.c test-frexp.c test-frexpl.c \ - test-fseeko.c test-fseeko.sh test-ftello.c test-ftello.sh \ - test-gettimeofday.c test-isnand-nolibm.c test-isnand.h nan.h \ - test-isnanf-nolibm.c test-isnanf.h nan.h test-isnanl-nolibm.c \ - test-isnanl.h test-linkedhash_list.c test-lock.c test-lseek.c \ - test-lseek.sh test-malloca.c test-math.c test-memchr.c \ - test-memcmp.c test-open.c test-printf-frexp.c \ - test-printf-frexpl.c test-quotearg.c test-sigaction.c \ + test-fseeko.c test-fseeko.sh test-fseeko2.sh test-ftello.c \ + test-ftello.sh test-ftello2.sh test-getdtablesize.c \ + $(top_srcdir)/build-aux/config.rpath test-gettimeofday.c \ + test-isnand-nolibm.c test-isnand.h nan.h test-isnanf-nolibm.c \ + test-isnanf.h nan.h test-isnanl-nolibm.c test-isnanl.h nan.h \ + test-linkedhash_list.c test-lseek.c test-lseek.sh test-lstat.c \ + test-malloca.c test-math.c test-mbrtowc1.sh test-mbrtowc2.sh \ + test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc.c \ + test-mbsinit.sh test-mbsinit.c test-memchr2.c test-open.c \ + test-posix_spawn1.c test-posix_spawn1.in.sh \ + test-posix_spawn2.c test-posix_spawn2.in.sh \ + test-printf-frexp.c test-printf-frexpl.c test-quotearg.sh \ + test-quotearg.c locale/fr/LC_MESSAGES/test-quotearg.po \ + locale/fr/LC_MESSAGES/test-quotearg.mo test-rawmemchr.c \ + test-sched.c setenv.c test-sigaction.c test-signal.c \ test-signbit.c test-snprintf.c test-stdbool.c test-stdint.c \ - test-stdio.c test-stdlib.c strdup.c test-strerror.c \ + test-stdio.c test-stdlib.c test-strchrnul.c test-strerror.c \ test-string.c test-strsignal.c test-strstr.c test-strtod.c \ - test-sys_stat.c test-sys_time.c test-tls.c test-unistd.c \ + test-sys_stat.c test-sys_time.c test-unistd.c unsetenv.c \ test-vasnprintf.c test-vasprintf-posix.c nan.h \ - test-vasprintf.c test-wchar.c test-wctype.c test-xvasprintf.c -BUILT_SOURCES = + test-vasprintf.c test-wchar.c test-wcrtomb.sh test-wcrtomb.c \ + wctob.c test-wctype.c test-xvasprintf.c +BUILT_SOURCES = $(am__append_3) SUFFIXES = MOSTLYCLEANFILES = core *.stackdump t-c-stack.tmp t-c-stack2.tmp \ - test-fflush.txt test-fpending.t t-fpurge.tmp t-freading.tmp + test-fflush.txt test-fpending.t t-fpurge.tmp t-freading.tmp \ + $(am__append_4) MOSTLYCLEANDIRS = CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = -AM_CPPFLAGS = \ - -I. -I$(srcdir) \ - -I.. -I$(srcdir)/.. \ - -I../lib -I$(srcdir)/../lib +# 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 <libintl.h> 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. -I$(srcdir) -I.. -I$(srcdir)/.. -I../lib \ + -I$(srcdir)/../lib -I$(top_builddir)/intl LDADD = libtests.a ../lib/libm4.a libtests.a $(LIBTESTS_LIBDEPS) libtests_a_SOURCES = gl_array_list.h gl_array_list.c gl_array_oset.h \ - gl_array_oset.c glthread/thread.h glthread/thread.c verify.h \ - glthread/yield.h + gl_array_oset.c libtests_a_LIBADD = $(M4tests_LIBOBJS) libtests_a_DEPENDENCIES = $(M4tests_LIBOBJS) -EXTRA_libtests_a_SOURCES = strdup.c +EXTRA_libtests_a_SOURCES = setenv.c unsetenv.c wctob.c AM_LIBTOOLFLAGS = --preserve-dup-deps test_array_list_LDADD = $(LDADD) @LIBINTL@ test_array_oset_LDADD = $(LDADD) @LIBINTL@ @@ -1000,11 +1273,11 @@ test_c_stack_LDADD = $(LDADD) $(LIBCSTAC test_closein_LDADD = $(LDADD) @LIBINTL@ test_dirname_LDADD = $(LDADD) @LIBINTL@ test_filenamecat_LDADD = $(LDADD) @LIBINTL@ +test_frexp_nolibm_SOURCES = test-frexp.c +test_frexpl_nolibm_SOURCES = test-frexpl.c test_linkedhash_list_LDADD = $(LDADD) @LIBINTL@ -test_lock_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@ test_quotearg_LDADD = $(LDADD) @LIBINTL@ test_strsignal_LDADD = $(LDADD) @LIBINTL@ -test_tls_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@ test_xvasprintf_LDADD = $(LDADD) @LIBINTL@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -1015,14 +1288,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign tests/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --silent-rules tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign --silent-rules tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -1040,6 +1313,7 @@ $(top_srcdir)/configure: $(am__configur cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): clean-checkLIBRARIES: -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) @@ -1047,9 +1321,9 @@ clean-checkLIBRARIES: clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) - -rm -f libtests.a - $(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) - $(RANLIB) libtests.a + $(AM_V_at)-rm -f libtests.a + $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) + $(AM_V_at)$(RANLIB) libtests.a clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) @@ -1058,184 +1332,214 @@ clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) test-alloca-opt$(EXEEXT): $(test_alloca_opt_OBJECTS) $(test_alloca_opt_DEPENDENCIES) @rm -f test-alloca-opt$(EXEEXT) - $(LINK) $(test_alloca_opt_OBJECTS) $(test_alloca_opt_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_alloca_opt_OBJECTS) $(test_alloca_opt_LDADD) $(LIBS) test-array_list$(EXEEXT): $(test_array_list_OBJECTS) $(test_array_list_DEPENDENCIES) @rm -f test-array_list$(EXEEXT) - $(LINK) $(test_array_list_OBJECTS) $(test_array_list_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_array_list_OBJECTS) $(test_array_list_LDADD) $(LIBS) test-array_oset$(EXEEXT): $(test_array_oset_OBJECTS) $(test_array_oset_DEPENDENCIES) @rm -f test-array_oset$(EXEEXT) - $(LINK) $(test_array_oset_OBJECTS) $(test_array_oset_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_array_oset_OBJECTS) $(test_array_oset_LDADD) $(LIBS) test-avltree_oset$(EXEEXT): $(test_avltree_oset_OBJECTS) $(test_avltree_oset_DEPENDENCIES) @rm -f test-avltree_oset$(EXEEXT) - $(LINK) $(test_avltree_oset_OBJECTS) $(test_avltree_oset_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_avltree_oset_OBJECTS) $(test_avltree_oset_LDADD) $(LIBS) test-binary-io$(EXEEXT): $(test_binary_io_OBJECTS) $(test_binary_io_DEPENDENCIES) @rm -f test-binary-io$(EXEEXT) - $(LINK) $(test_binary_io_OBJECTS) $(test_binary_io_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_binary_io_OBJECTS) $(test_binary_io_LDADD) $(LIBS) +test-btowc$(EXEEXT): $(test_btowc_OBJECTS) $(test_btowc_DEPENDENCIES) + @rm -f test-btowc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_btowc_OBJECTS) $(test_btowc_LDADD) $(LIBS) test-c-ctype$(EXEEXT): $(test_c_ctype_OBJECTS) $(test_c_ctype_DEPENDENCIES) @rm -f test-c-ctype$(EXEEXT) - $(LINK) $(test_c_ctype_OBJECTS) $(test_c_ctype_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_c_ctype_OBJECTS) $(test_c_ctype_LDADD) $(LIBS) test-c-stack$(EXEEXT): $(test_c_stack_OBJECTS) $(test_c_stack_DEPENDENCIES) @rm -f test-c-stack$(EXEEXT) - $(LINK) $(test_c_stack_OBJECTS) $(test_c_stack_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_c_stack_OBJECTS) $(test_c_stack_LDADD) $(LIBS) test-closein$(EXEEXT): $(test_closein_OBJECTS) $(test_closein_DEPENDENCIES) @rm -f test-closein$(EXEEXT) - $(LINK) $(test_closein_OBJECTS) $(test_closein_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_closein_OBJECTS) $(test_closein_LDADD) $(LIBS) test-dirname$(EXEEXT): $(test_dirname_OBJECTS) $(test_dirname_DEPENDENCIES) @rm -f test-dirname$(EXEEXT) - $(LINK) $(test_dirname_OBJECTS) $(test_dirname_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_dirname_OBJECTS) $(test_dirname_LDADD) $(LIBS) +test-environ$(EXEEXT): $(test_environ_OBJECTS) $(test_environ_DEPENDENCIES) + @rm -f test-environ$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_environ_OBJECTS) $(test_environ_LDADD) $(LIBS) test-errno$(EXEEXT): $(test_errno_OBJECTS) $(test_errno_DEPENDENCIES) @rm -f test-errno$(EXEEXT) - $(LINK) $(test_errno_OBJECTS) $(test_errno_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_errno_OBJECTS) $(test_errno_LDADD) $(LIBS) test-fcntl$(EXEEXT): $(test_fcntl_OBJECTS) $(test_fcntl_DEPENDENCIES) @rm -f test-fcntl$(EXEEXT) - $(LINK) $(test_fcntl_OBJECTS) $(test_fcntl_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_fcntl_OBJECTS) $(test_fcntl_LDADD) $(LIBS) test-fflush$(EXEEXT): $(test_fflush_OBJECTS) $(test_fflush_DEPENDENCIES) @rm -f test-fflush$(EXEEXT) - $(LINK) $(test_fflush_OBJECTS) $(test_fflush_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_fflush_OBJECTS) $(test_fflush_LDADD) $(LIBS) test-fflush2$(EXEEXT): $(test_fflush2_OBJECTS) $(test_fflush2_DEPENDENCIES) @rm -f test-fflush2$(EXEEXT) - $(LINK) $(test_fflush2_OBJECTS) $(test_fflush2_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_fflush2_OBJECTS) $(test_fflush2_LDADD) $(LIBS) test-filenamecat$(EXEEXT): $(test_filenamecat_OBJECTS) $(test_filenamecat_DEPENDENCIES) @rm -f test-filenamecat$(EXEEXT) - $(LINK) $(test_filenamecat_OBJECTS) $(test_filenamecat_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_filenamecat_OBJECTS) $(test_filenamecat_LDADD) $(LIBS) test-fopen$(EXEEXT): $(test_fopen_OBJECTS) $(test_fopen_DEPENDENCIES) @rm -f test-fopen$(EXEEXT) - $(LINK) $(test_fopen_OBJECTS) $(test_fopen_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_fopen_OBJECTS) $(test_fopen_LDADD) $(LIBS) test-fpending$(EXEEXT): $(test_fpending_OBJECTS) $(test_fpending_DEPENDENCIES) @rm -f test-fpending$(EXEEXT) - $(LINK) $(test_fpending_OBJECTS) $(test_fpending_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_fpending_OBJECTS) $(test_fpending_LDADD) $(LIBS) test-fpurge$(EXEEXT): $(test_fpurge_OBJECTS) $(test_fpurge_DEPENDENCIES) @rm -f test-fpurge$(EXEEXT) - $(LINK) $(test_fpurge_OBJECTS) $(test_fpurge_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_fpurge_OBJECTS) $(test_fpurge_LDADD) $(LIBS) test-freadahead$(EXEEXT): $(test_freadahead_OBJECTS) $(test_freadahead_DEPENDENCIES) @rm -f test-freadahead$(EXEEXT) - $(LINK) $(test_freadahead_OBJECTS) $(test_freadahead_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_freadahead_OBJECTS) $(test_freadahead_LDADD) $(LIBS) test-freading$(EXEEXT): $(test_freading_OBJECTS) $(test_freading_DEPENDENCIES) @rm -f test-freading$(EXEEXT) - $(LINK) $(test_freading_OBJECTS) $(test_freading_LDADD) $(LIBS) -test-frexp$(EXEEXT): $(test_frexp_OBJECTS) $(test_frexp_DEPENDENCIES) - @rm -f test-frexp$(EXEEXT) - $(LINK) $(test_frexp_OBJECTS) $(test_frexp_LDADD) $(LIBS) -test-frexpl$(EXEEXT): $(test_frexpl_OBJECTS) $(test_frexpl_DEPENDENCIES) - @rm -f test-frexpl$(EXEEXT) - $(LINK) $(test_frexpl_OBJECTS) $(test_frexpl_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_freading_OBJECTS) $(test_freading_LDADD) $(LIBS) +test-frexp-nolibm$(EXEEXT): $(test_frexp_nolibm_OBJECTS) $(test_frexp_nolibm_DEPENDENCIES) + @rm -f test-frexp-nolibm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_frexp_nolibm_OBJECTS) $(test_frexp_nolibm_LDADD) $(LIBS) +test-frexpl-nolibm$(EXEEXT): $(test_frexpl_nolibm_OBJECTS) $(test_frexpl_nolibm_DEPENDENCIES) + @rm -f test-frexpl-nolibm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_frexpl_nolibm_OBJECTS) $(test_frexpl_nolibm_LDADD) $(LIBS) test-fseeko$(EXEEXT): $(test_fseeko_OBJECTS) $(test_fseeko_DEPENDENCIES) @rm -f test-fseeko$(EXEEXT) - $(LINK) $(test_fseeko_OBJECTS) $(test_fseeko_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_fseeko_OBJECTS) $(test_fseeko_LDADD) $(LIBS) test-ftello$(EXEEXT): $(test_ftello_OBJECTS) $(test_ftello_DEPENDENCIES) @rm -f test-ftello$(EXEEXT) - $(LINK) $(test_ftello_OBJECTS) $(test_ftello_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_ftello_OBJECTS) $(test_ftello_LDADD) $(LIBS) +test-getdtablesize$(EXEEXT): $(test_getdtablesize_OBJECTS) $(test_getdtablesize_DEPENDENCIES) + @rm -f test-getdtablesize$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_getdtablesize_OBJECTS) $(test_getdtablesize_LDADD) $(LIBS) test-gettimeofday$(EXEEXT): $(test_gettimeofday_OBJECTS) $(test_gettimeofday_DEPENDENCIES) @rm -f test-gettimeofday$(EXEEXT) - $(LINK) $(test_gettimeofday_OBJECTS) $(test_gettimeofday_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_gettimeofday_OBJECTS) $(test_gettimeofday_LDADD) $(LIBS) test-isnand-nolibm$(EXEEXT): $(test_isnand_nolibm_OBJECTS) $(test_isnand_nolibm_DEPENDENCIES) @rm -f test-isnand-nolibm$(EXEEXT) - $(LINK) $(test_isnand_nolibm_OBJECTS) $(test_isnand_nolibm_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_isnand_nolibm_OBJECTS) $(test_isnand_nolibm_LDADD) $(LIBS) test-isnanf-nolibm$(EXEEXT): $(test_isnanf_nolibm_OBJECTS) $(test_isnanf_nolibm_DEPENDENCIES) @rm -f test-isnanf-nolibm$(EXEEXT) - $(LINK) $(test_isnanf_nolibm_OBJECTS) $(test_isnanf_nolibm_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_isnanf_nolibm_OBJECTS) $(test_isnanf_nolibm_LDADD) $(LIBS) test-isnanl-nolibm$(EXEEXT): $(test_isnanl_nolibm_OBJECTS) $(test_isnanl_nolibm_DEPENDENCIES) @rm -f test-isnanl-nolibm$(EXEEXT) - $(LINK) $(test_isnanl_nolibm_OBJECTS) $(test_isnanl_nolibm_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_isnanl_nolibm_OBJECTS) $(test_isnanl_nolibm_LDADD) $(LIBS) test-linkedhash_list$(EXEEXT): $(test_linkedhash_list_OBJECTS) $(test_linkedhash_list_DEPENDENCIES) @rm -f test-linkedhash_list$(EXEEXT) - $(LINK) $(test_linkedhash_list_OBJECTS) $(test_linkedhash_list_LDADD) $(LIBS) -test-lock$(EXEEXT): $(test_lock_OBJECTS) $(test_lock_DEPENDENCIES) - @rm -f test-lock$(EXEEXT) - $(LINK) $(test_lock_OBJECTS) $(test_lock_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_linkedhash_list_OBJECTS) $(test_linkedhash_list_LDADD) $(LIBS) test-lseek$(EXEEXT): $(test_lseek_OBJECTS) $(test_lseek_DEPENDENCIES) @rm -f test-lseek$(EXEEXT) - $(LINK) $(test_lseek_OBJECTS) $(test_lseek_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_lseek_OBJECTS) $(test_lseek_LDADD) $(LIBS) +test-lstat$(EXEEXT): $(test_lstat_OBJECTS) $(test_lstat_DEPENDENCIES) + @rm -f test-lstat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_lstat_OBJECTS) $(test_lstat_LDADD) $(LIBS) test-malloca$(EXEEXT): $(test_malloca_OBJECTS) $(test_malloca_DEPENDENCIES) @rm -f test-malloca$(EXEEXT) - $(LINK) $(test_malloca_OBJECTS) $(test_malloca_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_malloca_OBJECTS) $(test_malloca_LDADD) $(LIBS) test-math$(EXEEXT): $(test_math_OBJECTS) $(test_math_DEPENDENCIES) @rm -f test-math$(EXEEXT) - $(LINK) $(test_math_OBJECTS) $(test_math_LDADD) $(LIBS) -test-memchr$(EXEEXT): $(test_memchr_OBJECTS) $(test_memchr_DEPENDENCIES) - @rm -f test-memchr$(EXEEXT) - $(LINK) $(test_memchr_OBJECTS) $(test_memchr_LDADD) $(LIBS) -test-memcmp$(EXEEXT): $(test_memcmp_OBJECTS) $(test_memcmp_DEPENDENCIES) - @rm -f test-memcmp$(EXEEXT) - $(LINK) $(test_memcmp_OBJECTS) $(test_memcmp_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_math_OBJECTS) $(test_math_LDADD) $(LIBS) +test-mbrtowc$(EXEEXT): $(test_mbrtowc_OBJECTS) $(test_mbrtowc_DEPENDENCIES) + @rm -f test-mbrtowc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbrtowc_OBJECTS) $(test_mbrtowc_LDADD) $(LIBS) +test-mbsinit$(EXEEXT): $(test_mbsinit_OBJECTS) $(test_mbsinit_DEPENDENCIES) + @rm -f test-mbsinit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_mbsinit_OBJECTS) $(test_mbsinit_LDADD) $(LIBS) +test-memchr2$(EXEEXT): $(test_memchr2_OBJECTS) $(test_memchr2_DEPENDENCIES) + @rm -f test-memchr2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_memchr2_OBJECTS) $(test_memchr2_LDADD) $(LIBS) test-open$(EXEEXT): $(test_open_OBJECTS) $(test_open_DEPENDENCIES) @rm -f test-open$(EXEEXT) - $(LINK) $(test_open_OBJECTS) $(test_open_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_open_OBJECTS) $(test_open_LDADD) $(LIBS) +test-posix_spawn1$(EXEEXT): $(test_posix_spawn1_OBJECTS) $(test_posix_spawn1_DEPENDENCIES) + @rm -f test-posix_spawn1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_posix_spawn1_OBJECTS) $(test_posix_spawn1_LDADD) $(LIBS) +test-posix_spawn2$(EXEEXT): $(test_posix_spawn2_OBJECTS) $(test_posix_spawn2_DEPENDENCIES) + @rm -f test-posix_spawn2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_posix_spawn2_OBJECTS) $(test_posix_spawn2_LDADD) $(LIBS) test-printf-frexp$(EXEEXT): $(test_printf_frexp_OBJECTS) $(test_printf_frexp_DEPENDENCIES) @rm -f test-printf-frexp$(EXEEXT) - $(LINK) $(test_printf_frexp_OBJECTS) $(test_printf_frexp_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_printf_frexp_OBJECTS) $(test_printf_frexp_LDADD) $(LIBS) test-printf-frexpl$(EXEEXT): $(test_printf_frexpl_OBJECTS) $(test_printf_frexpl_DEPENDENCIES) @rm -f test-printf-frexpl$(EXEEXT) - $(LINK) $(test_printf_frexpl_OBJECTS) $(test_printf_frexpl_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_printf_frexpl_OBJECTS) $(test_printf_frexpl_LDADD) $(LIBS) test-quotearg$(EXEEXT): $(test_quotearg_OBJECTS) $(test_quotearg_DEPENDENCIES) @rm -f test-quotearg$(EXEEXT) - $(LINK) $(test_quotearg_OBJECTS) $(test_quotearg_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_quotearg_OBJECTS) $(test_quotearg_LDADD) $(LIBS) +test-rawmemchr$(EXEEXT): $(test_rawmemchr_OBJECTS) $(test_rawmemchr_DEPENDENCIES) + @rm -f test-rawmemchr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_rawmemchr_OBJECTS) $(test_rawmemchr_LDADD) $(LIBS) +test-sched$(EXEEXT): $(test_sched_OBJECTS) $(test_sched_DEPENDENCIES) + @rm -f test-sched$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_sched_OBJECTS) $(test_sched_LDADD) $(LIBS) test-sigaction$(EXEEXT): $(test_sigaction_OBJECTS) $(test_sigaction_DEPENDENCIES) @rm -f test-sigaction$(EXEEXT) - $(LINK) $(test_sigaction_OBJECTS) $(test_sigaction_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_sigaction_OBJECTS) $(test_sigaction_LDADD) $(LIBS) +test-signal$(EXEEXT): $(test_signal_OBJECTS) $(test_signal_DEPENDENCIES) + @rm -f test-signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_signal_OBJECTS) $(test_signal_LDADD) $(LIBS) test-signbit$(EXEEXT): $(test_signbit_OBJECTS) $(test_signbit_DEPENDENCIES) @rm -f test-signbit$(EXEEXT) - $(LINK) $(test_signbit_OBJECTS) $(test_signbit_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_signbit_OBJECTS) $(test_signbit_LDADD) $(LIBS) test-snprintf$(EXEEXT): $(test_snprintf_OBJECTS) $(test_snprintf_DEPENDENCIES) @rm -f test-snprintf$(EXEEXT) - $(LINK) $(test_snprintf_OBJECTS) $(test_snprintf_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_snprintf_OBJECTS) $(test_snprintf_LDADD) $(LIBS) test-stdbool$(EXEEXT): $(test_stdbool_OBJECTS) $(test_stdbool_DEPENDENCIES) @rm -f test-stdbool$(EXEEXT) - $(LINK) $(test_stdbool_OBJECTS) $(test_stdbool_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_stdbool_OBJECTS) $(test_stdbool_LDADD) $(LIBS) test-stdint$(EXEEXT): $(test_stdint_OBJECTS) $(test_stdint_DEPENDENCIES) @rm -f test-stdint$(EXEEXT) - $(LINK) $(test_stdint_OBJECTS) $(test_stdint_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_stdint_OBJECTS) $(test_stdint_LDADD) $(LIBS) test-stdio$(EXEEXT): $(test_stdio_OBJECTS) $(test_stdio_DEPENDENCIES) @rm -f test-stdio$(EXEEXT) - $(LINK) $(test_stdio_OBJECTS) $(test_stdio_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_stdio_OBJECTS) $(test_stdio_LDADD) $(LIBS) test-stdlib$(EXEEXT): $(test_stdlib_OBJECTS) $(test_stdlib_DEPENDENCIES) @rm -f test-stdlib$(EXEEXT) - $(LINK) $(test_stdlib_OBJECTS) $(test_stdlib_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_stdlib_OBJECTS) $(test_stdlib_LDADD) $(LIBS) +test-strchrnul$(EXEEXT): $(test_strchrnul_OBJECTS) $(test_strchrnul_DEPENDENCIES) + @rm -f test-strchrnul$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_strchrnul_OBJECTS) $(test_strchrnul_LDADD) $(LIBS) test-strerror$(EXEEXT): $(test_strerror_OBJECTS) $(test_strerror_DEPENDENCIES) @rm -f test-strerror$(EXEEXT) - $(LINK) $(test_strerror_OBJECTS) $(test_strerror_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_strerror_OBJECTS) $(test_strerror_LDADD) $(LIBS) test-string$(EXEEXT): $(test_string_OBJECTS) $(test_string_DEPENDENCIES) @rm -f test-string$(EXEEXT) - $(LINK) $(test_string_OBJECTS) $(test_string_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_string_OBJECTS) $(test_string_LDADD) $(LIBS) test-strsignal$(EXEEXT): $(test_strsignal_OBJECTS) $(test_strsignal_DEPENDENCIES) @rm -f test-strsignal$(EXEEXT) - $(LINK) $(test_strsignal_OBJECTS) $(test_strsignal_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_strsignal_OBJECTS) $(test_strsignal_LDADD) $(LIBS) test-strstr$(EXEEXT): $(test_strstr_OBJECTS) $(test_strstr_DEPENDENCIES) @rm -f test-strstr$(EXEEXT) - $(LINK) $(test_strstr_OBJECTS) $(test_strstr_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_strstr_OBJECTS) $(test_strstr_LDADD) $(LIBS) test-strtod$(EXEEXT): $(test_strtod_OBJECTS) $(test_strtod_DEPENDENCIES) @rm -f test-strtod$(EXEEXT) - $(LINK) $(test_strtod_OBJECTS) $(test_strtod_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_strtod_OBJECTS) $(test_strtod_LDADD) $(LIBS) test-sys_stat$(EXEEXT): $(test_sys_stat_OBJECTS) $(test_sys_stat_DEPENDENCIES) @rm -f test-sys_stat$(EXEEXT) - $(LINK) $(test_sys_stat_OBJECTS) $(test_sys_stat_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_sys_stat_OBJECTS) $(test_sys_stat_LDADD) $(LIBS) test-sys_time$(EXEEXT): $(test_sys_time_OBJECTS) $(test_sys_time_DEPENDENCIES) @rm -f test-sys_time$(EXEEXT) - $(LINK) $(test_sys_time_OBJECTS) $(test_sys_time_LDADD) $(LIBS) -test-tls$(EXEEXT): $(test_tls_OBJECTS) $(test_tls_DEPENDENCIES) - @rm -f test-tls$(EXEEXT) - $(LINK) $(test_tls_OBJECTS) $(test_tls_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_sys_time_OBJECTS) $(test_sys_time_LDADD) $(LIBS) test-unistd$(EXEEXT): $(test_unistd_OBJECTS) $(test_unistd_DEPENDENCIES) @rm -f test-unistd$(EXEEXT) - $(LINK) $(test_unistd_OBJECTS) $(test_unistd_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_unistd_OBJECTS) $(test_unistd_LDADD) $(LIBS) test-vasnprintf$(EXEEXT): $(test_vasnprintf_OBJECTS) $(test_vasnprintf_DEPENDENCIES) @rm -f test-vasnprintf$(EXEEXT) - $(LINK) $(test_vasnprintf_OBJECTS) $(test_vasnprintf_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_vasnprintf_OBJECTS) $(test_vasnprintf_LDADD) $(LIBS) test-vasprintf$(EXEEXT): $(test_vasprintf_OBJECTS) $(test_vasprintf_DEPENDENCIES) @rm -f test-vasprintf$(EXEEXT) - $(LINK) $(test_vasprintf_OBJECTS) $(test_vasprintf_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_vasprintf_OBJECTS) $(test_vasprintf_LDADD) $(LIBS) test-vasprintf-posix$(EXEEXT): $(test_vasprintf_posix_OBJECTS) $(test_vasprintf_posix_DEPENDENCIES) @rm -f test-vasprintf-posix$(EXEEXT) - $(LINK) $(test_vasprintf_posix_OBJECTS) $(test_vasprintf_posix_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_vasprintf_posix_OBJECTS) $(test_vasprintf_posix_LDADD) $(LIBS) test-wchar$(EXEEXT): $(test_wchar_OBJECTS) $(test_wchar_DEPENDENCIES) @rm -f test-wchar$(EXEEXT) - $(LINK) $(test_wchar_OBJECTS) $(test_wchar_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_wchar_OBJECTS) $(test_wchar_LDADD) $(LIBS) +test-wcrtomb$(EXEEXT): $(test_wcrtomb_OBJECTS) $(test_wcrtomb_DEPENDENCIES) + @rm -f test-wcrtomb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_wcrtomb_OBJECTS) $(test_wcrtomb_LDADD) $(LIBS) test-wctype$(EXEEXT): $(test_wctype_OBJECTS) $(test_wctype_DEPENDENCIES) @rm -f test-wctype$(EXEEXT) - $(LINK) $(test_wctype_OBJECTS) $(test_wctype_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_wctype_OBJECTS) $(test_wctype_LDADD) $(LIBS) test-xvasprintf$(EXEEXT): $(test_xvasprintf_OBJECTS) $(test_xvasprintf_DEPENDENCIES) @rm -f test-xvasprintf$(EXEEXT) - $(LINK) $(test_xvasprintf_OBJECTS) $(test_xvasprintf_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_xvasprintf_OBJECTS) $(test_xvasprintf_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -1245,16 +1549,18 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_array_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_array_oset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setenv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-alloca-opt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-array_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-array_oset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-avltree_oset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-binary-io.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-btowc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-ctype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-stack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-closein.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dirname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-environ.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-errno.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fflush.Po@am__quote@ @@ -1269,28 +1575,36 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-frexpl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fseeko.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftello.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getdtablesize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-gettimeofday.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isnand-nolibm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isnanf-nolibm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isnanl-nolibm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-linkedhash_list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lseek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lstat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-malloca.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-math.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memchr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memcmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbrtowc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsinit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memchr2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-printf-frexp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-printf-frexpl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-quotearg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rawmemchr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sched.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigaction.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signbit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-snprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdbool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdlib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strchrnul.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strsignal.Po@am__quote@ @@ -1298,44 +1612,33 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strtod.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_stat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasnprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasprintf-posix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcrtomb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wctype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xvasprintf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctob.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -thread.o: glthread/thread.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT thread.o -MD -MP -MF $(DEPDIR)/thread.Tpo -c -o thread.o `test -f 'glthread/thread.c' || echo '$(srcdir)/'`glthread/thread.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/thread.Tpo $(DEPDIR)/thread.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='glthread/thread.c' object='thread.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thread.o `test -f 'glthread/thread.c' || echo '$(srcdir)/'`glthread/thread.c - -thread.obj: glthread/thread.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT thread.obj -MD -MP -MF $(DEPDIR)/thread.Tpo -c -o thread.obj `if test -f 'glthread/thread.c'; then $(CYGPATH_W) 'glthread/thread.c'; else $(CYGPATH_W) '$(srcdir)/glthread/thread.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/thread.Tpo $(DEPDIR)/thread.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='glthread/thread.c' object='thread.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thread.obj `if test -f 'glthread/thread.c'; then $(CYGPATH_W) 'glthread/thread.c'; else $(CYGPATH_W) '$(srcdir)/glthread/thread.c'; fi` - # 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, @@ -1360,7 +1663,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -1394,16 +1697,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -1411,14 +1714,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -1430,7 +1733,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -1439,37 +1742,43 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ + $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ @@ -1478,49 +1787,63 @@ check-TESTS: $(TESTS) if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ + *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ - echo "XPASS: $$tst"; \ + col=$$red; res=XPASS; \ ;; \ *) \ - echo "PASS: $$tst"; \ + col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ + *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ - echo "XFAIL: $$tst"; \ + col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ - echo "FAIL: $$tst"; \ + col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ - echo "SKIP: $$tst"; \ + col=$$blu; res=SKIP; \ fi; \ + echo "$${col}$$res$${std}: $$tst"; \ done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ + banner="$$All$$all $$tests passed"; \ else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ + banner="$$failed of $$all $$tests failed"; \ else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ - skipped="($$skip tests were not run)"; \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ @@ -1531,11 +1854,15 @@ check-TESTS: $(TESTS) dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ - echo "$$dashes"; \ + if test "$$failed" -eq 0; then \ + echo "$$grn$$dashes"; \ + else \ + echo "$$red$$dashes"; \ + fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ - echo "$$dashes"; \ + echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi @@ -1555,27 +1882,41 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ @@ -1613,6 +1954,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @@ -1638,6 +1980,8 @@ dvi-am: html: html-recursive +html-am: + info: info-recursive info-am: @@ -1646,18 +1990,28 @@ install-data-am: install-dvi: install-dvi-recursive +install-dvi-am: + install-exec-am: install-html: install-html-recursive +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: install-pdf: install-pdf-recursive +install-pdf-am: + install-ps: install-ps-recursive +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -1680,8 +2034,9 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + check-am ctags-recursive install install-am install-strip \ + tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-TESTS check-am clean \ @@ -1699,6 +2054,12 @@ uninstall-am: mostlyclean-local pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am +@POSIX_SPAWN_PORTED_TRUE@test-posix_spawn1.sh: test-posix_spawn1.in.sh +@POSIX_SPAWN_PORTED_TRUE@ cp $(srcdir)/test-posix_spawn1.in.sh $@-t +@POSIX_SPAWN_PORTED_TRUE@ mv $@-t $@ +@POSIX_SPAWN_PORTED_TRUE@test-posix_spawn2.sh: test-posix_spawn2.in.sh +@POSIX_SPAWN_PORTED_TRUE@ cp $(srcdir)/test-posix_spawn2.in.sh $@-t +@POSIX_SPAWN_PORTED_TRUE@ mv $@-t $@ # Clean up after Solaris cc. clean-local: @@ -1711,6 +2072,7 @@ mostlyclean-local: mostlyclean-generic fi; \ done; \ : + # 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 -ruNp m4-1.4.12/tests/glthread/thread.c m4-1.4.13/tests/glthread/thread.c --- m4-1.4.12/tests/glthread/thread.c 2008-10-09 21:04:15.000000000 -0600 +++ m4-1.4.13/tests/glthread/thread.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,214 +0,0 @@ -/* Creating and controlling threads. - Copyright (C) 2005-2008 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public 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 <bruno@clisp.org>, 2005. - Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, - gthr-win32.h. */ - -#include <config.h> - -/* Specification. */ -#include "glthread/thread.h" - -#include <stdlib.h> -#include "glthread/lock.h" - -/* ========================================================================= */ - -#if USE_WIN32_THREADS - -/* -------------------------- gl_thread_t datatype -------------------------- */ - -/* The Thread-Local Storage (TLS) key that allows to access each thread's - 'struct gl_thread_struct *' pointer. */ -static DWORD self_key = (DWORD)-1; - -/* Initializes self_key. This function must only be called once. */ -static void -do_init_self_key (void) -{ - self_key = TlsAlloc (); - /* If this fails, we're hosed. */ - if (self_key == (DWORD)-1) - abort (); -} - -/* Initializes self_key. */ -static void -init_self_key (void) -{ - gl_once_define(static, once) - gl_once (once, do_init_self_key); -} - -/* This structure contains information about a thread. - It is stored in TLS under key self_key. */ -struct gl_thread_struct -{ - /* Fields for managing the handle. */ - HANDLE volatile handle; - CRITICAL_SECTION handle_lock; - /* Fields for managing the exit value. */ - void * volatile result; - /* Fields for managing the thread start. */ - void * (*func) (void *); - void *arg; -}; - -/* Return a real HANDLE object for the current thread. */ -static inline HANDLE -get_current_thread_handle (void) -{ - HANDLE this_handle; - - /* GetCurrentThread() returns a pseudo-handle, i.e. only a symbolic - identifier, not a real handle. */ - if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), - GetCurrentProcess (), &this_handle, - 0, FALSE, DUPLICATE_SAME_ACCESS)) - abort (); - return this_handle; -} - -gl_thread_t -gl_thread_self_func (void) -{ - gl_thread_t thread; - - if (self_key == (DWORD)-1) - init_self_key (); - thread = TlsGetValue (self_key); - if (thread == NULL) - { - /* This happens only in threads that have not been created through - glthread_create(), such as the main thread. */ - for (;;) - { - thread = - (struct gl_thread_struct *) - malloc (sizeof (struct gl_thread_struct)); - if (thread != NULL) - break; - /* Memory allocation failed. There is not much we can do. Have to - busy-loop, waiting for the availability of memory. */ - Sleep (1); - } - - thread->handle = get_current_thread_handle (); - InitializeCriticalSection (&thread->handle_lock); - thread->result = NULL; /* just to be deterministic */ - TlsSetValue (self_key, thread); - } - return thread; -} - -/* The main function of a freshly creating thread. It's a wrapper around - the FUNC and ARG arguments passed to glthread_create_func. */ -static DWORD WINAPI -wrapper_func (void *varg) -{ - struct gl_thread_struct *thread = (struct gl_thread_struct *)varg; - - EnterCriticalSection (&thread->handle_lock); - /* Create a new handle for the thread only if the parent thread did not yet - fill in the handle. */ - if (thread->handle == NULL) - thread->handle = get_current_thread_handle (); - LeaveCriticalSection (&thread->handle_lock); - - if (self_key == (DWORD)-1) - init_self_key (); - TlsSetValue (self_key, thread); - - /* Run the thread. Store the exit value if the thread was not terminated - otherwise. */ - thread->result = thread->func (thread->arg); - return 0; -} - -int -glthread_create_func (gl_thread_t *threadp, void * (*func) (void *), void *arg) -{ - struct gl_thread_struct *thread = - (struct gl_thread_struct *) malloc (sizeof (struct gl_thread_struct)); - if (thread == NULL) - return ENOMEM; - thread->handle = NULL; - InitializeCriticalSection (&thread->handle_lock); - thread->result = NULL; /* just to be deterministic */ - thread->func = func; - thread->arg = arg; - - { - DWORD thread_id; - HANDLE thread_handle; - - thread_handle = - CreateThread (NULL, 100000, wrapper_func, thread, 0, &thread_id); - if (thread_handle == NULL) - { - DeleteCriticalSection (&thread->handle_lock); - free (thread); - return EAGAIN; - } - - EnterCriticalSection (&thread->handle_lock); - if (thread->handle == NULL) - thread->handle = thread_handle; - else - /* thread->handle was already set by the thread itself. */ - CloseHandle (thread_handle); - LeaveCriticalSection (&thread->handle_lock); - - *threadp = thread; - return 0; - } -} - -int -glthread_join_func (gl_thread_t thread, void **retvalp) -{ - if (thread == NULL) - return EINVAL; - - if (thread == gl_thread_self ()) - return EDEADLK; - - if (WaitForSingleObject (thread->handle, INFINITE) == WAIT_FAILED) - return EINVAL; - - if (retvalp != NULL) - *retvalp = thread->result; - - DeleteCriticalSection (&thread->handle_lock); - CloseHandle (thread->handle); - free (thread); - - return 0; -} - -int -gl_thread_exit_func (void *retval) -{ - gl_thread_t thread = gl_thread_self (); - thread->result = retval; - ExitThread (0); -} - -#endif - -/* ========================================================================= */ diff -ruNp m4-1.4.12/tests/glthread/thread.h m4-1.4.13/tests/glthread/thread.h --- m4-1.4.12/tests/glthread/thread.h 2008-10-09 21:04:15.000000000 -0600 +++ m4-1.4.13/tests/glthread/thread.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,373 +0,0 @@ -/* Creating and controlling threads. - Copyright (C) 2005-2008 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public 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 <bruno@clisp.org>, 2005. - Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, - gthr-win32.h. */ - -/* This file contains primitives for creating and controlling threads. - - Thread data type: gl_thread_t. - - Creating a thread: - thread = gl_thread_create (func, arg); - Or with control of error handling: - err = glthread_create (&thread, func, arg); - extern int glthread_create (gl_thread_t *result, - void *(*func) (void *), void *arg); - - Querying and changing the signal mask of a thread (not supported on all - platforms): - gl_thread_sigmask (how, newmask, oldmask); - Or with control of error handling: - err = glthread_sigmask (how, newmask, oldmask); - extern int glthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask); - - Waiting for termination of another thread: - gl_thread_join (thread, &return_value); - Or with control of error handling: - err = glthread_join (thread, &return_value); - extern int glthread_join (gl_thread_t thread, void **return_value_ptr); - - Getting a reference to the current thread: - current = gl_thread_self (); - extern gl_thread_t gl_thread_self (void); - - Terminating the current thread: - gl_thread_exit (return_value); - extern void gl_thread_exit (void *return_value) __attribute__ ((noreturn)); - - Requesting custom code to be executed at fork() time(not supported on all - platforms): - gl_thread_atfork (prepare_func, parent_func, child_func); - Or with control of error handling: - err = glthread_atfork (prepare_func, parent_func, child_func); - extern int glthread_atfork (void (*prepare_func) (void), - void (*parent_func) (void), - void (*child_func) (void)); - Note that even on platforms where this is supported, use of fork() and - threads together is problematic, see - <http://lists.gnu.org/archive/html/bug-gnulib/2008-08/msg00062.html> - */ - - -#ifndef _GLTHREAD_THREAD_H -#define _GLTHREAD_THREAD_H - -#include <errno.h> -#include <stdlib.h> - -/* ========================================================================= */ - -#if USE_POSIX_THREADS - -/* Use the POSIX threads library. */ - -# include <pthread.h> - -# ifdef __cplusplus -extern "C" { -# endif - -# if PTHREAD_IN_USE_DETECTION_HARD - -/* The pthread_in_use() detection needs to be done at runtime. */ -# define pthread_in_use() \ - glthread_in_use () -extern int glthread_in_use (void); - -# endif - -# if USE_POSIX_THREADS_WEAK - -/* Use weak references to the POSIX threads library. */ - -/* Weak references avoid dragging in external libraries if the other parts - of the program don't use them. Here we use them, because we don't want - every program that uses libintl to depend on libpthread. This assumes - that libpthread would not be loaded after libintl; i.e. if libintl is - loaded first, by an executable that does not depend on libpthread, and - then a module is dynamically loaded that depends on libpthread, libintl - will not be multithread-safe. */ - -/* The way to test at runtime whether libpthread is present is to test - whether a function pointer's value, such as &pthread_mutex_init, is - non-NULL. However, some versions of GCC have a bug through which, in - PIC mode, &foo != NULL always evaluates to true if there is a direct - call to foo(...) in the same function. To avoid this, we test the - address of a function in libpthread that we don't use. */ - -# pragma weak pthread_create -# pragma weak pthread_sigmask -# pragma weak pthread_join -# ifndef pthread_self -# pragma weak pthread_self -# endif -# pragma weak pthread_exit -# if HAVE_PTHREAD_ATFORK -# pragma weak pthread_atfork -# endif - -# if !PTHREAD_IN_USE_DETECTION_HARD -# pragma weak pthread_cancel -# define pthread_in_use() (pthread_cancel != NULL) -# endif - -# else - -# if !PTHREAD_IN_USE_DETECTION_HARD -# define pthread_in_use() 1 -# endif - -# endif - -/* -------------------------- gl_thread_t datatype -------------------------- */ - -typedef pthread_t gl_thread_t; -# define glthread_create(THREADP, FUNC, ARG) \ - (pthread_in_use () ? pthread_create (THREADP, NULL, FUNC, ARG) : ENOSYS) -# define glthread_sigmask(HOW, SET, OSET) \ - (pthread_in_use () ? pthread_sigmask (HOW, SET, OSET) : 0) -# define glthread_join(THREAD, RETVALP) \ - (pthread_in_use () ? pthread_join (THREAD, RETVALP) : 0) -# define gl_thread_self() \ - (pthread_in_use () ? (void *) pthread_self () : NULL) -# define gl_thread_exit(RETVAL) \ - (pthread_in_use () ? pthread_exit (RETVAL) : 0) - -# if HAVE_PTHREAD_ATFORK -# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) \ - (pthread_in_use () ? pthread_atfork (PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) : 0) -# else -# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 -# endif - -# ifdef __cplusplus -} -# endif - -#endif - -/* ========================================================================= */ - -#if USE_PTH_THREADS - -/* Use the GNU Pth threads library. */ - -# include <pth.h> - -# ifdef __cplusplus -extern "C" { -# endif - -# if USE_PTH_THREADS_WEAK - -/* Use weak references to the GNU Pth threads library. */ - -# pragma weak pth_spawn -# pragma weak pth_sigmask -# pragma weak pth_join -# pragma weak pth_self -# pragma weak pth_exit - -# pragma weak pth_cancel -# define pth_in_use() (pth_cancel != NULL) - -# else - -# define pth_in_use() 1 - -# endif -/* -------------------------- gl_thread_t datatype -------------------------- */ - -typedef pth_t gl_thread_t; -# define glthread_create(THREADP, FUNC, ARG) \ - (pth_in_use () ? ((*(THREADP) = pth_spawn (NULL, FUNC, ARG)) ? 0 : errno) : 0) -# define glthread_sigmask(HOW, SET, OSET) \ - (pth_in_use () && !pth_sigmask (HOW, SET, OSET) ? errno : 0) -# define glthread_join(THREAD, RETVALP) \ - (pth_in_use () && !pth_join (THREAD, RETVALP) ? errno : 0) -# define gl_thread_self() \ - (pth_in_use () ? (void *) pth_self () : 0) -# define gl_thread_exit(RETVAL) \ - (pth_in_use () ? pth_exit (RETVAL) : 0) -# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 - -# ifdef __cplusplus -} -# endif - -#endif - -/* ========================================================================= */ - -#if USE_SOLARIS_THREADS - -/* Use the old Solaris threads library. */ - -# include <thread.h> -# include <synch.h> - -# ifdef __cplusplus -extern "C" { -# endif - -# if USE_SOLARIS_THREADS_WEAK - -/* Use weak references to the old Solaris threads library. */ - -# pragma weak thr_create -# pragma weak thr_join -# pragma weak thr_self -# pragma weak thr_exit - -# pragma weak thr_suspend -# define thread_in_use() (thr_suspend != NULL) - -# else - -# define thread_in_use() 1 - -# endif - -/* -------------------------- gl_thread_t datatype -------------------------- */ - -typedef thread_t gl_thread_t; -# define glthread_create(THREADP, FUNC, ARG) \ - (thread_in_use () ? thr_create (NULL, 0, FUNC, ARG, 0, THREADP) : 0) -# define glthread_sigmask(HOW, SET, OSET) \ - (thread_in_use () ? sigprocmask (HOW, SET, OSET) : 0) -# define glthread_join(THREAD, RETVALP) \ - (thread_in_use () ? thr_join (THREAD, NULL, RETVALP) : 0) -# define gl_thread_self() \ - (thread_in_use () ? (void *) thr_self () : 0) -# define gl_thread_exit(RETVAL) \ - (thread_in_use () ? thr_exit (RETVAL) : 0) -# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 - -# ifdef __cplusplus -} -# endif - -#endif - -/* ========================================================================= */ - -#if USE_WIN32_THREADS - -# include <windows.h> - -# ifdef __cplusplus -extern "C" { -# endif - -/* -------------------------- gl_thread_t datatype -------------------------- */ - -/* The gl_thread_t is a pointer to a structure in memory. - Why not the thread handle? If it were the thread handle, it would be hard - to implement gl_thread_self() (since GetCurrentThread () returns a pseudo- - handle, DuplicateHandle (GetCurrentThread ()) returns a handle that must be - closed afterwards, and there is no function for quickly retrieving a thread - handle from its id). - Why not the thread id? I tried it. It did not work: Sometimes ids appeared - that did not belong to running threads, and glthread_join failed with ESRCH. - */ -typedef struct gl_thread_struct *gl_thread_t; -# define glthread_create(THREADP, FUNC, ARG) \ - glthread_create_func (THREADP, FUNC, ARG) -# define glthread_sigmask(HOW, SET, OSET) \ - /* unsupported */ 0 -# define glthread_join(THREAD, RETVALP) \ - glthread_join_func (THREAD, RETVALP) -# define gl_thread_self() \ - gl_thread_self_func () -# define gl_thread_exit(RETVAL) \ - gl_thread_exit_func (RETVAL) -# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 -extern int glthread_create_func (gl_thread_t *threadp, void * (*func) (void *), void *arg); -extern int glthread_join_func (gl_thread_t thread, void **retvalp); -extern gl_thread_t gl_thread_self_func (void); -extern int gl_thread_exit_func (void *retval); - -# ifdef __cplusplus -} -# endif - -#endif - -/* ========================================================================= */ - -#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS) - -/* Provide dummy implementation if threads are not supported. */ - -typedef int gl_thread_t; -# define glthread_create(THREADP, FUNC, ARG) ENOSYS -# define glthread_sigmask(HOW, SET, OSET) 0 -# define glthread_join(THREAD, RETVALP) 0 -# define gl_thread_self() NULL -# define gl_thread_exit(RETVAL) 0 -# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0 - -#endif - -/* ========================================================================= */ - -/* Macros with built-in error handling. */ - -#ifdef __cplusplus -extern "C" { -#endif - -static inline gl_thread_t -gl_thread_create (void *(*func) (void *arg), void *arg) -{ - gl_thread_t thread; - int ret; - - ret = glthread_create (&thread, func, arg); - if (ret != 0) - abort (); - return thread; -} -#define gl_thread_sigmask(HOW, SET, OSET) \ - do \ - { \ - if (glthread_sigmask (HOW, SET, OSET)) \ - abort (); \ - } \ - while (0) -#define gl_thread_join(THREAD, RETVAL) \ - do \ - { \ - if (glthread_join (THREAD, RETVAL)) \ - abort (); \ - } \ - while (0) -#define gl_thread_atfork(PREPARE, PARENT, CHILD) \ - do \ - { \ - if (glthread_atfork (PREPARE, PARENT, CHILD)) \ - abort (); \ - } \ - while (0) - -#ifdef __cplusplus -} -#endif - -#endif /* _GLTHREAD_THREAD_H */ diff -ruNp m4-1.4.12/tests/glthread/yield.h m4-1.4.13/tests/glthread/yield.h --- m4-1.4.12/tests/glthread/yield.h 2008-10-09 21:04:15.000000000 -0600 +++ m4-1.4.13/tests/glthread/yield.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,121 +0,0 @@ -/* Yielding the processor to other threads and processes. - Copyright (C) 2005-2008 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* This file contains a primitive for yielding the processor to other threads. - extern void gl_thread_yield (void); - */ - -#ifndef _GLTHREAD_YIELD_H -#define _GLTHREAD_YIELD_H - -#include <errno.h> - -/* ========================================================================= */ - -#if USE_POSIX_THREADS - -/* Use the POSIX threads library. */ - -# include <sched.h> - -# ifdef __cplusplus -extern "C" { -# endif - -# define gl_thread_yield() \ - sched_yield () - -# ifdef __cplusplus -} -# endif - -#endif - -/* ========================================================================= */ - -#if USE_PTH_THREADS - -/* Use the GNU Pth threads library. */ - -# include <pth.h> - -# ifdef __cplusplus -extern "C" { -# endif - -# define gl_thread_yield() \ - pth_yield (NULL) - -# ifdef __cplusplus -} -# endif - -#endif - -/* ========================================================================= */ - -#if USE_SOLARIS_THREADS - -/* Use the old Solaris threads library. */ - -# include <thread.h> - -# ifdef __cplusplus -extern "C" { -# endif - -# define gl_thread_yield() \ - thr_yield () - -# ifdef __cplusplus -} -# endif - -#endif - -/* ========================================================================= */ - -#if USE_WIN32_THREADS - -# include <windows.h> - -# ifdef __cplusplus -extern "C" { -# endif - -# define gl_thread_yield() \ - Sleep (0) - -# ifdef __cplusplus -} -# endif - -#endif - -/* ========================================================================= */ - -#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS) - -/* Provide dummy implementation if threads are not supported. */ - -# define gl_thread_yield() 0 - -#endif - -/* ========================================================================= */ - -#endif /* _GLTHREAD_YIELD_H */ Files m4-1.4.12/tests/locale/fr/LC_MESSAGES/test-quotearg.mo and m4-1.4.13/tests/locale/fr/LC_MESSAGES/test-quotearg.mo differ diff -ruNp m4-1.4.12/tests/locale/fr/LC_MESSAGES/test-quotearg.po m4-1.4.13/tests/locale/fr/LC_MESSAGES/test-quotearg.po --- m4-1.4.12/tests/locale/fr/LC_MESSAGES/test-quotearg.po 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/locale/fr/LC_MESSAGES/test-quotearg.po 2009-01-25 19:37:32.000000000 -0700 @@ -0,0 +1,20 @@ +# Message catalog that maps the ASCII replacements for single-quote characters +# to real single-quote characters. +# The header entry is commented out on purpose, so that gettext() performs no +# no character set conversion from the PO file's encoding to the locale +# encoding. This allows us to use the same PO file in various locales. +#msgid "" +#msgstr "" +#"Project-Id-Version: GNU gnulib\n" +#"PO-Revision-Date: 2009-01-26 01:02+01:00\n" +#"Last-Translator: Eric Blake <ebb9@byu.net>\n" +#"Language-Team: Undetermined <und@li.org>\n" +#"MIME-Version: 1.0\n" +#"Content-Type: text/plain; charset=UTF-8\n" +#"Content-Transfer-Encoding: 8bit\n" + +msgid "`" +msgstr "\302\253" + +msgid "'" +msgstr "\302\273" diff -ruNp m4-1.4.12/tests/nan.h m4-1.4.13/tests/nan.h --- m4-1.4.12/tests/nan.h 2008-08-05 07:16:34.000000000 -0600 +++ m4-1.4.13/tests/nan.h 2009-02-28 08:26:52.000000000 -0700 @@ -1,5 +1,5 @@ /* Macros for not-a-number. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,4 +47,14 @@ NaNd () /* NaNl () returns a 'long double' not-a-number. */ -#define NaNl() (0.0L / 0.0L) +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif diff -ruNp m4-1.4.12/tests/setenv.c m4-1.4.13/tests/setenv.c --- m4-1.4.12/tests/setenv.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/setenv.c 2009-01-25 19:37:32.000000000 -0700 @@ -0,0 +1,330 @@ +/* Copyright (C) 1992,1995-1999,2000-2003,2005-2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#if !_LIBC +# include <config.h> +#endif +#include <alloca.h> + +/* Specification. */ +#include <stdlib.h> + +#include <errno.h> +#ifndef __set_errno +# define __set_errno(ev) ((errno) = (ev)) +#endif + +#include <string.h> +#if _LIBC || HAVE_UNISTD_H +# include <unistd.h> +#endif + +#if _LIBC || !HAVE_SETENV + +#if !_LIBC +# include "malloca.h" +#endif + +#if !_LIBC +# define __environ environ +#endif + +#if _LIBC +/* This lock protects against simultaneous modifications of `environ'. */ +# include <bits/libc-lock.h> +__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 <search.h> +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 *) malloca (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 + freea (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 + freea (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 = malloca (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 + freea (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 + freea (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 -ruNp m4-1.4.12/tests/strdup.c m4-1.4.13/tests/strdup.c --- m4-1.4.12/tests/strdup.c 2008-09-22 20:20:31.000000000 -0600 +++ m4-1.4.13/tests/strdup.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,55 +0,0 @@ -/* 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 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _LIBC -# include <config.h> -#endif - -/* Get specification. */ -#include <string.h> - -#include <stdlib.h> - -#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 -ruNp m4-1.4.12/tests/test-avltree_oset.c m4-1.4.13/tests/test-avltree_oset.c --- m4-1.4.12/tests/test-avltree_oset.c 2008-08-05 07:17:24.000000000 -0600 +++ m4-1.4.13/tests/test-avltree_oset.c 2009-01-24 12:02:36.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of ordered set data type implementation. - Copyright (C) 2006-2008 Free Software Foundation, Inc. + Copyright (C) 2006-2009 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2006. This program is free software: you can redistribute it and/or modify @@ -84,6 +84,8 @@ main (int argc, char *argv[]) { gl_oset_t set1, set2; + set_program_name (argv[0]); + /* Allow the user to provide a non-default random seed on the command line. */ if (argc > 1) srand (atoi (argv[1])); diff -ruNp m4-1.4.12/tests/test-btowc.c m4-1.4.13/tests/test-btowc.c --- m4-1.4.12/tests/test-btowc.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-btowc.c 2008-12-24 06:20:32.000000000 -0700 @@ -0,0 +1,71 @@ +/* Test of conversion of unibyte character to wide character. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <wchar.h> + +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +int +main (int argc, char *argv[]) +{ + int c; + + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + ASSERT (btowc (EOF) == WEOF); + + if (argc > 1) + switch (argv[1][0]) + { + case '1': + /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ + for (c = 0; c < 0x80; c++) + ASSERT (btowc (c) == c); + for (c = 0xA0; c < 0x100; c++) + ASSERT (btowc (c) != WEOF); + return 0; + + case '2': + /* Locale encoding is UTF-8. */ + for (c = 0; c < 0x80; c++) + ASSERT (btowc (c) == c); + for (c = 0x80; c < 0x100; c++) + ASSERT (btowc (c) == WEOF); + return 0; + } + + return 1; +} diff -ruNp m4-1.4.12/tests/test-btowc1.sh m4-1.4.13/tests/test-btowc1.sh --- m4-1.4.12/tests/test-btowc1.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-btowc1.sh 2008-12-24 06:20:32.000000000 -0700 @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test in an ISO-8859-1 or ISO-8859-15 locale. +: ${LOCALE_FR=fr_FR} +if test $LOCALE_FR = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no traditional french locale is installed" + else + echo "Skipping test: no traditional french locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR \ +./test-btowc${EXEEXT} 1 diff -ruNp m4-1.4.12/tests/test-btowc2.sh m4-1.4.13/tests/test-btowc2.sh --- m4-1.4.12/tests/test-btowc2.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-btowc2.sh 2008-12-24 06:20:33.000000000 -0700 @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no french Unicode locale is installed" + else + echo "Skipping test: no french Unicode locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR_UTF8 \ +./test-btowc${EXEEXT} 2 diff -ruNp m4-1.4.12/tests/test-closein.sh m4-1.4.13/tests/test-closein.sh --- m4-1.4.12/tests/test-closein.sh 2008-02-23 10:30:19.000000000 -0700 +++ m4-1.4.13/tests/test-closein.sh 2009-03-08 20:15:22.000000000 -0600 @@ -16,10 +16,10 @@ cmp ${p}out1.tmp ${p}in.tmp || exit 1 (./test-closein${EXEEXT} consume; cat) < ${p}in.tmp > ${p}out2.tmp || exit 1 cmp ${p}out2.tmp ${p}xout.tmp || exit 1 -# Test for lack of error on pipe -cat ${p}in.tmp | ./test-closein${EXEEXT} || exit 1 +# Test for lack of error on pipe. Ignore any EPIPE failures from cat. +cat ${p}in.tmp 2>/dev/null | ./test-closein${EXEEXT} || exit 1 -cat ${p}in.tmp | ./test-closein${EXEEXT} consume || exit 1 +cat ${p}in.tmp 2>/dev/null | ./test-closein${EXEEXT} consume || exit 1 # Test for lack of error when nothing is read ./test-closein${EXEEXT} </dev/null || exit 1 diff -ruNp m4-1.4.12/tests/test-environ.c m4-1.4.13/tests/test-environ.c --- m4-1.4.12/tests/test-environ.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-environ.c 2009-01-25 19:37:32.000000000 -0700 @@ -0,0 +1,44 @@ +/* Test of environ variable. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <unistd.h> + +#include <string.h> + +int +main () +{ + /* The environment variables that are set even in the weirdest situations + are HOME and PATH. + POSIX says that HOME is initialized by the system, and that PATH may be + unset. But in practice it's more frequent to see HOME unset and PATH + set. So we test the presence of PATH. */ + char **remaining_variables = environ; + char *string; + + for (; (string = *remaining_variables) != NULL; remaining_variables++) + { + if (strncmp (string, "PATH=", 5) == 0) + /* Found the PATH environment variable. */ + return 0; + } + /* Failed to find the PATH environment variable. */ + return 1; +} diff -ruNp m4-1.4.12/tests/test-fflush2.c m4-1.4.13/tests/test-fflush2.c --- m4-1.4.12/tests/test-fflush2.c 2008-08-05 07:17:25.000000000 -0600 +++ m4-1.4.13/tests/test-fflush2.c 2009-01-24 12:02:38.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of POSIX compatible fflush() function. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,9 +20,9 @@ #include <stdlib.h> -/* This test can only be made to work on specific platforms. */ -#if defined _IO_ferror_unlocked || defined __sferror /* GNU libc, BeOS; FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */ -# define ASSERT(expr) \ +#include "binary-io.h" + +#define ASSERT(expr) \ do \ { \ if (!(expr)) \ @@ -33,57 +33,89 @@ } \ } \ while (0) -#else -# define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - printf ("Skipping test: expected failure on this platform\n"); \ - exit (77); \ - } \ - } \ - while (0) -#endif int main (int argc, char **argv) { -#if 0 - /* Check fflush after a backup ungetc() call. This is case 1 in terms of - <http://lists.gnu.org/archive/html/bug-gnulib/2008-03/msg00131.html>. - The Austin Group has not yet decided how this should behave. */ -#endif -#if 0 - /* Check fflush after a non-backup ungetc() call. This is case 2 in terms of - <http://lists.gnu.org/archive/html/bug-gnulib/2008-03/msg00131.html>. - The Austin Group has not yet decided how this should behave. */ - /* Check that fflush after a non-backup ungetc() call discards the ungetc - buffer. This is mandated by POSIX - <http://www.opengroup.org/susv3/functions/ungetc.html>: - "The value of the file-position indicator for the stream after - reading or discarding all pushed-back bytes shall be the same - as it was before the bytes were pushed back." */ int c; - c = fgetc (stdin); - ASSERT (c == '#'); + /* Avoid the well-known bugs of fflush() on streams in O_TEXT mode + on native Windows platforms. */ + SET_BINARY (0); + + if (argc > 1) + switch (argv[1][0]) + { + case '1': + /* Check fflush after a backup ungetc() call. This is case 1a in + terms of + <http://lists.gnu.org/archive/html/bug-gnulib/2008-03/msg00131.html>, + according to the Austin Group's resolution on 2009-01-08. */ + + c = fgetc (stdin); + ASSERT (c == '#'); + + c = fgetc (stdin); + ASSERT (c == '!'); + + /* Here the file-position indicator must be 2. */ + + c = ungetc ('!', stdin); + ASSERT (c == '!'); + + fflush (stdin); + + /* Here the file-position indicator must be 1. */ + + c = fgetc (stdin); + ASSERT (c == '!'); + + c = fgetc (stdin); + ASSERT (c == '/'); + + return 0; + + case '2': + /* Check fflush after a non-backup ungetc() call. This is case 2a in + terms of + <http://lists.gnu.org/archive/html/bug-gnulib/2008-03/msg00131.html>, + according to the Austin Group's resolution on 2009-01-08. */ + /* Check that fflush after a non-backup ungetc() call discards the + ungetc buffer. This is mandated by POSIX + <http://www.opengroup.org/susv3/functions/ungetc.html>: + "The value of the file-position indicator for the stream after + reading or discarding all pushed-back bytes shall be the same + as it was before the bytes were pushed back." + <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> + "[After fflush(),] the file offset of the underlying open file + description shall be set to the file position of the stream, and + any characters pushed back onto the stream by ungetc() or + ungetwc() that have not subsequently been read from the stream + shall be discarded." */ + + c = fgetc (stdin); + ASSERT (c == '#'); + + c = fgetc (stdin); + ASSERT (c == '!'); + + /* Here the file-position indicator must be 2. */ - c = fgetc (stdin); - ASSERT (c == '!'); + c = ungetc ('@', stdin); + ASSERT (c == '@'); - /* Here the file-position indicator must be 2. */ + fflush (stdin); - c = ungetc ('@', stdin); - ASSERT (c == '@'); + /* Here the file-position indicator must be 1. */ - fflush (stdin); + c = fgetc (stdin); + ASSERT (c == '!'); - /* Here the file-position indicator must be 2 again. */ + c = fgetc (stdin); + ASSERT (c == '/'); - c = fgetc (stdin); - ASSERT (c == '/'); -#endif + return 0; + } - return 0; + return 1; } diff -ruNp m4-1.4.12/tests/test-fflush2.sh m4-1.4.13/tests/test-fflush2.sh --- m4-1.4.12/tests/test-fflush2.sh 2008-03-29 07:24:42.000000000 -0600 +++ m4-1.4.13/tests/test-fflush2.sh 2009-01-16 06:26:43.000000000 -0700 @@ -2,7 +2,8 @@ # Execute the test only with seekable input stream. # The behaviour of fflush() on a non-seekable input stream is undefined. -./test-fflush2${EXEEXT} < "$srcdir/test-fflush2.sh" || exit $? +./test-fflush2${EXEEXT} 1 < "$srcdir/test-fflush2.sh" || exit $? +./test-fflush2${EXEEXT} 2 < "$srcdir/test-fflush2.sh" || exit $? #cat "$srcdir/test-fflush2.sh" | ./test-fflush2${EXEEXT} || exit $? exit 0 diff -ruNp m4-1.4.12/tests/test-filenamecat.c m4-1.4.13/tests/test-filenamecat.c --- m4-1.4.12/tests/test-filenamecat.c 2008-09-22 20:38:31.000000000 -0600 +++ m4-1.4.13/tests/test-filenamecat.c 2009-01-24 12:02:38.000000000 -0700 @@ -1,6 +1,6 @@ /* Test of concatenation of two arbitrary file names. - Copyright (C) 1996-2007 Free Software Foundation, Inc. + Copyright (C) 1996-2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,8 +26,10 @@ #include <stdlib.h> #include <string.h> +#include "progname.h" + int -main () +main (int argc, char *argv[]) { static char const *const tests[][3] = { @@ -46,6 +48,9 @@ main () }; unsigned int i; bool fail = false; + + set_program_name (argv[0]); + for (i = 0; i < sizeof tests / sizeof tests[0]; i++) { char *base_in_result; diff -ruNp m4-1.4.12/tests/test-frexpl.c m4-1.4.13/tests/test-frexpl.c --- m4-1.4.12/tests/test-frexpl.c 2008-10-09 21:04:58.000000000 -0600 +++ m4-1.4.13/tests/test-frexpl.c 2009-02-28 08:26:55.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of splitting a 'long double' into fraction and mantissa. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #include "fpucw.h" #include "isnanl-nolibm.h" +#include "nan.h" /* Avoid some warnings from "gcc -Wshadow". This file doesn't use the exp() function. */ @@ -58,8 +59,20 @@ #endif /* On HP-UX 10.20, negating 0.0L does not yield -0.0L. - So we use minus_zero instead. */ -long double minus_zero = -LDBL_MIN * LDBL_MIN; + So we use minus_zero instead. + IRIX cc can't put -0.0L into .data, but can compute at runtime. + Note that the expression -LDBL_MIN * LDBL_MIN does not work on other + platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */ +#if defined __hpux || defined __sgi +static long double +compute_minus_zero (void) +{ + return -LDBL_MIN * LDBL_MIN; +} +# define minus_zero compute_minus_zero () +#else +long double minus_zero = -0.0L; +#endif static long double my_ldexp (long double x, int d) @@ -83,7 +96,7 @@ main () { /* NaN. */ int exp = -9999; long double mantissa; - x = 0.0L / 0.0L; + x = NaNl (); mantissa = frexpl (x, &exp); ASSERT (isnanl (mantissa)); } diff -ruNp m4-1.4.12/tests/test-fseeko.c m4-1.4.13/tests/test-fseeko.c --- m4-1.4.12/tests/test-fseeko.c 2008-08-05 07:17:28.000000000 -0600 +++ m4-1.4.13/tests/test-fseeko.c 2009-02-28 08:26:55.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of fseeko() function. - Copyright (C) 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,6 +33,10 @@ } \ while (0) +#ifndef FUNC_UNGETC_BROKEN +# define FUNC_UNGETC_BROKEN 0 +#endif + int main (int argc, char **argv) { @@ -50,10 +54,19 @@ main (int argc, char **argv) ASSERT (ch == '#'); ASSERT (ungetc (ch, stdin) == ch); ASSERT (fseeko (stdin, 2, SEEK_SET) == 0); - /* Test that fseek discards random ungetc data. */ ch = fgetc (stdin); ASSERT (ch == '/'); - ASSERT (ungetc (ch ^ 0xff, stdin) == (ch ^ 0xff)); + if (2 < argc) + { + if (FUNC_UNGETC_BROKEN) + { + fputs ("Skipping test: ungetc cannot handle arbitrary bytes\n", + stderr); + return 77; + } + /* Test that fseek discards random ungetc data. */ + ASSERT (ungetc (ch ^ 0xff, stdin) == (ch ^ 0xff)); + } ASSERT (fseeko (stdin, 0, SEEK_END) == 0); ASSERT (fgetc (stdin) == EOF); /* Test that fseek resets end-of-file marker. */ diff -ruNp m4-1.4.12/tests/test-fseeko2.sh m4-1.4.13/tests/test-fseeko2.sh --- m4-1.4.12/tests/test-fseeko2.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-fseeko2.sh 2009-02-28 08:25:58.000000000 -0700 @@ -0,0 +1,3 @@ +#!/bin/sh + +exec ./test-fseeko${EXEEXT} 1 2 < "$srcdir/test-fseeko2.sh" diff -ruNp m4-1.4.12/tests/test-ftello.c m4-1.4.13/tests/test-ftello.c --- m4-1.4.12/tests/test-ftello.c 2008-08-05 07:17:28.000000000 -0600 +++ m4-1.4.13/tests/test-ftello.c 2009-03-01 08:29:52.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of ftello() function. - Copyright (C) 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,10 @@ } \ while (0) +#ifndef FUNC_UNGETC_BROKEN +# define FUNC_UNGETC_BROKEN 0 +#endif + int main (int argc, char **argv) { @@ -88,24 +92,33 @@ main (int argc, char **argv) ASSERT (ftell (stdin) == 3); ASSERT (ftello (stdin) == 3); -#if !defined __hpux /* HP-UX 11 has a known bug here */ - /* Test ftell after ungetc without read. */ - ASSERT (fseek (stdin, 0, SEEK_CUR) == 0); - ASSERT (ftell (stdin) == 3); - ASSERT (ftello (stdin) == 3); -#endif - - ch = ungetc ('~', stdin); - ASSERT (ch == '~'); - ASSERT (ftell (stdin) == 2); - ASSERT (ftello (stdin) == 2); + if (2 < argc) + { + if (FUNC_UNGETC_BROKEN) + { + fputs ("Skipping test: ungetc cannot handle arbitrary bytes\n", + stderr); + return 77; + } + /* Test ftell after ungetc without read. */ + ASSERT (fseek (stdin, 0, SEEK_CUR) == 0); + ASSERT (ftell (stdin) == 3); + ASSERT (ftello (stdin) == 3); + + ch = ungetc ('~', stdin); + ASSERT (ch == '~'); + ASSERT (ftell (stdin) == 2); + ASSERT (ftello (stdin) == 2); + } +#if !defined __MINT__ /* FreeMiNT has problems seeking past end of file */ /* Test ftell beyond end of file. */ ASSERT (fseek (stdin, 0, SEEK_END) == 0); ch = ftello (stdin); ASSERT (fseek (stdin, 10, SEEK_END) == 0); ASSERT (ftell (stdin) == ch + 10); ASSERT (ftello (stdin) == ch + 10); +#endif return 0; } diff -ruNp m4-1.4.12/tests/test-ftello2.sh m4-1.4.13/tests/test-ftello2.sh --- m4-1.4.12/tests/test-ftello2.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-ftello2.sh 2009-02-28 08:25:58.000000000 -0700 @@ -0,0 +1,3 @@ +#!/bin/sh + +exec ./test-ftello${EXEEXT} 1 2 < "$srcdir/test-ftello2.sh" diff -ruNp m4-1.4.12/tests/test-getdtablesize.c m4-1.4.13/tests/test-getdtablesize.c --- m4-1.4.12/tests/test-getdtablesize.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-getdtablesize.c 2009-02-28 08:25:59.000000000 -0700 @@ -0,0 +1,44 @@ +/* Test of getdtablesize() function. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <unistd.h> + +#include <stdio.h> +#include <stdlib.h> + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +int +main (int argc, char *argv[]) +{ + ASSERT (getdtablesize () >= 3); + + return 0; +} diff -ruNp m4-1.4.12/tests/test-isnanl.h m4-1.4.13/tests/test-isnanl.h --- m4-1.4.12/tests/test-isnanl.h 2008-10-09 21:04:59.000000000 -0600 +++ m4-1.4.13/tests/test-isnanl.h 2009-02-28 08:26:57.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of isnanl() substitute. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,6 +21,8 @@ #include <stdio.h> #include <stdlib.h> +#include "nan.h" + #define ASSERT(expr) \ do \ { \ @@ -34,8 +36,20 @@ while (0) /* On HP-UX 10.20, negating 0.0L does not yield -0.0L. - So we use minus_zero instead. */ -long double minus_zero = -LDBL_MIN * LDBL_MIN; + So we use minus_zero instead. + IRIX cc can't put -0.0L into .data, but can compute at runtime. + Note that the expression -LDBL_MIN * LDBL_MIN does not work on other + platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */ +#if defined __hpux || defined __sgi +static long double +compute_minus_zero (void) +{ + return -LDBL_MIN * LDBL_MIN; +} +# define minus_zero compute_minus_zero () +#else +long double minus_zero = -0.0L; +#endif int main () @@ -58,14 +72,14 @@ main () ASSERT (!isnanl (1.0L / 0.0L)); ASSERT (!isnanl (-1.0L / 0.0L)); /* Quiet NaN. */ - ASSERT (isnanl (0.0L / 0.0L)); + ASSERT (isnanl (NaNl ())); #if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT /* A bit pattern that is different from a Quiet NaN. With a bit of luck, it's a Signalling NaN. */ { memory_long_double m; - m.value = 0.0L / 0.0L; + m.value = NaNl (); # if LDBL_EXPBIT0_BIT > 0 m.word[LDBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (LDBL_EXPBIT0_BIT - 1); # else diff -ruNp m4-1.4.12/tests/test-lock.c m4-1.4.13/tests/test-lock.c --- m4-1.4.12/tests/test-lock.c 2008-10-09 21:04:59.000000000 -0600 +++ m4-1.4.13/tests/test-lock.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,586 +0,0 @@ -/* Test of locking in multithreaded situations. - Copyright (C) 2005, 2008 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* Written by Bruno Haible <bruno@clisp.org>, 2005. */ - -#include <config.h> - -#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WIN32_THREADS - -#if USE_POSIX_THREADS -# define TEST_POSIX_THREADS 1 -#endif -#if USE_SOLARIS_THREADS -# define TEST_SOLARIS_THREADS 1 -#endif -#if USE_PTH_THREADS -# define TEST_PTH_THREADS 1 -#endif -#if USE_WIN32_THREADS -# define TEST_WIN32_THREADS 1 -#endif - -/* Whether to enable locking. - Uncomment this to get a test program without locking, to verify that - it crashes. */ -#define ENABLE_LOCKING 1 - -/* Which tests to perform. - Uncomment some of these, to verify that all tests crash if no locking - is enabled. */ -#define DO_TEST_LOCK 1 -#define DO_TEST_RWLOCK 1 -#define DO_TEST_RECURSIVE_LOCK 1 -#define DO_TEST_ONCE 1 - -/* Whether to help the scheduler through explicit yield(). - Uncomment this to see if the operating system has a fair scheduler. */ -#define EXPLICIT_YIELD 1 - -/* Whether to print debugging messages. */ -#define ENABLE_DEBUGGING 0 - -/* Number of simultaneous threads. */ -#define THREAD_COUNT 10 - -/* Number of operations performed in each thread. - This is quite high, because with a smaller count, say 5000, we often get - an "OK" result even without ENABLE_LOCKING (on Linux/x86). */ -#define REPEAT_COUNT 50000 - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#if !ENABLE_LOCKING -# undef USE_POSIX_THREADS -# undef USE_SOLARIS_THREADS -# undef USE_PTH_THREADS -# undef USE_WIN32_THREADS -#endif -#include "glthread/lock.h" - -#if !ENABLE_LOCKING -# if TEST_POSIX_THREADS -# define USE_POSIX_THREADS 1 -# endif -# if TEST_SOLARIS_THREADS -# define USE_SOLARIS_THREADS 1 -# endif -# if TEST_PTH_THREADS -# define USE_PTH_THREADS 1 -# endif -# if TEST_WIN32_THREADS -# define USE_WIN32_THREADS 1 -# endif -#endif - -#include "glthread/thread.h" -#include "glthread/yield.h" - -#if ENABLE_DEBUGGING -# define dbgprintf printf -#else -# define dbgprintf if (0) printf -#endif - -#if EXPLICIT_YIELD -# define yield() gl_thread_yield () -#else -# define yield() -#endif - -#define ACCOUNT_COUNT 4 - -static int account[ACCOUNT_COUNT]; - -static int -random_account (void) -{ - return ((unsigned int) rand() >> 3) % ACCOUNT_COUNT; -} - -static void -check_accounts (void) -{ - int i, sum; - - sum = 0; - for (i = 0; i < ACCOUNT_COUNT; i++) - sum += account[i]; - if (sum != ACCOUNT_COUNT * 1000) - abort (); -} - -/* Test normal locks by having several bank accounts and several threads - which shuffle around money between the accounts and another thread - checking that all the money is still there. */ - -gl_lock_define_initialized(static, my_lock) - -static void * -lock_mutator_thread (void *arg) -{ - int repeat; - - for (repeat = REPEAT_COUNT; repeat > 0; repeat--) - { - int i1, i2, value; - - dbgprintf ("Mutator %p before lock\n", gl_thread_self ()); - gl_lock_lock (my_lock); - dbgprintf ("Mutator %p after lock\n", gl_thread_self ()); - - i1 = random_account (); - i2 = random_account (); - value = ((unsigned int) rand() >> 3) % 10; - account[i1] += value; - account[i2] -= value; - - dbgprintf ("Mutator %p before unlock\n", gl_thread_self ()); - gl_lock_unlock (my_lock); - dbgprintf ("Mutator %p after unlock\n", gl_thread_self ()); - - dbgprintf ("Mutator %p before check lock\n", gl_thread_self ()); - gl_lock_lock (my_lock); - check_accounts (); - gl_lock_unlock (my_lock); - dbgprintf ("Mutator %p after check unlock\n", gl_thread_self ()); - - yield (); - } - - dbgprintf ("Mutator %p dying.\n", gl_thread_self ()); - return NULL; -} - -static volatile int lock_checker_done; - -static void * -lock_checker_thread (void *arg) -{ - while (!lock_checker_done) - { - dbgprintf ("Checker %p before check lock\n", gl_thread_self ()); - gl_lock_lock (my_lock); - check_accounts (); - gl_lock_unlock (my_lock); - dbgprintf ("Checker %p after check unlock\n", gl_thread_self ()); - - yield (); - } - - dbgprintf ("Checker %p dying.\n", gl_thread_self ()); - return NULL; -} - -void -test_lock (void) -{ - int i; - gl_thread_t checkerthread; - gl_thread_t threads[THREAD_COUNT]; - - /* Initialization. */ - for (i = 0; i < ACCOUNT_COUNT; i++) - account[i] = 1000; - lock_checker_done = 0; - - /* Spawn the threads. */ - checkerthread = gl_thread_create (lock_checker_thread, NULL); - for (i = 0; i < THREAD_COUNT; i++) - threads[i] = gl_thread_create (lock_mutator_thread, NULL); - - /* Wait for the threads to terminate. */ - for (i = 0; i < THREAD_COUNT; i++) - gl_thread_join (threads[i], NULL); - lock_checker_done = 1; - gl_thread_join (checkerthread, NULL); - check_accounts (); -} - -/* Test read-write locks by having several bank accounts and several threads - which shuffle around money between the accounts and several other threads - that check that all the money is still there. */ - -gl_rwlock_define_initialized(static, my_rwlock) - -static void * -rwlock_mutator_thread (void *arg) -{ - int repeat; - - for (repeat = REPEAT_COUNT; repeat > 0; repeat--) - { - int i1, i2, value; - - dbgprintf ("Mutator %p before wrlock\n", gl_thread_self ()); - gl_rwlock_wrlock (my_rwlock); - dbgprintf ("Mutator %p after wrlock\n", gl_thread_self ()); - - i1 = random_account (); - i2 = random_account (); - value = ((unsigned int) rand() >> 3) % 10; - account[i1] += value; - account[i2] -= value; - - dbgprintf ("Mutator %p before unlock\n", gl_thread_self ()); - gl_rwlock_unlock (my_rwlock); - dbgprintf ("Mutator %p after unlock\n", gl_thread_self ()); - - yield (); - } - - dbgprintf ("Mutator %p dying.\n", gl_thread_self ()); - return NULL; -} - -static volatile int rwlock_checker_done; - -static void * -rwlock_checker_thread (void *arg) -{ - while (!rwlock_checker_done) - { - dbgprintf ("Checker %p before check rdlock\n", gl_thread_self ()); - gl_rwlock_rdlock (my_rwlock); - check_accounts (); - gl_rwlock_unlock (my_rwlock); - dbgprintf ("Checker %p after check unlock\n", gl_thread_self ()); - - yield (); - } - - dbgprintf ("Checker %p dying.\n", gl_thread_self ()); - return NULL; -} - -void -test_rwlock (void) -{ - int i; - gl_thread_t checkerthreads[THREAD_COUNT]; - gl_thread_t threads[THREAD_COUNT]; - - /* Initialization. */ - for (i = 0; i < ACCOUNT_COUNT; i++) - account[i] = 1000; - rwlock_checker_done = 0; - - /* Spawn the threads. */ - for (i = 0; i < THREAD_COUNT; i++) - checkerthreads[i] = gl_thread_create (rwlock_checker_thread, NULL); - for (i = 0; i < THREAD_COUNT; i++) - threads[i] = gl_thread_create (rwlock_mutator_thread, NULL); - - /* Wait for the threads to terminate. */ - for (i = 0; i < THREAD_COUNT; i++) - gl_thread_join (threads[i], NULL); - rwlock_checker_done = 1; - for (i = 0; i < THREAD_COUNT; i++) - gl_thread_join (checkerthreads[i], NULL); - check_accounts (); -} - -/* Test recursive locks by having several bank accounts and several threads - which shuffle around money between the accounts (recursively) and another - thread checking that all the money is still there. */ - -gl_recursive_lock_define_initialized(static, my_reclock) - -static void -recshuffle (void) -{ - int i1, i2, value; - - dbgprintf ("Mutator %p before lock\n", gl_thread_self ()); - gl_recursive_lock_lock (my_reclock); - dbgprintf ("Mutator %p after lock\n", gl_thread_self ()); - - i1 = random_account (); - i2 = random_account (); - value = ((unsigned int) rand() >> 3) % 10; - account[i1] += value; - account[i2] -= value; - - /* Recursive with probability 0.5. */ - if (((unsigned int) rand() >> 3) % 2) - recshuffle (); - - dbgprintf ("Mutator %p before unlock\n", gl_thread_self ()); - gl_recursive_lock_unlock (my_reclock); - dbgprintf ("Mutator %p after unlock\n", gl_thread_self ()); -} - -static void * -reclock_mutator_thread (void *arg) -{ - int repeat; - - for (repeat = REPEAT_COUNT; repeat > 0; repeat--) - { - recshuffle (); - - dbgprintf ("Mutator %p before check lock\n", gl_thread_self ()); - gl_recursive_lock_lock (my_reclock); - check_accounts (); - gl_recursive_lock_unlock (my_reclock); - dbgprintf ("Mutator %p after check unlock\n", gl_thread_self ()); - - yield (); - } - - dbgprintf ("Mutator %p dying.\n", gl_thread_self ()); - return NULL; -} - -static volatile int reclock_checker_done; - -static void * -reclock_checker_thread (void *arg) -{ - while (!reclock_checker_done) - { - dbgprintf ("Checker %p before check lock\n", gl_thread_self ()); - gl_recursive_lock_lock (my_reclock); - check_accounts (); - gl_recursive_lock_unlock (my_reclock); - dbgprintf ("Checker %p after check unlock\n", gl_thread_self ()); - - yield (); - } - - dbgprintf ("Checker %p dying.\n", gl_thread_self ()); - return NULL; -} - -void -test_recursive_lock (void) -{ - int i; - gl_thread_t checkerthread; - gl_thread_t threads[THREAD_COUNT]; - - /* Initialization. */ - for (i = 0; i < ACCOUNT_COUNT; i++) - account[i] = 1000; - reclock_checker_done = 0; - - /* Spawn the threads. */ - checkerthread = gl_thread_create (reclock_checker_thread, NULL); - for (i = 0; i < THREAD_COUNT; i++) - threads[i] = gl_thread_create (reclock_mutator_thread, NULL); - - /* Wait for the threads to terminate. */ - for (i = 0; i < THREAD_COUNT; i++) - gl_thread_join (threads[i], NULL); - reclock_checker_done = 1; - gl_thread_join (checkerthread, NULL); - check_accounts (); -} - -/* Test once-only execution by having several threads attempt to grab a - once-only task simultaneously (triggered by releasing a read-write lock). */ - -gl_once_define(static, fresh_once) -static int ready[THREAD_COUNT]; -static gl_lock_t ready_lock[THREAD_COUNT]; -#if ENABLE_LOCKING -static gl_rwlock_t fire_signal[REPEAT_COUNT]; -#else -static volatile int fire_signal_state; -#endif -static gl_once_t once_control; -static int performed; -gl_lock_define_initialized(static, performed_lock) - -static void -once_execute (void) -{ - gl_lock_lock (performed_lock); - performed++; - gl_lock_unlock (performed_lock); -} - -static void * -once_contender_thread (void *arg) -{ - int id = (int) (long) arg; - int repeat; - - for (repeat = 0; repeat <= REPEAT_COUNT; repeat++) - { - /* Tell the main thread that we're ready. */ - gl_lock_lock (ready_lock[id]); - ready[id] = 1; - gl_lock_unlock (ready_lock[id]); - - if (repeat == REPEAT_COUNT) - break; - - dbgprintf ("Contender %p waiting for signal for round %d\n", - gl_thread_self (), repeat); -#if ENABLE_LOCKING - /* Wait for the signal to go. */ - gl_rwlock_rdlock (fire_signal[repeat]); - /* And don't hinder the others (if the scheduler is unfair). */ - gl_rwlock_unlock (fire_signal[repeat]); -#else - /* Wait for the signal to go. */ - while (fire_signal_state <= repeat) - yield (); -#endif - dbgprintf ("Contender %p got the signal for round %d\n", - gl_thread_self (), repeat); - - /* Contend for execution. */ - gl_once (once_control, once_execute); - } - - return NULL; -} - -void -test_once (void) -{ - int i, repeat; - gl_thread_t threads[THREAD_COUNT]; - - /* Initialize all variables. */ - for (i = 0; i < THREAD_COUNT; i++) - { - ready[i] = 0; - gl_lock_init (ready_lock[i]); - } -#if ENABLE_LOCKING - for (i = 0; i < REPEAT_COUNT; i++) - gl_rwlock_init (fire_signal[i]); -#else - fire_signal_state = 0; -#endif - - /* Block all fire_signals. */ - for (i = REPEAT_COUNT-1; i >= 0; i--) - gl_rwlock_wrlock (fire_signal[i]); - - /* Spawn the threads. */ - for (i = 0; i < THREAD_COUNT; i++) - threads[i] = gl_thread_create (once_contender_thread, (void *) (long) i); - - for (repeat = 0; repeat <= REPEAT_COUNT; repeat++) - { - /* Wait until every thread is ready. */ - dbgprintf ("Main thread before synchonizing for round %d\n", repeat); - for (;;) - { - int ready_count = 0; - for (i = 0; i < THREAD_COUNT; i++) - { - gl_lock_lock (ready_lock[i]); - ready_count += ready[i]; - gl_lock_unlock (ready_lock[i]); - } - if (ready_count == THREAD_COUNT) - break; - yield (); - } - dbgprintf ("Main thread after synchonizing for round %d\n", repeat); - - if (repeat > 0) - { - /* Check that exactly one thread executed the once_execute() - function. */ - if (performed != 1) - abort (); - } - - if (repeat == REPEAT_COUNT) - break; - - /* Preparation for the next round: Initialize once_control. */ - memcpy (&once_control, &fresh_once, sizeof (gl_once_t)); - - /* Preparation for the next round: Reset the performed counter. */ - performed = 0; - - /* Preparation for the next round: Reset the ready flags. */ - for (i = 0; i < THREAD_COUNT; i++) - { - gl_lock_lock (ready_lock[i]); - ready[i] = 0; - gl_lock_unlock (ready_lock[i]); - } - - /* Signal all threads simultaneously. */ - dbgprintf ("Main thread giving signal for round %d\n", repeat); -#if ENABLE_LOCKING - gl_rwlock_unlock (fire_signal[repeat]); -#else - fire_signal_state = repeat + 1; -#endif - } - - /* Wait for the threads to terminate. */ - for (i = 0; i < THREAD_COUNT; i++) - gl_thread_join (threads[i], NULL); -} - -int -main () -{ -#if TEST_PTH_THREADS - if (!pth_init ()) - abort (); -#endif - -#if DO_TEST_LOCK - printf ("Starting test_lock ..."); fflush (stdout); - test_lock (); - printf (" OK\n"); fflush (stdout); -#endif -#if DO_TEST_RWLOCK - printf ("Starting test_rwlock ..."); fflush (stdout); - test_rwlock (); - printf (" OK\n"); fflush (stdout); -#endif -#if DO_TEST_RECURSIVE_LOCK - printf ("Starting test_recursive_lock ..."); fflush (stdout); - test_recursive_lock (); - printf (" OK\n"); fflush (stdout); -#endif -#if DO_TEST_ONCE - printf ("Starting test_once ..."); fflush (stdout); - test_once (); - printf (" OK\n"); fflush (stdout); -#endif - - return 0; -} - -#else - -/* No multithreading available. */ - -#include <stdio.h> - -int -main () -{ - fputs ("Skipping test: multithreading not enabled\n", stderr); - return 77; -} - -#endif diff -ruNp m4-1.4.12/tests/test-lstat.c m4-1.4.13/tests/test-lstat.c --- m4-1.4.12/tests/test-lstat.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-lstat.c 2008-12-11 22:14:17.000000000 -0700 @@ -0,0 +1,37 @@ +/* Test of lstat() function. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Simon Josefsson, 2008. */ + +#include <config.h> + +#include <sys/stat.h> + +#include <stdio.h> + +int +main (int argc, char **argv) +{ + struct stat buf; + + if (lstat ("/", &buf) != 0) + { + perror ("lstat"); + return 1; + } + + return 0; +} diff -ruNp m4-1.4.12/tests/test-mbrtowc.c m4-1.4.13/tests/test-mbrtowc.c --- m4-1.4.12/tests/test-mbrtowc.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-mbrtowc.c 2008-12-24 06:20:33.000000000 -0700 @@ -0,0 +1,330 @@ +/* Test of conversion of multibyte character to wide character. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <wchar.h> + +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +int +main (int argc, char *argv[]) +{ + mbstate_t state; + wchar_t wc; + size_t ret; + + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + /* Test zero-length input. */ + { + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "x", 0, &state); + /* gnulib's implementation returns (size_t)(-2). + The AIX 5.1 implementation returns (size_t)(-1). + glibc's implementation returns 0. */ + ASSERT (ret == (size_t)(-2) || ret == (size_t)(-1) || ret == 0); + ASSERT (mbsinit (&state)); + } + + /* Test NUL byte input. */ + { + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, "", 1, &state); + ASSERT (ret == 0); + ASSERT (wc == 0); + ASSERT (mbsinit (&state)); + ret = mbrtowc (NULL, "", 1, &state); + ASSERT (ret == 0); + ASSERT (mbsinit (&state)); + } + + /* Test single-byte input. */ + { + int c; + char buf[1]; + + memset (&state, '\0', sizeof (mbstate_t)); + for (c = 0; c < 0x100; c++) + switch (c) + { + case '\t': case '\v': case '\f': + case ' ': case '!': case '"': case '#': case '%': + case '&': case '\'': case '(': case ')': 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 ';': case '<': case '=': 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': + case '[': case '\\': case ']': 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': case '{': case '|': case '}': case '~': + /* c is in the ISO C "basic character set". */ + buf[0] = c; + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, buf, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == c); + ASSERT (mbsinit (&state)); + ret = mbrtowc (NULL, buf, 1, &state); + ASSERT (ret == 1); + ASSERT (mbsinit (&state)); + break; + } + } + + /* Test special calling convention, passing a NULL pointer. */ + { + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, NULL, 5, &state); + ASSERT (ret == 0); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (mbsinit (&state)); + } + + if (argc > 1) + switch (argv[1][0]) + { + case '1': + /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ + { + char input[] = "B\374\337er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\374'); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 3, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == (unsigned char) '\337'); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 2, &state); + ASSERT (ret == 1); + ASSERT (wc == 'e'); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 4, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'r'); + ASSERT (mbsinit (&state)); + } + return 0; + + case '2': + /* Locale encoding is UTF-8. */ + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[1] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 5, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 4, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + input[4] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 5, 2, &state); + ASSERT (ret == 1); + ASSERT (wc == 'e'); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 6, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'r'); + ASSERT (mbsinit (&state)); + } + return 0; + + case '3': + /* Locale encoding is EUC-JP. */ + { + char input[] = "<\306\374\313\334\270\354>"; /* "<日本語>" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '<'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 2, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[1] = '\0'; + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[3] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 4, 4, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[4] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + input[6] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 7, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == '>'); + ASSERT (mbsinit (&state)); + } + return 0; + + case '4': + /* Locale encoding is GB18030. */ + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + memset (&state, '\0', sizeof (mbstate_t)); + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'B'); + ASSERT (mbsinit (&state)); + input[0] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 1, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (wc == (wchar_t) 0xBADFACE); + ASSERT (!mbsinit (&state)); + input[1] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 2, 7, &state); + ASSERT (ret == 1); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[2] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 3, 6, &state); + ASSERT (ret == 4); + ASSERT (wctob (wc) == EOF); + ASSERT (mbsinit (&state)); + input[3] = '\0'; + input[4] = '\0'; + input[5] = '\0'; + input[6] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 7, 2, &state); + ASSERT (ret == 1); + ASSERT (wc == 'e'); + ASSERT (mbsinit (&state)); + input[5] = '\0'; + + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input + 8, 1, &state); + ASSERT (ret == 1); + ASSERT (wc == 'r'); + ASSERT (mbsinit (&state)); + } + return 0; + } + + return 1; +} diff -ruNp m4-1.4.12/tests/test-mbrtowc1.sh m4-1.4.13/tests/test-mbrtowc1.sh --- m4-1.4.12/tests/test-mbrtowc1.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-mbrtowc1.sh 2008-12-24 06:20:33.000000000 -0700 @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test in an ISO-8859-1 or ISO-8859-15 locale. +: ${LOCALE_FR=fr_FR} +if test $LOCALE_FR = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no traditional french locale is installed" + else + echo "Skipping test: no traditional french locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR \ +./test-mbrtowc${EXEEXT} 1 diff -ruNp m4-1.4.12/tests/test-mbrtowc2.sh m4-1.4.13/tests/test-mbrtowc2.sh --- m4-1.4.12/tests/test-mbrtowc2.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-mbrtowc2.sh 2008-12-24 06:20:33.000000000 -0700 @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no french Unicode locale is installed" + else + echo "Skipping test: no french Unicode locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR_UTF8 \ +./test-mbrtowc${EXEEXT} 2 diff -ruNp m4-1.4.12/tests/test-mbrtowc3.sh m4-1.4.13/tests/test-mbrtowc3.sh --- m4-1.4.12/tests/test-mbrtowc3.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-mbrtowc3.sh 2008-12-24 06:20:33.000000000 -0700 @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific EUC-JP locale is installed. +: ${LOCALE_JA=ja_JP} +if test $LOCALE_JA = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no traditional japanese locale is installed" + else + echo "Skipping test: no traditional japanese locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_JA \ +./test-mbrtowc${EXEEXT} 3 diff -ruNp m4-1.4.12/tests/test-mbrtowc4.sh m4-1.4.13/tests/test-mbrtowc4.sh --- m4-1.4.12/tests/test-mbrtowc4.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-mbrtowc4.sh 2009-02-18 19:14:05.000000000 -0700 @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific GB18030 locale is installed. +: ${LOCALE_ZH_CN=zh_CN.GB18030} +if test $LOCALE_ZH_CN = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no transitional chinese locale is installed" + else + echo "Skipping test: no transitional chinese locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_ZH_CN \ +./test-mbrtowc${EXEEXT} 4 diff -ruNp m4-1.4.12/tests/test-mbsinit.c m4-1.4.13/tests/test-mbsinit.c --- m4-1.4.12/tests/test-mbsinit.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-mbsinit.c 2008-12-24 06:20:33.000000000 -0700 @@ -0,0 +1,62 @@ +/* Test of test for initial conversion state. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <wchar.h> + +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +int +main (int argc, char *argv[]) +{ + static mbstate_t state; + + ASSERT (mbsinit (&state)); + + if (argc > 1) + { + static const char input[1] = "\303"; + wchar_t wc; + size_t ret; + + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + ret = mbrtowc (&wc, input, 1, &state); + ASSERT (ret == (size_t)(-2)); + ASSERT (!mbsinit (&state)); + } + + return 0; +} diff -ruNp m4-1.4.12/tests/test-mbsinit.sh m4-1.4.13/tests/test-mbsinit.sh --- m4-1.4.12/tests/test-mbsinit.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-mbsinit.sh 2008-12-24 06:20:33.000000000 -0700 @@ -0,0 +1,15 @@ +#!/bin/sh + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 = none; then + if test -f /usr/bin/localedef; then + echo "Skipping test: no french Unicode locale is installed" + else + echo "Skipping test: no french Unicode locale is supported" + fi + exit 77 +fi + +LC_ALL=$LOCALE_FR_UTF8 \ +./test-mbsinit${EXEEXT} diff -ruNp m4-1.4.12/tests/test-memchr.c m4-1.4.13/tests/test-memchr.c --- m4-1.4.12/tests/test-memchr.c 2008-09-15 21:42:03.000000000 -0600 +++ m4-1.4.13/tests/test-memchr.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2008 Free Software Foundation - * Written by Eric Blake and Bruno Haible - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -#include <config.h> - -#include <string.h> - -#include <stdio.h> -#include <stdlib.h> - -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) - -/* Calculating void * + int is not portable, so this wrapper converts - to char * to make the tests easier to write. */ -#define MEMCHR (char *) memchr - -int -main () -{ - void *nil = NULL; /* Use to avoid gcc attribute((nonnull)) warnings. */ - - size_t n = 0x100000; - char *input = malloc (n); - ASSERT (input); - - input[0] = 'a'; - input[1] = 'b'; - memset (input + 2, 'c', 1024); - memset (input + 1026, 'd', n - 1028); - input[n - 2] = 'e'; - input[n - 1] = 'a'; - - /* Basic behavior tests. */ - ASSERT (MEMCHR (input, 'a', n) == input); - - ASSERT (MEMCHR (input, 'a', 0) == NULL); - ASSERT (MEMCHR (nil, 'a', 0) == NULL); - - ASSERT (MEMCHR (input, 'b', n) == input + 1); - ASSERT (MEMCHR (input, 'c', n) == input + 2); - ASSERT (MEMCHR (input, 'd', n) == input + 1026); - - ASSERT (MEMCHR (input + 1, 'a', n - 1) == input + n - 1); - ASSERT (MEMCHR (input + 1, 'e', n - 1) == input + n - 2); - - ASSERT (MEMCHR (input, 'f', n) == NULL); - ASSERT (MEMCHR (input, '\0', n) == NULL); - - /* Check that a very long haystack is handled quickly if the byte is - found near the beginning. */ - { - size_t repeat = 10000; - for (; repeat > 0; repeat--) - { - ASSERT (MEMCHR (input, 'c', n) == input + 2); - } - } - - /* Alignment tests. */ - { - int i, j; - for (i = 0; i < 32; i++) - { - for (j = 0; j < 256; j++) - input[i + j] = j; - for (j = 0; j < 256; j++) - { - ASSERT (MEMCHR (input + i, j, 256) == input + i + j); - } - } - } - - free (input); - - return 0; -} diff -ruNp m4-1.4.12/tests/test-memchr2.c m4-1.4.13/tests/test-memchr2.c --- m4-1.4.12/tests/test-memchr2.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-memchr2.c 2009-02-18 19:13:15.000000000 -0700 @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2008 Free Software Foundation + * Written by Eric Blake + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "memchr2.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +/* Calculating void * + int is not portable, so this wrapper converts + to char * to make the tests easier to write. */ +#define MEMCHR2 (char *) memchr2 + +int +main () +{ + size_t n = 0x100000; + char *input = malloc (n); + ASSERT (input); + + input[0] = 'a'; + input[1] = 'b'; + memset (input + 2, 'c', 1024); + memset (input + 1026, 'd', n - 1028); + input[n - 2] = 'e'; + input[n - 1] = 'a'; + + /* Basic behavior tests. */ + ASSERT (MEMCHR2 (input, 'a', 'b', n) == input); + ASSERT (MEMCHR2 (input, 'b', 'a', n) == input); + + ASSERT (MEMCHR2 (input, 'a', 'b', 0) == NULL); + ASSERT (MEMCHR2 (NULL, 'a', 'b', 0) == NULL); + + ASSERT (MEMCHR2 (input, 'b', 'd', n) == input + 1); + ASSERT (MEMCHR2 (input + 2, 'b', 'd', n - 2) == input + 1026); + + ASSERT (MEMCHR2 (input, 'd', 'e', n) == input + 1026); + ASSERT (MEMCHR2 (input, 'e', 'd', n) == input + 1026); + + ASSERT (MEMCHR2 (input + 1, 'a', 'e', n - 1) == input + n - 2); + ASSERT (MEMCHR2 (input + 1, 'e', 'a', n - 1) == input + n - 2); + + ASSERT (MEMCHR2 (input, 'f', 'g', n) == NULL); + ASSERT (MEMCHR2 (input, 'f', '\0', n) == NULL); + + ASSERT (MEMCHR2 (input, 'a', 'a', n) == input); + ASSERT (MEMCHR2 (input + 1, 'a', 'a', n - 1) == input + n - 1); + ASSERT (MEMCHR2 (input, 'f', 'f', n) == NULL); + + /* Check that a very long haystack is handled quickly if one of the + two bytes is found near the beginning. */ + { + size_t repeat = 10000; + for (; repeat > 0; repeat--) + { + ASSERT (MEMCHR2 (input, 'c', 'e', n) == input + 2); + ASSERT (MEMCHR2 (input, 'e', 'c', n) == input + 2); + ASSERT (MEMCHR2 (input, 'c', '\0', n) == input + 2); + ASSERT (MEMCHR2 (input, '\0', 'c', n) == input + 2); + } + } + + /* Alignment tests. */ + { + int i, j; + for (i = 0; i < 32; i++) + { + for (j = 0; j < 256; j++) + input[i + j] = j; + for (j = 0; j < 256; j++) + { + ASSERT (MEMCHR2 (input + i, j, 0xff, 256) == input + i + j); + ASSERT (MEMCHR2 (input + i, 0xff, j, 256) == input + i + j); + } + } + } + + free (input); + + return 0; +} diff -ruNp m4-1.4.12/tests/test-memcmp.c m4-1.4.13/tests/test-memcmp.c --- m4-1.4.12/tests/test-memcmp.c 2008-08-05 07:16:35.000000000 -0600 +++ m4-1.4.13/tests/test-memcmp.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2008 Free Software Foundation - * Written by Simon Josefsson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -#include <config.h> - -#include <string.h> - -#include <stdio.h> -#include <stdlib.h> - -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) - -int -main (void) -{ - void *nil = NULL; /* Use to avoid gcc attribute((nonnull)) warnings. */ - - /* Test equal / not equal distinction. */ - ASSERT (memcmp (nil, nil, 0) == 0); - ASSERT (memcmp ("foo", "foobar", 2) == 0); - ASSERT (memcmp ("foo", "foobar", 3) == 0); - ASSERT (memcmp ("foo", "foobar", 4) != 0); - ASSERT (memcmp ("foo", "bar", 1) != 0); - ASSERT (memcmp ("foo", "bar", 3) != 0); - - /* Test less / equal / greater distinction. */ - ASSERT (memcmp ("foo", "moo", 4) < 0); - ASSERT (memcmp ("moo", "foo", 4) > 0); - ASSERT (memcmp ("oomph", "oops", 3) < 0); - ASSERT (memcmp ("oops", "oomph", 3) > 0); - ASSERT (memcmp ("foo", "foobar", 4) < 0); - ASSERT (memcmp ("foobar", "foo", 4) > 0); - - /* Some old versions of memcmp were not 8-bit clean. */ - ASSERT (memcmp ("\100", "\201", 1) < 0); - ASSERT (memcmp ("\201", "\100", 1) > 0); - ASSERT (memcmp ("\200", "\201", 1) < 0); - ASSERT (memcmp ("\201", "\200", 1) > 0); - - /* The Next x86 OpenStep bug shows up only when comparing 16 bytes - or more and with at least one buffer not starting on a 4-byte boundary. - William Lewis provided this test program. */ - { - char foo[21]; - char bar[21]; - int i; - for (i = 0; i < 4; i++) - { - char *a = foo + i; - char *b = bar + i; - strcpy (a, "--------01111111"); - strcpy (b, "--------10000000"); - ASSERT (memcmp (a, b, 16) < 0); - } - } - - return 0; -} diff -ruNp m4-1.4.12/tests/test-posix_spawn1.c m4-1.4.13/tests/test-posix_spawn1.c --- m4-1.4.12/tests/test-posix_spawn1.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-posix_spawn1.c 2009-02-28 08:25:59.000000000 -0700 @@ -0,0 +1,144 @@ +/* Test of posix_spawn() function. + Copyright (C) 2008, 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <spawn.h> + +#include <errno.h> +#include <fcntl.h> +#include <signal.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> + +extern char **environ; + +#define CHILD_PROGRAM_FILENAME "test-posix_spawn1.sh" + +static int +fd_safer (int fd) +{ + if (0 <= fd && fd <= 2) + { + int f = fd_safer (dup (fd)); + int e = errno; + close (fd); + errno = e; + fd = f; + } + + return fd; +} + +int +main () +{ + char *argv[3] = { "/bin/sh", CHILD_PROGRAM_FILENAME, NULL }; + int ifd[2]; + sigset_t blocked_signals; + sigset_t fatal_signal_set; + posix_spawn_file_actions_t actions; + bool actions_allocated; + posix_spawnattr_t attrs; + bool attrs_allocated; + int err; + pid_t child; + int fd; + FILE *fp; + char line[80]; + int status; + int exitstatus; + + if (pipe (ifd) < 0 || (ifd[0] = fd_safer (ifd[0])) < 0) + { + perror ("cannot create pipe"); + exit (1); + } + sigprocmask (SIG_SETMASK, NULL, &blocked_signals); + sigemptyset (&fatal_signal_set); + sigaddset (&fatal_signal_set, SIGINT); + sigaddset (&fatal_signal_set, SIGTERM); + sigaddset (&fatal_signal_set, SIGHUP); + sigaddset (&fatal_signal_set, SIGPIPE); + sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL); + actions_allocated = false; + attrs_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (err = posix_spawn_file_actions_adddup2 (&actions, ifd[1], STDOUT_FILENO)) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ifd[1])) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ifd[0])) != 0 + || (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, "/dev/null", O_RDONLY, 0)) != 0 + || (err = posix_spawnattr_init (&attrs)) != 0 + || (attrs_allocated = true, + (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0 + || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0) + || (err = posix_spawnp (&child, "/bin/sh", &actions, &attrs, argv, environ)) != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + if (attrs_allocated) + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + errno = err; + perror ("subprocess failed"); + exit (1); + } + posix_spawn_file_actions_destroy (&actions); + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + close (ifd[1]); + fd = ifd[0]; + fp = fdopen (fd, "r"); + if (fp == NULL) + { + fprintf (stderr, "fdopen() failed\n"); + exit (1); + } + if (fread (line, 1, 80, fp) < 12) + { + fprintf (stderr, "could not read expected output\n"); + exit (1); + } + if (memcmp (line, "Halle Potta", 11) != 0) + { + fprintf (stderr, "read output is not the expected output"); + exit (1); + } + fclose (fp); + status = 0; + while (waitpid (child, &status, 0) != child) + ; + if (!WIFEXITED (status)) + { + fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status); + exit (1); + } + exitstatus = WEXITSTATUS (status); + if (exitstatus != 0) + { + fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus); + exit (1); + } + return 0; +} diff -ruNp m4-1.4.12/tests/test-posix_spawn1.in.sh m4-1.4.13/tests/test-posix_spawn1.in.sh --- m4-1.4.12/tests/test-posix_spawn1.in.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-posix_spawn1.in.sh 2009-02-28 08:25:59.000000000 -0700 @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Halle Potta" diff -ruNp m4-1.4.12/tests/test-posix_spawn2.c m4-1.4.13/tests/test-posix_spawn2.c --- m4-1.4.12/tests/test-posix_spawn2.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-posix_spawn2.c 2009-02-28 08:25:59.000000000 -0700 @@ -0,0 +1,139 @@ +/* Test of posix_spawn() function. + Copyright (C) 2008, 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <spawn.h> + +#include <errno.h> +#include <fcntl.h> +#include <signal.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> + +extern char **environ; + +#define CHILD_PROGRAM_FILENAME "test-posix_spawn2.sh" + +static int +fd_safer (int fd) +{ + if (0 <= fd && fd <= 2) + { + int f = fd_safer (dup (fd)); + int e = errno; + close (fd); + errno = e; + fd = f; + } + + return fd; +} + +int +main () +{ + char *argv[3] = { "/bin/sh", CHILD_PROGRAM_FILENAME, NULL }; + int ofd[2]; + sigset_t blocked_signals; + sigset_t fatal_signal_set; + posix_spawn_file_actions_t actions; + bool actions_allocated; + posix_spawnattr_t attrs; + bool attrs_allocated; + int err; + pid_t child; + int fd; + FILE *fp; + int written; + int status; + int exitstatus; + + if (pipe (ofd) < 0 || (ofd[1] = fd_safer (ofd[1])) < 0) + { + perror ("cannot create pipe"); + exit (1); + } + sigprocmask (SIG_SETMASK, NULL, &blocked_signals); + sigemptyset (&fatal_signal_set); + sigaddset (&fatal_signal_set, SIGINT); + sigaddset (&fatal_signal_set, SIGTERM); + sigaddset (&fatal_signal_set, SIGHUP); + sigaddset (&fatal_signal_set, SIGPIPE); + sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL); + actions_allocated = false; + attrs_allocated = false; + if ((err = posix_spawn_file_actions_init (&actions)) != 0 + || (actions_allocated = true, + (err = posix_spawn_file_actions_adddup2 (&actions, ofd[0], STDIN_FILENO)) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ofd[0])) != 0 + || (err = posix_spawn_file_actions_addclose (&actions, ofd[1])) != 0 + || (err = posix_spawnattr_init (&attrs)) != 0 + || (attrs_allocated = true, + (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0 + || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0) + || (err = posix_spawnp (&child, "/bin/sh", &actions, &attrs, argv, environ)) != 0)) + { + if (actions_allocated) + posix_spawn_file_actions_destroy (&actions); + if (attrs_allocated) + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + errno = err; + perror ("subprocess failed"); + exit (1); + } + posix_spawn_file_actions_destroy (&actions); + posix_spawnattr_destroy (&attrs); + sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL); + close (ofd[0]); + fd = ofd[1]; + fp = fdopen (fd, "w"); + if (fp == NULL) + { + fprintf (stderr, "fdopen() failed\n"); + exit (1); + } + written = fwrite ("Halle Potta\n", 1, 12, fp); + if (written < 12) + { + fprintf (stderr, "could not write input\n"); + exit (1); + } + fclose (fp); + status = 0; + while (waitpid (child, &status, 0) != child) + ; + if (!WIFEXITED (status)) + { + fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status); + exit (1); + } + exitstatus = WEXITSTATUS (status); + if (exitstatus != 0) + { + fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus); + exit (1); + } + return 0; +} diff -ruNp m4-1.4.12/tests/test-posix_spawn2.in.sh m4-1.4.13/tests/test-posix_spawn2.in.sh --- m4-1.4.12/tests/test-posix_spawn2.in.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-posix_spawn2.in.sh 2009-02-28 08:25:59.000000000 -0700 @@ -0,0 +1,3 @@ +#!/bin/sh +read line +test "$line" = "Halle Potta" diff -ruNp m4-1.4.12/tests/test-quotearg.c m4-1.4.13/tests/test-quotearg.c --- m4-1.4.12/tests/test-quotearg.c 2008-08-05 07:17:31.000000000 -0600 +++ m4-1.4.13/tests/test-quotearg.c 2009-01-25 19:38:22.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of quotearg family of functions. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,25 +22,15 @@ #include "quotearg.h" #include <ctype.h> +#include <locale.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#if ENABLE_NLS -/* On Linux, gettext is optionally defined as a forwarding macro, - which would cause syntax errors in our definition below. But on - platforms that require -lintl, we cannot #undef gettext, since we - want to provide the entry point libintl_gettext. So we disable - optimizations to avoid the Linux macros. */ -# undef __OPTIMIZE__ -# include <libintl.h> - -/* These quotes are borrowed from a pt_PT.utf8 translation. */ -# define LQ "\302\253" -# define RQ "\302\273" -#endif +#include "progname.h" +#include "gettext.h" #define ASSERT(expr) \ do \ @@ -161,6 +151,11 @@ static struct result_groups flag_results }; #if ENABLE_NLS + +/* These quotes are borrowed from a pt_PT.utf8 translation. */ +# define LQ "\302\253" +# define RQ "\302\273" + static struct result_groups locale_results[] = { /* locale_quoting_style */ { { LQ RQ, LQ "\\0001\\0" RQ, 11, LQ "simple" RQ, @@ -178,6 +173,7 @@ static struct result_groups locale_resul { LQ RQ, LQ "\\0001\\0" RQ, 11, LQ "simple" RQ, LQ " \\t\\n'\"\\033?""?/\\\\" RQ, LQ "a\\:b" RQ, LQ "a\\\\b" RQ } } }; + #endif /* ENABLE_NLS */ static void @@ -249,46 +245,14 @@ use_quotearg_colon (const char *str, siz return p; } -#if ENABLE_NLS -/* True if the locale should be faked. */ -static bool fake_locale; - -/* A replacement gettext that allows testing of locale quotes without - requiring a locale. */ -char * -gettext (char const *str) -{ - if (fake_locale) - { - static char lq[] = LQ; - static char rq[] = RQ; - if (strcmp (str, "`") == 0) - return lq; - if (strcmp (str, "'") == 0) - return rq; - } - return (char *) str; -} - -char * -dgettext (char const *d, char const *str) -{ - return gettext (str); -} - -char * -dcgettext (char const *d, char const *str, int c) -{ - return gettext (str); -} -#endif /* ENABLE_NLS */ - int -main () +main (int argc, char *argv[]) { int i; - /* This program is hard-wired to the C locale since it does not call + set_program_name (argv[0]); + + /* This program part is hard-wired to the C locale since it does not call setlocale. */ ASSERT (!isprint ('\033')); for (i = literal_quoting_style; i <= clocale_quoting_style; i++) @@ -321,21 +285,37 @@ main () ASSERT (set_quoting_flags (NULL, 0) == QA_SPLIT_TRIGRAPHS); #if ENABLE_NLS - /* Rather than change locales, and require a .gmo file with - translations for "`" and "'" that match our expectations, we - merely override the gettext function to satisfy the link - dependencies of quotearg.c. */ - fake_locale = true; - - set_quoting_style (NULL, locale_quoting_style); - compare_strings (use_quotearg_buffer, &locale_results[0].group1); - compare_strings (use_quotearg, &locale_results[0].group2); - compare_strings (use_quotearg_colon, &locale_results[0].group3); - - set_quoting_style (NULL, clocale_quoting_style); - compare_strings (use_quotearg_buffer, &locale_results[1].group1); - compare_strings (use_quotearg, &locale_results[1].group2); - compare_strings (use_quotearg_colon, &locale_results[1].group3); + /* Clean up environment. */ + unsetenv ("LANGUAGE"); + unsetenv ("LC_ALL"); + unsetenv ("LC_MESSAGES"); + unsetenv ("LC_CTYPE"); + unsetenv ("LANG"); + unsetenv ("OUTPUT_CHARSET"); + + /* This program part runs in a French UTF-8 locale. It uses + the test-quotearg.mo message catalog. */ + { + const char *locale_name = getenv ("LOCALE"); + + if (locale_name != NULL && strcmp (locale_name, "none") != 0 + && setenv ("LC_ALL", locale_name, 1) == 0 + && setlocale (LC_ALL, "") != NULL) + { + textdomain ("test-quotearg"); + bindtextdomain ("test-quotearg", getenv ("LOCALEDIR")); + + set_quoting_style (NULL, locale_quoting_style); + compare_strings (use_quotearg_buffer, &locale_results[0].group1); + compare_strings (use_quotearg, &locale_results[0].group2); + compare_strings (use_quotearg_colon, &locale_results[0].group3); + + set_quoting_style (NULL, clocale_quoting_style); + compare_strings (use_quotearg_buffer, &locale_results[1].group1); + compare_strings (use_quotearg, &locale_results[1].group2); + compare_strings (use_quotearg_colon, &locale_results[1].group3); + } + } #endif /* ENABLE_NLS */ quotearg_free (); diff -ruNp m4-1.4.12/tests/test-quotearg.sh m4-1.4.13/tests/test-quotearg.sh --- m4-1.4.12/tests/test-quotearg.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-quotearg.sh 2009-01-25 19:37:32.000000000 -0700 @@ -0,0 +1,16 @@ +#!/bin/sh + +# Choose an existing locale. The locale encoding does not matter; see the +# comment in test-quotearg.po. +if test $LOCALE_FR_UTF8 != none; then + locale=$LOCALE_FR_UTF8 +else + if test $LOCALE_FR != none; then + locale=$LOCALE_FR + else + locale=none + fi +fi + +LOCALE=$locale LOCALEDIR="$srcdir/locale" \ +./test-quotearg${EXEEXT} diff -ruNp m4-1.4.12/tests/test-rawmemchr.c m4-1.4.13/tests/test-rawmemchr.c --- m4-1.4.12/tests/test-rawmemchr.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-rawmemchr.c 2009-02-28 08:25:59.000000000 -0700 @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2008 Free Software Foundation + * Written by Eric Blake and Bruno Haible + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <string.h> + +#include <stdio.h> +#include <stdlib.h> + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +/* Calculating void * + int is not portable, so this wrapper converts + to char * to make the tests easier to write. */ +#define RAWMEMCHR (char *) rawmemchr + +int +main () +{ + size_t n = 0x100000; + char *input = malloc (n + 1); + ASSERT (input); + + input[0] = 'a'; + input[1] = 'b'; + memset (input + 2, 'c', 1024); + memset (input + 1026, 'd', n - 1028); + input[n - 2] = 'e'; + input[n - 1] = 'a'; + input[n] = '\0'; + + /* Basic behavior tests. */ + ASSERT (RAWMEMCHR (input, 'a') == input); + ASSERT (RAWMEMCHR (input, 'b') == input + 1); + ASSERT (RAWMEMCHR (input, 'c') == input + 2); + ASSERT (RAWMEMCHR (input, 'd') == input + 1026); + + ASSERT (RAWMEMCHR (input + 1, 'a') == input + n - 1); + ASSERT (RAWMEMCHR (input + 1, 'e') == input + n - 2); + + ASSERT (RAWMEMCHR (input, '\0') == input + n); + + /* Alignment tests. */ + { + int i, j; + for (i = 0; i < 32; i++) + { + for (j = 0; j < 256; j++) + input[i + j] = j; + for (j = 0; j < 256; j++) + { + ASSERT (RAWMEMCHR (input + i, j) == input + i + j); + } + } + } + + free (input); + + return 0; +} diff -ruNp m4-1.4.12/tests/test-sched.c m4-1.4.13/tests/test-sched.c --- m4-1.4.12/tests/test-sched.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-sched.c 2009-03-01 16:12:26.000000000 -0700 @@ -0,0 +1,38 @@ +/* Test of <sched.h> substitute. + Copyright (C) 2008-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <sched.h> + +/* Check that 'struct sched_param' is defined. */ +static struct sched_param a; + +/* Check that the SCHED_* macros are defined and compile-time constants. */ +int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER }; + +static int f1; + +int +main () +{ + /* Check fields of 'struct sched_param'. */ + f1 = a.sched_priority; + + return 0; +} diff -ruNp m4-1.4.12/tests/test-signal.c m4-1.4.13/tests/test-signal.c --- m4-1.4.12/tests/test-signal.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-signal.c 2009-03-23 05:55:03.000000000 -0600 @@ -0,0 +1,28 @@ +/* Test of <signal.h> substitute. + Copyright (C) 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Eric Blake <ebb9@byu.net>, 2009. */ + +#include <config.h> + +#include <signal.h> + +volatile sig_atomic_t s; + +int main () +{ + return s; +} diff -ruNp m4-1.4.12/tests/test-signbit.c m4-1.4.13/tests/test-signbit.c --- m4-1.4.12/tests/test-signbit.c 2008-10-09 21:05:00.000000000 -0600 +++ m4-1.4.13/tests/test-signbit.c 2009-01-16 06:26:48.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of signbit() substitute. - Copyright (C) 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,8 +48,20 @@ long double zerol = 0.0L; So we use -zerod instead. */ /* On HP-UX 10.20, negating 0.0L does not yield -0.0L. - So we use minus_zerol instead. */ -long double minus_zerol = -LDBL_MIN * LDBL_MIN; + So we use minus_zerol instead. + IRIX cc can't put -0.0L into .data, but can compute at runtime. + Note that the expression -LDBL_MIN * LDBL_MIN does not work on other + platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */ +#if defined __hpux || defined __sgi +static long double +compute_minus_zerol (void) +{ + return -LDBL_MIN * LDBL_MIN; +} +# define minus_zerol compute_minus_zerol () +#else +long double minus_zerol = -0.0L; +#endif static void test_signbitf () diff -ruNp m4-1.4.12/tests/test-strchrnul.c m4-1.4.13/tests/test-strchrnul.c --- m4-1.4.12/tests/test-strchrnul.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-strchrnul.c 2009-02-28 08:25:59.000000000 -0700 @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2008 Free Software Foundation + * Written by Eric Blake and Bruno Haible + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <string.h> + +#include <stdio.h> +#include <stdlib.h> + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +int +main () +{ + size_t n = 0x100000; + char *input = malloc (n + 1); + ASSERT (input); + + input[0] = 'a'; + input[1] = 'b'; + memset (input + 2, 'c', 1024); + memset (input + 1026, 'd', n - 1028); + input[n - 2] = 'e'; + input[n - 1] = 'a'; + input[n] = '\0'; + + /* Basic behavior tests. */ + ASSERT (strchrnul (input, 'a') == input); + ASSERT (strchrnul (input, 'b') == input + 1); + ASSERT (strchrnul (input, 'c') == input + 2); + ASSERT (strchrnul (input, 'd') == input + 1026); + + ASSERT (strchrnul (input + 1, 'a') == input + n - 1); + ASSERT (strchrnul (input + 1, 'e') == input + n - 2); + + ASSERT (strchrnul (input, 'f') == input + n); + ASSERT (strchrnul (input, '\0') == input + n); + + /* Check that a very long haystack is handled quickly if the byte is + found near the beginning. */ + { + size_t repeat = 10000; + for (; repeat > 0; repeat--) + { + ASSERT (strchrnul (input, 'c') == input + 2); + } + } + + /* Alignment tests. */ + { + int i, j; + for (i = 0; i < 32; i++) + { + for (j = 0; j < 256; j++) + input[i + j] = (j + 1) & 0xff; + for (j = 1; j < 256; j++) + { + ASSERT (strchrnul (input + i, j) == input + i + j - 1); + input[i + j - 1] = (j == 1 ? 2 : 1); + ASSERT (strchrnul (input + i, j) == input + i + 255); + input[i + j - 1] = j; + } + } + } + + free (input); + + return 0; +} diff -ruNp m4-1.4.12/tests/test-tls.c m4-1.4.13/tests/test-tls.c --- m4-1.4.12/tests/test-tls.c 2008-10-09 21:05:02.000000000 -0600 +++ m4-1.4.13/tests/test-tls.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,206 +0,0 @@ -/* Test of thread-local storage in multithreaded situations. - Copyright (C) 2005, 2008 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* Written by Bruno Haible <bruno@clisp.org>, 2005. */ - -#include <config.h> - -#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WIN32_THREADS - -#if USE_POSIX_THREADS -# define TEST_POSIX_THREADS 1 -#endif -#if USE_SOLARIS_THREADS -# define TEST_SOLARIS_THREADS 1 -#endif -#if USE_PTH_THREADS -# define TEST_PTH_THREADS 1 -#endif -#if USE_WIN32_THREADS -# define TEST_WIN32_THREADS 1 -#endif - -/* Whether to help the scheduler through explicit yield(). - Uncomment this to see if the operating system has a fair scheduler. */ -#define EXPLICIT_YIELD 1 - -/* Whether to print debugging messages. */ -#define ENABLE_DEBUGGING 0 - -/* Number of simultaneous threads. */ -#define THREAD_COUNT 16 - -/* Number of operations performed in each thread. */ -#define REPEAT_COUNT 50000 - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "glthread/tls.h" -#include "glthread/thread.h" -#include "glthread/yield.h" - -#if ENABLE_DEBUGGING -# define dbgprintf printf -#else -# define dbgprintf if (0) printf -#endif - -#if EXPLICIT_YIELD -# define yield() gl_thread_yield () -#else -# define yield() -#endif - -static inline void -perhaps_yield (void) -{ - /* Call yield () only with a certain probability, otherwise with GNU Pth - the sequence of thread activations is too predictable. */ - if ((((unsigned int) rand () >> 3) % 4) == 0) - yield (); -} - -#define KEYS_COUNT 4 - -static gl_tls_key_t mykeys[KEYS_COUNT]; - -static void * -worker_thread (void *arg) -{ - unsigned int id = (unsigned int) (unsigned long) arg; - int i, j, repeat; - unsigned int values[KEYS_COUNT]; - - dbgprintf ("Worker %p started\n", gl_thread_self ()); - - /* Initialize the per-thread storage. */ - for (i = 0; i < KEYS_COUNT; i++) - { - values[i] = (((unsigned int) rand() >> 3) % 1000000) * THREAD_COUNT + id; - /* Hopefully no arithmetic overflow. */ - if ((values[i] % THREAD_COUNT) != id) - abort (); - } - perhaps_yield (); - - /* Verify that the initial value is NULL. */ - dbgprintf ("Worker %p before initial verify\n", gl_thread_self ()); - for (i = 0; i < KEYS_COUNT; i++) - if (gl_tls_get (mykeys[i]) != NULL) - abort (); - dbgprintf ("Worker %p after initial verify\n", gl_thread_self ()); - perhaps_yield (); - - /* Initialize the per-thread storage. */ - dbgprintf ("Worker %p before first tls_set\n", gl_thread_self ()); - for (i = 0; i < KEYS_COUNT; i++) - { - unsigned int *ptr = (unsigned int *) malloc (sizeof (unsigned int)); - *ptr = values[i]; - gl_tls_set (mykeys[i], ptr); - } - dbgprintf ("Worker %p after first tls_set\n", gl_thread_self ()); - perhaps_yield (); - - /* Shuffle around the pointers. */ - for (repeat = REPEAT_COUNT; repeat > 0; repeat--) - { - dbgprintf ("Worker %p doing value swapping\n", gl_thread_self ()); - i = ((unsigned int) rand() >> 3) % KEYS_COUNT; - j = ((unsigned int) rand() >> 3) % KEYS_COUNT; - if (i != j) - { - void *vi = gl_tls_get (mykeys[i]); - void *vj = gl_tls_get (mykeys[j]); - - gl_tls_set (mykeys[i], vj); - gl_tls_set (mykeys[j], vi); - } - perhaps_yield (); - } - - /* Verify that all the values are from this thread. */ - dbgprintf ("Worker %p before final verify\n", gl_thread_self ()); - for (i = 0; i < KEYS_COUNT; i++) - if ((*(unsigned int *) gl_tls_get (mykeys[i]) % THREAD_COUNT) != id) - abort (); - dbgprintf ("Worker %p after final verify\n", gl_thread_self ()); - perhaps_yield (); - - dbgprintf ("Worker %p dying.\n", gl_thread_self ()); - return NULL; -} - -void -test_tls (void) -{ - int pass, i; - - for (pass = 0; pass < 2; pass++) - { - gl_thread_t threads[THREAD_COUNT]; - - if (pass == 0) - for (i = 0; i < KEYS_COUNT; i++) - gl_tls_key_init (mykeys[i], free); - else - for (i = KEYS_COUNT - 1; i >= 0; i--) - gl_tls_key_init (mykeys[i], free); - - /* Spawn the threads. */ - for (i = 0; i < THREAD_COUNT; i++) - threads[i] = gl_thread_create (worker_thread, NULL); - - /* Wait for the threads to terminate. */ - for (i = 0; i < THREAD_COUNT; i++) - gl_thread_join (threads[i], NULL); - - for (i = 0; i < KEYS_COUNT; i++) - gl_tls_key_destroy (mykeys[i]); - } -} - -int -main () -{ -#if TEST_PTH_THREADS - if (!pth_init ()) - abort (); -#endif - - printf ("Starting test_tls ..."); fflush (stdout); - test_tls (); - printf (" OK\n"); fflush (stdout); - - return 0; -} - -#else - -/* No multithreading available. */ - -#include <stdio.h> - -int -main () -{ - fputs ("Skipping test: multithreading not enabled\n", stderr); - return 77; -} - -#endif diff -ruNp m4-1.4.12/tests/test-unistd.c m4-1.4.13/tests/test-unistd.c --- m4-1.4.12/tests/test-unistd.c 2008-02-23 10:30:25.000000000 -0700 +++ m4-1.4.13/tests/test-unistd.c 2009-01-24 12:02:44.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of <unistd.h> substitute. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,12 @@ /* Check that the various SEEK_* macros are defined. */ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; +/* Check that the various *_FILENO macros are defined. */ +#if ! (defined STDIN_FILENO \ + && (STDIN_FILENO + STDOUT_FILENO + STDERR_FILENO == 3)) +missing or broken *_FILENO macros +#endif + /* Check that the types are all defined. */ size_t t1; ssize_t t2; diff -ruNp m4-1.4.12/tests/test-vasprintf-posix.c m4-1.4.13/tests/test-vasprintf-posix.c --- m4-1.4.12/tests/test-vasprintf-posix.c 2008-10-09 21:05:02.000000000 -0600 +++ m4-1.4.13/tests/test-vasprintf-posix.c 2009-02-28 08:27:00.000000000 -0700 @@ -1,5 +1,5 @@ /* Test of POSIX compatible vasprintf() and asprintf() functions. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,6 @@ #include <float.h> #include <stdarg.h> #include <stddef.h> -#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> @@ -57,8 +56,20 @@ have_minus_zero () double zerod = 0.0; /* On HP-UX 10.20, negating 0.0L does not yield -0.0L. - So we use minus_zerol instead. */ -long double minus_zerol = -LDBL_MIN * LDBL_MIN; + So we use minus_zerol instead. + IRIX cc can't put -0.0L into .data, but can compute at runtime. + Note that the expression -LDBL_MIN * LDBL_MIN does not work on other + platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */ +#if defined __hpux || defined __sgi +static long double +compute_minus_zerol (void) +{ + return -LDBL_MIN * LDBL_MIN; +} +# define minus_zerol compute_minus_zerol () +#else +long double minus_zerol = -0.0L; +#endif /* Representation of an 80-bit 'long double' as an initializer for a sequence of 'unsigned int' words. */ @@ -3568,6 +3579,56 @@ test_function (int (*my_asprintf) (char ASSERT (retval == strlen (result)); free (result); } + + /* Test the support of the %s format directive. */ + + /* To verify that these tests succeed, it is necessary to run them under + a tool that checks against invalid memory accesses, such as ElectricFence + or "valgrind --tool=memcheck". */ + { + size_t i; + + for (i = 1; i <= 8; i++) + { + char *block; + char *result; + int retval; + + block = (char *) malloc (i); + memcpy (block, "abcdefgh", i); + retval = my_asprintf (&result, "%.*s", (int) i, block); + ASSERT (result != NULL); + ASSERT (memcmp (result, block, i) == 0); + ASSERT (result[i] == '\0'); + ASSERT (retval == strlen (result)); + free (result); + free (block); + } + } +#if HAVE_WCHAR_T + { + size_t i; + + for (i = 1; i <= 8; i++) + { + wchar_t *block; + size_t j; + char *result; + int retval; + + block = (wchar_t *) malloc (i * sizeof (wchar_t)); + for (j = 0; j < i; j++) + block[j] = "abcdefgh"[j]; + retval = my_asprintf (&result, "%.*ls", (int) i, block); + ASSERT (result != NULL); + ASSERT (memcmp (result, "abcdefgh", i) == 0); + ASSERT (result[i] == '\0'); + ASSERT (retval == strlen (result)); + free (result); + free (block); + } + } +#endif } static int diff -ruNp m4-1.4.12/tests/test-wcrtomb.c m4-1.4.13/tests/test-wcrtomb.c --- m4-1.4.12/tests/test-wcrtomb.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-wcrtomb.c 2008-12-24 06:20:34.000000000 -0700 @@ -0,0 +1,162 @@ +/* Test of conversion of wide character to multibyte character. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */ + +#include <config.h> + +#include <wchar.h> + +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +/* Check the multibyte character s[0..n-1]. */ +static void +check_character (const char *s, size_t n) +{ + wchar_t wc; + char buf[64]; + int iret; + size_t ret; + + wc = (wchar_t) 0xBADFACE; + iret = mbtowc (&wc, s, n); + ASSERT (iret == n); + + ret = wcrtomb (buf, wc, NULL); + ASSERT (ret == n); + ASSERT (memcmp (buf, s, n) == 0); + + /* Test special calling convention, passing a NULL pointer. */ + ret = wcrtomb (NULL, wc, NULL); + ASSERT (ret == 1); +} + +int +main (int argc, char *argv[]) +{ + char buf[64]; + size_t ret; + + /* configure should already have checked that the locale is supported. */ + if (setlocale (LC_ALL, "") == NULL) + return 1; + + /* Test NUL character. */ + { + buf[0] = 'x'; + ret = wcrtomb (buf, 0, NULL); + ASSERT (ret == 1); + ASSERT (buf[0] == '\0'); + } + + /* Test single bytes. */ + { + int c; + + for (c = 0; c < 0x100; c++) + switch (c) + { + case '\t': case '\v': case '\f': + case ' ': case '!': case '"': case '#': case '%': + case '&': case '\'': case '(': case ')': 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 ';': case '<': case '=': 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': + case '[': case '\\': case ']': 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': case '{': case '|': case '}': case '~': + /* c is in the ISO C "basic character set". */ + ret = wcrtomb (buf, btowc (c), NULL); + ASSERT (ret == 1); + ASSERT (buf[0] == (char) c); + break; + } + } + + if (argc > 1) + switch (argv[1][0]) + { + case '1': + /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ + { + const char input[] = "B\374\337er"; /* "Büßer" */ + + check_character (input + 1, 1); + check_character (input + 2, 1); + } + return 0; + + case '2': + /* Locale encoding is UTF-8. */ + { + const char input[] = "B\303\274\303\237er"; /* "Büßer" */ + + check_character (input + 1, 2); + check_character (input + 3, 2); + } + return 0; + + case '3': + /* Locale encoding is EUC-JP. */ + { + const char input[] = "<\306\374\313\334\270\354>"; /* "<日本語>" */ + + check_character (input + 1, 2); + check_character (input + 3, 2); + check_character (input + 5, 2); + } + return 0; + + case '4': + /* Locale encoding is GB18030. */ + { + const char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + + check_character (input + 1, 2); + check_character (input + 3, 4); + } + return 0; + } + + return 1; +} diff -ruNp m4-1.4.12/tests/test-wcrtomb.sh m4-1.4.13/tests/test-wcrtomb.sh --- m4-1.4.12/tests/test-wcrtomb.sh 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/test-wcrtomb.sh 2009-02-18 19:14:08.000000000 -0700 @@ -0,0 +1,35 @@ +#!/bin/sh + +# Test in an ISO-8859-1 or ISO-8859-15 locale. +: ${LOCALE_FR=fr_FR} +if test $LOCALE_FR != none; then + LC_ALL=$LOCALE_FR \ + ./test-wcrtomb${EXEEXT} 1 \ + || exit 1 +fi + +# Test whether a specific UTF-8 locale is installed. +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR_UTF8 != none; then + LC_ALL=$LOCALE_FR_UTF8 \ + ./test-wcrtomb${EXEEXT} 2 \ + || exit 1 +fi + +# Test whether a specific EUC-JP locale is installed. +: ${LOCALE_JA=ja_JP} +if test $LOCALE_JA != none; then + LC_ALL=$LOCALE_JA \ + ./test-wcrtomb${EXEEXT} 3 \ + || exit 1 +fi + +# Test whether a specific GB18030 locale is installed. +: ${LOCALE_ZH_CN=zh_CN.GB18030} +if test $LOCALE_ZH_CN != none; then + LC_ALL=$LOCALE_ZH_CN \ + ./test-wcrtomb${EXEEXT} 4 \ + || exit 1 +fi + +exit 0 diff -ruNp m4-1.4.12/tests/unsetenv.c m4-1.4.13/tests/unsetenv.c --- m4-1.4.12/tests/unsetenv.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/unsetenv.c 2009-01-25 19:37:32.000000000 -0700 @@ -0,0 +1,90 @@ +/* Copyright (C) 1992,1995-1999,2000-2002,2005-2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <stdlib.h> + +#include <errno.h> +#if !_LIBC +# define __set_errno(ev) ((errno) = (ev)) +#endif + +#include <string.h> +#include <unistd.h> + +#if !_LIBC +# define __environ environ +#endif + +#if _LIBC +/* This lock protects against simultaneous modifications of `environ'. */ +# include <bits/libc-lock.h> +__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 -ruNp m4-1.4.12/tests/verify.h m4-1.4.13/tests/verify.h --- m4-1.4.12/tests/verify.h 2008-02-23 10:30:26.000000000 -0700 +++ m4-1.4.13/tests/verify.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,140 +0,0 @@ -/* 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 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* 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 <int w> - 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 -ruNp m4-1.4.12/tests/wctob.c m4-1.4.13/tests/wctob.c --- m4-1.4.12/tests/wctob.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.13/tests/wctob.c 2008-12-24 06:20:34.000000000 -0700 @@ -0,0 +1,37 @@ +/* Convert wide character to unibyte character. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include <stdio.h> +#include <stdlib.h> + +int +wctob (wint_t wc) +{ + char buf[64]; + + if (!(MB_CUR_MAX <= sizeof (buf))) + abort (); + if (wctomb (buf, wc) == 1) + return (unsigned char) buf[0]; + else + return EOF; +}