diff -ruNp m4-1.4.8/AUTHORS m4-1.4.9/AUTHORS --- m4-1.4.8/AUTHORS 2006-09-23 22:28:00.000000000 -0600 +++ m4-1.4.9/AUTHORS 2007-03-23 06:40:01.000000000 -0600 @@ -86,9 +86,13 @@ M4 Ralf Wildenhues Germany, 1975 2006-03 Assigns Past and Future Changes Ralf.Wildenhues@gmx.de +M4 Markus Duft Austria, 1984 2006-08-03 +Assigns Past and Future Changes +markus.duft@salomon.at + ======================================================================== -Copyright (C) 2000, 2006 Free Software Foundation, Inc. +Copyright (C) 2000, 2006, 2007 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.8/ChangeLog m4-1.4.9/ChangeLog --- m4-1.4.8/ChangeLog 2006-11-20 21:08:44.000000000 -0700 +++ m4-1.4.9/ChangeLog 2007-03-23 14:33:12.000000000 -0600 @@ -1,7 +1,241 @@ -2006-11-20 Eric Blake +2007-03-23 Eric Blake + + Release 1.4.9: + * configure.ac (AC_INIT): Bump version number. + * NEWS: Describe changes since 1.4.8b. + +2007-03-16 Eric Blake + + * doc/m4.texinfo (Mkstemp): Tweak wording. + * src/output.c (output_init): Adjust to latest gnulib. + +2007-03-15 Eric Blake + + Avoid Tandem/NSK's broken long long (without a symmetric unsigned + long long, it confuses gnulib). + * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken + if unsigned long long doesn't work. + * THANKS: Update. + Reported by Matthew Woehlke. + +2007-03-07 Eric Blake + + * AUTHORS: Update. + * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning. + +2007-03-01 Eric Blake - Release 1.4.8: + * doc/m4.texinfo: Pick up more index entries from head. Follow + more texinfo recommendations. + (Sysval): Improve tests. + + Avoid overfull \vbox warning from texinfo, due to indices that + weren't quite big enough to split across page boundaries. + * doc/m4.texinfo: Add lots of concept index entries. + (Concept Index): Move to be last, as recommended by texinfo + manual. + (Define, Arguments, Pseudo Arguments): Add more function entries. + +2007-02-28 Eric Blake + + * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN + 137. + (Pseudo Arguments): Add useful example. + + * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to + reflect POSIX XCU ERN 118. + + * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from... + * src/m4.c (usage): ...here,... + * src/builtin.c (set_macro_sequence): ...and here. + (define_user_macro): Fix typo. + * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor + inaccuracies. + (Shift): Document composite macro argn for portably getting at + positional parameters beyond 9. + * configure.ac (AC_INIT): Bump version number. + * NEWS: Start changes of 1.4.8c. + +2007-02-24 Eric Blake + Beta Release 1.4.8b: + * configure.ac (AC_INIT): Bump version number. + * NEWS: Describe changes since 1.4.8. + + Reserve all uses of raw ${} in macro definitions, not just + ${}. + * src/builtin.c (set_macro_sequence): Change default macro + sequence. + * doc/m4.texinfo (Operation modes): Update to match. + * src/m4.c (usage): Likewise. + * NEWS: Likewise. + +2007-02-23 Eric Blake + + * src/m4.h (includes): Update to latest gnulib. + +2007-02-08 Eric Blake + + Rename --warn-syntax to --warn-macro-sequence[=regex], to make it + more flexible, and so that autoconf can use it. + * src/m4.h (set_macro_sequence, free_macro_sequence): New + prototypes. + * src/builtin.c (macro_sequence_buf, macro_sequence_regs) + (macro_sequence_inuse, set_macro_sequence, free_macro_sequence): + New variables and functions. + (define_user_macro): Allow flexibility in regular expression used + to trigger warning. + * src/m4.c (warn_syntax): Delete. + (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed + spelling of option, along with optional argument. + * doc/m4.texinfo (Operation modes, Arguments): Document this + change. + * NEWS: Document this change. + +2007-02-05 Eric Blake + + * m4/gnulib-cache.m4: Module strstr no longer exists. + + Avoid bool bitfields, as they don't work on AIX. + * src/m4.h (bool_bitfield): New typedef. + (struct symbol, struct builtin): Use it. + * src/input.c (struct input_block): Likewise. + Reported by Albert Chin. + + * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable. + Reported by Albert Chin. + * THANKS: Update. + +2006-06-18 Bruno Haible (tiny change) + + * doc/m4.texinfo (Input processing): Further clarifications. + +2007-02-03 Eric Blake + + * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up + the examples. + Reported by Bruno Haible. + +2007-02-01 Eric Blake + + * src/m4.c (fatal_warnings): New variable. + (usage): Document new -E behavior. + (main): Make -E an additive option. + (m4_error, m4_error_at_line): Change exit status when required. + * NEWS: Document this change. + * doc/m4.texinfo (Operation modes): Likewise. + Reported by Ralf Wildenhues. + +2007-01-27 Eric Blake + + * src/m4.h (warn_syntax): Declare. + (init_pattern_buffer): Export. + * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS) + (long_options, main): Implement new option. + * src/builtin.c (init_pattern_buffer): Allow NULL regs argument. + (define_user_macro): Warn on $11 and ${1} if requested. + * src/input.c (init_pattern_buffer): Delete duplicate method. + * doc/m4.texinfo (Operation modes): Document it. + (Arguments): Document future direction of ${11} vs. $11. + (Incompatibilities): Fix wording on POSIX limitations. + * checks/get-them: Parse @{ and @} correctly. + * NEWS: Document this change. + +2007-01-26 Eric Blake + + * src/builtin.c (includes): Adjust to gnulib changes. + +2007-01-15 Eric Blake + + * doc/m4.texinfo: Pull in various improvements from head. + * src/builtin.c (include): Alter exit status on failure. + * NEWS: Document this fix. + +2007-01-13 Eric Blake + + * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and + assume the fallback of ss_base for BSDI 4.0.1. + * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK && + ! HAVE_STACK_T_SS_SP]: Use this check. + Reported by Chris McGuire. + * THANKS: Update. + * NEWS: Document the improvement. + +2007-01-09 Eric Blake + + * src/eval.c (ASSIGN): New enumerator. + (eval_lex): Recognize '='. + (equality_term): Treat '=' like '==', but warn that it is + deprecated. + * doc/m4.texinfo (Eval): Document and test this. + (Incompatibilities): Document the POSIX incompatibility. + * NEWS: Document this change. + +2007-01-06 Eric Blake + + * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'. + * checks/check-them: Record expected exit status. + * checks/get-them: Check exit status. + * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t + instead. + * src/builtin.c: All users changed. + * src/eval.c: Likewise. Also document where we are triggering + undefined or implementation-defined behavior. + (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate) + (logical_or_term, logical_and_term, logical_not_term, not_term) + (equality_term, unary_term): Port from head to follow POSIX + semantics. + (exp_term): Reject 0**0 as undefined. + * doc/m4.texinfo (History): Mention 1.4.9. + (Format, Incompatibilities): Update to document POSIX compliance. + * NEWS: Document this change. + +2007-01-04 Eric Blake + + * NEWS: Document previous fix. + * THANKS: Update. + +2007-01-04 Sami Liedes (tiny change) + + Fix Debian bug 405594, introduced 2006-11-01 from a bad + copy-n-paste from head. + * src/m4.c (main): Use correct file name after --. + +2007-01-04 Eric Blake + + Fix regression from 1.4.7 in large file handling on some + platforms, introduced on 2006-10-13. + * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files + will be handled. + * NEWS: Document this fix. + +2007-01-03 Eric Blake + + * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import + version-etc-fsf'. + * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus + it bumps the copyright year). + +2006-12-27 Eric Blake + + * doc/m4.texinfo (Patsubst): Fix typo. + +2006-12-16 Eric Blake + + * src/m4.c (main): Check for errors when closing stdin. + +2006-12-09 Ralf Wildenhues + + * doc/m4.texinfo: Fix some typos. + +2006-12-09 Eric Blake + + * configure.ac (AC_INIT): Bump version number. + * NEWS: Start changes of 1.4.8a. + +2006-11-20 Eric Blake + + Release 1.4.8: * configure.ac (AC_INIT): Bump version number. * NEWS: Describe changes since 1.4.7. @@ -366,8 +600,7 @@ 2006-09-25 Eric Blake - Release 1.4.7: - + Release 1.4.7: * configure.ac (AC_INIT): Bump version number. * NEWS: Describe changes since 1.4.6. @@ -468,7 +701,6 @@ 2006-08-25 Eric Blake Release 1.4.6: - * configure.ac (AC_INIT): Bump version number. * NEWS: Describe changes since 1.4.5. @@ -830,7 +1062,6 @@ 2006-07-15 Eric Blake Release 1.4.5: - * configure.ac (AC_INIT): Bump version number. * NEWS: Describe changes since 1.4.4. @@ -1270,8 +1501,7 @@ 2006-06-17 Eric Blake - Release 1.4.4b: - + Beta Release 1.4.4b: * configure.ac (AC_INIT): Bump version number. * NEWS: Describe changes since 1.4.4. * Makefile.maint (cvs-news): Accomodate copyright line wrapping. @@ -1600,7 +1830,6 @@ 2005-10-19 Gary V. Vaughan (tiny change) Release 1.4.4: - * configure.ac (AC_INIT): Bump to 1.4.4. * NEWS: Describe 1.4.4's changes. * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream. @@ -1661,7 +1890,6 @@ 2005-03-31 Gary V. Vaughan (tiny change) Release 1.4.3: - * configure.in (AC_INIT): Bump to 1.4.3. * NEWS: Describe 1.4.3's changes. @@ -1770,8 +1998,7 @@ 2004-08-19 Paul Eggert - * Release 1.4.2. - + Release 1.4.2. * configure.in (VERSION): Bump to 1.4.2. * News: Describe 1.4.2's changes. @@ -1793,8 +2020,7 @@ 2004-06-03 Paul Eggert - * Release 1.4.1. - + Release 1.4.1. * configure.in (VERSION): Bump to 1.4.1. * NEWS: Describe 1.4.1's changes. @@ -1844,8 +2070,7 @@ Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule) - * Release 1.4. - + Release 1.4. * doc/Makefile.in (realclean): Also remove stamp-vti. Reported by Eric Backus. @@ -2002,8 +2227,7 @@ Wed Sep 14 10:00:22 1994 Francois Pinar Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule) - * Release 1.3. - + Release 1.3. * Makefile.in: Group all *clean-recursive goals in one, using sed to remove `-recursive' while calling make recursively. Also, use a subshell for each recursive $(MAKE). @@ -3371,14 +3595,14 @@ Mon Jan 22 21:08:52 1990 Rene' Seindal ----- - $Revision: 1.1.1.1.2.224 $ $Date: 2006/11/21 04:08:44 $ + $Revision: 1.1.1.1.2.258 $ $Date: 2007/03/23 20:33:12 $ Local Variables: coding: utf-8 End: Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 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.8/Makefile.in m4-1.4.9/Makefile.in --- m4-1.4.8/Makefile.in 2006-11-20 07:25:50.000000000 -0700 +++ m4-1.4.9/Makefile.in 2007-03-23 07:32:35.000000000 -0600 @@ -47,12 +47,13 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/gnulib-comp.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/longdouble.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.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 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ @@ -61,17 +62,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(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/stdlib-safer.m4 $(top_srcdir)/m4/strcase.m4 \ - $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.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/tmpdir.m4 $(top_srcdir)/m4/ulonglong.m4 \ $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ - $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ - $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac + $(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/xvasprintf.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -105,7 +106,12 @@ GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ +ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ +ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ +ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ +ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ +ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ @@ -134,18 +140,39 @@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ +GLIBC21 = @GLIBC21@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_READLINK = @GNULIB_READLINK@ GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -172,6 +199,11 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ @@ -180,9 +212,11 @@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ -UNISTD_H = @UNISTD_H@ +SYS_TIME_H = @SYS_TIME_H@ VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ diff -ruNp m4-1.4.8/NEWS m4-1.4.9/NEWS --- m4-1.4.8/NEWS 2006-11-20 06:57:48.000000000 -0700 +++ m4-1.4.9/NEWS 2007-03-23 06:41:17.000000000 -0600 @@ -1,7 +1,43 @@ GNU M4 NEWS - User visible changes. -Copyright (C) 1992, 1993, 1994, 2004, 2005, 2006 Free Software +Copyright (C) 1992, 1993, 1994, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +Version 1.4.9 - 23 Mar 2007, by Eric Blake (CVS version 1.4.8c) + +* Minor documentation and portability cleanups. + +Version 1.4.8b - 24 Feb 2007, by Eric Blake (CVS version 1.4.8a) + +* Fix a regression introduced in 1.4.8 that made m4 unable to process + files larger than 2GiB on some platforms. +* Fix a regression introduced in 1.4.8 that made m4 dump core when + invoked as 'm4 -- file'. +* The `eval' builtin now follows C precedence rules. Additionally, the + short-circuit operators correctly short-circuit division by zero. The + previously undocumented alias of '=' meaning '==' in eval now triggers a + deprecation warning, so that a future version of M4 can implement a form + of variable assignment as an extension. +* The `include' builtin now affects exit status on failure, as required by + POSIX. Use `sinclude' if you need a successful exit status. +* The `-E'/`--fatal-warnings' command-line option now has two levels. When + specified only once, warnings affect exit status, but execution + continues, so that you can see all warnings instead of fixing them one + at a time. To acheive 1.4.8 behavior, where the first warning + immediately exits, specify -E twice on the command line. +* A new `--warn-macro-sequence' command-line option allows detection of + sequences in `define' and `pushdef' definitions that match an optional + regular expression. The default regular expression is + `\$\({[^}]*}\|[0-9][0-9]+\)', corresponding to the sequences that might + not behave correctly when upgrading to the eventual M4 2.0. By default, + M4 2.0 will follow the POSIX requirement that a macro definition + containing `$11' must expand to the first argument concatenated with 1, + rather than the eleventh argument; and will take advantage of the POSIX + wording that allows implementations to treat `${11}' as the eleventh + argument instead of literal text. Be aware that Autoconf 2.61 will not + work with this option enabled with the default regular expression; but + Autoconf 2.62 will be compatible with this option. +* Improved portability to platforms such as BSD/OS and AIX. + Version 1.4.8 - 20 November 2006, by Eric Blake (CVS version 1.4.7a) * The `divert' macro and `-H'/`--hashsize' command line option no longer diff -ruNp m4-1.4.8/THANKS m4-1.4.9/THANKS --- m4-1.4.8/THANKS 2006-11-20 06:55:42.000000000 -0700 +++ m4-1.4.9/THANKS 2007-03-23 06:40:02.000000000 -0600 @@ -8,6 +8,7 @@ these people. Help me keep it complete Akiko Matsushita matusita@sra.co.jp Akim Demaille akim@epita.fr Alan Magnuson awm@osc.edu +Albert Chin m4-discuss@mlists.thewrittenword.com Alexander Lehmann alex@hal.rhein-main.de Amos Shapira amoss@cs.huji.ac.il Andreas Büning andreas.buening@nexgo.de @@ -22,6 +23,7 @@ Bjorn R. Bjornsson brb@falcon.is Bob Badour bob@badour.net Brendan Kehoe brendan@cygnus.com Bruno Haible bruno@clisp.org +Chris McGuire chris@wso.net Damian Menscher menscher@uiuc.edu Dan Jacobson jidanni@jidanni.org David J. MacKenzie djm@uunet.uu.net @@ -59,6 +61,7 @@ Marion Hakanson hakanson@cse.ogi.edu Mark Seiden mis@seiden.com Martin Koeppe mkoeppe@gmx.de Matt Kraai kraai@debian.org +Matthew Woehlke mw_triad@users.sourceforge.net Matthias Rabe rabe@mathematik.uni-bielefeld.de Michael Fetterman mafetter@ichips.intel.com Michael L. Welcome welcome@bigbird.llnl.gov @@ -83,6 +86,7 @@ Robert Bernstein rocky@panix.com Robert Bihlmeyer robbe@orcus.priv.at Roland H. Pesch roland@wrs.com Roland McGrath roland@gnu.ai.mit.edu +Sami Liedes sliedes@cc.hut.fi Santiago Vila sanvila@debian.org Scott Bartram deneb!scottb Simon Leinen simon@lia.di.epfl.ch @@ -107,7 +111,7 @@ Local Variables: coding: utf-8 End: -Copyright (C) 2000, 2006 Free Software Foundation, Inc. +Copyright (C) 2000, 2006, 2007 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.8/aclocal.m4 m4-1.4.9/aclocal.m4 --- m4-1.4.8/aclocal.m4 2006-11-20 07:25:28.000000000 -0700 +++ m4-1.4.9/aclocal.m4 2007-03-23 07:32:14.000000000 -0600 @@ -877,18 +877,19 @@ m4_include([m4/fatal-signal.m4]) m4_include([m4/fpending.m4]) m4_include([m4/free.m4]) m4_include([m4/getopt.m4]) +m4_include([m4/gettimeofday.m4]) m4_include([m4/gl_list.m4]) +m4_include([m4/glibc21.m4]) +m4_include([m4/gnulib-common.m4]) m4_include([m4/gnulib-comp.m4]) m4_include([m4/inline.m4]) m4_include([m4/intmax_t.m4]) m4_include([m4/inttypes_h.m4]) +m4_include([m4/localcharset.m4]) m4_include([m4/longdouble.m4]) m4_include([m4/longlong.m4]) -m4_include([m4/mbchar.m4]) -m4_include([m4/mbiter.m4]) m4_include([m4/mbrtowc.m4]) m4_include([m4/mbstate_t.m4]) -m4_include([m4/memchr.m4]) m4_include([m4/mkdtemp.m4]) m4_include([m4/mkstemp.m4]) m4_include([m4/pathmax.m4]) @@ -904,10 +905,10 @@ m4_include([m4/stdint.m4]) m4_include([m4/stdint_h.m4]) m4_include([m4/stdio-safer.m4]) m4_include([m4/stdlib-safer.m4]) -m4_include([m4/strcase.m4]) -m4_include([m4/strstr.m4]) +m4_include([m4/stdlib_h.m4]) m4_include([m4/strtol.m4]) m4_include([m4/sys_stat_h.m4]) +m4_include([m4/sys_time_h.m4]) m4_include([m4/tempname.m4]) m4_include([m4/tmpdir.m4]) m4_include([m4/ulonglong.m4]) @@ -916,8 +917,9 @@ m4_include([m4/unistd_h.m4]) m4_include([m4/unlocked-io.m4]) m4_include([m4/vasnprintf.m4]) m4_include([m4/vasprintf.m4]) +m4_include([m4/wchar.m4]) m4_include([m4/wchar_t.m4]) -m4_include([m4/wcwidth.m4]) +m4_include([m4/wctype.m4]) m4_include([m4/wint_t.m4]) m4_include([m4/xalloc.m4]) m4_include([m4/xsize.m4]) diff -ruNp m4-1.4.8/checks/001.comments m4-1.4.9/checks/001.comments --- m4-1.4.8/checks/001.comments 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/001.comments 2007-03-23 07:36:09.000000000 -0600 @@ -1,5 +1,6 @@ -dnl @ ../doc/m4.texinfo:872: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation +dnl @ ../doc/m4.texinfo:918: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation dnl @ This file is free software; 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.8/checks/002.inhibiting m4-1.4.9/checks/002.inhibiting --- m4-1.4.8/checks/002.inhibiting 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/002.inhibiting 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:1049: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 diff -ruNp m4-1.4.8/checks/002.input_proc m4-1.4.9/checks/002.input_proc --- m4-1.4.8/checks/002.input_proc 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/002.input_proc 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:1003: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/003.inhibiting m4-1.4.9/checks/003.inhibiting --- m4-1.4.8/checks/003.inhibiting 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/003.inhibiting 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:1063: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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{} diff -ruNp m4-1.4.8/checks/003.input_proc m4-1.4.9/checks/003.input_proc --- m4-1.4.8/checks/003.input_proc 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/003.input_proc 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:1079: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/004.inhibiting m4-1.4.9/checks/004.inhibiting --- m4-1.4.8/checks/004.inhibiting 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/004.inhibiting 2007-03-23 07:36:09.000000000 -0600 @@ -1,12 +1,11 @@ -dnl @ ../doc/m4.texinfo:1078: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation +dnl @ ../doc/m4.texinfo:1204: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation dnl @ This file is free software; the Free Software 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', `substr(ab') -dnl @result{} -define(`y', `cde, `3', `2')') -dnl @result{} -x`'y -dnl @result{}de +eval +dnl @result{}eval +eval(`1') +dnl @result{}1 diff -ruNp m4-1.4.8/checks/005.inhibiting m4-1.4.9/checks/005.inhibiting --- m4-1.4.8/checks/005.inhibiting 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/005.inhibiting 2007-03-23 07:36:09.000000000 -0600 @@ -1,12 +1,15 @@ -dnl @ ../doc/m4.texinfo:1091: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation +dnl @ ../doc/m4.texinfo:1237: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation dnl @ This file is free software; the Free Software 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') -dnl @result{} -macro(`m')macro -dnl @result{}mmacro -macro(`m')`'macro -dnl @result{}mm +`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.8/checks/006.inhibiting m4-1.4.9/checks/006.inhibiting --- m4-1.4.8/checks/006.inhibiting 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/006.inhibiting 2007-03-23 07:36:09.000000000 -0600 @@ -1,12 +1,11 @@ -dnl @ ../doc/m4.texinfo:1103: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation +dnl @ ../doc/m4.texinfo:1251: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation dnl @ This file is free software; the Free Software 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') +`'divert dnl @result{} -macro(`v')`ert' -dnl @result{}divert -macro(`v')ert +divert`' dnl @result{} diff -ruNp m4-1.4.8/checks/007.inhibiting m4-1.4.9/checks/007.inhibiting --- m4-1.4.8/checks/007.inhibiting 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/007.inhibiting 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1267: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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', `substr(ab') +dnl @result{} +define(`y', `cde, `3', `2')') +dnl @result{} +x`'y +dnl @result{}de diff -ruNp m4-1.4.8/checks/007.macro_argu m4-1.4.9/checks/007.macro_argu --- m4-1.4.8/checks/007.macro_argu 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/007.macro_argu 1969-12-31 17:00:00.000000000 -0700 @@ -1,23 +0,0 @@ -dnl @ ../doc/m4.texinfo:1135: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/008.inhibiting m4-1.4.9/checks/008.inhibiting --- m4-1.4.8/checks/008.inhibiting 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/008.inhibiting 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1280: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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') +dnl @result{} +macro(`m')macro +dnl @result{}mmacro +macro(`m')`'macro +dnl @result{}mm diff -ruNp m4-1.4.8/checks/008.macro_argu m4-1.4.9/checks/008.macro_argu --- m4-1.4.8/checks/008.macro_argu 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/008.macro_argu 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:1181: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 -f -dnl @result{}2 diff -ruNp m4-1.4.8/checks/009.inhibiting m4-1.4.9/checks/009.inhibiting --- m4-1.4.8/checks/009.inhibiting 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/009.inhibiting 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1292: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/009.macro_argu m4-1.4.9/checks/009.macro_argu --- m4-1.4.8/checks/009.macro_argu 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/009.macro_argu 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:1192: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/010.define m4-1.4.9/checks/010.define --- m4-1.4.8/checks/010.define 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/010.define 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:1300: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/010.macro_argu m4-1.4.9/checks/010.macro_argu --- m4-1.4.8/checks/010.macro_argu 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/010.macro_argu 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,24 @@ +dnl @ ../doc/m4.texinfo:1324: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/011.define m4-1.4.9/checks/011.define --- m4-1.4.8/checks/011.define 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/011.define 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:1317: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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) -dnl @result{} -define(foo, two) -dnl @result{} -one -dnl @result{}two diff -ruNp m4-1.4.8/checks/011.macro_argu m4-1.4.9/checks/011.macro_argu --- m4-1.4.8/checks/011.macro_argu 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/011.macro_argu 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1372: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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 +f +dnl @result{}2 diff -ruNp m4-1.4.8/checks/012.define m4-1.4.9/checks/012.define --- m4-1.4.8/checks/012.define 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/012.define 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:1343: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/012.macro_argu m4-1.4.9/checks/012.macro_argu --- m4-1.4.8/checks/012.macro_argu 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/012.macro_argu 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:1384: Origin of test +dnl @ expected status: 1 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/013.arguments m4-1.4.9/checks/013.arguments --- m4-1.4.8/checks/013.arguments 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/013.arguments 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:1372: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/013.quoting_ar m4-1.4.9/checks/013.quoting_ar --- m4-1.4.8/checks/013.quoting_ar 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/013.quoting_ar 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:1443: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/014.arguments m4-1.4.9/checks/014.arguments --- m4-1.4.8/checks/014.arguments 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/014.arguments 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:1382: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/014.define m4-1.4.9/checks/014.define --- m4-1.4.8/checks/014.define 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/014.define 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:1517: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/015.arguments m4-1.4.9/checks/015.arguments --- m4-1.4.8/checks/015.arguments 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/015.arguments 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:1405: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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'') -dnl @result{} -test -dnl @result{}Macro name: test diff -ruNp m4-1.4.8/checks/015.define m4-1.4.9/checks/015.define --- m4-1.4.8/checks/015.define 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/015.define 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1534: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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) +dnl @result{} +define(foo, two) +dnl @result{} +one +dnl @result{}two diff -ruNp m4-1.4.8/checks/016.arguments m4-1.4.9/checks/016.arguments --- m4-1.4.8/checks/016.arguments 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/016.arguments 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:1415: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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'.') -dnl @result{} -foo -dnl @result{}This is macro foo. diff -ruNp m4-1.4.8/checks/016.define m4-1.4.9/checks/016.define --- m4-1.4.8/checks/016.define 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/016.define 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:1568: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/017.arguments m4-1.4.9/checks/017.arguments --- m4-1.4.8/checks/017.arguments 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/017.arguments 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:1602: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/017.pseudo_arg m4-1.4.9/checks/017.pseudo_arg --- m4-1.4.8/checks/017.pseudo_arg 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/017.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 @@ -1,21 +0,0 @@ -dnl @ ../doc/m4.texinfo:1439: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/018.arguments m4-1.4.9/checks/018.arguments --- m4-1.4.8/checks/018.arguments 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/018.arguments 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1612: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/018.pseudo_arg m4-1.4.9/checks/018.pseudo_arg --- m4-1.4.8/checks/018.pseudo_arg 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/018.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:1460: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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{} -echo(arg1, arg2, arg3 , arg4) -dnl @result{}arg1,arg2,arg3 ,arg4 diff -ruNp m4-1.4.8/checks/019.arguments m4-1.4.9/checks/019.arguments --- m4-1.4.8/checks/019.arguments 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/019.arguments 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:1628: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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'') +dnl @result{} +test +dnl @result{}Macro name: test diff -ruNp m4-1.4.8/checks/019.pseudo_arg m4-1.4.9/checks/019.pseudo_arg --- m4-1.4.8/checks/019.pseudo_arg 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/019.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:1471: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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{} -echo(arg1, arg2, arg3 , arg4) -dnl @result{}arg1,arg2,arg3 ,arg4 diff -ruNp m4-1.4.8/checks/020.arguments m4-1.4.9/checks/020.arguments --- m4-1.4.8/checks/020.arguments 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/020.arguments 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:1638: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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'.') +dnl @result{} +foo +dnl @result{}This is macro foo. diff -ruNp m4-1.4.8/checks/020.pseudo_arg m4-1.4.9/checks/020.pseudo_arg --- m4-1.4.8/checks/020.pseudo_arg 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/020.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 @@ -1,20 +0,0 @@ -dnl @ ../doc/m4.texinfo:1481: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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', `$*') -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 diff -ruNp m4-1.4.8/checks/021.arguments m4-1.4.9/checks/021.arguments --- m4-1.4.8/checks/021.arguments 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/021.arguments 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:1673: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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') +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 diff -ruNp m4-1.4.8/checks/021.pseudo_arg m4-1.4.9/checks/021.pseudo_arg --- m4-1.4.8/checks/021.pseudo_arg 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/021.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 @@ -1,20 +0,0 @@ -dnl @ ../doc/m4.texinfo:1503: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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', `$*') -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.8/checks/022.pseudo_arg m4-1.4.9/checks/022.pseudo_arg --- m4-1.4.8/checks/022.pseudo_arg 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/022.pseudo_arg 2007-03-23 07:36:09.000000000 -0600 @@ -1,10 +1,22 @@ -dnl @ ../doc/m4.texinfo:1524: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation +dnl @ ../doc/m4.texinfo:1721: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation dnl @ This file is free software; the Free Software 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 $$$') +define(`nargs', `$#') dnl @result{} -foo -dnl @result{}$$$ hello $$$ +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.8/checks/023.pseudo_arg m4-1.4.9/checks/023.pseudo_arg --- m4-1.4.8/checks/023.pseudo_arg 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/023.pseudo_arg 2007-03-23 07:36:09.000000000 -0600 @@ -1,26 +1,14 @@ -dnl @ ../doc/m4.texinfo:1537: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation +dnl @ ../doc/m4.texinfo:1743: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation dnl @ This file is free software; the Free Software 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 Attempt to define a macro to just `$#' +define(underquoted, $#) +oops) 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 +underquoted +dnl @result{}0) +dnl @result{}oops diff -ruNp m4-1.4.8/checks/024.pseudo_arg m4-1.4.9/checks/024.pseudo_arg --- m4-1.4.8/checks/024.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/024.pseudo_arg 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:1756: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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{} +echo(arg1, arg2, arg3 , arg4) +dnl @result{}arg1,arg2,arg3 ,arg4 diff -ruNp m4-1.4.8/checks/024.undefine m4-1.4.9/checks/024.undefine --- m4-1.4.8/checks/024.undefine 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/024.undefine 1969-12-31 17:00:00.000000000 -0700 @@ -1,20 +0,0 @@ -dnl @ ../doc/m4.texinfo:1576: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/025.pseudo_arg m4-1.4.9/checks/025.pseudo_arg --- m4-1.4.8/checks/025.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/025.pseudo_arg 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:1767: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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{} +echo(arg1, arg2, arg3 , arg4) +dnl @result{}arg1,arg2,arg3 ,arg4 diff -ruNp m4-1.4.8/checks/025.undefine m4-1.4.9/checks/025.undefine --- m4-1.4.8/checks/025.undefine 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/025.undefine 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:1596: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/026.defn m4-1.4.9/checks/026.defn --- m4-1.4.8/checks/026.defn 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/026.defn 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:1633: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/026.pseudo_arg m4-1.4.9/checks/026.pseudo_arg --- m4-1.4.8/checks/026.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/026.pseudo_arg 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:1777: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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', `$*') +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 diff -ruNp m4-1.4.8/checks/027.defn m4-1.4.9/checks/027.defn --- m4-1.4.8/checks/027.defn 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/027.defn 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:1650: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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'') -dnl @result{} -define(`bar', defn(`foo')) -dnl @result{} -bar -dnl @result{}This is bar diff -ruNp m4-1.4.8/checks/027.pseudo_arg m4-1.4.9/checks/027.pseudo_arg --- m4-1.4.8/checks/027.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/027.pseudo_arg 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:1799: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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', `$*') +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.8/checks/028.defn m4-1.4.9/checks/028.defn --- m4-1.4.8/checks/028.defn 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/028.defn 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:1662: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 -') -dnl @result{} -string -dnl @result{}The macro -defn(`string') -dnl @result{}The macro dnl is very useful -dnl @result{} diff -ruNp m4-1.4.8/checks/028.pseudo_arg m4-1.4.9/checks/028.pseudo_arg --- m4-1.4.8/checks/028.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/028.pseudo_arg 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:1820: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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 $$$ diff -ruNp m4-1.4.8/checks/029.defn m4-1.4.9/checks/029.defn --- m4-1.4.8/checks/029.defn 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/029.defn 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:1680: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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) -dnl @result{} -define(`a', `A') -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.8/checks/029.pseudo_arg m4-1.4.9/checks/029.pseudo_arg --- m4-1.4.8/checks/029.pseudo_arg 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/029.pseudo_arg 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,27 @@ +dnl @ ../doc/m4.texinfo:1836: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/030.defn m4-1.4.9/checks/030.defn --- m4-1.4.8/checks/030.defn 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/030.defn 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:1699: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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') -dnl @result{} -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 diff -ruNp m4-1.4.8/checks/030.undefine m4-1.4.9/checks/030.undefine --- m4-1.4.8/checks/030.undefine 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/030.undefine 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:1875: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/031.pushdef m4-1.4.9/checks/031.pushdef --- m4-1.4.8/checks/031.pushdef 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/031.pushdef 1969-12-31 17:00:00.000000000 -0700 @@ -1,30 +0,0 @@ -dnl @ ../doc/m4.texinfo:1738: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/031.undefine m4-1.4.9/checks/031.undefine --- m4-1.4.8/checks/031.undefine 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/031.undefine 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1895: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/032.defn m4-1.4.9/checks/032.defn --- m4-1.4.8/checks/032.defn 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/032.defn 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1934: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/032.pushdef m4-1.4.9/checks/032.pushdef --- m4-1.4.8/checks/032.pushdef 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/032.pushdef 1969-12-31 17:00:00.000000000 -0700 @@ -1,22 +0,0 @@ -dnl @ ../doc/m4.texinfo:1770: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/033.defn m4-1.4.9/checks/033.defn --- m4-1.4.8/checks/033.defn 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/033.defn 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:1951: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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'') +dnl @result{} +define(`bar', defn(`foo')) +dnl @result{} +bar +dnl @result{}This is bar diff -ruNp m4-1.4.8/checks/033.indir m4-1.4.9/checks/033.indir --- m4-1.4.8/checks/033.indir 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/033.indir 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:1819: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/034.defn m4-1.4.9/checks/034.defn --- m4-1.4.8/checks/034.defn 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/034.defn 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:1963: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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 +') +dnl @result{} +string +dnl @result{}The macro +defn(`string') +dnl @result{}The macro dnl is very useful +dnl @result{} diff -ruNp m4-1.4.8/checks/034.indir m4-1.4.9/checks/034.indir --- m4-1.4.8/checks/034.indir 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/034.indir 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:1839: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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' -dnl @result{} diff -ruNp m4-1.4.8/checks/035.defn m4-1.4.9/checks/035.defn --- m4-1.4.8/checks/035.defn 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/035.defn 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:1982: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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) +dnl @result{} +define(`a', `A') +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.8/checks/035.indir m4-1.4.9/checks/035.indir --- m4-1.4.8/checks/035.indir 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/035.indir 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:1856: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/036.builtin m4-1.4.9/checks/036.builtin --- m4-1.4.8/checks/036.builtin 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/036.builtin 1969-12-31 17:00:00.000000000 -0700 @@ -1,30 +0,0 @@ -dnl @ ../doc/m4.texinfo:1893: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/036.defn m4-1.4.9/checks/036.defn --- m4-1.4.8/checks/036.defn 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/036.defn 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:2003: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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') +dnl @result{} +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 diff -ruNp m4-1.4.8/checks/037.builtin m4-1.4.9/checks/037.builtin --- m4-1.4.8/checks/037.builtin 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/037.builtin 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:1929: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 `' -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{} diff -ruNp m4-1.4.8/checks/037.pushdef m4-1.4.9/checks/037.pushdef --- m4-1.4.8/checks/037.pushdef 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/037.pushdef 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:2044: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/038.ifdef m4-1.4.9/checks/038.ifdef --- m4-1.4.8/checks/038.ifdef 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/038.ifdef 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:1976: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/038.pushdef m4-1.4.9/checks/038.pushdef --- m4-1.4.8/checks/038.pushdef 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/038.pushdef 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,23 @@ +dnl @ ../doc/m4.texinfo:2081: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/039.ifelse m4-1.4.9/checks/039.ifelse --- m4-1.4.8/checks/039.ifelse 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/039.ifelse 1969-12-31 17:00:00.000000000 -0700 @@ -1,11 +0,0 @@ -dnl @ ../doc/m4.texinfo:2022: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/039.indir m4-1.4.9/checks/039.indir --- m4-1.4.8/checks/039.indir 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/039.indir 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:2130: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/040.ifelse m4-1.4.9/checks/040.ifelse --- m4-1.4.8/checks/040.ifelse 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/040.ifelse 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:2032: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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') -dnl @result{} -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.8/checks/040.indir m4-1.4.9/checks/040.indir --- m4-1.4.8/checks/040.indir 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/040.indir 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:2150: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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' +dnl @result{} diff -ruNp m4-1.4.8/checks/041.ifelse m4-1.4.9/checks/041.ifelse --- m4-1.4.8/checks/041.ifelse 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/041.ifelse 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:2050: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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:$#')') -dnl @result{} -foo -dnl @result{}foo -foo() -dnl @result{}arguments:1 -foo(`a', `b', `c') -dnl @result{}arguments:3 diff -ruNp m4-1.4.8/checks/041.indir m4-1.4.9/checks/041.indir --- m4-1.4.8/checks/041.indir 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/041.indir 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,20 @@ +dnl @ ../doc/m4.texinfo:2167: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/042.builtin m4-1.4.9/checks/042.builtin --- m4-1.4.8/checks/042.builtin 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/042.builtin 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:2204: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/042.ifelse m4-1.4.9/checks/042.ifelse --- m4-1.4.8/checks/042.ifelse 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/042.ifelse 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:2069: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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', `third', `gnu', `gnats') -dnl @error{}m4:stdin:1: Warning: excess arguments to builtin `ifelse' ignored -dnl @result{}gnu -ifelse(`foo', `bar', `third', `gnu', `gnats', `sixth') -dnl @result{} -ifelse(`foo', `bar', `third', `gnu', `gnats', `sixth', `seventh') -dnl @result{}seventh -ifelse(`foo', `bar', `3', `gnu', `gnats', `6', `7', `8') -dnl @error{}m4:stdin:4: Warning: excess arguments to builtin `ifelse' ignored -dnl @result{}7 diff -ruNp m4-1.4.8/checks/043.builtin m4-1.4.9/checks/043.builtin --- m4-1.4.8/checks/043.builtin 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/043.builtin 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:2240: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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 `' +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{} diff -ruNp m4-1.4.8/checks/043.shift m4-1.4.9/checks/043.shift --- m4-1.4.8/checks/043.shift 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/043.shift 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:2109: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software Foundation -dnl @ gives unlimited permission to copy and/or distribute it -dnl @ with or without modifications, as long as this notice -dnl @ is preserved. -shift -dnl @result{}shift -shift(`bar') -dnl @result{} -shift(`foo', `bar', `baz') -dnl @result{}bar,baz diff -ruNp m4-1.4.8/checks/044.ifdef m4-1.4.9/checks/044.ifdef --- m4-1.4.8/checks/044.ifdef 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/044.ifdef 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:2287: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/044.shift m4-1.4.9/checks/044.shift --- m4-1.4.8/checks/044.shift 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/044.shift 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:2126: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`reverse', `ifelse(`$#', `0', , `$#', `1', ``$1'', - `reverse(shift($@)), `$1'')') -dnl @result{} -reverse -dnl @result{} -reverse(`foo') -dnl @result{}foo -reverse(`foo', `bar', `gnats', `and gnus') -dnl @result{}and gnus, gnats, bar, foo diff -ruNp m4-1.4.8/checks/045.ifelse m4-1.4.9/checks/045.ifelse --- m4-1.4.8/checks/045.ifelse 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/045.ifelse 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:2335: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/045.shift m4-1.4.9/checks/045.shift --- m4-1.4.8/checks/045.shift 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/045.shift 1969-12-31 17:00:00.000000000 -0700 @@ -1,23 +0,0 @@ -dnl @ ../doc/m4.texinfo:2158: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`quote.m4') -dnl @result{} --quote-dquote-dquote_elt- -dnl @result{}---- --quote()-dquote()-dquote_elt()- -dnl @result{}--`'-`'- --quote(`1')-dquote(`1')-dquote_elt(`1')- -dnl @result{}-1-`1'-`1'- --quote(`1', `2')-dquote(`1', `2')-dquote_elt(`1', `2')- -dnl @result{}-1,2-`1',`2'-`1',`2'- -define(`n', `$#')dnl --n(quote(`1', `2'))-n(dquote(`1', `2'))-n(dquote_elt(`1', `2'))- -dnl @result{}-1-1-2- -dquote(dquote_elt(`1', `2')) -dnl @result{}``1'',``2'' -dquote_elt(dquote(`1', `2')) -dnl @result{}``1',`2'' diff -ruNp m4-1.4.8/checks/046.ifelse m4-1.4.9/checks/046.ifelse --- m4-1.4.8/checks/046.ifelse 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/046.ifelse 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:2345: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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') +dnl @result{} +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.8/checks/046.shift m4-1.4.9/checks/046.shift --- m4-1.4.8/checks/046.shift 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/046.shift 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:2189: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`quote.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# quote(args) - convert args to single-quoted string -dnl @result{}define(`quote', `ifelse(`$#', `0', `', ``$*'')') -dnl @result{}# dquote(args) - convert args to quoted list of quoted strings -dnl @result{}define(`dquote', ``$@'') -dnl @result{}# dquote_elt(args) - convert args to list of double-quoted strings -dnl @result{}define(`dquote_elt', `ifelse(`$#', `0', `', `$#', `1', ```$1''', -dnl @result{} ```$1'',$0(shift($@))')') -dnl @result{}divert`'dnl diff -ruNp m4-1.4.8/checks/047.forloop m4-1.4.9/checks/047.forloop --- m4-1.4.8/checks/047.forloop 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/047.forloop 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:2221: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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', `8', `i ') -dnl @result{}1 2 3 4 5 6 7 8 diff -ruNp m4-1.4.8/checks/047.ifelse m4-1.4.9/checks/047.ifelse --- m4-1.4.8/checks/047.ifelse 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/047.ifelse 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:2365: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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:$#')') +dnl @result{} +foo +dnl @result{}foo +foo() +dnl @result{}arguments:1 +foo(`a', `b', `c') +dnl @result{}arguments:3 diff -ruNp m4-1.4.8/checks/048.forloop m4-1.4.9/checks/048.forloop --- m4-1.4.8/checks/048.forloop 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/048.forloop 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:2230: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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', `4', `forloop(`j', `1', `8', ` (i, j)') -') -dnl @result{} (1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6) (1, 7) (1, 8) -dnl @result{} (2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6) (2, 7) (2, 8) -dnl @result{} (3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6) (3, 7) (3, 8) -dnl @result{} (4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6) (4, 7) (4, 8) -dnl @result{} diff -ruNp m4-1.4.8/checks/048.ifelse m4-1.4.9/checks/048.ifelse --- m4-1.4.8/checks/048.ifelse 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/048.ifelse 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:2386: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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', `third', `gnu', `gnats') +dnl @error{}m4:stdin:1: Warning: excess arguments to builtin `ifelse' ignored +dnl @result{}gnu +ifelse(`foo', `bar', `third', `gnu', `gnats', `sixth') +dnl @result{} +ifelse(`foo', `bar', `third', `gnu', `gnats', `sixth', `seventh') +dnl @result{}seventh +ifelse(`foo', `bar', `3', `gnu', `gnats', `6', `7', `8') +dnl @error{}m4:stdin:4: Warning: excess arguments to builtin `ifelse' ignored +dnl @result{}7 diff -ruNp m4-1.4.8/checks/049.forloop m4-1.4.9/checks/049.forloop --- m4-1.4.8/checks/049.forloop 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/049.forloop 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:2256: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`forloop.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# forloop(var, from, to, stmt) - simple version -dnl @result{}define(`forloop', `pushdef(`$1', `$2')_forloop($@)popdef(`$1')') -dnl @result{}define(`_forloop', -dnl @result{} `$4`'ifelse($1, `$3', `', `define(`$1', incr($1))$0($@)')') -dnl @result{}divert`'dnl diff -ruNp m4-1.4.8/checks/049.shift m4-1.4.9/checks/049.shift --- m4-1.4.8/checks/049.shift 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/049.shift 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:2426: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software Foundation +dnl @ gives unlimited permission to copy and/or distribute it +dnl @ with or without modifications, as long as this notice +dnl @ is preserved. +shift +dnl @result{}shift +shift(`bar') +dnl @result{} +shift(`foo', `bar', `baz') +dnl @result{}bar,baz diff -ruNp m4-1.4.8/checks/050.foreach m4-1.4.9/checks/050.foreach --- m4-1.4.8/checks/050.foreach 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/050.foreach 1969-12-31 17:00:00.000000000 -0700 @@ -1,20 +0,0 @@ -dnl @ ../doc/m4.texinfo:2301: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`foreach.m4') -dnl @result{} -foreach(`x', (foo, bar, foobar), `Word was: x -')dnl -dnl @result{}Word was: foo -dnl @result{}Word was: bar -dnl @result{}Word was: foobar -include(`foreachq.m4') -dnl @result{} -foreachq(`x', `foo, bar, foobar', `Word was: x -')dnl -dnl @result{}Word was: foo -dnl @result{}Word was: bar -dnl @result{}Word was: foobar diff -ruNp m4-1.4.8/checks/050.shift m4-1.4.9/checks/050.shift --- m4-1.4.8/checks/050.shift 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/050.shift 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:2443: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`reverse', `ifelse(`$#', `0', , `$#', `1', ``$1'', + `reverse(shift($@)), `$1'')') +dnl @result{} +reverse +dnl @result{} +reverse(`foo') +dnl @result{}foo +reverse(`foo', `bar', `gnats', `and gnus') +dnl @result{}and gnus, gnats, bar, foo diff -ruNp m4-1.4.8/checks/051.foreach m4-1.4.9/checks/051.foreach --- m4-1.4.8/checks/051.foreach 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/051.foreach 1969-12-31 17:00:00.000000000 -0700 @@ -1,24 +0,0 @@ -dnl @ ../doc/m4.texinfo:2322: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`foreach.m4') -dnl @result{} -define(`_case', ` $1) - $2=" $1";; -')dnl -define(`_cat', `$1$2')dnl -case $`'1 in -dnl @result{}case $1 in -foreach(`x', `(`(`a', `vara')', `(`b', `varb')', `(`c', `varc')')', - `_cat(`_case', x)')dnl -dnl @result{} a) -dnl @result{} vara=" a";; -dnl @result{} b) -dnl @result{} varb=" b";; -dnl @result{} c) -dnl @result{} varc=" c";; -esac -dnl @result{}esac diff -ruNp m4-1.4.8/checks/051.shift m4-1.4.9/checks/051.shift --- m4-1.4.8/checks/051.shift 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/051.shift 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,24 @@ +dnl @ ../doc/m4.texinfo:2475: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`quote.m4') +dnl @result{} +-quote-dquote-dquote_elt- +dnl @result{}---- +-quote()-dquote()-dquote_elt()- +dnl @result{}--`'-`'- +-quote(`1')-dquote(`1')-dquote_elt(`1')- +dnl @result{}-1-`1'-`1'- +-quote(`1', `2')-dquote(`1', `2')-dquote_elt(`1', `2')- +dnl @result{}-1,2-`1',`2'-`1',`2'- +define(`n', `$#')dnl +-n(quote(`1', `2'))-n(dquote(`1', `2'))-n(dquote_elt(`1', `2'))- +dnl @result{}-1-1-2- +dquote(dquote_elt(`1', `2')) +dnl @result{}``1'',``2'' +dquote_elt(dquote(`1', `2')) +dnl @result{}``1',`2'' diff -ruNp m4-1.4.8/checks/052.foreach m4-1.4.9/checks/052.foreach --- m4-1.4.8/checks/052.foreach 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/052.foreach 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:2350: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`foreach.m4')dnl -dnl @result{}divert(`-1') -dnl @result{}# foreach(x, (item_1, item_2, ..., item_n), stmt) -dnl @result{}# parenthesized list, simple version -dnl @result{}define(`foreach', `pushdef(`$1')_foreach($@)popdef(`$1')') -dnl @result{}define(`_arg1', `$1') -dnl @result{}define(`_foreach', `ifelse(`$2', `()', `', -dnl @result{} `define(`$1', _arg1$2)$3`'$0(`$1', (shift$2), `$3')')') -dnl @result{}divert`'dnl diff -ruNp m4-1.4.8/checks/052.shift m4-1.4.9/checks/052.shift --- m4-1.4.8/checks/052.shift 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/052.shift 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:2506: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`quote.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# quote(args) - convert args to single-quoted string +dnl @result{}define(`quote', `ifelse(`$#', `0', `', ``$*'')') +dnl @result{}# dquote(args) - convert args to quoted list of quoted strings +dnl @result{}define(`dquote', ``$@'') +dnl @result{}# dquote_elt(args) - convert args to list of double-quoted strings +dnl @result{}define(`dquote_elt', `ifelse(`$#', `0', `', `$#', `1', ```$1''', +dnl @result{} ```$1'',$0(shift($@))')') +dnl @result{}divert`'dnl diff -ruNp m4-1.4.8/checks/053.foreach m4-1.4.9/checks/053.foreach --- m4-1.4.8/checks/053.foreach 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/053.foreach 1969-12-31 17:00:00.000000000 -0700 @@ -1,24 +0,0 @@ -dnl @ ../doc/m4.texinfo:2375: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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', `1')define(`b', `2')define(`c', `3') -dnl @result{} -include(`foreach.m4') -dnl @result{} -include(`foreachq.m4') -dnl @result{} -foreach(`x', `(``a'', ``(b'', ``c)'')', `x -') -dnl @result{}1 -dnl @result{}(2)1 -dnl @result{} -dnl @result{}, x -dnl @result{}) -foreachq(`x', ```a'', ``(b'', ``c)''', `x -')dnl -dnl @result{}a -dnl @result{}(b -dnl @result{}c) diff -ruNp m4-1.4.8/checks/053.shift m4-1.4.9/checks/053.shift --- m4-1.4.8/checks/053.shift 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/053.shift 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:2535: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`argn', `ifelse(`$1', 1, ``$2'', + `argn(decr(`$1'), shift(shift($@)))')') +dnl @result{} +argn(`1', `a') +dnl @result{}a +define(`foo', `argn(`11', $@)') +dnl @result{} +foo(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k', `l') +dnl @result{}k diff -ruNp m4-1.4.8/checks/054.foreach m4-1.4.9/checks/054.foreach --- m4-1.4.8/checks/054.foreach 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/054.foreach 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:2398: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`foreachq.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, simple version -dnl @result{}define(`foreachq', `pushdef(`$1')_foreachq($@)popdef(`$1')') -dnl @result{}define(`_arg1', `$1') -dnl @result{}define(`_foreachq', `ifelse(quote($2), `', `', -dnl @result{} `define(`$1', `_arg1($2)')$3`'$0(`$1', `shift($2)', `$3')')') -dnl @result{}divert`'dnl diff -ruNp m4-1.4.8/checks/054.forloop m4-1.4.9/checks/054.forloop --- m4-1.4.8/checks/054.forloop 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/054.forloop 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:2566: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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', `8', `i ') +dnl @result{}1 2 3 4 5 6 7 8 diff -ruNp m4-1.4.8/checks/055.dumpdef m4-1.4.9/checks/055.dumpdef --- m4-1.4.8/checks/055.dumpdef 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/055.dumpdef 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:2457: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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: -dnl @result{} diff -ruNp m4-1.4.8/checks/055.forloop m4-1.4.9/checks/055.forloop --- m4-1.4.8/checks/055.forloop 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/055.forloop 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:2575: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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', `4', `forloop(`j', `1', `8', ` (i, j)') +') +dnl @result{} (1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6) (1, 7) (1, 8) +dnl @result{} (2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6) (2, 7) (2, 8) +dnl @result{} (3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6) (3, 7) (3, 8) +dnl @result{} (4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6) (4, 7) (4, 8) +dnl @result{} diff -ruNp m4-1.4.8/checks/056.dumpdef m4-1.4.9/checks/056.dumpdef --- m4-1.4.8/checks/056.dumpdef 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/056.dumpdef 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:2473: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/056.forloop m4-1.4.9/checks/056.forloop --- m4-1.4.8/checks/056.forloop 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/056.forloop 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:2601: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`forloop.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# forloop(var, from, to, stmt) - simple version +dnl @result{}define(`forloop', `pushdef(`$1', `$2')_forloop($@)popdef(`$1')') +dnl @result{}define(`_forloop', +dnl @result{} `$4`'ifelse($1, `$3', `', `define(`$1', incr($1))$0($@)')') +dnl @result{}divert`'dnl diff -ruNp m4-1.4.8/checks/057.foreach m4-1.4.9/checks/057.foreach --- m4-1.4.8/checks/057.foreach 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/057.foreach 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:2646: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`foreach.m4') +dnl @result{} +foreach(`x', (foo, bar, foobar), `Word was: x +')dnl +dnl @result{}Word was: foo +dnl @result{}Word was: bar +dnl @result{}Word was: foobar +include(`foreachq.m4') +dnl @result{} +foreachq(`x', `foo, bar, foobar', `Word was: x +')dnl +dnl @result{}Word was: foo +dnl @result{}Word was: bar +dnl @result{}Word was: foobar diff -ruNp m4-1.4.8/checks/057.trace m4-1.4.9/checks/057.trace --- m4-1.4.8/checks/057.trace 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/057.trace 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:2513: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/058.foreach m4-1.4.9/checks/058.foreach --- m4-1.4.8/checks/058.foreach 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/058.foreach 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,25 @@ +dnl @ ../doc/m4.texinfo:2667: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`foreach.m4') +dnl @result{} +define(`_case', ` $1) + $2=" $1";; +')dnl +define(`_cat', `$1$2')dnl +case $`'1 in +dnl @result{}case $1 in +foreach(`x', `(`(`a', `vara')', `(`b', `varb')', `(`c', `varc')')', + `_cat(`_case', x)')dnl +dnl @result{} a) +dnl @result{} vara=" a";; +dnl @result{} b) +dnl @result{} varb=" b";; +dnl @result{} c) +dnl @result{} varc=" c";; +esac +dnl @result{}esac diff -ruNp m4-1.4.8/checks/058.trace m4-1.4.9/checks/058.trace --- m4-1.4.8/checks/058.trace 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/058.trace 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:2538: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 -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:8: 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.8/checks/059.foreach m4-1.4.9/checks/059.foreach --- m4-1.4.8/checks/059.foreach 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/059.foreach 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:2695: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`foreach.m4')dnl +dnl @result{}divert(`-1') +dnl @result{}# foreach(x, (item_1, item_2, ..., item_n), stmt) +dnl @result{}# parenthesized list, simple version +dnl @result{}define(`foreach', `pushdef(`$1')_foreach($@)popdef(`$1')') +dnl @result{}define(`_arg1', `$1') +dnl @result{}define(`_foreach', `ifelse(`$2', `()', `', +dnl @result{} `define(`$1', _arg1$2)$3`'$0(`$1', (shift$2), `$3')')') +dnl @result{}divert`'dnl diff -ruNp m4-1.4.8/checks/059.trace m4-1.4.9/checks/059.trace --- m4-1.4.8/checks/059.trace 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/059.trace 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:2571: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`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.8/checks/060.debug_leve m4-1.4.9/checks/060.debug_leve --- m4-1.4.8/checks/060.debug_leve 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/060.debug_leve 1969-12-31 17:00:00.000000000 -0700 @@ -1,25 +0,0 @@ -dnl @ ../doc/m4.texinfo:2666: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/060.foreach m4-1.4.9/checks/060.foreach --- m4-1.4.8/checks/060.foreach 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/060.foreach 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,25 @@ +dnl @ ../doc/m4.texinfo:2720: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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', `1')define(`b', `2')define(`c', `3') +dnl @result{} +include(`foreach.m4') +dnl @result{} +include(`foreachq.m4') +dnl @result{} +foreach(`x', `(``a'', ``(b'', ``c)'')', `x +') +dnl @result{}1 +dnl @result{}(2)1 +dnl @result{} +dnl @result{}, x +dnl @result{}) +foreachq(`x', ```a'', ``(b'', ``c)''', `x +')dnl +dnl @result{}a +dnl @result{}(b +dnl @result{}c) diff -ruNp m4-1.4.8/checks/061.debug_outp m4-1.4.9/checks/061.debug_outp --- m4-1.4.8/checks/061.debug_outp 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/061.debug_outp 1969-12-31 17:00:00.000000000 -0700 @@ -1,22 +0,0 @@ -dnl @ ../doc/m4.texinfo:2711: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/061.foreach m4-1.4.9/checks/061.foreach --- m4-1.4.8/checks/061.foreach 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/061.foreach 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:2743: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`foreachq.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, simple version +dnl @result{}define(`foreachq', `pushdef(`$1')_foreachq($@)popdef(`$1')') +dnl @result{}define(`_arg1', `$1') +dnl @result{}define(`_foreachq', `ifelse(quote($2), `', `', +dnl @result{} `define(`$1', `_arg1($2)')$3`'$0(`$1', `shift($2)', `$3')')') +dnl @result{}divert`'dnl diff -ruNp m4-1.4.8/checks/062.dnl m4-1.4.9/checks/062.dnl --- m4-1.4.8/checks/062.dnl 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/062.dnl 1969-12-31 17:00:00.000000000 -0700 @@ -1,9 +0,0 @@ -dnl @ ../doc/m4.texinfo:2761: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/062.dumpdef m4-1.4.9/checks/062.dumpdef --- m4-1.4.8/checks/062.dumpdef 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/062.dumpdef 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:2805: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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: +dnl @result{} diff -ruNp m4-1.4.8/checks/063.dnl m4-1.4.9/checks/063.dnl --- m4-1.4.8/checks/063.dnl 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/063.dnl 1969-12-31 17:00:00.000000000 -0700 @@ -1,11 +0,0 @@ -dnl @ ../doc/m4.texinfo:2779: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/063.dumpdef m4-1.4.9/checks/063.dumpdef --- m4-1.4.8/checks/063.dumpdef 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/063.dumpdef 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:2821: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/064.dnl m4-1.4.9/checks/064.dnl --- m4-1.4.8/checks/064.dnl 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/064.dnl 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:2790: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/064.trace m4-1.4.9/checks/064.trace --- m4-1.4.8/checks/064.trace 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/064.trace 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:2863: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/065.changequot m4-1.4.9/checks/065.changequot --- m4-1.4.8/checks/065.changequot 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/065.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:2820: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/065.trace m4-1.4.9/checks/065.trace --- m4-1.4.8/checks/065.trace 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/065.trace 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,34 @@ +dnl @ ../doc/m4.texinfo:2888: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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 +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:8: 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.8/checks/066.changequot m4-1.4.9/checks/066.changequot --- m4-1.4.8/checks/066.changequot 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/066.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:2835: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/066.trace m4-1.4.9/checks/066.trace --- m4-1.4.8/checks/066.trace 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/066.trace 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:2921: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`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.8/checks/067.changequot m4-1.4.9/checks/067.changequot --- m4-1.4.8/checks/067.changequot 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/067.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:2850: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/067.debug_leve m4-1.4.9/checks/067.debug_leve --- m4-1.4.8/checks/067.debug_leve 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/067.debug_leve 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,26 @@ +dnl @ ../doc/m4.texinfo:3028: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/068.changequot m4-1.4.9/checks/068.changequot --- m4-1.4.8/checks/068.changequot 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/068.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:2872: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/068.debug_outp m4-1.4.9/checks/068.debug_outp --- m4-1.4.8/checks/068.debug_outp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/068.debug_outp 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,23 @@ +dnl @ ../doc/m4.texinfo:3073: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/069.changequot m4-1.4.9/checks/069.changequot --- m4-1.4.8/checks/069.changequot 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/069.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,30 +0,0 @@ -dnl @ ../doc/m4.texinfo:2905: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/069.dnl m4-1.4.9/checks/069.dnl --- m4-1.4.8/checks/069.dnl 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/069.dnl 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,10 @@ +dnl @ ../doc/m4.texinfo:3125: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/070.changequot m4-1.4.9/checks/070.changequot --- m4-1.4.8/checks/070.changequot 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/070.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,28 +0,0 @@ -dnl @ ../doc/m4.texinfo:2938: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/070.dnl m4-1.4.9/checks/070.dnl --- m4-1.4.8/checks/070.dnl 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/070.dnl 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:3143: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/071.changequot m4-1.4.9/checks/071.changequot --- m4-1.4.8/checks/071.changequot 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/071.changequot 1969-12-31 17:00:00.000000000 -0700 @@ -1,24 +0,0 @@ -dnl @ ../doc/m4.texinfo:2970: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/071.dnl m4-1.4.9/checks/071.dnl --- m4-1.4.8/checks/071.dnl 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/071.dnl 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:3154: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/072.changequot m4-1.4.9/checks/072.changequot --- m4-1.4.8/checks/072.changequot 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/072.changequot 2007-03-23 07:36:09.000000000 -0600 @@ -1,10 +1,13 @@ -dnl @ ../doc/m4.texinfo:2993: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation +dnl @ ../doc/m4.texinfo:3185: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation dnl @ This file is free software; the Free Software 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 +changequote(`[', `]') +dnl @result{} +define([foo], [Macro [foo].]) +dnl @result{} +foo +dnl @result{}Macro foo. diff -ruNp m4-1.4.8/checks/073.changecom m4-1.4.9/checks/073.changecom --- m4-1.4.8/checks/073.changecom 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/073.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3019: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/073.changequot m4-1.4.9/checks/073.changequot --- m4-1.4.8/checks/073.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/073.changequot 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:3200: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/074.changecom m4-1.4.9/checks/074.changecom --- m4-1.4.8/checks/074.changecom 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/074.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3046: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/074.changequot m4-1.4.9/checks/074.changequot --- m4-1.4.8/checks/074.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/074.changequot 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:3215: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/075.changecom m4-1.4.9/checks/075.changecom --- m4-1.4.8/checks/075.changecom 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/075.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:3065: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/075.changequot m4-1.4.9/checks/075.changequot --- m4-1.4.8/checks/075.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/075.changequot 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:3237: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/076.changecom m4-1.4.9/checks/076.changecom --- m4-1.4.8/checks/076.changecom 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/076.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,20 +0,0 @@ -dnl @ ../doc/m4.texinfo:3088: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/076.changequot m4-1.4.9/checks/076.changequot --- m4-1.4.8/checks/076.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/076.changequot 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:3270: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/077.changecom m4-1.4.9/checks/077.changecom --- m4-1.4.8/checks/077.changecom 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/077.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,26 +0,0 @@ -dnl @ ../doc/m4.texinfo:3111: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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: -echo((hi)) -dnl @result{}0::((hi)) -changecom(`,', `)') -dnl @result{} -echo(hi,hi)bye) -dnl @result{}1:HI,hi)bye: diff -ruNp m4-1.4.8/checks/077.changequot m4-1.4.9/checks/077.changequot --- m4-1.4.8/checks/077.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/077.changequot 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,29 @@ +dnl @ ../doc/m4.texinfo:3303: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/078.changecom m4-1.4.9/checks/078.changecom --- m4-1.4.8/checks/078.changecom 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/078.changecom 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:3136: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/078.changequot m4-1.4.9/checks/078.changequot --- m4-1.4.8/checks/078.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/078.changequot 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,25 @@ +dnl @ ../doc/m4.texinfo:3335: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/079.changequot m4-1.4.9/checks/079.changequot --- m4-1.4.8/checks/079.changequot 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/079.changequot 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:3359: Origin of test +dnl @ expected status: 1 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/079.changeword m4-1.4.9/checks/079.changeword --- m4-1.4.8/checks/079.changeword 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/079.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:3186: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/080.changecom m4-1.4.9/checks/080.changecom --- m4-1.4.8/checks/080.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/080.changecom 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:3386: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/080.changeword m4-1.4.9/checks/080.changeword --- m4-1.4.8/checks/080.changeword 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/080.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -dnl @ ../doc/m4.texinfo:3199: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/081.changecom m4-1.4.9/checks/081.changecom --- m4-1.4.8/checks/081.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/081.changecom 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:3413: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/081.changeword m4-1.4.9/checks/081.changeword --- m4-1.4.8/checks/081.changeword 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/081.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,38 +0,0 @@ -dnl @ ../doc/m4.texinfo:3218: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/082.changecom m4-1.4.9/checks/082.changecom --- m4-1.4.8/checks/082.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/082.changecom 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:3432: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/082.changeword m4-1.4.9/checks/082.changeword --- m4-1.4.8/checks/082.changeword 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/082.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,36 +0,0 @@ -dnl @ ../doc/m4.texinfo:3260: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/083.changecom m4-1.4.9/checks/083.changecom --- m4-1.4.8/checks/083.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/083.changecom 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:3455: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/083.changeword m4-1.4.9/checks/083.changeword --- m4-1.4.8/checks/083.changeword 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/083.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:3298: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/084.changecom m4-1.4.9/checks/084.changecom --- m4-1.4.8/checks/084.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/084.changecom 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,27 @@ +dnl @ ../doc/m4.texinfo:3478: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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: +echo((hi)) +dnl @result{}0::((hi)) +changecom(`,', `)') +dnl @result{} +echo(hi,hi)bye) +dnl @result{}1:HI,hi)bye: diff -ruNp m4-1.4.8/checks/084.changeword m4-1.4.9/checks/084.changeword --- m4-1.4.8/checks/084.changeword 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/084.changeword 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:3335: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/085.changecom m4-1.4.9/checks/085.changecom --- m4-1.4.8/checks/085.changecom 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/085.changecom 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:3504: Origin of test +dnl @ expected status: 1 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/085.m4wrap m4-1.4.9/checks/085.m4wrap --- m4-1.4.8/checks/085.m4wrap 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/085.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:3386: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/086.changeword m4-1.4.9/checks/086.changeword --- m4-1.4.8/checks/086.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/086.changeword 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:3557: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/086.m4wrap m4-1.4.9/checks/086.m4wrap --- m4-1.4.8/checks/086.m4wrap 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/086.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:3415: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/087.changeword m4-1.4.9/checks/087.changeword --- m4-1.4.8/checks/087.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/087.changeword 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,18 @@ +dnl @ ../doc/m4.texinfo:3570: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/087.m4wrap m4-1.4.9/checks/087.m4wrap --- m4-1.4.8/checks/087.m4wrap 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/087.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:3429: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/088.changeword m4-1.4.9/checks/088.changeword --- m4-1.4.8/checks/088.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/088.changeword 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,39 @@ +dnl @ ../doc/m4.texinfo:3589: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/088.m4wrap m4-1.4.9/checks/088.m4wrap --- m4-1.4.8/checks/088.m4wrap 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/088.m4wrap 1969-12-31 17:00:00.000000000 -0700 @@ -1,9 +0,0 @@ -dnl @ ../doc/m4.texinfo:3443: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/089.changeword m4-1.4.9/checks/089.changeword --- m4-1.4.8/checks/089.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/089.changeword 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,37 @@ +dnl @ ../doc/m4.texinfo:3631: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/089.include m4-1.4.9/checks/089.include --- m4-1.4.8/checks/089.include 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/089.include 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3485: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/090.changeword m4-1.4.9/checks/090.changeword --- m4-1.4.8/checks/090.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/090.changeword 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:3669: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/090.include m4-1.4.9/checks/090.include --- m4-1.4.8/checks/090.include 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/090.include 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:3516: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/091.changeword m4-1.4.9/checks/091.changeword --- m4-1.4.8/checks/091.changeword 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/091.changeword 2007-03-23 07:36:09.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:3706: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/091.include m4-1.4.9/checks/091.include --- m4-1.4.8/checks/091.include 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/091.include 1969-12-31 17:00:00.000000000 -0700 @@ -1,13 +0,0 @@ -dnl @ ../doc/m4.texinfo:3531: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/092.diversions m4-1.4.9/checks/092.diversions --- m4-1.4.8/checks/092.diversions 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/092.diversions 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:3599: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/092.m4wrap m4-1.4.9/checks/092.m4wrap --- m4-1.4.8/checks/092.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/092.m4wrap 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:3759: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/093.diversions m4-1.4.9/checks/093.diversions --- m4-1.4.8/checks/093.diversions 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/093.diversions 1969-12-31 17:00:00.000000000 -0700 @@ -1,33 +0,0 @@ -dnl @ ../doc/m4.texinfo:3631: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/093.m4wrap m4-1.4.9/checks/093.m4wrap --- m4-1.4.8/checks/093.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/093.m4wrap 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:3788: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/094.divert m4-1.4.9/checks/094.divert --- m4-1.4.8/checks/094.divert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/094.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:3696: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/094.m4wrap m4-1.4.9/checks/094.m4wrap --- m4-1.4.8/checks/094.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/094.m4wrap 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:3802: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/095.divert m4-1.4.9/checks/095.divert --- m4-1.4.8/checks/095.divert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/095.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:3712: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 preceeds ') -dnl @result{} -dnl @result{}Wrapped TEXT preceeds diverted text. diff -ruNp m4-1.4.8/checks/095.m4wrap m4-1.4.9/checks/095.m4wrap --- m4-1.4.8/checks/095.m4wrap 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/095.m4wrap 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,10 @@ +dnl @ ../doc/m4.texinfo:3817: Origin of test +dnl @ expected status: 1 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/096.divert m4-1.4.9/checks/096.divert --- m4-1.4.8/checks/096.divert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/096.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,11 +0,0 @@ -dnl @ ../doc/m4.texinfo:3729: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/096.include m4-1.4.9/checks/096.include --- m4-1.4.8/checks/096.include 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/096.include 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:3859: Origin of test +dnl @ expected status: 1 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/097.divert m4-1.4.9/checks/097.divert --- m4-1.4.8/checks/097.divert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/097.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:3743: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/097.include m4-1.4.9/checks/097.include --- m4-1.4.8/checks/097.include 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/097.include 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:3890: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/098.divert m4-1.4.9/checks/098.divert --- m4-1.4.8/checks/098.divert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/098.divert 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3758: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/098.include m4-1.4.9/checks/098.include --- m4-1.4.8/checks/098.include 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/098.include 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,14 @@ +dnl @ ../doc/m4.texinfo:3905: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/099.diversions m4-1.4.9/checks/099.diversions --- m4-1.4.8/checks/099.diversions 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/099.diversions 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,34 @@ +dnl @ ../doc/m4.texinfo:3976: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/099.undivert m4-1.4.9/checks/099.undivert --- m4-1.4.8/checks/099.undivert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/099.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3789: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/100.diversions m4-1.4.9/checks/100.diversions --- m4-1.4.8/checks/100.diversions 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/100.diversions 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,34 @@ +dnl @ ../doc/m4.texinfo:4008: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/100.undivert m4-1.4.9/checks/100.undivert --- m4-1.4.8/checks/100.undivert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/100.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3812: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/101.divert m4-1.4.9/checks/101.divert --- m4-1.4.8/checks/101.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/101.divert 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:4073: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/101.undivert m4-1.4.9/checks/101.undivert --- m4-1.4.8/checks/101.undivert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/101.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:3828: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/102.divert m4-1.4.9/checks/102.divert --- m4-1.4.8/checks/102.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/102.divert 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:4089: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/102.undivert m4-1.4.9/checks/102.undivert --- m4-1.4.8/checks/102.undivert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/102.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:3847: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/103.divert m4-1.4.9/checks/103.divert --- m4-1.4.8/checks/103.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/103.divert 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:4108: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/103.undivert m4-1.4.9/checks/103.undivert --- m4-1.4.8/checks/103.undivert 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/103.undivert 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:3868: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/104.divert m4-1.4.9/checks/104.divert --- m4-1.4.8/checks/104.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/104.divert 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:4122: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/104.divnum m4-1.4.9/checks/104.divnum --- m4-1.4.8/checks/104.divnum 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/104.divnum 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:3892: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/105.cleardiver m4-1.4.9/checks/105.cleardiver --- m4-1.4.8/checks/105.cleardiver 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/105.cleardiver 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:3918: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/105.divert m4-1.4.9/checks/105.divert --- m4-1.4.8/checks/105.divert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/105.divert 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:4137: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/106.cleardiver m4-1.4.9/checks/106.cleardiver --- m4-1.4.8/checks/106.cleardiver 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/106.cleardiver 1969-12-31 17:00:00.000000000 -0700 @@ -1,9 +0,0 @@ -dnl @ ../doc/m4.texinfo:3937: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/106.undivert m4-1.4.9/checks/106.undivert --- m4-1.4.8/checks/106.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/106.undivert 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:4171: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/107.len m4-1.4.9/checks/107.len --- m4-1.4.8/checks/107.len 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/107.len 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:3977: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/107.undivert m4-1.4.9/checks/107.undivert --- m4-1.4.8/checks/107.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/107.undivert 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:4194: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/108.index_macr m4-1.4.9/checks/108.index_macr --- m4-1.4.8/checks/108.index_macr 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/108.index_macr 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:3998: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/108.undivert m4-1.4.9/checks/108.undivert --- m4-1.4.8/checks/108.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/108.undivert 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:4210: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/109.index_macr m4-1.4.9/checks/109.index_macr --- m4-1.4.8/checks/109.index_macr 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/109.index_macr 1969-12-31 17:00:00.000000000 -0700 @@ -1,9 +0,0 @@ -dnl @ ../doc/m4.texinfo:4007: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 diff -ruNp m4-1.4.8/checks/109.undivert m4-1.4.9/checks/109.undivert --- m4-1.4.8/checks/109.undivert 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/109.undivert 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:4229: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/110.regexp m4-1.4.9/checks/110.regexp --- m4-1.4.8/checks/110.regexp 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/110.regexp 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:4051: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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', `\a-c-a') -dnl @result{}<;>abcba -translit(`abcdef', `aabdef', `bcged') -dnl @result{}bgced diff -ruNp m4-1.4.8/checks/116.index_macr m4-1.4.9/checks/116.index_macr --- m4-1.4.8/checks/116.index_macr 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/116.index_macr 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,10 @@ +dnl @ ../doc/m4.texinfo:4390: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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 diff -ruNp m4-1.4.8/checks/116.translit m4-1.4.9/checks/116.translit --- m4-1.4.8/checks/116.translit 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/116.translit 1969-12-31 17:00:00.000000000 -0700 @@ -1,8 +0,0 @@ -dnl @ ../doc/m4.texinfo:4185: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/117.regexp m4-1.4.9/checks/117.regexp --- m4-1.4.8/checks/117.regexp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/117.regexp 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:4439: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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', `\a-c-a') +dnl @result{}<;>abcba +translit(`abcdef', `aabdef', `bcged') +dnl @result{}bgced diff -ruNp m4-1.4.8/checks/123.format m4-1.4.9/checks/123.format --- m4-1.4.8/checks/123.format 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/123.format 1969-12-31 17:00:00.000000000 -0700 @@ -1,21 +0,0 @@ -dnl @ ../doc/m4.texinfo:4333: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/123.translit m4-1.4.9/checks/123.translit --- m4-1.4.8/checks/123.translit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/123.translit 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,9 @@ +dnl @ ../doc/m4.texinfo:4573: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/124.incr m4-1.4.9/checks/124.incr --- m4-1.4.8/checks/124.incr 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/124.incr 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:4397: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/124.translit m4-1.4.9/checks/124.translit --- m4-1.4.8/checks/124.translit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/124.translit 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,10 @@ +dnl @ ../doc/m4.texinfo:4581: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/125.eval m4-1.4.9/checks/125.eval --- m4-1.4.8/checks/125.eval 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/125.eval 1969-12-31 17:00:00.000000000 -0700 @@ -1,25 +0,0 @@ -dnl @ ../doc/m4.texinfo:4489: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(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:8: bad expression in eval: foo/6 -dnl @result{} -eval(foo/6) -dnl @result{}111 diff -ruNp m4-1.4.8/checks/125.patsubst m4-1.4.9/checks/125.patsubst --- m4-1.4.8/checks/125.patsubst 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/125.patsubst 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,20 @@ +dnl @ ../doc/m4.texinfo:4625: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/126.eval m4-1.4.9/checks/126.eval --- m4-1.4.8/checks/126.eval 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/126.eval 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:4522: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(0x80000000 / -1) -dnl @result{}-2147483648 -eval(0x80000000 % -1) -dnl @result{}0 -eval(0x7fffffff) -dnl @result{}2147483647 -incr(eval(0x7fffffff)) -dnl @result{}-2147483648 -eval(-4 >> 33) -dnl @result{}-2 diff -ruNp m4-1.4.8/checks/126.patsubst m4-1.4.9/checks/126.patsubst --- m4-1.4.8/checks/126.patsubst 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/126.patsubst 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:4654: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`upcase', `translit(`$*', `a-z', `A-Z')')dnl +define(`downcase', `translit(`$*', `A-Z', `a-z')')dnl +define(`capitalize1', + `regexp(`$1', `^\(\w\)\(\w*\)', + `upcase(`\1')`'downcase(`\2')')')dnl +define(`capitalize', + `patsubst(`$1', `\w+', `capitalize1(`\&')')')dnl +capitalize(`GNUs not Unix') +dnl @result{}Gnus Not Unix diff -ruNp m4-1.4.8/checks/127.eval m4-1.4.9/checks/127.eval --- m4-1.4.8/checks/127.eval 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/127.eval 1969-12-31 17:00:00.000000000 -0700 @@ -1,22 +0,0 @@ -dnl @ ../doc/m4.texinfo:4546: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 diff -ruNp m4-1.4.8/checks/127.patsubst m4-1.4.9/checks/127.patsubst --- m4-1.4.8/checks/127.patsubst 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/127.patsubst 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:4670: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/128.patsubst m4-1.4.9/checks/128.patsubst --- m4-1.4.8/checks/128.patsubst 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/128.patsubst 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,10 @@ +dnl @ ../doc/m4.texinfo:4684: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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 diff -ruNp m4-1.4.8/checks/128.platform_m m4-1.4.9/checks/128.platform_m --- m4-1.4.8/checks/128.platform_m 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/128.platform_m 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:4620: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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{} -ifdef(`__gnu__', `Extensions are active') -dnl @result{}Extensions are active diff -ruNp m4-1.4.8/checks/129.format m4-1.4.9/checks/129.format --- m4-1.4.8/checks/129.format 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/129.format 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:4709: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`%.0f', `56789.9876') +dnl @result{}56790 +len(format(`%-*X', `300', `1')) +dnl @result{}300 diff -ruNp m4-1.4.8/checks/129.platform_m m4-1.4.9/checks/129.platform_m --- m4-1.4.8/checks/129.platform_m 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/129.platform_m 1969-12-31 17:00:00.000000000 -0700 @@ -1,16 +0,0 @@ -dnl @ ../doc/m4.texinfo:4641: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/130.format m4-1.4.9/checks/130.format --- m4-1.4.8/checks/130.format 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/130.format 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,22 @@ +dnl @ ../doc/m4.texinfo:4723: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/130.syscmd m4-1.4.9/checks/130.syscmd --- m4-1.4.8/checks/130.syscmd 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/130.syscmd 1969-12-31 17:00:00.000000000 -0700 @@ -1,11 +0,0 @@ -dnl @ ../doc/m4.texinfo:4674: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/131.incr m4-1.4.9/checks/131.incr --- m4-1.4.8/checks/131.incr 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/131.incr 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:4787: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/131.syscmd m4-1.4.9/checks/131.syscmd --- m4-1.4.8/checks/131.syscmd 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/131.syscmd 1969-12-31 17:00:00.000000000 -0700 @@ -1,8 +0,0 @@ -dnl @ ../doc/m4.texinfo:4709: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/132.esyscmd m4-1.4.9/checks/132.esyscmd --- m4-1.4.8/checks/132.esyscmd 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/132.esyscmd 1969-12-31 17:00:00.000000000 -0700 @@ -1,11 +0,0 @@ -dnl @ ../doc/m4.texinfo:4736: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/132.eval m4-1.4.9/checks/132.eval --- m4-1.4.8/checks/132.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/132.eval 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:4864: Origin of test +dnl @ expected status: 1 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/133.eval m4-1.4.9/checks/133.eval --- m4-1.4.8/checks/133.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/133.eval 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:4897: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/133.sysval m4-1.4.9/checks/133.sysval --- m4-1.4.8/checks/133.sysval 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/133.sysval 1969-12-31 17:00:00.000000000 -0700 @@ -1,30 +0,0 @@ -dnl @ ../doc/m4.texinfo:4766: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`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.8/checks/134.eval m4-1.4.9/checks/134.eval --- m4-1.4.8/checks/134.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/134.eval 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,21 @@ +dnl @ ../doc/m4.texinfo:4930: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/134.sysval m4-1.4.9/checks/134.sysval --- m4-1.4.8/checks/134.sysval 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/134.sysval 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -dnl @ ../doc/m4.texinfo:4812: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 -13 $$') -dnl @result{} -sysval -dnl @result{}3328 -esyscmd(`kill -9 $$') -dnl @result{} -sysval -dnl @result{}2304 diff -ruNp m4-1.4.8/checks/135.eval m4-1.4.9/checks/135.eval --- m4-1.4.8/checks/135.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/135.eval 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,26 @@ +dnl @ ../doc/m4.texinfo:4966: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(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:8: bad expression in eval: foo / 6 +dnl @result{} +eval(foo / 6) +dnl @result{}111 diff -ruNp m4-1.4.8/checks/135.mkstemp m4-1.4.9/checks/135.mkstemp --- m4-1.4.8/checks/135.mkstemp 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/135.mkstemp 1969-12-31 17:00:00.000000000 -0700 @@ -1,25 +0,0 @@ -dnl @ ../doc/m4.texinfo:4890: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`echo foo??????')dnl -dnl @result{}foo?????? -define(`file1', maketemp(`fooXXXXXX'))dnl -ifelse(esyscmd(`echo foo??????'), `foo??????', `no file', `created') -dnl @result{}created -define(`file2', maketemp(`fooXX'))dnl -define(`file3', mkstemp(`fooXXXXXX'))dnl -ifelse(len(file1), len(file2), `same length', `different') -dnl @result{}same length -ifelse(file1, file2, `same', `different file') -dnl @result{}different file -ifelse(file2, file3, `same', `different file') -dnl @result{}different file -ifelse(file1, file3, `same', `different file') -dnl @result{}different file -syscmd(`rm 'file1 file2 file3) -dnl @result{} -sysval -dnl @result{}0 diff -ruNp m4-1.4.8/checks/136.errprint m4-1.4.9/checks/136.errprint --- m4-1.4.8/checks/136.errprint 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/136.errprint 1969-12-31 17:00:00.000000000 -0700 @@ -1,14 +0,0 @@ -dnl @ ../doc/m4.texinfo:4941: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/136.eval m4-1.4.9/checks/136.eval --- m4-1.4.8/checks/136.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/136.eval 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,25 @@ +dnl @ ../doc/m4.texinfo:4999: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/137.eval m4-1.4.9/checks/137.eval --- m4-1.4.8/checks/137.eval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/137.eval 2007-03-23 07:36:10.000000000 -0600 @@ -0,0 +1,32 @@ +dnl @ ../doc/m4.texinfo:5032: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/137.location m4-1.4.9/checks/137.location --- m4-1.4.8/checks/137.location 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/137.location 1969-12-31 17:00:00.000000000 -0700 @@ -1,10 +0,0 @@ -dnl @ ../doc/m4.texinfo:4975: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/138.location m4-1.4.9/checks/138.location --- m4-1.4.8/checks/138.location 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/138.location 1969-12-31 17:00:00.000000000 -0700 @@ -1,15 +0,0 @@ -dnl @ ../doc/m4.texinfo:4994: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/138.platform_m m4-1.4.9/checks/138.platform_m --- m4-1.4.8/checks/138.platform_m 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/138.platform_m 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:5112: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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{} +ifdef(`__gnu__', `Extensions are active') +dnl @result{}Extensions are active diff -ruNp m4-1.4.8/checks/139.location m4-1.4.9/checks/139.location --- m4-1.4.8/checks/139.location 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/139.location 1969-12-31 17:00:00.000000000 -0700 @@ -1,29 +0,0 @@ -dnl @ ../doc/m4.texinfo:5014: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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 -dnl @result{}6 -dnl @result{}6 diff -ruNp m4-1.4.8/checks/139.platform_m m4-1.4.9/checks/139.platform_m --- m4-1.4.8/checks/139.platform_m 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/139.platform_m 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,17 @@ +dnl @ ../doc/m4.texinfo:5132: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/140.m4exit m4-1.4.9/checks/140.m4exit --- m4-1.4.8/checks/140.m4exit 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/140.m4exit 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:5067: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/140.syscmd m4-1.4.9/checks/140.syscmd --- m4-1.4.8/checks/140.syscmd 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/140.syscmd 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:5165: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/141.m4exit m4-1.4.9/checks/141.m4exit --- m4-1.4.8/checks/141.m4exit 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/141.m4exit 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:5084: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/141.syscmd m4-1.4.9/checks/141.syscmd --- m4-1.4.8/checks/141.syscmd 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/141.syscmd 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,9 @@ +dnl @ ../doc/m4.texinfo:5200: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/142.esyscmd m4-1.4.9/checks/142.esyscmd --- m4-1.4.8/checks/142.esyscmd 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/142.esyscmd 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,12 @@ +dnl @ ../doc/m4.texinfo:5227: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/142.extensions m4-1.4.9/checks/142.extensions --- m4-1.4.8/checks/142.extensions 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/142.extensions 1969-12-31 17:00:00.000000000 -0700 @@ -1,23 +0,0 @@ -dnl @ ../doc/m4.texinfo:5334: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/143.incompatib m4-1.4.9/checks/143.incompatib --- m4-1.4.8/checks/143.incompatib 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/143.incompatib 1969-12-31 17:00:00.000000000 -0700 @@ -1,23 +0,0 @@ -dnl @ ../doc/m4.texinfo:5459: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/143.sysval m4-1.4.9/checks/143.sysval --- m4-1.4.8/checks/143.sysval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/143.sysval 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,33 @@ +dnl @ ../doc/m4.texinfo:5257: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/144.improved_e m4-1.4.9/checks/144.improved_e --- m4-1.4.8/checks/144.improved_e 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/144.improved_e 1969-12-31 17:00:00.000000000 -0700 @@ -1,12 +0,0 @@ -dnl @ ../doc/m4.texinfo:5670: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/144.sysval m4-1.4.9/checks/144.sysval --- m4-1.4.8/checks/144.sysval 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/144.sysval 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,24 @@ +dnl @ ../doc/m4.texinfo:5307: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/145.improved_f m4-1.4.9/checks/145.improved_f --- m4-1.4.8/checks/145.improved_f 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/145.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,30 +0,0 @@ -dnl @ ../doc/m4.texinfo:5690: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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(`($3) >= ($2)'), `1', -dnl @result{} `pushdef(`$1', eval(`$2'))_forloop(`$1', -dnl @result{} eval(`$3'), `$4')popdef(`$1')')') -dnl @result{}define(`_forloop', -dnl @result{} `$3`'ifelse(indir(`$1'), `$2', `', -dnl @result{} `define(`$1', incr(indir(`$1')))$0($@)')') -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): (b) >= (a) -dnl @result{} diff -ruNp m4-1.4.8/checks/145.mkstemp m4-1.4.9/checks/145.mkstemp --- m4-1.4.8/checks/145.mkstemp 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/145.mkstemp 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,26 @@ +dnl @ ../doc/m4.texinfo:5392: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`echo foo??????')dnl +dnl @result{}foo?????? +define(`file1', maketemp(`fooXXXXXX'))dnl +ifelse(esyscmd(`echo foo??????'), `foo??????', `no file', `created') +dnl @result{}created +define(`file2', maketemp(`fooXX'))dnl +define(`file3', mkstemp(`fooXXXXXX'))dnl +ifelse(len(file1), len(file2), `same length', `different') +dnl @result{}same length +ifelse(file1, file2, `same', `different file') +dnl @result{}different file +ifelse(file2, file3, `same', `different file') +dnl @result{}different file +ifelse(file1, file3, `same', `different file') +dnl @result{}different file +syscmd(`rm 'file1 file2 file3) +dnl @result{} +sysval +dnl @result{}0 diff -ruNp m4-1.4.8/checks/146.errprint m4-1.4.9/checks/146.errprint --- m4-1.4.8/checks/146.errprint 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/146.errprint 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,15 @@ +dnl @ ../doc/m4.texinfo:5444: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/146.improved_f m4-1.4.9/checks/146.improved_f --- m4-1.4.8/checks/146.improved_f 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/146.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,32 +0,0 @@ -dnl @ ../doc/m4.texinfo:5729: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/147.improved_f m4-1.4.9/checks/147.improved_f --- m4-1.4.8/checks/147.improved_f 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/147.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,30 +0,0 @@ -dnl @ ../doc/m4.texinfo:5767: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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')_foreachq($@)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.8/checks/147.location m4-1.4.9/checks/147.location --- m4-1.4.8/checks/147.location 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/147.location 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:5480: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/148.improved_f m4-1.4.9/checks/148.improved_f --- m4-1.4.8/checks/148.improved_f 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/148.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,34 +0,0 @@ -dnl @ ../doc/m4.texinfo:5808: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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')_foreach(`$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.8/checks/148.location m4-1.4.9/checks/148.location --- m4-1.4.8/checks/148.location 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/148.location 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,16 @@ +dnl @ ../doc/m4.texinfo:5499: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/149.improved_f m4-1.4.9/checks/149.improved_f --- m4-1.4.8/checks/149.improved_f 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/149.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,70 +0,0 @@ -dnl @ ../doc/m4.texinfo:5852: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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', `', `') / foreachq(`x', `', `') -dnl @result{} / -dnl 1-element list of empty element -foreach(`x', `()', `') / foreachq(`x', ``'', `') -dnl @result{}<> / <> -dnl 2-element list of empty elements -foreach(`x', `(`',`')', `') / foreachq(`x', ``',`'', `') -dnl @result{}<><> / <><> -dnl 1-element list of a comma -foreach(`x', `(`,')', `') / foreachq(`x', ``,'', `') -dnl @result{}<,> / <,> -dnl 2-element list of unbalanced parentheses -foreach(`x', `(`(', `)')', `') / foreachq(`x', ``(', `)'', `') -dnl @result{}<(><)> / <(><)> -define(`active', `ACT, IVE') -dnl @result{} -traceon(`active') -dnl @result{} -dnl list of unquoted macros; expansion occurs before recursion -foreach(`x', `(active, active)', ` -')dnl -dnl @error{}m4trace: -4- active -> `ACT, IVE' -dnl @error{}m4trace: -4- active -> `ACT, IVE' -dnl @result{} -dnl @result{} -dnl @result{} -dnl @result{} -foreachq(`x', `active, active', ` -')dnl -dnl @error{}m4trace: -3- active -> `ACT, IVE' -dnl @error{}m4trace: -3- active -> `ACT, IVE' -dnl @result{} -dnl @error{}m4trace: -3- active -> `ACT, IVE' -dnl @error{}m4trace: -3- active -> `ACT, IVE' -dnl @result{} -dnl @result{} -dnl @result{} -dnl list of quoted macros; expansion occurs during recursion -foreach(`x', `(`active', `active')', ` -')dnl -dnl @error{}m4trace: -1- active -> `ACT, IVE' -dnl @result{} -dnl @error{}m4trace: -1- active -> `ACT, IVE' -dnl @result{} -foreachq(`x', ``active', `active'', ` -')dnl -dnl @error{}m4trace: -1- active -> `ACT, IVE' -dnl @result{} -dnl @error{}m4trace: -1- active -> `ACT, IVE' -dnl @result{} -dnl list of double-quoted macro names; no expansion -foreach(`x', `(``active'', ``active'')', ` -')dnl -dnl @result{} -dnl @result{} -foreachq(`x', ```active'', ``active''', ` -')dnl -dnl @result{} -dnl @result{} diff -ruNp m4-1.4.8/checks/149.location m4-1.4.9/checks/149.location --- m4-1.4.8/checks/149.location 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/149.location 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,30 @@ +dnl @ ../doc/m4.texinfo:5519: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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 +dnl @result{}6 +dnl @result{}6 diff -ruNp m4-1.4.8/checks/150.improved_c m4-1.4.9/checks/150.improved_c --- m4-1.4.8/checks/150.improved_c 2006-11-20 07:12:37.000000000 -0700 +++ m4-1.4.9/checks/150.improved_c 1969-12-31 17:00:00.000000000 -0700 @@ -1,28 +0,0 @@ -dnl @ ../doc/m4.texinfo:5928: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/150.m4exit m4-1.4.9/checks/150.m4exit --- m4-1.4.8/checks/150.m4exit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/150.m4exit 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:5572: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/151.improved_f m4-1.4.9/checks/151.improved_f --- m4-1.4.8/checks/151.improved_f 2006-11-20 07:12:38.000000000 -0700 +++ m4-1.4.9/checks/151.improved_f 1969-12-31 17:00:00.000000000 -0700 @@ -1,18 +0,0 @@ -dnl @ ../doc/m4.texinfo:5965: Origin of test -dnl @ Copyright (C) 2006 Free Software Foundation -dnl @ This file is free software; the Free Software 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.8/checks/151.m4exit m4-1.4.9/checks/151.m4exit --- m4-1.4.8/checks/151.m4exit 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/151.m4exit 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:5590: Origin of test +dnl @ expected status: 1 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/152.extensions m4-1.4.9/checks/152.extensions --- m4-1.4.8/checks/152.extensions 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/152.extensions 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,24 @@ +dnl @ ../doc/m4.texinfo:5843: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/153.incompatib m4-1.4.9/checks/153.incompatib --- m4-1.4.8/checks/153.incompatib 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/153.incompatib 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,24 @@ +dnl @ ../doc/m4.texinfo:5971: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/154.other_inco m4-1.4.9/checks/154.other_inco --- m4-1.4.8/checks/154.other_inco 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/154.other_inco 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,11 @@ +dnl @ ../doc/m4.texinfo:6136: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/155.improved_e m4-1.4.9/checks/155.improved_e --- m4-1.4.8/checks/155.improved_e 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/155.improved_e 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,13 @@ +dnl @ ../doc/m4.texinfo:6187: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/156.improved_f m4-1.4.9/checks/156.improved_f --- m4-1.4.8/checks/156.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/156.improved_f 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:6207: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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(`($3) >= ($2)'), `1', +dnl @result{} `pushdef(`$1', eval(`$2'))_forloop(`$1', +dnl @result{} eval(`$3'), `$4')popdef(`$1')')') +dnl @result{}define(`_forloop', +dnl @result{} `$3`'ifelse(indir(`$1'), `$2', `', +dnl @result{} `define(`$1', incr(indir(`$1')))$0($@)')') +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): (b) >= (a) +dnl @result{} diff -ruNp m4-1.4.8/checks/157.improved_f m4-1.4.9/checks/157.improved_f --- m4-1.4.8/checks/157.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/157.improved_f 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,33 @@ +dnl @ ../doc/m4.texinfo:6246: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/158.improved_f m4-1.4.9/checks/158.improved_f --- m4-1.4.8/checks/158.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/158.improved_f 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,31 @@ +dnl @ ../doc/m4.texinfo:6286: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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')_foreachq($@)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.8/checks/159.improved_f m4-1.4.9/checks/159.improved_f --- m4-1.4.8/checks/159.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/159.improved_f 2007-03-23 07:36:11.000000000 -0600 @@ -0,0 +1,35 @@ +dnl @ ../doc/m4.texinfo:6327: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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')_foreach(`$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.8/checks/160.improved_f m4-1.4.9/checks/160.improved_f --- m4-1.4.8/checks/160.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/160.improved_f 2007-03-23 07:36:12.000000000 -0600 @@ -0,0 +1,71 @@ +dnl @ ../doc/m4.texinfo:6371: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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', `', `') / foreachq(`x', `', `') +dnl @result{} / +dnl 1-element list of empty element +foreach(`x', `()', `') / foreachq(`x', ``'', `') +dnl @result{}<> / <> +dnl 2-element list of empty elements +foreach(`x', `(`',`')', `') / foreachq(`x', ``',`'', `') +dnl @result{}<><> / <><> +dnl 1-element list of a comma +foreach(`x', `(`,')', `') / foreachq(`x', ``,'', `') +dnl @result{}<,> / <,> +dnl 2-element list of unbalanced parentheses +foreach(`x', `(`(', `)')', `') / foreachq(`x', ``(', `)'', `') +dnl @result{}<(><)> / <(><)> +define(`active', `ACT, IVE') +dnl @result{} +traceon(`active') +dnl @result{} +dnl list of unquoted macros; expansion occurs before recursion +foreach(`x', `(active, active)', ` +')dnl +dnl @error{}m4trace: -4- active -> `ACT, IVE' +dnl @error{}m4trace: -4- active -> `ACT, IVE' +dnl @result{} +dnl @result{} +dnl @result{} +dnl @result{} +foreachq(`x', `active, active', ` +')dnl +dnl @error{}m4trace: -3- active -> `ACT, IVE' +dnl @error{}m4trace: -3- active -> `ACT, IVE' +dnl @result{} +dnl @error{}m4trace: -3- active -> `ACT, IVE' +dnl @error{}m4trace: -3- active -> `ACT, IVE' +dnl @result{} +dnl @result{} +dnl @result{} +dnl list of quoted macros; expansion occurs during recursion +foreach(`x', `(`active', `active')', ` +')dnl +dnl @error{}m4trace: -1- active -> `ACT, IVE' +dnl @result{} +dnl @error{}m4trace: -1- active -> `ACT, IVE' +dnl @result{} +foreachq(`x', ``active', `active'', ` +')dnl +dnl @error{}m4trace: -1- active -> `ACT, IVE' +dnl @result{} +dnl @error{}m4trace: -1- active -> `ACT, IVE' +dnl @result{} +dnl list of double-quoted macro names; no expansion +foreach(`x', `(``active'', ``active'')', ` +')dnl +dnl @result{} +dnl @result{} +foreachq(`x', ```active'', ``active''', ` +')dnl +dnl @result{} +dnl @result{} diff -ruNp m4-1.4.8/checks/161.improved_c m4-1.4.9/checks/161.improved_c --- m4-1.4.8/checks/161.improved_c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/161.improved_c 2007-03-23 07:36:12.000000000 -0600 @@ -0,0 +1,29 @@ +dnl @ ../doc/m4.texinfo:6447: Origin of test +dnl @ expected status: 0 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/162.improved_f m4-1.4.9/checks/162.improved_f --- m4-1.4.8/checks/162.improved_f 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/checks/162.improved_f 2007-03-23 07:36:12.000000000 -0600 @@ -0,0 +1,19 @@ +dnl @ ../doc/m4.texinfo:6485: Origin of test +dnl @ expected status: 1 +dnl @ Copyright (C) 2006, 2007 Free Software Foundation +dnl @ This file is free software; the Free Software 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.8/checks/check-them m4-1.4.9/checks/check-them --- m4-1.4.8/checks/check-them 2006-09-07 07:08:54.000000000 -0600 +++ m4-1.4.9/checks/check-them 2007-01-06 12:56:11.000000000 -0700 @@ -1,6 +1,6 @@ #!/bin/sh # Check GNU m4 against examples from the manual source. -# Copyright (C) 1992, 2006 Free Software Foundation, Inc. +# Copyright (C) 1992, 2006, 2007 Free Software Foundation, Inc. # Sanity check what we are testing m4 --version @@ -59,12 +59,22 @@ do echo "Checking $file" sed -e '/^dnl @/d' -e '/^\^D$/q' "$file" \ | LC_MESSAGES=C m4 -d -I "$examples" - >$out 2>$err + stat=$? - if test $? = 77 ; then - skipped="$skipped $file" - cat $err - continue - fi + xstat=`sed -ne '2s/^dnl @ expected status: //p;2q' "$file"` + case $stat in + 77) + skipped="$skipped $file" + cat $err + continue + ;; + $xstat) ;; + *) + failed="$failed $file:status" + echo `sed -e 's/^dnl //' -e 1q $file` + echo "$file: status was $stat, expected $xstat" + ;; + esac sed -e '/^dnl @result{}/!d' -e 's///' -e "s|\.\./examples|$examples|" \ "$file" > $xout diff -ruNp m4-1.4.8/checks/get-them m4-1.4.9/checks/get-them --- m4-1.4.8/checks/get-them 2006-11-20 06:55:42.000000000 -0700 +++ m4-1.4.9/checks/get-them 2007-01-27 18:54:41.000000000 -0700 @@ -1,6 +1,7 @@ #!/bin/sh +# -*- AWK -*- # Extract all examples from the manual source. -# Copyright (C) 1992, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 1992, 2005, 2006, 2007 Free Software Foundation, Inc. # This script is for use with GNU awk. @@ -13,6 +14,7 @@ BEGIN { seq = -1; count = 0; file = "NONE"; + status = 0; } /^@node / { @@ -34,9 +36,14 @@ BEGIN { /^@comment ignore$/ { getline; + status = 0; next; } +/^@comment status: / { + status = $3; +} + /^@example$/, /^@end example$/ { if (seq < 0) next; @@ -47,11 +54,13 @@ BEGIN { count++; file = sprintf("%03d.%s", count, node); printf("dnl @ %s:%d: Origin of test\n"\ - "dnl @ Copyright (C) 2006 Free Software Foundation\n"\ + "dnl @ expected status: %d\n"\ + "dnl @ Copyright (C) 2006, 2007 Free Software Foundation\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"\ - "dnl @ is preserved.\n", FILENAME, NR) > file; + "dnl @ is preserved.\n", FILENAME, NR, status) > file; + status = 0; next; } if ($0 ~ /^@end example$/) { @@ -64,6 +73,8 @@ BEGIN { else prefix = ""; gsub("@@", "@", $0); + gsub("@{", "{", $0); + gsub("@}", "}", $0); gsub("@w{ }", " ", $0); gsub("@tabchar{}", "\t", $0); printf("%s%s\n", prefix, $0) >> file; diff -ruNp m4-1.4.8/config.guess m4-1.4.9/config.guess --- m4-1.4.8/config.guess 2006-11-20 07:08:13.000000000 -0700 +++ m4-1.4.9/config.guess 2007-03-23 06:54:13.000000000 -0600 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2006-07-02' +timestamp='2007-03-06' # 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 @@ -161,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -780,7 +781,7 @@ EOF i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - i*:MINGW*:*) + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) @@ -790,12 +791,15 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - x86:Interix*:[3456]*) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T:Interix*:[3456]*) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; @@ -950,6 +954,9 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -1208,6 +1215,15 @@ EOF SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; diff -ruNp m4-1.4.8/config.sub m4-1.4.9/config.sub --- m4-1.4.8/config.sub 2006-11-20 07:08:13.000000000 -0700 +++ m4-1.4.9/config.sub 2007-03-23 06:54:13.000000000 -0600 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2006-09-20' +timestamp='2007-01-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -245,12 +245,12 @@ case $basic_machine in | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore \ + | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -324,7 +324,7 @@ case $basic_machine in | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ @@ -925,6 +925,9 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sh5el) + basic_machine=sh5le-unknown + ;; sh64) basic_machine=sh64-unknown ;; @@ -1219,7 +1222,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1414,6 +1417,9 @@ case $basic_machine in m68*-cisco) os=-aout ;; + mep-*) + os=-elf + ;; mips*-cisco) os=-elf ;; diff -ruNp m4-1.4.8/configure m4-1.4.9/configure --- m4-1.4.8/configure 2006-11-20 07:25:55.000000000 -0700 +++ m4-1.4.9/configure 2007-03-23 07:32:41.000000000 -0600 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for GNU M4 1.4.8. +# Generated by GNU Autoconf 2.61 for GNU M4 1.4.9. # # Report bugs to . # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='GNU M4' PACKAGE_TARNAME='m4' -PACKAGE_VERSION='1.4.8' -PACKAGE_STRING='GNU M4 1.4.8' +PACKAGE_VERSION='1.4.9' +PACKAGE_STRING='GNU M4 1.4.9' PACKAGE_BUGREPORT='bug-m4@gnu.org' ac_unique_file="src/m4.h" @@ -709,11 +709,22 @@ GL_COND_LIBTOOL_FALSE ALLOCA ALLOCA_H GETOPT_H +ABSOLUTE_SYS_TIME_H +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +SYS_TIME_H +GLIBC21 +GNULIB_GETSUBOPT +GNULIB_MKDTEMP +GNULIB_MKSTEMP +HAVE_GETSUBOPT +HAVE_MKDTEMP +REPLACE_MKSTEMP STDBOOL_H HAVE__BOOL HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT -HAVE_WCHAR_H HAVE_INTTYPES_H HAVE_SYS_TYPES_H ABSOLUTE_STDINT_H @@ -734,10 +745,32 @@ SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H +ABSOLUTE_STDLIB_H ABSOLUTE_SYS_STAT_H SYS_STAT_H -UNISTD_H +GNULIB_CHOWN +GNULIB_DUP2 +GNULIB_FCHDIR +GNULIB_FTRUNCATE +GNULIB_GETCWD +GNULIB_GETLOGIN_R +GNULIB_READLINK +HAVE_DUP2 +HAVE_FTRUNCATE +HAVE_READLINK +HAVE_DECL_GETLOGIN_R +REPLACE_CHOWN +REPLACE_FCHDIR +REPLACE_GETCWD +HAVE_UNISTD_H +ABSOLUTE_UNISTD_H EOVERFLOW +ABSOLUTE_WCHAR_H +WCHAR_H +HAVE_WINT_T +ABSOLUTE_WCTYPE_H +HAVE_WCTYPE_H +WCTYPE_H LIBM4_LIBDEPS LIBM4_LTLIBDEPS STACKOVF_TRUE @@ -1258,7 +1291,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.8 to adapt to many kinds of systems. +\`configure' configures GNU M4 1.4.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1328,7 +1361,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU M4 1.4.8:";; + short | recursive ) echo "Configuration of GNU M4 1.4.9:";; esac cat <<\_ACEOF @@ -1344,9 +1377,12 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-included-regex - 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) + 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) --with-dmalloc use dmalloc, as in dmalloc.tar.gz from @/ftp.antaire.com:antaire/src/dmalloc. @@ -1424,7 +1460,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU M4 configure 1.4.8 +GNU M4 configure 1.4.9 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1438,7 +1474,7 @@ 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.8, which was +It was created by GNU M4 $as_me 1.4.9, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1722,23 +1758,24 @@ ac_func_list="$ac_func_list strerror" ac_header_list="$ac_header_list unistd.h" ac_func_list="$ac_func_list raise" ac_header_list="$ac_header_list stdio_ext.h" -ac_header_list="$ac_header_list wchar.h" -ac_header_list="$ac_header_list wctype.h" +ac_header_list="$ac_header_list sys/time.h" +ac_func_list="$ac_func_list gettimeofday" ac_header_list="$ac_header_list sys/param.h" -ac_func_list="$ac_func_list iswprint" ac_func_list="$ac_func_list mbsinit" ac_header_list="$ac_header_list locale.h" +ac_func_list="$ac_func_list iswctype" ac_func_list="$ac_func_list mbrtowc" -ac_func_list="$ac_func_list mempcpy" ac_func_list="$ac_func_list wcrtomb" ac_func_list="$ac_func_list wcscoll" ac_header_list="$ac_header_list stdint.h" +ac_header_list="$ac_header_list stdlib.h" ac_func_list="$ac_func_list lstat" ac_header_list="$ac_header_list sys/stat.h" -ac_header_list="$ac_header_list sys/time.h" -ac_func_list="$ac_func_list gettimeofday" ac_func_list="$ac_func_list pipe" -ac_func_list="$ac_func_list wcwidth" +ac_func_list="$ac_func_list vasnprintf" +ac_header_list="$ac_header_list wchar.h" +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 @@ -2156,7 +2193,7 @@ fi # Define the identity of the package. PACKAGE='m4' - VERSION='1.4.8' + VERSION='1.4.9' cat >>confdefs.h <<_ACEOF @@ -4482,42 +4519,162 @@ _ACEOF + case $ac_cv_prog_cc_stdc in + no) ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; + *) { echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C99... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c99+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; +typedef const char *ccp; +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + const char *str; + int number; + float fnumber; + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} +int +main () +{ + // Check bool. + _Bool success = false; + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); -for ac_header in $ac_header_list -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext +for ac_arg in '' -std=gnu99 -c99 -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -4534,112 +4691,175 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_prog_cc_c99=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + fi -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +if test "x$ac_cv_prog_cc_c89" != xno; then + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 else - eval "$as_ac_Header=\$ac_header_preproc" + ac_cv_prog_cc_stdc=no fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF fi -done - - - - + ;; +esac + { echo "$as_me:$LINENO: checking for $CC option to accept ISO Standard C" >&5 +echo $ECHO_N "checking for $CC option to accept ISO Standard C... $ECHO_C" >&6; } + if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi + case $ac_cv_prog_cc_stdc in + no) { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + '') { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + *) { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6; } ;; +esac @@ -4649,39 +4869,48 @@ done +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi +if test "$enable_largefile" != no; then - -{ echo "$as_me:$LINENO: checking for siginfo_t" >&5 -echo $ECHO_N "checking for siginfo_t... $ECHO_C" >&6; } -if test "${ac_cv_type_siginfo_t+set}" = set; then + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#if HAVE_SIGINFO_H -# include -#endif - - -typedef siginfo_t ac__type_new_; +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext + rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -4698,47 +4927,79 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_siginfo_t=yes + break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_siginfo_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_siginfo_t" >&5 -echo "${ECHO_T}$ac_cv_type_siginfo_t" >&6; } -if test $ac_cv_type_siginfo_t = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGINFO_T 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 fi -{ echo "$as_me:$LINENO: checking for struct sigaction.sa_sigaction" >&5 -echo $ECHO_N "checking for struct sigaction.sa_sigaction... $ECHO_C" >&6; } -if test "${ac_cv_member_struct_sigaction_sa_sigaction+set}" = set; then +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - - +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -static struct sigaction ac_aggr; -if (ac_aggr.sa_sigaction) -return 0; + ; return 0; } @@ -4760,26 +5021,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_sigaction_sa_sigaction=yes + ac_cv_sys_file_offset_bits=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF + +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. */ -#include - - +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -static struct sigaction ac_aggr; -if (sizeof ac_aggr.sa_sigaction) -return 0; + ; return 0; } @@ -4801,36 +5071,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_sigaction_sa_sigaction=yes + ac_cv_sys_file_offset_bits=64; break else 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 + ac_cv_sys_file_offset_bits=unknown + break +done fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_sigaction_sa_sigaction" >&5 -echo "${ECHO_T}$ac_cv_member_struct_sigaction_sa_sigaction" >&6; } -if test $ac_cv_member_struct_sigaction_sa_sigaction = yes; then - +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF - - -fi - - -{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } -if test "${ac_cv_type_signal+set}" = set; then +;; +esac +rm -f conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4838,12 +5109,18 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include - + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -return *(signal (0, 0)) (0) == 1; + ; return 0; } @@ -4865,44 +5142,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_signal=int + ac_cv_sys_large_files=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +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. */ -$ac_includes_default -typedef size_t ac__type_new_; +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; + ; return 0; } @@ -4924,134 +5192,180 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes + ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then - : -else - +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF -#define size_t unsigned int +#define _LARGE_FILES $ac_cv_sys_large_files _ACEOF - +;; +esac +rm -f conftest* + fi fi - -for ac_func in $ac_func_list +for ac_header in $ac_header_list do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -#undef $ac_func + ac_header_compiler=no +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 $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 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -int -main () -{ -return $ac_func (); - ; - return 0; -} +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------- ## +## Report this to bug-m4@gnu.org ## +## ----------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_var'}'` +ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi -done - - - - - - - - +done @@ -5069,11 +5383,9 @@ done -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for siginfo_t" >&5 +echo $ECHO_N "checking for siginfo_t... $ECHO_C" >&6; } +if test "${ac_cv_type_siginfo_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5082,24 +5394,32 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +#if HAVE_SIGINFO_H +# include +#endif + + +typedef siginfo_t ac__type_new_; int main () { -char *p = (char *) alloca (2 * sizeof (int)); - if (p) return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5108,32 +5428,31 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_working_alloca_h=yes + } && test -s conftest.$ac_objext; then + ac_cv_type_siginfo_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_working_alloca_h=no + ac_cv_type_siginfo_t=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } -if test $ac_cv_working_alloca_h = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_siginfo_t" >&5 +echo "${ECHO_T}$ac_cv_type_siginfo_t" >&6; } +if test $ac_cv_type_siginfo_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T 1 _ACEOF + fi -{ echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then +{ echo "$as_me:$LINENO: checking for struct sigaction.sa_sigaction" >&5 +echo $ECHO_N "checking for struct sigaction.sa_sigaction... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_sigaction_sa_sigaction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5142,44 +5461,27 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif +#include + int main () { -char *p = (char *) alloca (1); - if (p) return 0; +static struct sigaction ac_aggr; +if (ac_aggr.sa_sigaction) +return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5188,131 +5490,39 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_alloca_works=yes + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sigaction_sa_sigaction=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_alloca_works=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=\${LIBOBJDIR}alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } -if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func +#include -/* 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 (); +static struct sigaction ac_aggr; +if (sizeof ac_aggr.sa_sigaction) +return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5321,139 +5531,165 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sigaction_sa_sigaction=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_member_struct_sigaction_sa_sigaction=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_sigaction_sa_sigaction" >&5 +echo "${ECHO_T}$ac_cv_member_struct_sigaction_sa_sigaction" >&6; } +if test $ac_cv_member_struct_sigaction_sa_sigaction = yes; then cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func +#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 _ACEOF - break -fi - done fi -{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then +{ echo "$as_me:$LINENO: checking for stack_t.ss_sp" >&5 +echo $ECHO_N "checking for stack_t.ss_sp... $ECHO_C" >&6; } +if test "${ac_cv_member_stack_t_ss_sp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} +#include +#if HAVE_SIGINFO_H +# include +#endif + int main () { - return find_stack_direction () < 0; +static stack_t ac_aggr; +if (ac_aggr.ss_sp) +return 0; + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_stack_t_ss_sp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if HAVE_SIGINFO_H +# include +#endif + + +int +main () +{ +static stack_t ac_aggr; +if (sizeof ac_aggr.ss_sp) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_stack_t_ss_sp=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + ac_cv_member_stack_t_ss_sp=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_member_stack_t_ss_sp" >&5 +echo "${ECHO_T}$ac_cv_member_stack_t_ss_sp" >&6; } +if test $ac_cv_member_stack_t_ss_sp = yes; then cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction +#define HAVE_STACK_T_SS_SP 1 _ACEOF fi - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF + 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> +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -5472,186 +5708,214 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_type_signal=int else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6; } -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +$ac_includes_default +typedef size_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest.$ac_objext; then + ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + ac_cv_type_size_t=no fi -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then + : +else -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int _ACEOF fi -done -{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + + + + +for ac_func in $ac_func_list +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - 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 +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include #else -char *malloc (); +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me #endif int main () { -return ! malloc (0); +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest$ac_exeext +rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + eval "$as_ac_var=no" fi - +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then - gl_cv_func_malloc_0_nonnull=1 -else - gl_cv_func_malloc_0_nonnull=0 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + fi +done + + + + + + + + + + + + + + + + + + + -cat >>confdefs.h <<_ACEOF -#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull -_ACEOF + +# Tandem/NSK is broken - it has 'long long int' but not +# 'unsigned long long int', which confuses assumptions made by gnulib. +# Simply pretend that neither type exists if both do not work. + { echo "$as_me:$LINENO: checking for long long int" >&5 echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } if test "${ac_cv_type_long_long_int+set}" = set; then @@ -5784,42 +6048,39 @@ _ACEOF fi - { echo "$as_me:$LINENO: checking for long double" >&5 -echo $ECHO_N "checking for long double... $ECHO_C" >&6; } -if test "${gt_cv_c_long_double+set}" = set; then + { echo "$as_me:$LINENO: checking for unsigned long long int" >&5 +echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; } +if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$GCC" = yes; then - gt_cv_c_long_double=yes - else - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - /* The Stardent Vistra knows sizeof(long double), but does not support it. */ - long double foo = 0.0; - /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ - int array [2*(sizeof(long double) >= sizeof(double)) - 1]; - +unsigned long long int ull = 18446744073709551615ULL; + typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; int main () { - +unsigned long long int ullmax = 18446744073709551615ull; + return (ull << 63 | ull >> 63 | ull << i | ull >> i + | ullmax / ull | ullmax % ull); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5828,31 +6089,44 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gt_cv_c_long_double=yes + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_type_unsigned_long_long_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - gt_cv_c_long_double=no + ac_cv_type_unsigned_long_long_int=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 -echo "${ECHO_T}$gt_cv_c_long_double" >&6; } - if test $gt_cv_c_long_double = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_DOUBLE 1 +#define HAVE_UNSIGNED_LONG_LONG_INT 1 _ACEOF fi -{ echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 -echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_strerror_r+set}" = set; then +if test $ac_cv_type_long_long_int:$ac_cv_type_unsigned_long_long_int = yes:no +then + ac_cv_type_long_long_int=no + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_LONG_INT 0 +_ACEOF + +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } +if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5861,26 +6135,24 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include int main () { -#ifndef strerror_r - (void) strerror_r; -#endif - +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5889,39 +6161,153 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec (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 + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_strerror_r=no + ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6; } -if test $ac_cv_have_decl_strerror_r = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R 1 +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA_H 1 _ACEOF +fi +{ echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R 0 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_alloca_works=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } +if test $ac_cv_func_alloca_works = yes; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF -for ac_func in strerror_r -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +cat >>confdefs.h <<\_ACEOF +#define C_ALLOCA 1 +_ACEOF + + +{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then @@ -6005,22 +6391,26 @@ ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func _ACEOF + break fi -done -{ echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 -echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6; } -if test "${ac_cv_func_strerror_r_char_p+set}" = set; then + done +fi + +{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } +if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - ac_cv_func_strerror_r_char_p=no - if test $ac_cv_have_decl_strerror_r = yes; then - cat >conftest.$ac_ext <<_ACEOF + 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 @@ -6028,80 +6418,33 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int -main () +find_stack_direction () { + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} - char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - char *p = strerror_r (0, buf, sizeof buf); - return !p || x; - - ; - return 0; +int +main () +{ + return find_stack_direction () < 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - else - # strerror_r is not declared. Choose between - # systems that have relatively inaccessible declarations for the - # function. BeOS and DEC UNIX 4.0 fall in this category, but the - # former has a strerror_r that returns char*, while the latter - # has a strerror_r that returns `int'. - # This test should segfault on the DEC system. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - extern char *strerror_r (); -int -main () -{ -char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - return ! isalpha (x); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' @@ -6114,111 +6457,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_strerror_r_char_p=yes + ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 -echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6; } -if test $ac_cv_func_strerror_r_char_p = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STRERROR_R_CHAR_P 1 -_ACEOF - -fi - - - { echo "$as_me:$LINENO: checking for sig_atomic_t" >&5 -echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6; } -if test "${ac_cv_type_sig_atomic_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -typedef sig_atomic_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_sig_atomic_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_sig_atomic_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_sig_atomic_t" >&5 -echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6; } -if test $ac_cv_type_sig_atomic_t = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF -#define HAVE_SIG_ATOMIC_T 1 +#define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF -else - -cat >>confdefs.h <<\_ACEOF -#define sig_atomic_t int -_ACEOF - fi - - - - - - - if test -z "$GETOPT_H"; then - -for ac_header in getopt.h +for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -6358,133 +6623,111 @@ if test `eval echo '${'$as_ac_Header'}'` #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -else - GETOPT_H=getopt.h fi done - fi - - if test -z "$GETOPT_H"; then - -for ac_func in getopt_long_only -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include #else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me +char *malloc (); #endif int main () { -return $ac_func (); +return ! malloc (0); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext +rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_link") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" +( exit $ac_status ) +ac_cv_func_malloc_0_nonnull=no fi - -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_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then + gl_cv_func_malloc_0_nonnull=1 else - GETOPT_H=getopt.h + gl_cv_func_malloc_0_nonnull=0 fi -done - fi - if test -z "$GETOPT_H"; then - { echo "$as_me:$LINENO: checking whether optreset is declared" >&5 -echo $ECHO_N "checking whether optreset is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_optreset+set}" = set; then + +cat >>confdefs.h <<_ACEOF +#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull +_ACEOF + + + + { echo "$as_me:$LINENO: checking for long double" >&5 +echo $ECHO_N "checking for long double... $ECHO_C" >&6; } +if test "${gt_cv_c_long_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$GCC" = yes; then + gt_cv_c_long_double=yes + else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include + + /* The Stardent Vistra knows sizeof(long double), but does not support it. */ + long double foo = 0.0; + /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + int array [2*(sizeof(long double) >= sizeof(double)) - 1]; int main () { -#ifndef optreset - (void) optreset; -#endif ; return 0; @@ -6507,34 +6750,30 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_optreset=yes + gt_cv_c_long_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_optreset=no + gt_cv_c_long_double=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5 -echo "${ECHO_T}$ac_cv_have_decl_optreset" >&6; } -if test $ac_cv_have_decl_optreset = yes; then - GETOPT_H=getopt.h -fi +{ echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 +echo "${ECHO_T}$gt_cv_c_long_double" >&6; } + if test $gt_cv_c_long_double = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_DOUBLE 1 +_ACEOF fi - if test -z "$GETOPT_H"; then - { echo "$as_me:$LINENO: checking for working GNU getopt function" >&5 -echo $ECHO_N "checking for working GNU getopt function... $ECHO_C" >&6; } -if test "${gl_cv_func_gnu_getopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5 -echo $ECHO_N "checking whether getopt_clip is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_getopt_clip+set}" = set; then +{ echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 +echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strerror_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6543,13 +6782,12 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +$ac_includes_default int main () { -#ifndef getopt_clip - (void) getopt_clip; +#ifndef strerror_r + (void) strerror_r; #endif ; @@ -6573,24 +6811,42 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getopt_clip=yes + ac_cv_have_decl_strerror_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_getopt_clip=no + ac_cv_have_decl_strerror_r=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getopt_clip" >&6; } -if test $ac_cv_have_decl_getopt_clip = yes; then - gl_cv_func_gnu_getopt=no +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6; } +if test $ac_cv_have_decl_strerror_r = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R 1 +_ACEOF + + else - gl_cv_func_gnu_getopt=yes + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R 0 +_ACEOF + + fi + + +for ac_func in strerror_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6598,68 +6854,94 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { - - char *myargv[3]; - myargv[0] = "conftest"; - myargv[1] = "-+"; - myargv[2] = 0; - return getopt (2, myargv, "+a") != '?'; - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest$ac_exeext +rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_func_gnu_getopt=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -gl_cv_func_gnu_getopt=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + eval "$as_ac_var=no" fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi -{ echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5 -echo "${ECHO_T}$gl_cv_func_gnu_getopt" >&6; } - if test "$gl_cv_func_gnu_getopt" = "no"; then - GETOPT_H=getopt.h - fi - fi +done -{ echo "$as_me:$LINENO: checking whether getenv is declared" >&5 -echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_getenv+set}" = set; then +{ echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 +echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6; } +if test "${ac_cv_func_strerror_r_char_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + 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 @@ -6669,9 +6951,11 @@ $ac_includes_default int main () { -#ifndef getenv - (void) getenv; -#endif + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; ; return 0; @@ -6694,110 +6978,91 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getenv=yes + ac_cv_func_strerror_r_char_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_getenv=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6; } -if test $ac_cv_have_decl_getenv = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 0 -_ACEOF - fi - -{ echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6; } -if test "${ac_cv_c_inline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + # strerror_r is not declared. Choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns `int'. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes; then + : else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - +$ac_includes_default + extern char *strerror_r (); +int +main () +{ +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + return ! isalpha (x); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_inline=$ac_kw -else - echo "$as_me: failed program was:" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_char_p=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6; } -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 +echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then +cat >>confdefs.h <<\_ACEOF +#define STRERROR_R_CHAR_P 1 +_ACEOF +fi -{ echo "$as_me:$LINENO: checking for mbstate_t" >&5 -echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6; } -if test "${ac_cv_type_mbstate_t+set}" = set; then + { echo "$as_me:$LINENO: checking for sig_atomic_t" >&5 +echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6; } +if test "${ac_cv_type_sig_atomic_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6806,12 +7071,16 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -# include +#include + +typedef sig_atomic_t ac__type_new_; int main () { -mbstate_t x; return sizeof x; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -6833,137 +7102,69 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_mbstate_t=yes + ac_cv_type_sig_atomic_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_mbstate_t=no + ac_cv_type_sig_atomic_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 -echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6; } - if test $ac_cv_type_mbstate_t = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_sig_atomic_t" >&5 +echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6; } +if test $ac_cv_type_sig_atomic_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBSTATE_T 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_SIG_ATOMIC_T 1 _ACEOF - else + +else cat >>confdefs.h <<\_ACEOF -#define mbstate_t int +#define sig_atomic_t int _ACEOF - fi +fi - { echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 -echo $ECHO_N "checking whether mbrtowc and mbstate_t are properly declared... $ECHO_C" >&6; } -if test "${gl_cv_func_mbrtowc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -wchar_t wc; - char const s[] = ""; - size_t n = 1; - mbstate_t state; - return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - gl_cv_func_mbrtowc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - gl_cv_func_mbrtowc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc" >&5 -echo "${ECHO_T}$gl_cv_func_mbrtowc" >&6; } - if test $gl_cv_func_mbrtowc = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBRTOWC 1 -_ACEOF - fi -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi -if test "$enable_largefile" != no; then - { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then + + if test -z "$GETOPT_H"; then + +for ac_header in getopt.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - 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 + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF - rm -f conftest.$ac_objext +rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -6980,91 +7181,175 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - break + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_header_compiler=no fi -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_largefile_CC=' -n32'; break + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------- ## +## Report this to bug-m4@gnu.org ## +## ----------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + GETOPT_H=getopt.h +fi + +done + + fi + + if test -z "$GETOPT_H"; then + +for ac_func in getopt_long_only +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif - { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; int main () { - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -7073,35 +7358,54 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec (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 + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF +else + GETOPT_H=getopt.h fi +done -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + + if test -z "$GETOPT_H"; then + { echo "$as_me:$LINENO: checking whether optreset is declared" >&5 +echo $ECHO_N "checking whether optreset is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_optreset+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +#include + int main () { +#ifndef optreset + (void) optreset; +#endif ; return 0; @@ -7124,55 +7428,50 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=64; break + ac_cv_have_decl_optreset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_have_decl_optreset=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } -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 -f conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5 +echo "${ECHO_T}$ac_cv_have_decl_optreset" >&6; } +if test $ac_cv_have_decl_optreset = yes; then + GETOPT_H=getopt.h +fi + + fi + + if test -z "$GETOPT_H"; then + { echo "$as_me:$LINENO: checking for working GNU getopt function" >&5 +echo $ECHO_N "checking for working GNU getopt function... $ECHO_C" >&6; } +if test "${gl_cv_func_gnu_getopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + { echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5 +echo $ECHO_N "checking whether getopt_clip is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getopt_clip+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - 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 - /* 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]; +#include + int main () { +#ifndef getopt_clip + (void) getopt_clip; +#endif ; return 0; @@ -7195,47 +7494,118 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break + ac_cv_have_decl_getopt_clip=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_have_decl_getopt_clip=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getopt_clip" >&6; } +if test $ac_cv_have_decl_getopt_clip = yes; then + gl_cv_func_gnu_getopt=no +else + gl_cv_func_gnu_getopt=yes +fi + +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +#include int main () { + char *myargv[3]; + myargv[0] = "conftest"; + myargv[1] = "-+"; + myargv[2] = 0; + return getopt (2, myargv, "+a") != '?'; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_gnu_getopt=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_gnu_getopt=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5 +echo "${ECHO_T}$gl_cv_func_gnu_getopt" >&6; } + if test "$gl_cv_func_gnu_getopt" = "no"; then + GETOPT_H=getopt.h + fi + fi + +{ echo "$as_me:$LINENO: checking whether getenv is declared" >&5 +echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef getenv + (void) getenv; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -7245,39 +7615,32 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=1; break + ac_cv_have_decl_getenv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_have_decl_getenv=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6; } +if test $ac_cv_have_decl_getenv = yes; then + cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files +#define HAVE_DECL_GETENV 1 _ACEOF -;; -esac -rm -f conftest* - fi -fi - - - +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 0 +_ACEOF +fi { echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 @@ -7356,9 +7719,60 @@ _ACEOF esac - { echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 -echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; } -if test "${am_cv_langinfo_codeset+set}" = set; then + + + + + + + + + + + if test $ac_cv_header_sys_time_h = yes; then + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_sys_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + + + + if test $ac_cv_header_sys_time_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF + gl_cv_absolute_sys_time_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | +sed -n '\#/sys/time.h#{s#.*"\(.*/sys/time.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_sys_time_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_sys_time_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_SYS_TIME_H "$gl_cv_absolute_sys_time_h" +_ACEOF + + + ABSOLUTE_SYS_TIME_H=\"$gl_cv_absolute_sys_time_h\" + HAVE_SYS_TIME_H=1 + else + ABSOLUTE_SYS_TIME_H=\"no/such/file/sys/time.h\" + HAVE_SYS_TIME_H=0 + fi + + + + { echo "$as_me:$LINENO: checking for struct timeval" >&5 +echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6; } +if test "${gl_cv_sys_struct_timeval+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7367,23 +7781,27 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#if HAVE_SYS_TIME_H + #include + #endif + #include + int main () { -char* cs = nl_langinfo(CODESET); return !cs; +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" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -7392,124 +7810,59 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - am_cv_langinfo_codeset=yes + } && test -s conftest.$ac_objext; then + gl_cv_sys_struct_timeval=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - am_cv_langinfo_codeset=no + gl_cv_sys_struct_timeval=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -echo "${ECHO_T}$am_cv_langinfo_codeset" >&6; } - if test $am_cv_langinfo_codeset = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LANGINFO_CODESET 1 -_ACEOF - +{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5 +echo "${ECHO_T}$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval = yes; then + HAVE_STRUCT_TIMEVAL=1 + else + HAVE_STRUCT_TIMEVAL=0 fi + REPLACE_GETTIMEOFDAY=0 + if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then + SYS_TIME_H=sys/time.h + else + SYS_TIME_H= + fi -{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 -echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } -if test "${ac_cv_header_stdbool_h+set}" = set; then + +{ echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6; } +if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; - #if defined __xlc__ || defined __GNUC__ - /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 - reported by James Lemley on 2005-10-05; see - http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html - This test is not quite right, since xlc is allowed to - reject this program, as the initializer for xlcbug is - not one of the forms that C requires support for. - However, doing the test right would require a run-time - test, and that would make cross-compilation harder. - Let us hope that IBM fixes the xlc bug, and also adds - support for this kind of constant expression. In the - meantime, this test will reject xlc, which is OK, since - our stdbool.h substitute should suffice. We also test - this with GCC, where it should work, to detect more - quickly whether someone messes up the test in the - future. */ - char digs[] = "0123456789"; - int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); - #endif - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; - -int -main () -{ - - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); - - ; - return 0; -} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -7528,91 +7881,42 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_stdbool_h=yes + ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_stdbool_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } - { echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } -if test "${ac_cv_type__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef _Bool ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__Bool=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6; } -if test $ac_cv_type__Bool = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF - + test "$ac_cv_c_inline" != no && break +done fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6; } - if test $ac_cv_header_stdbool_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STDBOOL_H 1 +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 - fi - { echo "$as_me:$LINENO: checking for unsigned long long int" >&5 -echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; } -if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then + { echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 +echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; } +if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7621,16 +7925,11 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -unsigned long long int ull = 18446744073709551615ULL; - typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; - int i = 63; +#include int main () { -unsigned long long int ullmax = 18446744073709551615ull; - return (ull << 63 | ull >> 63 | ull << i | ull >> i - | ullmax / ull | ullmax % ull); +char* cs = nl_langinfo(CODESET); return !cs; ; return 0; } @@ -7653,34 +7952,31 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_type_unsigned_long_long_int=yes + am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_unsigned_long_long_int=no + am_cv_langinfo_codeset=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6; } - if test $ac_cv_type_unsigned_long_long_int = yes; then +{ echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 +echo "${ECHO_T}$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_UNSIGNED_LONG_LONG_INT 1 +#define HAVE_LANGINFO_CODESET 1 _ACEOF fi - - - - -{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 -echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; } -if test "${ac_cv_header_stat_broken+set}" = set; then +{ echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 +echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7689,25 +7985,17 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include - -#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]; +$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" @@ -7726,37 +8014,38 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_stat_broken=no + ac_cv_have_decl_getc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_stat_broken=yes + ac_cv_have_decl_getc_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 -echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; } -if test $ac_cv_header_stat_broken = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6; } +if test $ac_cv_have_decl_getc_unlocked = yes; then -cat >>confdefs.h <<\_ACEOF -#define STAT_MACROS_BROKEN 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED 1 _ACEOF -fi - - - +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED 0 +_ACEOF +fi -{ echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 -echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then + { echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 +echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6; } +if test "${ac_cv_gnu_library_2_1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7765,66 +8054,57 @@ _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; + +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_clearerr_unlocked=yes +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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_clearerr_unlocked=no + ac_cv_gnu_library_2_1=no fi +rm -f conftest* + + -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6; } -if test $ac_cv_have_decl_clearerr_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 +echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLEARERR_UNLOCKED 1 -_ACEOF + GLIBC21="$ac_cv_gnu_library_2_1" -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLEARERR_UNLOCKED 0 -_ACEOF + GNULIB_GETSUBOPT=0; + GNULIB_MKDTEMP=0; + GNULIB_MKSTEMP=0; + HAVE_GETSUBOPT=1; + HAVE_MKDTEMP=1; + REPLACE_MKSTEMP=0; -fi -{ echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 -echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then + + + + + + + + + + + + +{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } +if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7833,25 +8113,89 @@ _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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + #if defined __xlc__ || defined __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a run-time + test, and that would make cross-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. We also test + this with GCC, where it should work, to detect more + quickly whether someone messes up the test in the + future. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); + #endif + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err @@ -7862,37 +8206,21 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_feof_unlocked=yes + ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_feof_unlocked=no + ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6; } -if test $ac_cv_have_decl_feof_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEOF_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEOF_UNLOCKED 0 -_ACEOF - - -fi - - -{ echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 -echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } + { echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } +if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7902,13 +8230,14 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef _Bool ac__type_new_; int main () { -#ifndef ferror_unlocked - (void) ferror_unlocked; -#endif - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -7930,37 +8259,43 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_ferror_unlocked=yes + ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_ferror_unlocked=no + ac_cv_type__Bool=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6; } -if test $ac_cv_have_decl_ferror_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FERROR_UNLOCKED 1 +#define HAVE__BOOL 1 _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FERROR_UNLOCKED 0 +fi + + if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 _ACEOF + fi -fi -{ echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 -echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then + + + +{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 +echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; } +if test "${ac_cv_header_stat_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7969,17 +8304,25 @@ _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; +#include +#include + +#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 - ; - return 0; -} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -7998,37 +8341,49 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fflush_unlocked=yes + ac_cv_header_stat_broken=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_fflush_unlocked=no + ac_cv_header_stat_broken=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6; } -if test $ac_cv_have_decl_fflush_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 +echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FFLUSH_UNLOCKED 1 +cat >>confdefs.h <<\_ACEOF +#define STAT_MACROS_BROKEN 1 _ACEOF +fi -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FFLUSH_UNLOCKED 0 -_ACEOF -fi + GNULIB_CHOWN=0; + GNULIB_DUP2=0; + GNULIB_FCHDIR=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETLOGIN_R=0; + GNULIB_READLINK=0; + HAVE_DUP2=1; + HAVE_FTRUNCATE=1; + HAVE_READLINK=1; + HAVE_DECL_GETLOGIN_R=1; + REPLACE_CHOWN=0; + REPLACE_FCHDIR=0; + REPLACE_GETCWD=0; -{ echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 -echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then + + +{ echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 +echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8041,8 +8396,8 @@ $ac_includes_default int main () { -#ifndef fgets_unlocked - (void) fgets_unlocked; +#ifndef clearerr_unlocked + (void) clearerr_unlocked; #endif ; @@ -8066,37 +8421,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fgets_unlocked=yes + ac_cv_have_decl_clearerr_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_fgets_unlocked=no + ac_cv_have_decl_clearerr_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6; } -if test $ac_cv_have_decl_fgets_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6; } +if test $ac_cv_have_decl_clearerr_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED 1 +#define HAVE_DECL_CLEARERR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED 0 +#define HAVE_DECL_CLEARERR_UNLOCKED 0 _ACEOF fi -{ echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then +{ echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 +echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8109,8 +8464,8 @@ $ac_includes_default int main () { -#ifndef fputc_unlocked - (void) fputc_unlocked; +#ifndef feof_unlocked + (void) feof_unlocked; #endif ; @@ -8134,37 +8489,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fputc_unlocked=yes + ac_cv_have_decl_feof_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_fputc_unlocked=no + ac_cv_have_decl_feof_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6; } -if test $ac_cv_have_decl_fputc_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6; } +if test $ac_cv_have_decl_feof_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 1 +#define HAVE_DECL_FEOF_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 0 +#define HAVE_DECL_FEOF_UNLOCKED 0 _ACEOF fi -{ echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then +{ echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 +echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8177,8 +8532,8 @@ $ac_includes_default int main () { -#ifndef fputs_unlocked - (void) fputs_unlocked; +#ifndef ferror_unlocked + (void) ferror_unlocked; #endif ; @@ -8202,37 +8557,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fputs_unlocked=yes + ac_cv_have_decl_ferror_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_fputs_unlocked=no + ac_cv_have_decl_ferror_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6; } -if test $ac_cv_have_decl_fputs_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6; } +if test $ac_cv_have_decl_ferror_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 1 +#define HAVE_DECL_FERROR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 0 +#define HAVE_DECL_FERROR_UNLOCKED 0 _ACEOF fi -{ echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 -echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then +{ echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 +echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8245,8 +8600,8 @@ $ac_includes_default int main () { -#ifndef fread_unlocked - (void) fread_unlocked; +#ifndef fflush_unlocked + (void) fflush_unlocked; #endif ; @@ -8270,37 +8625,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fread_unlocked=yes + ac_cv_have_decl_fflush_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_fread_unlocked=no + ac_cv_have_decl_fflush_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6; } -if test $ac_cv_have_decl_fread_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6; } +if test $ac_cv_have_decl_fflush_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREAD_UNLOCKED 1 +#define HAVE_DECL_FFLUSH_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREAD_UNLOCKED 0 +#define HAVE_DECL_FFLUSH_UNLOCKED 0 _ACEOF fi -{ echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 -echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then +{ echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 +echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8313,8 +8668,8 @@ $ac_includes_default int main () { -#ifndef fwrite_unlocked - (void) fwrite_unlocked; +#ifndef fgets_unlocked + (void) fgets_unlocked; #endif ; @@ -8338,37 +8693,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fwrite_unlocked=yes + ac_cv_have_decl_fgets_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_fwrite_unlocked=no + ac_cv_have_decl_fgets_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6; } -if test $ac_cv_have_decl_fwrite_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6; } +if test $ac_cv_have_decl_fgets_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 1 +#define HAVE_DECL_FGETS_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 0 +#define HAVE_DECL_FGETS_UNLOCKED 0 _ACEOF fi -{ echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 -echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then +{ echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8381,8 +8736,8 @@ $ac_includes_default int main () { -#ifndef getc_unlocked - (void) getc_unlocked; +#ifndef fputc_unlocked + (void) fputc_unlocked; #endif ; @@ -8406,37 +8761,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getc_unlocked=yes + ac_cv_have_decl_fputc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_getc_unlocked=no + ac_cv_have_decl_fputc_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6; } -if test $ac_cv_have_decl_getc_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6; } +if test $ac_cv_have_decl_fputc_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED 1 +#define HAVE_DECL_FPUTC_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED 0 +#define HAVE_DECL_FPUTC_UNLOCKED 0 _ACEOF fi -{ echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 -echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then +{ echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8449,8 +8804,8 @@ $ac_includes_default int main () { -#ifndef getchar_unlocked - (void) getchar_unlocked; +#ifndef fputs_unlocked + (void) fputs_unlocked; #endif ; @@ -8474,37 +8829,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getchar_unlocked=yes + ac_cv_have_decl_fputs_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_getchar_unlocked=no + ac_cv_have_decl_fputs_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6; } -if test $ac_cv_have_decl_getchar_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6; } +if test $ac_cv_have_decl_fputs_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCHAR_UNLOCKED 1 +#define HAVE_DECL_FPUTS_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCHAR_UNLOCKED 0 +#define HAVE_DECL_FPUTS_UNLOCKED 0 _ACEOF fi -{ echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 -echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then +{ echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 +echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8517,8 +8872,8 @@ $ac_includes_default int main () { -#ifndef putc_unlocked - (void) putc_unlocked; +#ifndef fread_unlocked + (void) fread_unlocked; #endif ; @@ -8542,37 +8897,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_putc_unlocked=yes + ac_cv_have_decl_fread_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_putc_unlocked=no + ac_cv_have_decl_fread_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6; } -if test $ac_cv_have_decl_putc_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6; } +if test $ac_cv_have_decl_fread_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 1 +#define HAVE_DECL_FREAD_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 0 +#define HAVE_DECL_FREAD_UNLOCKED 0 _ACEOF fi -{ echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 -echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then +{ echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 +echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8585,8 +8940,8 @@ $ac_includes_default int main () { -#ifndef putchar_unlocked - (void) putchar_unlocked; +#ifndef fwrite_unlocked + (void) fwrite_unlocked; #endif ; @@ -8610,105 +8965,52 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_putchar_unlocked=yes + ac_cv_have_decl_fwrite_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_putchar_unlocked=no + ac_cv_have_decl_fwrite_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6; } -if test $ac_cv_have_decl_putchar_unlocked = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6; } +if test $ac_cv_have_decl_fwrite_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTCHAR_UNLOCKED 1 +#define HAVE_DECL_FWRITE_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTCHAR_UNLOCKED 0 +#define HAVE_DECL_FWRITE_UNLOCKED 0 _ACEOF fi - - - { echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 -echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6; } -if test "${ac_cv_decl_EOVERFLOW+set}" = set; then +{ echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#ifdef EOVERFLOW -yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - have_eoverflow=1 -fi -rm -f conftest* - - if test -n "$have_eoverflow"; then - ac_cv_decl_EOVERFLOW=yes - else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -#ifdef EOVERFLOW -yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - have_eoverflow=1 -fi -rm -f conftest* - - if test -n "$have_eoverflow"; then - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - +$ac_includes_default int main () { -static int test_array [1 - 2 * !((EOVERFLOW) >= 0)]; -test_array [0] = 0 +#ifndef getchar_unlocked + (void) getchar_unlocked; +#endif ; return 0; @@ -8731,28 +9033,54 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include + ac_cv_have_decl_getchar_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; -test_array [0] = 0 + ac_cv_have_decl_getchar_unlocked=no +fi - ; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6; } +if test $ac_cv_have_decl_getchar_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCHAR_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCHAR_UNLOCKED 0 +_ACEOF + + +fi + + +{ echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 +echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef putc_unlocked + (void) putc_unlocked; +#endif + + ; return 0; } _ACEOF @@ -8773,26 +9101,156 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break + ac_cv_have_decl_putc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_cv_have_decl_putc_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6; } +if test $ac_cv_have_decl_putc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED 0 +_ACEOF + + +fi + + +{ echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef putchar_unlocked + (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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_putchar_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF + ac_cv_have_decl_putchar_unlocked=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6; } +if test $ac_cv_have_decl_putchar_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED 0 +_ACEOF + + +fi + + + + + { echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 +echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6; } +if test "${ac_cv_decl_EOVERFLOW+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + have_eoverflow=1 +fi +rm -f conftest* + + if test -n "$have_eoverflow"; then + ac_cv_decl_EOVERFLOW=yes + else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + have_eoverflow=1 +fi +rm -f conftest* + + if test -n "$have_eoverflow"; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8808,7 +9266,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -static int test_array [1 - 2 * !((EOVERFLOW) < 0)]; +static int test_array [1 - 2 * !((EOVERFLOW) >= 0)]; test_array [0] = 0 ; @@ -8832,7 +9290,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 + ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8850,7 +9308,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -static int test_array [1 - 2 * !((EOVERFLOW) >= $ac_mid)]; +static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; test_array [0] = 0 ; @@ -8874,17 +9332,17 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi - ac_mid=`expr 2 '*' $ac_mid` + ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -8893,17 +9351,7 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8919,7 +9367,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; +static int test_array [1 - 2 * !((EOVERFLOW) < 0)]; test_array [0] = 0 ; @@ -8943,22 +9391,9 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_decl_EOVERFLOW=$ac_lo;; -'') ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8971,29 +9406,153 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include -static long int longval () { return EOVERFLOW; } -static unsigned long int ulongval () { return EOVERFLOW; } -#include -#include int main () { +static int test_array [1 - 2 * !((EOVERFLOW) >= $ac_mid)]; +test_array [0] = 0 - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if ((EOVERFLOW) < 0) - { - long int i = longval (); - if (i != (EOVERFLOW)) - return 1; - fprintf (f, "%ld\n", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (EOVERFLOW)) - return 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_decl_EOVERFLOW=$ac_lo;; +'') ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +static long int longval () { return EOVERFLOW; } +static unsigned long int ulongval () { return EOVERFLOW; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((EOVERFLOW) < 0) + { + long int i = longval (); + if (i != (EOVERFLOW)) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (EOVERFLOW)) + return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; @@ -9032,7 +9591,6 @@ fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val - else ac_cv_decl_EOVERFLOW=E2BIG fi @@ -9052,6 +9610,8 @@ _ACEOF fi + + { echo "$as_me:$LINENO: checking for wchar_t" >&5 echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } if test "${gt_cv_c_wchar_t+set}" = set; then @@ -9122,6 +9682,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include #include wint_t foo = (wchar_t)'\0'; int @@ -9383,6 +9951,10 @@ _ACEOF + + + + if false; then GL_COND_LIBTOOL_TRUE= GL_COND_LIBTOOL_FALSE='#' @@ -9473,13 +10045,15 @@ _ACEOF M4_LIBOBJS="$M4_LIBOBJS close-stream.$ac_objext" + : + + + cat >>confdefs.h <<\_ACEOF #define GNULIB_CLOSE_STREAM 1 _ACEOF - : - M4_LIBOBJS="$M4_LIBOBJS closeout.$ac_objext" @@ -9664,6 +10238,8 @@ done M4_LIBOBJS="$M4_LIBOBJS fopen-safer.$ac_objext" + + cat >>confdefs.h <<\_ACEOF #define GNULIB_FOPEN_SAFER 1 _ACEOF @@ -10034,27 +10610,36 @@ fi - { echo "$as_me:$LINENO: checking whether the compiler generally respects inline" >&5 -echo $ECHO_N "checking whether the compiler generally respects inline... $ECHO_C" >&6; } -if test "${gl_cv_c_inline_effective+set}" = set; then + + + + + + + + + { echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5 +echo $ECHO_N "checking for gettimeofday with POSIX signature... $ECHO_C" >&6; } +if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test $ac_cv_c_inline = no; then - gl_cv_c_inline_effective=no - else - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include + struct timeval c; int main () { -#ifdef __NO_INLINE__ - #error "inline is not effective" - #endif + + int (*f) (struct timeval *restrict, void *restrict) = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + ; return 0; } @@ -10076,33 +10661,368 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - gl_cv_c_inline_effective=yes + gl_cv_func_gettimeofday_posix_signature=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - gl_cv_c_inline_effective=no + gl_cv_func_gettimeofday_posix_signature=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +echo "${ECHO_T}$gl_cv_func_gettimeofday_posix_signature" >&6; } + + + + { echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5 +echo $ECHO_N "checking whether gettimeofday clobbers localtime buffer... $ECHO_C" >&6; } +if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + gl_cv_func_gettimeofday_clobber=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main () +{ + + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_gettimeofday_clobber=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_gettimeofday_clobber=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_c_inline_effective" >&5 -echo "${ECHO_T}$gl_cv_c_inline_effective" >&6; } - if test $gl_cv_c_inline_effective = yes; then + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5 +echo "${ECHO_T}$gl_cv_func_gettimeofday_clobber" >&6; } + + if test $gl_cv_func_gettimeofday_clobber = yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + + M4_LIBOBJS="$M4_LIBOBJS gettimeofday.$ac_objext" + + +for ac_header in sys/timeb.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------- ## +## Report this to bug-m4@gnu.org ## +## ----------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in _ftime +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + cat >>confdefs.h <<\_ACEOF -#define HAVE_INLINE 1 +#define gmtime rpl_gmtime _ACEOF - fi +cat >>confdefs.h <<\_ACEOF +#define localtime rpl_localtime +_ACEOF +cat >>confdefs.h <<\_ACEOF +#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1 +_ACEOF -for ac_header in stdlib.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 + M4_LIBOBJS="$M4_LIBOBJS gettimeofday.$ac_objext" + + +for ac_header in sys/timeb.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -10246,109 +11166,8 @@ fi done -{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_malloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 0 -_ACEOF - - M4_LIBOBJS="$M4_LIBOBJS malloc.$ac_objext" - -cat >>confdefs.h <<\_ACEOF -#define malloc rpl_malloc -_ACEOF - -fi - - - - - - - - - - - - if test $ac_cv_header_wchar_h = yes; then - M4_LIBOBJS="$M4_LIBOBJS mbchar.$ac_objext" - - - - - - -for ac_func in iswcntrl +for ac_func in _ftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -10441,76 +11260,45 @@ _ACEOF fi done - fi - - - - : + fi + fi -for ac_func in memchr -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking whether the compiler generally respects inline" >&5 +echo $ECHO_N "checking whether the compiler generally respects inline... $ECHO_C" >&6; } +if test "${gl_cv_c_inline_effective+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif int main () { -return $ac_func (); +#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -10519,36 +11307,44 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + } && test -s conftest.$ac_objext; then + gl_cv_c_inline_effective=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + gl_cv_c_inline_effective=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +{ echo "$as_me:$LINENO: result: $gl_cv_c_inline_effective" >&5 +echo "${ECHO_T}$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_INLINE 1 _ACEOF -else - M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" -fi -done + fi + + + - if test $ac_cv_func_memchr = no; then -for ac_header in bp-sym.h + + + + + + + + + +for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -10671,29 +11467,112 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes else - eval "$as_ac_Header=\$ac_header_preproc" + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } + fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 0 +_ACEOF + + M4_LIBOBJS="$M4_LIBOBJS malloc.$ac_objext" + +cat >>confdefs.h <<\_ACEOF +#define malloc rpl_malloc _ACEOF fi -done - fi @@ -10793,12 +11672,18 @@ fi done if test $ac_cv_func_mkdtemp = no; then + HAVE_MKDTEMP=0 : fi + GNULIB_MKDTEMP=1 + + + + { echo "$as_me:$LINENO: checking for working mkstemp" >&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6; } @@ -10878,16 +11763,16 @@ fi echo "${ECHO_T}$gl_cv_func_working_mkstemp" >&6; } if test $gl_cv_func_working_mkstemp != yes; then - -cat >>confdefs.h <<\_ACEOF -#define __MKSTEMP_PREFIX rpl_ -_ACEOF - + REPLACE_MKSTEMP=1 M4_LIBOBJS="$M4_LIBOBJS mkstemp.$ac_objext" fi + + + GNULIB_MKSTEMP=1 + { echo "$as_me:$LINENO: checking for obstacks" >&5 echo $ECHO_N "checking for obstacks... $ECHO_C" >&6; } if test "${ac_cv_func_obstack+set}" = set; then @@ -10974,16 +11859,6 @@ fi - - - - - - - - - - { echo "$as_me:$LINENO: checking for mbstate_t" >&5 echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6; } if test "${ac_cv_type_mbstate_t+set}" = set; then @@ -11134,8 +12009,7 @@ fi # 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. The first failing regular expression is from `Spencer ere - # test #75' in grep-2.3. + # regex.c. { echo "$as_me:$LINENO: checking for working re_compile_pattern" >&5 echo $ECHO_N "checking for working re_compile_pattern... $ECHO_C" >&6; } if test "${gl_cv_func_re_compile_pattern_working+set}" = set; then @@ -11192,68 +12066,80 @@ static struct re_pattern_buffer regex; } #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)); + 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) - exit (1); + return 1; - /* This should succeed, but does not for e.g. glibc-2.1.3. */ - memset (®ex, 0, sizeof (regex)); + /* 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) - exit (1); + return 1; /* The following example is derived from a problem report against gawk from Jorge Stolfi . */ - memset (®ex, 0, sizeof (regex)); + memset (®ex, 0, sizeof regex); s = re_compile_pattern ("[an\371]*n", 7, ®ex); if (s) - exit (1); + return 1; - /* This should match, but does not for e.g. glibc-2.2.1. */ + /* This should match, but does not for glibc-2.2.1. */ if (re_match (®ex, "an", 2, 0, ®s) != 2) - exit (1); + return 1; - memset (®ex, 0, sizeof (regex)); + memset (®ex, 0, sizeof regex); s = re_compile_pattern ("x", 1, ®ex); if (s) - exit (1); + return 1; - /* The version of regex.c in e.g. GNU libc-2.2.93 did not - work with a negative RANGE argument. */ + /* glibc-2.2.93 does not work with a negative RANGE argument. */ if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) - exit (1); + return 1; /* The version of regex.c in older versions of gnulib ignored RE_ICASE. Detect that problem too. */ - memset (®ex, 0, sizeof (regex)); re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); s = re_compile_pattern ("x", 1, ®ex); if (s) - exit (1); + return 1; if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) - exit (1); + return 1; /* REG_STARTEND was added to glibc on 2004-01-15. Reject older versions. */ if (! REG_STARTEND) - exit (1); + 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)) - exit (1); + return 1; - exit (0); + return 0; ; return 0; } @@ -11402,15 +12288,6 @@ _ACEOF - - - - - - - - - { echo "$as_me:$LINENO: checking whether isblank is declared" >&5 echo $ECHO_N "checking whether isblank is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_isblank+set}" = set; then @@ -12172,7 +13049,6 @@ fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val - if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -12482,7 +13358,6 @@ fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val - if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then cat >conftest.$ac_ext <<_ACEOF @@ -12773,19 +13648,6 @@ _ACEOF fi - - - - - - - if test $ac_cv_header_wchar_h = yes; then - HAVE_WCHAR_H=1 - else - HAVE_WCHAR_H=0 - fi - - if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else @@ -12850,7 +13712,7 @@ else gl_cv_header_working_stdint_h=no cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ + /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -12940,9 +13802,9 @@ struct s { /* 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; + (-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; + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; /* Detect bugs in OpenBSD 3.9 stdint.h. */ #ifdef UINT8_MAX @@ -13008,8 +13870,9 @@ fi { echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 echo "${ECHO_T}$gl_cv_header_working_stdint_h" >&6; } fi - if test "$gl_cv_header_working_stdint_h" != yes; then - + if test "$gl_cv_header_working_stdint_h" = yes; then + STDINT_H= + else for ac_header in sys/inttypes.h sys/bitypes.h @@ -13192,15 +14055,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include #include - #if HAVE_WCHAR_H - /* BSD/OS 4.1 has a bug: and must be included before - . */ - # include - # include - # include - #endif + #include + #include + #include #include int @@ -13239,15 +14100,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include #include - #if HAVE_WCHAR_H - /* BSD/OS 4.1 has a bug: and must be included before - . */ - # include - # include - # include - #endif + #include + #include + #include #include int @@ -13303,15 +14162,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include #include - #if HAVE_WCHAR_H - /* BSD/OS 4.1 has a bug: and must be included before - . */ - # include - # include - # include - #endif + #include + #include + #include #include int @@ -13350,15 +14207,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include #include - #if HAVE_WCHAR_H - /* BSD/OS 4.1 has a bug: and must be included before - . */ - # include - # include - # include - #endif + #include + #include + #include #include int @@ -13424,15 +14279,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include #include - #if HAVE_WCHAR_H - /* BSD/OS 4.1 has a bug: and must be included before - . */ - # include - # include - # include - #endif + #include + #include + #include #include int @@ -13484,15 +14337,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include #include - #if HAVE_WCHAR_H - /* BSD/OS 4.1 has a bug: and must be included before - . */ - # include - # include - # include - #endif + #include + #include + #include #include static long int longval () { return sizeof ($gltype) * CHAR_BIT; } @@ -13558,7 +14409,6 @@ fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val - eval gl_cv_bitsizeof_${gltype}=\$result fi @@ -13596,15 +14446,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include #include - #if HAVE_WCHAR_H - /* BSD/OS 4.1 has a bug: and must be included before - . */ - # include - # include - # include - #endif + #include + #include + #include int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; int @@ -13679,40 +14527,38 @@ else eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed if test "$result" = yes; then - glsufu= + glsufu= else - glsufu=u + 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 + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include #include - #if HAVE_WCHAR_H - /* BSD/OS 4.1 has a bug: and must be included before - . */ - # include - # include - # include - #endif + #include + #include + #include - extern $gltype foo; - extern $gltype1 foo; + extern $gltype foo; + extern $gltype1 foo; int main () { @@ -13747,8 +14593,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - eval result=\$gl_cv_type_${gltype}_suffix - test "$result" != no && break + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break done fi ac_res=`eval echo '${'gl_cv_type_${gltype}_suffix'}'` @@ -13766,199 +14612,48 @@ _ACEOF - STDINT_H=stdint.h - fi - - - - M4_LIBOBJS="$M4_LIBOBJS mkstemp-safer.$ac_objext" - - - - M4_LIBOBJS="$M4_LIBOBJS strcasecmp.$ac_objext" - - - : - - - - -for ac_func in strncasecmp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" -fi -done - - { echo "$as_me:$LINENO: checking whether strncasecmp is declared" >&5 -echo $ECHO_N "checking whether strncasecmp is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_strncasecmp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strncasecmp - (void) strncasecmp; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strncasecmp=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strncasecmp=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strncasecmp" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strncasecmp" >&6; } -if test $ac_cv_have_decl_strncasecmp = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNCASECMP 1 -_ACEOF + STDINT_H=stdint.h + fi -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNCASECMP 0 -_ACEOF -fi + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else - if test $ac_cv_func_strncasecmp = no; then - : - fi + if test $ac_cv_header_stdlib_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF + gl_cv_absolute_stdlib_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | +sed -n '\#/stdlib.h#{s#.*"\(.*/stdlib.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_stdlib_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_stdlib_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_STDLIB_H "$gl_cv_absolute_stdlib_h" +_ACEOF - M4_LIBOBJS="$M4_LIBOBJS strstr.$ac_objext" + ABSOLUTE_STDLIB_H=\"$gl_cv_absolute_stdlib_h\" - : + M4_LIBOBJS="$M4_LIBOBJS mkstemp-safer.$ac_objext" @@ -14319,23 +15014,99 @@ _ACEOF SYS_STAT_H='sys/stat.h' + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_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 - - M4_LIBOBJS="$M4_LIBOBJS tempname.$ac_objext" - - + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_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 +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + M4_LIBOBJS="$M4_LIBOBJS tempname.$ac_objext" + : @@ -14422,169 +15193,64 @@ fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -for ac_header in unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------- ## -## Report this to bug-m4@gnu.org ## -## ----------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` +ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - UNISTD_H='' +fi +done + + + + + + + + + + + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_unistd_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - UNISTD_H='unistd.h' + + + + + if test $ac_cv_header_unistd_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF + gl_cv_absolute_unistd_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | +sed -n '\#/unistd.h#{s#.*"\(.*/unistd.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` + fi fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_unistd_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_unistd_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_UNISTD_H "$gl_cv_absolute_unistd_h" +_ACEOF -done + + ABSOLUTE_UNISTD_H=\"$gl_cv_absolute_unistd_h\" + else + HAVE_UNISTD_H=0 + fi @@ -14664,105 +15330,30 @@ _ACEOF -for ac_func in vasnprintf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test $ac_cv_func_vasnprintf = no; then + + - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -else - M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" -fi -done - if test $ac_cv_func_vasnprintf = no; then - M4_LIBOBJS="$M4_LIBOBJS printf-args.$ac_objext" - M4_LIBOBJS="$M4_LIBOBJS printf-parse.$ac_objext" - M4_LIBOBJS="$M4_LIBOBJS asnprintf.$ac_objext" + + M4_LIBOBJS="$M4_LIBOBJS vasnprintf.$ac_objext" + M4_LIBOBJS="$M4_LIBOBJS printf-args.$ac_objext" + M4_LIBOBJS="$M4_LIBOBJS printf-parse.$ac_objext" + M4_LIBOBJS="$M4_LIBOBJS asnprintf.$ac_objext" + if test $ac_cv_func_vasnprintf = yes; then + +cat >>confdefs.h <<\_ACEOF +#define REPLACE_VASNPRINTF 1 +_ACEOF + + fi @@ -14943,6 +15534,7 @@ done + fi @@ -15037,19 +15629,18 @@ if test `eval echo '${'$as_ac_var'}'` = #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -else - M4_LIBOBJS="$M4_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_vasprintf = no; then - M4_LIBOBJS="$M4_LIBOBJS asprintf.$ac_objext" - - - - + M4_LIBOBJS="$M4_LIBOBJS vasprintf.$ac_objext" + M4_LIBOBJS="$M4_LIBOBJS asprintf.$ac_objext" + if test $ac_cv_func_vasprintf = yes; then +cat >>confdefs.h <<\_ACEOF +#define REPLACE_VASPRINTF 1 +_ACEOF fi @@ -15060,58 +15651,17 @@ done + fi - - - - - - - - - - - - - - - - { echo "$as_me:$LINENO: checking whether wcwidth is declared" >&5 -echo $ECHO_N "checking whether wcwidth is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_wcwidth+set}" = set; then + { echo "$as_me:$LINENO: checking whether is standalone" >&5 +echo $ECHO_N "checking whether is standalone... $ECHO_C" >&6; } +if test "${gl_cv_header_wchar_h_standalone+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* AIX 3.2.5 declares wcwidth in . */ -#include -#if HAVE_WCHAR_H -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.1 has a bug: and must be included before - . */ -# include -# include -# include -#endif - - -int -main () -{ -#ifndef wcwidth - (void) wcwidth; -#endif - - ; - return 0; -} +#include +wchar_t w; _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -15130,32 +15680,125 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_wcwidth=yes + gl_cv_header_wchar_h_standalone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_wcwidth=no + gl_cv_header_wchar_h_standalone=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_wcwidth" >&5 -echo "${ECHO_T}$ac_cv_have_decl_wcwidth" >&6; } -if test $ac_cv_have_decl_wcwidth = yes; then +{ echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5 +echo "${ECHO_T}$gl_cv_header_wchar_h_standalone" >&6; } + if test $gl_cv_header_wchar_h_standalone = yes; then + WCHAR_H= + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_wchar_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + + + + if test $ac_cv_header_wchar_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF + gl_cv_absolute_wchar_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | +sed -n '\#/wchar.h#{s#.*"\(.*/wchar.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` + fi +fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_wchar_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_wchar_h" >&6; } cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_WCWIDTH 1 +#define ABSOLUTE_WCHAR_H "$gl_cv_absolute_wchar_h" _ACEOF + ABSOLUTE_WCHAR_H=\"$gl_cv_absolute_wchar_h\" + WCHAR_H=wchar.h + fi + + + + + + + + + + + + + + + + + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + WCTYPE_H=wctype.h + if test $ac_cv_header_wctype_h = yes; then + if test "$ac_cv_func_iswcntrl" = yes; then + WCTYPE_H= + fi + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_absolute_wctype_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_WCWIDTH 0 -_ACEOF + + + + if test $ac_cv_header_wctype_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF + gl_cv_absolute_wctype_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | +sed -n '\#/wctype.h#{s#.*"\(.*/wctype.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` + fi + fi +{ echo "$as_me:$LINENO: result: $gl_cv_absolute_wctype_h" >&5 +echo "${ECHO_T}$gl_cv_absolute_wctype_h" >&6; } +cat >>confdefs.h <<_ACEOF +#define ABSOLUTE_WCTYPE_H "$gl_cv_absolute_wctype_h" +_ACEOF + + + ABSOLUTE_WCTYPE_H=\"$gl_cv_absolute_wctype_h\" + HAVE_WCTYPE_H=1 + else + ABSOLUTE_WCTYPE_H=\"no/such/file/wctype.h\" + HAVE_WCTYPE_H=0 + fi + + @@ -16233,7 +16876,7 @@ exec 6>&1 # 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.8, which was +This file was extended by GNU M4 $as_me 1.4.9, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16286,7 +16929,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -GNU M4 config.status 1.4.8 +GNU M4 config.status 1.4.9 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -16563,11 +17206,11 @@ GL_COND_LIBTOOL_FALSE!$GL_COND_LIBTOOL_F ALLOCA!$ALLOCA$ac_delim ALLOCA_H!$ALLOCA_H$ac_delim GETOPT_H!$GETOPT_H$ac_delim -STDBOOL_H!$STDBOOL_H$ac_delim -HAVE__BOOL!$HAVE__BOOL$ac_delim -HAVE_LONG_LONG_INT!$HAVE_LONG_LONG_INT$ac_delim -HAVE_UNSIGNED_LONG_LONG_INT!$HAVE_UNSIGNED_LONG_LONG_INT$ac_delim -HAVE_WCHAR_H!$HAVE_WCHAR_H$ac_delim +ABSOLUTE_SYS_TIME_H!$ABSOLUTE_SYS_TIME_H$ac_delim +HAVE_SYS_TIME_H!$HAVE_SYS_TIME_H$ac_delim +HAVE_STRUCT_TIMEVAL!$HAVE_STRUCT_TIMEVAL$ac_delim +REPLACE_GETTIMEOFDAY!$REPLACE_GETTIMEOFDAY$ac_delim +SYS_TIME_H!$SYS_TIME_H$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -16609,6 +17252,17 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +GLIBC21!$GLIBC21$ac_delim +GNULIB_GETSUBOPT!$GNULIB_GETSUBOPT$ac_delim +GNULIB_MKDTEMP!$GNULIB_MKDTEMP$ac_delim +GNULIB_MKSTEMP!$GNULIB_MKSTEMP$ac_delim +HAVE_GETSUBOPT!$HAVE_GETSUBOPT$ac_delim +HAVE_MKDTEMP!$HAVE_MKDTEMP$ac_delim +REPLACE_MKSTEMP!$REPLACE_MKSTEMP$ac_delim +STDBOOL_H!$STDBOOL_H$ac_delim +HAVE__BOOL!$HAVE__BOOL$ac_delim +HAVE_LONG_LONG_INT!$HAVE_LONG_LONG_INT$ac_delim +HAVE_UNSIGNED_LONG_LONG_INT!$HAVE_UNSIGNED_LONG_LONG_INT$ac_delim HAVE_INTTYPES_H!$HAVE_INTTYPES_H$ac_delim HAVE_SYS_TYPES_H!$HAVE_SYS_TYPES_H$ac_delim ABSOLUTE_STDINT_H!$ABSOLUTE_STDINT_H$ac_delim @@ -16629,10 +17283,32 @@ SIZE_T_SUFFIX!$SIZE_T_SUFFIX$ac_delim WCHAR_T_SUFFIX!$WCHAR_T_SUFFIX$ac_delim WINT_T_SUFFIX!$WINT_T_SUFFIX$ac_delim STDINT_H!$STDINT_H$ac_delim +ABSOLUTE_STDLIB_H!$ABSOLUTE_STDLIB_H$ac_delim ABSOLUTE_SYS_STAT_H!$ABSOLUTE_SYS_STAT_H$ac_delim SYS_STAT_H!$SYS_STAT_H$ac_delim -UNISTD_H!$UNISTD_H$ac_delim +GNULIB_CHOWN!$GNULIB_CHOWN$ac_delim +GNULIB_DUP2!$GNULIB_DUP2$ac_delim +GNULIB_FCHDIR!$GNULIB_FCHDIR$ac_delim +GNULIB_FTRUNCATE!$GNULIB_FTRUNCATE$ac_delim +GNULIB_GETCWD!$GNULIB_GETCWD$ac_delim +GNULIB_GETLOGIN_R!$GNULIB_GETLOGIN_R$ac_delim +GNULIB_READLINK!$GNULIB_READLINK$ac_delim +HAVE_DUP2!$HAVE_DUP2$ac_delim +HAVE_FTRUNCATE!$HAVE_FTRUNCATE$ac_delim +HAVE_READLINK!$HAVE_READLINK$ac_delim +HAVE_DECL_GETLOGIN_R!$HAVE_DECL_GETLOGIN_R$ac_delim +REPLACE_CHOWN!$REPLACE_CHOWN$ac_delim +REPLACE_FCHDIR!$REPLACE_FCHDIR$ac_delim +REPLACE_GETCWD!$REPLACE_GETCWD$ac_delim +HAVE_UNISTD_H!$HAVE_UNISTD_H$ac_delim +ABSOLUTE_UNISTD_H!$ABSOLUTE_UNISTD_H$ac_delim EOVERFLOW!$EOVERFLOW$ac_delim +ABSOLUTE_WCHAR_H!$ABSOLUTE_WCHAR_H$ac_delim +WCHAR_H!$WCHAR_H$ac_delim +HAVE_WINT_T!$HAVE_WINT_T$ac_delim +ABSOLUTE_WCTYPE_H!$ABSOLUTE_WCTYPE_H$ac_delim +HAVE_WCTYPE_H!$HAVE_WCTYPE_H$ac_delim +WCTYPE_H!$WCTYPE_H$ac_delim LIBM4_LIBDEPS!$LIBM4_LIBDEPS$ac_delim LIBM4_LTLIBDEPS!$LIBM4_LTLIBDEPS$ac_delim STACKOVF_TRUE!$STACKOVF_TRUE$ac_delim @@ -16643,7 +17319,7 @@ M4_LIBOBJS!$M4_LIBOBJS$ac_delim M4_LTLIBOBJS!$M4_LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 32; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 65; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff -ruNp m4-1.4.8/configure.ac m4-1.4.9/configure.ac --- m4-1.4.8/configure.ac 2006-11-20 06:56:33.000000000 -0700 +++ m4-1.4.9/configure.ac 2007-03-23 06:40:49.000000000 -0600 @@ -1,5 +1,5 @@ # Configure template for GNU M4. -*-Autoconf-*- -# Copyright (C) 1991, 1993, 1994, 2004, 2005, 2006 Free Software +# Copyright (C) 1991, 1993, 1994, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -18,7 +18,7 @@ # 02110-1301 USA AC_PREREQ([2.60]) -AC_INIT([GNU M4], [1.4.8], [bug-m4@gnu.org]) +AC_INIT([GNU M4], [1.4.9], [bug-m4@gnu.org]) AM_INIT_AUTOMAKE([1.9.6 dist-bzip2 gnu]) PACKAGE=$PACKAGE_TARNAME; AC_SUBST([PACKAGE]) VERSION=$PACKAGE_VERSION; AC_SUBST([VERSION]) @@ -33,6 +33,7 @@ AC_CANONICAL_HOST AC_PROG_CC M4_EARLY +AC_SYS_LARGEFILE AC_CHECK_HEADERS_ONCE([limits.h siginfo.h sys/wait.h]) AC_CHECK_TYPES([siginfo_t], [], [], [[#include @@ -43,12 +44,30 @@ AC_CHECK_TYPES([siginfo_t], [], [], AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], [], [], [[#include ]]) +AC_CHECK_MEMBERS([stack_t.ss_sp], [], [], +[[#include +#if HAVE_SIGINFO_H +# include +#endif +]]) AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_CHECK_FUNCS_ONCE([sigaction sigaltstack sigstack sigvec strerror]) +# Tandem/NSK is broken - it has 'long long int' but not +# 'unsigned long long int', which confuses assumptions made by gnulib. +# Simply pretend that neither type exists if both do not work. +AC_TYPE_LONG_LONG_INT +AC_TYPE_UNSIGNED_LONG_LONG_INT +if test $ac_cv_type_long_long_int:$ac_cv_type_unsigned_long_long_int = yes:no +then + ac_cv_type_long_long_int=no + AC_DEFINE([HAVE_LONG_LONG_INT], 0, + [Define to 1 if the system has the type `long long int'.]) +fi + M4_INIT # Code from Jim Avera . diff -ruNp m4-1.4.8/doc/Makefile.in m4-1.4.9/doc/Makefile.in --- m4-1.4.8/doc/Makefile.in 2006-11-20 07:25:48.000000000 -0700 +++ m4-1.4.9/doc/Makefile.in 2007-03-23 07:32:33.000000000 -0600 @@ -45,12 +45,13 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/gnulib-comp.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/longdouble.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.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 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ @@ -59,17 +60,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(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/stdlib-safer.m4 $(top_srcdir)/m4/strcase.m4 \ - $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.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/tmpdir.m4 $(top_srcdir)/m4/ulonglong.m4 \ $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ - $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ - $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac + $(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/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 @@ -101,7 +102,12 @@ NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ +ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ +ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ +ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ +ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ +ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ @@ -130,18 +136,39 @@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ +GLIBC21 = @GLIBC21@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_READLINK = @GNULIB_READLINK@ GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -168,6 +195,11 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ @@ -176,9 +208,11 @@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ -UNISTD_H = @UNISTD_H@ +SYS_TIME_H = @SYS_TIME_H@ VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ diff -ruNp m4-1.4.8/doc/gendocs_template m4-1.4.9/doc/gendocs_template --- m4-1.4.8/doc/gendocs_template 2006-11-20 06:57:33.000000000 -0700 +++ m4-1.4.9/doc/gendocs_template 2007-03-23 06:50:37.000000000 -0600 @@ -78,7 +78,7 @@ Please send broken links and other corre

-Copyright (C) 2006 Free Software Foundation, Inc., +Copyright © 2007 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
Verbatim copying and distribution of this entire article is diff -ruNp m4-1.4.8/doc/m4.1 m4-1.4.9/doc/m4.1 --- m4-1.4.8/doc/m4.1 2006-11-20 07:12:34.000000000 -0700 +++ m4-1.4.9/doc/m4.1 2007-03-23 07:36:08.000000000 -0600 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH M4 "1" "November 2006" "FSF" "User Commands" +.TH M4 "1" "March 2007" "FSF" "User Commands" .SH NAME -M4 \- macro processor +m4 \- macro processor .SH SYNOPSIS .B m4 [\fIOPTION\fR]... [\fIFILE\fR]... @@ -20,7 +20,8 @@ display this help and exit output version information and exit .TP \fB\-E\fR, \fB\-\-fatal\-warnings\fR -stop execution after first warning +once: warnings become errors, twice: stop +execution at first error .TP \fB\-i\fR, \fB\-\-interactive\fR unbuffer output, ignore interrupts @@ -30,6 +31,10 @@ force a `m4_' prefix to all builtins .TP \fB\-Q\fR, \fB\-\-quiet\fR, \fB\-\-silent\fR suppress some warnings for builtins +.TP +\fB\-\-warn\-macro\-sequence\fR[=\fIREGEXP\fR] +warn if macro definition matches REGEXP, +default \e$\e({[^}]*}\e|[0\-9][0\-9]+\e) .SS "Preprocessor features:" .TP \fB\-D\fR, \fB\-\-define=NAME\fR[=\fIVALUE\fR] @@ -118,17 +123,18 @@ Written by Rene' Seindal. .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT -Copyright \(co 2006 Free Software Foundation, Inc. +Copyright \(co 2007 Free Software Foundation, Inc. +License GPLv2+: GNU GPL version 2 or later .br -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for -.B M4 +.B m4 is maintained as a Texinfo manual. If the .B info and -.B M4 +.B m4 programs are properly installed at your site, the command .IP .B info m4 diff -ruNp m4-1.4.8/doc/m4.info m4-1.4.9/doc/m4.info --- m4-1.4.8/doc/m4.info 2006-11-20 07:12:30.000000000 -0700 +++ m4-1.4.9/doc/m4.info 2007-03-23 07:36:05.000000000 -0600 @@ -1,10 +1,10 @@ This is m4.info, produced by makeinfo version 4.8 from m4.texinfo. - This manual is for GNU M4 (version 1.4.8, 20 November 2006), a -package containing an implementation of the m4 macro language. + This manual is for GNU M4 (version 1.4.9, 23 March 2007), a package +containing an implementation of the m4 macro language. - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006 -Free Software Foundation, Inc. + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, +2007 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 is for GNU M4 (version 1.4.8, 20 November 2006), a package +This manual is for GNU M4 (version 1.4.9, 23 March 2007), a package containing an implementation of the m4 macro language. - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006 -Free Software Foundation, Inc. + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, +2007 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.8/AUTHORS' -and `m4-1.4.8/THANKS' from the GNU M4 distribution. +names and email addresses can be found in the files `m4-1.4.9/AUTHORS' +and `m4-1.4.9/THANKS' from the GNU M4 distribution. - This is release 1.4.8. It is now considered stable: future + This is release 1.4.9. 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... @@ -224,8 +224,8 @@ How to make copies of this manual Indices of concepts and macros -* Concept index:: Index for many concepts * Macro index:: Index for all `m4' macros +* Concept index:: Index for many concepts  File: m4.info, Node: Preliminaries, Next: Invoking m4, Prev: Top, Up: Top @@ -307,7 +307,7 @@ constructs are builtin instead of derive Originally, the Kernighan and Plauger macro-processor, and then `m3', formed the engine for the Rational FORTRAN preprocessor, that is, -the `Ratfor' equivalent of `cpp'. Later, `m4' was used as a frontend +the `Ratfor' equivalent of `cpp'. Later, `m4' was used as a front-end for `Ratfor', `C' and `Cobol'. Rene' Seindal released his implementation of `m4', GNU `m4', in @@ -327,11 +327,12 @@ years. It was at this time that GNU Aut had too many limitations. More recently, in 2004, Paul Eggert released 1.4.1 and 1.4.2 which -addressed some long standing bugs in the venerable 1.4 release. Then -in 2005 Gary V. Vaughan collected together the many patches to GNU `m4' +addressed some long standing bugs in the venerable 1.4 release. Then in +2005, Gary V. Vaughan collected together the many patches to GNU `m4' 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. +release of 1.4.5, 1.4.6, 1.4.7, and 1.4.8. The 1.4.x series remains +open for bug fixes, including release 1.4.9 in 2007. Meanwhile, development has continued on new features for `m4', such as dynamic module loading and additional builtins. When complete, GNU @@ -356,10 +357,10 @@ Then send us the input file and the exac say what you expected to occur; this will help us decide whether the problem was really in the documentation. - Once you've got a precise problem, send e-mail to (Internet) -. Please include the version number of `m4' you are -using. You can get this information with the command `m4 --version'. -Also provide details about the platform you are executing on. + Once you've got a precise problem, send e-mail to . +Please include the version number of `m4' you are using. You can get +this information with the command `m4 --version'. Also provide details +about the platform you are executing on. Non-bug suggestions are always welcome as well. If you have questions about things that are unclear in the documentation or are @@ -387,10 +388,10 @@ Thus error-->and an error message The sequence `^D' in an example indicates the end of the input file. -The majority of these examples are self-contained, and you can run them -with similar results by invoking `m4 -d'. In fact, the testsuite that -is bundled in the GNU M4 package consists of the examples in this -document! +The sequence `' refers to the newline character. The majority of +these examples are self-contained, and you can run them with similar +results by invoking `m4 -d'. In fact, the testsuite that is bundled in +the GNU M4 package consists of the examples in this document! As each of the predefined macros in `m4' is described, a prototype call of the macro will be shown, giving descriptive names to the @@ -493,8 +494,14 @@ Several options control the overall oper `-E' `--fatal-warnings' - Stop execution and exit `m4' once the first warning has been - issued, considering all of them to be fatal. + Controls the effect of warnings. If unspecified, then execution + continues and exit status is unaffected when a warning is printed. + If specified exactly once, warnings become fatal; when one is + issued, execution continues, but the exit status will be non-zero. + If specified multiple times, then execution halts with non-zero + status the first time a warning is issued. The introduction of + behavior levels is new to M4 1.4.9; for behavior consistent with + earlier versions, you should specify `-E' twice. `-i' `--interactive' @@ -518,6 +525,20 @@ Several options control the overall oper Suppress warnings, such as missing or superfluous arguments in macro calls, or treating the empty string as zero. +`--warn-macro-sequence[=REGEXP]' + Issue a warning if the regular expression REGEXP has a non-empty + match in any macro definition (either by `define' or `pushdef'). + Empty matches are ignored; therefore, supplying the empty string + as REGEXP disables any warning. If the optional REGEXP is not + supplied, then the default regular expression is + `\$\({[^}]*}\|[0-9][0-9]+\)' (a literal `$' followed by multiple + digits or by an open brace), since these sequences will change + semantics in the default operation of GNU M4 2.0 (due to a change + in how more than 9 arguments in a macro definition will be + handled, *note Arguments::). Providing an alternate regular + expression can provide a useful reverse lookup feature of finding + where a macro is defined to have a given definition. + `-W REGEXP' `--word-regexp=REGEXP' Use REGEXP as an alternative syntax for macro names. This @@ -537,13 +558,12 @@ from. These features occur with the fol `-D NAME[=VALUE]' `--define=NAME[=VALUE]' - This enters NAME into the symbol table, before any input files are - read. If `=VALUE' is missing, the value is taken to be the empty - string. The 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 NAME - loses the previous value. + This enters NAME into the symbol table. If `=VALUE' is missing, + the value is taken to be the empty string. The 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 NAME loses the previous value. `-I DIRECTORY' `--include=DIRECTORY' @@ -749,11 +769,12 @@ As `m4' reads its input, it separates it either a name, a quoted string, or any single character, that is not a part of either a name or a string. Input to `m4' can also contain comments. GNU `m4' does not yet understand locales; all operations are -byte-oriented rather than character-oriented. However, `m4' is -eight-bit clean, so you can use non-ASCII characters in quoted strings -(*note Changequote::), comments (*note Changecom::), and macro names -(*note Indir::), with the exception of the NUL character (the zero byte -`'\0''). +byte-oriented rather than character-oriented (although if your locale +uses a single byte encoding, such as ISO-8859-1, you will not notice a +difference). However, `m4' is eight-bit clean, so you can use +non-ASCII characters in quoted strings (*note Changequote::), comments +(*note Changecom::), and macro names (*note Indir::), with the +exception of the NUL character (the zero byte `'\0''). * Menu: @@ -852,8 +873,11 @@ of the remaining input. In other words, call will be read and parsed into tokens again. `m4' expands a macro as soon as possible. If it finds a macro call -when collecting the arguments to another, it will expand the second -call first. For a running example, examine how `m4' handles this input: +when collecting the arguments to another, it will expand the second call +first. This process continues until there are no more macro calls to +expand and all the input has been consumed. + + For a running example, examine how `m4' handles this input: format(`Result is %d', eval(`2**15')) @@ -875,11 +899,123 @@ round of scanning for the tokens `Result =>Result is 32768 - The order in which `m4' expands the macros can be explored using the -trace facilities of GNU `m4' (*note Trace::). - - This process continues until there are no more macro calls to expand -and all the input has been consumed. + As a more complicated example, we will contrast an actual code +example from the Gnulib project(1), showing both a buggy approach and +the desired results. The user desires to output a shell assignment +statement that takes its argument and turns it into a shell variable by +converting it to uppercase and prepending a prefix. The original +attempt looks like this: + + changequote([,])dnl + define([gl_STRING_MODULE_INDICATOR], + [ + dnl comment + GNULIB_]translit([$1],[a-z],[A-Z])[=1 + ])dnl + gl_STRING_MODULE_INDICATOR([strcase]) + => + => GNULIB_strcase=1 + => + + Oops - the argument did not get capitalized. And although the manual +is not able to easily show it, both lines that appear empty actually +contain two trailing spaces. By stepping through the parse, it is easy +to see what happened. First, `m4' sees the token `changequote', which +it recognizes as a macro, followed by `(', `[', `,', `]', and `)' to +form the argument list. The macro expands to the empty string, but +changes the quoting characters to something more useful for generating +shell code (unbalanced ``' and `'' appear all the time in shell scripts, +but unbalanced `[]' tend to be rare). Also in the first line, `m4' +sees the token `dnl', which it recognizes as a builtin macro that +consumes the rest of the line, resulting in no output for that line. + + The second line starts a macro definition. `m4' sees the token +`define', which it recognizes as a macro, followed by a `(', +`[gl_STRING_MODULE_INDICATOR]', and `,'. Because an unquoted comma was +encountered, the first argument is known to be the expansion of the +single-quoted string token, or `gl_STRING_MODULE_INDICATOR'. Next, +`m4' sees `', ` ', and ` ', but this whitespace is discarded as +part of argument collection. Then comes a rather lengthy single-quoted +string token, `[ dnl comment GNULIB_]'. This is followed +by the token `translit', which `m4' recognizes as a macro name, so a +nested macro expansion has started. + + The arguments to the `translit' are found by the tokens `(', `[$1]', +`,', `[a-z]', `,', `[A-Z]', and finally `)'. All three string +arguments are expanded (or in other words, the quotes are stripped), +and since neither `$' nor `1' need capitalization, the result of the +macro is `$1'. This expansion is rescanned, resulting in the two +literal characters `$' and `1'. + + Scanning of the outer macro resumes, and picks up with `[=1 ]', +and finally `)'. The collected pieces of expanded text are +concatenated, with the end result that the macro +`gl_STRING_MODULE_INDICATOR' is now defined to be the sequence ` +dnl comment GNULIB_$1=1 '. Once again, `dnl' is recognized +and avoids a newline in the output. + + The final line is then parsed, beginning with ` ' and ` ' that are +output literally. Then `gl_STRING_MODULE_INDICATOR' is recognized as a +macro name, with an argument list of `(', `[strcase]', and `)'. Since +the definition of the macro contains the sequence `$1', that sequence +is replaced with the argument `strcase' prior to starting the rescan. +The rescan sees `' and four spaces, which are output literally, then +`dnl', which discards the text ` comment'. Next comes four more +spaces, also output literally, and the token `GNULIB_strcase', which +resulted from the earlier parameter substitution. Since that is not a +macro name, it is output literally, followed by the literal tokens `=', +`1', `', and two more spaces. Finally, the original `' seen +after the macro invocation is scanned and output literally. + + Now for a corrected approach. This rearranges the use of newlines +and whitespace so that less whitespace is output (which, although +harmless to shell scripts, can be visually unappealing), and fixes the +quoting issues so that the capitalization occurs when the macro +`gl_STRING_MODULE_INDICATOR' is invoked, rather then when it is defined. + + changequote([,])dnl + define([gl_STRING_MODULE_INDICATOR], + [dnl comment + GNULIB_[]translit([$1], [a-z], [A-Z])=1dnl + ])dnl + gl_STRING_MODULE_INDICATOR([strcase]) + => GNULIB_STRCASE=1 + + The parsing of the first line is unchanged. The second line sees the +name of the macro to define, then sees the discarded `' and two +spaces, as before. But this time, the next token is `[dnl comment +GNULIB_[]translit([$1], [a-z], [A-Z])=1dnl]', which includes nested +quotes, followed by `)' to end the macro definition and `dnl' to skip +the newline. No early expansion of `translit' occurs, so the entire +string becomes the definition of the macro. + + The final line is then parsed, beginning with two spaces that are +output literally, and an invocation of `gl_STRING_MODULE_INDICATOR' +with the argument `strcase'. Again, the `$1' in the macro definition +is substituted prior to rescanning. Rescanning first encounters `dnl', +and discards ` comment'. Then two spaces are output literally. +Next comes the token `GNULIB_', but that is not a macro, so it is +output literally. The token `[]' is an empty string, so it does not +affect output. Then the token `translit' is encountered. + + This time, the arguments to `translit' are parsed as `(', +`[strcase]', `,', ` ', `[a-z]', `,', ` ', `[A-Z]', and `)'. The two +spaces are discarded, and the translit results in the desired result +`STRCASE'. This is rescanned, but since it is not a macro name, it is +output literally. Then the scanner sees `=' and `1', which are output +literally, followed by `dnl' which discards the rest of the definition +of `gl_STRING_MODULE_INDICATOR'. The newline at the end of output is +the literal `' that appeared after the invocation of the macro. + + The order in which `m4' expands the macros can be further explored +using the trace facilities of GNU `m4' (*note Trace::). + + ---------- Footnotes ---------- + + (1) Derived from a patch in +`http://lists.gnu.org/archive/html/bug-gnulib/2007-01/msg00389.html', +and a followup patch in +`http://lists.gnu.org/archive/html/bug-gnulib/2007-02/msg00000.html'  File: m4.info, Node: Macros, Next: Definitions, Prev: Syntax, Up: Top @@ -943,11 +1079,21 @@ sometimes be the source of spurious, unw recognition of names as macro calls. First of all, many builtin macros cannot meaningfully be called -without arguments. For any of these macros, whenever an opening -parenthesis does not immediately follow their name, the builtin macro -call is not triggered. This solves the most usual cases, like for -`include' or `eval'. Later in this document, the sentence "This macro -is recognized only with parameters" refers to this specific provision. +without arguments. As a GNU extension, for any of these macros, +whenever an opening parenthesis does not immediately follow their name, +the builtin macro call is not triggered. This solves the most usual +cases, like for `include' or `eval'. Later in this document, the +sentence "This macro is recognized only with parameters" refers to this +specific provision of GNU M4, also known as a blind builtin macro. For +the builtins defined by POSIX that bear this disclaimer, POSIX +specifically states that invoking those builtins without arguments is +unspecified, because many other implementations simply invoke the +builtin as though it were given one empty argument instead. + + eval + =>eval + eval(`1') + =>1 There is also a command line option (`--prefix-builtins', or `-P', *note Invoking m4: Operation modes.) that renames all builtin macros @@ -1045,7 +1191,7 @@ However, some builtins are documented to missing optional argument than for an explicit empty string. If there are too many arguments, the excess arguments are ignored. Unquoted leading whitespace is stripped off all arguments, but whitespace -generated by a macro expansion or occuring after a macro that expanded +generated by a macro expansion or occurring after a macro that expanded to an empty string remains intact. Whitespace includes space, tab, newline, carriage return, vertical tab, and formfeed. @@ -1126,14 +1272,35 @@ with the parentheses, the `right' way to foo(`() (() (') - It is, however, in certain cases necessary or convenient to leave out -quotes for some arguments, and there is nothing wrong in doing it. It -just makes life a bit harder, if you are not careful. For consistency, -this manual follows the rule of thumb that each layer of parentheses -introduces another layer of single quoting, except when showing the -consequences of quoting rules. This is done even when the quoted string -cannot be a macro, such as with integers when you have not changed the -syntax via `changeword' (*note Changeword::). + It is, however, in certain cases necessary (because nested expansion +must occur to create the arguments for the outer macro) or convenient +(because it uses fewer characters) to leave out quotes for some +arguments, and there is nothing wrong in doing it. It just makes life a +bit harder, if you are not careful to follow a consistent quoting style. +For consistency, this manual follows the rule of thumb that each layer +of parentheses introduces another layer of single quoting, except when +showing the consequences of quoting rules. This is done even when the +quoted string cannot be a macro, such as with integers when you have not +changed the syntax via `changeword' (*note Changeword::). + + The quoting rule of thumb of one level of quoting per parentheses +has a nice property: when a macro name appears inside parentheses, you +can determine when it will be expanded. If it is not quoted, it will be +expanded prior to the outer macro, so that its expansion becomes the +argument. If it is single-quoted, it will be expanded after the outer +macro. And if it is double-quoted, it will be used as literal text +instead of a macro name. + + define(`active', `ACT, IVE') + => + define(`show', `$1 $1') + => + show(active) + =>ACT ACT + show(`active') + =>ACT, IVE ACT, IVE + show(``active'') + =>active active  File: m4.info, Node: Macro expansion, Prev: Quoting Arguments, Up: Macros @@ -1227,9 +1394,15 @@ other implementations of `m4' replace al be a simple word. It can be any text string, even the empty string. A macro with a non-standard name cannot be invoked in the normal way, as the name is not recognized. It can only be referenced by the builtins -`Indir' (*note Indir::) and `Defn' (*note Defn::). +`indir' (*note Indir::) and `defn' (*note Defn::). - Arrays and associative arrays can be simulated by using this trick. + Arrays and associative arrays can be simulated by using non-standard +macro names. + + -- Composite: array (INDEX) + -- Composite: array_set (INDEX, [VALUE]) + Provide access to entries within an array. `array' reads the entry + at location INDEX, and `array_set' assigns VALUE to location INDEX. define(`array', `defn(format(``array[%d]'', `$1'))') => @@ -1256,8 +1429,11 @@ Macros can have arguments. The Nth argu expansion text, and is replaced by the Nth actual argument, when the macro is expanded. Replacement of arguments happens before rescanning, regardless of how many nesting levels of quoting appear in the -expansion. Here is an example of a macro with two arguments. It -simply exchanges the order of the two arguments. +expansion. Here is an example of a macro with two arguments. + + -- Composite: exch (ARG1, ARG2) + Expands to ARG2 followed by ARG1, effectively exchanging their + order. define(`exch', `$2, $1') => @@ -1278,10 +1454,6 @@ to be reversed. (You should try and improve this example so that clients of `exch' do not have to double quote; or *note Answers: Improved exch.). - GNU `m4' allows the number following the `$' to consist of one or -more digits, allowing macros to have any number of arguments. This is -not so in UNIX implementations of `m4', which only recognize one digit. - As a special case, the zeroth argument, `$0', is always the name of the macro being expanded. @@ -1301,6 +1473,50 @@ remember that quotes can be nested in qu The `foo' in the expansion text is _not_ expanded, since it is a quoted string, and not a name. + GNU `m4' allows the number following the `$' to consist of one or +more digits, allowing macros to have any number of arguments. The +extension of accepting multiple digits is incompatible with POSIX, and +is different than traditional implementations of `m4', which only +recognize one digit. Therefore, future versions of GNU M4 will phase +out this feature. To portably access beyond the ninth argument, you +can use the `argn' macro documented later (*note Shift::). + + POSIX also states that `$' followed immediately by `{' in a macro +definition is implementation-defined. This version of M4 passes the +literal characters `${' through unchanged, but M4 2.0 will implement an +optional feature similar to `sh', where `${11}' expands to the eleventh +argument, to replace the current recognition of `$11'. Meanwhile, if +you want to guarantee that you will get a literal `${' in output when +expanding a macro, even when you upgrade to M4 2.0, you can use nested +quoting to your advantage: + + define(`foo', `single quoted $`'{1} output') + => + define(`bar', ``double quoted $'`{2} output'') + => + foo(`a', `b') + =>single quoted ${1} output + bar(`a', `b') + =>double quoted ${2} output + + To help you detect places in your M4 input files that might change in +behavior due to the changed behavior of M4 2.0, you can use the +`--warn-macro-sequence' command-line option (*note Invoking m4: +Operation modes.) with the default regular expression. This will add a +warning any time a macro definition includes `$' followed by multiple +digits, or by `{'. The warning is not enabled by default, because it +triggers a number of warnings in Autoconf 2.61 (and Autoconf uses `-E' +to treat warnings as errors), and because it will still be possible to +restore older behavior in M4 2.0. + + $ m4 --warn-macro-sequence + define(`foo', `$001 ${1} $1') + error-->m4:stdin:1: Warning: definition of `foo' contains sequence `$001' + error-->m4:stdin:1: Warning: definition of `foo' contains sequence `${1}' + => + foo(`bar') + =>bar ${1} bar +  File: m4.info, Node: Pseudo Arguments, Next: Undefine, Prev: Arguments, Up: Definitions @@ -1311,8 +1527,10 @@ There is a special notation for the numb and for all the actual arguments. The number of actual arguments in a macro call is denoted by `$#' in -the expansion text. Thus, a macro to display the number of arguments -given can be +the expansion text. + + -- Composite: nargs (...) + Expands to a count of the number of arguments supplied. define(`nargs', `$#') => @@ -1330,6 +1548,18 @@ given can be nargs((unquoted parentheses, like this, group arguments)) =>1 + Remember that `#' defaults to the comment character; if you forget +quotes to inhibit the comment behavior, your macro definition may not +end where you expected. + + dnl Attempt to define a macro to just `$#' + define(underquoted, $#) + oops) + => + underquoted + =>0) + =>oops + The notation `$*' can be used in the expansion text to denote all the actual arguments, unquoted, with commas in between. For example @@ -1610,7 +1840,11 @@ previous definition at a later time. Th If a macro with several definitions is redefined with `define', the topmost definition is _replaced_ with the new definition. If it is removed with `undefine', _all_ the definitions are removed, and not -only the topmost one. +only the topmost one. However, POSIX allows other implementations that +treat `define' as replacing an entire stack of definitions with a +single new definition, so to be portable to other implementations, it +may be worth explicitly using `popdef' and `pushdef' rather than +relying on the GNU behavior of `define'. define(`foo', `Expansion one.') => @@ -1867,8 +2101,8 @@ warning about missing arguments is never Notice how the first argument was used unquoted; it is common to compare the expansion of a macro with a string. With this macro, you -can now reproduce the behavior of many of the builtins, where the macro -is recognized only with arguments. +can now reproduce the behavior of blind builtins, where the macro is +recognized only with arguments. define(`foo', `ifelse(`$#', `0', ``$0'', `arguments:$#')') => @@ -1963,7 +2197,7 @@ requires adding quotes to each element: levels of quoting are added around each element. An actual implementation of these three macros is distributed as -`m4-1.4.8/examples/quote.m4' in this package. First, let's examine +`m4-1.4.9/examples/quote.m4' in this package. First, let's examine their usage: include(`quote.m4') @@ -1989,7 +2223,7 @@ results in one string, while `dquote_elt the implementation. Note that `quote' and `dquote_elt' make decisions based on their number of arguments, so that when called without arguments, they result in nothing instead of a quoted empty string; -this is so that it is possible to distinquish between no arguments and +this is so that it is possible to distinguish between no arguments and an empty first argument. `dquote', on the other hand, results in a string no matter what, since it is still possible to tell whether it was invoked without arguments based on the resulting string. @@ -2005,6 +2239,27 @@ was invoked without arguments based on t => ```$1'',$0(shift($@))')') =>divert`'dnl + One more useful macro based on `shift' allows portably selecting an +arbitrary argument (usually greater than the ninth argument), without +relying on the GNU extension of multi-digit arguments (*note +Arguments::). + + -- Composite: argn (N, ...) + Expands to argument N out of the remaining arguments. N must be a + positive number. Usually invoked as `argn(`N',$@)'. + + It is implemented as: + + define(`argn', `ifelse(`$1', 1, ``$2'', + `argn(decr(`$1'), shift(shift($@)))')') + => + argn(`1', `a') + =>a + define(`foo', `argn(`11', $@)') + => + foo(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k', `l') + =>k +  File: m4.info, Node: Forloop, Next: Foreach, Prev: Shift, Up: Conditionals @@ -2051,7 +2306,7 @@ finished, it increments the iterator (us `incr', *note Incr::), and recurses. Here is an actual implementation of `forloop', distributed as -`m4-1.4.8/examples/forloop.m4' in this package: +`m4-1.4.9/examples/forloop.m4' in this package: undivert(`forloop.m4')dnl =>divert(`-1') @@ -2091,8 +2346,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.8/examples/foreach.m4', and `foreachq' in -`m4-1.4.8/examples/foreachq.m4'. +`m4-1.4.9/examples/foreach.m4', and `foreachq' in +`m4-1.4.9/examples/foreachq.m4'. include(`foreach.m4') => @@ -2278,7 +2533,8 @@ It is possible to trace macro calls and -- Builtin: traceon ([NAMES...]) -- Builtin: traceoff ([NAMES...]) When called without any arguments, `traceon' and `traceoff' will - turn tracing on and off, respectively, for all defined macros. + turn tracing on and off, respectively, for all currently defined + macros. When called with arguments, only the macros listed in NAMES are affected, whether or not they are currently defined. @@ -2367,52 +2623,64 @@ File: m4.info, Node: Debug Levels, Nex 7.3 Controlling debugging output ================================ -The `-d' option to `m4' (*note Invoking m4: Debugging options.) -controls the amount of details presented, when using the macros -described in the preceding sections. +The `-d' option to `m4' (or `--debug', *note Invoking m4: Debugging +options.) controls the amount of details presented in three categories +of output. Trace output is requested by `traceon' (*note Trace::), and +each line is prefixed by `m4trace:' in relation to a macro invocation. +Debug output tracks useful events not associated with a macro +invocation, and each line is prefixed by `m4debug:'. Finally, +`dumpdef' (*note Dumpdef::) output is affected, with no prefix added to +the output lines. The FLAGS following the option can be one or more of the following: `a' - Show the actual arguments in each macro call. This applies to all - macro calls if the `t' flag is used, otherwise only the macros - covered by calls of `traceon'. + In trace output, show the actual arguments that were collected + before invoking the macro. This applies to all macro calls if the + `t' flag is used, otherwise only the macros covered by calls of + `traceon'. `c' - Show several trace lines for each macro call. A line is shown - when the macro is seen, but before the arguments are collected; a - second line when the arguments have been collected and a third - line after the call has completed. + In trace output, show several trace lines for each macro call. A + line is shown when the macro is seen, but before the arguments are + collected; a second line when the arguments have been collected + and a third line after the call has completed. `e' - Show the expansion of each macro call, if it is not void. This - applies to all macro calls if the `t' flag is used, otherwise only - the macros covered by calls of `traceon'. + In trace output, show the expansion of each macro call, if it is + not void. This applies to all macro calls if the `t' flag is used, + otherwise only the macros covered by calls of `traceon'. `f' - Show the name of the current input file in each trace output line. + In debug and trace output, include the name of the current input + file in the output line. `i' - Print a message each time the current input file is changed, - giving file name and input line number. + In debug output, print a message each time the current input file + is changed. `l' - Show the current input line number in each trace output line. + In debug and trace output, include the current input line number + in the output line. `p' - Print a message when a named file is found through the path search - mechanism (*note Search Path::), giving the actual file name used. + In debug output, print a message when a named file is found + through the path search mechanism (*note Search Path::), giving + the actual file name used. `q' - Quote actual arguments and macro expansions in the display with the - current quotes. + In trace and dumpdef output, quote actual arguments and macro + expansions in the display with the current quotes. This is useful + in connection with the `a' and `e' flags above. `t' - Trace all macro calls made in this invocation of `m4'. + In trace output, trace all macro calls made in this invocation of + `m4', regardless of the settings of `traceon'. `x' - Add a unique `macro call id' to each line of the trace output. - This is useful in connection with the `c' flag above. + In trace output, add a unique `macro call id' to each line of the + trace output. This is useful in connection with the `c' flag + above. `V' A shorthand for all of the above flags. @@ -3123,8 +3391,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.8/examples' directory shipped as part of the GNU `m4' package. -The file `m4-1.4.8/examples/incl.m4' in the distribution contains the +`m4-1.4.9/examples' directory shipped as part of the GNU `m4' package. +The file `m4-1.4.9/examples/incl.m4' in the distribution contains the lines: Include file start @@ -3262,10 +3530,10 @@ after any wrapped text is expanded. divert(`1')`diverted text.' divert => - m4wrap(`Wrapped text preceeds ') + m4wrap(`Wrapped text precedes ') => ^D - =>Wrapped TEXT preceeds diverted text. + =>Wrapped TEXT precedes diverted text. If output is diverted to a negative diversion, it is simply discarded. This can be used to suppress unwanted output. A common @@ -3393,7 +3661,7 @@ not get rearranged among the other diver argument, the contents of the file named will be copied, uninterpreted, to the current output. This complements the builtin `include' (*note Include::). To illustrate the difference, the file -`m4-1.4.8/examples/foo' contains the word `bar': +`m4-1.4.9/examples/foo' contains the word `bar': define(`bar', `BAR') => @@ -3540,8 +3808,10 @@ Searching for regular expressions is don -- Builtin: regexp (STRING, REGEXP, [REPLACEMENT]) Searches for REGEXP in STRING. The syntax for regular expressions - is the same as in GNU Emacs. *Note Syntax of Regular Expressions: - (emacs)Regexps. + is the same as in GNU Emacs, which is similar to BRE (Basic + Regular Expressions) in POSIX. *Note Syntax of Regular + Expressions: (emacs)Regexps. Support for ERE (Extended Regular + Expressions) is not available, but will be added in GNU M4 2.0. If REPLACEMENT is omitted, `regexp' expands to the index of the first match of REGEXP in STRING. If REGEXP does not match @@ -3731,7 +4001,7 @@ Global substitution in a string is done =>GNUs NOT Unix Here is a slightly more realistic example, which capitalizes -individual word or whole sentences, by substituting calls of the macros +individual words or whole sentences, by substituting calls of the macros `upcase' and `downcase' into the strings. -- Composite: upcase (TEXT) @@ -3775,8 +4045,8 @@ and preserves non-matching pieces:  File: m4.info, Node: Format, Prev: Patsubst, Up: Text handling -11.7 Formatted output -===================== +11.7 Formatting strings (printf-like) +===================================== Formatted output can be made with `format': @@ -3882,75 +4152,153 @@ File: m4.info, Node: Eval, Prev: Incr, Integer expressions are evaluated with `eval': -- Builtin: eval (EXPRESSION, [RADIX = `10'], [WIDTH]) - Expands to the value of EXPRESSION. The expansion is empty if an - error is encountered while parsing the arguments. If specified, + Expands to the value of EXPRESSION. The expansion is empty if a + problem is encountered while parsing the arguments. If specified, RADIX and WIDTH control the format of the output. - The macro `eval' is recognized only with parameters. + Calculations are done with 32-bit signed numbers. Overflow + silently results in wraparound. A warning is issued if division + by zero is attempted, or if EXPRESSION could not be parsed. - Expressions can contain the following operators, listed in order of -decreasing precedence. + Expressions can contain the following operators, listed in order of + decreasing precedence. -`+ -' - Unary plus and minus + `()' + Parentheses -`**' - Exponentiation + `+ - ~ !' + Unary plus and minus, and bitwise and logical negation -`* / %' - Multiplication, division and modulo + `**' + Exponentiation -`+ -' - Addition and subtraction + `* / %' + Multiplication, division, and modulo -`<< >>' - Shift left or right + `+ -' + Addition and subtraction -`== != > >= < <=' - Relational operators + `<< >>' + Shift left or right -`!' - Logical negation + `> >= < <=' + Relational operators -`~' - Bitwise negation + `== !=' + Equality operators -`&' - Bitwise and + `&' + Bitwise and -`^' - Bitwise exclusive-or + `^' + Bitwise exclusive-or -`|' - Bitwise or + `|' + Bitwise or -`&&' - Logical and + `&&' + Logical and -`||' - Logical or + `||' + Logical or + + The macro `eval' is recognized only with parameters. - All operators, except exponentiation, are left associative. + All binary operators, except exponentiation, are left associative. C +operators that perform variable assignment, such as `+=' or `--', are +not implemented, since `eval' only operates on constants, not +variables. Attempting to use them results in an error. However, since +traditional implementations treated `=' as an undocumented alias for +`==' as opposed to an assignment operator, this usage is supported as a +special case. Be aware that a future version of GNU M4 may support +assignment semantics as an extension when POSIX mode is not requested, +and that using `=' to check equality is not portable. + + eval(`2 = 2') + error-->m4:stdin:1: Warning: recommend ==, not =, for equality operator + =>1 + eval(`++0') + error-->m4:stdin:2: invalid operator in eval: ++0 + => + eval(`0 |= 1') + error-->m4:stdin:3: invalid operator in eval: 0 |= 1 + => Note that some older `m4' implementations use `^' as an alternate -operator for exponentiation, although POSIX requires the C behavior of -bitwise exclusive-or. On the other hand, the precedence of `~' and `!' -are different in GNU `m4' than they are in C, matching the precedence -in traditional `m4' implementations. This behavior is likely to change -in a future version to match POSIX, so use parentheses to force the -desired precedence. +operator for the exponentiation, although POSIX requires the C behavior +of bitwise exclusive-or. The precedence of the negation operators, `~' +and `!', was traditionally lower than equality. The unary operators +could not be used reliably more than once on the same term without +intervening parentheses. The traditional precedence of the equality +operators `==' and `!=' was identical instead of lower than the +relational operators such as `<', even through GNU M4 1.4.8. Starting +with version 1.4.9, GNU M4 correctly follows POSIX precedence rules. +M4 scripts designed to be portable between releases must be aware that +parentheses may be required to enforce C precedence rules. Likewise, +division by zero, even in the unused branch of a short-circuiting +operator, is not always well-defined in other implementations. + + Following are some examples where the current version of M4 follows C +precedence rules, but where older versions and some other +implementations of `m4' require explicit parentheses to get the correct +result: + + eval(`1 == 2 > 0') + =>1 + eval(`(1 == 2) > 0') + =>0 + eval(`! 0 * 2') + =>2 + eval(`! (0 * 2)') + =>1 + eval(`1 | 1 ^ 1') + =>1 + eval(`(1 | 1) ^ 1') + =>0 + eval(`+ + - ~ ! ~ 0') + =>1 + eval(`2 || 1 / 0') + =>1 + eval(`0 || 1 / 0') + error-->m4:stdin:9: divide by zero in eval: 0 || 1 / 0 + => + eval(`0 && 1 % 0') + =>0 + eval(`2 && 1 % 0') + error-->m4:stdin:11: modulo by zero in eval: 2 && 1 % 0 + => + + As a GNU extension, the operator `**' performs integral +exponentiation. The operator is right-associative, and if evaluated, +the exponent must be non-negative, and at least one of the arguments +must be non-zero, or a warning is issued. + + eval(`2 ** 3 ** 2') + =>512 + eval(`(2 ** 3) ** 2') + =>64 + eval(`0 ** 1') + =>0 + eval(`2 ** 0') + =>1 + eval(`0 ** 0') + => + error-->m4:stdin:5: divide by zero in eval: 0 ** 0 + eval(`4 ** -2') + error-->m4:stdin:6: negative exponent in eval: 4 ** -2 + => Within EXPRESSION, (but not RADIX or WIDTH), numbers without a special prefix are decimal. A simple `0' prefix introduces an octal -number. `0x' introduces a hexadecimal number. `0b' introduces a -binary number. `0r' introduces a number expressed in any radix between -1 and 36: the prefix should be immediately followed by the decimal -expression of the radix, a colon, then the digits making the number. -For radix 1, leading zeros are ignored and all remaining digits must be -`1'; for all other radices, the digits are `0', `1', `2', .... Beyond -`9', the digits are `a', `b' ... up to `z'. Lower and upper case -letters can be used interchangeably in numbers prefixes and as number -digits. +number. `0x' introduces a hexadecimal number. As GNU extensions, `0b' +introduces a binary number. `0r' introduces a number expressed in any +radix between 1 and 36: the prefix should be immediately followed by +the decimal expression of the radix, a colon, then the digits making +the number. For radix 1, leading zeros are ignored, and all remaining +digits must be `1'; for all other radices, the digits are `0', `1', `2', +.... Beyond `9', the digits are `a', `b' ... up to `z'. Lower and +upper case letters can be used interchangeably in numbers prefixes and +as number digits. Parentheses may be used to group subexpressions whenever needed. For the relational operators, a true relation returns `1', and a false @@ -3964,49 +4312,59 @@ relation return `0'. =>1 eval(`0r1:0111 + 0b100 + 0r3:12') =>12 - define(`square', `eval(`('$1`)**2')') + define(`square', `eval(`($1) ** 2')') => square(`9') =>81 - square(square(`5')`+1') + square(square(`5')` + 1') =>676 define(`foo', `666') => - eval(`foo/6') - error-->m4:stdin:8: bad expression in eval: foo/6 + eval(`foo / 6') + error-->m4:stdin:8: bad expression in eval: foo / 6 => - eval(foo/6) + eval(foo / 6) =>111 As the last two lines show, `eval' does not handle macro names, even if they expand to a valid expression (or part of a valid expression). Therefore all macros must be expanded before they are passed to `eval'. - All evaluation is done with 32-bit signed integers, assuming -2's-complement with wrap-around. The shift operators are defined in GNU -`m4' by doing an implicit bit-wise and of the right-hand operand with -0x1f, and sign-extension with right shift. + Some calculations are not portable to other implementations, since +they have undefined semantics in C, but GNU `m4' has well-defined +behavior on overflow. When shifting, an out-of-range shift amount is +implicitly brought into the range of 32-bit signed integers using an +implicit bit-wise and with 0x1f). - eval(0x80000000 / -1) + define(`max_int', eval(`0x7fffffff')) + => + define(`min_int', incr(max_int)) + => + eval(min_int` < 0') + =>1 + eval(max_int` > 0') + =>1 + ifelse(eval(min_int` / -1'), min_int, `overflow occurred') + =>overflow occurred + min_int =>-2147483648 - eval(0x80000000 % -1) + eval(`0x80000000 % -1') =>0 - eval(0x7fffffff) - =>2147483647 - incr(eval(0x7fffffff)) - =>-2147483648 - eval(-4 >> 33) + eval(`-4 >> 1') + =>-2 + eval(`-4 >> 33') =>-2 If RADIX is specified, it specifies the radix to be used in the expansion. The default radix is 10; this is also the case if RADIX is -the empty string. It is an error if the radix is outside the range of -1 through 36, inclusive. The result of `eval' is always taken to be +the empty string. A warning results if the radix is outside the range +of 1 through 36, inclusive. The result of `eval' is always taken to be signed. No radix prefix is output, and for radices greater than 10, the digits are lower case. The WIDTH argument specifies the minimum output width, excluding any negative sign. The result is zero-padded -to extend the expansion to the requested width. It is an error if the -width is negative. On error, the expansion of `eval' is empty. +to extend the expansion to the requested width. A warning results if +the width is negative. If RADIX or WIDTH is out of bounds, the +expansion of `eval' is empty. eval(`666', `10') =>666 @@ -4024,6 +4382,15 @@ width is negative. On error, the expans =>0r1:01111111111 eval(`10', `16') =>a + eval(`1', `37') + error-->m4:stdin:9: radix 37 in builtin `eval' out of range + => + eval(`1', , `-1') + error-->m4:stdin:10: negative width to builtin `eval' + => + eval() + error-->m4:stdin:11: empty string treated as 0 in builtin `eval' + =>0  File: m4.info, Node: Shell commands, Next: Miscellaneous, Prev: Arithmetic, Up: Top @@ -4191,6 +4558,8 @@ To see whether a shell command succeeded `syscmd' or `esyscmd'. Expands to 0 if no command has been run yet. + sysval + =>0 syscmd(`false') => ifelse(sysval, `0', `zero', `non-zero') @@ -4231,10 +4600,14 @@ result is the signal number shifted left ifdef(`__unix__', , `errprint(` skipping: syscmd does not have unix semantics ')m4exit(`77')')dnl - syscmd(`kill -13 $$') + syscmd(`kill -9 $$') + => + sysval + =>2304 + syscmd() => sysval - =>3328 + =>0 esyscmd(`kill -9 $$') => sysval @@ -4275,6 +4648,9 @@ file, for output or for some other purpo new implementations of `m4' provide the secure `mkstemp' builtin, and that users of `m4' check for its existence. + The expansion is void and an error issued if a temporary file could + not be created. + The macros `mkstemp' and `maketemp' are recognized only with parameters. @@ -4396,7 +4772,7 @@ Preprocessor features.), and the `f' and (*note Debug Levels::), also use this notion of current file and line. Redefining the three location macros has no effect on syncline, debug, or warning message output. Assume this example is run in the -`m4-1.4.8/checks' directory of the GNU M4 package, using +`m4-1.4.9/checks' directory of the GNU M4 package, using `--include=../examples' in the command line to find the file `incl.m4' mentioned earlier: @@ -4554,7 +4930,7 @@ once, and further execute, as often as n with the varying input. The first call, containing the `-F' option, only reads and executes file `base.m4', defining various application macros and computing other initializations. Once the input file -`base.m4' has been completely processed, GNU `m4' produces on +`base.m4' has been completely processed, GNU `m4' produces in `base.m4f' a "frozen" file, that is, a file which contains a kind of snapshot of the `m4' internal state. @@ -4665,7 +5041,7 @@ characters. The directives are: the same name, and its order, along with `F', is important. `V NUMBER ' - Confirms the format of the file. `m4' 1.4.8 only creates and + Confirms the format of the file. `m4' 1.4.9 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. @@ -4700,7 +5076,7 @@ System V `m4'. These extra facilities a `-G' command line option (*note Invoking m4: Limits control.), unless overridden by other command line options. - * In the `$'N notation for macro arguments, N can contain several + * In the `$N' notation for macro arguments, N can contain several digits, while the System V `m4' only accepts one digit. This allows macros in GNU `m4' to take any number of arguments, and not only nine (*note Arguments::). @@ -4728,6 +5104,8 @@ overridden by other command line options Eleventh(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k') =>k + Also see the `argn' macro (*note Shift::). + * The `divert' (*note Divert::) macro can manage more than 9 diversions. GNU `m4' treats all positive numbers as valid diversions, rather than discarding diversions greater than 9. @@ -4744,9 +5122,9 @@ overridden by other command line options * Formatted output is supported through the `format' builtin, which is modeled after the C library function `printf' (*note Format::). - * Searches and text substitution through regular expressions are - supported by the `regexp' (*note Regexp::) and `patsubst' (*note - Patsubst::) builtins. + * Searches and text substitution through basic regular expressions + are supported by the `regexp' (*note Regexp::) and `patsubst' + (*note Patsubst::) builtins. * The output of shell commands can be read into `m4' with `esyscmd' (*note Esyscmd::). @@ -4814,7 +5192,7 @@ behaviors is non-portable, as a future r all arguments, with output separated by spaces. However, it is possible to emulate POSIX behavior by including the - file `m4-1.4.8/examples/wrapfifo.m4' from the distribution: + file `m4-1.4.9/examples/wrapfifo.m4' from the distribution: undivert(`wrapfifo.m4')dnl =>dnl Redefine m4wrap to have FIFO semantics. @@ -4835,8 +5213,9 @@ behaviors is non-portable, as a future r ^D =>abc - * POSIX requires that all builtins that require arguments, but are - called without arguments, behave as though empty strings had been + * POSIX states that builtins that require arguments, but are called + without arguments, have undefined behavior. Traditional + implementations simply behave as though empty strings had been passed. For example, `a`'define`'b' would expand to `ab'. But GNU `m4' ignores certain builtins if they have missing arguments, giving `adefineb' for the above example. @@ -4845,7 +5224,7 @@ behaviors is non-portable, as a future r Define::) by undefining the entire stack of previous definitions, and if doing `undefine(`f')' first. GNU `m4' replaces just the top definition on the stack, as if doing `popdef(`f')' followed by - `pushdef(`f',`1')'. + `pushdef(`f',`1')'. POSIX allows either behavior. * POSIX requires `syscmd' (*note Syscmd::) to evaluate command output for macro expansion, but this appears to be a mistake in @@ -4906,15 +5285,18 @@ behaviors is non-portable, as a future r even if the macro is currently undefined. * POSIX requires `eval' (*note Eval::) to treat all operators with - the same precedence as C. However, GNU `m4' currently follows the - traditional precedence of other `m4' implementations, where - bitwise and logical negation (`~' and `!') have lower precedence - than equality operators, rather than equal precedence with other - unary operators. Use explicit parentheses to ensure proper - precedence. As extensions to POSIX, GNU `m4' treats the shift - operators `<<' and `>>' as well-defined on signed integers (even - though they are not in C), and adds the exponentiation operator - `**'. + the same precedence as C. However, earlier versions of GNU `m4' + followed the traditional behavior of other `m4' implementations, + where bitwise and logical negation (`~' and `!') have lower + precedence than equality operators; and where equality operators + (`==' and `!=') had the same precedence as relational operators + (such as `<'). Use explicit parentheses to ensure proper + precedence. As extensions to POSIX, GNU `m4' gives well-defined + semantics to operations that C leaves undefined, such as when + overflow occurs, when shifting negative numbers, or when + performing division by zero. POSIX also requires `=' to cause an + error, but many traditional implementations allowed it as an alias + for `=='. * POSIX requires `translit' (*note Translit::) to treat each character of the second and third arguments literally, but GNU @@ -4965,17 +5347,18 @@ There are a few other incompatibilities => There is nothing inherently wrong with defining `x' to return `x'. - The wrong thing is to expand `x' unquoted. In `m4', one might - use macros to hold strings, as we do for variables in other - programming languages, further checking them with: + The wrong thing is to expand `x' unquoted, because that would + cause an infinite rescan loop. In `m4', one might use macros to + hold strings, as we do for variables in other programming + languages, further checking them with: ifelse(defn(`HOLDER'), `VALUE', ...) - In cases like this one, an interdiction for a macro to hold its own - name would be a useless limitation. Of course, this leaves more - rope for the GNU `m4' user to hang himself! Rescanning hangs may - be avoided through careful programming, a little like for endless - loops in traditional programming languages. + In cases like this one, an interdiction for a macro to hold its + own name would be a useless limitation. Of course, this leaves + more rope for the GNU `m4' user to hang himself! Rescanning hangs + may be avoided through careful programming, a little like for + endless loops in traditional programming languages.  File: m4.info, Node: Answers, Next: Copying This Manual, Prev: Compatibility, Up: Top @@ -5024,7 +5407,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.8/examples/forloop2.m4'; this version also optimizes +shipped as `m4-1.4.9/examples/forloop2.m4'; this version also optimizes based on the fact that the starting bound does not need to be passed to the helper `_forloop'. @@ -5102,7 +5485,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.8/examples/foreachq2.m4': +found in `m4-1.4.9/examples/foreachq2.m4': include(`foreachq2.m4') => @@ -5137,7 +5520,7 @@ Contrast the use of `_arg1q', which quot element directly. For a different approach, the improved version of `foreach', -available in `m4-1.4.8/examples/foreach2.m4', simply overquotes the +available in `m4-1.4.9/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: @@ -5761,356 +6144,453 @@ Appendix B Indices of concepts and macro * Menu: -* Concept index:: Index for many concepts * Macro index:: Index for all `m4' macros +* Concept index:: Index for many concepts  -File: m4.info, Node: Concept index, Next: Macro index, Up: Indices +File: m4.info, Node: Macro index, Next: Concept index, Up: Indices -B.1 Index for many concepts -=========================== +B.1 Index for all `m4' macros +============================= + +This index covers all `m4' builtins, as well as several useful +composite macros. References are exclusively to the places where a +macro is introduced the first time. [index] * Menu: -* arguments to macros: Macro Arguments. (line 6) -* Arguments to macros: Arguments. (line 6) -* arguments to macros, special: Pseudo Arguments. (line 6) -* arguments, quoted macro: Quoting Arguments. (line 6) -* arithmetic: Arithmetic. (line 6) -* arrays: Define. (line 52) -* builtins, indirect call of: Builtin. (line 6) -* call of builtins, indirect: Builtin. (line 6) -* call of macros, indirect: Indir. (line 6) -* changing comment delimiters: Changecom. (line 6) -* changing the quote delimiters: Changequote. (line 6) -* characters, translating: Translit. (line 6) -* command line, file names on the: Command line files. (line 6) -* command line, macro definitions on the: Preprocessor features. - (line 6) -* command line, options: Invoking m4. (line 10) -* commands, exit status from shell: Sysval. (line 6) -* commands, running shell: Shell commands. (line 6) -* commands, running UNIX: Shell commands. (line 6) -* comment delimiters, changing: Changecom. (line 6) -* comments: Comments. (line 6) -* comments, copied to output: Changecom. (line 29) -* comparing strings: Ifelse. (line 6) -* compatibility: Compatibility. (line 6) -* conditionals: Ifdef. (line 6) -* controlling debugging output: Debug Levels. (line 6) -* counting loops: Forloop. (line 6) -* debugging output, controlling: Debug Levels. (line 6) -* debugging output, saving: Debug Output. (line 6) -* decrement operator: Incr. (line 6) -* defining new macros: Definitions. (line 6) -* definitions, displaying macro: Dumpdef. (line 6) -* deleting macros: Undefine. (line 6) -* deleting whitespace in input: Dnl. (line 6) -* discarding diverted text: Cleardivert. (line 6) -* displaying macro definitions: Dumpdef. (line 6) -* diversion numbers: Divnum. (line 6) -* diverted text, discarding: Cleardivert. (line 6) -* diverting output to files: Divert. (line 6) -* dumping into frozen file: Using frozen files. (line 6) -* error messages, printing: Errprint. (line 6) -* evaluation, of integer expressions: Eval. (line 6) -* executing shell commands: Shell commands. (line 6) -* executing UNIX commands: Shell commands. (line 6) -* exit status from shell commands: Sysval. (line 6) -* exiting from m4: M4exit. (line 6) -* expansion of macros: Macro expansion. (line 6) -* expansion, tracing macro: Trace. (line 6) -* expressions, evaluation of integer: Eval. (line 6) -* extracting substrings: Substr. (line 6) -* fast loading of frozen files: Using frozen files. (line 6) -* FDL, GNU Free Documentation License: GNU Free Documentation License. - (line 6) -* file format, frozen file: Frozen file format. (line 6) -* file inclusion <1>: Undivert. (line 81) -* file inclusion: File Inclusion. (line 6) -* file names, on the command line: Command line files. (line 6) -* files, diverting output to: Divert. (line 6) -* files, names of temporary: Mkstemp. (line 6) -* for each loops: Foreach. (line 6) -* for loops: Forloop. (line 6) -* formatted output: Format. (line 6) -* frozen file format: Frozen file format. (line 6) -* frozen files for fast loading: Using frozen files. (line 6) -* GNU extensions <1>: Indir. (line 6) -* GNU extensions <2>: Patsubst. (line 6) -* GNU extensions <3>: Extensions. (line 6) -* GNU extensions <4>: Regexp. (line 6) -* GNU extensions <5>: Using frozen files. (line 6) -* GNU extensions <6>: Format. (line 6) -* GNU extensions <7>: Undivert. (line 81) -* GNU extensions <8>: Divert. (line 54) -* GNU extensions <9>: Search Path. (line 6) -* GNU extensions <10>: Define. (line 41) -* GNU extensions <11>: Arguments. (line 32) -* GNU extensions <12>: Esyscmd. (line 6) -* GNU extensions <13>: Debug Output. (line 6) -* GNU extensions <14>: Mkstemp. (line 52) -* GNU extensions <15>: Builtin. (line 6) -* GNU extensions: Debug Levels. (line 59) -* included files, search path for: Search Path. (line 6) -* inclusion, of files <1>: Undivert. (line 81) -* inclusion, of files: File Inclusion. (line 6) -* increment operator: Incr. (line 6) -* indirect call of builtins: Builtin. (line 6) -* indirect call of macros: Indir. (line 6) -* initialization, frozen states: Using frozen files. (line 6) -* input tokens: Syntax. (line 6) -* input, saving: M4wrap. (line 6) -* integer arithmetic: Arithmetic. (line 6) -* integer expression evaluation: Eval. (line 6) -* iterating over lists: Foreach. (line 6) -* length of strings: Len. (line 6) -* lexical structure of words: Changeword. (line 6) -* License: Copying This Manual. (line 6) -* local variables: Pushdef. (line 75) -* loops: Shift. (line 10) -* loops, counting: Forloop. (line 6) -* loops, list iteration: Foreach. (line 6) -* macro definitions, on the command line: Preprocessor features. - (line 6) -* macro expansion, tracing: Trace. (line 6) -* macro invocation: Invocation. (line 6) -* macros, arguments to <1>: Macro Arguments. (line 6) -* macros, arguments to: Arguments. (line 6) -* macros, displaying definitions: Dumpdef. (line 6) -* macros, expansion of: Macro expansion. (line 6) -* macros, how to define new: Definitions. (line 6) -* macros, how to delete: Undefine. (line 6) -* macros, how to rename: Defn. (line 6) -* macros, indirect call of: Indir. (line 6) -* macros, quoted arguments to: Quoting Arguments. (line 6) -* macros, recursive: Shift. (line 6) -* macros, special arguments to: Pseudo Arguments. (line 6) -* macros, temporary redefinition of: Pushdef. (line 6) -* messages, printing error: Errprint. (line 6) -* multibranches: Ifelse. (line 66) -* names: Names. (line 6) -* options, command line: Invoking m4. (line 10) -* output, diverting to files: Divert. (line 6) -* output, formatted: Format. (line 6) -* output, saving debugging: Debug Output. (line 6) -* pattern substitution: Patsubst. (line 6) -* platform macro: Platform macros. (line 31) -* platform macros: Platform macros. (line 6) -* POSIXLY_CORRECT: Invoking m4. (line 10) -* printing error messages: Errprint. (line 6) -* quote delimiters, changing the: Changequote. (line 6) -* quoted macro arguments: Quoting Arguments. (line 6) -* quoted string: Quoted strings. (line 6) -* recursive macros: Shift. (line 6) -* redefinition of macros, temporary: Pushdef. (line 6) -* regular expressions <1>: Patsubst. (line 6) -* regular expressions: Regexp. (line 6) -* reloading a frozen file: Using frozen files. (line 6) -* renaming macros: Defn. (line 6) -* running shell commands: Shell commands. (line 6) -* running UNIX commands: Shell commands. (line 6) -* saving debugging output: Debug Output. (line 6) -* saving input: M4wrap. (line 6) -* search path for included files: Search Path. (line 6) -* shell commands, exit status from: Sysval. (line 6) -* shell commands, running: Shell commands. (line 6) -* special arguments to macros: Pseudo Arguments. (line 6) -* status of shell commands: Sysval. (line 6) -* status, setting m4 exit: M4exit. (line 6) -* strings, length of: Len. (line 6) -* substitution by regular expression: Patsubst. (line 6) -* substrings, extracting: Substr. (line 6) -* temporary file names: Mkstemp. (line 6) -* temporary redefinition of macros: Pushdef. (line 6) -* tokens: Syntax. (line 6) -* tracing macro expansion: Trace. (line 6) -* translating characters: Translit. (line 6) -* undefining macros: Undefine. (line 6) -* UNIX commands, exit status from: Sysval. (line 6) -* UNIX commands, running: Shell commands. (line 6) -* variables, local: Pushdef. (line 75) -* words, lexical structure of: Changeword. (line 6) +* __file__: Location. (line 10) +* __gnu__: Platform macros. (line 12) +* __line__: Location. (line 11) +* __os2__: Platform macros. (line 13) +* __program__: Location. (line 12) +* __unix__: Platform macros. (line 15) +* __windows__: Platform macros. (line 17) +* argn: Shift. (line 110) +* array: Define. (line 56) +* array_set: Define. (line 57) +* builtin: Builtin. (line 9) +* capitalize: Patsubst. (line 55) +* changecom: Changecom. (line 10) +* changequote: Changequote. (line 10) +* changeword: Changeword. (line 23) +* cleardivert: Cleardivert. (line 26) +* debugfile: Debug Output. (line 11) +* debugmode: Debug Levels. (line 75) +* decr: Incr. (line 11) +* define: Define. (line 10) +* defn: Defn. (line 10) +* divert: Divert. (line 9) +* divnum: Divnum. (line 9) +* dnl: Dnl. (line 9) +* downcase: Patsubst. (line 54) +* dquote: Shift. (line 53) +* dquote_elt: Shift. (line 54) +* dumpdef: Dumpdef. (line 10) +* errprint: Errprint. (line 9) +* esyscmd: Esyscmd. (line 9) +* eval: Eval. (line 9) +* example: Manual. (line 32) +* exch: Arguments. (line 13) +* fatal_error: M4exit. (line 25) +* foreach: Foreach. (line 9) +* foreachq: Foreach. (line 10) +* forloop: Forloop. (line 9) +* format: Format. (line 9) +* ifdef: Ifdef. (line 10) +* ifelse: Ifelse. (line 11) +* include: Include. (line 9) +* incr: Incr. (line 10) +* index: Index macro. (line 9) +* indir: Indir. (line 9) +* len: Len. (line 9) +* m4exit: M4exit. (line 10) +* m4wrap: M4wrap. (line 14) +* maketemp: Mkstemp. (line 12) +* mkstemp: Mkstemp. (line 11) +* nargs: Pseudo Arguments. (line 13) +* os2: Platform macros. (line 14) +* patsubst: Patsubst. (line 9) +* popdef: Pushdef. (line 12) +* pushdef: Pushdef. (line 11) +* quote: Shift. (line 52) +* regexp: Regexp. (line 9) +* reverse: Shift. (line 32) +* shift: Shift. (line 17) +* sinclude: Include. (line 10) +* substr: Substr. (line 9) +* syscmd: Syscmd. (line 9) +* sysval: Sysval. (line 9) +* traceoff: Trace. (line 11) +* traceon: Trace. (line 10) +* translit: Translit. (line 9) +* undefine: Undefine. (line 9) +* undivert: Undivert. (line 9) +* unix: Platform macros. (line 16) +* upcase: Patsubst. (line 53) +* windows: Platform macros. (line 18)  -File: m4.info, Node: Macro index, Prev: Concept index, Up: Indices - -B.2 Index for all `m4' macros -============================= +File: m4.info, Node: Concept index, Prev: Macro index, Up: Indices -References are exclusively to the places where a builtin is introduced -the first time. +B.2 Index for many concepts +=========================== [index] * Menu: -* __file__: Location. (line 10) -* __gnu__: Platform macros. (line 12) -* __line__: Location. (line 11) -* __os2__: Platform macros. (line 13) -* __program__: Location. (line 12) -* __unix__: Platform macros. (line 15) -* __windows__: Platform macros. (line 17) -* builtin: Builtin. (line 9) -* capitalize: Patsubst. (line 55) -* changecom: Changecom. (line 10) -* changequote: Changequote. (line 10) -* changeword: Changeword. (line 23) -* cleardivert: Cleardivert. (line 26) -* debugfile: Debug Output. (line 11) -* debugmode: Debug Levels. (line 63) -* decr: Incr. (line 11) -* define: Define. (line 10) -* defn: Defn. (line 10) -* divert: Divert. (line 9) -* divnum: Divnum. (line 9) -* dnl: Dnl. (line 9) -* downcase: Patsubst. (line 54) -* dquote: Shift. (line 53) -* dquote_elt: Shift. (line 54) -* dumpdef: Dumpdef. (line 10) -* errprint: Errprint. (line 9) -* esyscmd: Esyscmd. (line 9) -* eval: Eval. (line 9) -* example: Manual. (line 32) -* fatal_error: M4exit. (line 25) -* foreach: Foreach. (line 9) -* foreachq: Foreach. (line 10) -* forloop: Forloop. (line 9) -* format: Format. (line 9) -* ifdef: Ifdef. (line 10) -* ifelse: Ifelse. (line 12) -* include: Include. (line 9) -* incr: Incr. (line 10) -* index: Index macro. (line 9) -* indir: Indir. (line 9) -* len: Len. (line 9) -* m4exit: M4exit. (line 10) -* m4wrap: M4wrap. (line 14) -* maketemp: Mkstemp. (line 12) -* mkstemp: Mkstemp. (line 11) -* os2: Platform macros. (line 14) -* patsubst: Patsubst. (line 9) -* popdef: Pushdef. (line 12) -* pushdef: Pushdef. (line 11) -* quote: Shift. (line 52) -* regexp: Regexp. (line 9) -* reverse: Shift. (line 32) -* shift: Shift. (line 17) -* sinclude: Include. (line 10) -* substr: Substr. (line 9) -* syscmd: Syscmd. (line 9) -* sysval: Sysval. (line 9) -* traceoff: Trace. (line 11) -* traceon: Trace. (line 10) -* translit: Translit. (line 9) -* undefine: Undefine. (line 9) -* undivert: Undivert. (line 9) -* unix: Platform macros. (line 16) -* upcase: Patsubst. (line 53) -* windows: Platform macros. (line 18) +* arguments to macros <1>: Macro Arguments. (line 6) +* arguments to macros: Arguments. (line 6) +* arguments to macros, special: Pseudo Arguments. (line 6) +* arguments, more than nine <1>: Arguments. (line 54) +* arguments, more than nine: Shift. (line 104) +* arguments, quoted macro: Quoting Arguments. (line 6) +* arithmetic: Arithmetic. (line 6) +* arrays: Define. (line 52) +* avoiding quadratic behavior: Improved foreach. (line 37) +* basic regular expressions <1>: Regexp. (line 6) +* basic regular expressions: Patsubst. (line 6) +* blind macro <1>: Ifelse. (line 52) +* blind macro: Inhibiting Invocation. + (line 14) +* bug reports: Bugs. (line 6) +* builtins, indirect call of: Builtin. (line 6) +* builtins, special tokens: Defn. (line 79) +* call of builtins, indirect: Builtin. (line 6) +* call of macros, indirect: Indir. (line 6) +* case statement: Ifelse. (line 66) +* changing comment delimiters: Changecom. (line 6) +* changing quote delimiters: Changequote. (line 6) +* changing syntax: Changeword. (line 6) +* characters, translating: Translit. (line 6) +* command line: Invoking m4. (line 6) +* command line, file names on the: Command line files. (line 6) +* command line, macro definitions on the: Preprocessor features. + (line 6) +* command line, options: Invoking m4. (line 10) +* commands, exit status from shell: Sysval. (line 6) +* commands, running shell: Shell commands. (line 6) +* comment delimiters, changing: Changecom. (line 6) +* comments: Comments. (line 6) +* comments, copied to output: Changecom. (line 29) +* comparing strings: Ifelse. (line 6) +* compatibility: Compatibility. (line 6) +* conditionals: Ifdef. (line 6) +* controlling debugging output: Debug Levels. (line 6) +* counting loops: Forloop. (line 6) +* debugging macros: Debugging. (line 6) +* debugging output, controlling: Debug Levels. (line 6) +* debugging output, saving: Debug Output. (line 6) +* decrement operator: Incr. (line 6) +* deferring expansion: M4wrap. (line 6) +* deferring output: Diversions. (line 6) +* defining new macros: Definitions. (line 6) +* definition stack: Pushdef. (line 6) +* definitions, displaying macro <1>: Dumpdef. (line 6) +* definitions, displaying macro: Defn. (line 6) +* deleting macros: Undefine. (line 6) +* deleting whitespace in input: Dnl. (line 6) +* delimiters, changing <1>: Changecom. (line 6) +* delimiters, changing: Changequote. (line 6) +* discarding diverted text: Cleardivert. (line 6) +* discarding input <1>: Ifelse. (line 6) +* discarding input <2>: Divert. (line 42) +* discarding input: Dnl. (line 6) +* displaying macro definitions: Dumpdef. (line 6) +* diversion numbers: Divnum. (line 6) +* diverted text, discarding: Cleardivert. (line 6) +* diverting output to files: Divert. (line 6) +* dumping into frozen file: Using frozen files. (line 6) +* error messages, printing: Errprint. (line 6) +* errors, fatal: Operation modes. (line 20) +* evaluation, of integer expressions: Eval. (line 6) +* examples, understanding: Manual. (line 6) +* executing shell commands: Shell commands. (line 6) +* exit status from shell commands: Sysval. (line 6) +* exiting from m4: M4exit. (line 6) +* expansion of macros: Macro expansion. (line 6) +* expansion, deferring: M4wrap. (line 6) +* expansion, tracing macro: Trace. (line 6) +* expressions, evaluation of integer: Eval. (line 6) +* expressions, regular <1>: Patsubst. (line 6) +* expressions, regular: Regexp. (line 6) +* extracting substrings: Substr. (line 6) +* fast loading of frozen files: Using frozen files. (line 6) +* fatal errors: Operation modes. (line 20) +* FDL, GNU Free Documentation License: GNU Free Documentation License. + (line 6) +* file format, frozen file: Frozen file format. (line 6) +* file inclusion <1>: Undivert. (line 13) +* file inclusion: File Inclusion. (line 6) +* file names, on the command line: Command line files. (line 6) +* files, diverting output to: Divert. (line 6) +* files, names of temporary: Mkstemp. (line 6) +* for each loops: Foreach. (line 6) +* for loops: Forloop. (line 6) +* formatted output: Format. (line 6) +* frozen file format: Frozen file format. (line 6) +* frozen files for fast loading: Using frozen files. (line 6) +* GNU extensions <1>: Mkstemp. (line 55) +* GNU extensions <2>: Divert. (line 54) +* GNU extensions <3>: Undivert. (line 81) +* GNU extensions <4>: Patsubst. (line 6) +* GNU extensions <5>: Inhibiting Invocation. + (line 14) +* GNU extensions <6>: Builtin. (line 6) +* GNU extensions <7>: Esyscmd. (line 6) +* GNU extensions <8>: Eval. (line 125) +* GNU extensions <9>: Extensions. (line 6) +* GNU extensions <10>: Debug Output. (line 6) +* GNU extensions <11>: Arguments. (line 54) +* GNU extensions <12>: Format. (line 6) +* GNU extensions <13>: Debug Levels. (line 71) +* GNU extensions <14>: Search Path. (line 6) +* GNU extensions <15>: Indir. (line 6) +* GNU extensions <16>: Define. (line 41) +* GNU extensions <17>: Using frozen files. (line 6) +* GNU extensions: Regexp. (line 6) +* GNU M4, history of: History. (line 6) +* history of m4: History. (line 6) +* included files, search path for: Search Path. (line 6) +* inclusion, of files <1>: File Inclusion. (line 6) +* inclusion, of files: Undivert. (line 81) +* increment operator: Incr. (line 6) +* indirect call of builtins: Builtin. (line 6) +* indirect call of macros: Indir. (line 6) +* initialization, frozen state: Using frozen files. (line 6) +* input location <1>: Preprocessor features. + (line 28) +* input location: Location. (line 6) +* input tokens: Syntax. (line 6) +* input, discarding <1>: Divert. (line 42) +* input, discarding <2>: Ifelse. (line 6) +* input, discarding: Dnl. (line 6) +* input, saving: M4wrap. (line 6) +* integer arithmetic: Arithmetic. (line 6) +* integer expression evaluation: Eval. (line 6) +* invoking m4: Invoking m4. (line 6) +* invoking macros: Invocation. (line 6) +* iterating over lists: Foreach. (line 6) +* length of strings: Len. (line 6) +* lexical structure of words: Changeword. (line 6) +* License: Copying This Manual. (line 6) +* limit, nesting: Limits control. (line 27) +* literal output: Pseudo Arguments. (line 106) +* local variables: Pushdef. (line 79) +* location, input <1>: Location. (line 6) +* location, input: Preprocessor features. + (line 28) +* loops: Shift. (line 10) +* loops, counting: Forloop. (line 6) +* loops, list iteration: Foreach. (line 6) +* M4PATH: Search Path. (line 9) +* macro definitions, on the command line: Preprocessor features. + (line 6) +* macro expansion, tracing: Trace. (line 6) +* macro invocation: Invocation. (line 6) +* macro, blind <1>: Ifelse. (line 52) +* macro, blind: Inhibiting Invocation. + (line 14) +* macros, arguments to <1>: Macro Arguments. (line 6) +* macros, arguments to: Arguments. (line 6) +* macros, debugging: Debugging. (line 6) +* macros, displaying definitions <1>: Dumpdef. (line 6) +* macros, displaying definitions: Defn. (line 6) +* macros, expansion of: Macro expansion. (line 6) +* macros, how to define new: Definitions. (line 6) +* macros, how to delete: Undefine. (line 6) +* macros, how to rename: Defn. (line 6) +* macros, indirect call of: Indir. (line 6) +* macros, quoted arguments to: Quoting Arguments. (line 6) +* macros, recursive: Shift. (line 6) +* macros, special arguments to: Pseudo Arguments. (line 6) +* macros, temporary redefinition of: Pushdef. (line 6) +* messages, printing error: Errprint. (line 6) +* more than nine arguments <1>: Arguments. (line 54) +* more than nine arguments: Shift. (line 104) +* multibranches: Ifelse. (line 66) +* names: Names. (line 6) +* nesting limit: Limits control. (line 27) +* nine arguments, more than <1>: Shift. (line 104) +* nine arguments, more than: Arguments. (line 54) +* numbers: Manual. (line 49) +* options, command line: Invoking m4. (line 10) +* output, diverting to files: Divert. (line 6) +* output, formatted: Format. (line 6) +* output, literal: Pseudo Arguments. (line 106) +* output, saving debugging: Debug Output. (line 6) +* overview of m4: Intro. (line 6) +* pattern substitution: Patsubst. (line 6) +* platform macros: Platform macros. (line 6) +* positional parameters, more than nine: Arguments. (line 54) +* POSIX: Extensions. (line 6) +* POSIXLY_CORRECT: Invoking m4. (line 10) +* preprocessor features: Preprocessor features. + (line 6) +* printing error messages: Errprint. (line 6) +* quadratic behavior, avoiding: Improved foreach. (line 37) +* quote delimiters, changing: Changequote. (line 6) +* quoted macro arguments: Quoting Arguments. (line 6) +* quoted string: Quoted strings. (line 6) +* quoting rule of thumb: Quoting Arguments. (line 22) +* recursive macros: Shift. (line 6) +* redefinition of macros, temporary: Pushdef. (line 6) +* regular expressions <1>: Regexp. (line 6) +* regular expressions <2>: Patsubst. (line 6) +* regular expressions: Changeword. (line 6) +* reloading a frozen file: Using frozen files. (line 6) +* renaming macros: Defn. (line 6) +* reporting bugs: Bugs. (line 6) +* rescanning <1>: Other Incompatibilities. + (line 33) +* rescanning <2>: Pseudo Arguments. (line 106) +* rescanning <3>: Inhibiting Invocation. + (line 76) +* rescanning <4>: Limits control. (line 40) +* rescanning: Defn. (line 59) +* rule of thumb, quoting: Quoting Arguments. (line 22) +* running shell commands: Shell commands. (line 6) +* saving debugging output: Debug Output. (line 6) +* saving input: M4wrap. (line 6) +* search path for included files: Search Path. (line 6) +* shell commands, exit status from: Sysval. (line 6) +* shell commands, running: Shell commands. (line 6) +* special arguments to macros: Pseudo Arguments. (line 6) +* stack, macro definition: Pushdef. (line 6) +* standard error, output to <1>: Dumpdef. (line 6) +* standard error, output to <2>: Errprint. (line 6) +* standard error, output to: Trace. (line 6) +* status of shell commands: Sysval. (line 6) +* status, setting m4 exit: M4exit. (line 6) +* string, quoted: Quoted strings. (line 6) +* strings, length of: Len. (line 6) +* substitution by regular expression: Patsubst. (line 6) +* substrings, extracting: Substr. (line 6) +* substrings, locating: Index macro. (line 6) +* suggestions, reporting: Bugs. (line 6) +* suppressing warnings: Macro Arguments. (line 38) +* switch statement: Ifelse. (line 66) +* synchronization lines: Preprocessor features. + (line 28) +* syntax, changing: Changeword. (line 6) +* temporary file names: Mkstemp. (line 6) +* temporary redefinition of macros: Pushdef. (line 6) +* TMPDIR: Diversions. (line 10) +* tokens: Syntax. (line 6) +* tokens, builtin macro: Defn. (line 79) +* tokens, special: Other tokens. (line 6) +* tracing macro expansion: Trace. (line 6) +* translating characters: Translit. (line 6) +* undefining macros: Undefine. (line 6) +* UNIX commands, exit status from: Sysval. (line 6) +* UNIX commands, running: Shell commands. (line 6) +* variables, local: Pushdef. (line 79) +* warnings, suppressing: Macro Arguments. (line 38) +* words: Names. (line 6) +* words, lexical structure of: Changeword. (line 6)  Tag Table: -Node: Top840 -Node: Preliminaries9196 -Node: Intro9882 -Node: History11514 -Node: Bugs14146 -Node: Manual15408 -Node: Invoking m418340 -Node: Operation modes20488 -Node: Preprocessor features22199 -Node: Limits control24701 -Node: Frozen state27637 -Node: Debugging options28436 -Node: Command line files30175 -Node: Syntax31538 -Node: Names32539 -Node: Quoted strings33001 -Node: Comments33650 -Node: Other tokens34517 -Node: Input processing35095 -Node: Macros36982 -Node: Invocation37476 -Node: Inhibiting Invocation38277 -Node: Macro Arguments41848 -Node: Quoting Arguments44539 -Node: Macro expansion45861 -Node: Definitions46529 -Node: Define47314 -Node: Arguments49520 -Node: Pseudo Arguments51268 -Node: Undefine54483 -Node: Defn55613 -Node: Pushdef58346 -Node: Indir60680 -Node: Builtin62782 -Node: Conditionals64544 -Node: Ifdef65363 -Node: Ifelse66226 -Node: Shift69445 -Node: Forloop73244 -Node: Foreach75813 -Node: Debugging80792 -Node: Dumpdef81377 -Node: Trace82761 -Node: Debug Levels85449 -Node: Debug Output88255 -Node: Input Control89526 -Node: Dnl90063 -Node: Changequote91964 -Node: Changecom96760 -Node: Changeword100276 -Node: M4wrap105717 -Node: File Inclusion107978 -Node: Include108295 -Node: Search Path110895 -Node: Diversions111812 -Node: Divert113603 -Node: Undivert116129 -Node: Divnum119011 -Node: Cleardivert119475 -Node: Text handling120680 -Node: Len121403 -Node: Index macro121788 -Node: Regexp122559 -Node: Substr124808 -Node: Translit125859 -Node: Patsubst128581 -Node: Format132121 -Node: Arithmetic134188 -Node: Incr134637 -Node: Eval135412 -Node: Shell commands139821 -Node: Platform macros140743 -Node: Syscmd142487 -Node: Esyscmd144292 -Node: Sysval145340 -Node: Mkstemp146895 -Node: Miscellaneous150197 -Node: Errprint150630 -Node: Location151849 -Node: M4exit154651 -Node: Frozen files156738 -Node: Using frozen files157519 -Node: Frozen file format160759 -Node: Compatibility163822 -Node: Extensions164437 -Node: Incompatibilities168204 -Node: Other Incompatibilities176116 -Node: Answers178044 -Node: Improved exch178661 -Node: Improved forloop179199 -Node: Improved foreach181035 -Node: Improved cleardivert187974 -Node: Improved fatal_error188957 -Node: Copying This Manual190019 -Node: GNU Free Documentation License190275 -Node: Indices212669 -Node: Concept index212949 -Node: Macro index224692 +Node: Top843 +Node: Preliminaries9202 +Node: Intro9888 +Node: History11520 +Node: Bugs14233 +Node: Manual15484 +Node: Invoking m418470 +Node: Operation modes20618 +Node: Preprocessor features23590 +Node: Limits control26054 +Node: Frozen state28990 +Node: Debugging options29789 +Node: Command line files31528 +Node: Syntax32891 +Node: Names34000 +Node: Quoted strings34462 +Node: Comments35111 +Node: Other tokens35978 +Node: Input processing36556 +Ref: Input processing-Footnote-144229 +Node: Macros44424 +Node: Invocation44918 +Node: Inhibiting Invocation45719 +Node: Macro Arguments49668 +Node: Quoting Arguments52360 +Node: Macro expansion54483 +Node: Definitions55151 +Node: Define55936 +Node: Arguments58374 +Node: Pseudo Arguments62046 +Node: Undefine65588 +Node: Defn66718 +Node: Pushdef69451 +Node: Indir72077 +Node: Builtin74179 +Node: Conditionals75941 +Node: Ifdef76760 +Node: Ifelse77623 +Node: Shift80836 +Node: Forloop85291 +Node: Foreach87860 +Node: Debugging92839 +Node: Dumpdef93424 +Node: Trace94808 +Node: Debug Levels97511 +Node: Debug Output100971 +Node: Input Control102242 +Node: Dnl102779 +Node: Changequote104680 +Node: Changecom109476 +Node: Changeword112992 +Node: M4wrap118433 +Node: File Inclusion120694 +Node: Include121011 +Node: Search Path123611 +Node: Diversions124528 +Node: Divert126319 +Node: Undivert128845 +Node: Divnum131727 +Node: Cleardivert132191 +Node: Text handling133396 +Node: Len134119 +Node: Index macro134504 +Node: Regexp135275 +Node: Substr137695 +Node: Translit138746 +Node: Patsubst141468 +Node: Format145009 +Node: Arithmetic147108 +Node: Incr147557 +Node: Eval148332 +Node: Shell commands156199 +Node: Platform macros157121 +Node: Syscmd158865 +Node: Esyscmd160670 +Node: Sysval161718 +Node: Mkstemp163336 +Node: Miscellaneous166733 +Node: Errprint167166 +Node: Location168385 +Node: M4exit171187 +Node: Frozen files173274 +Node: Using frozen files174055 +Node: Frozen file format177295 +Node: Compatibility180358 +Node: Extensions180973 +Node: Incompatibilities184795 +Node: Other Incompatibilities193002 +Node: Answers194985 +Node: Improved exch195602 +Node: Improved forloop196140 +Node: Improved foreach197976 +Node: Improved cleardivert204915 +Node: Improved fatal_error205898 +Node: Copying This Manual206960 +Node: GNU Free Documentation License207216 +Node: Indices229610 +Node: Macro index229890 +Node: Concept index235324  End Tag Table diff -ruNp m4-1.4.8/doc/m4.texinfo m4-1.4.9/doc/m4.texinfo --- m4-1.4.8/doc/m4.texinfo 2006-11-20 06:55:43.000000000 -0700 +++ m4-1.4.9/doc/m4.texinfo 2007-03-23 06:40:02.000000000 -0600 @@ -2,15 +2,14 @@ @comment ======================================================== @comment %**start of header @setfilename m4.info -@settitle GNU M4 macro processor +@include version.texi +@settitle GNU M4 @value{VERSION} macro processor @setchapternewpage odd @ifnothtml @setcontentsaftertitlepage @end ifnothtml @finalout -@include version.texi - @c @tabchar{} @c ---------- @c The testsuite expects literal tab output in some examples, but @@ -44,7 +43,7 @@ This manual is for @acronym{GNU} M4 (ver a package containing an implementation of the m4 macro language. Copyright @copyright{} 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, -2006 Free Software Foundation, Inc. +2006, 2007 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -65,7 +64,9 @@ entitled ``@acronym{GNU} Free Documentat @title GNU M4, version @value{VERSION} @subtitle A powerful macro processor @subtitle Edition @value{EDITION}, @value{UPDATED} -@author by Ren@'e Seindal +@author by Ren@'e Seindal, Fran@,{c}ois Pinard, +@author Gary V. Vaughan, and Eric Blake +@author (@email{bug-m4@@gnu.org}) @page @vskip 0pt plus 1filll @@ -275,8 +276,8 @@ How to make copies of this manual Indices of concepts and macros -* Concept index:: Index for many concepts * Macro index:: Index for all @code{m4} macros +* Concept index:: Index for many concepts @end detailmenu @end menu @@ -302,6 +303,7 @@ language. @node Intro @section Introduction to @code{m4} +@cindex overview of @code{m4} @code{m4} is a macro processor, in the sense that it copies its input to the output, expanding macros as it goes. Macros are either builtin or user-defined, and can take any number of arguments. @@ -333,6 +335,8 @@ debugging their @code{m4} scripts than d @node History @section Historical references +@cindex history of @code{m4} +@cindex @acronym{GNU} M4, history of @code{GPM} was an important ancestor of @code{m4}. See C. Stratchey: ``A General Purpose Macro generator'', Computer Journal 8,3 (1965), pp. 225 ff. @code{GPM} is also succinctly described into @@ -355,7 +359,7 @@ more constructs are builtin instead of d Originally, the Kernighan and Plauger macro-processor, and then @code{m3}, formed the engine for the Rational FORTRAN preprocessor, that is, the @code{Ratfor} equivalent of @code{cpp}. Later, @code{m4} -was used as a frontend for @code{Ratfor}, @code{C} and @code{Cobol}. +was used as a front-end for @code{Ratfor}, @code{C} and @code{Cobol}. Ren@'e Seindal released his implementation of @code{m4}, @acronym{GNU} @code{m4}, @@ -376,11 +380,13 @@ engine, since all other implementations limitations. More recently, in 2004, Paul Eggert released 1.4.1 and 1.4.2 which -addressed some long standing bugs in the venerable 1.4 release. -Then in 2005 Gary V. Vaughan collected together the many -patches to @acronym{GNU} @code{m4} 1.4 that were floating around the net and +addressed some long standing bugs in the venerable 1.4 release. Then in +2005, Gary V. Vaughan collected together the many patches to +@acronym{GNU} @code{m4} 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. +prepared patches for the release of 1.4.5, 1.4.6, 1.4.7, and 1.4.8. The +1.4.x series remains open for bug fixes, including release 1.4.9 in +2007. Meanwhile, development has continued on new features for @code{m4}, such as dynamic module loading and additional builtins. When complete, @@ -389,6 +395,9 @@ as dynamic module loading and additional @node Bugs @section Problems and bugs +@cindex reporting bugs +@cindex bug reports +@cindex suggestions, reporting If you have problems with @acronym{GNU} M4 or think you've found a bug, please report it. Before reporting a bug, make sure you've actually found a real bug. Carefully reread the documentation and see if it @@ -402,7 +411,7 @@ send us the input file and the exact res say what you expected to occur; this will help us decide whether the problem was really in the documentation. -Once you've got a precise problem, send e-mail to (Internet) +Once you've got a precise problem, send e-mail to @email{bug-m4@@gnu.org}. Please include the version number of @code{m4} you are using. You can get this information with the command @kbd{m4 --version}. Also provide details about the platform you are @@ -415,6 +424,7 @@ features, please report them too. @node Manual @section Using this manual +@cindex examples, understanding This manual contains a number of examples of @code{m4} input and output, and a simple notation is used to distinguish input, output and error messages from @code{m4}. Examples are set out from the normal text, and @@ -436,7 +446,8 @@ Example of input line @error{}and an error message @end example -The sequence @samp{^D} in an example indicates the end of the input file. +The sequence @samp{^D} in an example indicates the end of the input +file. The sequence @samp{@key{NL}} refers to the newline character. The majority of these examples are self-contained, and you can run them with similar results by invoking @kbd{m4 -d}. In fact, the testsuite that is bundled in the @acronym{GNU} M4 package consists of the examples @@ -466,6 +477,7 @@ would explicitly pass the empty string f after @var{argument}, rather than ignoring them. @end deffn +@cindex numbers All macro arguments in @code{m4} are strings, but some are given special interpretation, e.g., as numbers, file names, regular expressions, etc. The documentation for each macro will state how the @@ -483,6 +495,8 @@ primitive is spelled within @code{m4}. @node Invoking m4 @chapter Invoking @code{m4} +@cindex command line +@cindex invoking @code{m4} The format of the @code{m4} command is: @comment ignore @@ -549,8 +563,16 @@ performing any other actions. @item -E @itemx --fatal-warnings -Stop execution and exit @code{m4} once the first warning has been -issued, considering all of them to be fatal. +@cindex errors, fatal +@cindex fatal errors +Controls the effect of warnings. If unspecified, then execution +continues and exit status is unaffected when a warning is printed. If +specified exactly once, warnings become fatal; when one is issued, +execution continues, but the exit status will be non-zero. If specified +multiple times, then execution halts with non-zero status the first time +a warning is issued. The introduction of behavior levels is new to M4 +1.4.9; for behavior consistent with earlier versions, you should specify +@option{-E} twice. @item -i @itemx --interactive @@ -575,6 +597,20 @@ 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 +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 +@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 +to a change in how more than 9 arguments in a macro definition will be +handled, @pxref{Arguments}). Providing an alternate regular +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 @@ -587,6 +623,7 @@ implementations (@pxref{Changeword}). @cindex macro definitions, on the command line @cindex command line, macro definitions on the +@cindex preprocessor features Several options allow @code{m4} to behave more like a preprocessor. Macro definitions and deletions can be made on the command line, the search path can be altered, and the output file can track where the @@ -595,13 +632,12 @@ input came from. These features occur w @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, before any input files are -read. 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. +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. @item -I @var{DIRECTORY} @itemx --include=@var{DIRECTORY} @@ -611,6 +647,9 @@ details. This option may be given more @item -s @itemx --synclines +@cindex synchronization lines +@cindex location, input +@cindex input location Generate synchronization lines, for use by the C preprocessor or other similar tools. Order is significant with respect to file names. This option is useful, for example, when @code{m4} is used as a @@ -660,6 +699,8 @@ increase this value, unless you define a @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, stopping program execution if this limit is ever exceeded. When not specified, nesting is limited to 1024 levels. A value of zero means @@ -672,6 +713,7 @@ when some complex @code{m4} input was ge Most users would never need this option. If shown to be obtrusive, this option (which is still experimental) might well disappear. +@cindex rescanning This option does @emph{not} have the ability to break endless rescanning loops, since these do not necessarily consume much memory or stack space. Through clever usage of rescanning loops, one can @@ -803,7 +845,9 @@ token is either a name, a quoted string, is not a part of either a name or a string. Input to @code{m4} can also contain comments. @acronym{GNU} @code{m4} does not yet understand locales; all operations are byte-oriented rather than -character-oriented. However, @code{m4} is eight-bit clean, so you can +character-oriented (although if your locale uses a single byte +encoding, such as @sc{ISO-8859-1}, you will not notice a difference). +However, @code{m4} is eight-bit clean, so you can use non-@sc{ascii} characters in quoted strings (@pxref{Changequote}), comments (@pxref{Changecom}), and macro names (@pxref{Indir}), with the exception of the @sc{nul} character (the zero byte @samp{'\0'}). @@ -820,6 +864,7 @@ exception of the @sc{nul} character (the @section Macro names @cindex names +@cindex words A name is any sequence of letters, digits, and the character @samp{_} (underscore), where the first character is not a digit. @code{m4} will use the longest such sequence found in the input. If a name has a @@ -832,6 +877,7 @@ Examples of legal names are: @samp{foo}, @section Quoting input to @code{m4} @cindex quoted string +@cindex string, quoted A quoted string is a sequence of characters surrounded by quote strings, defaulting to @samp{`} and @samp{'}, where the nested begin and end quotes within the @@ -883,6 +929,7 @@ information. @node Other tokens @section Other kinds of input tokens +@cindex tokens, special Any character, that is neither a part of a name, nor of a quoted string, nor a comment, is a token by itself. When not in the context of macro expansion, all of these tokens are just copied to output. However, @@ -904,9 +951,11 @@ of the remaining input. In other words, call will be read and parsed into tokens again. @code{m4} expands a macro as soon as possible. If it finds a macro call -when collecting the arguments to another, it will expand the second -call first. For a running example, examine how @code{m4} handles this -input: +when collecting the arguments to another, it will expand the second call +first. This process continues until there are no more macro calls to +expand and all the input has been consumed. + +For a running example, examine how @code{m4} handles this input: @comment ignore @example @@ -941,11 +990,134 @@ round of scanning for the tokens @samp{R @result{}Result is 32768 @end example -The order in which @code{m4} expands the macros can be explored using -the trace facilities of @acronym{GNU} @code{m4} (@pxref{Trace}). +As a more complicated example, we will contrast an actual code +example from the Gnulib project@footnote{Derived from a patch in +@uref{http://lists.gnu.org/archive/html/bug-gnulib/@/2007-01/@/msg00389.html}, +and a followup patch in +@uref{http://lists.gnu.org/archive/html/bug-gnulib/@/2007-02/@/msg00000.html}}, +showing both a buggy approach and the desired results. The user desires +to output a shell assignment statement that takes its argument and turns +it into a shell variable by converting it to uppercase and prepending a +prefix. The original attempt looks like this: + +@example +changequote([,])dnl +define([gl_STRING_MODULE_INDICATOR], + [ + dnl comment + GNULIB_]translit([$1],[a-z],[A-Z])[=1 + ])dnl + gl_STRING_MODULE_INDICATOR([strcase]) +@result{} @w{ } +@result{} GNULIB_strcase=1 +@result{} @w{ } +@end example + +Oops -- the argument did not get capitalized. And although the manual +is not able to easily show it, both lines that appear empty actually +contain two trailing spaces. By stepping through the parse, it is easy +to see what happened. First, @code{m4} sees the token +@samp{changequote}, which it recognizes as a macro, followed by +@samp{(}, @samp{[}, @samp{,}, @samp{]}, and @samp{)} to form the +argument list. The macro expands to the empty string, but changes the +quoting characters to something more useful for generating shell code +(unbalanced @samp{`} and @samp{'} appear all the time in shell scripts, +but unbalanced @samp{[]} tend to be rare). Also in the first line, +@code{m4} sees the token @samp{dnl}, which it recognizes as a builtin +macro that consumes the rest of the line, resulting in no output for +that line. + +The second line starts a macro definition. @code{m4} sees the token +@samp{define}, which it recognizes as a macro, followed by a @samp{(}, +@samp{[gl_STRING_MODULE_INDICATOR]}, and @samp{,}. Because an unquoted +comma was encountered, the first argument is known to be the expansion +of the single-quoted string token, or @samp{gl_STRING_MODULE_INDICATOR}. +Next, @code{m4} sees @samp{@key{NL}}, @samp{ }, and @samp{ }, but this +whitespace is discarded as part of argument collection. Then comes a +rather lengthy single-quoted string token, @samp{[@key{NL}@ @ @ @ dnl +comment@key{NL}@ @ @ @ GNULIB_]}. This is followed by the token +@samp{translit}, which @code{m4} recognizes as a macro name, so a nested +macro expansion has started. + +The arguments to the @code{translit} are found by the tokens @samp{(}, +@samp{[$1]}, @samp{,}, @samp{[a-z]}, @samp{,}, @samp{[A-Z]}, and finally +@samp{)}. All three string arguments are expanded (or in other words, +the quotes are stripped), and since neither @samp{$} nor @samp{1} need +capitalization, the result of the macro is @samp{$1}. This expansion is +rescanned, resulting in the two literal characters @samp{$} and +@samp{1}. + +Scanning of the outer macro resumes, and picks up with +@samp{[=1@key{NL}@ @ ]}, and finally @samp{)}. The collected pieces of +expanded text are concatenated, with the end result that the macro +@samp{gl_STRING_MODULE_INDICATOR} is now defined to be the sequence +@samp{@key{NL}@ @ @ @ dnl comment@key{NL}@ @ @ @ GNULIB_$1=1@key{NL}@ @ }. +Once again, @samp{dnl} is recognized and avoids a newline in the output. + +The final line is then parsed, beginning with @samp{ } and @samp{ } +that are output literally. Then @samp{gl_STRING_MODULE_INDICATOR} is +recognized as a macro name, with an argument list of @samp{(}, +@samp{[strcase]}, and @samp{)}. Since the definition of the macro +contains the sequence @samp{$1}, that sequence is replaced with the +argument @samp{strcase} prior to starting the rescan. The rescan sees +@samp{@key{NL}} and four spaces, which are output literally, then +@samp{dnl}, which discards the text @samp{ comment@key{NL}}. Next +comes four more spaces, also output literally, and the token +@samp{GNULIB_strcase}, which resulted from the earlier parameter +substitution. Since that is not a macro name, it is output literally, +followed by the literal tokens @samp{=}, @samp{1}, @samp{@key{NL}}, and +two more spaces. Finally, the original @samp{@key{NL}} seen after the +macro invocation is scanned and output literally. + +Now for a corrected approach. This rearranges the use of newlines and +whitespace so that less whitespace is output (which, although harmless +to shell scripts, can be visually unappealing), and fixes the quoting +issues so that the capitalization occurs when the macro +@samp{gl_STRING_MODULE_INDICATOR} is invoked, rather then when it is +defined. + +@example +changequote([,])dnl +define([gl_STRING_MODULE_INDICATOR], + [dnl comment + GNULIB_[]translit([$1], [a-z], [A-Z])=1dnl +])dnl + gl_STRING_MODULE_INDICATOR([strcase]) +@result{} GNULIB_STRCASE=1 +@end example + +The parsing of the first line is unchanged. The second line sees the +name of the macro to define, then sees the discarded @samp{@key{NL}} +and two spaces, as before. But this time, the next token is +@samp{[dnl comment@key{NL}@ @ GNULIB_[]translit([$1], [a-z], +[A-Z])=1dnl@key{NL}]}, which includes nested quotes, followed by +@samp{)} to end the macro definition and @samp{dnl} to skip the +newline. No early expansion of @code{translit} occurs, so the entire +string becomes the definition of the macro. + +The final line is then parsed, beginning with two spaces that are +output literally, and an invocation of +@code{gl_STRING_MODULE_INDICATOR} with the argument @samp{strcase}. +Again, the @samp{$1} in the macro definition is substituted prior to +rescanning. Rescanning first encounters @samp{dnl}, and discards +@samp{ comment@key{NL}}. Then two spaces are output literally. Next +comes the token @samp{GNULIB_}, but that is not a macro, so it is +output literally. The token @samp{[]} is an empty string, so it does +not affect output. Then the token @samp{translit} is encountered. + +This time, the arguments to @code{translit} are parsed as @samp{(}, +@samp{[strcase]}, @samp{,}, @samp{ }, @samp{[a-z]}, @samp{,}, @samp{ }, +@samp{[A-Z]}, and @samp{)}. The two spaces are discarded, and the +translit results in the desired result @samp{STRCASE}. This is +rescanned, but since it is not a macro name, it is output literally. +Then the scanner sees @samp{=} and @samp{1}, which are output +literally, followed by @samp{dnl} which discards the rest of the +definition of @code{gl_STRING_MODULE_INDICATOR}. The newline at the +end of output is the literal @samp{@key{NL}} that appeared after the +invocation of the macro. -This process continues until there are no more macro calls to expand and -all the input has been consumed. +The order in which @code{m4} expands the macros can be further explored +using the trace facilities of @acronym{GNU} @code{m4} (@pxref{Trace}). @node Macros @chapter How to invoke macros @@ -965,6 +1137,7 @@ expansion is treated. @section Macro invocation @cindex macro invocation +@cindex invoking macros Macro invocations has one of the forms @comment ignore @@ -1012,13 +1185,28 @@ sometimes be the source of spurious, unw @code{m4} offers several mechanisms or techniques for inhibiting the recognition of names as macro calls. -First of all, many builtin macros cannot meaningfully be called -without arguments. For any of these macros, whenever an opening -parenthesis does not immediately follow their name, the builtin macro -call is not triggered. This solves the most usual cases, like for -@samp{include} or @samp{eval}. Later in this document, the sentence -``This macro is recognized only with parameters'' refers to this -specific provision. +@cindex @acronym{GNU} extensions +@cindex blind macro +@cindex macro, blind +First of all, many builtin macros cannot meaningfully be called without +arguments. As a @acronym{GNU} extension, for any of these macros, +whenever an opening parenthesis does not immediately follow their name, +the builtin macro call is not triggered. This solves the most usual +cases, like for @samp{include} or @samp{eval}. Later in this document, +the sentence ``This macro is recognized only with parameters'' refers to +this specific provision of @acronym{GNU} M4, also known as a blind +builtin macro. For the builtins defined by @acronym{POSIX} that bear +this disclaimer, @acronym{POSIX} specifically states that invoking those +builtins without arguments is unspecified, because many other +implementations simply invoke the builtin as though it were given one +empty argument instead. + +@example +eval +@result{}eval +eval(`1') +@result{}1 +@end example There is also a command line option (@option{--prefix-builtins}, or @option{-P}, @pxref{Operation modes, , Invoking m4}) that renames all @@ -1071,6 +1259,7 @@ divert`' the @code{divert} builtin macro will be called, which expands to the empty string. +@cindex rescanning The output of macro evaluations is always rescanned. The following example would yield the string @samp{de}, exactly as if @code{m4} has been given @w{@samp{substr(`abcde', `3', `2')}} as input: @@ -1128,7 +1317,7 @@ However, some builtins are documented to missing optional argument than for an explicit empty string. If there are too many arguments, the excess arguments are ignored. Unquoted leading whitespace is stripped off all arguments, but whitespace -generated by a macro expansion or occuring after a macro that expanded +generated by a macro expansion or occurring after a macro that expanded to an empty string remains intact. Whitespace includes space, tab, newline, carriage return, vertical tab, and formfeed. @@ -1152,6 +1341,8 @@ macro(`unquoted trailing whitespace kept @result{} @end example +@cindex warnings, suppressing +@cindex suppressing warnings Normally @code{m4} will issue warnings if a builtin macro is called with an inappropriate number of arguments, but it can be suppressed with the @option{--quiet} command line option (or @option{--silent}, or @@ -1189,6 +1380,7 @@ f It is an error if the end of file occurs while collecting arguments. +@comment status: 1 @example hello world @result{}hello world @@ -1227,14 +1419,39 @@ example with the parentheses, the `right foo(`() (() (') @end example -It is, however, in certain cases necessary or convenient to leave out -quotes for some arguments, and there is nothing wrong in doing it. It -just makes life a bit harder, if you are not careful. For consistency, -this manual follows the rule of thumb that each layer of parentheses -introduces another layer of single quoting, except when showing the -consequences of quoting rules. This is done even when the quoted string -cannot be a macro, such as with integers when you have not changed the -syntax via @code{changeword} (@pxref{Changeword}). +@cindex quoting rule of thumb +@cindex rule of thumb, quoting +It is, however, in certain cases necessary (because nested expansion +must occur to create the arguments for the outer macro) or convenient +(because it uses fewer characters) to leave out quotes for some +arguments, and there is nothing wrong in doing it. It just makes life a +bit harder, if you are not careful to follow a consistent quoting style. +For consistency, this manual follows the rule of thumb that each layer +of parentheses introduces another layer of single quoting, except when +showing the consequences of quoting rules. This is done even when the +quoted string cannot be a macro, such as with integers when you have not +changed the syntax via @code{changeword} (@pxref{Changeword}). + +The quoting rule of thumb of one level of quoting per parentheses has a +nice property: when a macro name appears inside parentheses, you can +determine when it will be expanded. If it is not quoted, it will be +expanded prior to the outer macro, so that its expansion becomes the +argument. If it is single-quoted, it will be expanded after the outer +macro. And if it is double-quoted, it will be used as literal text +instead of a macro name. + +@example +define(`active', `ACT, IVE') +@result{} +define(`show', `$1 $1') +@result{} +show(active) +@result{}ACT ACT +show(`active') +@result{}ACT, IVE ACT, IVE +show(``active'') +@result{}active active +@end example @node Macro expansion @section Macro expansion @@ -1334,11 +1551,19 @@ As a @acronym{GNU} extension, the first not have to be a simple word. It can be any text string, even the empty string. A macro with a non-standard name cannot be invoked in the normal way, as the name is -not recognized. It can only be referenced by the builtins @code{Indir} -(@pxref{Indir}) and @code{Defn} (@pxref{Defn}). +not recognized. It can only be referenced by the builtins @code{indir} +(@pxref{Indir}) and @code{defn} (@pxref{Defn}). @cindex arrays -Arrays and associative arrays can be simulated by using this trick. +Arrays and associative arrays can be simulated by using non-standard +macro names. + +@deffn Composite array (@var{index}) +@deffnx Composite array_set (@var{index}, @ovar{value}) +Provide access to entries within an array. @code{array} reads the entry +at location @var{index}, and @code{array_set} assigns @var{value} to +location @var{index}. +@end deffn @example define(`array', `defn(format(``array[%d]'', `$1'))') @@ -1355,19 +1580,24 @@ array(eval(`10 + 7')) @result{}array element no. 17 @end example -Change the @code{%d} to @code{%s} and it is an associative array. +Change the @samp{%d} to @samp{%s} and it is an associative array. @node Arguments @section Arguments to macros @cindex macros, arguments to -@cindex Arguments to macros +@cindex arguments to macros Macros can have arguments. The @var{n}th argument is denoted by @code{$n} in the expansion text, and is replaced by the @var{n}th actual argument, when the macro is expanded. Replacement of arguments happens before rescanning, regardless of how many nesting levels of quoting appear in the expansion. Here is an example of a macro with -two arguments. It simply exchanges the order of the two arguments. +two arguments. + +@deffn Composite exch (@var{arg1}, @var{arg2}) +Expands to @var{arg2} followed by @var{arg1}, effectively exchanging +their order. +@end deffn @example define(`exch', `$2, $1') @@ -1392,13 +1622,6 @@ macro (You should try and improve this example so that clients of @code{exch} do not have to double quote; or @pxref{Improved exch, , Answers}). -@cindex @acronym{GNU} extensions -@acronym{GNU} @code{m4} allows the number following the @samp{$} to -consist of one -or more digits, allowing macros to have any number of arguments. This -is not so in UNIX implementations of @code{m4}, which only recognize -one digit. - As a special case, the zeroth argument, @code{$0}, is always the name of the macro being expanded. @@ -1423,6 +1646,62 @@ foo The @samp{foo} in the expansion text is @emph{not} expanded, since it is a quoted string, and not a name. +@cindex @acronym{GNU} extensions +@cindex nine arguments, more than +@cindex more than nine arguments +@cindex arguments, more than nine +@cindex positional parameters, more than nine +@acronym{GNU} @code{m4} allows the number following the @samp{$} to +consist of one or more digits, allowing macros to have any number of +arguments. The extension of accepting multiple digits is incompatible +with @acronym{POSIX}, and is different than traditional implementations +of @code{m4}, which only recognize one digit. Therefore, future +versions of @acronym{GNU} M4 will phase out this feature. To portably +access beyond the ninth argument, you can use the @code{argn} macro +documented later (@pxref{Shift}). + +@acronym{POSIX} also states that @samp{$} followed immediately by +@samp{@{} in a macro definition is implementation-defined. This version +of M4 passes the literal characters @samp{$@{} through unchanged, but M4 +2.0 will implement an optional feature similar to @command{sh}, where +@samp{$@{11@}} expands to the eleventh argument, to replace the current +recognition of @samp{$11}. Meanwhile, if you want to guarantee that you +will get a literal @samp{$@{} in output when expanding a macro, even +when you upgrade to M4 2.0, you can use nested quoting to your +advantage: + +@example +define(`foo', `single quoted $`'@{1@} output') +@result{} +define(`bar', ``double quoted $'`@{2@} output'') +@result{} +foo(`a', `b') +@result{}single quoted $@{1@} output +bar(`a', `b') +@result{}double quoted $@{2@} output +@end example + +To help you detect places in your M4 input files that might change in +behavior due to the changed behavior of M4 2.0, you can use the +@option{--warn-macro-sequence} command-line option (@pxref{Operation +modes, , Invoking m4}) with the default regular expression. This will +add a warning any time a macro definition includes @samp{$} followed by +multiple digits, or by @samp{@{}. The warning is not enabled by +default, because it triggers a number of warnings in Autoconf 2.61 (and +Autoconf uses @option{-E} to treat warnings as errors), and because it +will still be possible to restore older behavior in M4 2.0. + +@comment ignore +@example +$ @kbd{m4 --warn-macro-sequence} +define(`foo', `$001 $@{1@} $1') +@error{}m4:stdin:1: Warning: definition of `foo' contains sequence `$001' +@error{}m4:stdin:1: Warning: definition of `foo' contains sequence `$@{1@}' +@result{} +foo(`bar') +@result{}bar $@{1@} bar +@end example + @node Pseudo Arguments @section Special arguments to macros @@ -1433,8 +1712,11 @@ There is a special notation for the numb and for all the actual arguments. The number of actual arguments in a macro call is denoted by @code{$#} -in the expansion text. Thus, a macro to display the number of arguments -given can be +in the expansion text. + +@deffn Composite nargs (@dots{}) +Expands to a count of the number of arguments supplied. +@end deffn @example define(`nargs', `$#') @@ -1454,6 +1736,20 @@ nargs((unquoted parentheses, like this, @result{}1 @end example +Remember that @samp{#} defaults to the comment character; if you forget +quotes to inhibit the comment behavior, your macro definition may not +end where you expected. + +@example +dnl Attempt to define a macro to just `$#' +define(underquoted, $#) +oops) +@result{} +underquoted +@result{}0) +@result{}oops +@end example + The notation @code{$*} can be used in the expansion text to denote all the actual arguments, unquoted, with commas in between. For example @@ -1528,6 +1824,9 @@ foo @result{}$$$ hello $$$ @end example +@cindex rescanning +@cindex literal output +@cindex output, literal If you want a macro to expand to something like @samp{$12}, the judicious use of nested quoting can put a safe character between the @code{$} and the next character, relying on the rescanning to remove the @@ -1610,6 +1909,8 @@ case, @code{undefine} does nothing. @cindex macros, how to rename @cindex renaming macros +@cindex macros, displaying definitions +@cindex definitions, displaying macro It is possible to rename an already defined macro. To do this, you need the builtin @code{defn}: @@ -1670,6 +1971,7 @@ defn(`string') @result{} @end example +@cindex rescanning However, it is important to remember that @code{m4} rescanning is purely textual. If an unbalanced end-quote string occurs in a macro definition, the rescan will see that embedded quote as the termination @@ -1692,6 +1994,8 @@ echo(foo) @result{}AA' @end example +@cindex builtins, special tokens +@cindex tokens, builtin macro Using @code{defn} to generate special tokens for builtin macros outside of expected contexts can sometimes trigger warnings. But most of the time, such tokens are silently converted to the empty string. @@ -1712,6 +2016,8 @@ divnum @cindex macros, temporary redefinition of @cindex temporary redefinition of macros @cindex redefinition of macros, temporary +@cindex definition 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 @code{pushdef} and @code{popdef}: @@ -1765,7 +2071,12 @@ foo If a macro with several definitions is redefined with @code{define}, the topmost definition is @emph{replaced} with the new definition. If it is removed with @code{undefine}, @emph{all} the definitions are removed, -and not only the topmost one. +and not only the topmost one. However, @acronym{POSIX} allows other +implementations that treat @code{define} as replacing an entire stack +of definitions with a single new definition, so to be portable to other +implementations, it may be worth explicitly using @code{popdef} and +@code{pushdef} rather than relying on the @acronym{GNU} behavior of +@code{define}. @example define(`foo', `Expansion one.') @@ -1989,6 +2300,8 @@ ifdef(`no_such_macro', `yes', `no', `ext @section If-else construct, or multibranch @cindex comparing strings +@cindex discarding input +@cindex input, discarding The other conditional, @code{ifelse}, is much more powerful. It can be used as a way to introduce a long comment, as an if-else construct, or as a multibranch, depending on the number of arguments supplied: @@ -2042,10 +2355,12 @@ ifelse(foo, `foo', `true', `false') @result{}false @end example +@cindex macro, blind +@cindex blind macro Notice how the first argument was used unquoted; it is common to compare the expansion of a macro with a string. With this macro, you can now -reproduce the behavior of many of the builtins, where the macro is -recognized only with arguments. +reproduce the behavior of blind builtins, where the macro is recognized +only with arguments. @example define(`foo', `ifelse(`$#', `0', ``$0'', `arguments:$#')') @@ -2059,6 +2374,8 @@ foo(`a', `b', `c') @end example @cindex multibranches +@cindex switch statement +@cindex case statement However, @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 @@ -2180,7 +2497,7 @@ results in one string, while @code{dquot examine the implementation. Note that @code{quote} and @code{dquote_elt} make decisions based on their number of arguments, so that when called without arguments, they result in nothing instead of a -quoted empty string; this is so that it is possible to distinquish +quoted empty string; this is so that it is possible to distinguish between no arguments and an empty first argument. @code{dquote}, on the other hand, results in a string no matter what, since it is still possible to tell whether it was invoked without arguments based on the @@ -2199,6 +2516,34 @@ undivert(`quote.m4')dnl @result{}divert`'dnl @end example +@cindex nine arguments, more than +@cindex more than nine arguments +@cindex arguments, more than nine +One more useful macro based on @code{shift} allows portably selecting +an arbitrary argument (usually greater than the ninth argument), without +relying on the @acronym{GNU} extension of multi-digit arguments +(@pxref{Arguments}). + +@deffn Composite argn (@var{n}, @dots{}) +Expands to argument @var{n} out of the remaining arguments. @var{n} +must be a positive number. Usually invoked as +@samp{argn(`@var{n}',$@@)}. +@end deffn + +It is implemented as: + +@example +define(`argn', `ifelse(`$1', 1, ``$2'', + `argn(decr(`$1'), shift(shift($@@)))')') +@result{} +argn(`1', `a') +@result{}a +define(`foo', `argn(`11', $@@)') +@result{} +foo(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k', `l') +@result{}k +@end example + @node Forloop @section Iteration by counting @@ -2424,6 +2769,8 @@ elements of both of these implementation @node Debugging @chapter How to debug macros and input +@cindex debugging macros +@cindex macros, debugging When writing macros for @code{m4}, they often do not work as intended on the first try (as is the case with most programming languages). Fortunately, there is support for macro debugging in @code{m4}. @@ -2441,6 +2788,7 @@ Fortunately, there is support for macro @cindex displaying macro definitions @cindex macros, displaying definitions @cindex definitions, displaying macro +@cindex standard error, output to If you want to see what a name expands into, you can use the builtin @code{dumpdef}: @@ -2490,13 +2838,15 @@ display. @cindex tracing macro expansion @cindex macro expansion, tracing @cindex expansion, tracing macro +@cindex standard error, output to It is possible to trace macro calls and expansions through the builtins @code{traceon} and @code{traceoff}: @deffn Builtin traceon (@ovar{names@dots{}}) @deffnx Builtin traceoff (@ovar{names@dots{}}) When called without any arguments, @code{traceon} and @code{traceoff} -will turn tracing on and off, respectively, for all defined macros. +will turn tracing on and off, respectively, for all currently defined +macros. When called with arguments, only the macros listed in @var{names} are affected, whether or not they are currently defined. @@ -2565,7 +2915,7 @@ foo @result{}blah @end example -Tracing even works on builtins. However, @command{defn} (@pxref{Defn}) +Tracing even works on builtins. However, @code{defn} (@pxref{Defn}) does not transfer tracing status. @example @@ -2591,54 +2941,66 @@ display. @cindex controlling debugging output @cindex debugging output, controlling -The @option{-d} option to @code{m4} (@pxref{Debugging options, , -Invoking m4}) controls the amount of details presented, when using the -macros described in the preceding sections. +The @option{-d} option to @code{m4} (or @option{--debug}, +@pxref{Debugging options, , Invoking m4}) controls the amount of details +presented in three +categories of output. Trace output is requested by @code{traceon} +(@pxref{Trace}), and each line is prefixed by @samp{m4trace:} in +relation to a macro invocation. Debug output tracks useful events not +associated with a macro invocation, and each line is prefixed by +@samp{m4debug:}. Finally, @code{dumpdef} (@pxref{Dumpdef}) output is +affected, with no prefix added to the output lines. The @var{flags} following the option can be one or more of the following: @table @code @item a -Show the actual arguments in each macro call. This applies to all macro -calls if the @samp{t} flag is used, otherwise only the macros covered by -calls of @code{traceon}. +In trace output, show the actual arguments that were collected before +invoking the macro. This applies to all macro calls if the @samp{t} +flag is used, otherwise only the macros covered by calls of +@code{traceon}. @item c -Show several trace lines for each macro call. A line is shown when the -macro is seen, but before the arguments are collected; a second line -when the arguments have been collected and a third line after the call -has completed. +In trace output, show several trace lines for each macro call. A line +is shown when the macro is seen, but before the arguments are collected; +a second line when the arguments have been collected and a third line +after the call has completed. @item e -Show the expansion of each macro call, if it is not void. This applies -to all macro calls if the @samp{t} flag is used, otherwise only the -macros covered by calls of @code{traceon}. +In trace output, show the expansion of each macro call, if it is not +void. This applies to all macro calls if the @samp{t} flag is used, +otherwise only the macros covered by calls of @code{traceon}. @item f -Show the name of the current input file in each trace output line. +In debug and trace output, include the name of the current input file in +the output line. @item i -Print a message each time the current input file is changed, giving file -name and input line number. +In debug output, print a message each time the current input file is +changed. @item l -Show the current input line number in each trace output line. +In debug and trace output, include the current input line number in the +output line. @item p -Print a message when a named file is found through the path search -mechanism (@pxref{Search Path}), giving the actual file name used. +In debug output, print a message when a named file is found through the +path search mechanism (@pxref{Search Path}), giving the actual file name +used. @item q -Quote actual arguments and macro expansions in the display with the -current quotes. +In trace and dumpdef output, quote actual arguments and macro expansions +in the display with the current quotes. This is useful in connection +with the @samp{a} and @samp{e} flags above. @item t -Trace all macro calls made in this invocation of @code{m4}. +In trace output, trace all macro calls made in this invocation of +@code{m4}, regardless of the settings of @code{traceon}. @item x -Add a unique `macro call id' to each line of the trace output. This is -useful in connection with the @samp{c} flag above. +In trace output, add a unique `macro call id' to each line of the trace +output. This is useful in connection with the @samp{c} flag above. @item V A shorthand for all of the above flags. @@ -2745,6 +3107,8 @@ to @code{m4}. @section Deleting whitespace in input @cindex deleting whitespace in input +@cindex discarding input +@cindex input, discarding The builtin @code{dnl} stands for ``Discard to Next Line'': @deffn Builtin dnl @@ -2801,8 +3165,9 @@ define(`hi', `HI') @node Changequote @section Changing the quote characters -@cindex changing the quote delimiters -@cindex quote delimiters, changing the +@cindex changing quote delimiters +@cindex quote delimiters, changing +@cindex delimiters, changing The default quote delimiters can be changed with the builtin @code{changequote}: @@ -2990,6 +3355,7 @@ changequote(`"', `"') It is an error if the end of file occurs within a quoted string. +@comment status: 1 @example `hello world' @result{}hello world @@ -3003,6 +3369,7 @@ It is an error if the end of file occurs @cindex changing comment delimiters @cindex comment delimiters, changing +@cindex delimiters, changing The default comment delimiters can be changed with the builtin macro @code{changecom}: @@ -3133,6 +3500,7 @@ echo(hi,hi)bye) It is an error if the end of file occurs within a comment. +@comment status: 1 @example changecom(`/*', `*/') @result{} @@ -3146,6 +3514,9 @@ changecom(`/*', `*/') @cindex lexical structure of words @cindex words, lexical structure of +@cindex syntax, changing +@cindex changing syntax +@cindex regular expressions @quotation The macro @code{changeword} and all associated functionality is experimental. It is only available if the @option{--enable-changeword} @@ -3366,6 +3737,8 @@ the parsing speed. @cindex saving input @cindex input, saving +@cindex deferring expansion +@cindex expansion, deferring It is possible to `save' some text until the end of the normal input has been seen. Text can be saved, to be read again by @code{m4} when the normal input has been exhausted. This feature is normally used to @@ -3440,6 +3813,7 @@ m4wrap(`a')m4wrap(`a') however, the transition between recursion levels behaves like an end of file condition between two input files. +@comment status: 1 @example m4wrap(`m4wrap(`)')len(abc') @result{} @@ -3452,7 +3826,6 @@ m4wrap(`m4wrap(`)')len(abc') @cindex file inclusion @cindex inclusion, of files - @code{m4} allows you to include named files at any point in the input. @menu @@ -3482,6 +3855,7 @@ The macros @code{include} and @code{sinc parameters. @end deffn +@comment status: 1 @example include(`none') @error{}m4:stdin:1: cannot open `none': No such file or directory @@ -3558,6 +3932,7 @@ using @code{undivert} (@pxref{Undivert}) @acronym{GNU} @code{m4} allows included files to be found in other directories than the current working directory. +@cindex @env{M4PATH} If the @option{--prepend-include} or @option{-B} command-line option was provided (@pxref{Preprocessor features, , Invoking m4}), those directories are searched first, in reverse order that those options were @@ -3574,11 +3949,13 @@ debug flag (@pxref{Debug Levels}) can he @node Diversions @chapter Diverting and undiverting output +@cindex deferring output Diversions are a way of temporarily saving output. The output of @code{m4} can at any time be diverted to a temporary file, and be reinserted into the output stream, @dfn{undiverted}, again at a later time. +@cindex @env{TMPDIR} Numbered diversions are counted from 0 upwards, diversion number 0 being the normal output stream. The number of simultaneous diversions is limited mainly by the memory used to describe them, because @acronym{GNU} @@ -3715,12 +4092,14 @@ define(`text', `TEXT') divert(`1')`diverted text.' divert @result{} -m4wrap(`Wrapped text preceeds ') +m4wrap(`Wrapped text precedes ') @result{} ^D -@result{}Wrapped TEXT preceeds diverted text. +@result{}Wrapped TEXT precedes diverted text. @end example +@cindex discarding input +@cindex input, discarding If output is diverted to a negative diversion, it is simply discarded. This can be used to suppress unwanted output. A common example of unwanted output is the trailing newlines after macro definitions. Here @@ -3779,6 +4158,9 @@ Undiverts the numeric @var{diversions} g order given. If no arguments are supplied, all diversions are undiverted, in numerical order. +@cindex file inclusion +@cindex inclusion, of files +@cindex @acronym{GNU} extensions As a @acronym{GNU} extension, @var{diversions} may contain non-numeric strings, which are treated as the names of files to copy into the output without expansion. A warning is issued if a file could not be opened. @@ -3984,6 +4366,7 @@ len(`abcdef') @node Index macro @section Searching for substrings +@cindex substrings, locating Searching for substrings is done with @code{index}: @deffn Builtin index (@var{string}, @var{substring}) @@ -4013,14 +4396,17 @@ index(`abc') @node Regexp @section Searching for regular expressions +@cindex basic regular expressions @cindex regular expressions +@cindex expressions, regular @cindex @acronym{GNU} extensions Searching for regular expressions is done with the builtin @code{regexp}: @deffn Builtin regexp (@var{string}, @var{regexp}, @ovar{replacement}) Searches for @var{regexp} in @var{string}. The syntax for regular -expressions is the same as in @acronym{GNU} Emacs. +expressions is the same as in @acronym{GNU} Emacs, which is similar to +@acronym{BRE, Basic Regular Expressions} in @acronym{POSIX}. @ifnothtml @xref{Regexps, , Syntax of Regular Expressions, emacs, The GNU Emacs Manual}. @@ -4030,6 +4416,8 @@ See @uref{http://www.gnu.org/@/software/@/emacs/@/manual/@/emacs.html#Regexps, Syntax of Regular Expressions} in the @acronym{GNU} Emacs Manual. @end ifhtml +Support for @acronym{ERE, Extended Regular Expressions} is not +available, but will be added in @acronym{GNU} M4 2.0. If @var{replacement} is omitted, @code{regexp} expands to the index of the first match of @var{regexp} in @var{string}. If @var{regexp} does @@ -4199,7 +4587,9 @@ translit(`abc') @node Patsubst @section Substituting text by regular expression +@cindex basic regular expressions @cindex regular expressions +@cindex expressions, regular @cindex pattern substitution @cindex substitution by regular expression @cindex @acronym{GNU} extensions @@ -4249,7 +4639,7 @@ patsubst(`GNUs not Unix', `not', `NOT\') @end example Here is a slightly more realistic example, which capitalizes individual -word or whole sentences, by substituting calls of the macros +words or whole sentences, by substituting calls of the macros @code{upcase} and @code{downcase} into the strings. @deffn Composite upcase (@var{text}) @@ -4298,7 +4688,7 @@ patsubst(`abc') @end example @node Format -@section Formatted output +@section Formatting strings (printf-like) @cindex formatted output @cindex output, formatted @@ -4417,32 +4807,33 @@ Integer expressions are evaluated with @ @deffn Builtin eval (@var{expression}, @dvar{radix, 10}, @ovar{width}) Expands to the value of @var{expression}. The expansion is empty -if an error is encountered while parsing the arguments. If specified, +if a problem is encountered while parsing the arguments. If specified, @var{radix} and @var{width} control the format of the output. -The macro @code{eval} is recognized only with parameters. -@end deffn +Calculations are done with 32-bit signed numbers. Overflow silently +results in wraparound. A warning is issued if division by zero is +attempted, or if @var{expression} could not be parsed. Expressions can contain the following operators, listed in order of decreasing precedence. -@table @code -@item + - -Unary plus and minus +@table @samp +@item () +Parentheses +@item + - ~ ! +Unary plus and minus, and bitwise and logical negation @item ** Exponentiation @item * / % -Multiplication, division and modulo +Multiplication, division, and modulo @item + - Addition and subtraction @item << >> Shift left or right -@item == != > >= < <= +@item > >= < <= Relational operators -@item ! -Logical negation -@item ~ -Bitwise negation +@item == != +Equality operators @item & Bitwise and @item ^ @@ -4455,30 +4846,116 @@ Logical and Logical or @end table -All operators, except exponentiation, are left associative. +The macro @code{eval} is recognized only with parameters. +@end deffn + +All binary operators, except exponentiation, are left associative. C +operators that perform variable assignment, such as @samp{+=} or +@samp{--}, are not implemented, since @code{eval} only operates on +constants, not variables. Attempting to use them results in an error. +However, since traditional implementations treated @samp{=} as an +undocumented alias for @samp{==} as opposed to an assignment operator, +this usage is supported as a special case. Be aware that a future +version of @acronym{GNU} M4 may support assignment semantics as an +extension when @acronym{POSIX} mode is not requested, and that using +@samp{=} to check equality is not portable. + +@comment status: 1 +@example +eval(`2 = 2') +@error{}m4:stdin:1: Warning: recommend ==, not =, for equality operator +@result{}1 +eval(`++0') +@error{}m4:stdin:2: invalid operator in eval: ++0 +@result{} +eval(`0 |= 1') +@error{}m4:stdin:3: invalid operator in eval: 0 |= 1 +@result{} +@end example Note that some older @code{m4} implementations use @samp{^} as an -alternate operator for exponentiation, although @acronym{POSIX} requires -the C behavior of bitwise exclusive-or. On the other hand, the -precedence of @samp{~} and @samp{!} are different in @acronym{GNU} -@code{m4} than -they are in C, matching the precedence in traditional @code{m4} -implementations. This behavior is likely to change in a future -version to match @acronym{POSIX}, so use parentheses to force the -desired precedence. - -Within @var{expression}, (but not @var{radix} or @var{width}), -numbers without a special prefix are decimal. A simple @samp{0} -prefix introduces an octal number. @samp{0x} introduces a hexadecimal -number. @samp{0b} introduces a binary number. @samp{0r} introduces a -number expressed in any radix between 1 and 36: the prefix should be -immediately followed by the decimal expression of the radix, a colon, -then the digits making the number. For radix 1, leading zeros are -ignored and all remaining digits must be @samp{1}; for all other -radices, the digits are -@samp{0}, @samp{1}, @samp{2}, @dots{}. Beyond @samp{9}, the digits are -@samp{a}, @samp{b} @dots{} up to @samp{z}. Lower and upper case letters -can be used interchangeably in numbers prefixes and as number digits. +alternate operator for the exponentiation, although @acronym{POSIX} +requires the C behavior of bitwise exclusive-or. The precedence of the +negation operators, @samp{~} and @samp{!}, was traditionally lower than +equality. The unary operators could not be used reliably more than once +on the same term without intervening parentheses. The traditional +precedence of the equality operators @samp{==} and @samp{!=} was +identical instead of lower than the relational operators such as +@samp{<}, even through @acronym{GNU} M4 1.4.8. Starting with version +1.4.9, @acronym{GNU} M4 correctly follows @acronym{POSIX} precedence +rules. M4 scripts designed to be portable between releases must be +aware that parentheses may be required to enforce C precedence rules. +Likewise, division by zero, even in the unused branch of a +short-circuiting operator, is not always well-defined in other +implementations. + +Following are some examples where the current version of M4 follows C +precedence rules, but where older versions and some other +implementations of @code{m4} require explicit parentheses to get the +correct result: + +@example +eval(`1 == 2 > 0') +@result{}1 +eval(`(1 == 2) > 0') +@result{}0 +eval(`! 0 * 2') +@result{}2 +eval(`! (0 * 2)') +@result{}1 +eval(`1 | 1 ^ 1') +@result{}1 +eval(`(1 | 1) ^ 1') +@result{}0 +eval(`+ + - ~ ! ~ 0') +@result{}1 +eval(`2 || 1 / 0') +@result{}1 +eval(`0 || 1 / 0') +@error{}m4:stdin:9: divide by zero in eval: 0 || 1 / 0 +@result{} +eval(`0 && 1 % 0') +@result{}0 +eval(`2 && 1 % 0') +@error{}m4:stdin:11: modulo by zero in eval: 2 && 1 % 0 +@result{} +@end example + +@cindex @acronym{GNU} extensions +As a @acronym{GNU} extension, the operator @samp{**} performs integral +exponentiation. The operator is right-associative, and if evaluated, +the exponent must be non-negative, and at least one of the arguments +must be non-zero, or a warning is issued. + +@example +eval(`2 ** 3 ** 2') +@result{}512 +eval(`(2 ** 3) ** 2') +@result{}64 +eval(`0 ** 1') +@result{}0 +eval(`2 ** 0') +@result{}1 +eval(`0 ** 0') +@result{} +@error{}m4:stdin:5: divide by zero in eval: 0 ** 0 +eval(`4 ** -2') +@error{}m4:stdin:6: negative exponent in eval: 4 ** -2 +@result{} +@end example + +Within @var{expression}, (but not @var{radix} or @var{width}), numbers +without a special prefix are decimal. A simple @samp{0} prefix +introduces an octal number. @samp{0x} introduces a hexadecimal number. +As @acronym{GNU} extensions, @samp{0b} introduces a binary number. +@samp{0r} introduces a number expressed in any radix between 1 and 36: +the prefix should be immediately followed by the decimal expression of +the radix, a colon, then the digits making the number. For radix 1, +leading zeros are ignored, and all remaining digits must be @samp{1}; +for all other radices, the digits are @samp{0}, @samp{1}, @samp{2}, +@dots{}. Beyond @samp{9}, the digits are @samp{a}, @samp{b} @dots{} up +to @samp{z}. Lower and upper case letters can be used interchangeably +in numbers prefixes and as number digits. Parentheses may be used to group subexpressions whenever needed. For the relational operators, a true relation returns @code{1}, and a false @@ -4493,18 +4970,18 @@ eval(index(`Hello world', `llo') >= 0) @result{}1 eval(`0r1:0111 + 0b100 + 0r3:12') @result{}12 -define(`square', `eval(`('$1`)**2')') +define(`square', `eval(`($1) ** 2')') @result{} square(`9') @result{}81 -square(square(`5')`+1') +square(square(`5')` + 1') @result{}676 define(`foo', `666') @result{} -eval(`foo/6') -@error{}m4:stdin:8: bad expression in eval: foo/6 +eval(`foo / 6') +@error{}m4:stdin:8: bad expression in eval: foo / 6 @result{} -eval(foo/6) +eval(foo / 6) @result{}111 @end example @@ -4513,34 +4990,43 @@ names, even if they expand to a valid ex expression). Therefore all macros must be expanded before they are passed to @code{eval}. -All evaluation is done with 32-bit signed integers, assuming -2's-complement with wrap-around. The shift operators are defined in -@acronym{GNU} -@code{m4} by doing an implicit bit-wise and of the right-hand operand -with 0x1f, and sign-extension with right shift. +Some calculations are not portable to other implementations, since they +have undefined semantics in C, but @acronym{GNU} @code{m4} has +well-defined behavior on overflow. When shifting, an out-of-range shift +amount is implicitly brought into the range of 32-bit signed integers +using an implicit bit-wise and with 0x1f). @example -eval(0x80000000 / -1) +define(`max_int', eval(`0x7fffffff')) +@result{} +define(`min_int', incr(max_int)) +@result{} +eval(min_int` < 0') +@result{}1 +eval(max_int` > 0') +@result{}1 +ifelse(eval(min_int` / -1'), min_int, `overflow occurred') +@result{}overflow occurred +min_int @result{}-2147483648 -eval(0x80000000 % -1) +eval(`0x80000000 % -1') @result{}0 -eval(0x7fffffff) -@result{}2147483647 -incr(eval(0x7fffffff)) -@result{}-2147483648 -eval(-4 >> 33) +eval(`-4 >> 1') +@result{}-2 +eval(`-4 >> 33') @result{}-2 @end example If @var{radix} is specified, it specifies the radix to be used in the expansion. The default radix is 10; this is also the case if -@var{radix} is the empty string. It is an error if the radix is outside -the range of 1 through 36, inclusive. The result of @code{eval} is -always taken to be signed. No radix prefix is output, and for radices -greater than 10, the digits are lower case. The @var{width} argument -specifies the minimum output width, excluding any negative sign. The -result is zero-padded to extend the expansion to the requested width. -It is an error if the width is negative. On error, the expansion of +@var{radix} is the empty string. A warning results if the radix is +outside the range of 1 through 36, inclusive. The result of @code{eval} +is always taken to be signed. No radix prefix is output, and for +radices greater than 10, the digits are lower case. The @var{width} +argument specifies the minimum output width, excluding any negative +sign. The result is zero-padded to extend the expansion to the +requested width. A warning results if the width is negative. If +@var{radix} or @var{width} is out of bounds, the expansion of @code{eval} is empty. @example @@ -4560,15 +5046,21 @@ eval(`10', `', `0') @result{}0r1:01111111111 eval(`10', `16') @result{}a +eval(`1', `37') +@error{}m4:stdin:9: radix 37 in builtin `eval' out of range +@result{} +eval(`1', , `-1') +@error{}m4:stdin:10: negative width to builtin `eval' +@result{} +eval() +@error{}m4:stdin:11: empty string treated as 0 in builtin `eval' +@result{}0 @end example @node Shell commands @chapter Macros for running shell commands -@cindex executing UNIX commands -@cindex running UNIX commands @cindex UNIX commands, running -@cindex commands, running UNIX @cindex executing shell commands @cindex running shell commands @cindex shell commands, running @@ -4577,10 +5069,10 @@ There are a few builtin macros in @code{ commands from within @code{m4}. Note that the definition of a valid shell command is system dependent. -On UNIX systems, this is the typical @code{/bin/sh}. But on other +On UNIX systems, this is the typical @command{/bin/sh}. But on other systems, such as native Windows, the shell has a different syntax of commands that it understands. Some examples in this chapter assume -@code{/bin/sh}, and also demonstrate how to quit early with a known +@command{/bin/sh}, and also demonstrate how to quit early with a known exit value if this is not the case. @menu @@ -4595,8 +5087,8 @@ exit value if this is not the case. @section Determining the platform @cindex platform macros -Sometimes it is desirable for an input file to know which -platform @code{m4} is running on. @acronym{GNU} @code{m4} provides several +Sometimes it is desirable for an input file to know which platform +@code{m4} is running on. @acronym{GNU} @code{m4} provides several macros that are predefined to expand to the empty string; checking for their existence will confirm platform details. @@ -4624,7 +5116,6 @@ ifdef(`__gnu__', `Extensions are active' @result{}Extensions are active @end example -@cindex platform macro On UNIX systems, @acronym{GNU} @code{m4} will define @code{@w{__unix__}} by default, or @code{unix} when the @option{-G} option is specified. @@ -4764,6 +5255,8 @@ run yet. @end deffn @example +sysval +@result{}0 syscmd(`false') @result{} ifelse(sysval, `0', `zero', `non-zero') @@ -4790,7 +5283,7 @@ sysval @result{}0 @end example -@command{sysval} results in 127 if there was a problem executing the +@code{sysval} results in 127 if there was a problem executing the command, for example, if the system-imposed argument length is exceeded, or if there were not enough resources to fork. It is not possible to distinguish between failed execution and successful execution that had @@ -4808,17 +5301,23 @@ signal number shifted left by eight bits @comment exits normally rather than letting the signal terminate it). @comment Also, TERM is flaky, as it can also kill the running m4 on @comment systems where /bin/sh does not create its own process group. -@comment That leaves KILL and PIPE as the two signals tested. +@comment And PIPE is unreliable, since people tend to run with it +@comment ignored, with m4 inheriting that choice. That leaves KILL as +@comment the only signal we can reliably test. @example 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 -13 $$') +syscmd(`kill -9 $$') @result{} sysval -@result{}3328 +@result{}2304 +syscmd() +@result{} +sysval +@result{}0 esyscmd(`kill -9 $$') @result{} sysval @@ -4858,6 +5357,9 @@ that file name. Hence, @acronym{POSIX} implementations of @code{m4} provide the secure @code{mkstemp} builtin, and that users of @code{m4} check for its existence. +The expansion is void and an error issued if a temporary file could +not be created. + The macros @code{mkstemp} and @code{maketemp} are recognized only with parameters. @end deffn @@ -4927,6 +5429,7 @@ any of the previous chapters. @cindex printing error messages @cindex error messages, printing @cindex messages, printing error +@cindex standard error, output to You can print error messages using @code{errprint}: @deffn Builtin errprint (@var{message}, @dots{}) @@ -4961,6 +5464,8 @@ had one, and @acronym{POSIX} is silent o @node Location @section Printing current location +@cindex location, input +@cindex input location To make it possible to specify the location of an error, three utility builtins exist: @@ -5081,6 +5586,7 @@ Abort processing with an error message a resulting string to standard error. @end deffn +@comment status: 1 @example define(`fatal_error', `errprint(__program__:__file__:__line__`: fatal error: $* @@ -5117,8 +5623,8 @@ which files are listed on each @code{m4} user's input file, or else each input file uses @code{include}. Reading the common base of a big application, over and over again, may -be time consuming. @acronym{GNU} @code{m4} offers some machinery to speed up -the start of an application using lengthy common bases. +be time consuming. @acronym{GNU} @code{m4} offers some machinery to +speed up the start of an application using lengthy common bases. @menu * Using frozen files:: Using frozen files @@ -5127,9 +5633,10 @@ the start of an application using length @node Using frozen files @section Using frozen files + @cindex fast loading of frozen files @cindex frozen files for fast loading -@cindex initialization, frozen states +@cindex initialization, frozen state @cindex dumping into frozen file @cindex reloading a frozen file @cindex @acronym{GNU} extensions @@ -5166,7 +5673,7 @@ with the varying input. The first call, option, only reads and executes file @file{base.m4}, defining various application macros and computing other initializations. Once the input file @file{base.m4} has been completely processed, @acronym{GNU} -@code{m4} produces on @file{base.m4f} a @dfn{frozen} file, that is, a +@code{m4} produces in @file{base.m4f} a @dfn{frozen} file, that is, a file which contains a kind of snapshot of the @code{m4} internal state. Later calls, containing the @option{-R} option, are able to reload @@ -5227,6 +5734,7 @@ exit with status 63 to indicate version @node Frozen file format @section Frozen file format + @cindex frozen file format @cindex file format, frozen file Frozen files are sharable across architectures. It is safe to write @@ -5314,6 +5822,7 @@ is made to summarize these here. @section Extensions in @acronym{GNU} @code{m4} @cindex @acronym{GNU} extensions +@cindex @acronym{POSIX} This version of @code{m4} contains a few facilities that do not exist in System V @code{m4}. These extra facilities are all suppressed by using the @option{-G} command line option (@pxref{Limits control, , @@ -5321,7 +5830,7 @@ Invoking m4}), unless overridden by othe @itemize @bullet @item -In the @code{$}@var{n} notation for macro arguments, @var{n} can contain +In the @code{$@var{n}} notation for macro arguments, @var{n} can contain several digits, while the System V @code{m4} only accepts one digit. This allows macros in @acronym{GNU} @code{m4} to take any number of arguments, and not only nine (@pxref{Arguments}). @@ -5351,6 +5860,9 @@ Eleventh(`a', `b', `c', `d', `e', `f', ` @result{}k @end example +@noindent +Also see the @code{argn} macro (@pxref{Shift}). + @item The @code{divert} (@pxref{Divert}) macro can manage more than 9 diversions. @acronym{GNU} @code{m4} treats all positive numbers as valid @@ -5371,7 +5883,7 @@ Formatted output is supported through th is modeled after the C library function @code{printf} (@pxref{Format}). @item -Searches and text substitution through regular expressions are +Searches and text substitution through basic regular expressions are supported by the @code{regexp} (@pxref{Regexp}) and @code{patsubst} (@pxref{Patsubst}) builtins. @@ -5478,10 +5990,11 @@ m4wrap(`a`'m4wrap(`c @end example @item -@acronym{POSIX} requires that all builtins that require arguments, but -are called without arguments, behave as though empty strings had been -passed. For example, @code{a`'define`'b} would expand to @code{ab}. -But @acronym{GNU} @code{m4} ignores certain builtins if they have missing +@acronym{POSIX} states that builtins that require arguments, but are +called without arguments, have undefined behavior. Traditional +implementations simply behave as though empty strings had been passed. +For example, @code{a`'define`'b} would expand to @code{ab}. But +@acronym{GNU} @code{m4} ignores certain builtins if they have missing arguments, giving @code{adefineb} for the above example. @item @@ -5489,7 +6002,7 @@ Traditional implementations handle @code by undefining the entire stack of previous definitions, and if doing @code{undefine(`f')} first. @acronym{GNU} @code{m4} replaces just the top definition on the stack, as if doing @code{popdef(`f')} followed by -@code{pushdef(`f',`1')}. +@code{pushdef(`f',`1')}. @acronym{POSIX} allows either behavior. @item @acronym{POSIX} requires @code{syscmd} (@pxref{Syscmd}) to evaluate @@ -5559,15 +6072,18 @@ that is preserved even if the macro is c @item @acronym{POSIX} requires @code{eval} (@pxref{Eval}) to treat all -operators with the same precedence as C. However, @acronym{GNU} @code{m4} -currently follows the traditional precedence of other @code{m4} -implementations, where bitwise and logical negation (@samp{~} and -@samp{!}) have lower precedence than equality operators, rather than -equal precedence with other unary operators. Use explicit parentheses -to ensure proper precedence. As extensions to @acronym{POSIX}, @acronym{GNU} -@code{m4} treats the shift operators @samp{<<} and @samp{>>} as -well-defined on signed integers (even though they are not in C), and -adds the exponentiation operator @samp{**}. +operators with the same precedence as C. However, earlier versions of +@acronym{GNU} @code{m4} followed the traditional behavior of other +@code{m4} implementations, where bitwise and logical negation (@samp{~} +and @samp{!}) have lower precedence than equality operators; and where +equality operators (@samp{==} and @samp{!=}) had the same precedence as +relational operators (such as @samp{<}). Use explicit parentheses to +ensure proper precedence. As extensions to @acronym{POSIX}, +@acronym{GNU} @code{m4} gives well-defined semantics to operations that +C leaves undefined, such as when overflow occurs, when shifting negative +numbers, or when performing division by zero. @acronym{POSIX} also +requires @samp{=} to cause an error, but many traditional +implementations allowed it as an alias for @samp{==}. @item @acronym{POSIX} requires @code{translit} (@pxref{Translit}) to treat @@ -5617,7 +6133,6 @@ diversion were made, and not where it wa @acronym{GNU} @code{m4} makes no attempt at prohibiting self-referential definitions like: -@comment ignore @example define(`x', `x') @result{} @@ -5625,8 +6140,10 @@ define(`x', `x ') @result{} @end example +@cindex rescanning There is nothing inherently wrong with defining @samp{x} to -return @samp{x}. The wrong thing is to expand @samp{x} unquoted. +return @samp{x}. The wrong thing is to expand @samp{x} unquoted, +because that would cause an infinite rescan loop. In @code{m4}, one might use macros to hold strings, as we do for variables in other programming languages, further checking them with: @@ -5636,11 +6153,11 @@ ifelse(defn(`@var{holder}'), `@var{value @end example @noindent -In cases like this one, an interdiction for a macro to hold its own -name would be a useless limitation. Of course, this leaves more rope -for the @acronym{GNU} @code{m4} user to hang himself! Rescanning hangs may be -avoided through careful programming, a little like for endless loops -in traditional programming languages. +In cases like this one, an interdiction for a macro to hold its own name +would be a useless limitation. Of course, this leaves more rope for the +@acronym{GNU} @code{m4} user to hang himself! Rescanning hangs may be +avoided through careful programming, a little like for endless loops in +traditional programming languages. @end itemize @node Answers @@ -5755,6 +6272,8 @@ foreachq(`x', ``1', `2', `3', `4'', `x @error{}m4trace: -3- shift(`4') @end example +@cindex quadratic behavior, avoiding +@cindex avoiding quadratic behavior Each successive iteration was adding more quoted @code{shift} invocations, and the entire list contents were passing through every iteration. In general, when recursing, it is a good idea to make the @@ -5962,6 +6481,7 @@ though all files start at line 1. Furth @code{fatal_error} to work across the entire 1.4.x release series, a better implementation would be: +@comment status: 1 @example define(`fatal_error', `errprint(ifdef(`__program__', `__program__', ``m4'')'dnl @@ -5994,31 +6514,28 @@ fatal_error(`inside wrapped text')') @appendix Indices of concepts and macros @menu -* Concept index:: Index for many concepts * Macro index:: Index for all @code{m4} macros +* Concept index:: Index for many concepts @end menu -@node Concept index -@appendixsec Index for many concepts - -@printindex cp - @node Macro index @appendixsec Index for all @code{m4} macros -References are exclusively to the places where a builtin is introduced -the first time. - -@iftex -@sp 1 -@end iftex +This index covers all @code{m4} builtins, as well as several useful +composite macros. References are exclusively to the places where a +macro is introduced the first time. @printindex fn +@node Concept index +@appendixsec Index for many concepts + +@printindex cp + @bye @c Local Variables: -@c coding: ISO-8859-1 +@c coding: iso-8859-1 @c fill-column: 72 @c ispell-local-dictionary: "american" @c indent-tabs-mode: nil diff -ruNp m4-1.4.8/doc/stamp-vti m4-1.4.9/doc/stamp-vti --- m4-1.4.8/doc/stamp-vti 2006-11-20 07:28:42.000000000 -0700 +++ m4-1.4.9/doc/stamp-vti 2007-03-23 07:36:04.000000000 -0600 @@ -1,4 +1,4 @@ -@set UPDATED 20 November 2006 -@set UPDATED-MONTH November 2006 -@set EDITION 1.4.8 -@set VERSION 1.4.8 +@set UPDATED 23 March 2007 +@set UPDATED-MONTH March 2007 +@set EDITION 1.4.9 +@set VERSION 1.4.9 diff -ruNp m4-1.4.8/doc/texinfo.tex m4-1.4.9/doc/texinfo.tex --- m4-1.4.8/doc/texinfo.tex 2006-11-20 07:08:21.000000000 -0700 +++ m4-1.4.9/doc/texinfo.tex 2007-03-23 06:54:13.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{2006-10-15.13} +\def\texinfoversion{2007-03-14.11} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, -% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free -% Software Foundation, Inc. +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007 Free Software Foundation, Inc. % % This texinfo.tex file is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -67,7 +67,7 @@ \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} -\message{Basics,} + \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. @@ -1225,8 +1225,9 @@ where each line of input produces a line % To handle parens, we must adopt a different approach, since parens are % not active characters. hyperref.dtx (which has the same problem as -% us) handles it with this amazing macro to replace tokens. I've -% tinkered with it a little for texinfo, but it's definitely from there. +% 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. @@ -1255,13 +1256,44 @@ where each line of input produces a line \HyPsdSubst{)}{\realbackslash)}{#1}% } +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + \ifpdf \input pdfcolor - \pdfcatalog{/PageMode /UseOutlines}% + \pdfcatalog{/PageMode /UseOutlines} + % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .png, .jpg, .pdf (among + % others). Let's try in that order. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \openin 1 #1.pdf \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{pdf}% + \fi + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \closein 1 + \endgroup + % % without \immediate, pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 @@ -1272,28 +1304,32 @@ where each line of input produces a line \ifdim \wd0 >0pt width \imagewidth \fi \ifdim \wd2 >0pt height \imageheight \fi \ifnum\pdftexversion<13 - #1.pdf% + #1.\pdfimgext \else - {#1.pdf}% + {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} + % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. - \atdummies + \indexnofonts + \turnoffactive \activebackslashdouble + \makevalueexpandable \def\pdfdestname{#1}% \backslashparens\pdfdestname \pdfdest name{\pdfdestname} xyz% - }}% + }} % % used to mark target names; must be expandable. - \def\pdfmkpgn#1{#1}% + \def\pdfmkpgn#1{#1} % \let\linkcolor = \Blue % was Cyan, but that seems light? \def\endlink{\Black\pdfendlink} + % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% @@ -1548,7 +1584,7 @@ where each line of input produces a line % Definitions for a main text size of 11pt. This is the default in % Texinfo. % -\def\definetextfontsizexi{ +\def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} @@ -4132,6 +4168,34 @@ where each line of input produces a line % % All done with double columns. \def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. @@ -5248,12 +5312,18 @@ where each line of input produces a line \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else + \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } @@ -5554,6 +5624,7 @@ where each line of input produces a line \endgroup } + \message{defuns,} % @defun etc. @@ -6210,7 +6281,6 @@ where each line of input produces a line \message{cross references,} \newwrite\auxfile - \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. @@ -6323,7 +6393,8 @@ where each line of input produces a line \ifpdf \leavevmode \getfilename{#4}% - {\turnoffactive + {\indexnofonts + \turnoffactive % See comments at \activebackslashdouble. {\activebackslashdouble \xdef\pdfxrefdest{#1}% \backslashparens\pdfxrefdest}% @@ -6470,10 +6541,18 @@ where each line of input produces a line % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% - \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value. + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? - \expandafter\iffloat\csname XR#1\endcsname + \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname @@ -6488,7 +6567,8 @@ where each line of input produces a line % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. - \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}% + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% \fi } @@ -6592,6 +6672,7 @@ where each line of input produces a line \input\jobname.#1 \endgroup} + \message{insertions,} % including footnotes. @@ -7066,8 +7147,8 @@ where each line of input produces a line \writeentry }} + \message{localization,} -% and i18n. % @documentlanguage is usually given very early, just after % @setfilename. If done too late, it may not override everything @@ -7091,14 +7172,809 @@ where each line of input produces a line is empty. Maybe you need to install it? In the current directory should work if nowhere else does.} +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1 + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} -% @documentencoding should change something in TeX eventually, most -% likely, but for now just recognize it. -\let\documentencoding = \comment +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{~} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{~} + \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}} + \gdef^^b2{\missingcharmsg{OGONEK}} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'\i} + \gdef^^ee{\^\i} + \gdef^^ef{\v d} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} -% Page size parameters. +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup + +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz = "#1\relax + \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + \endgroup} + + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=A} + \DeclareUnicodeCharacter{0101}{\=a} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=E} + \DeclareUnicodeCharacter{0113}{\=e} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=I} + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=O} + \DeclareUnicodeCharacter{014D}{\=o} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=U} + \DeclareUnicodeCharacter{016B}{\=u} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\={\AE}} + \DeclareUnicodeCharacter{01E3}{\={\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=Y} + \DeclareUnicodeCharacter{0233}{\=y} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=G} + \DeclareUnicodeCharacter{1E21}{\=g} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs + + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. % +\setnonasciicharscatcode \other + + +\message{formatting,} + \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt diff -ruNp m4-1.4.8/doc/version.texi m4-1.4.9/doc/version.texi --- m4-1.4.8/doc/version.texi 2006-11-20 07:12:28.000000000 -0700 +++ m4-1.4.9/doc/version.texi 2007-03-23 07:36:04.000000000 -0600 @@ -1,4 +1,4 @@ -@set UPDATED 20 November 2006 -@set UPDATED-MONTH November 2006 -@set EDITION 1.4.8 -@set VERSION 1.4.8 +@set UPDATED 23 March 2007 +@set UPDATED-MONTH March 2007 +@set EDITION 1.4.9 +@set VERSION 1.4.9 diff -ruNp m4-1.4.8/examples/Makefile.in m4-1.4.9/examples/Makefile.in --- m4-1.4.8/examples/Makefile.in 2006-11-20 07:25:48.000000000 -0700 +++ m4-1.4.9/examples/Makefile.in 2007-03-23 07:32:34.000000000 -0600 @@ -43,12 +43,13 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/gnulib-comp.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/longdouble.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.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 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ @@ -57,17 +58,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(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/stdlib-safer.m4 $(top_srcdir)/m4/strcase.m4 \ - $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.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/tmpdir.m4 $(top_srcdir)/m4/ulonglong.m4 \ $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ - $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ - $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac + $(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/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 @@ -77,7 +78,12 @@ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ +ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ +ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ +ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ +ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ +ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ @@ -106,18 +112,39 @@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ +GLIBC21 = @GLIBC21@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_READLINK = @GNULIB_READLINK@ GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -144,6 +171,11 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ @@ -152,9 +184,11 @@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ -UNISTD_H = @UNISTD_H@ +SYS_TIME_H = @SYS_TIME_H@ VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ diff -ruNp m4-1.4.8/install-sh m4-1.4.9/install-sh --- m4-1.4.8/install-sh 2006-11-20 07:08:13.000000000 -0700 +++ m4-1.4.9/install-sh 2007-03-23 06:54:13.000000000 -0600 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2006-10-14.15 +scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -48,7 +48,7 @@ IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" +doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else @@ -58,34 +58,49 @@ fi # Put in absolute file names if you don't have them in your path; # or use environment vars. -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' -posix_glob= posix_mkdir= # Desired mode of installed file. mode=0755 +chgrpcmd= chmodcmd=$chmodprog chowncmd= -chgrpcmd= -stripcmd= +mvcmd=$mvprog rmcmd="$rmprog -f" -mvcmd="$mvprog" +stripcmd= + src= dst= dir_arg= -dstarg= +dst_arg= + +copy_on_change=false no_target_directory= -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... @@ -95,65 +110,55 @@ In the 2nd and 3rd, copy all SRCFILES to In the 4th, create DIRECTORIES. Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG " while test $# -ne 0; do case $1 in - -c) shift - continue;; + -c) ;; + + -C) copy_on_change=true;; - -d) dir_arg=true - shift - continue;; + -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - shift - shift case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac - continue;; + shift;; -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t) dstarg=$2 - shift - shift - continue;; - - -T) no_target_directory=true - shift - continue;; + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; @@ -165,21 +170,22 @@ while test $# -ne 0; do *) break;; esac + shift done -if test $# -ne 0 && test -z "$dir_arg$dstarg"; then +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do - if test -n "$dstarg"; then + if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" + set fnord "$@" "$dst_arg" shift # fnord fi shift # arg - dstarg=$arg + dst_arg=$arg done fi @@ -224,7 +230,7 @@ for src do # Protect names starting with `-'. case $src in - -*) src=./$src ;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -242,22 +248,22 @@ do exit 1 fi - if test -z "$dstarg"; then + if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi - dst=$dstarg + dst=$dst_arg # Protect names starting with `-'. case $dst in - -*) dst=./$dst ;; + -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 + echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst @@ -378,26 +384,19 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix=/ ;; - -*) prefix=./ ;; - *) prefix= ;; + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; esac - case $posix_glob in - '') - if (set -f) 2>/dev/null; then - posix_glob=true - else - posix_glob=false - fi ;; - esac + eval "$initialize_posix_glob" oIFS=$IFS IFS=/ - $posix_glob && set -f + $posix_glob set -f set fnord $dstdir shift - $posix_glob && set +f + $posix_glob set +f IFS=$oIFS prefixes= @@ -459,41 +458,54 @@ do # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dst"; then - $doit $rmcmd -f "$dst" 2>/dev/null \ - || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ - && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ - || { - echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - } || exit 1 + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 trap '' 0 fi diff -ruNp m4-1.4.8/lib/Makefile.am m4-1.4.9/lib/Makefile.am --- m4-1.4.8/lib/Makefile.am 2006-11-20 07:24:20.000000000 -0700 +++ m4-1.4.9/lib/Makefile.am 2007-03-23 06:52:16.000000000 -0600 @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2004-2006 Free Software Foundation, Inc. +# Copyright (C) 2004-2007 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -9,17 +9,13 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=M4 avltree-oset binary-io clean-temp cloexec close-stream closeout config-h error fdl fopen-safer free gendocs getopt gnupload mkstemp obstack regex stdbool stdlib-safer strstr strtol unlocked-io verror xalloc xvasprintf +# Reproduce by: gnulib-tool --import --dir=. --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=M4 avltree-oset binary-io clean-temp cloexec close-stream closeout config-h error fdl fopen-safer free gendocs getopt gnupload mkstemp obstack regex stdbool stdint stdlib-safer strtol unlocked-io verror version-etc-fsf xalloc xvasprintf AUTOMAKE_OPTIONS = 1.5 gnits -noinst_LIBRARIES = libm4.a - -libm4_a_SOURCES = -libm4_a_LIBADD = $(M4_LIBOBJS) -libm4_a_DEPENDENCIES = $(M4_LIBOBJS) -EXTRA_libm4_a_SOURCES = noinst_HEADERS = +noinst_LIBRARIES = +noinst_LTLIBRARIES = EXTRA_DIST = BUILT_SOURCES = SUFFIXES = @@ -31,6 +27,13 @@ MAINTAINERCLEANFILES = AM_CPPFLAGS = +noinst_LIBRARIES += libm4.a + +libm4_a_SOURCES = +libm4_a_LIBADD = $(M4_LIBOBJS) +libm4_a_DEPENDENCIES = $(M4_LIBOBJS) +EXTRA_libm4_a_SOURCES = + ## begin gnulib module alloca @@ -112,6 +115,62 @@ EXTRA_libm4_a_SOURCES += closeout.c ## end gnulib module closeout +## begin gnulib module configmake + +# Retrieve values of the variables through 'configure' followed by +# 'make', not directly through 'configure', so that a user who +# sets some of these variables consistently on the 'make' command +# line gets correct results. +# +# One advantage of this approach, compared to the classical +# approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS, +# is that it protects against the use of undefined variables. +# If, say, $(libdir) is not set in the Makefile, LIBDIR is not +# defined by this module, and code using LIBDIR gives a +# compilation error. +# +# Another advantage is that 'make' output is shorter. +# +# Listed in the same order as the GNU makefile conventions. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +configmake.h: Makefile + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t + mv $@-t $@ +BUILT_SOURCES += configmake.h +CLEANFILES += configmake.h configmake.h-t + +## end gnulib module configmake + ## begin gnulib module error @@ -121,12 +180,6 @@ EXTRA_libm4_a_SOURCES += error.c ## end gnulib module error -## begin gnulib module exit - -libm4_a_SOURCES += exit.h - -## end gnulib module exit - ## begin gnulib module exitfail @@ -194,6 +247,21 @@ libm4_a_SOURCES += gettext.h ## end gnulib module gettext-h +## begin gnulib module gettimeofday + + +EXTRA_DIST += gettimeofday.c + +EXTRA_libm4_a_SOURCES += gettimeofday.c + +## end gnulib module gettimeofday + +## begin gnulib module link-warning + +LINK_WARNING_H=$(top_srcdir)/./link-warning.h + +## end gnulib module link-warning + ## begin gnulib module linkedhash-list libm4_a_SOURCES += gl_linkedhash_list.h gl_linkedhash_list.c gl_anyhash_list1.h gl_anyhash_list2.h gl_anylinked_list1.h gl_anylinked_list2.h @@ -206,43 +274,77 @@ libm4_a_SOURCES += gl_list.h gl_list.c ## end gnulib module list -## begin gnulib module malloc - - -EXTRA_DIST += malloc.c - -EXTRA_libm4_a_SOURCES += malloc.c - -## end gnulib module malloc +## begin gnulib module localcharset -## begin gnulib module mbchar +libm4_a_SOURCES += localcharset.h localcharset.c +# We need the following in order to install a simple file in $(libdir) +# which is shared with other installed packages. We use a list of referencing +# packages so that "make uninstall" will remove the file if and only if it +# is not used by another installed package. +# On systems with glibc-2.1 or newer, the file is redundant, therefore we +# avoid installing it. + +all-local: charset.alias ref-add.sed ref-del.sed + +charset_alias = $(DESTDIR)$(libdir)/charset.alias +charset_tmp = $(DESTDIR)$(libdir)/charset.tmp +install-exec-local: all-local + test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) + 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 \ + sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + fi ; \ + fi + +uninstall-local: all-local + if test -f $(charset_alias); then \ + sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ + if grep '^# Packages using this file: $$' $(charset_tmp) \ + > /dev/null; then \ + rm -f $(charset_alias); \ + else \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ + fi; \ + rm -f $(charset_tmp); \ + fi -EXTRA_DIST += mbchar.c mbchar.h - -EXTRA_libm4_a_SOURCES += mbchar.c +charset.alias: config.charset + rm -f t-$@ $@ + $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ + mv t-$@ $@ -## end gnulib module mbchar +SUFFIXES += .sed .sin +.sin.sed: + rm -f t-$@ $@ + sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ + mv t-$@ $@ -## begin gnulib module mbuiter +CLEANFILES += charset.alias ref-add.sed ref-del.sed -libm4_a_SOURCES += mbuiter.h +EXTRA_DIST += config.charset ref-add.sin ref-del.sin -## end gnulib module mbuiter +## end gnulib module localcharset -## begin gnulib module memchr +## begin gnulib module malloc -EXTRA_DIST += memchr.c +EXTRA_DIST += malloc.c -EXTRA_libm4_a_SOURCES += memchr.c +EXTRA_libm4_a_SOURCES += malloc.c -## end gnulib module memchr +## end gnulib module malloc ## begin gnulib module mkdtemp -EXTRA_DIST += mkdtemp.c mkdtemp.h +EXTRA_DIST += mkdtemp.c EXTRA_libm4_a_SOURCES += mkdtemp.c @@ -251,7 +353,7 @@ EXTRA_libm4_a_SOURCES += mkdtemp.c ## begin gnulib module mkstemp -EXTRA_DIST += mkstemp.c mkstemp.h +EXTRA_DIST += mkstemp.c EXTRA_libm4_a_SOURCES += mkstemp.c @@ -339,8 +441,7 @@ BUILT_SOURCES += $(STDINT_H) stdint.h: stdint_.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ - -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ + sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ @@ -370,38 +471,40 @@ EXTRA_DIST += stdint_.h ## end gnulib module stdint -## begin gnulib module stdlib-safer - - -EXTRA_DIST += mkstemp-safer.c stdlib--.h stdlib-safer.h +## begin gnulib module stdlib -EXTRA_libm4_a_SOURCES += mkstemp-safer.c +BUILT_SOURCES += stdlib.h -## end gnulib module stdlib-safer - -## begin gnulib module strcase - - -EXTRA_DIST += strcase.h strcasecmp.c strncasecmp.c - -EXTRA_libm4_a_SOURCES += strcasecmp.c strncasecmp.c - -## end gnulib module strcase - -## begin gnulib module strnlen1 +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +stdlib.h: stdlib_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_STDLIB_H''@|$(ABSOLUTE_STDLIB_H)|g' \ + -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ + -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ + -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/stdlib_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += stdlib.h stdlib.h-t -libm4_a_SOURCES += strnlen1.h strnlen1.c +EXTRA_DIST += stdlib_.h -## end gnulib module strnlen1 +## end gnulib module stdlib -## begin gnulib module strstr +## begin gnulib module stdlib-safer -EXTRA_DIST += strstr.c strstr.h +EXTRA_DIST += mkstemp-safer.c stdlib--.h stdlib-safer.h -EXTRA_libm4_a_SOURCES += strstr.c +EXTRA_libm4_a_SOURCES += mkstemp-safer.c -## end gnulib module strstr +## end gnulib module stdlib-safer ## begin gnulib module strtol @@ -419,7 +522,7 @@ BUILT_SOURCES += $(SYS_STAT_H) # We need the following in order to create when the system # has one that is incomplete. sys/stat.h: stat_.h - test -d sys || mkdir sys + @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \ @@ -433,6 +536,29 @@ EXTRA_DIST += stat_.h ## end gnulib module sys_stat +## begin gnulib module sys_time + +BUILT_SOURCES += $(SYS_TIME_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/time.h: sys_time_.h + @MKDIR_P@ sys + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ + -e 's|@''ABSOLUTE_SYS_TIME_H''@|$(ABSOLUTE_SYS_TIME_H)|g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + < $(srcdir)/sys_time_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += sys/time.h sys/time.h-t + +EXTRA_DIST += sys_time_.h + +## end gnulib module sys_time + ## begin gnulib module tempname @@ -450,15 +576,35 @@ libm4_a_SOURCES += tmpdir.h tmpdir.c ## begin gnulib module unistd -BUILT_SOURCES += $(UNISTD_H) +BUILT_SOURCES += unistd.h # We need the following in order to create an empty placeholder for # when the system doesn't have one. -unistd.h: +unistd.h: unistd_.h + rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - echo '/* Empty placeholder for $@. */'; \ - } > $@ -MOSTLYCLEANFILES += unistd.h + sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + -e 's|@''ABSOLUTE_UNISTD_H''@|$(ABSOLUTE_UNISTD_H)|g' \ + -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ + -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ + -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ + -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ + -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + < $(srcdir)/unistd_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += unistd.h unistd.h-t + +EXTRA_DIST += unistd_.h ## end gnulib module unistd @@ -508,11 +654,58 @@ libm4_a_SOURCES += verror.h verror.c ## end gnulib module verror -## begin gnulib module wcwidth +## begin gnulib module version-etc + +libm4_a_SOURCES += version-etc.h version-etc.c + +## end gnulib module version-etc + +## begin gnulib module version-etc-fsf + +libm4_a_SOURCES += version-etc-fsf.c + +## end gnulib module version-etc-fsf + +## begin gnulib module wchar + +BUILT_SOURCES += $(WCHAR_H) + +# We need the following in order to create when the system +# version does not work standalone. +wchar.h: wchar_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''ABSOLUTE_WCHAR_H''@|$(ABSOLUTE_WCHAR_H)|g' \ + < $(srcdir)/wchar_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += wchar.h wchar.h-t + +EXTRA_DIST += wchar_.h + +## end gnulib module wchar + +## begin gnulib module wctype + +BUILT_SOURCES += $(WCTYPE_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +wctype.h: wctype_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ + -e 's|@''ABSOLUTE_WCTYPE_H''@|$(ABSOLUTE_WCTYPE_H)|g' \ + -e 's/@''HAVE_WCTYPE_CTMP_BUG''@/$(HAVE_WCTYPE_CTMP_BUG)/g' \ + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + < $(srcdir)/wctype_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += wctype.h wctype.h-t -libm4_a_SOURCES += wcwidth.h +EXTRA_DIST += wctype_.h -## end gnulib module wcwidth +## end gnulib module wctype ## begin gnulib module xalloc diff -ruNp m4-1.4.8/lib/Makefile.in m4-1.4.9/lib/Makefile.in --- m4-1.4.8/lib/Makefile.in 2006-11-20 07:25:49.000000000 -0700 +++ m4-1.4.9/lib/Makefile.in 2007-03-23 07:32:35.000000000 -0600 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2004-2006 Free Software Foundation, Inc. +# Copyright (C) 2004-2007 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -23,7 +23,8 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=M4 avltree-oset binary-io clean-temp cloexec close-stream closeout config-h error fdl fopen-safer free gendocs getopt gnupload mkstemp obstack regex stdbool stdlib-safer strstr strtol unlocked-io verror xalloc xvasprintf +# Reproduce by: gnulib-tool --import --dir=. --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=M4 avltree-oset binary-io clean-temp cloexec close-stream closeout config-h error fdl fopen-safer free gendocs getopt gnupload mkstemp obstack regex stdbool stdint stdlib-safer strtol unlocked-io verror version-etc-fsf xalloc xvasprintf + VPATH = @srcdir@ @@ -57,12 +58,13 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/gnulib-comp.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/longdouble.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.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 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ @@ -71,17 +73,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(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/stdlib-safer.m4 $(top_srcdir)/m4/strcase.m4 \ - $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.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/tmpdir.m4 $(top_srcdir)/m4/ulonglong.m4 \ $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ - $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ - $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac + $(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/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 @@ -95,10 +97,12 @@ am__DEPENDENCIES_1 = am_libm4_a_OBJECTS = allocsa.$(OBJEXT) gl_avltree_oset.$(OBJEXT) \ clean-temp.$(OBJEXT) fatal-signal.$(OBJEXT) \ gl_linkedhash_list.$(OBJEXT) gl_list.$(OBJEXT) \ - gl_oset.$(OBJEXT) strnlen1.$(OBJEXT) tmpdir.$(OBJEXT) \ - verror.$(OBJEXT) xalloc-die.$(OBJEXT) xallocsa.$(OBJEXT) \ - xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT) + localcharset.$(OBJEXT) gl_oset.$(OBJEXT) tmpdir.$(OBJEXT) \ + verror.$(OBJEXT) version-etc.$(OBJEXT) \ + version-etc-fsf.$(OBJEXT) xalloc-die.$(OBJEXT) \ + xallocsa.$(OBJEXT) xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT) libm4_a_OBJECTS = $(am_libm4_a_OBJECTS) +LTLIBRARIES = $(noinst_LTLIBRARIES) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -113,7 +117,12 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ +ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ +ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ +ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ +ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ +ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ @@ -142,18 +151,39 @@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ +GLIBC21 = @GLIBC21@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_READLINK = @GNULIB_READLINK@ GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -180,6 +210,11 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ @@ -188,9 +223,11 @@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ -UNISTD_H = @UNISTD_H@ +SYS_TIME_H = @SYS_TIME_H@ VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ @@ -242,59 +279,66 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.5 gnits -noinst_LIBRARIES = libm4.a -libm4_a_SOURCES = allocsa.h allocsa.c gl_avltree_oset.h \ - gl_avltree_oset.c gl_anytree_oset.h binary-io.h clean-temp.h \ - clean-temp.c exit.h fatal-signal.h fatal-signal.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 mbuiter.h gl_oset.h gl_oset.c size_max.h \ - strnlen1.h strnlen1.c tmpdir.h tmpdir.c verify.h verror.h \ - verror.c wcwidth.h xalloc-die.c xallocsa.h xallocsa.c xsize.h \ - 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 closeout.c \ - error.c exitfail.c fopen-safer.c __fpending.c free.c getopt.c \ - getopt1.c malloc.c mbchar.c memchr.c mkdtemp.c mkstemp.c \ - obstack.c quotearg.c regcomp.c regex.c regex_internal.c \ - regexec.c sigprocmask.c mkstemp-safer.c strcasecmp.c \ - strncasecmp.c strstr.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 noinst_HEADERS = +noinst_LIBRARIES = libm4.a +noinst_LTLIBRARIES = EXTRA_DIST = alloca.c alloca_.h allocsa.valgrind cloexec.c cloexec.h \ close-stream.c close-stream.h closeout.c closeout.h error.c \ error.h exitfail.c exitfail.h fopen-safer.c stdio--.h \ stdio-safer.h __fpending.c __fpending.h free.c getopt.c \ - getopt1.c getopt_.h getopt_int.h malloc.c mbchar.c mbchar.h \ - memchr.c mkdtemp.c mkdtemp.h mkstemp.c mkstemp.h obstack.c \ + getopt1.c getopt_.h getopt_int.h gettimeofday.c config.charset \ + ref-add.sin ref-del.sin malloc.c mkdtemp.c mkstemp.c obstack.c \ obstack.h pathmax.h quotearg.c quotearg.h regcomp.c regex.c \ regex.h regex_internal.c regex_internal.h regexec.c \ - sigprocmask.c sigprocmask.h stdbool_.h stdint_.h \ - mkstemp-safer.c stdlib--.h stdlib-safer.h strcase.h \ - strcasecmp.c strncasecmp.c strstr.c strstr.h strtol.c stat_.h \ - tempname.c tempname.h dup-safer.c fd-safer.c pipe-safer.c \ - unistd--.h unistd-safer.h unlocked-io.h asnprintf.c \ - printf-args.c printf-args.h printf-parse.c printf-parse.h \ - vasnprintf.c vasnprintf.h asprintf.c vasprintf.c vasprintf.h \ - xalloc.h xmalloc.c xalloc.h -BUILT_SOURCES = $(ALLOCA_H) $(GETOPT_H) $(STDBOOL_H) $(STDINT_H) \ - $(SYS_STAT_H) $(UNISTD_H) -SUFFIXES = + sigprocmask.c sigprocmask.h stdbool_.h stdint_.h stdlib_.h \ + mkstemp-safer.c stdlib--.h stdlib-safer.h strtol.c stat_.h \ + sys_time_.h tempname.c tempname.h unistd_.h dup-safer.c \ + fd-safer.c pipe-safer.c unistd--.h unistd-safer.h \ + unlocked-io.h asnprintf.c printf-args.c printf-args.h \ + printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h \ + asprintf.c vasprintf.c vasprintf.h wchar_.h wctype_.h xalloc.h \ + xmalloc.c xalloc.h +BUILT_SOURCES = $(ALLOCA_H) configmake.h $(GETOPT_H) $(STDBOOL_H) \ + $(STDINT_H) stdlib.h $(SYS_STAT_H) $(SYS_TIME_H) unistd.h \ + $(WCHAR_H) $(WCTYPE_H) +SUFFIXES = .sed .sin MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t getopt.h \ - getopt.h-t stdbool.h stdbool.h-t stdint.h stdint.h-t \ - sys/stat.h sys/stat.h-t unistd.h + getopt.h-t stdbool.h stdbool.h-t stdint.h stdint.h-t stdlib.h \ + stdlib.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 -CLEANFILES = +CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \ + ref-del.sed DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = +libm4_a_SOURCES = allocsa.h allocsa.c gl_avltree_oset.h \ + gl_avltree_oset.c gl_anytree_oset.h binary-io.h clean-temp.h \ + clean-temp.c fatal-signal.h fatal-signal.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 gl_oset.h \ + gl_oset.c size_max.h tmpdir.h tmpdir.c verify.h verror.h \ + verror.c version-etc.h version-etc.c version-etc-fsf.c \ + xalloc-die.c xallocsa.h xallocsa.c xsize.h 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 closeout.c \ + error.c exitfail.c fopen-safer.c __fpending.c free.c getopt.c \ + getopt1.c gettimeofday.c malloc.c mkdtemp.c mkstemp.c \ + obstack.c quotearg.c regcomp.c regex.c regex_internal.c \ + regexec.c sigprocmask.c mkstemp-safer.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 +LINK_WARNING_H = $(top_srcdir)/./link-warning.h +charset_alias = $(DESTDIR)$(libdir)/charset.alias +charset_tmp = $(DESTDIR)$(libdir)/charset.tmp all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .c .o .obj +.SUFFIXES: .sed .sin .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -349,6 +393,15 @@ libm4.a: $(libm4_a_OBJECTS) $(libm4_a_DE $(libm4_a_AR) libm4.a $(libm4_a_OBJECTS) $(libm4_a_LIBADD) $(RANLIB) libm4.a +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -374,13 +427,13 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_avltree_oset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_linkedhash_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_oset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbchar.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.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@ @@ -394,16 +447,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_internal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strncasecmp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmpdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verror.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc-fsf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xallocsa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xasprintf.Po@am__quote@ @@ -501,7 +552,8 @@ distdir: $(DISTFILES) check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LIBRARIES) $(HEADERS) config.h +all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) config.h \ + all-local installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am @@ -535,7 +587,8 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am -clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am +clean-am: clean-generic clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ + mostlyclean-am distclean: distclean-am -rm -rf $(DEPDIR) ./$(DEPDIR) @@ -557,7 +610,7 @@ install-data-am: install-dvi: install-dvi-am -install-exec-am: +install-exec-am: install-exec-local install-html: install-html-am @@ -589,22 +642,23 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-local .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-hdr distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ + clean-generic clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ + ctags distclean distclean-compile distclean-generic \ + distclean-hdr distclean-tags distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-exec-local install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am tags \ - uninstall uninstall-am + uninstall uninstall-am uninstall-local # We need the following in order to create when the system @@ -615,6 +669,56 @@ alloca.h: alloca_.h } > $@-t mv -f $@-t $@ +# Retrieve values of the variables through 'configure' followed by +# 'make', not directly through 'configure', so that a user who +# sets some of these variables consistently on the 'make' command +# line gets correct results. +# +# One advantage of this approach, compared to the classical +# approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS, +# is that it protects against the use of undefined variables. +# If, say, $(libdir) is not set in the Makefile, LIBDIR is not +# defined by this module, and code using LIBDIR gives a +# compilation error. +# +# Another advantage is that 'make' output is shorter. +# +# Listed in the same order as the GNU makefile conventions. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +configmake.h: Makefile + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t + mv $@-t $@ + # We need the following in order to create when the system # doesn't have one that works with the given compiler. getopt.h: getopt_.h @@ -623,6 +727,49 @@ getopt.h: getopt_.h } > $@-t mv -f $@-t $@ +# We need the following in order to install a simple file in $(libdir) +# which is shared with other installed packages. We use a list of referencing +# packages so that "make uninstall" will remove the file if and only if it +# is not used by another installed package. +# On systems with glibc-2.1 or newer, the file is redundant, therefore we +# avoid installing it. + +all-local: charset.alias ref-add.sed ref-del.sed +install-exec-local: all-local + test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) + 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 \ + sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + fi ; \ + fi + +uninstall-local: all-local + if test -f $(charset_alias); then \ + sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ + if grep '^# Packages using this file: $$' $(charset_tmp) \ + > /dev/null; then \ + rm -f $(charset_alias); \ + else \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ + fi; \ + rm -f $(charset_tmp); \ + fi + +charset.alias: config.charset + rm -f t-$@ $@ + $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ + mv t-$@ $@ +.sin.sed: + rm -f t-$@ $@ + sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ + mv t-$@ $@ + # We need the following in order to create when the system # doesn't have one that works. stdbool.h: stdbool_.h @@ -637,8 +784,7 @@ stdbool.h: stdbool_.h stdint.h: stdint_.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ - -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ + sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ @@ -663,10 +809,27 @@ stdint.h: stdint_.h } > $@-t mv $@-t $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +stdlib.h: stdlib_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''ABSOLUTE_STDLIB_H''@|$(ABSOLUTE_STDLIB_H)|g' \ + -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ + -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ + -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/stdlib_.h; \ + } > $@-t + mv $@-t $@ + # We need the following in order to create when the system # has one that is incomplete. sys/stat.h: stat_.h - test -d sys || mkdir sys + @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \ @@ -674,12 +837,67 @@ sys/stat.h: stat_.h } > $@-t mv $@-t $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/time.h: sys_time_.h + @MKDIR_P@ sys + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ + -e 's|@''ABSOLUTE_SYS_TIME_H''@|$(ABSOLUTE_SYS_TIME_H)|g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + < $(srcdir)/sys_time_.h; \ + } > $@-t + mv $@-t $@ + # We need the following in order to create an empty placeholder for # when the system doesn't have one. -unistd.h: +unistd.h: unistd_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + -e 's|@''ABSOLUTE_UNISTD_H''@|$(ABSOLUTE_UNISTD_H)|g' \ + -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ + -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ + -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ + -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ + -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + < $(srcdir)/unistd_.h; \ + } > $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# version does not work standalone. +wchar.h: wchar_.h + rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - echo '/* Empty placeholder for $@. */'; \ - } > $@ + sed -e 's|@''ABSOLUTE_WCHAR_H''@|$(ABSOLUTE_WCHAR_H)|g' \ + < $(srcdir)/wchar_.h; \ + } > $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +wctype.h: wctype_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ + -e 's|@''ABSOLUTE_WCTYPE_H''@|$(ABSOLUTE_WCTYPE_H)|g' \ + -e 's/@''HAVE_WCTYPE_CTMP_BUG''@/$(HAVE_WCTYPE_CTMP_BUG)/g' \ + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + < $(srcdir)/wctype_.h; \ + } > $@-t + mv $@-t $@ mostlyclean-local: mostlyclean-generic @for dir in '' $(MOSTLYCLEANDIRS); do \ diff -ruNp m4-1.4.8/lib/allocsa.h m4-1.4.9/lib/allocsa.h --- m4-1.4.8/lib/allocsa.h 2006-11-20 06:57:25.000000000 -0700 +++ m4-1.4.9/lib/allocsa.h 2007-03-23 06:50:40.000000000 -0600 @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2006 Free Software Foundation, Inc. + Copyright (C) 2003-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -106,17 +106,17 @@ enum among all elementary types. */ sa_alignment_long = sa_alignof (long), sa_alignment_double = sa_alignof (double), -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT sa_alignment_longlong = sa_alignof (long long), #endif -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE sa_alignment_longdouble = sa_alignof (long double), #endif sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1) -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT | (sa_alignment_longlong - 1) #endif -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE | (sa_alignment_longdouble - 1) #endif ) + 1, diff -ruNp m4-1.4.8/lib/clean-temp.c m4-1.4.9/lib/clean-temp.c --- m4-1.4.8/lib/clean-temp.c 2006-11-20 07:22:53.000000000 -0700 +++ m4-1.4.9/lib/clean-temp.c 2007-03-23 06:50:41.000000000 -0600 @@ -1,5 +1,5 @@ /* Temporary directories and temporary files with automatic cleanup. - Copyright (C) 2001, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify @@ -30,11 +30,15 @@ #include #include +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include +#endif + #include "error.h" #include "fatal-signal.h" #include "pathmax.h" #include "tmpdir.h" -#include "mkdtemp.h" #include "xalloc.h" #include "xallocsa.h" #include "gl_linkedhash_list.h" @@ -67,6 +71,13 @@ # define uintptr_t unsigned long #endif +#if !GNULIB_FCNTL_SAFER +/* The results of open() in this file are not used with fchdir, + therefore save some unnecessary work in fchdir.c. */ +# undef open +# undef close +#endif + /* The use of 'volatile' in the types below (and ISO C 99 section 5.1.2.3.(5)) ensure that while constructing or modifying the data structures, the field @@ -309,9 +320,11 @@ create_temp_dir (const char *prefix, con tmpdir->dirname = NULL; tmpdir->cleanup_verbose = cleanup_verbose; tmpdir->subdirs = gl_list_create_empty (GL_LINKEDHASH_LIST, - string_equals, string_hash, false); + string_equals, string_hash, NULL, + false); tmpdir->files = gl_list_create_empty (GL_LINKEDHASH_LIST, - string_equals, string_hash, false); + string_equals, string_hash, NULL, + false); /* Create the temporary directory. */ xtemplate = (char *) xallocsa (PATH_MAX); @@ -556,12 +569,40 @@ cleanup_temp_dir (struct temp_dir *dir) } +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* On Windows, opening a file with _O_TEMPORARY has the effect of passing + the FILE_FLAG_DELETE_ON_CLOSE flag to CreateFile(), which has the effect + of deleting the file when it is closed - even when the program crashes. + But (according to the Cygwin sources) it works only on Windows NT or newer. + So we cache the info whether we are running on Windows NT or newer. */ + +static bool +supports_delete_on_close () +{ + static int known; /* 1 = yes, -1 = no, 0 = unknown */ + if (!known) + { + OSVERSIONINFO v; + + if (GetVersionEx (&v)) + known = (v.dwPlatformId == VER_PLATFORM_WIN32_NT ? 1 : -1); + else + known = -1; + } + return (known > 0); +} + +#endif + + /* Register a file descriptor to be closed. */ static void register_fd (int fd) { if (descriptors == NULL) - descriptors = gl_list_create_empty (GL_LINKEDHASH_LIST, NULL, NULL, false); + descriptors = gl_list_create_empty (GL_LINKEDHASH_LIST, NULL, NULL, NULL, + false); gl_list_add_first (descriptors, (void *) (uintptr_t) fd); } @@ -591,7 +632,15 @@ open_temp (const char *file_name, int fl int saved_errno; block_fatal_signals (); - fd = open (file_name, flags, mode); /* actually open or open_safer */ + /* Note: 'open' here is actually open() or open_safer(). */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* Use _O_TEMPORARY when possible, to increase the chances that the + temporary file is removed when the process crashes. */ + if (supports_delete_on_close ()) + fd = open (file_name, flags | _O_TEMPORARY, mode); + else +#endif + fd = open (file_name, flags, mode); saved_errno = errno; if (fd >= 0) register_fd (fd); @@ -609,8 +658,28 @@ fopen_temp (const char *file_name, const int saved_errno; block_fatal_signals (); - fp = fopen (file_name, mode); /* actually fopen or fopen_safer */ - saved_errno = errno; + /* Note: 'fopen' here is actually fopen() or fopen_safer(). */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* Use _O_TEMPORARY when possible, to increase the chances that the + temporary file is removed when the process crashes. */ + if (supports_delete_on_close ()) + { + size_t mode_len = strlen (mode); + char *augmented_mode = (char *) xallocsa (mode_len + 2); + memcpy (augmented_mode, mode, mode_len); + memcpy (augmented_mode + mode_len, "D", 2); + + fp = fopen (file_name, augmented_mode); + saved_errno = errno; + + freesa (augmented_mode); + } + else +#endif + { + fp = fopen (file_name, mode); + saved_errno = errno; + } if (fp != NULL) { /* It is sufficient to register fileno (fp) instead of the entire fp, diff -ruNp m4-1.4.8/lib/config.charset m4-1.4.9/lib/config.charset --- m4-1.4.8/lib/config.charset 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/config.charset 2007-03-23 06:50:43.000000000 -0600 @@ -0,0 +1,639 @@ +#! /bin/sh +# Output a system dependent table of character encoding aliases. +# +# Copyright (C) 2000-2004, 2006 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# The table consists of lines of the form +# ALIAS CANONICAL +# +# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". +# ALIAS is compared in a case sensitive way. +# +# CANONICAL is the GNU canonical name for this character encoding. +# It must be an encoding supported by libiconv. Support by GNU libc is +# also desirable. CANONICAL is case insensitive. Usually an upper case +# MIME charset name is preferred. +# The current list of GNU canonical charset names is as follows. +# +# name MIME? used by which systems +# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin +# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd darwin +# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd darwin +# ISO-8859-3 Y glibc solaris +# ISO-8859-4 Y osf solaris freebsd netbsd darwin +# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd darwin +# ISO-8859-6 Y glibc aix hpux solaris +# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd darwin +# ISO-8859-8 Y glibc aix hpux osf solaris +# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin +# ISO-8859-13 glibc netbsd darwin +# ISO-8859-14 glibc +# ISO-8859-15 glibc aix osf solaris freebsd darwin +# KOI8-R Y glibc solaris freebsd netbsd darwin +# KOI8-U Y glibc freebsd netbsd darwin +# KOI8-T glibc +# CP437 dos +# CP775 dos +# CP850 aix osf dos +# CP852 dos +# CP855 dos +# CP856 aix +# CP857 dos +# CP861 dos +# CP862 dos +# CP864 dos +# CP865 dos +# CP866 freebsd netbsd darwin dos +# CP869 dos +# CP874 woe32 dos +# CP922 aix +# CP932 aix woe32 dos +# CP943 aix +# CP949 osf woe32 dos +# CP950 woe32 dos +# CP1046 aix +# CP1124 aix +# CP1125 dos +# CP1129 aix +# CP1250 woe32 +# CP1251 glibc solaris netbsd darwin woe32 +# CP1252 aix woe32 +# CP1253 woe32 +# CP1254 woe32 +# CP1255 glibc woe32 +# CP1256 woe32 +# CP1257 woe32 +# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin +# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin +# 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 +# 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 +# GEORGIAN-PS glibc +# HP-ROMAN8 hpux +# HP-ARABIC8 hpux +# HP-GREEK8 hpux +# HP-HEBREW8 hpux +# HP-TURKISH8 hpux +# HP-KANA8 hpux +# DEC-KANJI osf +# DEC-HANYU osf +# UTF-8 Y glibc aix hpux osf solaris netbsd darwin +# +# Note: Names which are not marked as being a MIME name should not be used in +# Internet protocols for information interchange (mail, news, etc.). +# +# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications +# must understand both names and treat them as equivalent. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + +host="$1" +os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` +echo "# This file contains a table of character encoding aliases," +echo "# suitable for operating system '${os}'." +echo "# It was automatically generated from config.charset." +# List of references, updated during installation: +echo "# Packages using this file: " +case "$os" in + linux-gnulibc1*) + # Linux libc5 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "C ASCII" + echo "POSIX ASCII" + for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \ + en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \ + en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \ + es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \ + et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \ + fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \ + it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \ + sv_FI sv_SE; do + echo "$l ISO-8859-1" + echo "$l.iso-8859-1 ISO-8859-1" + echo "$l.iso-8859-15 ISO-8859-15" + echo "$l.iso-8859-15@euro ISO-8859-15" + echo "$l@euro ISO-8859-15" + echo "$l.cp-437 CP437" + echo "$l.cp-850 CP850" + echo "$l.cp-1252 CP1252" + echo "$l.cp-1252@euro CP1252" + #echo "$l.atari-st ATARI-ST" # not a commonly used encoding + echo "$l.utf-8 UTF-8" + echo "$l.utf-8@euro UTF-8" + done + for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \ + sl_SI sr sr_CS sr_YU; do + echo "$l ISO-8859-2" + echo "$l.iso-8859-2 ISO-8859-2" + echo "$l.cp-852 CP852" + echo "$l.cp-1250 CP1250" + echo "$l.utf-8 UTF-8" + done + for l in mk mk_MK ru ru_RU; do + echo "$l ISO-8859-5" + echo "$l.iso-8859-5 ISO-8859-5" + echo "$l.koi8-r KOI8-R" + echo "$l.cp-866 CP866" + echo "$l.cp-1251 CP1251" + echo "$l.utf-8 UTF-8" + done + for l in ar ar_SA; do + echo "$l ISO-8859-6" + echo "$l.iso-8859-6 ISO-8859-6" + echo "$l.cp-864 CP864" + #echo "$l.cp-868 CP868" # not a commonly used encoding + echo "$l.cp-1256 CP1256" + echo "$l.utf-8 UTF-8" + done + for l in el el_GR gr gr_GR; do + echo "$l ISO-8859-7" + echo "$l.iso-8859-7 ISO-8859-7" + echo "$l.cp-869 CP869" + echo "$l.cp-1253 CP1253" + echo "$l.cp-1253@euro CP1253" + echo "$l.utf-8 UTF-8" + echo "$l.utf-8@euro UTF-8" + done + for l in he he_IL iw iw_IL; do + echo "$l ISO-8859-8" + echo "$l.iso-8859-8 ISO-8859-8" + echo "$l.cp-862 CP862" + echo "$l.cp-1255 CP1255" + echo "$l.utf-8 UTF-8" + done + for l in tr tr_TR; do + echo "$l ISO-8859-9" + echo "$l.iso-8859-9 ISO-8859-9" + echo "$l.cp-857 CP857" + echo "$l.cp-1254 CP1254" + echo "$l.utf-8 UTF-8" + done + for l in lt lt_LT lv lv_LV; do + #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name + echo "$l ISO-8859-13" + done + for l in ru_UA uk uk_UA; do + echo "$l KOI8-U" + done + for l in zh zh_CN; do + #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name + echo "$l GB2312" + done + for l in ja ja_JP ja_JP.EUC; do + echo "$l EUC-JP" + done + for l in ko ko_KR; do + echo "$l EUC-KR" + done + for l in th th_TH; do + echo "$l TIS-620" + done + for l in fa fa_IR; do + #echo "$l ISIRI-3342" # a broken encoding + echo "$l.utf-8 UTF-8" + done + ;; + linux* | *-gnu*) + # With glibc-2.1 or newer, we don't need any canonicalization, + # because glibc has iconv and both glibc and libiconv support all + # GNU canonical names directly. Therefore, the Makefile does not + # need to install the alias file at all. + # The following applies only to glibc-2.0.x and older libcs. + echo "ISO_646.IRV:1983 ASCII" + ;; + aix*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-6 ISO-8859-6" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "IBM-850 CP850" + echo "IBM-856 CP856" + echo "IBM-921 ISO-8859-13" + echo "IBM-922 CP922" + echo "IBM-932 CP932" + echo "IBM-943 CP943" + echo "IBM-1046 CP1046" + echo "IBM-1124 CP1124" + echo "IBM-1129 CP1129" + echo "IBM-1252 CP1252" + echo "IBM-eucCN GB2312" + echo "IBM-eucJP EUC-JP" + echo "IBM-eucKR EUC-KR" + echo "IBM-eucTW EUC-TW" + echo "big5 BIG5" + echo "GBK GBK" + echo "TIS-620 TIS-620" + echo "UTF-8 UTF-8" + ;; + hpux*) + echo "iso88591 ISO-8859-1" + echo "iso88592 ISO-8859-2" + echo "iso88595 ISO-8859-5" + echo "iso88596 ISO-8859-6" + echo "iso88597 ISO-8859-7" + echo "iso88598 ISO-8859-8" + echo "iso88599 ISO-8859-9" + echo "iso885915 ISO-8859-15" + echo "roman8 HP-ROMAN8" + echo "arabic8 HP-ARABIC8" + echo "greek8 HP-GREEK8" + echo "hebrew8 HP-HEBREW8" + echo "turkish8 HP-TURKISH8" + echo "kana8 HP-KANA8" + echo "tis620 TIS-620" + echo "big5 BIG5" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "hp15CN GB2312" + #echo "ccdc ?" # what is this? + echo "SJIS SHIFT_JIS" + echo "utf8 UTF-8" + ;; + irix*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-9 ISO-8859-9" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + ;; + osf*) + 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-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "cp850 CP850" + echo "big5 BIG5" + echo "dechanyu DEC-HANYU" + echo "dechanzi GB2312" + echo "deckanji DEC-KANJI" + echo "deckorean EUC-KR" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "GBK GBK" + echo "KSC5601 CP949" + echo "sdeckanji EUC-JP" + echo "SJIS SHIFT_JIS" + echo "TACTIS TIS-620" + echo "UTF-8 UTF-8" + ;; + solaris*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-3 ISO-8859-3" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-6 ISO-8859-6" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "koi8-r KOI8-R" + echo "ansi-1251 CP1251" + echo "BIG5 BIG5" + echo "Big5-HKSCS BIG5-HKSCS" + echo "gb2312 GB2312" + echo "GBK GBK" + echo "GB18030 GB18030" + echo "cns11643 EUC-TW" + echo "5601 EUC-KR" + echo "ko_KR.johap92 JOHAB" + echo "eucJP EUC-JP" + echo "PCK SHIFT_JIS" + echo "TIS620.2533 TIS-620" + #echo "sun_eu_greek ?" # what is this? + echo "UTF-8 UTF-8" + ;; + freebsd* | os2*) + # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just + # reuse FreeBSD's locale data for OS/2. + echo "C ASCII" + echo "US-ASCII ASCII" + for l in la_LN lt_LN; do + echo "$l.ASCII ASCII" + done + for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ + lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do + echo "$l.ISO_8859-1 ISO-8859-1" + echo "$l.DIS_8859-15 ISO-8859-15" + done + for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do + echo "$l.ISO_8859-2 ISO-8859-2" + done + for l in la_LN lt_LT; do + echo "$l.ISO_8859-4 ISO-8859-4" + done + for l in ru_RU ru_SU; do + echo "$l.KOI8-R KOI8-R" + echo "$l.ISO_8859-5 ISO-8859-5" + echo "$l.CP866 CP866" + done + echo "uk_UA.KOI8-U KOI8-U" + echo "zh_TW.BIG5 BIG5" + echo "zh_TW.Big5 BIG5" + echo "zh_CN.EUC GB2312" + echo "ja_JP.EUC EUC-JP" + echo "ja_JP.SJIS SHIFT_JIS" + echo "ja_JP.Shift_JIS SHIFT_JIS" + echo "ko_KR.EUC EUC-KR" + ;; + netbsd*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-13 ISO-8859-13" + echo "ISO8859-15 ISO-8859-15" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "BIG5 BIG5" + echo "SJIS SHIFT_JIS" + ;; + darwin[56]*) + # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "C ASCII" + for l in en_AU en_CA en_GB en_US la_LN; do + echo "$l.US-ASCII ASCII" + done + for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \ + nl_NL no_NO pt_PT sv_SE; do + echo "$l ISO-8859-1" + echo "$l.ISO8859-1 ISO-8859-1" + echo "$l.ISO8859-15 ISO-8859-15" + done + for l in la_LN; do + echo "$l.ISO8859-1 ISO-8859-1" + echo "$l.ISO8859-15 ISO-8859-15" + done + for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do + echo "$l.ISO8859-2 ISO-8859-2" + done + for l in la_LN lt_LT; do + echo "$l.ISO8859-4 ISO-8859-4" + done + for l in ru_RU; do + echo "$l.KOI8-R KOI8-R" + echo "$l.ISO8859-5 ISO-8859-5" + echo "$l.CP866 CP866" + done + for l in bg_BG; do + echo "$l.CP1251 CP1251" + done + echo "uk_UA.KOI8-U KOI8-U" + echo "zh_TW.BIG5 BIG5" + echo "zh_TW.Big5 BIG5" + echo "zh_CN.EUC GB2312" + echo "ja_JP.EUC EUC-JP" + echo "ja_JP.SJIS SHIFT_JIS" + echo "ko_KR.EUC EUC-KR" + ;; + darwin*) + # Darwin 7.5 has nl_langinfo(CODESET), but it 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. + # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by + # the system; nl_langinfo(CODESET) returns "US-ASCII" in this case. + # - The documentation says: + # "... all code that calls BSD system routines should ensure + # that the const *char parameters of these routines are in UTF-8 + # encoding. All BSD system functions expect their string + # parameters to be in UTF-8 encoding and nothing else." + # It also says + # "An additional caveat is that string parameters for files, + # paths, and other file-system entities must be in canonical + # UTF-8. In a canonical UTF-8 Unicode string, all decomposable + # characters are decomposed ..." + # but this is not true: You can pass non-decomposed UTF-8 strings + # to file system functions, and it is the OS which will convert + # them to decomposed UTF-8 before accessing the file system. + # - The Apple Terminal application displays UTF-8 by default. + # - However, other applications are free to use different encodings: + # - xterm uses ISO-8859-1 by default. + # - TextEdit uses MacRoman by default. + # We prefer UTF-8 over decomposed UTF-8-MAC because one should + # minimize the use of decomposed Unicode. Unfortunately, through the + # Darwin file system, decomposed UTF-8 strings are leaked into user + # space nevertheless. + echo "* UTF-8" + ;; + beos*) + # BeOS has a single locale, and it has UTF-8 encoding. + echo "* UTF-8" + ;; + msdosdjgpp*) + # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "#" + echo "# The encodings given here may not all be correct." + echo "# If you find that the encoding given for your language and" + echo "# country is not the one your DOS machine actually uses, just" + echo "# correct it in this file, and send a mail to" + echo "# Juan Manuel Guerrero " + echo "# and Bruno Haible ." + echo "#" + echo "C ASCII" + # ISO-8859-1 languages + echo "ca CP850" + echo "ca_ES CP850" + echo "da CP865" # not CP850 ?? + echo "da_DK CP865" # not CP850 ?? + echo "de CP850" + echo "de_AT CP850" + echo "de_CH CP850" + echo "de_DE CP850" + echo "en CP850" + echo "en_AU CP850" # not CP437 ?? + echo "en_CA CP850" + echo "en_GB CP850" + echo "en_NZ CP437" + echo "en_US CP437" + echo "en_ZA CP850" # not CP437 ?? + echo "es CP850" + echo "es_AR CP850" + echo "es_BO CP850" + echo "es_CL CP850" + echo "es_CO CP850" + echo "es_CR CP850" + echo "es_CU CP850" + echo "es_DO CP850" + echo "es_EC CP850" + echo "es_ES CP850" + echo "es_GT CP850" + echo "es_HN CP850" + echo "es_MX CP850" + echo "es_NI CP850" + echo "es_PA CP850" + echo "es_PY CP850" + echo "es_PE CP850" + echo "es_SV CP850" + echo "es_UY CP850" + echo "es_VE CP850" + echo "et CP850" + echo "et_EE CP850" + echo "eu CP850" + echo "eu_ES CP850" + echo "fi CP850" + echo "fi_FI CP850" + echo "fr CP850" + echo "fr_BE CP850" + echo "fr_CA CP850" + echo "fr_CH CP850" + echo "fr_FR CP850" + echo "ga CP850" + echo "ga_IE CP850" + echo "gd CP850" + echo "gd_GB CP850" + echo "gl CP850" + echo "gl_ES CP850" + echo "id CP850" # not CP437 ?? + echo "id_ID CP850" # not CP437 ?? + echo "is CP861" # not CP850 ?? + echo "is_IS CP861" # not CP850 ?? + echo "it CP850" + echo "it_CH CP850" + echo "it_IT CP850" + echo "lt CP775" + echo "lt_LT CP775" + echo "lv CP775" + echo "lv_LV CP775" + echo "nb CP865" # not CP850 ?? + echo "nb_NO CP865" # not CP850 ?? + echo "nl CP850" + echo "nl_BE CP850" + echo "nl_NL CP850" + echo "nn CP865" # not CP850 ?? + echo "nn_NO CP865" # not CP850 ?? + echo "no CP865" # not CP850 ?? + echo "no_NO CP865" # not CP850 ?? + echo "pt CP850" + echo "pt_BR CP850" + echo "pt_PT CP850" + echo "sv CP850" + echo "sv_SE CP850" + # ISO-8859-2 languages + echo "cs CP852" + echo "cs_CZ CP852" + echo "hr CP852" + echo "hr_HR CP852" + echo "hu CP852" + echo "hu_HU CP852" + echo "pl CP852" + echo "pl_PL CP852" + echo "ro CP852" + echo "ro_RO CP852" + echo "sk CP852" + echo "sk_SK CP852" + echo "sl CP852" + echo "sl_SI CP852" + echo "sq CP852" + echo "sq_AL CP852" + echo "sr CP852" # CP852 or CP866 or CP855 ?? + echo "sr_CS CP852" # CP852 or CP866 or CP855 ?? + echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? + # ISO-8859-3 languages + echo "mt CP850" + echo "mt_MT CP850" + # ISO-8859-5 languages + echo "be CP866" + echo "be_BE CP866" + echo "bg CP866" # not CP855 ?? + echo "bg_BG CP866" # not CP855 ?? + echo "mk CP866" # not CP855 ?? + echo "mk_MK CP866" # not CP855 ?? + echo "ru CP866" + echo "ru_RU CP866" + echo "uk CP1125" + echo "uk_UA CP1125" + # ISO-8859-6 languages + echo "ar CP864" + echo "ar_AE CP864" + echo "ar_DZ CP864" + echo "ar_EG CP864" + echo "ar_IQ CP864" + echo "ar_IR CP864" + echo "ar_JO CP864" + echo "ar_KW CP864" + echo "ar_MA CP864" + echo "ar_OM CP864" + echo "ar_QA CP864" + echo "ar_SA CP864" + echo "ar_SY CP864" + # ISO-8859-7 languages + echo "el CP869" + echo "el_GR CP869" + # ISO-8859-8 languages + echo "he CP862" + echo "he_IL CP862" + # ISO-8859-9 languages + echo "tr CP857" + echo "tr_TR CP857" + # Japanese + echo "ja CP932" + echo "ja_JP CP932" + # Chinese + echo "zh_CN GBK" + echo "zh_TW CP950" # not CP938 ?? + # Korean + echo "kr CP949" # not CP934 ?? + echo "kr_KR CP949" # not CP934 ?? + # Thai + echo "th CP874" + echo "th_TH CP874" + # Other + echo "eo CP850" + echo "eo_EO CP850" + ;; +esac diff -ruNp m4-1.4.8/lib/config.hin m4-1.4.9/lib/config.hin --- m4-1.4.8/lib/config.hin 2006-11-20 07:28:09.000000000 -0700 +++ m4-1.4.9/lib/config.hin 2007-03-23 07:35:12.000000000 -0600 @@ -3,9 +3,24 @@ /* Define this to an absolute name of . */ #undef ABSOLUTE_STDINT_H +/* Define this to an absolute name of . */ +#undef ABSOLUTE_STDLIB_H + /* Define this to an absolute name of . */ #undef ABSOLUTE_SYS_STAT_H +/* Define this to an absolute name of . */ +#undef ABSOLUTE_SYS_TIME_H + +/* Define this to an absolute name of . */ +#undef ABSOLUTE_UNISTD_H + +/* Define this to an absolute name of . */ +#undef ABSOLUTE_WCHAR_H + +/* Define this to an absolute name of . */ +#undef ABSOLUTE_WCTYPE_H + /* Define to the number of bits in type 'ptrdiff_t'. */ #undef BITSIZEOF_PTRDIFF_T @@ -38,10 +53,13 @@ /* Define to 1 if the return value of system() disagrees with pclose(). */ #undef FUNC_SYSTEM_BROKEN -/* Define to 1 when using the gnulib close-stream module. */ +/* Define if gettimeofday clobbers the localtime buffer. */ +#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME + +/* Define to 1 when using the gnulib module close-stream. */ #undef GNULIB_CLOSE_STREAM -/* Define to 1 when using the gnulib fopen-safer module. */ +/* Define to 1 when using the gnulib module fopen-safer. */ #undef GNULIB_FOPEN_SAFER /* Define to 1 if you have 'alloca' after including , a header that @@ -52,9 +70,6 @@ includes only if HAVE_ALLOCA_H is defined. */ #undef HAVE_ALLOCA_H -/* Define to 1 if you have the header file. */ -#undef HAVE_BP_SYM_H - /* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_CLEARERR_UNLOCKED @@ -123,14 +138,6 @@ don't. */ #undef HAVE_DECL_STRERROR_R -/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you - don't. */ -#undef HAVE_DECL_STRNCASECMP - -/* Define to 1 if you have the declaration of `wcwidth', and to 0 if you - don't. */ -#undef HAVE_DECL_WCWIDTH - /* Define to 1 if you have the declaration of `__fpending', and to 0 if you don't. */ #undef HAVE_DECL___FPENDING @@ -165,8 +172,8 @@ /* Define to 1 if you have the `iswcntrl' function. */ #undef HAVE_ISWCNTRL -/* Define to 1 if you have the `iswprint' function. */ -#undef HAVE_ISWPRINT +/* Define to 1 if you have the `iswctype' function. */ +#undef HAVE_ISWCTYPE /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET @@ -202,15 +209,9 @@ /* Define to 1 if 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 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 `mkdtemp' function. */ #undef HAVE_MKDTEMP @@ -275,6 +276,9 @@ /* Define to 1 if the system has the type `stack_t'. */ #undef HAVE_STACK_T +/* Define to 1 if `ss_sp' is member of `stack_t'. */ +#undef HAVE_STACK_T_SS_SP + /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H @@ -303,9 +307,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strncasecmp' function. */ -#undef HAVE_STRNCASECMP - /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL @@ -324,6 +325,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIMEB_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H @@ -363,15 +367,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H -/* Define to 1 if you have the `wcwidth' function. */ -#undef HAVE_WCWIDTH - /* Define if you have the 'wint_t' type. */ #undef HAVE_WINT_T /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL +/* Define to 1 if you have the `_ftime' function. */ +#undef HAVE__FTIME + /* Define to 1 if you have the `__fpending' function. */ #undef HAVE___FPENDING @@ -406,6 +410,12 @@ 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX +/* Define if vasnprintf exists but is overridden by gnulib. */ +#undef REPLACE_VASNPRINTF + +/* Define if vasprintf exists but is overridden by gnulib. */ +#undef REPLACE_VASPRINTF + /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE @@ -509,15 +519,15 @@ used. */ #undef __GETOPT_PREFIX -/* Define to rpl_ if the mkstemp replacement function should be used. */ -#undef __MKSTEMP_PREFIX - /* Define to rpl_free if the replacement function should be used. */ #undef free /* A replacement for va_copy, if needed. */ #define gl_va_copy(a,b) ((a) = (b)) +/* Define to rpl_gmtime if the replacement function should be used. */ +#undef gmtime + /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus @@ -527,6 +537,9 @@ /* Define to long or long long if and don't define. */ #undef intmax_t +/* Define to rpl_localtime if the replacement function should be used. */ +#undef localtime + /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc diff -ruNp m4-1.4.8/lib/dup-safer.c m4-1.4.9/lib/dup-safer.c --- m4-1.4.8/lib/dup-safer.c 2006-09-23 22:28:33.000000000 -0600 +++ m4-1.4.9/lib/dup-safer.c 2007-03-23 06:50:43.000000000 -0600 @@ -35,7 +35,7 @@ int dup_safer (int fd) { -#ifdef F_DUPFD +#if defined F_DUPFD && !defined FCHDIR_REPLACEMENT return fcntl (fd, F_DUPFD, STDERR_FILENO + 1); #else /* fd_safer calls us back, but eventually the recursion unwinds and diff -ruNp m4-1.4.8/lib/exit.h m4-1.4.9/lib/exit.h --- m4-1.4.8/lib/exit.h 2006-09-23 22:28:34.000000000 -0600 +++ m4-1.4.9/lib/exit.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,32 +0,0 @@ -/* exit() function. - Copyright (C) 1995, 2001 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _EXIT_H -#define _EXIT_H - -/* Get exit() declaration. */ -#include - -/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ -#ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -#endif -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - -#endif /* _EXIT_H */ diff -ruNp m4-1.4.8/lib/exitfail.c m4-1.4.9/lib/exitfail.c --- m4-1.4.8/lib/exitfail.c 2006-09-23 22:28:34.000000000 -0600 +++ m4-1.4.9/lib/exitfail.c 2007-03-23 06:50:44.000000000 -0600 @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #include #include "exitfail.h" -#include "exit.h" + +#include int volatile exit_failure = EXIT_FAILURE; diff -ruNp m4-1.4.8/lib/getopt_.h m4-1.4.9/lib/getopt_.h --- m4-1.4.8/lib/getopt_.h 2006-11-20 07:22:57.000000000 -0700 +++ m4-1.4.9/lib/getopt_.h 2007-03-23 06:50:46.000000000 -0600 @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006 + Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -101,7 +101,7 @@ # endif #endif -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -216,7 +216,7 @@ extern int getopt_long_only (int ___argc #endif -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff -ruNp m4-1.4.8/lib/gettext.h m4-1.4.9/lib/gettext.h --- m4-1.4.8/lib/gettext.h 2006-11-20 07:22:57.000000000 -0700 +++ m4-1.4.9/lib/gettext.h 2007-03-23 06:50:46.000000000 -0600 @@ -169,7 +169,8 @@ npgettext_aux (const char *domain, #include #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ - (__GNUC__ >= 3 || __GNUG__ >= 2 /* || __STDC_VERSION__ >= 199901L */ ) + (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ + /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include diff -ruNp m4-1.4.8/lib/gettimeofday.c m4-1.4.9/lib/gettimeofday.c --- m4-1.4.8/lib/gettimeofday.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/gettimeofday.c 2007-03-23 06:50:46.000000000 -0600 @@ -0,0 +1,142 @@ +/* Provide gettimeofday for systems that don't have it or for which it's broken. + + Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* written by Jim Meyering */ + +#include + +/* Specification. */ +#include + +#include + +#if HAVE_SYS_TIMEB_H +# include +#endif + +#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME + +/* Work around the bug in some systems whereby gettimeofday clobbers + the static buffer that localtime uses for its return value. The + gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has + this problem. The tzset replacement is necessary for at least + Solaris 2.5, 2.5.1, and 2.6. */ + +static struct tm tm_zero_buffer; +static struct tm *localtime_buffer_addr = &tm_zero_buffer; + +/* This is a wrapper for localtime. It is used only on systems for which + gettimeofday clobbers the static buffer used for localtime's result. + + On the first call, record the address of the static buffer that + localtime uses for its result. */ + +struct tm * +localtime (time_t const *timep) +{ +#undef localtime + extern struct tm *localtime (time_t const *); + struct tm *tm = localtime (timep); + + if (localtime_buffer_addr == &tm_zero_buffer) + localtime_buffer_addr = tm; + + return tm; +} + +/* Same as above, since gmtime and localtime use the same buffer. */ +struct tm * +gmtime (time_t const *timep) +{ +#undef gmtime + extern struct tm *gmtime (time_t const *); + struct tm *tm = gmtime (timep); + + if (localtime_buffer_addr == &tm_zero_buffer) + localtime_buffer_addr = tm; + + return tm; +} + +#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */ + +#if TZSET_CLOBBERS_LOCALTIME +/* This is a wrapper for tzset, for systems on which tzset may clobber + the static buffer used for localtime's result. */ +void +tzset (void) +{ +#undef tzset + extern void tzset (void); + + /* Save and restore the contents of the buffer used for localtime's + result around the call to tzset. */ + struct tm save = *localtime_buffer_addr; + tzset (); + *localtime_buffer_addr = save; +} +#endif + +/* This is a wrapper for gettimeofday. It is used only on systems + that lack this function, or whose implementation of this function + causes problems. */ + +int +rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz) +{ +#undef gettimeofday +#if HAVE_GETTIMEOFDAY +# if GETTIMEOFDAY_CLOBBERS_LOCALTIME + /* Save and restore the contents of the buffer used for localtime's + result around the call to gettimeofday. */ + struct tm save = *localtime_buffer_addr; +# endif + + int result = gettimeofday (tv, tz); + +# if GETTIMEOFDAY_CLOBBERS_LOCALTIME + *localtime_buffer_addr = save; +# endif + + return result; + +#else + +# if HAVE__FTIME + + struct _timeb timebuf; + _ftime (&timebuf); + tv->tv_sec = timebuf.time; + tv->tv_usec = timebuf.millitm * 1000; + +# else + +# if !defined OK_TO_USE_1S_CLOCK +# error "Only 1-second nominal clock resolution found. Is that intended?" \ + "If so, compile with the -DOK_TO_USE_1S_CLOCK option." +# endif + tv->tv_sec = time (NULL); + tv->tv_usec = 0; + +# endif + + return 0; + +#endif +} diff -ruNp m4-1.4.8/lib/gl_anylinked_list2.h m4-1.4.9/lib/gl_anylinked_list2.h --- m4-1.4.8/lib/gl_anylinked_list2.h 2006-11-20 07:22:58.000000000 -0700 +++ m4-1.4.9/lib/gl_anylinked_list2.h 2007-03-23 06:50:48.000000000 -0600 @@ -1,5 +1,5 @@ /* Sequential list data type implemented by a linked list. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify @@ -41,6 +41,7 @@ static gl_list_t gl_linked_create_empty (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates) { struct gl_list_impl *list = XMALLOC (struct gl_list_impl); @@ -48,6 +49,7 @@ gl_linked_create_empty (gl_list_implemen list->base.vtable = implementation; list->base.equals_fn = equals_fn; list->base.hashcode_fn = hashcode_fn; + list->base.dispose_fn = dispose_fn; list->base.allow_duplicates = allow_duplicates; #if WITH_HASHTABLE list->table_size = 11; @@ -64,6 +66,7 @@ static gl_list_t gl_linked_create (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates, size_t count, const void **contents) { @@ -73,6 +76,7 @@ gl_linked_create (gl_list_implementation list->base.vtable = implementation; list->base.equals_fn = equals_fn; list->base.hashcode_fn = hashcode_fn; + list->base.dispose_fn = dispose_fn; list->base.allow_duplicates = allow_duplicates; #if WITH_HASHTABLE { @@ -684,6 +688,8 @@ gl_linked_remove_node (gl_list_t list, g next->prev = prev; list->count--; + if (list->base.dispose_fn != NULL) + list->base.dispose_fn (node->value); free (node); return true; } @@ -730,6 +736,8 @@ gl_linked_remove_at (gl_list_t list, siz #endif list->count--; + if (list->base.dispose_fn != NULL) + list->base.dispose_fn (removed_node->value); free (removed_node); return true; } @@ -748,11 +756,14 @@ gl_linked_remove (gl_list_t list, const static void gl_linked_list_free (gl_list_t list) { + gl_listelement_dispose_fn dispose = list->base.dispose_fn; gl_list_node_t node; for (node = list->root.next; node != &list->root; ) { gl_list_node_t next = node->next; + if (dispose != NULL) + dispose (node->value); free (node); node = next; } diff -ruNp m4-1.4.8/lib/gl_anytree_oset.h m4-1.4.9/lib/gl_anytree_oset.h --- m4-1.4.8/lib/gl_anytree_oset.h 2006-11-20 07:22:58.000000000 -0700 +++ m4-1.4.9/lib/gl_anytree_oset.h 2007-03-23 06:50:48.000000000 -0600 @@ -1,5 +1,5 @@ /* Ordered set data type implemented by a binary tree. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify @@ -30,12 +30,14 @@ typedef iterstack_item_t iterstack_t[MAX static gl_oset_t gl_tree_create_empty (gl_oset_implementation_t implementation, - gl_setelement_compar_fn compar_fn) + gl_setelement_compar_fn compar_fn, + gl_setelement_dispose_fn dispose_fn) { struct gl_oset_impl *set = XMALLOC (struct gl_oset_impl); set->base.vtable = implementation; set->base.compar_fn = compar_fn; + set->base.dispose_fn = dispose_fn; set->root = NULL; set->count = 0; @@ -216,6 +218,8 @@ gl_tree_oset_free (gl_oset_t set) if (!stack_ptr->rightp) break; /* Free the current node. */ + if (set->base.dispose_fn != NULL) + set->base.dispose_fn (node->value); free (node); } /* Descend on right branch. */ diff -ruNp m4-1.4.8/lib/gl_avltree_oset.c m4-1.4.9/lib/gl_avltree_oset.c --- m4-1.4.8/lib/gl_avltree_oset.c 2006-11-20 07:22:58.000000000 -0700 +++ m4-1.4.9/lib/gl_avltree_oset.c 2007-03-23 06:50:48.000000000 -0600 @@ -1,5 +1,5 @@ /* Ordered set data type implemented by a binary tree. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify @@ -519,6 +519,8 @@ gl_tree_remove_node (gl_oset_t set, gl_o } set->count--; + if (set->base.dispose_fn != NULL) + set->base.dispose_fn (node->value); free (node); return true; } diff -ruNp m4-1.4.8/lib/gl_list.c m4-1.4.9/lib/gl_list.c --- m4-1.4.8/lib/gl_list.c 2006-11-20 06:57:27.000000000 -0700 +++ m4-1.4.9/lib/gl_list.c 2007-03-23 06:50:49.000000000 -0600 @@ -1,5 +1,5 @@ /* Abstract sequential list data type. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify @@ -31,21 +31,23 @@ gl_list_t gl_list_create_empty (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates) { return implementation->create_empty (implementation, equals_fn, hashcode_fn, - allow_duplicates); + dispose_fn, allow_duplicates); } gl_list_t gl_list_create (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates, size_t count, const void **contents) { return implementation->create (implementation, equals_fn, hashcode_fn, - allow_duplicates, count, contents); + dispose_fn, allow_duplicates, count, contents); } size_t diff -ruNp m4-1.4.8/lib/gl_list.h m4-1.4.9/lib/gl_list.h --- m4-1.4.8/lib/gl_list.h 2006-11-20 06:57:28.000000000 -0700 +++ m4-1.4.9/lib/gl_list.h 2007-03-23 06:50:50.000000000 -0600 @@ -1,5 +1,5 @@ /* Abstract sequential list data type. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify @@ -102,6 +102,10 @@ typedef bool (*gl_listelement_equals_fn) NULL denotes a function that depends only on the pointer itself. */ typedef size_t (*gl_listelement_hashcode_fn) (const void *elt); +/* Type of function used to dispose an element once it's removed from a list. + NULL denotes a no-op. */ +typedef void (*gl_listelement_dispose_fn) (const void *elt); + struct gl_list_impl; /* Type representing an entire list. */ typedef struct gl_list_impl * gl_list_t; @@ -122,11 +126,13 @@ typedef const struct gl_list_implementat GL_RBTREEHASH_LIST. EQUALS_FN is an element comparison function or NULL. HASHCODE_FN is an element hash code function or NULL. + DISPOSE_FN is an element disposal function or NULL. ALLOW_DUPLICATES is false if duplicate elements shall not be allowed in the list. The implementation may verify this at runtime. */ extern gl_list_t gl_list_create_empty (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates); /* Create a list with given contents. @@ -135,6 +141,7 @@ extern gl_list_t gl_list_create_empty (g GL_RBTREEHASH_LIST. EQUALS_FN is an element comparison function or NULL. HASHCODE_FN is an element hash code function or NULL. + DISPOSE_FN is an element disposal function or NULL. ALLOW_DUPLICATES is false if duplicate elements shall not be allowed in the list. The implementation may verify this at runtime. COUNT is the number of initial elements. @@ -142,6 +149,7 @@ extern gl_list_t gl_list_create_empty (g extern gl_list_t gl_list_create (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates, size_t count, const void **contents); @@ -364,10 +372,12 @@ struct gl_list_implementation gl_list_t (*create_empty) (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates); gl_list_t (*create) (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates, size_t count, const void **contents); size_t (*size) (gl_list_t list); @@ -429,6 +439,7 @@ struct gl_list_impl_base const struct gl_list_implementation *vtable; gl_listelement_equals_fn equals_fn; gl_listelement_hashcode_fn hashcode_fn; + gl_listelement_dispose_fn dispose_fn; bool allow_duplicates; }; @@ -443,10 +454,11 @@ static inline gl_list_t gl_list_create_empty (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates) { return implementation->create_empty (implementation, equals_fn, hashcode_fn, - allow_duplicates); + dispose_fn, allow_duplicates); } # define gl_list_create gl_list_create_inline @@ -454,11 +466,12 @@ static inline gl_list_t gl_list_create (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, + gl_listelement_dispose_fn dispose_fn, bool allow_duplicates, size_t count, const void **contents) { return implementation->create (implementation, equals_fn, hashcode_fn, - allow_duplicates, count, contents); + dispose_fn, allow_duplicates, count, contents); } # define gl_list_size gl_list_size_inline diff -ruNp m4-1.4.8/lib/gl_oset.c m4-1.4.9/lib/gl_oset.c --- m4-1.4.8/lib/gl_oset.c 2006-11-20 06:57:28.000000000 -0700 +++ m4-1.4.9/lib/gl_oset.c 2007-03-23 06:50:50.000000000 -0600 @@ -1,5 +1,5 @@ /* Abstract ordered set data type. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify @@ -29,9 +29,10 @@ gl_oset_t gl_oset_create_empty (gl_oset_implementation_t implementation, - gl_setelement_compar_fn compar_fn) + gl_setelement_compar_fn compar_fn, + gl_setelement_dispose_fn dispose_fn) { - return implementation->create_empty (implementation, compar_fn); + return implementation->create_empty (implementation, compar_fn, dispose_fn); } size_t diff -ruNp m4-1.4.8/lib/gl_oset.h m4-1.4.9/lib/gl_oset.h --- m4-1.4.8/lib/gl_oset.h 2006-11-20 07:23:00.000000000 -0700 +++ m4-1.4.9/lib/gl_oset.h 2007-03-23 06:50:50.000000000 -0600 @@ -1,5 +1,5 @@ /* Abstract ordered set data type. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify @@ -70,6 +70,10 @@ extern "C" { NULL denotes pointer comparison. */ typedef int (*gl_setelement_compar_fn) (const void *elt1, const void *elt2); +/* Type of function used to dispose an element once it's removed from a set. + NULL denotes a no-op. */ +typedef void (*gl_setelement_dispose_fn) (const void *elt); + /* Type of function used to compare an element with a threshold. Return true if the element is greater or equal than the threshold. */ typedef bool (*gl_setelement_threshold_fn) (const void *elt, const void *threshold); @@ -84,9 +88,11 @@ typedef const struct gl_oset_implementat /* Create an empty set. IMPLEMENTATION is one of GL_ARRAY_OSET, GL_AVLTREE_OSET, GL_RBTREE_OSET. - COMPAR_FN is an element comparison function or NULL. */ + COMPAR_FN is an element comparison function or NULL. + DISPOSE_FN is an element disposal function or NULL. */ extern gl_oset_t gl_oset_create_empty (gl_oset_implementation_t implementation, - gl_setelement_compar_fn compar_fn); + gl_setelement_compar_fn compar_fn, + gl_setelement_dispose_fn dispose_fn); /* Return the current number of elements in an ordered set. */ extern size_t gl_oset_size (gl_oset_t set); @@ -155,7 +161,8 @@ struct gl_oset_implementation { /* gl_oset_t functions. */ gl_oset_t (*create_empty) (gl_oset_implementation_t implementation, - gl_setelement_compar_fn compar_fn); + gl_setelement_compar_fn compar_fn, + gl_setelement_dispose_fn dispose_fn); size_t (*size) (gl_oset_t set); bool (*search) (gl_oset_t set, const void *elt); bool (*search_atleast) (gl_oset_t set, @@ -174,6 +181,7 @@ struct gl_oset_impl_base { const struct gl_oset_implementation *vtable; gl_setelement_compar_fn compar_fn; + gl_setelement_dispose_fn dispose_fn; }; #if HAVE_INLINE @@ -185,9 +193,10 @@ struct gl_oset_impl_base # define gl_oset_create_empty gl_oset_create_empty_inline static inline gl_oset_t gl_oset_create_empty (gl_oset_implementation_t implementation, - gl_setelement_compar_fn compar_fn) + gl_setelement_compar_fn compar_fn, + gl_setelement_dispose_fn dispose_fn) { - return implementation->create_empty (implementation, compar_fn); + return implementation->create_empty (implementation, compar_fn, dispose_fn); } # define gl_oset_size gl_oset_size_inline diff -ruNp m4-1.4.8/lib/localcharset.c m4-1.4.9/lib/localcharset.c --- m4-1.4.8/lib/localcharset.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/localcharset.c 2007-03-23 06:50:50.000000000 -0600 @@ -0,0 +1,460 @@ +/* Determine a canonical name for the current locale's character encoding. + + Copyright (C) 2000-2006 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Bruno Haible . */ + +#include + +/* Specification. */ +#include "localcharset.h" + +#include +#include +#include +#include + +#if defined _WIN32 || defined __WIN32__ +# define WIN32_NATIVE +#endif + +#if defined __EMX__ +/* Assume EMX program runs on OS/2, even if compiled under DOS. */ +# define OS2 +#endif + +#if !defined WIN32_NATIVE +# if HAVE_LANGINFO_CODESET +# include +# else +# if 0 /* see comment below */ +# include +# endif +# endif +# ifdef __CYGWIN__ +# define WIN32_LEAN_AND_MEAN +# include +# endif +#elif defined WIN32_NATIVE +# define WIN32_LEAN_AND_MEAN +# include +#endif +#if defined OS2 +# define INCL_DOS +# include +#endif + +#if ENABLE_RELOCATABLE +# include "relocatable.h" +#else +# define relocate(pathname) (pathname) +#endif + +/* Get LIBDIR. */ +#ifndef LIBDIR +# include "configmake.h" +#endif + +#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ + /* Win32, Cygwin, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#endif + +#ifndef DIRECTORY_SEPARATOR +# define DIRECTORY_SEPARATOR '/' +#endif + +#ifndef ISSLASH +# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) +#endif + +#if HAVE_DECL_GETC_UNLOCKED +# undef getc +# define getc getc_unlocked +#endif + +/* The following static variable is declared 'volatile' to avoid a + possible multithread problem in the function get_charset_aliases. If we + are running in a threaded environment, and if two threads initialize + 'charset_aliases' simultaneously, both will produce the same value, + and everything will be ok if the two assignments to 'charset_aliases' + are atomic. But I don't know what will happen if the two assignments mix. */ +#if __STDC__ != 1 +# define volatile /* empty */ +#endif +/* Pointer to the contents of the charset.alias file, if it has already been + read, else NULL. Its format is: + ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ +static const char * volatile charset_aliases; + +/* Return a pointer to the contents of the charset.alias file. */ +static const char * +get_charset_aliases (void) +{ + const char *cp; + + cp = charset_aliases; + if (cp == NULL) + { +#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) + FILE *fp; + const char *dir; + const char *base = "charset.alias"; + char *file_name; + + /* Make it possible to override the charset.alias location. This is + necessary for running the testsuite before "make install". */ + dir = getenv ("CHARSETALIASDIR"); + if (dir == NULL || dir[0] == '\0') + dir = relocate (LIBDIR); + + /* Concatenate dir and base into freshly allocated file_name. */ + { + size_t dir_len = strlen (dir); + size_t base_len = strlen (base); + int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); + file_name = (char *) malloc (dir_len + add_slash + base_len + 1); + if (file_name != NULL) + { + memcpy (file_name, dir, dir_len); + if (add_slash) + file_name[dir_len] = DIRECTORY_SEPARATOR; + memcpy (file_name + dir_len + add_slash, base, base_len + 1); + } + } + + if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) + /* Out of memory or file not found, treat it as empty. */ + cp = ""; + else + { + /* Parse the file's contents. */ + char *res_ptr = NULL; + size_t res_size = 0; + + for (;;) + { + int c; + char buf1[50+1]; + char buf2[50+1]; + size_t l1, l2; + char *old_res_ptr; + + c = getc (fp); + if (c == EOF) + break; + if (c == '\n' || c == ' ' || c == '\t') + continue; + if (c == '#') + { + /* Skip comment, to end of line. */ + do + c = getc (fp); + while (!(c == EOF || c == '\n')); + if (c == EOF) + break; + continue; + } + ungetc (c, fp); + if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) + break; + l1 = strlen (buf1); + l2 = strlen (buf2); + old_res_ptr = res_ptr; + if (res_size == 0) + { + res_size = l1 + 1 + l2 + 1; + res_ptr = (char *) malloc (res_size + 1); + } + else + { + res_size += l1 + 1 + l2 + 1; + res_ptr = (char *) realloc (res_ptr, res_size + 1); + } + if (res_ptr == NULL) + { + /* Out of memory. */ + res_size = 0; + if (old_res_ptr != NULL) + free (old_res_ptr); + break; + } + strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); + strcpy (res_ptr + res_size - (l2 + 1), buf2); + } + fclose (fp); + if (res_size == 0) + cp = ""; + else + { + *(res_ptr + res_size) = '\0'; + cp = res_ptr; + } + } + + if (file_name != NULL) + free (file_name); + +#else + +# 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. */ + /* The list of encodings is taken from the OpenVMS 7.3-1 documentation + "Compaq C Run-Time Library Reference Manual for OpenVMS systems" + section 10.7 "Handling Different Character Sets". */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-8" "\0" "ISO-8859-8" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + /* Japanese */ + "eucJP" "\0" "EUC-JP" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "DECKANJI" "\0" "DEC-KANJI" "\0" + "SDECKANJI" "\0" "EUC-JP" "\0" + /* Chinese */ + "eucTW" "\0" "EUC-TW" "\0" + "DECHANYU" "\0" "DEC-HANYU" "\0" + "DECHANZI" "\0" "GB2312" "\0" + /* Korean */ + "DECKOREAN" "\0" "EUC-KR" "\0"; +# endif + +# if defined WIN32_NATIVE || defined __CYGWIN__ + /* To avoid the troubles of installing a separate file in the same + directory as the DLL and of retrieving the DLL's directory at + runtime, simply inline the aliases here. */ + + cp = "CP936" "\0" "GBK" "\0" + "CP1361" "\0" "JOHAB" "\0" + "CP20127" "\0" "ASCII" "\0" + "CP20866" "\0" "KOI8-R" "\0" + "CP20936" "\0" "GB2312" "\0" + "CP21866" "\0" "KOI8-RU" "\0" + "CP28591" "\0" "ISO-8859-1" "\0" + "CP28592" "\0" "ISO-8859-2" "\0" + "CP28593" "\0" "ISO-8859-3" "\0" + "CP28594" "\0" "ISO-8859-4" "\0" + "CP28595" "\0" "ISO-8859-5" "\0" + "CP28596" "\0" "ISO-8859-6" "\0" + "CP28597" "\0" "ISO-8859-7" "\0" + "CP28598" "\0" "ISO-8859-8" "\0" + "CP28599" "\0" "ISO-8859-9" "\0" + "CP28605" "\0" "ISO-8859-15" "\0" + "CP38598" "\0" "ISO-8859-8" "\0" + "CP51932" "\0" "EUC-JP" "\0" + "CP51936" "\0" "GB2312" "\0" + "CP51949" "\0" "EUC-KR" "\0" + "CP51950" "\0" "EUC-TW" "\0" + "CP54936" "\0" "GB18030" "\0" + "CP65001" "\0" "UTF-8" "\0"; +# endif +#endif + + charset_aliases = cp; + } + + return cp; +} + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ + +#ifdef STATIC +STATIC +#endif +const char * +locale_charset (void) +{ + const char *codeset; + const char *aliases; + +#if !(defined WIN32_NATIVE || defined OS2) + +# if HAVE_LANGINFO_CODESET + + /* Most systems support nl_langinfo (CODESET) nowadays. */ + codeset = nl_langinfo (CODESET); + +# ifdef __CYGWIN__ + /* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always + returns "US-ASCII". As long as this is not fixed, return the suffix + of the locale name from the environment variables (if present) or + the codepage as a number. */ + if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) + { + const char *locale; + static char buf[2 + 10 + 1]; + + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + if (locale != NULL && locale[0] != '\0') + { + /* If the locale name contains an encoding after the dot, return + it. */ + const char *dot = strchr (locale, '.'); + + if (dot != NULL) + { + const char *modifier; + + dot++; + /* Look for the possible @... trailer and remove it, if any. */ + modifier = strchr (dot, '@'); + if (modifier == NULL) + return dot; + if (modifier - dot < sizeof (buf)) + { + memcpy (buf, dot, modifier - dot); + buf [modifier - dot] = '\0'; + return buf; + } + } + } + + /* Woe32 has a function returning the locale's codepage as a number. */ + sprintf (buf, "CP%u", GetACP ()); + codeset = buf; + } +# endif + +# else + + /* On old systems which lack it, use setlocale or getenv. */ + const char *locale = NULL; + + /* But most old systems don't have a complete set of locales. Some + (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't + use setlocale here; it would return "C" when it doesn't support the + locale name the user has set. */ +# if 0 + locale = setlocale (LC_CTYPE, NULL); +# endif + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + } + + /* On some old systems, one used to set locale = "iso8859_1". On others, + you set it to "language_COUNTRY.charset". In any case, we resolve it + through the charset.alias file. */ + codeset = locale; + +# endif + +#elif defined WIN32_NATIVE + + static char buf[2 + 10 + 1]; + + /* Woe32 has a function returning the locale's codepage as a number. */ + sprintf (buf, "CP%u", GetACP ()); + codeset = buf; + +#elif defined OS2 + + const char *locale; + static char buf[2 + 10 + 1]; + ULONG cp[3]; + ULONG cplen; + + /* Allow user to override the codeset, as set in the operating system, + with standard language environment variables. */ + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + if (locale != NULL && locale[0] != '\0') + { + /* If the locale name contains an encoding after the dot, return it. */ + const char *dot = strchr (locale, '.'); + + if (dot != NULL) + { + const char *modifier; + + dot++; + /* Look for the possible @... trailer and remove it, if any. */ + modifier = strchr (dot, '@'); + if (modifier == NULL) + return dot; + if (modifier - dot < sizeof (buf)) + { + memcpy (buf, dot, modifier - dot); + buf [modifier - dot] = '\0'; + return buf; + } + } + + /* Resolve through the charset.alias file. */ + codeset = locale; + } + else + { + /* OS/2 has a function returning the locale's codepage as a number. */ + if (DosQueryCp (sizeof (cp), cp, &cplen)) + codeset = ""; + else + { + sprintf (buf, "CP%u", cp[0]); + codeset = buf; + } + } + +#endif + + if (codeset == NULL) + /* The canonical name cannot be determined. */ + codeset = ""; + + /* Resolve alias. */ + for (aliases = get_charset_aliases (); + *aliases != '\0'; + aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) + if (strcmp (codeset, aliases) == 0 + || (aliases[0] == '*' && aliases[1] == '\0')) + { + codeset = aliases + strlen (aliases) + 1; + break; + } + + /* Don't return an empty string. GNU libc and GNU libiconv interpret + the empty string as denoting "the locale's character encoding", + thus GNU libiconv would call this function a second time. */ + if (codeset[0] == '\0') + codeset = "ASCII"; + + return codeset; +} diff -ruNp m4-1.4.8/lib/localcharset.h m4-1.4.9/lib/localcharset.h --- m4-1.4.8/lib/localcharset.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/localcharset.h 2007-03-23 06:50:50.000000000 -0600 @@ -0,0 +1,41 @@ +/* Determine a canonical name for the current locale's character encoding. + Copyright (C) 2000-2003 Free Software Foundation, Inc. + This file is part of the GNU CHARSET Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public 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 _LOCALCHARSET_H +#define _LOCALCHARSET_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ +extern const char * locale_charset (void); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _LOCALCHARSET_H */ diff -ruNp m4-1.4.8/lib/mbchar.c m4-1.4.9/lib/mbchar.c --- m4-1.4.8/lib/mbchar.c 2006-11-20 06:57:39.000000000 -0700 +++ m4-1.4.9/lib/mbchar.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,36 +0,0 @@ -/* Copyright (C) 2001, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - -#include - -#include - -#include "mbchar.h" - -#if IS_BASIC_ASCII - -/* Bit table of characters in the ISO C "basic character set". */ -const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] = -{ - 0x00001a00, /* '\t' '\v' '\f' */ - 0xffffffef, /* ' '...'#' '%'...'?' */ - 0xfffffffe, /* 'A'...'Z' '[' '\\' ']' '^' '_' */ - 0x7ffffffe /* 'a'...'z' '{' '|' '}' '~' */ - /* The remaining bits are 0. */ -}; - -#endif /* IS_BASIC_ASCII */ diff -ruNp m4-1.4.8/lib/mbchar.h m4-1.4.9/lib/mbchar.h --- m4-1.4.8/lib/mbchar.h 2006-11-20 06:57:39.000000000 -0700 +++ m4-1.4.9/lib/mbchar.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,478 +0,0 @@ -/* Multibyte character data type. - Copyright (C) 2001, 2005-2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Bruno Haible . */ - -/* A multibyte character is a short subsequence of a char* string, - representing a single wide character. - - We use multibyte characters instead of wide characters because of - the following goals: - 1) correct multibyte handling, i.e. operate according to the LC_CTYPE - locale, - 2) ease of maintenance, i.e. the maintainer needs not know all details - of the ISO C 99 standard, - 3) don't fail grossly if the input is not in the encoding set by the - locale, because often different encodings are in use in the same - countries (ISO-8859-1/UTF-8, EUC-JP/Shift_JIS, ...), - 4) fast in the case of ASCII characters, - 5) portability, i.e. don't make unportable assumptions about wchar_t. - - Multibyte characters are only accessed through the mb* macros. - - mb_ptr (mbc) - return a pointer to the beginning of the multibyte sequence. - - mb_len (mbc) - returns the number of bytes occupied by the multibyte sequence. - Always > 0. - - mb_iseq (mbc, sc) - returns true if mbc is the standard ASCII character sc. - - mb_isnul (mbc) - returns true if mbc is the nul character. - - mb_cmp (mbc1, mbc2) - returns a positive, zero, or negative value depending on whether mbc1 - sorts after, same or before mbc2. - - mb_casecmp (mbc1, mbc2) - returns a positive, zero, or negative value depending on whether mbc1 - sorts after, same or before mbc2, modulo upper/lowercase conversion. - - mb_equal (mbc1, mbc2) - returns true if mbc1 and mbc2 are equal. - - mb_caseequal (mbc1, mbc2) - returns true if mbc1 and mbc2 are equal modulo upper/lowercase conversion. - - mb_isalnum (mbc) - returns true if mbc is alphanumeric. - - mb_isalpha (mbc) - returns true if mbc is alphabetic. - - mb_isascii(mbc) - returns true if mbc is plain ASCII. - - mb_isblank (mbc) - returns true if mbc is a blank. - - mb_iscntrl (mbc) - returns true if mbc is a control character. - - mb_isdigit (mbc) - returns true if mbc is a decimal digit. - - mb_isgraph (mbc) - returns true if mbc is a graphic character. - - mb_islower (mbc) - returns true if mbc is lowercase. - - mb_isprint (mbc) - returns true if mbc is a printable character. - - mb_ispunct (mbc) - returns true if mbc is a punctuation character. - - mb_isspace (mbc) - returns true if mbc is a space character. - - mb_isupper (mbc) - returns true if mbc is uppercase. - - mb_isxdigit (mbc) - returns true if mbc is a hexadecimal digit. - - mb_width (mbc) - returns the number of columns on the output device occupied by mbc. - Always >= 0. - - mb_putc (mbc, stream) - outputs mbc on stream, a byte oriented FILE stream opened for output. - - mb_setascii (&mbc, sc) - assigns the standard ASCII character sc to mbc. - - mb_copy (&destmbc, &srcmbc) - copies srcmbc to destmbc. - - Here are the function prototypes of the macros. - - extern const char * mb_ptr (const mbchar_t mbc); - extern size_t mb_len (const mbchar_t mbc); - extern bool mb_iseq (const mbchar_t mbc, char sc); - extern bool mb_isnul (const mbchar_t mbc); - extern int mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2); - extern int mb_casecmp (const mbchar_t mbc1, const mbchar_t mbc2); - extern bool mb_equal (const mbchar_t mbc1, const mbchar_t mbc2); - extern bool mb_caseequal (const mbchar_t mbc1, const mbchar_t mbc2); - extern bool mb_isalnum (const mbchar_t mbc); - extern bool mb_isalpha (const mbchar_t mbc); - extern bool mb_isascii (const mbchar_t mbc); - extern bool mb_isblank (const mbchar_t mbc); - extern bool mb_iscntrl (const mbchar_t mbc); - extern bool mb_isdigit (const mbchar_t mbc); - extern bool mb_isgraph (const mbchar_t mbc); - extern bool mb_islower (const mbchar_t mbc); - extern bool mb_isprint (const mbchar_t mbc); - extern bool mb_ispunct (const mbchar_t mbc); - extern bool mb_isspace (const mbchar_t mbc); - extern bool mb_isupper (const mbchar_t mbc); - extern bool mb_isxdigit (const mbchar_t mbc); - extern int mb_width (const mbchar_t mbc); - extern void mb_putc (const mbchar_t mbc, FILE *stream); - extern void mb_setascii (mbchar_t *new, char sc); - extern void mb_copy (mbchar_t *new, const mbchar_t *old); - */ - -#ifndef _MBCHAR_H -#define _MBCHAR_H 1 - -#include -#include - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.1 has a bug: and must be included before - . */ -#include -#include -#include - -/* BeOS 5 has the functions but no . */ -#if HAVE_WCTYPE_H -# include -#endif -/* FreeBSD 4.4 to 4.11 has but lacks the functions. - Assume all 12 functions are implemented the same way, or not at all. */ -#if !defined iswalnum && !HAVE_ISWCNTRL -static inline int -iswalnum (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? (wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z') - : 0); -} -# define iswalnum iswalnum -#endif -#if !defined iswalpha && !HAVE_ISWCNTRL -static inline int -iswalpha (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z' - : 0); -} -# define iswalpha iswalpha -#endif -#if !defined iswblank && !HAVE_ISWCNTRL -static inline int -iswblank (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? wc == ' ' || wc == '\t' - : 0); -} -# define iswblank iswblank -#endif -#if !defined iswcntrl && !HAVE_ISWCNTRL -static inline int -iswcntrl (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? (wc & ~0x1f) == 0 || wc == 0x7f - : 0); -} -# define iswcntrl iswcntrl -#endif -#if !defined iswdigit && !HAVE_ISWCNTRL -static inline int -iswdigit (wint_t wc) -{ - return (wc >= '0' && wc <= '9'); -} -# define iswdigit iswdigit -#endif -#if !defined iswgraph && !HAVE_ISWCNTRL -static inline int -iswgraph (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? wc >= '!' && wc <= '~' - : 1); -} -# define iswgraph iswgraph -#endif -#if !defined iswlower && !HAVE_ISWCNTRL -static inline int -iswlower (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? wc >= 'a' && wc <= 'z' - : 0); -} -# define iswlower iswlower -#endif -#if !defined iswprint && !HAVE_ISWCNTRL -static inline int -iswprint (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? wc >= ' ' && wc <= '~' - : 1); -} -# define iswprint iswprint -#endif -#if !defined iswpunct && !HAVE_ISWCNTRL -static inline int -iswpunct (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? wc >= '!' && wc <= '~' - && !((wc >= '0' && wc <= '9') - || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')) - : 1); -} -# define iswpunct iswpunct -#endif -#if !defined iswspace && !HAVE_ISWCNTRL -static inline int -iswspace (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? wc == ' ' || wc == '\t' - || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r' - : 0); -} -# define iswspace iswspace -#endif -#if !defined iswupper && !HAVE_ISWCNTRL -static inline int -iswupper (wint_t wc) -{ - return (wc >= 0 && wc < 128 - ? wc >= 'A' && wc <= 'Z' - : 0); -} -# define iswupper iswupper -#endif -#if !defined iswxdigit && !HAVE_ISWCNTRL -static inline int -iswxdigit (wint_t wc) -{ - return (wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'); -} -# define iswxdigit iswxdigit -#endif - -#include "wcwidth.h" - -#define MBCHAR_BUF_SIZE 24 - -struct mbchar -{ - const char *ptr; /* pointer to current character */ - size_t bytes; /* number of bytes of current character, > 0 */ - bool wc_valid; /* true if wc is a valid wide character */ - wchar_t wc; /* if wc_valid: the current character */ - char buf[MBCHAR_BUF_SIZE]; /* room for the bytes, used for file input only */ -}; - -/* EOF (not a real character) is represented with bytes = 0 and - wc_valid = false. */ - -typedef struct mbchar mbchar_t; - -/* Access the current character. */ -#define mb_ptr(mbc) ((mbc).ptr) -#define mb_len(mbc) ((mbc).bytes) - -/* Comparison of characters. */ -#define mb_iseq(mbc, sc) ((mbc).wc_valid && (mbc).wc == (sc)) -#define mb_isnul(mbc) ((mbc).wc_valid && (mbc).wc == 0) -#define mb_cmp(mbc1, mbc2) \ - ((mbc1).wc_valid \ - ? ((mbc2).wc_valid \ - ? (int) (mbc1).wc - (int) (mbc2).wc \ - : -1) \ - : ((mbc2).wc_valid \ - ? 1 \ - : (mbc1).bytes == (mbc2).bytes \ - ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \ - : (mbc1).bytes < (mbc2).bytes \ - ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \ - : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1))) -#define mb_casecmp(mbc1, mbc2) \ - ((mbc1).wc_valid \ - ? ((mbc2).wc_valid \ - ? (int) towlower ((mbc1).wc) - (int) towlower ((mbc2).wc) \ - : -1) \ - : ((mbc2).wc_valid \ - ? 1 \ - : (mbc1).bytes == (mbc2).bytes \ - ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \ - : (mbc1).bytes < (mbc2).bytes \ - ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \ - : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1))) -#define mb_equal(mbc1, mbc2) \ - ((mbc1).wc_valid && (mbc2).wc_valid \ - ? (mbc1).wc == (mbc2).wc \ - : (mbc1).bytes == (mbc2).bytes \ - && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) -#define mb_caseequal(mbc1, mbc2) \ - ((mbc1).wc_valid && (mbc2).wc_valid \ - ? towlower ((mbc1).wc) == towlower ((mbc2).wc) \ - : (mbc1).bytes == (mbc2).bytes \ - && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) - -/* , classification. */ -#define mb_isascii(mbc) \ - ((mbc).wc_valid && (mbc).wc >= 0 && (mbc).wc <= 127) -#define mb_isalnum(mbc) ((mbc).wc_valid && iswalnum ((mbc).wc)) -#define mb_isalpha(mbc) ((mbc).wc_valid && iswalpha ((mbc).wc)) -#define mb_isblank(mbc) ((mbc).wc_valid && iswblank ((mbc).wc)) -#define mb_iscntrl(mbc) ((mbc).wc_valid && iswcntrl ((mbc).wc)) -#define mb_isdigit(mbc) ((mbc).wc_valid && iswdigit ((mbc).wc)) -#define mb_isgraph(mbc) ((mbc).wc_valid && iswgraph ((mbc).wc)) -#define mb_islower(mbc) ((mbc).wc_valid && iswlower ((mbc).wc)) -#define mb_isprint(mbc) ((mbc).wc_valid && iswprint ((mbc).wc)) -#define mb_ispunct(mbc) ((mbc).wc_valid && iswpunct ((mbc).wc)) -#define mb_isspace(mbc) ((mbc).wc_valid && iswspace ((mbc).wc)) -#define mb_isupper(mbc) ((mbc).wc_valid && iswupper ((mbc).wc)) -#define mb_isxdigit(mbc) ((mbc).wc_valid && iswxdigit ((mbc).wc)) - -/* Extra function. */ - -/* Unprintable characters appear as a small box of width 1. */ -#define MB_UNPRINTABLE_WIDTH 1 - -static inline int -mb_width_aux (wint_t wc) -{ - int w = wcwidth (wc); - /* For unprintable characters, arbitrarily return 0 for control characters - and MB_UNPRINTABLE_WIDTH otherwise. */ - return (w >= 0 ? w : iswcntrl (wc) ? 0 : MB_UNPRINTABLE_WIDTH); -} - -#define mb_width(mbc) \ - ((mbc).wc_valid ? mb_width_aux ((mbc).wc) : MB_UNPRINTABLE_WIDTH) - -/* Output. */ -#define mb_putc(mbc, stream) fwrite ((mbc).ptr, 1, (mbc).bytes, (stream)) - -/* Assignment. */ -#define mb_setascii(mbc, sc) \ - ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \ - (mbc)->wc = (mbc)->buf[0] = (sc)) - -/* Copying a character. */ -static inline void -mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc) -{ - if (old_mbc->ptr == &old_mbc->buf[0]) - { - memcpy (&new_mbc->buf[0], &old_mbc->buf[0], old_mbc->bytes); - new_mbc->ptr = &new_mbc->buf[0]; - } - else - new_mbc->ptr = old_mbc->ptr; - new_mbc->bytes = old_mbc->bytes; - if ((new_mbc->wc_valid = old_mbc->wc_valid)) - new_mbc->wc = old_mbc->wc; -} - - -/* is_basic(c) tests whether the single-byte character c is in the - ISO C "basic character set". - This is a convenience function, and is in this file only to share code - between mbiter_multi.h and mbfile_multi.h. */ -#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ - && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ - && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ - && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ - && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ - && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ - && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ - && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ - && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ - && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ - && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ - && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ - && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ - && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ - && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ - && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ - && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ - && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ - && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ - && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ - && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ - && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ - && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126) -/* The character set is ISO-646, not EBCDIC. */ -# define IS_BASIC_ASCII 1 - -extern const unsigned int is_basic_table[]; - -static inline bool -is_basic (char c) -{ - return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) - & 1; -} - -#else - -static inline bool -is_basic (char 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 '~': - return 1; - default: - return 0; - } -} - -#endif - -#endif /* _MBCHAR_H */ diff -ruNp m4-1.4.8/lib/mbuiter.h m4-1.4.9/lib/mbuiter.h --- m4-1.4.8/lib/mbuiter.h 2006-09-23 22:28:35.000000000 -0600 +++ m4-1.4.9/lib/mbuiter.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,203 +0,0 @@ -/* Iterating through multibyte strings: macros for multi-byte encodings. - Copyright (C) 2001, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Bruno Haible . */ - -/* The macros in this file implement forward iteration through a - multi-byte string, without knowing its length a-priori. - - With these macros, an iteration loop that looks like - - char *iter; - for (iter = buf; *iter != '\0'; iter++) - { - do_something (*iter); - } - - becomes - - mbui_iterator_t iter; - for (mbui_init (iter, buf); mbui_avail (iter); mbui_advance (iter)) - { - do_something (mbui_cur_ptr (iter), mb_len (mbui_cur (iter))); - } - - The benefit of these macros over plain use of mbrtowc is: - - Handling of invalid multibyte sequences is possible without - making the code more complicated, while still preserving the - invalid multibyte sequences. - - Compared to mbiter.h, the macros here don't need to know the string's - length a-priori. The downside is that at each step, the look-ahead - that guards against overrunning the terminating '\0' is more expensive. - The mbui_* macros are therefore suitable when there is a high probability - that only the first few multibyte characters need to be inspected. - Whereas the mbi_* macros are better if usually the iteration runs - through the entire string. - - mbui_iterator_t - is a type usable for variable declarations. - - mbui_init (iter, startptr) - initializes the iterator, starting at startptr. - - mbui_avail (iter) - returns true if there are more multibyte chracters available before - the end of string is reached. In this case, mbui_cur (iter) is - initialized to the next multibyte chracter. - - mbui_advance (iter) - advances the iterator by one multibyte character. - - mbui_cur (iter) - returns the current multibyte character, of type mbchar_t. All the - macros defined in mbchar.h can be used on it. - - mbui_cur_ptr (iter) - return a pointer to the beginning of the current multibyte character. - - mbui_reloc (iter, ptrdiff) - relocates iterator when the string is moved by ptrdiff bytes. - - Here are the function prototypes of the macros. - - extern void mbui_init (mbui_iterator_t iter, const char *startptr); - extern bool mbui_avail (mbui_iterator_t iter); - extern void mbui_advance (mbui_iterator_t iter); - extern mbchar_t mbui_cur (mbui_iterator_t iter); - extern const char * mbui_cur_ptr (mbui_iterator_t iter); - extern void mbui_reloc (mbui_iterator_t iter, ptrdiff_t ptrdiff); - */ - -#ifndef _MBUITER_H -#define _MBUITER_H 1 - -#include -#include -#include - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.1 has a bug: and must be included before - . */ -#include -#include -#include - -#include "mbchar.h" -#include "strnlen1.h" - -struct mbuiter_multi -{ - bool in_shift; /* true if next byte may not be interpreted as ASCII */ - mbstate_t state; /* if in_shift: current shift state */ - bool next_done; /* true if mbui_avail has already filled the following */ - struct mbchar cur; /* the current character: - const char *cur.ptr pointer to current character - The following are only valid after mbui_avail. - size_t cur.bytes number of bytes of current character - bool cur.wc_valid true if wc is a valid wide character - wchar_t cur.wc if wc_valid: the current character - */ -}; - -static inline void -mbuiter_multi_next (struct mbuiter_multi *iter) -{ - if (iter->next_done) - return; - if (iter->in_shift) - goto with_shift; - /* Handle most ASCII characters quickly, without calling mbrtowc(). */ - if (is_basic (*iter->cur.ptr)) - { - /* These characters are part of the basic character set. ISO C 99 - guarantees that their wide character code is identical to their - char code. */ - iter->cur.bytes = 1; - iter->cur.wc = *iter->cur.ptr; - iter->cur.wc_valid = true; - } - else - { - assert (mbsinit (&iter->state)); - iter->in_shift = true; - with_shift: - iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr, - strnlen1 (iter->cur.ptr, MB_CUR_MAX), - &iter->state); - if (iter->cur.bytes == (size_t) -1) - { - /* An invalid multibyte sequence was encountered. */ - iter->cur.bytes = 1; - iter->cur.wc_valid = false; - /* Whether to set iter->in_shift = false and reset iter->state - or not is not very important; the string is bogus anyway. */ - } - else if (iter->cur.bytes == (size_t) -2) - { - /* An incomplete multibyte character at the end. */ - iter->cur.bytes = strlen (iter->cur.ptr); - iter->cur.wc_valid = false; - /* Whether to set iter->in_shift = false and reset iter->state - or not is not important; the string end is reached anyway. */ - } - else - { - if (iter->cur.bytes == 0) - { - /* A null wide character was encountered. */ - iter->cur.bytes = 1; - assert (*iter->cur.ptr == '\0'); - assert (iter->cur.wc == 0); - } - iter->cur.wc_valid = true; - - /* When in the initial state, we can go back treating ASCII - characters more quickly. */ - if (mbsinit (&iter->state)) - iter->in_shift = false; - } - } - iter->next_done = true; -} - -static inline void -mbuiter_multi_reloc (struct mbuiter_multi *iter, ptrdiff_t ptrdiff) -{ - iter->cur.ptr += ptrdiff; -} - -/* Iteration macros. */ -typedef struct mbuiter_multi mbui_iterator_t; -#define mbui_init(iter, startptr) \ - ((iter).cur.ptr = (startptr), \ - (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \ - (iter).next_done = false) -#define mbui_avail(iter) \ - (mbuiter_multi_next (&(iter)), !mb_isnul ((iter).cur)) -#define mbui_advance(iter) \ - ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false) - -/* Access to the current character. */ -#define mbui_cur(iter) (iter).cur -#define mbui_cur_ptr(iter) (iter).cur.ptr - -/* Relocation. */ -#define mbui_reloc(iter, ptrdiff) mbuiter_multi_reloc (&iter, ptrdiff) - -#endif /* _MBUITER_H */ diff -ruNp m4-1.4.8/lib/memchr.c m4-1.4.9/lib/memchr.c --- m4-1.4.8/lib/memchr.c 2006-09-23 22:28:36.000000000 -0600 +++ m4-1.4.9/lib/memchr.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,201 +0,0 @@ -/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2006 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 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _LIBC -# include -#endif - -#include - -#include - -#if defined _LIBC -# include -#else -# define reg_char char -#endif - -#include - -#if HAVE_BP_SYM_H || defined _LIBC -# include -#else -# define BP_SYM(sym) sym -#endif - -#undef memchr -#undef __memchr - -/* Search no more than N bytes of S for C. */ -void * -__memchr (void const *s, int c_in, size_t n) -{ - const unsigned char *char_ptr; - const unsigned long int *longword_ptr; - unsigned long int longword, magic_bits, charmask; - unsigned reg_char c; - int i; - - c = (unsigned char) c_in; - - /* Handle the first few characters by reading one character at a time. - Do this until CHAR_PTR is aligned on a longword boundary. */ - for (char_ptr = (const unsigned char *) s; - n > 0 && (size_t) char_ptr % sizeof longword != 0; - --n, ++char_ptr) - if (*char_ptr == c) - return (void *) char_ptr; - - /* All these elucidatory comments refer to 4-byte longwords, - but the theory applies equally well to any size longwords. */ - - longword_ptr = (const unsigned long int *) char_ptr; - - /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits - the "holes." Note that there is a hole just to the left of - each byte, with an extra at the end: - - bits: 01111110 11111110 11111110 11111111 - bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD - - The 1-bits make sure that carries propagate to the next 0-bit. - The 0-bits provide holes for carries to fall into. */ - - /* Set MAGIC_BITS to be this pattern of 1 and 0 bits. - Set CHARMASK to be a longword, each of whose bytes is C. */ - - magic_bits = 0xfefefefe; - charmask = c | (c << 8); - charmask |= charmask << 16; -#if 0xffffffffU < ULONG_MAX - magic_bits |= magic_bits << 32; - charmask |= charmask << 32; - if (8 < sizeof longword) - for (i = 64; i < sizeof longword * 8; i *= 2) - { - magic_bits |= magic_bits << i; - charmask |= charmask << i; - } -#endif - magic_bits = (ULONG_MAX >> 1) & (magic_bits | 1); - - /* Instead of the traditional loop which tests each character, - we will test a longword at a time. The tricky part is testing - if *any of the four* bytes in the longword in question are zero. */ - while (n >= sizeof longword) - { - /* We tentatively exit the loop if adding MAGIC_BITS to - LONGWORD fails to change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-30 is set, there will be a carry - into bit 31, so all of the hole bits will be changed. - - The one misfire occurs when bits 24-30 are clear and bit - 31 is set; in this case, the hole at bit 31 is not - changed. If we had access to the processor carry flag, - we could close this loophole by putting the fourth hole - at bit 32! - - So it ignores everything except 128's, when they're aligned - properly. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - - longword = *longword_ptr++ ^ charmask; - - /* Add MAGIC_BITS to LONGWORD. */ - if ((((longword + magic_bits) - - /* Set those bits that were unchanged by the addition. */ - ^ ~longword) - - /* Look at only the hole bits. If any of the hole bits - are unchanged, most likely one of the bytes was a - zero. */ - & ~magic_bits) != 0) - { - /* Which of the bytes was C? If none of them were, it was - a misfire; continue the search. */ - - const unsigned char *cp = (const unsigned char *) (longword_ptr - 1); - - if (cp[0] == c) - return (void *) cp; - if (cp[1] == c) - return (void *) &cp[1]; - if (cp[2] == c) - return (void *) &cp[2]; - if (cp[3] == c) - return (void *) &cp[3]; - if (4 < sizeof longword && cp[4] == c) - return (void *) &cp[4]; - if (5 < sizeof longword && cp[5] == c) - return (void *) &cp[5]; - if (6 < sizeof longword && cp[6] == c) - return (void *) &cp[6]; - if (7 < sizeof longword && cp[7] == c) - return (void *) &cp[7]; - if (8 < sizeof longword) - for (i = 8; i < sizeof longword; i++) - if (cp[i] == c) - return (void *) &cp[i]; - } - - n -= sizeof longword; - } - - char_ptr = (const unsigned char *) longword_ptr; - - while (n-- > 0) - { - if (*char_ptr == c) - return (void *) char_ptr; - else - ++char_ptr; - } - - return 0; -} -#ifdef weak_alias -weak_alias (__memchr, BP_SYM (memchr)) -#endif diff -ruNp m4-1.4.8/lib/mkdtemp.c m4-1.4.9/lib/mkdtemp.c --- m4-1.4.8/lib/mkdtemp.c 2006-11-20 06:57:28.000000000 -0700 +++ m4-1.4.9/lib/mkdtemp.c 2007-03-23 06:50:51.000000000 -0600 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001-2003, 2006 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2001-2003, 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 @@ -20,10 +20,9 @@ #include /* Specification. */ -#include "mkdtemp.h" +#include #include "tempname.h" -#include /* Generate a unique temporary directory from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; diff -ruNp m4-1.4.8/lib/mkdtemp.h m4-1.4.9/lib/mkdtemp.h --- m4-1.4.8/lib/mkdtemp.h 2006-11-20 06:57:28.000000000 -0700 +++ m4-1.4.9/lib/mkdtemp.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,32 +0,0 @@ -/* Creating a private temporary directory. - Copyright (C) 2001-2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#if HAVE_MKDTEMP - -/* Get mkdtemp() declaration. */ -#include - -#else - -/* Create a unique temporary directory from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the directory name unique. - Returns TEMPLATE, or a null pointer if it cannot get a unique name. - The directory is created mode 700. */ -extern char * mkdtemp (char *template); - -#endif diff -ruNp m4-1.4.8/lib/mkstemp-safer.c m4-1.4.9/lib/mkstemp-safer.c --- m4-1.4.8/lib/mkstemp-safer.c 2006-11-20 07:23:01.000000000 -0700 +++ m4-1.4.9/lib/mkstemp-safer.c 2007-03-23 06:50:51.000000000 -0600 @@ -1,6 +1,6 @@ /* Invoke mkstemp, but avoid some glitches. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ #include "stdlib-safer.h" -#include "mkstemp.h" +#include #include "unistd-safer.h" /* Like mkstemp, but do not return STDIN_FILENO, STDOUT_FILENO, or diff -ruNp m4-1.4.8/lib/mkstemp.c m4-1.4.9/lib/mkstemp.c --- m4-1.4.8/lib/mkstemp.c 2006-11-20 06:57:40.000000000 -0700 +++ m4-1.4.9/lib/mkstemp.c 2007-03-23 06:50:52.000000000 -0600 @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2001, 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2001, 2005, 2006, 2007 Free Software Foundation, Inc. This file is derived from the one in the GNU C Library. This program is free software; you can redistribute it and/or modify @@ -17,14 +17,17 @@ #if !_LIBC # include -# include "mkstemp.h" +#endif + +#include + +#if !_LIBC # include "tempname.h" # define __gen_tempname gen_tempname # define __GT_FILE GT_FILE #endif #include -#include #ifndef __GT_FILE # define __GT_FILE 0 diff -ruNp m4-1.4.8/lib/mkstemp.h m4-1.4.9/lib/mkstemp.h --- m4-1.4.8/lib/mkstemp.h 2006-11-20 06:57:40.000000000 -0700 +++ m4-1.4.9/lib/mkstemp.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,31 +0,0 @@ -/* Create a unique temporary file. - - Copyright (C) 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* written by Jim Meyering */ - -#include -#include - -#ifdef __MKSTEMP_PREFIX -# define _GL_CONCAT(x, y) x ## y -# define _GL_XCONCAT(x, y) _GL_CONCAT (x, y) -# define __MKSTEMP_ID(y) _GL_XCONCAT (__MKSTEMP_PREFIX, y) -# undef mkstemp -# define mkstemp __MKSTEMP_ID (mkstemp) -int mkstemp (char *); -#endif diff -ruNp m4-1.4.8/lib/printf-args.c m4-1.4.9/lib/printf-args.c --- m4-1.4.8/lib/printf-args.c 2006-11-20 06:57:42.000000000 -0700 +++ m4-1.4.9/lib/printf-args.c 2007-03-23 06:50:53.000000000 -0600 @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2005-2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,7 +56,7 @@ printf_fetchargs (va_list args, argument case TYPE_ULONGINT: ap->a.a_ulongint = va_arg (args, unsigned long int); break; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: ap->a.a_longlongint = va_arg (args, long long int); break; @@ -67,7 +67,7 @@ printf_fetchargs (va_list args, argument case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: ap->a.a_longdouble = va_arg (args, long double); break; @@ -75,7 +75,7 @@ printf_fetchargs (va_list args, argument case TYPE_CHAR: ap->a.a_char = va_arg (args, int); break; -#ifdef HAVE_WINT_T +#if HAVE_WINT_T case TYPE_WIDE_CHAR: /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by default argument promotions", this is not the case in mingw32, @@ -94,7 +94,7 @@ printf_fetchargs (va_list args, argument if (ap->a.a_string == NULL) ap->a.a_string = "(NULL)"; break; -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T case TYPE_WIDE_STRING: ap->a.a_wide_string = va_arg (args, const wchar_t *); /* A null pointer is an invalid argument for "%ls", but in practice @@ -128,7 +128,7 @@ printf_fetchargs (va_list args, argument case TYPE_COUNT_LONGINT_POINTER: ap->a.a_count_longint_pointer = va_arg (args, long int *); break; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; diff -ruNp m4-1.4.8/lib/printf-args.h m4-1.4.9/lib/printf-args.h --- m4-1.4.8/lib/printf-args.h 2006-11-20 06:57:42.000000000 -0700 +++ m4-1.4.9/lib/printf-args.h 2007-03-23 06:50:53.000000000 -0600 @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,12 +22,12 @@ #include /* Get wchar_t. */ -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T # include #endif /* Get wint_t. */ -#ifdef HAVE_WINT_T +#if HAVE_WINT_T # include #endif @@ -47,20 +47,20 @@ typedef enum TYPE_UINT, TYPE_LONGINT, TYPE_ULONGINT, -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT TYPE_LONGLONGINT, TYPE_ULONGLONGINT, #endif TYPE_DOUBLE, -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE TYPE_LONGDOUBLE, #endif TYPE_CHAR, -#ifdef HAVE_WINT_T +#if HAVE_WINT_T TYPE_WIDE_CHAR, #endif TYPE_STRING, -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T TYPE_WIDE_STRING, #endif TYPE_POINTER, @@ -68,7 +68,7 @@ typedef enum TYPE_COUNT_SHORT_POINTER, TYPE_COUNT_INT_POINTER, TYPE_COUNT_LONGINT_POINTER -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT , TYPE_COUNT_LONGLONGINT_POINTER #endif } arg_type; @@ -87,21 +87,21 @@ typedef struct unsigned int a_uint; long int a_longint; unsigned long int a_ulongint; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT long long int a_longlongint; unsigned long long int a_ulonglongint; #endif float a_float; double a_double; -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE long double a_longdouble; #endif int a_char; -#ifdef HAVE_WINT_T +#if HAVE_WINT_T wint_t a_wide_char; #endif const char* a_string; -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T const wchar_t* a_wide_string; #endif void* a_pointer; @@ -109,7 +109,7 @@ typedef struct short * a_count_short_pointer; int * a_count_int_pointer; long int * a_count_longint_pointer; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT long long int * a_count_longlongint_pointer; #endif } diff -ruNp m4-1.4.8/lib/printf-parse.c m4-1.4.9/lib/printf-parse.c --- m4-1.4.8/lib/printf-parse.c 2006-11-20 07:23:03.000000000 -0700 +++ m4-1.4.9/lib/printf-parse.c 2007-03-23 06:50:53.000000000 -0600 @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999-2000, 2002-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -326,7 +326,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRE flags += 8; cp++; } -#ifdef HAVE_INTMAX_T +#if HAVE_INTMAX_T else if (*cp == 'j') { if (sizeof (intmax_t) > sizeof (long)) @@ -382,7 +382,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRE switch (c) { case 'd': case 'i': -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; @@ -400,7 +400,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRE type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; @@ -419,7 +419,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRE break; case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE if (flags >= 16 || (flags & 4)) type = TYPE_LONGDOUBLE; else @@ -428,7 +428,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRE break; case 'c': if (flags >= 8) -#ifdef HAVE_WINT_T +#if HAVE_WINT_T type = TYPE_WIDE_CHAR; #else goto error; @@ -436,7 +436,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRE else type = TYPE_CHAR; break; -#ifdef HAVE_WINT_T +#if HAVE_WINT_T case 'C': type = TYPE_WIDE_CHAR; c = 'c'; @@ -444,7 +444,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRE #endif case 's': if (flags >= 8) -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T type = TYPE_WIDE_STRING; #else goto error; @@ -452,7 +452,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRE else type = TYPE_STRING; break; -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T case 'S': type = TYPE_WIDE_STRING; c = 's'; @@ -462,7 +462,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRE type = TYPE_POINTER; break; case 'n': -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; diff -ruNp m4-1.4.8/lib/quotearg.c m4-1.4.9/lib/quotearg.c --- m4-1.4.8/lib/quotearg.c 2006-11-20 07:23:03.000000000 -0700 +++ m4-1.4.9/lib/quotearg.c 2007-03-23 06:50:53.000000000 -0600 @@ -1,6 +1,6 @@ /* quotearg.c - quote arguments for output - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006 Free + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -31,20 +31,13 @@ #include #include #include +#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) #define N_(msgid) msgid -#if HAVE_WCHAR_H - -/* BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared. */ -# include -# include - -# include -#endif - #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 @@ -62,15 +55,6 @@ # define mbsinit(ps) 1 #endif -#ifndef iswprint -# if HAVE_WCTYPE_H -# include -# endif -# if !defined iswprint && !HAVE_ISWPRINT -# define iswprint(wc) 1 -# endif -#endif - #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif diff -ruNp m4-1.4.8/lib/ref-add.sin m4-1.4.9/lib/ref-add.sin --- m4-1.4.8/lib/ref-add.sin 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/ref-add.sin 2007-03-23 06:50:54.000000000 -0600 @@ -0,0 +1,30 @@ +# Add this package to a list of references stored in a text file. +# +# Copyright (C) 2000 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Written by Bruno Haible . +# +/^# Packages using this file: / { + s/# Packages using this file:// + ta + :a + s/ @PACKAGE@ / @PACKAGE@ / + tb + s/ $/ @PACKAGE@ / + :b + s/^/# Packages using this file:/ +} diff -ruNp m4-1.4.8/lib/ref-del.sin m4-1.4.9/lib/ref-del.sin --- m4-1.4.8/lib/ref-del.sin 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/ref-del.sin 2007-03-23 06:50:54.000000000 -0600 @@ -0,0 +1,25 @@ +# Remove this package from a list of references stored in a text file. +# +# Copyright (C) 2000 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Written by Bruno Haible . +# +/^# Packages using this file: / { + s/# Packages using this file:// + s/ @PACKAGE@ / / + s/^/# Packages using this file:/ +} diff -ruNp m4-1.4.8/lib/regcomp.c m4-1.4.9/lib/regcomp.c --- m4-1.4.8/lib/regcomp.c 2006-09-23 22:28:37.000000000 -0600 +++ m4-1.4.9/lib/regcomp.c 2007-03-23 06:50:54.000000000 -0600 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002,2003,2004,2005,2006 Free Software Foundation, Inc. + Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -451,8 +451,8 @@ re_compile_fastmap_iter (regex_t *bufp, int regcomp (preg, pattern, cflags) - regex_t *__restrict preg; - const char *__restrict pattern; + regex_t *_Restrict_ preg; + const char *_Restrict_ pattern; int cflags; { reg_errcode_t ret; @@ -515,13 +515,13 @@ weak_alias (__regcomp, regcomp) size_t regerror (errcode, preg, errbuf, errbuf_size) int errcode; - const regex_t *__restrict preg; - char *__restrict errbuf; + const regex_t *_Restrict_ preg; + char *_Restrict_ errbuf; size_t errbuf_size; #else /* size_t might promote */ size_t -regerror (int errcode, const regex_t *__restrict preg, - char *__restrict errbuf, size_t errbuf_size) +regerror (int errcode, const regex_t *_Restrict_ preg, + char *_Restrict_ errbuf, size_t errbuf_size) #endif { const char *msg; @@ -542,17 +542,13 @@ regerror (int errcode, const regex_t *__ if (BE (errbuf_size != 0, 1)) { + size_t cpy_size = msg_size; if (BE (msg_size > errbuf_size, 0)) { -#if defined HAVE_MEMPCPY || defined _LIBC - *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; -#else - memcpy (errbuf, msg, errbuf_size - 1); - errbuf[errbuf_size - 1] = 0; -#endif + cpy_size = errbuf_size - 1; + errbuf[cpy_size] = '\0'; } - else - memcpy (errbuf, msg, msg_size); + memcpy (errbuf, msg, cpy_size); } return msg_size; @@ -833,9 +829,6 @@ static reg_errcode_t init_dfa (re_dfa_t *dfa, size_t pat_len) { __re_size_t table_size; -#ifndef _LIBC - char *codeset_name; -#endif #ifdef RE_ENABLE_I18N size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t)); #else @@ -879,22 +872,7 @@ init_dfa (re_dfa_t *dfa, size_t pat_len) dfa->map_notascii = (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_TO_NONASCII) != 0); #else -# ifdef HAVE_LANGINFO_CODESET - codeset_name = nl_langinfo (CODESET); -# else - codeset_name = getenv ("LC_ALL"); - if (codeset_name == NULL || codeset_name[0] == '\0') - codeset_name = getenv ("LC_CTYPE"); - if (codeset_name == NULL || codeset_name[0] == '\0') - codeset_name = getenv ("LANG"); - if (codeset_name == NULL) - codeset_name = ""; - else if (strchr (codeset_name, '.') != NULL) - codeset_name = strchr (codeset_name, '.') + 1; -# endif - - if (strcasecmp (codeset_name, "UTF-8") == 0 - || strcasecmp (codeset_name, "UTF8") == 0) + if (strcmp (locale_charset (), "UTF-8") == 0) dfa->is_utf8 = 1; /* We check exhaustively in the loop below if this charset is a @@ -2177,7 +2155,7 @@ static bin_tree_t * parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token, reg_syntax_t syntax, Idx nest, reg_errcode_t *err) { - bin_tree_t *tree, *exp; + bin_tree_t *tree, *expr; re_dfa_t *dfa = (re_dfa_t *) preg->buffer; tree = parse_expression (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && tree == NULL, 0)) @@ -2186,14 +2164,14 @@ parse_branch (re_string_t *regexp, regex while (token->type != OP_ALT && token->type != END_OF_RE && (nest == 0 || token->type != OP_CLOSE_SUBEXP)) { - exp = parse_expression (regexp, preg, token, syntax, nest, err); - if (BE (*err != REG_NOERROR && exp == NULL, 0)) + expr = parse_expression (regexp, preg, token, syntax, nest, err); + if (BE (*err != REG_NOERROR && expr == NULL, 0)) { return NULL; } - if (tree != NULL && exp != NULL) + if (tree != NULL && expr != NULL) { - tree = create_tree (dfa, tree, exp, CONCAT); + tree = create_tree (dfa, tree, expr, CONCAT); if (tree == NULL) { *err = REG_ESPACE; @@ -2201,8 +2179,8 @@ parse_branch (re_string_t *regexp, regex } } else if (tree == NULL) - tree = exp; - /* Otherwise exp == NULL, we don't need to create new tree. */ + tree = expr; + /* Otherwise expr == NULL, we don't need to create new tree. */ } return tree; } @@ -3074,7 +3052,7 @@ parse_bracket_exp (re_string_t *regexp, #endif /* not RE_ENABLE_I18N */ non_match = true; if (syntax & RE_HAT_LISTS_NOT_NEWLINE) - bitset_set (sbcset, '\0'); + bitset_set (sbcset, '\n'); re_string_skip_bytes (regexp, token_len); /* Skip a token. */ token_len = peek_token_bracket (token, regexp, syntax); if (BE (token->type == END_OF_RE, 0)) @@ -3605,10 +3583,6 @@ build_charclass_op (re_dfa_t *dfa, RE_TR if (non_match) { #ifdef RE_ENABLE_I18N - /* - if (syntax & RE_HAT_LISTS_NOT_NEWLINE) - bitset_set(cset->sbcset, '\0'); - */ mbcset->non_match = 1; #endif /* not RE_ENABLE_I18N */ } diff -ruNp m4-1.4.8/lib/regex.h m4-1.4.9/lib/regex.h --- m4-1.4.8/lib/regex.h 2006-09-23 22:28:37.000000000 -0600 +++ m4-1.4.9/lib/regex.h 2007-03-23 06:50:55.000000000 -0600 @@ -625,38 +625,45 @@ extern int re_exec (const char *); #endif /* GCC 2.95 and later have "__restrict"; C99 compilers have - "restrict", and "configure" may have defined "restrict". */ -#ifndef __restrict -# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)) -# if defined restrict || 199901L <= __STDC_VERSION__ -# define __restrict restrict -# else -# define __restrict -# endif + "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. */ -#ifndef __restrict_arr -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) \ - && !defined __GNUG__ -# define __restrict_arr __restrict +/* 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 +# define _Restrict_arr_ # endif #endif /* POSIX compatibility. */ -extern int regcomp (regex_t *__restrict __preg, - const char *__restrict __pattern, +extern int regcomp (regex_t *_Restrict_ __preg, + const char *_Restrict_ __pattern, int __cflags); -extern int regexec (const regex_t *__restrict __preg, - const char *__restrict __string, size_t __nmatch, - regmatch_t __pmatch[__restrict_arr], +extern int regexec (const regex_t *_Restrict_ __preg, + const char *_Restrict_ __string, size_t __nmatch, + regmatch_t __pmatch[_Restrict_arr_], int __eflags); -extern size_t regerror (int __errcode, const regex_t *__restrict __preg, - char *__restrict __errbuf, size_t __errbuf_size); +extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, + char *_Restrict_ __errbuf, size_t __errbuf_size); extern void regfree (regex_t *__preg); diff -ruNp m4-1.4.8/lib/regex_internal.c m4-1.4.9/lib/regex_internal.c --- m4-1.4.8/lib/regex_internal.c 2006-09-23 22:28:38.000000000 -0600 +++ m4-1.4.9/lib/regex_internal.c 2007-03-23 06:50:55.000000000 -0600 @@ -1,5 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software + Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -706,7 +707,7 @@ re_string_reconstruct (re_string_t *pstr if (pstr->is_utf8) { - const unsigned char *raw, *p, *q, *end; + const unsigned char *raw, *p, *end; /* Special case UTF-8. Multi-byte chars start with any byte other than 0x80 - 0xbf. */ @@ -735,13 +736,11 @@ re_string_reconstruct (re_string_t *pstr unsigned char buf[6]; size_t mbclen; - q = p; if (BE (pstr->trans != NULL, 0)) { int i = mlen < 6 ? mlen : 6; while (--i >= 0) buf[i] = pstr->trans[p[i]]; - q = buf; } /* XXX Don't use mbrtowc, we know which conversion to use (UTF-8 -> UCS4). */ diff -ruNp m4-1.4.8/lib/regex_internal.h m4-1.4.9/lib/regex_internal.h --- m4-1.4.8/lib/regex_internal.h 2006-09-23 22:28:38.000000000 -0600 +++ m4-1.4.9/lib/regex_internal.h 2007-03-23 06:50:55.000000000 -0600 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -27,22 +27,17 @@ #include #include -#ifndef _LIBC -# include "strcase.h" -#endif - -#if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC +#ifdef _LIBC # include +#else +# include "localcharset.h" #endif #if defined HAVE_LOCALE_H || defined _LIBC # include #endif -#if defined HAVE_WCHAR_H || defined _LIBC -# include -#endif /* HAVE_WCHAR_H || _LIBC */ -#if defined HAVE_WCTYPE_H || defined _LIBC -# include -#endif /* HAVE_WCTYPE_H || _LIBC */ + +#include +#include #include #if defined _LIBC # include @@ -89,7 +84,7 @@ # define SIZE_MAX ((size_t) -1) #endif -#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC +#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC # define RE_ENABLE_I18N #endif @@ -119,9 +114,6 @@ # define __wctype wctype # define __iswctype iswctype # define __btowc btowc -# ifndef __mempcpy -# define __mempcpy mempcpy -# endif # define __wcrtomb wcrtomb # define __regfree regfree # define attribute_hidden @@ -348,7 +340,7 @@ typedef struct Idx idx; /* for BACK_REF */ re_context_type ctx_type; /* for ANCHOR */ } opr; -#if __GNUC__ >= 2 +#if __GNUC__ >= 2 && !__STRICT_ANSI__ re_token_type_t type : 8; #else re_token_type_t type; diff -ruNp m4-1.4.8/lib/regexec.c m4-1.4.9/lib/regexec.c --- m4-1.4.8/lib/regexec.c 2006-09-23 22:28:38.000000000 -0600 +++ m4-1.4.9/lib/regexec.c 2007-03-23 06:50:56.000000000 -0600 @@ -221,10 +221,10 @@ static reg_errcode_t extend_buffers (re_ int regexec (preg, string, nmatch, pmatch, eflags) - const regex_t *__restrict preg; - const char *__restrict string; + const regex_t *_Restrict_ preg; + const char *_Restrict_ string; size_t nmatch; - regmatch_t pmatch[]; + regmatch_t pmatch[_Restrict_arr_]; int eflags; { reg_errcode_t err; @@ -267,8 +267,8 @@ __typeof__ (__regexec) __compat_regexec; int attribute_compat_text_section -__compat_regexec (const regex_t *__restrict preg, - const char *__restrict string, size_t nmatch, +__compat_regexec (const regex_t *_Restrict_ preg, + const char *_Restrict_ string, size_t nmatch, regmatch_t pmatch[], int eflags) { return regexec (preg, string, nmatch, pmatch, @@ -3966,7 +3966,7 @@ check_node_accept_bytes (const re_dfa_t # endif /* _LIBC */ { /* match with range expression? */ -#if __GNUC__ >= 2 +#if __GNUC__ >= 2 && ! (__STDC_VERSION__ < 199901L && __STRICT_ANSI__) wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'}; #else wchar_t cmp_buf[] = {L'\0', L'\0', L'\0', L'\0', L'\0', L'\0'}; diff -ruNp m4-1.4.8/lib/stdbool_.h m4-1.4.9/lib/stdbool_.h --- m4-1.4.8/lib/stdbool_.h 2006-09-23 22:28:38.000000000 -0600 +++ m4-1.4.9/lib/stdbool_.h 2007-03-23 06:50:57.000000000 -0600 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -41,6 +41,9 @@ - You cannot assume that _Bool is a typedef; it might be a macro. + - Bit-fields of type 'bool' are not supported. Portable code + should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'. + - In C99, casts and automatic conversions to '_Bool' or 'bool' are performed in such a way that every nonzero value gets converted to 'true', and zero gets converted to 'false'. This doesn't work diff -ruNp m4-1.4.8/lib/stdint_.h m4-1.4.9/lib/stdint_.h --- m4-1.4.8/lib/stdint_.h 2006-11-20 07:23:06.000000000 -0700 +++ m4-1.4.9/lib/stdint_.h 2007-03-23 06:50:57.000000000 -0600 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -82,11 +82,7 @@ #if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS /* Get WCHAR_MIN, WCHAR_MAX. */ -# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) - /* BSD/OS 4.1 has a bug: and must be included before - . */ -# include -# include +# if ! (defined WCHAR_MIN && defined WCHAR_MAX) # include # endif @@ -124,22 +120,34 @@ #define int32_t int #define uint32_t unsigned int -#undef int64_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 +# define GL_INT64_T #elif defined _MSC_VER +# undef int64_t # define int64_t __int64 +# define GL_INT64_T #elif @HAVE_LONG_LONG_INT@ +# undef int64_t # define int64_t long long int +# define GL_INT64_T #endif -#undef uint64_t #if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# undef uint64_t # define uint64_t unsigned long int +# define GL_UINT64_T #elif defined _MSC_VER +# undef uint64_t # define uint64_t unsigned __int64 +# define GL_UINT64_T #elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# undef uint64_t # define uint64_t unsigned long long int +# define GL_UINT64_T #endif /* Avoid collision with Solaris 2.5.1 etc. */ @@ -168,10 +176,10 @@ #define uint_least16_t uint16_t #define int_least32_t int32_t #define uint_least32_t uint32_t -#ifdef int64_t +#ifdef GL_INT64_T # define int_least64_t int64_t #endif -#ifdef uint64_t +#ifdef GL_UINT64_T # define uint_least64_t uint64_t #endif @@ -199,10 +207,10 @@ #define uint_fast16_t unsigned int_fast16_t #define int_fast32_t long int #define uint_fast32_t unsigned int_fast32_t -#ifdef int64_t +#ifdef GL_INT64_T # define int_fast64_t int64_t #endif -#ifdef uint64_t +#ifdef GL_UINT64_T # define uint_fast64_t uint64_t #endif @@ -221,7 +229,7 @@ #undef intmax_t #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define intmax_t long long int -#elif defined int64_t +#elif defined GL_INT64_T # define intmax_t int64_t #else # define intmax_t long int @@ -230,7 +238,7 @@ #undef uintmax_t #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # define uintmax_t unsigned long long int -#elif defined uint64_t +#elif defined GL_UINT64_T # define uintmax_t uint64_t #else # define uintmax_t unsigned long int @@ -268,13 +276,15 @@ #undef INT64_MIN #undef INT64_MAX -#ifdef int64_t -# define INT64_MIN (~ INT64_MAX) +#ifdef GL_INT64_T +/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 + evaluates the latter incorrectly in preprocessor expressions. */ +# define INT64_MIN (- INTMAX_C (1) << 63) # define INT64_MAX INTMAX_C (9223372036854775807) #endif #undef UINT64_MAX -#ifdef uint64_t +#ifdef GL_UINT64_T # define UINT64_MAX UINTMAX_C (18446744073709551615) #endif @@ -307,13 +317,13 @@ #undef INT_LEAST64_MIN #undef INT_LEAST64_MAX -#ifdef int64_t +#ifdef GL_INT64_T # define INT_LEAST64_MIN INT64_MIN # define INT_LEAST64_MAX INT64_MAX #endif #undef UINT_LEAST64_MAX -#ifdef uint64_t +#ifdef GL_UINT64_T # define UINT_LEAST64_MAX UINT64_MAX #endif @@ -346,13 +356,13 @@ #undef INT_FAST64_MIN #undef INT_FAST64_MAX -#ifdef int64_t +#ifdef GL_INT64_T # define INT_FAST64_MIN INT64_MIN # define INT_FAST64_MAX INT64_MAX #endif #undef UINT_FAST64_MAX -#ifdef uint64_t +#ifdef GL_UINT64_T # define UINT_FAST64_MAX UINT64_MAX #endif @@ -369,10 +379,11 @@ #undef INTMAX_MIN #undef INTMAX_MAX -#define INTMAX_MIN (~ INTMAX_MAX) #ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN # define INTMAX_MAX INT64_MAX #else +# define INTMAX_MIN INT32_MIN # define INTMAX_MAX INT32_MAX #endif @@ -473,7 +484,7 @@ #undef INTMAX_C #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define INTMAX_C(x) x##LL -#elif defined int64_t +#elif defined GL_INT64_T # define INTMAX_C(x) INT64_C(x) #else # define INTMAX_C(x) x##L @@ -482,7 +493,7 @@ #undef UINTMAX_C #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # define UINTMAX_C(x) x##ULL -#elif defined uint64_t +#elif defined GL_UINT64_T # define UINTMAX_C(x) UINT64_C(x) #else # define UINTMAX_C(x) x##UL diff -ruNp m4-1.4.8/lib/stdlib--.h m4-1.4.9/lib/stdlib--.h --- m4-1.4.8/lib/stdlib--.h 2006-09-23 22:28:39.000000000 -0600 +++ m4-1.4.9/lib/stdlib--.h 2007-03-23 06:50:57.000000000 -0600 @@ -1,6 +1,6 @@ /* Like stdlib.h, but redefine some names to avoid glitches. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,6 +21,5 @@ #include #include "stdlib-safer.h" -#include "mkstemp.h" #undef mkstemp #define mkstemp mkstemp_safer diff -ruNp m4-1.4.8/lib/stdlib_.h m4-1.4.9/lib/stdlib_.h --- m4-1.4.8/lib/stdlib_.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/stdlib_.h 2007-03-23 06:50:58.000000000 -0600 @@ -0,0 +1,141 @@ +/* A GNU-like . + + Copyright (C) 1995, 2001-2002, 2006-2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#if defined __need_malloc_and_calloc +/* Special invocation convention inside glibc header files. */ + +/* This #pragma avoids a warning with "gcc -Wall" on some glibc systems + on which has an inappropriate declaration, see + . */ +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include @ABSOLUTE_STDLIB_H@ + +#else +/* Normal invocation convention. */ +#ifndef _GL_STDLIB_H +#define _GL_STDLIB_H + +/* This #pragma avoids a warning with "gcc -Wall" on some glibc systems + on which has an inappropriate declaration, see + . */ +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include @ABSOLUTE_STDLIB_H@ + + +/* The definition of GL_LINK_WARNING is copied here. */ + + +/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere + with proper operation of xargs. */ +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#elif EXIT_FAILURE != 1 +# undef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_GETSUBOPT@ +/* Assuming *OPTIONP is a comma separated list of elements of the form + "token" or "token=value", getsubopt parses the first of these elements. + If the first element refers to a "token" that is member of the given + NULL-terminated array of tokens: + - It replaces the comma with a NUL byte, updates *OPTIONP to point past + the first option and the comma, sets *VALUEP to the value of the + element (or NULL if it doesn't contain an "=" sign), + - It returns the index of the "token" in the given array of tokens. + Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. + For more details see the POSIX:2001 specification. + http://www.opengroup.org/susv3xsh/getsubopt.html */ +# if !@HAVE_GETSUBOPT@ +extern int getsubopt (char **optionp, char *const *tokens, char **valuep); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getsubopt +# define getsubopt(o,t,v) \ + (GL_LINK_WARNING ("getsubopt is unportable - " \ + "use gnulib module getsubopt for portability"), \ + getsubopt (o, t, v)) +#endif + + +#if @GNULIB_MKDTEMP@ +# if !@HAVE_MKDTEMP@ +/* Create a unique temporary directory from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the directory name unique. + Returns TEMPLATE, or a null pointer if it cannot get a unique name. + The directory is created mode 700. */ +extern char * mkdtemp (char *template); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mkdtemp +# define mkdtemp(t) \ + (GL_LINK_WARNING ("mkdtemp is unportable - " \ + "use gnulib module mkdtemp for portability"), \ + mkdtemp (t)) +#endif + + +#if @GNULIB_MKSTEMP@ +# if @REPLACE_MKSTEMP@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The file is then created, ensuring it didn't exist before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# define mkstemp rpl_mkstemp +extern int mkstemp (char *template); +# else +/* On MacOS X 10.3, only declares mkstemp. */ +# include +# endif +#elif defined GNULIB_POSIXCHECK +# undef mkstemp +# define mkstemp(t) \ + (GL_LINK_WARNING ("mkstemp is unportable - " \ + "use gnulib module mkstemp for portability"), \ + mkstemp (t)) +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_STDLIB_H */ +#endif diff -ruNp m4-1.4.8/lib/strcase.h m4-1.4.9/lib/strcase.h --- m4-1.4.8/lib/strcase.h 2006-11-20 07:23:07.000000000 -0700 +++ m4-1.4.9/lib/strcase.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,56 +0,0 @@ -/* Case-insensitive string comparison functions. - Copyright (C) 1995-1996, 2001, 2003, 2005-2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _STRCASE_H -#define _STRCASE_H - -#include -/* Include header files with a possibly conflicting declarations of strcasecmp - before we define it as a macro, so that they will be no-ops if included - after strcasecmp is defined as a macro. */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/* No known system has a strcasecmp() function that works correctly in - multibyte locales. Therefore we use our version always. */ -#define strcasecmp rpl_strcasecmp -/* Compare strings S1 and S2, ignoring case, returning less than, equal to or - greater than zero if S1 is lexicographically less than, equal to or greater - than S2. - Note: This function may, in multibyte locales, return 0 for strings of - different lengths! */ -extern int strcasecmp (const char *s1, const char *s2); - -/* Compare no more than N characters of strings S1 and S2, ignoring case, - returning less than, equal to or greater than zero if S1 is - lexicographically less than, equal to or greater than S2. - Note: This function can not work correctly in multibyte locales. */ -#if ! HAVE_DECL_STRNCASECMP -extern int strncasecmp (const char *s1, const char *s2, size_t n); -#endif - - -#ifdef __cplusplus -} -#endif - - -#endif /* _STRCASE_H */ diff -ruNp m4-1.4.8/lib/strcasecmp.c m4-1.4.9/lib/strcasecmp.c --- m4-1.4.8/lib/strcasecmp.c 2006-09-23 22:28:39.000000000 -0600 +++ m4-1.4.9/lib/strcasecmp.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,103 +0,0 @@ -/* Case-insensitive string comparison function. - Copyright (C) 1998-1999, 2005-2006 Free Software Foundation, Inc. - Written by Bruno Haible , 2005, - based on earlier glibc code. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include - -/* Specification. */ -#include "strcase.h" - -#include -#include - -#if HAVE_MBRTOWC -# include "mbuiter.h" -#endif - -#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) - -/* Compare strings S1 and S2, ignoring case, returning less than, equal to or - greater than zero if S1 is lexicographically less than, equal to or greater - than S2. - Note: This function may, in multibyte locales, return 0 for strings of - different lengths! */ -int -strcasecmp (const char *s1, const char *s2) -{ - if (s1 == s2) - return 0; - - /* Be careful not to look at the entire extent of s1 or s2 until needed. - This is useful because when two strings differ, the difference is - most often already in the very few first characters. */ -#if HAVE_MBRTOWC - if (MB_CUR_MAX > 1) - { - mbui_iterator_t iter1; - mbui_iterator_t iter2; - - mbui_init (iter1, s1); - mbui_init (iter2, s2); - - while (mbui_avail (iter1) && mbui_avail (iter2)) - { - int cmp = mb_casecmp (mbui_cur (iter1), mbui_cur (iter2)); - - if (cmp != 0) - return cmp; - - mbui_advance (iter1); - mbui_advance (iter2); - } - if (mbui_avail (iter1)) - /* s2 terminated before s1. */ - return 1; - if (mbui_avail (iter2)) - /* s1 terminated before s2. */ - return -1; - return 0; - } - else -#endif - { - const unsigned char *p1 = (const unsigned char *) s1; - const unsigned char *p2 = (const unsigned char *) s2; - unsigned char c1, c2; - - do - { - c1 = TOLOWER (*p1); - c2 = TOLOWER (*p2); - - if (c1 == '\0') - break; - - ++p1; - ++p2; - } - while (c1 == c2); - - if (UCHAR_MAX <= INT_MAX) - return c1 - c2; - else - /* On machines where 'char' and 'int' are types of the same size, the - difference of two 'unsigned char' values - including the sign bit - - doesn't fit in an 'int'. */ - return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); - } -} diff -ruNp m4-1.4.8/lib/strncasecmp.c m4-1.4.9/lib/strncasecmp.c --- m4-1.4.8/lib/strncasecmp.c 2006-09-23 22:28:39.000000000 -0600 +++ m4-1.4.9/lib/strncasecmp.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,63 +0,0 @@ -/* strncasecmp.c -- case insensitive string comparator - Copyright (C) 1998-1999, 2005-2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include - -/* Specification. */ -#include "strcase.h" - -#include -#include - -#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) - -/* Compare no more than N bytes of strings S1 and S2, - ignoring case, returning less than, equal to or - greater than zero if S1 is lexicographically less - than, equal to or greater than S2. */ - -int -strncasecmp (const char *s1, const char *s2, size_t n) -{ - register const unsigned char *p1 = (const unsigned char *) s1; - register const unsigned char *p2 = (const unsigned char *) s2; - unsigned char c1, c2; - - if (p1 == p2 || n == 0) - return 0; - - do - { - c1 = TOLOWER (*p1); - c2 = TOLOWER (*p2); - - if (--n == 0 || c1 == '\0') - break; - - ++p1; - ++p2; - } - while (c1 == c2); - - if (UCHAR_MAX <= INT_MAX) - return c1 - c2; - else - /* On machines where 'char' and 'int' are types of the same size, the - difference of two 'unsigned char' values - including the sign bit - - doesn't fit in an 'int'. */ - return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); -} diff -ruNp m4-1.4.8/lib/strnlen1.c m4-1.4.9/lib/strnlen1.c --- m4-1.4.8/lib/strnlen1.c 2006-11-20 06:57:47.000000000 -0700 +++ m4-1.4.9/lib/strnlen1.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,36 +0,0 @@ -/* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005-2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include - -/* Specification. */ -#include "strnlen1.h" - -#include - -/* Find the length of STRING + 1, but scan at most MAXLEN bytes. - If no '\0' terminator is found in that many characters, return MAXLEN. */ -/* This is the same as strnlen (string, maxlen - 1) + 1. */ -size_t -strnlen1 (const char *string, size_t maxlen) -{ - const char *end = (const char *) memchr (string, '\0', maxlen); - if (end != NULL) - return end - string + 1; - else - return maxlen; -} diff -ruNp m4-1.4.8/lib/strnlen1.h m4-1.4.9/lib/strnlen1.h --- m4-1.4.8/lib/strnlen1.h 2006-09-23 22:28:40.000000000 -0600 +++ m4-1.4.9/lib/strnlen1.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,40 +0,0 @@ -/* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _STRNLEN1_H -#define _STRNLEN1_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Find the length of STRING + 1, but scan at most MAXLEN bytes. - If no '\0' terminator is found in that many characters, return MAXLEN. */ -/* This is the same as strnlen (string, maxlen - 1) + 1. */ -extern size_t strnlen1 (const char *string, size_t maxlen); - - -#ifdef __cplusplus -} -#endif - - -#endif /* _STRNLEN1_H */ diff -ruNp m4-1.4.8/lib/strstr.c m4-1.4.9/lib/strstr.c --- m4-1.4.8/lib/strstr.c 2006-11-20 06:57:29.000000000 -0700 +++ m4-1.4.9/lib/strstr.c 1969-12-31 17:00:00.000000000 -0700 @@ -1,126 +0,0 @@ -/* Searching in a string. - Copyright (C) 2005-2006 Free Software Foundation, Inc. - Written by Bruno Haible , 2005. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include - -/* Specification. */ -#include "strstr.h" - -#include /* for NULL */ - -#if HAVE_MBRTOWC -# include "mbuiter.h" -#endif - -/* Find the first occurrence of NEEDLE in HAYSTACK. */ -char * -strstr (const char *haystack, const char *needle) -{ - /* Be careful not to look at the entire extent of haystack or needle - until needed. This is useful because of these two cases: - - haystack may be very long, and a match of needle found early, - - needle may be very long, and not even a short initial segment of - needle may be found in haystack. */ -#if HAVE_MBRTOWC - if (MB_CUR_MAX > 1) - { - mbui_iterator_t iter_needle; - - mbui_init (iter_needle, needle); - if (mbui_avail (iter_needle)) - { - mbui_iterator_t iter_haystack; - - mbui_init (iter_haystack, haystack); - for (;; mbui_advance (iter_haystack)) - { - if (!mbui_avail (iter_haystack)) - /* No match. */ - return NULL; - - if (mb_equal (mbui_cur (iter_haystack), mbui_cur (iter_needle))) - /* The first character matches. */ - { - mbui_iterator_t rhaystack; - mbui_iterator_t rneedle; - - memcpy (&rhaystack, &iter_haystack, sizeof (mbui_iterator_t)); - mbui_advance (rhaystack); - - mbui_init (rneedle, needle); - if (!mbui_avail (rneedle)) - abort (); - mbui_advance (rneedle); - - for (;; mbui_advance (rhaystack), mbui_advance (rneedle)) - { - if (!mbui_avail (rneedle)) - /* Found a match. */ - return (char *) mbui_cur_ptr (iter_haystack); - if (!mbui_avail (rhaystack)) - /* No match. */ - return NULL; - if (!mb_equal (mbui_cur (rhaystack), mbui_cur (rneedle))) - /* Nothing in this round. */ - break; - } - } - } - } - else - return (char *) haystack; - } - else -#endif - { - if (*needle != '\0') - { - /* Speed up the following searches of needle by caching its first - character. */ - char b = *needle++; - - for (;; haystack++) - { - if (*haystack == '\0') - /* No match. */ - return NULL; - if (*haystack == b) - /* The first character matches. */ - { - const char *rhaystack = haystack + 1; - const char *rneedle = needle; - - for (;; rhaystack++, rneedle++) - { - if (*rneedle == '\0') - /* Found a match. */ - return (char *) haystack; - if (*rhaystack == '\0') - /* No match. */ - return NULL; - if (*rhaystack != *rneedle) - /* Nothing in this round. */ - break; - } - } - } - } - else - return (char *) haystack; - } -} diff -ruNp m4-1.4.8/lib/strstr.h m4-1.4.9/lib/strstr.h --- m4-1.4.8/lib/strstr.h 2006-11-20 06:57:29.000000000 -0700 +++ m4-1.4.9/lib/strstr.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,37 +0,0 @@ -/* Searching in a string. - Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - - -/* Include string.h: on glibc systems, it contains a macro definition of - strstr() that would collide with our definition if included afterwards. */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* No known system has a strstr() function that works correctly in - multibyte locales. Therefore we use our version always. */ -#undef strstr -#define strstr rpl_strstr - -/* Find the first occurrence of NEEDLE in HAYSTACK. */ -extern char *strstr (const char *haystack, const char *needle); - -#ifdef __cplusplus -} -#endif diff -ruNp m4-1.4.8/lib/strtol.c m4-1.4.9/lib/strtol.c --- m4-1.4.8/lib/strtol.c 2006-09-23 22:28:40.000000000 -0600 +++ m4-1.4.9/lib/strtol.c 2007-03-23 06:50:58.000000000 -0600 @@ -1,6 +1,7 @@ /* Convert string representation of a number into an integer value. - Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005, 2006 + Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005, + 2006, 2007 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C @@ -187,9 +188,7 @@ # define LOCALE_PARAM_PROTO #endif -#if defined _LIBC || defined HAVE_WCHAR_H -# include -#endif +#include #ifdef USE_WIDE_CHAR # include diff -ruNp m4-1.4.8/lib/sys_time_.h m4-1.4.9/lib/sys_time_.h --- m4-1.4.8/lib/sys_time_.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/sys_time_.h 2007-03-23 06:50:58.000000000 -0600 @@ -0,0 +1,44 @@ +/* Provide a more complete sys/time.h. + + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Paul Eggert. */ + +#ifndef _gl_SYS_TIME_H +#define _gl_SYS_TIME_H + +#if @HAVE_SYS_TIME_H@ +# include @ABSOLUTE_SYS_TIME_H@ +#else +# include +#endif + +#if ! @HAVE_STRUCT_TIMEVAL@ +struct timeval +{ + time_t tv_sec; + long int tv_usec; +}; +#endif + +#if @REPLACE_GETTIMEOFDAY@ +# undef gettimeofday +# define gettimeofday rpl_gettimeofday +int gettimeofday (struct timeval *restrict, void *restrict); +#endif + +#endif /* _gl_SYS_TIME_H */ diff -ruNp m4-1.4.8/lib/tempname.c m4-1.4.9/lib/tempname.c --- m4-1.4.8/lib/tempname.c 2006-11-20 07:23:09.000000000 -0700 +++ m4-1.4.9/lib/tempname.c 2007-03-23 06:50:59.000000000 -0600 @@ -1,7 +1,8 @@ /* tempname.c - generate the name of a temporary file. Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, + Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,11 +52,7 @@ #include #include - -#if HAVE_SYS_TIME_H || _LIBC -# include -#endif - +#include #include #include @@ -242,15 +239,11 @@ __gen_tempname (char *tmpl, int kind) #ifdef RANDOM_BITS RANDOM_BITS (random_time_bits); #else -# if HAVE_GETTIMEOFDAY || _LIBC { struct timeval tv; __gettimeofday (&tv, NULL); random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; } -# else - random_time_bits = time (NULL); -# endif #endif value += random_time_bits ^ __getpid (); diff -ruNp m4-1.4.8/lib/unistd_.h m4-1.4.9/lib/unistd_.h --- m4-1.4.8/lib/unistd_.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/unistd_.h 2007-03-23 06:51:00.000000000 -0600 @@ -0,0 +1,192 @@ +/* Substitute for and wrapper around . + Copyright (C) 2004-2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_UNISTD_H +#define _GL_UNISTD_H + +#if @HAVE_UNISTD_H@ +# include @ABSOLUTE_UNISTD_H@ +#endif + + +/* The definition of GL_LINK_WARNING is copied here. */ + + +/* Declare overridden functions. */ + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_CHOWN@ +# if @REPLACE_CHOWN@ +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE + to GID (if GID is not -1). + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# define chown rpl_chown +extern int chown (const char *file, uid_t uid, gid_t gid); +# endif +#elif defined GNULIB_POSIXCHECK +# undef chown +# define chown(f,u,g) \ + (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \ + "doesn't treat a uid or gid of -1 on some systems - " \ + "use gnulib module chown for portability"), \ + chown (f, u, g)) +#endif + + +#if @GNULIB_DUP2@ +# if !@HAVE_DUP2@ +/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if + NEWFD = OLDFD, otherwise close NEWFD first if it is open. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +extern int dup2 (int oldfd, int newfd); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dup2 +# define dup2(o,n) \ + (GL_LINK_WARNING ("dup2 is unportable - " \ + "use gnulib module dup2 for portability"), \ + dup2 (o, n)) +#endif + + +#if @GNULIB_FCHDIR@ +# if @REPLACE_FCHDIR@ + +/* Change the process' current working directory to the directory on which + the given file descriptor is open. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +extern int fchdir (int /*fd*/); + +# define close rpl_close +extern int close (int); +# define dup rpl_dup +extern int dup (int); +# define dup2 rpl_dup2 +extern int dup2 (int, int); + +# endif +#elif defined GNULIB_POSIXCHECK +# undef fchdir +# define fchdir(f) \ + (GL_LINK_WARNING ("fchdir is unportable - " \ + "use gnulib module fchdir for portability"), \ + fchdir (f)) +#endif + + +#if @GNULIB_FTRUNCATE@ +# if !@HAVE_FTRUNCATE@ +/* Change the size of the file to which FD is opened to become equal to LENGTH. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +extern int ftruncate (int fd, off_t length); +# endif +#elif defined GNULIB_POSIXCHECK +# undef ftruncate +# define ftruncate(f,l) \ + (GL_LINK_WARNING ("ftruncate is unportable - " \ + "use gnulib module ftruncate for portability"), \ + ftruncate (f, l)) +#endif + + +#if @GNULIB_GETCWD@ +/* Include the headers that might declare getcwd so that they will not + cause confusion if included after this file. */ +# include +# if @REPLACE_GETCWD@ +/* Get the name of the current working directory, and put it in SIZE bytes + of BUF. + Return BUF if successful, or NULL if the directory couldn't be determined + or SIZE was too small. + See the POSIX:2001 specification + . + Additionally, the gnulib module 'getcwd' guarantees the following GNU + extension: If BUF is NULL, an array is allocated with 'malloc'; the array + is SIZE bytes long, unless SIZE == 0, in which case it is as big as + necessary. */ +# define getcwd rpl_getcwd +extern char * getcwd (char *buf, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getcwd +# define getcwd(b,s) \ + (GL_LINK_WARNING ("getcwd is unportable - " \ + "use gnulib module getcwd for portability"), \ + getcwd (b, s)) +#endif + + +#if @GNULIB_GETLOGIN_R@ +/* Copies the user's login name to NAME. + The array pointed to by NAME has room for SIZE bytes. + + Returns 0 if successful. Upon error, an error number is returned, or -1 in + the case that the login name cannot be found but no specific error is + provided (this case is hopefully rare but is left open by the POSIX spec). + + See . + */ +# if !@HAVE_DECL_GETLOGIN_R@ +# include +extern int getlogin_r (char *name, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getlogin_r +# define getlogin_r(n,s) \ + (GL_LINK_WARNING ("getlogin_r is unportable - " \ + "use gnulib module getlogin_r for portability"), \ + getlogin_r (n, s)) +#endif + + +#if @GNULIB_READLINK@ +/* Read the contents of the symbolic link FILE and place the first BUFSIZE + bytes of it into BUF. Return the number of bytes placed into BUF if + successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# if !@HAVE_READLINK@ +# include +extern int readlink (const char *file, char *buf, size_t bufsize); +# endif +#elif defined GNULIB_POSIXCHECK +# undef readlink +# define readlink(f,b,s) \ + (GL_LINK_WARNING ("readlink is unportable - " \ + "use gnulib module readlink for portability"), \ + readlink (f, b, s)) +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* _GL_UNISTD_H */ diff -ruNp m4-1.4.8/lib/vasnprintf.c m4-1.4.9/lib/vasnprintf.c --- m4-1.4.8/lib/vasnprintf.c 2006-11-20 06:57:49.000000000 -0700 +++ m4-1.4.9/lib/vasnprintf.c 2007-03-23 06:51:01.000000000 -0600 @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ # include "vasnprintf.h" #endif +#include /* localeconv() */ #include /* snprintf(), sprintf() */ #include /* abort(), malloc(), realloc(), free() */ #include /* memcpy(), strlen() */ @@ -49,8 +50,22 @@ /* Checked size_t computations. */ #include "xsize.h" -#ifdef HAVE_WCHAR_T -# ifdef HAVE_WCSLEN +#if NEED_PRINTF_DIRECTIVE_A && !defined IN_LIBINTL +# include "isnan.h" +# include "isnanl-nolibm.h" +# if HAVE_LONG_DOUBLE +# include "printf-frexp.h" +# include "printf-frexpl.h" +# endif +#endif + +/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ +#ifndef EOVERFLOW +# define EOVERFLOW E2BIG +#endif + +#if HAVE_WCHAR_T +# if HAVE_WCSLEN # define local_wcslen wcslen # else /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid @@ -100,8 +115,12 @@ local_wcslen (const wchar_t *s) # else /* Unix. */ # define SNPRINTF snprintf + /* Here we need to call the native snprintf, not rpl_snprintf. */ +# undef snprintf # endif #endif +/* Here we need to call the native sprintf, not rpl_sprintf. */ +#undef sprintf CHAR_T * VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args) @@ -248,7 +267,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l case TYPE_COUNT_LONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longint_pointer = length; break; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; break; @@ -257,6 +276,486 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l abort (); } } +#if NEED_PRINTF_DIRECTIVE_A && !defined IN_LIBINTL + else if (dp->conversion == 'a' || dp->conversion == 'A') + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + size_t tmp_length; + CHAR_T tmpbuf[700]; + CHAR_T *tmp; + CHAR_T *pad_ptr; + CHAR_T *p; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = (unsigned int) (-arg); + } + else + width = arg; + } + else + { + const CHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const CHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + /* Allocate a temporary buffer of sufficient size. */ +# if HAVE_LONG_DOUBLE + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) ((LDBL_DIG + 1) + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else +# endif + tmp_length = + (unsigned int) ((DBL_DIG + 1) + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + + if (tmp_length < width) + tmp_length = width; + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + + if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (CHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } + + pad_ptr = NULL; + p = tmp; +# if HAVE_LONG_DOUBLE + if (type == TYPE_LONGDOUBLE) + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + + if (isnanl (arg)) + { + if (dp->conversion == 'A') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + + if (arg < 0.0L) + { + sign = -1; + arg = -arg; + } + else if (arg == 0.0L) + { + /* Distinguish 0.0L and -0.0L. */ + static long double plus_zero = 0.0L; + long double arg_mem; + memset (&arg_mem, 0, sizeof (long double)); + arg_mem = arg; + if (memcmp (&plus_zero, &arg_mem, sizeof (long double)) != 0) + { + sign = -1; + arg = -arg; + } + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0L && arg + arg == arg) + { + if (dp->conversion == 'A') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { + int exponent; + long double mantissa; + + if (arg > 0.0L) + mantissa = printf_frexpl (arg, &exponent); + else + { + exponent = 0; + mantissa = 0.0L; + } + + if (has_precision + && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1) + { + /* Round the mantissa. */ + long double tail = mantissa; + size_t q; + + for (q = precision; ; q--) + { + int digit = (int) tail; + tail -= digit; + if (q == 0) + { + if (digit & 1 ? tail >= 0.5L : tail > 0.5L) + tail = 1 - tail; + else + tail = - tail; + break; + } + tail *= 16.0L; + } + if (tail != 0.0L) + for (q = precision; q > 0; q--) + tail *= 0.0625L; + mantissa += tail; + } + + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + { + int digit; + + digit = (int) mantissa; + mantissa -= digit; + *p++ = '0' + digit; + if ((flags & FLAG_ALT) + || mantissa > 0.0L || precision > 0) + { + const char *point = + localeconv () -> decimal_point; + /* The decimal point is always a single byte: + either '.' or ','. */ + *p++ = (point[0] != '\0' ? point[0] : '.'); + /* This loop terminates because we assume + that FLT_RADIX is a power of 2. */ + while (mantissa > 0.0L) + { + mantissa *= 16.0L; + digit = (int) mantissa; + mantissa -= digit; + *p++ = digit + + (digit < 10 + ? '0' + : dp->conversion - 10); + if (precision > 0) + precision--; + } + while (precision > 0) + { + *p++ = '0'; + precision--; + } + } + } + *p++ = dp->conversion - 'A' + 'P'; +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } +# else + sprintf (p, "%+d", exponent); +# endif + while (*p != '\0') + p++; + } + } + } + else +# endif + { + double arg = a.arg[dp->arg_index].a.a_double; + + if (isnan (arg)) + { + if (dp->conversion == 'A') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + + if (arg < 0.0) + { + sign = -1; + arg = -arg; + } + else if (arg == 0.0) + { + /* Distinguish 0.0 and -0.0. */ + static double plus_zero = 0.0; + double arg_mem; + memset (&arg_mem, 0, sizeof (double)); + arg_mem = arg; + if (memcmp (&plus_zero, &arg_mem, sizeof (double)) != 0) + { + sign = -1; + arg = -arg; + } + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0 && arg + arg == arg) + { + if (dp->conversion == 'A') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { + int exponent; + double mantissa; + + if (arg > 0.0) + mantissa = printf_frexp (arg, &exponent); + else + { + exponent = 0; + mantissa = 0.0; + } + + if (has_precision + && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1) + { + /* Round the mantissa. */ + double tail = mantissa; + size_t q; + + for (q = precision; ; q--) + { + int digit = (int) tail; + tail -= digit; + if (q == 0) + { + if (digit & 1 ? tail >= 0.5 : tail > 0.5) + tail = 1 - tail; + else + tail = - tail; + break; + } + tail *= 16.0; + } + if (tail != 0.0) + for (q = precision; q > 0; q--) + tail *= 0.0625; + mantissa += tail; + } + + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + { + int digit; + + digit = (int) mantissa; + mantissa -= digit; + *p++ = '0' + digit; + if ((flags & FLAG_ALT) + || mantissa > 0.0 || precision > 0) + { + const char *point = + localeconv () -> decimal_point; + /* The decimal point is always a single byte: + either '.' or ','. */ + *p++ = (point[0] != '\0' ? point[0] : '.'); + /* This loop terminates because we assume + that FLT_RADIX is a power of 2. */ + while (mantissa > 0.0) + { + mantissa *= 16.0; + digit = (int) mantissa; + mantissa -= digit; + *p++ = digit + + (digit < 10 + ? '0' + : dp->conversion - 10); + if (precision > 0) + precision--; + } + while (precision > 0) + { + *p++ = '0'; + precision--; + } + } + } + *p++ = dp->conversion - 'A' + 'P'; +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } +# else + sprintf (p, "%+d", exponent); +# endif + while (*p != '\0') + p++; + } + } + } + /* The generated string now extends from tmp to p, with the + zero padding insertion point being at pad_ptr. */ + if (has_width && p - tmp < width) + { + size_t pad = width - (p - tmp); + CHAR_T *end = p + pad; + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + CHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + CHAR_T *q = end; + + while (p > tmp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + + p = end; + } + + { + size_t count = p - tmp; + + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); + + /* Make room for the result. */ + if (count >= allocated - length) + { + size_t n = xsum (length, count); + + ENSURE_ALLOCATION (n); + } + + /* Append the result. */ + memcpy (result + length, tmp, count * sizeof (CHAR_T)); + if (tmp != tmpbuf) + free (tmp); + length += count; + } + } +#endif else { arg_type type = a.arg[dp->arg_index].type; @@ -322,7 +821,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l { case 'd': case 'i': case 'u': -# ifdef HAVE_LONG_LONG_INT +# if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT @@ -352,7 +851,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l break; case 'o': -# ifdef HAVE_LONG_LONG_INT +# if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT @@ -380,7 +879,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l break; case 'x': case 'X': -# ifdef HAVE_LONG_LONG_INT +# if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT @@ -408,7 +907,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l break; case 'f': case 'F': -# ifdef HAVE_LONG_DOUBLE +# if HAVE_LONG_DOUBLE if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_MAX_EXP @@ -430,14 +929,34 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l break; case 'e': case 'E': case 'g': case 'G': - case 'a': case 'A': tmp_length = 12; /* sign, decimal point, exponent etc. */ tmp_length = xsum (tmp_length, precision); break; + case 'a': case 'A': +# if HAVE_LONG_DOUBLE + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) (LDBL_DIG + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else +# endif + tmp_length = + (unsigned int) (DBL_DIG + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + break; + case 'c': -# if defined HAVE_WINT_T && !WIDE_CHAR_VERSION +# if HAVE_WINT_T && !WIDE_CHAR_VERSION if (type == TYPE_WIDE_CHAR) tmp_length = MB_CUR_MAX; else @@ -446,7 +965,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l break; case 's': -# ifdef HAVE_WCHAR_T +# if HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { tmp_length = @@ -527,7 +1046,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l switch (type) { -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: *p++ = 'l'; @@ -535,15 +1054,15 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l #endif case TYPE_LONGINT: case TYPE_ULONGINT: -#ifdef HAVE_WINT_T +#if HAVE_WINT_T case TYPE_WIDE_CHAR: #endif -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T case TYPE_WIDE_STRING: #endif *p++ = 'l'; break; -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: *p++ = 'L'; break; @@ -593,6 +1112,9 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l retcount = 0; #if USE_SNPRINTF + /* SNPRINTF can fail if maxlen > INT_MAX. */ + if (maxlen > INT_MAX) + goto overflow; # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ @@ -681,7 +1203,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l SNPRINTF_BUF (arg); } break; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: { long long int arg = a.arg[dp->arg_index].a.a_longlongint; @@ -701,7 +1223,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l SNPRINTF_BUF (arg); } break; -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: { long double arg = a.arg[dp->arg_index].a.a_longdouble; @@ -715,7 +1237,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l SNPRINTF_BUF (arg); } break; -#ifdef HAVE_WINT_T +#if HAVE_WINT_T case TYPE_WIDE_CHAR: { wint_t arg = a.arg[dp->arg_index].a.a_wide_char; @@ -729,7 +1251,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l SNPRINTF_BUF (arg); } break; -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T case TYPE_WIDE_STRING: { const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; @@ -868,6 +1390,15 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l not have this limitation. */ return result; + overflow: + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EOVERFLOW; + return NULL; + out_of_memory: if (!(result == resultbuf || result == NULL)) free (result); diff -ruNp m4-1.4.8/lib/vasnprintf.h m4-1.4.9/lib/vasnprintf.h --- m4-1.4.8/lib/vasnprintf.h 2006-09-23 22:28:40.000000000 -0600 +++ m4-1.4.9/lib/vasnprintf.h 2007-03-23 06:51:01.000000000 -0600 @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 2002-2004 Free Software Foundation, Inc. + Copyright (C) 2002-2004, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ # endif #endif -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -65,12 +65,16 @@ extern "C" { free (output); } */ +#if REPLACE_VASNPRINTF +# define asnprintf rpl_asnprintf +# define vasnprintf rpl_vasnprintf +#endif extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 3, 0))); -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff -ruNp m4-1.4.8/lib/vasprintf.h m4-1.4.9/lib/vasprintf.h --- m4-1.4.8/lib/vasprintf.h 2006-09-23 22:28:41.000000000 -0600 +++ m4-1.4.9/lib/vasprintf.h 2007-03-23 06:51:01.000000000 -0600 @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 2002-2003 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,9 @@ /* Get asprintf(), vasprintf() declarations. */ #include -#else +#endif + +#if !HAVE_VASPRINTF || REPLACE_VASPRINTF /* Get va_list. */ #include @@ -41,7 +43,7 @@ # endif #endif -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -49,12 +51,16 @@ extern "C" { If the memory allocation succeeds, store the address of the string in *RESULT and return the number of resulting bytes, excluding the trailing NUL. Upon memory allocation error, or some other error, return -1. */ +#if REPLACE_VASPRINTF +# define asprintf rpl_asprintf +# define vasprintf rpl_vasprintf +#endif extern int asprintf (char **result, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int vasprintf (char **result, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 2, 0))); -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff -ruNp m4-1.4.8/lib/verror.h m4-1.4.9/lib/verror.h --- m4-1.4.8/lib/verror.h 2006-09-23 22:28:41.000000000 -0600 +++ m4-1.4.9/lib/verror.h 2007-03-23 06:51:02.000000000 -0600 @@ -1,5 +1,5 @@ /* Declaration for va_list error-reporting function - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ #include "error.h" #include -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -47,7 +47,7 @@ extern void verror_at_line (int __status va_list __args) __attribute__ ((__format__ (__printf__, 5, 0))); -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff -ruNp m4-1.4.8/lib/version-etc-fsf.c m4-1.4.9/lib/version-etc-fsf.c --- m4-1.4.8/lib/version-etc-fsf.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/version-etc-fsf.c 2007-03-23 06:51:02.000000000 -0600 @@ -0,0 +1,31 @@ +/* Variable with FSF copyright information, for version-etc. + Copyright (C) 1999-2006 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Jim Meyering. */ + +#include + +/* Specification. */ +#include "version-etc.h" + +/* Default copyright goes to the FSF. */ + +const char version_etc_copyright[] = + /* Do *not* mark this string for translation. %s is a copyright + symbol suitable for this locale, and %d is the copyright + year. */ + "Copyright %s %d Free Software Foundation, Inc."; diff -ruNp m4-1.4.8/lib/version-etc.c m4-1.4.9/lib/version-etc.c --- m4-1.4.8/lib/version-etc.c 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/version-etc.c 2007-03-23 06:51:02.000000000 -0600 @@ -0,0 +1,173 @@ +/* Utility to help print --version output in a consistent format. + Copyright (C) 1999-2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Jim Meyering. */ + +#include + +/* Specification. */ +#include "version-etc.h" + +#include +#include +#include + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +enum { COPYRIGHT_YEAR = 2007 }; + +/* Like version_etc, below, but with the NULL-terminated author list + provided via a variable of type va_list. */ +void +version_etc_va (FILE *stream, + const char *command_name, const char *package, + const char *version, va_list authors) +{ + size_t n_authors; + + /* Count the number of authors. */ + { + va_list tmp_authors; + + va_copy (tmp_authors, authors); + + n_authors = 0; + while (va_arg (tmp_authors, const char *) != NULL) + ++n_authors; + } + + if (command_name) + fprintf (stream, "%s (%s) %s\n", command_name, package, version); + else + fprintf (stream, "%s %s\n", package, version); + + /* TRANSLATORS: Translate "(C)" to the copyright symbol + (C-in-a-circle), if this symbol is available in the user's + locale. Otherwise, do not translate "(C)"; leave it as-is. */ + fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR); + + fputs (_("\ +\n\ +License GPLv2+: GNU GPL version 2 or later \n\ +This is free software: you are free to change and redistribute it.\n\ +There is NO WARRANTY, to the extent permitted by law.\n\ +\n\ +"), + stream); + + switch (n_authors) + { + case 0: + /* The caller must provide at least one author name. */ + abort (); + case 1: + /* TRANSLATORS: %s denotes an author name. */ + vfprintf (stream, _("Written by %s.\n"), authors); + break; + case 2: + /* TRANSLATORS: Each %s denotes an author name. */ + vfprintf (stream, _("Written by %s and %s.\n"), authors); + break; + case 3: + /* TRANSLATORS: Each %s denotes an author name. */ + vfprintf (stream, _("Written by %s, %s, and %s.\n"), authors); + break; + case 4: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("Written by %s, %s, %s,\nand %s.\n"), authors); + break; + case 5: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("Written by %s, %s, %s,\n%s, and %s.\n"), authors); + break; + case 6: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"), + authors); + break; + case 7: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"), + authors); + break; + case 8: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("\ +Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"), + authors); + break; + case 9: + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("\ +Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"), + authors); + break; + default: + /* 10 or more authors. Use an abbreviation, since the human reader + will probably not want to read the entire list anyway. */ + /* TRANSLATORS: Each %s denotes an author name. + You can use line breaks, estimating that each author name occupies + ca. 16 screen columns and that a screen line has ca. 80 columns. */ + vfprintf (stream, _("\ +Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"), + authors); + break; + } + va_end (authors); +} + + +/* Display the --version information the standard way. + + If COMMAND_NAME is NULL, the PACKAGE is asumed to be the name of + the program. The formats are therefore: + + PACKAGE VERSION + + or + + COMMAND_NAME (PACKAGE) VERSION. + + The author names are passed as separate arguments, with an additional + NULL argument at the end. */ +void +version_etc (FILE *stream, + const char *command_name, const char *package, + const char *version, /* const char *author1, ...*/ ...) +{ + va_list authors; + + va_start (authors, version); + version_etc_va (stream, command_name, package, version, authors); +} diff -ruNp m4-1.4.8/lib/version-etc.h m4-1.4.9/lib/version-etc.h --- m4-1.4.8/lib/version-etc.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/version-etc.h 2007-03-23 06:51:02.000000000 -0600 @@ -0,0 +1,37 @@ +/* Utility to help print --version output in a consistent format. + Copyright (C) 1999, 2003, 2005 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Jim Meyering. */ + +#ifndef VERSION_ETC_H +# define VERSION_ETC_H 1 + +# include +# include + +extern const char version_etc_copyright[]; + +extern void version_etc_va (FILE *stream, + const char *command_name, const char *package, + const char *version, va_list authors); + +extern void version_etc (FILE *stream, + const char *command_name, const char *package, + const char *version, + /* const char *author1, ...*/ ...); + +#endif /* VERSION_ETC_H */ diff -ruNp m4-1.4.8/lib/wchar_.h m4-1.4.9/lib/wchar_.h --- m4-1.4.8/lib/wchar_.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/wchar_.h 2007-03-23 06:51:03.000000000 -0600 @@ -0,0 +1,42 @@ +/* A substitute for ISO C99 , for platforms that have issues. + + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Eric Blake. */ + +/* + * ISO C 99 for platforms that have issues. + * + * + * For now, this just ensures proper prerequisite inclusion order. + */ + +#ifndef _GL_WCHAR_H +#define _GL_WCHAR_H + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include + +/* Include the original . */ +#include @ABSOLUTE_WCHAR_H@ + +#endif /* _GL_WCHAR_H */ diff -ruNp m4-1.4.8/lib/wctype_.h m4-1.4.9/lib/wctype_.h --- m4-1.4.8/lib/wctype_.h 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/lib/wctype_.h 2007-03-23 06:51:03.000000000 -0600 @@ -0,0 +1,154 @@ +/* A substitute for ISO C99 , for platforms that lack it. + + Copyright (C) 2006, 2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Bruno Haible and Paul Eggert. */ + +/* + * ISO C 99 for platforms that lack it. + * + * + * iswctype, towctrans, towlower, towupper, wctrans, wctype, + * wctrans_t, and wctype_t are not yet implemented. + */ + +#ifndef _GL_WCTYPE_H +#define _GL_WCTYPE_H + +#if @HAVE_WINT_T@ +/* Solaris 2.5 has a bug: must be included before . + Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +# include +# include +# include +# include +typedef wint_t __wctype_wint_t; +#else +typedef int __wctype_wint_t; +#endif + +/* Include the original if it exists. + BeOS 5 has the functions but no . */ +#if @HAVE_WCTYPE_H@ +# include @ABSOLUTE_WCTYPE_H@ +#endif + +/* FreeBSD 4.4 to 4.11 has but lacks the functions. + Assume all 12 functions are implemented the same way, or not at all. */ +#if ! HAVE_ISWCNTRL + +/* IRIX 5.3 has macros but no functions, its isw* macros refer to an + undefined variable _ctmp_ and to macros like _P, and they + refer to system functions like _iswctype that are not in the + standard C library. Rather than try to get ancient buggy + implementations like this to work, just disable them. */ +# undef iswalnum +# undef iswalpha +# undef iswblank +# undef iswcntrl +# undef iswdigit +# undef iswgraph +# undef iswlower +# undef iswprint +# undef iswpunct +# undef iswspace +# undef iswupper +# undef iswxdigit + +static inline int +iswalnum (__wctype_wint_t wc) +{ + return ((wc >= '0' && wc <= '9') + || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')); +} + +static inline int +iswalpha (__wctype_wint_t wc) +{ + return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'; +} + +static inline int +iswblank (__wctype_wint_t wc) +{ + return wc == ' ' || wc == '\t'; +} + +static inline int +iswcntrl (__wctype_wint_t wc) +{ + return (wc & ~0x1f) == 0 || wc == 0x7f; +} + +static inline int +iswdigit (__wctype_wint_t wc) +{ + return wc >= '0' && wc <= '9'; +} + +static inline int +iswgraph (__wctype_wint_t wc) +{ + return wc >= '!' && wc <= '~'; +} + +static inline int +iswlower (__wctype_wint_t wc) +{ + return wc >= 'a' && wc <= 'z'; +} + +static inline int +iswprint (__wctype_wint_t wc) +{ + return wc >= ' ' && wc <= '~'; +} + +static inline int +iswpunct (__wctype_wint_t wc) +{ + return (wc >= '!' && wc <= '~' + && !((wc >= '0' && wc <= '9') + || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'))); +} + +static inline int +iswspace (__wctype_wint_t wc) +{ + return (wc == ' ' || wc == '\t' + || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r'); +} + +static inline int +iswupper (__wctype_wint_t wc) +{ + return wc >= 'A' && wc <= 'Z'; +} + +static inline int +iswxdigit (__wctype_wint_t wc) +{ + return ((wc >= '0' && wc <= '9') + || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')); +} + +# endif /* ! HAVE_ISWCNTRL */ + +#endif /* _GL_WCTYPE_H */ diff -ruNp m4-1.4.8/lib/wcwidth.h m4-1.4.9/lib/wcwidth.h --- m4-1.4.8/lib/wcwidth.h 2006-11-20 06:57:50.000000000 -0700 +++ m4-1.4.9/lib/wcwidth.h 1969-12-31 17:00:00.000000000 -0700 @@ -1,81 +0,0 @@ -/* Determine the number of screen columns needed for a character. - Copyright (C) 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _gl_WCWIDTH_H -#define _gl_WCWIDTH_H - -#if HAVE_WCHAR_T - -/* Get wcwidth if available, along with wchar_t. */ -# if HAVE_WCHAR_H -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.1 has a bug: and must be included before - . */ -# include -# include -# include -# endif - -/* Get iswprint. */ -# if HAVE_WCTYPE_H -# include -# endif -# if !defined iswprint && !HAVE_ISWPRINT -static inline int -# if HAVE_WINT_T -iswprint (wint_t wc) -# else -iswprint (int wc) -# endif -{ - return (wc >= 0 && wc < 128 - ? wc >= ' ' && wc <= '~' - : 1); -} -# define iswprint iswprint -# endif - -# ifndef HAVE_DECL_WCWIDTH -"this configure-time declaration test was not run" -# endif -# ifndef wcwidth -# if !HAVE_WCWIDTH - -/* wcwidth doesn't exist, so assume all printable characters have - width 1. */ -static inline int -wcwidth (wchar_t wc) -{ - return wc == 0 ? 0 : iswprint (wc) ? 1 : -1; -} - -# elif !HAVE_DECL_WCWIDTH - -/* wcwidth exists but is not declared. */ -extern -# ifdef __cplusplus -"C" -# endif -int wcwidth (int /* actually wchar_t */); - -# endif -# endif - -#endif /* HAVE_WCHAR_H */ - -#endif /* _gl_WCWIDTH_H */ diff -ruNp m4-1.4.8/lib/xalloc.h m4-1.4.9/lib/xalloc.h --- m4-1.4.8/lib/xalloc.h 2006-11-20 07:23:12.000000000 -0700 +++ m4-1.4.9/lib/xalloc.h 2007-03-23 06:51:03.000000000 -0600 @@ -1,7 +1,7 @@ /* xalloc.h -- malloc with out-of-memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc. + 1999, 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -139,10 +139,10 @@ xnrealloc (void *p, size_t n, size_t s) allocating an initial block with a nonzero size, or by allocating a larger block. - In the following implementation, nonzero sizes are doubled so that - repeated reallocations have O(N log N) overall cost rather than - O(N**2) cost, but the specification for this function does not - guarantee that sizes are doubled. + In the following implementation, nonzero sizes are increased by a + factor of approximately 1.5 so that repeated reallocations have + O(N) overall cost rather than O(N**2) cost, but the + specification for this function does not guarantee that rate. Here is an example of use: @@ -204,9 +204,13 @@ x2nrealloc (void *p, size_t *pn, size_t } else { - if (((size_t) -1) / 2 / s < n) + /* Set N = ceil (1.5 * N) so that progress is made if N == 1. + Check for overflow, so that N * S stays in size_t range. + The check is slightly conservative, but an exact check isn't + worth the trouble. */ + if ((size_t) -1 / 3 * 2 / s <= n) xalloc_die (); - n *= 2; + n += (n + 1) / 2; } *pn = n; diff -ruNp m4-1.4.8/lib/xvasprintf.h m4-1.4.9/lib/xvasprintf.h --- m4-1.4.8/lib/xvasprintf.h 2006-09-23 22:28:42.000000000 -0600 +++ m4-1.4.9/lib/xvasprintf.h 2007-03-23 06:51:04.000000000 -0600 @@ -1,5 +1,5 @@ /* vasprintf and asprintf with out-of-memory checking. - Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2002-2004, 2006-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ # endif #endif -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -50,7 +50,7 @@ extern char *xasprintf (const char *form extern char *xvasprintf (const char *format, va_list args) __attribute__ ((__format__ (__printf__, 1, 0))); -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff -ruNp m4-1.4.8/m4/close-stream.m4 m4-1.4.9/m4/close-stream.m4 --- m4-1.4.8/m4/close-stream.m4 2006-11-20 06:57:53.000000000 -0700 +++ m4-1.4.9/m4/close-stream.m4 2007-03-23 07:14:34.000000000 -0600 @@ -1,5 +1,5 @@ -#serial 2 -dnl Copyright (C) 2006 Free Software Foundation, Inc. +#serial 3 +dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,8 +7,6 @@ dnl with or without modifications, as lo AC_DEFUN([gl_CLOSE_STREAM], [ AC_LIBOBJ([close-stream]) - AC_DEFINE([GNULIB_CLOSE_STREAM], [1], - [Define to 1 when using the gnulib close-stream module.]) dnl Prerequisites of lib/close-stream.c. : diff -ruNp m4-1.4.8/m4/eoverflow.m4 m4-1.4.9/m4/eoverflow.m4 --- m4-1.4.8/m4/eoverflow.m4 2006-09-23 22:28:42.000000000 -0600 +++ m4-1.4.9/m4/eoverflow.m4 2007-03-23 07:14:35.000000000 -0600 @@ -1,5 +1,5 @@ -# eoverflow.m4 serial 1 -dnl Copyright (C) 2004 Free Software Foundation, Inc. +# eoverflow.m4 serial 2 +dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -40,7 +40,7 @@ yes if test -n "$have_eoverflow"; then dnl EOVERFLOW exists but is hidden. dnl Define it to the same value. - _AC_COMPUTE_INT([EOVERFLOW], ac_cv_decl_EOVERFLOW, [ + AC_COMPUTE_INT([ac_cv_decl_EOVERFLOW], [EOVERFLOW], [ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ @@ -62,3 +62,9 @@ yes AC_SUBST(EOVERFLOW) fi ]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) diff -ruNp m4-1.4.8/m4/gettimeofday.m4 m4-1.4.9/m4/gettimeofday.m4 --- m4-1.4.8/m4/gettimeofday.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/m4/gettimeofday.m4 2007-03-23 07:14:36.000000000 -0600 @@ -0,0 +1,101 @@ +#serial 11 + +# Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. + +AC_DEFUN([gl_FUNC_GETTIMEOFDAY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_SYS_TIME_H]) + AC_CHECK_FUNCS_ONCE([gettimeofday]) + + AC_CACHE_CHECK([for gettimeofday with POSIX signature], + [gl_cv_func_gettimeofday_posix_signature], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + struct timeval c; + ]], + [[ + int (*f) (struct timeval *restrict, void *restrict) = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + ]])], + [gl_cv_func_gettimeofday_posix_signature=yes], + [gl_cv_func_gettimeofday_posix_signature=no])]) + + gl_FUNC_GETTIMEOFDAY_CLOBBER + + if test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + if test $gl_cv_func_gettimeofday_clobber != yes; then + AC_LIBOBJ(gettimeofday) + gl_PREREQ_GETTIMEOFDAY + fi + fi +]) + + +dnl See if gettimeofday clobbers the static buffer that localtime uses +dnl for its return value. The gettimeofday function from Mac OS X 10.0.4 +dnl (i.e., Darwin 1.3.7) has this problem. +dnl +dnl If it does, then arrange to use gettimeofday and localtime only via +dnl the wrapper functions that work around the problem. + +AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], +[ + AC_REQUIRE([gl_HEADER_SYS_TIME_H]) + + AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], + [gl_cv_func_gettimeofday_clobber], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + #include + ]], + [[ + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + ]])], + [gl_cv_func_gettimeofday_clobber=no], + [gl_cv_func_gettimeofday_clobber=yes], + dnl When crosscompiling, assume it is broken. + [gl_cv_func_gettimeofday_clobber=yes])]) + + if test $gl_cv_func_gettimeofday_clobber = yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + gl_GETTIMEOFDAY_REPLACE_LOCALTIME + AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], 1, + [Define if gettimeofday clobbers the localtime buffer.]) + fi +]) + +AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ + AC_LIBOBJ(gettimeofday) + gl_PREREQ_GETTIMEOFDAY + AC_DEFINE([gmtime], [rpl_gmtime], + [Define to rpl_gmtime if the replacement function should be used.]) + AC_DEFINE([localtime], [rpl_localtime], + [Define to rpl_localtime if the replacement function should be used.]) +]) + +# Prerequisites of lib/gettimeofday.c. +AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [ + AC_CHECK_HEADERS([sys/timeb.h]) + AC_CHECK_FUNCS([_ftime]) +]) diff -ruNp m4-1.4.8/m4/glibc21.m4 m4-1.4.9/m4/glibc21.m4 --- m4-1.4.8/m4/glibc21.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/m4/glibc21.m4 2007-03-23 07:14:36.000000000 -0600 @@ -0,0 +1,30 @@ +# glibc21.m4 serial 3 +dnl Copyright (C) 2000-2002, 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. + +# Test for the GNU C Library, version 2.1 or newer. +# From Bruno Haible. + +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_EGREP_CPP([Lucky GNU user], + [ +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + ], + ac_cv_gnu_library_2_1=yes, + ac_cv_gnu_library_2_1=no) + ] + ) + AC_SUBST(GLIBC21) + GLIBC21="$ac_cv_gnu_library_2_1" + ] +) diff -ruNp m4-1.4.8/m4/gnulib-cache.m4 m4-1.4.9/m4/gnulib-cache.m4 --- m4-1.4.8/m4/gnulib-cache.m4 2006-11-20 06:55:46.000000000 -0700 +++ m4-1.4.9/m4/gnulib-cache.m4 2007-03-23 07:12:38.000000000 -0600 @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2006 Free Software Foundation, Inc. +# Copyright (C) 2004-2007 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -15,11 +15,11 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=M4 avltree-oset binary-io clean-temp cloexec close-stream closeout config-h error fdl fopen-safer free gendocs getopt gnupload mkstemp obstack regex stdbool stdlib-safer strstr strtol unlocked-io verror xalloc xvasprintf +# gnulib-tool --import --dir=. --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=M4 avltree-oset binary-io clean-temp cloexec close-stream closeout config-h error fdl fopen-safer free gendocs getopt gnupload mkstemp obstack regex stdbool stdint stdlib-safer strtol unlocked-io verror version-etc-fsf xalloc xvasprintf # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) -gl_MODULES([avltree-oset binary-io clean-temp cloexec close-stream closeout config-h error fdl fopen-safer free gendocs getopt gnupload mkstemp obstack regex stdbool stdlib-safer strstr strtol unlocked-io verror xalloc xvasprintf]) +gl_MODULES([avltree-oset binary-io clean-temp cloexec close-stream closeout config-h error fdl fopen-safer free gendocs getopt gnupload mkstemp obstack regex stdbool stdint stdlib-safer strtol unlocked-io verror version-etc-fsf xalloc xvasprintf]) gl_AVOID([]) gl_SOURCE_BASE([lib]) gl_M4_BASE([m4]) diff -ruNp m4-1.4.8/m4/gnulib-common.m4 m4-1.4.9/m4/gnulib-common.m4 --- m4-1.4.8/m4/gnulib-common.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/m4/gnulib-common.m4 2007-03-23 07:14:36.000000000 -0600 @@ -0,0 +1,22 @@ +# gnulib-common.m4 serial 2 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# gl_MODULE_INDICATOR([modulename]) +# defines a C macro indicating the presence of the given module. +AC_DEFUN([gl_MODULE_INDICATOR], +[ + AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], + [Define to 1 when using the gnulib module ]$1[.]) +]) + +# AC_PROG_MKDIR_P +# is a backport of autoconf-2.60's AC_PROG_MKDIR_P. +# Remove this macro when we can assume autoconf >= 2.60. +m4_ifdef([AC_PROG_MKDIR_P], [], [ + AC_DEFUN([AC_PROG_MKDIR_P], + [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + MKDIR_P='$(mkdir_p)' + AC_SUBST([MKDIR_P])])]) diff -ruNp m4-1.4.8/m4/gnulib-comp.m4 m4-1.4.9/m4/gnulib-comp.m4 --- m4-1.4.8/m4/gnulib-comp.m4 2006-11-20 07:24:26.000000000 -0700 +++ m4-1.4.9/m4/gnulib-comp.m4 2007-03-23 07:16:07.000000000 -0600 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2004-2006 Free Software Foundation, Inc. +# Copyright (C) 2004-2007 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -27,6 +27,11 @@ AC_DEFUN([M4_EARLY], AC_REQUIRE([AC_PROG_RANLIB]) AC_REQUIRE([AC_GNU_SOURCE]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode + dnl for the builtin va_copy to work. With Autoconf 2.60 or later, + dnl AC_PROG_CC_STDC arranges for this. With older Autoconf AC_PROG_CC_STDC + dnl shouldn't hurt, though installers are on their own to set c99 mode. + AC_REQUIRE([AC_PROG_CC_STDC]) ]) # This macro should be invoked from ./configure.ac, in the section @@ -46,24 +51,26 @@ AC_DEFUN([M4_INIT], AC_DEFINE([SIGNAL_SAFE_LIST], [1], [Define if lists must be signal-safe.]) gl_CLOEXEC gl_CLOSE_STREAM + gl_MODULE_INDICATOR([close-stream]) gl_CLOSEOUT gl_CONFIG_H gl_ERROR gl_EXITFAIL - dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac. gl_FATAL_SIGNAL gl_FOPEN_SAFER + gl_MODULE_INDICATOR([fopen-safer]) gl_FUNC_FPENDING gl_FUNC_FREE gl_GETOPT + gl_FUNC_GETTIMEOFDAY gl_INLINE gl_LIST + gl_LOCALCHARSET AC_FUNC_MALLOC - gl_MBCHAR - gl_MBITER - gl_FUNC_MEMCHR gt_FUNC_MKDTEMP + gl_STDLIB_MODULE_INDICATOR([mkdtemp]) gl_FUNC_MKSTEMP + gl_STDLIB_MODULE_INDICATOR([mkstemp]) AC_FUNC_OBSTACK dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]). gl_LIST @@ -76,19 +83,22 @@ AC_DEFUN([M4_INIT], gl_STDARG_H AM_STDBOOL_H gl_STDINT_H + gl_STDLIB_H gl_STDLIB_SAFER - gl_STRCASE - gl_FUNC_STRSTR gl_FUNC_STRTOL gl_HEADER_SYS_STAT_H + AC_PROG_MKDIR_P + gl_HEADER_SYS_TIME_H + AC_PROG_MKDIR_P gl_FUNC_GEN_TEMPNAME gt_TMPDIR - gl_HEADER_UNISTD + gl_UNISTD_H gl_UNISTD_SAFER gl_FUNC_GLIBC_UNLOCKED_IO gl_FUNC_VASNPRINTF gl_FUNC_VASPRINTF - gl_FUNC_WCWIDTH + gl_WCHAR_H + gl_WCTYPE_H gl_XALLOC gl_XSIZE gl_XVASPRINTF @@ -135,6 +145,7 @@ AC_DEFUN([M4_LIBSOURCES], AC_DEFUN([M4_FILE_LIST], [ build-aux/gendocs.sh build-aux/gnupload + build-aux/link-warning.h doc/fdl.texi doc/gendocs_template lib/__fpending.c @@ -155,10 +166,10 @@ AC_DEFUN([M4_FILE_LIST], [ lib/close-stream.h lib/closeout.c lib/closeout.h + lib/config.charset lib/dup-safer.c lib/error.c lib/error.h - lib/exit.h lib/exitfail.c lib/exitfail.h lib/fatal-signal.c @@ -171,6 +182,7 @@ AC_DEFUN([M4_FILE_LIST], [ lib/getopt_.h lib/getopt_int.h lib/gettext.h + lib/gettimeofday.c lib/gl_anyhash_list1.h lib/gl_anyhash_list2.h lib/gl_anylinked_list1.h @@ -184,16 +196,12 @@ AC_DEFUN([M4_FILE_LIST], [ lib/gl_list.h lib/gl_oset.c lib/gl_oset.h + lib/localcharset.c + lib/localcharset.h lib/malloc.c - lib/mbchar.c - lib/mbchar.h - lib/mbuiter.h - lib/memchr.c lib/mkdtemp.c - lib/mkdtemp.h lib/mkstemp-safer.c lib/mkstemp.c - lib/mkstemp.h lib/obstack.c lib/obstack.h lib/pathmax.h @@ -204,6 +212,8 @@ AC_DEFUN([M4_FILE_LIST], [ lib/printf-parse.h lib/quotearg.c lib/quotearg.h + lib/ref-add.sin + lib/ref-del.sin lib/regcomp.c lib/regex.c lib/regex.h @@ -220,20 +230,16 @@ AC_DEFUN([M4_FILE_LIST], [ lib/stdio-safer.h lib/stdlib--.h lib/stdlib-safer.h - lib/strcase.h - lib/strcasecmp.c - lib/strncasecmp.c - lib/strnlen1.c - lib/strnlen1.h - lib/strstr.c - lib/strstr.h + lib/stdlib_.h lib/strtol.c + lib/sys_time_.h lib/tempname.c lib/tempname.h lib/tmpdir.c lib/tmpdir.h lib/unistd--.h lib/unistd-safer.h + lib/unistd_.h lib/unlocked-io.h lib/vasnprintf.c lib/vasnprintf.h @@ -242,7 +248,11 @@ AC_DEFUN([M4_FILE_LIST], [ lib/verify.h lib/verror.c lib/verror.h - lib/wcwidth.h + lib/version-etc-fsf.c + lib/version-etc.c + lib/version-etc.h + lib/wchar_.h + lib/wctype_.h lib/xalloc-die.c lib/xalloc.h lib/xallocsa.c @@ -269,17 +279,18 @@ AC_DEFUN([M4_FILE_LIST], [ m4/fpending.m4 m4/free.m4 m4/getopt.m4 + m4/gettimeofday.m4 m4/gl_list.m4 + m4/glibc21.m4 + m4/gnulib-common.m4 m4/inline.m4 m4/intmax_t.m4 m4/inttypes_h.m4 + m4/localcharset.m4 m4/longdouble.m4 m4/longlong.m4 - m4/mbchar.m4 - m4/mbiter.m4 m4/mbrtowc.m4 m4/mbstate_t.m4 - m4/memchr.m4 m4/mkdtemp.m4 m4/mkstemp.m4 m4/pathmax.m4 @@ -295,10 +306,10 @@ AC_DEFUN([M4_FILE_LIST], [ m4/stdint_h.m4 m4/stdio-safer.m4 m4/stdlib-safer.m4 - m4/strcase.m4 - m4/strstr.m4 + m4/stdlib_h.m4 m4/strtol.m4 m4/sys_stat_h.m4 + m4/sys_time_h.m4 m4/tempname.m4 m4/tmpdir.m4 m4/ulonglong.m4 @@ -307,8 +318,9 @@ AC_DEFUN([M4_FILE_LIST], [ m4/unlocked-io.m4 m4/vasnprintf.m4 m4/vasprintf.m4 + m4/wchar.m4 m4/wchar_t.m4 - m4/wcwidth.m4 + m4/wctype.m4 m4/wint_t.m4 m4/xalloc.m4 m4/xsize.m4 diff -ruNp m4-1.4.8/m4/localcharset.m4 m4-1.4.9/m4/localcharset.m4 --- m4-1.4.8/m4/localcharset.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/m4/localcharset.m4 2007-03-23 07:14:37.000000000 -0600 @@ -0,0 +1,16 @@ +# localcharset.m4 serial 5 +dnl Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_LOCALCHARSET], +[ + dnl Prerequisites of lib/localcharset.c. + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CHECK_DECLS_ONCE(getc_unlocked) + + dnl Prerequisites of the lib/Makefile.am snippet. + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_GLIBC21]) +]) diff -ruNp m4-1.4.8/m4/mbchar.m4 m4-1.4.9/m4/mbchar.m4 --- m4-1.4.8/m4/mbchar.m4 2006-09-23 22:28:43.000000000 -0600 +++ m4-1.4.9/m4/mbchar.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,23 +0,0 @@ -# mbchar.m4 serial 4 -dnl Copyright (C) 2005-2006 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl autoconf tests required for use of mbchar.m4 -dnl From Bruno Haible. - -AC_DEFUN([gl_MBCHAR], -[ - AC_REQUIRE([AC_GNU_SOURCE]) - dnl The following line is that so the user can test HAVE_WCHAR_H - dnl before #include "mbchar.h". - AC_CHECK_HEADERS_ONCE([wchar.h]) - dnl Compile mbchar.c only if HAVE_WCHAR_H. - if test $ac_cv_header_wchar_h = yes; then - AC_LIBOBJ([mbchar]) - dnl Prerequisites of mbchar.h and mbchar.c. - AC_CHECK_HEADERS_ONCE([wctype.h]) - AC_CHECK_FUNCS([iswcntrl]) - fi -]) diff -ruNp m4-1.4.8/m4/mbiter.m4 m4-1.4.9/m4/mbiter.m4 --- m4-1.4.8/m4/mbiter.m4 2006-09-23 22:28:43.000000000 -0600 +++ m4-1.4.9/m4/mbiter.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,17 +0,0 @@ -# mbiter.m4 serial 2 -dnl Copyright (C) 2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl autoconf tests required for use of mbiter.h -dnl From Bruno Haible. - -AC_DEFUN([gl_MBITER], -[ - AC_REQUIRE([AC_TYPE_MBSTATE_T]) - dnl The following line is that so the user can test HAVE_MBRTOWC before - dnl #include "mbiter.h" or "mbuiter.h". - AC_REQUIRE([gl_FUNC_MBRTOWC]) - : -]) diff -ruNp m4-1.4.8/m4/memchr.m4 m4-1.4.9/m4/memchr.m4 --- m4-1.4.8/m4/memchr.m4 2006-09-23 22:28:44.000000000 -0600 +++ m4-1.4.9/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.8/m4/mkdtemp.m4 m4-1.4.9/m4/mkdtemp.m4 --- m4-1.4.8/m4/mkdtemp.m4 2006-11-20 06:57:31.000000000 -0700 +++ m4-1.4.9/m4/mkdtemp.m4 2007-03-23 07:14:38.000000000 -0600 @@ -1,13 +1,15 @@ -# mkdtemp.m4 serial 4 -dnl Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. +# mkdtemp.m4 serial 5 +dnl Copyright (C) 2001-2003, 2006-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gt_FUNC_MKDTEMP], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REPLACE_FUNCS(mkdtemp) if test $ac_cv_func_mkdtemp = no; then + HAVE_MKDTEMP=0 gl_PREREQ_MKDTEMP fi ]) diff -ruNp m4-1.4.8/m4/mkstemp.m4 m4-1.4.9/m4/mkstemp.m4 --- m4-1.4.8/m4/mkstemp.m4 2006-11-20 07:23:17.000000000 -0700 +++ m4-1.4.9/m4/mkstemp.m4 2007-03-23 07:14:38.000000000 -0600 @@ -1,6 +1,6 @@ -#serial 16 +#serial 17 -# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,6 +13,7 @@ # On systems like the above, arrange to use the replacement function. AC_DEFUN([gl_FUNC_MKSTEMP], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([AC_SYS_LARGEFILE]) AC_CACHE_CHECK([for working mkstemp], @@ -43,8 +44,7 @@ AC_DEFUN([gl_FUNC_MKSTEMP], ]) if test $gl_cv_func_working_mkstemp != yes; then - AC_DEFINE([__MKSTEMP_PREFIX], [[rpl_]], - [Define to rpl_ if the mkstemp replacement function should be used.]) + REPLACE_MKSTEMP=1 AC_LIBOBJ([mkstemp]) gl_PREREQ_MKSTEMP fi diff -ruNp m4-1.4.8/m4/quotearg.m4 m4-1.4.9/m4/quotearg.m4 --- m4-1.4.8/m4/quotearg.m4 2006-11-20 06:57:32.000000000 -0700 +++ m4-1.4.9/m4/quotearg.m4 2007-03-23 07:14:38.000000000 -0600 @@ -1,5 +1,5 @@ -# quotearg.m4 serial 5 -dnl Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. +# quotearg.m4 serial 6 +dnl Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,8 +9,7 @@ AC_DEFUN([gl_QUOTEARG], AC_LIBOBJ([quotearg]) dnl Prerequisites of lib/quotearg.c. - AC_CHECK_HEADERS_ONCE(wchar.h wctype.h) - AC_CHECK_FUNCS_ONCE(iswprint mbsinit) + AC_CHECK_FUNCS_ONCE([mbsinit]) AC_TYPE_MBSTATE_T gl_FUNC_MBRTOWC ]) diff -ruNp m4-1.4.8/m4/regex.m4 m4-1.4.9/m4/regex.m4 --- m4-1.4.8/m4/regex.m4 2006-09-23 22:28:44.000000000 -0600 +++ m4-1.4.9/m4/regex.m4 2007-03-23 07:14:38.000000000 -0600 @@ -1,7 +1,7 @@ -#serial 40 +#serial 46 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006 Free Software Foundation, Inc. +# 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -18,9 +18,12 @@ AC_DEFUN([gl_REGEX], AC_ARG_WITH([included-regex], [AC_HELP_STRING([--without-included-regex], - [don't compile regex; this is the default on + [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)])]) + 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)])]) case $with_included_regex in #( yes|no) ac_use_included_regex=$with_included_regex @@ -29,8 +32,7 @@ AC_DEFUN([gl_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. The first failing regular expression is from `Spencer ere - # test #75' in grep-2.3. + # regex.c. AC_CACHE_CHECK([for working re_compile_pattern], [gl_cv_func_re_compile_pattern_working], [AC_RUN_IFELSE( @@ -74,68 +76,80 @@ AC_DEFUN([gl_REGEX], } #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)); + 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) - exit (1); + return 1; - /* This should succeed, but does not for e.g. glibc-2.1.3. */ - memset (®ex, 0, sizeof (regex)); + /* 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) - exit (1); + return 1; /* The following example is derived from a problem report against gawk from Jorge Stolfi . */ - memset (®ex, 0, sizeof (regex)); + memset (®ex, 0, sizeof regex); s = re_compile_pattern ("[an\371]*n", 7, ®ex); if (s) - exit (1); + return 1; - /* This should match, but does not for e.g. glibc-2.2.1. */ + /* This should match, but does not for glibc-2.2.1. */ if (re_match (®ex, "an", 2, 0, ®s) != 2) - exit (1); + return 1; - memset (®ex, 0, sizeof (regex)); + memset (®ex, 0, sizeof regex); s = re_compile_pattern ("x", 1, ®ex); if (s) - exit (1); + return 1; - /* The version of regex.c in e.g. GNU libc-2.2.93 did not - work with a negative RANGE argument. */ + /* glibc-2.2.93 does not work with a negative RANGE argument. */ if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) - exit (1); + return 1; /* The version of regex.c in older versions of gnulib ignored RE_ICASE. Detect that problem too. */ - memset (®ex, 0, sizeof (regex)); re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); + memset (®ex, 0, sizeof regex); s = re_compile_pattern ("x", 1, ®ex); if (s) - exit (1); + return 1; if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) - exit (1); + return 1; /* REG_STARTEND was added to glibc on 2004-01-15. Reject older versions. */ if (! REG_STARTEND) - exit (1); + 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)) - exit (1); + return 1; - exit (0);]])], + return 0;]])], [gl_cv_func_re_compile_pattern_working=yes], [gl_cv_func_re_compile_pattern_working=no], dnl When crosscompiling, assume it is not working. @@ -192,8 +206,6 @@ AC_DEFUN([gl_PREREQ_REGEX], [ AC_REQUIRE([AC_GNU_SOURCE]) AC_REQUIRE([AC_C_RESTRICT]) - AC_REQUIRE([AM_LANGINFO_CODESET]) - AC_CHECK_HEADERS_ONCE([wchar.h wctype.h]) - AC_CHECK_FUNCS_ONCE([mbrtowc mempcpy wcrtomb wcscoll]) + AC_CHECK_FUNCS_ONCE([iswctype mbrtowc wcrtomb wcscoll]) AC_CHECK_DECLS([isblank], [], [], [#include ]) ]) diff -ruNp m4-1.4.8/m4/size_max.m4 m4-1.4.9/m4/size_max.m4 --- m4-1.4.8/m4/size_max.m4 2006-11-20 06:57:57.000000000 -0700 +++ m4-1.4.9/m4/size_max.m4 2007-03-23 07:14:39.000000000 -0600 @@ -1,4 +1,4 @@ -# size_max.m4 serial 5 +# size_max.m4 serial 6 dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,10 +26,10 @@ Found it 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([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1, + AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], [#include #include ], size_t_bits_minus_1=) - _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, + AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], [#include ], fits_in_uint=) if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then @@ -60,3 +60,9 @@ Found it [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi ]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) diff -ruNp m4-1.4.8/m4/stdint.m4 m4-1.4.9/m4/stdint.m4 --- m4-1.4.8/m4/stdint.m4 2006-11-20 06:57:58.000000000 -0700 +++ m4-1.4.9/m4/stdint.m4 2007-03-23 07:14:39.000000000 -0600 @@ -1,5 +1,5 @@ -# stdint.m4 serial 19 -dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc. +# stdint.m4 serial 22 +dnl Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -27,15 +27,6 @@ AC_DEFUN([gl_STDINT_H], fi AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) - dnl Check for . - AC_CHECK_HEADERS_ONCE([wchar.h]) - if test $ac_cv_header_wchar_h = yes; then - HAVE_WCHAR_H=1 - else - HAVE_WCHAR_H=0 - fi - AC_SUBST([HAVE_WCHAR_H]) - dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. if test $ac_cv_header_inttypes_h = yes; then @@ -75,7 +66,7 @@ AC_DEFUN([gl_STDINT_H], [gl_cv_header_working_stdint_h], [gl_cv_header_working_stdint_h=no AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ + AC_LANG_PROGRAM([[ #include #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ @@ -160,9 +151,9 @@ struct s { /* 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; + (-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; + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; /* Detect bugs in OpenBSD 3.9 stdint.h. */ #ifdef UINT8_MAX @@ -189,11 +180,12 @@ struct s { int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; - ]])], + ]])], [gl_cv_header_working_stdint_h=yes])]) fi - if test "$gl_cv_header_working_stdint_h" != yes; then - + if test "$gl_cv_header_working_stdint_h" = yes; then + STDINT_H= + else dnl Check for , and for dnl (used in Linux libc4 >= 4.6.7 and libc5). AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) @@ -229,8 +221,8 @@ AC_DEFUN([gl_STDINT_BITSIZEOF], [Define to the number of bits in type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], - [_AC_COMPUTE_INT([sizeof ($gltype) * CHAR_BIT], result, - [$2 + [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], + [$2 #include ], [result=unknown]) eval gl_cv_bitsizeof_${gltype}=\$result ]) @@ -298,35 +290,35 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], AC_FOREACH([gltype], [$1], [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], [Define to l, ll, u, ul, ull, etc., as suitable for - constants of type ']gltype['.])]) + constants of type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for $gltype integer literal suffix], [gl_cv_type_${gltype}_suffix], [eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed if test "$result" = yes; then - glsufu= + glsufu= else - glsufu=u + glsufu=u fi for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do - case $glsuf in - '') gltype1='int';; - l) gltype1='long int';; - ll) gltype1='long long int';; - i64) gltype1='__int64';; - u) gltype1='unsigned int';; - ul) gltype1='unsigned long int';; - ull) gltype1='unsigned long long int';; - ui64)gltype1='unsigned __int64';; - esac - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([$2 - extern $gltype foo; - extern $gltype1 foo;])], - [eval gl_cv_type_${gltype}_suffix=\$glsuf]) - eval result=\$gl_cv_type_${gltype}_suffix - test "$result" != no && break + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([$2 + extern $gltype foo; + extern $gltype1 foo;])], + [eval gl_cv_type_${gltype}_suffix=\$glsuf]) + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break done]) GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix @@ -341,15 +333,13 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], dnl gl_STDINT_INCLUDES AC_DEFUN([gl_STDINT_INCLUDES], [[ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include #include - #if HAVE_WCHAR_H - /* BSD/OS 4.1 has a bug: and must be included before - . */ - # include - # include - # include - #endif + #include + #include + #include ]]) dnl gl_STDINT_TYPE_PROPERTIES @@ -366,3 +356,14 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], [gl_STDINT_INCLUDES]) ]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) + +# Hey Emacs! +# Local Variables: +# indent-tabs-mode: nil +# End: diff -ruNp m4-1.4.8/m4/stdio-safer.m4 m4-1.4.9/m4/stdio-safer.m4 --- m4-1.4.8/m4/stdio-safer.m4 2006-11-20 06:57:58.000000000 -0700 +++ m4-1.4.9/m4/stdio-safer.m4 2007-03-23 07:14:39.000000000 -0600 @@ -1,5 +1,5 @@ -#serial 9 -dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. +#serial 10 +dnl Copyright (C) 2002, 2005-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,8 +7,6 @@ dnl with or without modifications, as lo AC_DEFUN([gl_FOPEN_SAFER], [ AC_LIBOBJ([fopen-safer]) - AC_DEFINE([GNULIB_FOPEN_SAFER], [1], - [Define to 1 when using the gnulib fopen-safer module.]) ]) AC_DEFUN([gl_TMPFILE_SAFER], diff -ruNp m4-1.4.8/m4/stdlib_h.m4 m4-1.4.9/m4/stdlib_h.m4 --- m4-1.4.8/m4/stdlib_h.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/m4/stdlib_h.m4 2007-03-23 07:14:40.000000000 -0600 @@ -0,0 +1,31 @@ +# stdlib_h.m4 serial 1 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STDLIB_H], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + gl_ABSOLUTE_HEADER([stdlib.h]) + ABSOLUTE_STDLIB_H=\"$gl_cv_absolute_stdlib_h\" + AC_SUBST([ABSOLUTE_STDLIB_H]) +]) + +AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_STDLIB_H_DEFAULTS], +[ + GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) + GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) + GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) + HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) + REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) +]) diff -ruNp m4-1.4.8/m4/strcase.m4 m4-1.4.9/m4/strcase.m4 --- m4-1.4.8/m4/strcase.m4 2006-11-20 07:23:19.000000000 -0700 +++ m4-1.4.9/m4/strcase.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,39 +0,0 @@ -# strcase.m4 serial 4 -dnl Copyright (C) 2002, 2005-2006 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_STRCASE], -[ - gl_FUNC_STRCASECMP - gl_FUNC_STRNCASECMP -]) - -AC_DEFUN([gl_FUNC_STRCASECMP], -[ - dnl No known system has a strcasecmp() function that works correctly in - dnl multibyte locales. Therefore we use our version always. - AC_LIBOBJ(strcasecmp) - gl_PREREQ_STRCASECMP -]) - -AC_DEFUN([gl_FUNC_STRNCASECMP], -[ - AC_REPLACE_FUNCS(strncasecmp) - AC_CHECK_DECLS(strncasecmp) - if test $ac_cv_func_strncasecmp = no; then - gl_PREREQ_STRNCASECMP - fi -]) - -# Prerequisites of lib/strcasecmp.c. -AC_DEFUN([gl_PREREQ_STRCASECMP], [ - AC_REQUIRE([gl_FUNC_MBRTOWC]) - : -]) - -# Prerequisites of lib/strncasecmp.c. -AC_DEFUN([gl_PREREQ_STRNCASECMP], [ - : -]) diff -ruNp m4-1.4.8/m4/strstr.m4 m4-1.4.9/m4/strstr.m4 --- m4-1.4.8/m4/strstr.m4 2006-11-20 06:57:32.000000000 -0700 +++ m4-1.4.9/m4/strstr.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,19 +0,0 @@ -# strstr.m4 serial 5 -dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_FUNC_STRSTR], -[ - dnl No known system has a strstr() function that works correctly in - dnl multibyte locales. Therefore we use our version always. - AC_LIBOBJ(strstr) - gl_PREREQ_STRSTR -]) - -# Prerequisites of lib/strstr.c. -AC_DEFUN([gl_PREREQ_STRSTR], [ - AC_REQUIRE([gl_FUNC_MBRTOWC]) - : -]) diff -ruNp m4-1.4.8/m4/sys_time_h.m4 m4-1.4.9/m4/sys_time_h.m4 --- m4-1.4.8/m4/sys_time_h.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/m4/sys_time_h.m4 2007-03-23 07:14:40.000000000 -0600 @@ -0,0 +1,61 @@ +# Configure a replacement for . + +# Copyright (C) 2007 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Paul Eggert and Martin Lambers. + +AC_DEFUN([gl_HEADER_SYS_TIME_H], +[ + dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement + dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1 + dnl statements that occur in other macros. + AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + + if test $ac_cv_header_sys_time_h = yes; then + gl_ABSOLUTE_HEADER([sys/time.h]) + ABSOLUTE_SYS_TIME_H=\"$gl_cv_absolute_sys_time_h\" + HAVE_SYS_TIME_H=1 + else + ABSOLUTE_SYS_TIME_H=\"no/such/file/sys/time.h\" + HAVE_SYS_TIME_H=0 + fi + AC_SUBST([ABSOLUTE_SYS_TIME_H]) + AC_SUBST([HAVE_SYS_TIME_H]) + + AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#if HAVE_SYS_TIME_H + #include + #endif + #include + ]], + [[static struct timeval x; x.tv_sec = x.tv_usec;]])], + [gl_cv_sys_struct_timeval=yes], + [gl_cv_sys_struct_timeval=no])]) + if test $gl_cv_sys_struct_timeval = yes; then + HAVE_STRUCT_TIMEVAL=1 + else + HAVE_STRUCT_TIMEVAL=0 + fi + AC_SUBST([HAVE_STRUCT_TIMEVAL]) + + dnl Assume POSIX behavior unless another module says otherwise. + REPLACE_GETTIMEOFDAY=0 + AC_SUBST([REPLACE_GETTIMEOFDAY]) + if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then + SYS_TIME_H=sys/time.h + else + SYS_TIME_H= + fi + AC_SUBST([SYS_TIME_H]) +]) diff -ruNp m4-1.4.8/m4/tempname.m4 m4-1.4.9/m4/tempname.m4 --- m4-1.4.8/m4/tempname.m4 2006-11-20 07:23:20.000000000 -0700 +++ m4-1.4.9/m4/tempname.m4 2007-03-23 07:14:40.000000000 -0600 @@ -1,6 +1,6 @@ -#serial 2 +#serial 3 -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006-2007 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -18,6 +18,5 @@ AC_DEFUN([gl_FUNC_GEN_TEMPNAME], # Prerequisites of lib/tempname.c. AC_DEFUN([gl_PREREQ_TEMPNAME], [ - AC_CHECK_HEADERS_ONCE([sys/time.h]) - AC_CHECK_FUNCS_ONCE([gettimeofday]) + : ]) diff -ruNp m4-1.4.8/m4/unistd_h.m4 m4-1.4.9/m4/unistd_h.m4 --- m4-1.4.8/m4/unistd_h.m4 2006-09-23 22:28:45.000000000 -0600 +++ m4-1.4.9/m4/unistd_h.m4 2007-03-23 07:14:41.000000000 -0600 @@ -1,18 +1,51 @@ -# unistd_h.m4 serial 2 -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# unistd_h.m4 serial 5 +dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -dnl Written by Simon Josefsson +dnl Written by Simon Josefsson, Bruno Haible. -AC_DEFUN([gl_HEADER_UNISTD], +AC_DEFUN([gl_UNISTD_H], [ - dnl Prerequisites of lib/unistd.h. - AC_CHECK_HEADERS([unistd.h], [ - UNISTD_H='' - ], [ - UNISTD_H='unistd.h' - ]) - AC_SUBST(UNISTD_H) + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + gl_ABSOLUTE_HEADER([unistd.h]) + ABSOLUTE_UNISTD_H=\"$gl_cv_absolute_unistd_h\" + else + HAVE_UNISTD_H=0 + fi + AC_SUBST([HAVE_UNISTD_H]) + AC_SUBST([ABSOLUTE_UNISTD_H]) +]) + +AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_UNISTD_H_DEFAULTS], +[ + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) + HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) + REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) + REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) + REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) ]) diff -ruNp m4-1.4.8/m4/vasnprintf.m4 m4-1.4.9/m4/vasnprintf.m4 --- m4-1.4.8/m4/vasnprintf.m4 2006-11-20 06:58:00.000000000 -0700 +++ m4-1.4.9/m4/vasnprintf.m4 2007-03-23 07:14:41.000000000 -0600 @@ -1,5 +1,5 @@ -# vasnprintf.m4 serial 7 -dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc. +# vasnprintf.m4 serial 9 +dnl Copyright (C) 2002-2004, 2006-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,18 +7,29 @@ dnl with or without modifications, as lo AC_DEFUN([gl_FUNC_VASNPRINTF], [ AC_REQUIRE([gl_EOVERFLOW]) - AC_REPLACE_FUNCS(vasnprintf) + AC_CHECK_FUNCS_ONCE([vasnprintf]) if test $ac_cv_func_vasnprintf = no; then - AC_LIBOBJ(printf-args) - AC_LIBOBJ(printf-parse) - AC_LIBOBJ(asnprintf) - gl_PREREQ_PRINTF_ARGS - gl_PREREQ_PRINTF_PARSE - gl_PREREQ_VASNPRINTF - gl_PREREQ_ASNPRINTF + gl_REPLACE_VASNPRINTF fi ]) +AC_DEFUN([gl_REPLACE_VASNPRINTF], +[ + AC_CHECK_FUNCS_ONCE([vasnprintf]) + AC_LIBOBJ([vasnprintf]) + AC_LIBOBJ([printf-args]) + AC_LIBOBJ([printf-parse]) + AC_LIBOBJ([asnprintf]) + if test $ac_cv_func_vasnprintf = yes; then + AC_DEFINE([REPLACE_VASNPRINTF], 1, + [Define if vasnprintf exists but is overridden by gnulib.]) + fi + gl_PREREQ_PRINTF_ARGS + gl_PREREQ_PRINTF_PARSE + gl_PREREQ_VASNPRINTF + gl_PREREQ_ASNPRINTF +]) + # Prequisites of lib/printf-args.h, lib/printf-args.c. AC_DEFUN([gl_PREREQ_PRINTF_ARGS], [ diff -ruNp m4-1.4.8/m4/vasprintf.m4 m4-1.4.9/m4/vasprintf.m4 --- m4-1.4.8/m4/vasprintf.m4 2006-09-23 22:28:46.000000000 -0600 +++ m4-1.4.9/m4/vasprintf.m4 2007-03-23 07:14:42.000000000 -0600 @@ -1,20 +1,30 @@ -# vasprintf.m4 serial 2 -dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. +# vasprintf.m4 serial 3 +dnl Copyright (C) 2002-2003, 2006-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_VASPRINTF], [ - AC_REPLACE_FUNCS(vasprintf) + AC_CHECK_FUNCS([vasprintf]) if test $ac_cv_func_vasprintf = no; then - AC_LIBOBJ(asprintf) - gl_PREREQ_VASPRINTF_H - gl_PREREQ_VASPRINTF - gl_PREREQ_ASPRINTF + gl_REPLACE_VASPRINTF fi ]) +AC_DEFUN([gl_REPLACE_VASPRINTF], +[ + AC_LIBOBJ([vasprintf]) + AC_LIBOBJ([asprintf]) + if test $ac_cv_func_vasprintf = yes; then + AC_DEFINE([REPLACE_VASPRINTF], 1, + [Define if vasprintf exists but is overridden by gnulib.]) + fi + gl_PREREQ_VASPRINTF_H + gl_PREREQ_VASPRINTF + gl_PREREQ_ASPRINTF +]) + # Prerequisites of lib/vasprintf.h. AC_DEFUN([gl_PREREQ_VASPRINTF_H], [ diff -ruNp m4-1.4.8/m4/wchar.m4 m4-1.4.9/m4/wchar.m4 --- m4-1.4.8/m4/wchar.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/m4/wchar.m4 2007-03-23 07:14:42.000000000 -0600 @@ -0,0 +1,29 @@ +dnl A placeholder for ISO C99 , for platforms that have issues. + +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Eric Blake. + +# wchar.m4 serial 1 + +AC_DEFUN([gl_WCHAR_H], +[ + AC_CACHE_CHECK([whether is standalone], + [gl_cv_header_wchar_h_standalone], + [AC_COMPILE_IFELSE([[#include +wchar_t w;]], + [gl_cv_header_wchar_h_standalone=yes], + [gl_cv_header_wchar_h_standalone=no])]) + if test $gl_cv_header_wchar_h_standalone = yes; then + WCHAR_H= + else + gl_ABSOLUTE_HEADER([wchar.h]) + ABSOLUTE_WCHAR_H=\"$gl_cv_absolute_wchar_h\" + WCHAR_H=wchar.h + fi + AC_SUBST([ABSOLUTE_WCHAR_H]) + AC_SUBST([WCHAR_H]) +]) diff -ruNp m4-1.4.8/m4/wctype.m4 m4-1.4.9/m4/wctype.m4 --- m4-1.4.8/m4/wctype.m4 1969-12-31 17:00:00.000000000 -0700 +++ m4-1.4.9/m4/wctype.m4 2007-03-23 07:14:43.000000000 -0600 @@ -0,0 +1,41 @@ +dnl A placeholder for ISO C99 , for platforms that lack it. + +dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_WCTYPE_H], +[ + AC_CHECK_FUNCS_ONCE([iswcntrl]) + AC_CHECK_HEADERS_ONCE([wctype.h]) + AC_REQUIRE([AC_C_INLINE]) + + AC_REQUIRE([gt_TYPE_WINT_T]) + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + AC_SUBST([HAVE_WINT_T]) + + WCTYPE_H=wctype.h + if test $ac_cv_header_wctype_h = yes; then + if test "$ac_cv_func_iswcntrl" = yes; then + WCTYPE_H= + fi + dnl Compute ABSOLUTE_WCTYPE_H even if WCTYPE_H is empty, + dnl for the benefit of builds from non-distclean directories. + gl_ABSOLUTE_HEADER([wctype.h]) + ABSOLUTE_WCTYPE_H=\"$gl_cv_absolute_wctype_h\" + HAVE_WCTYPE_H=1 + else + ABSOLUTE_WCTYPE_H=\"no/such/file/wctype.h\" + HAVE_WCTYPE_H=0 + fi + AC_SUBST([ABSOLUTE_WCTYPE_H]) + AC_SUBST([HAVE_WCTYPE_H]) + AC_SUBST([WCTYPE_H]) +]) diff -ruNp m4-1.4.8/m4/wcwidth.m4 m4-1.4.9/m4/wcwidth.m4 --- m4-1.4.8/m4/wcwidth.m4 2006-11-20 06:58:00.000000000 -0700 +++ m4-1.4.9/m4/wcwidth.m4 1969-12-31 17:00:00.000000000 -0700 @@ -1,31 +0,0 @@ -# wcwidth.m4 serial 6 -dnl Copyright (C) 2006 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_FUNC_WCWIDTH], -[ - dnl Persuade glibc to declare wcwidth(). - AC_REQUIRE([AC_GNU_SOURCE]) - - AC_REQUIRE([AC_C_INLINE]) - AC_REQUIRE([gt_TYPE_WCHAR_T]) - AC_REQUIRE([gt_TYPE_WINT_T]) - - AC_CHECK_HEADERS_ONCE([wchar.h wctype.h]) - AC_CHECK_FUNCS_ONCE([iswprint wcwidth]) - - AC_CHECK_DECLS([wcwidth], [], [], [ -/* AIX 3.2.5 declares wcwidth in . */ -#include -#if HAVE_WCHAR_H -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.1 has a bug: and must be included before - . */ -# include -# include -# include -#endif -])]) diff -ruNp m4-1.4.8/m4/wint_t.m4 m4-1.4.9/m4/wint_t.m4 --- m4-1.4.8/m4/wint_t.m4 2006-09-23 22:28:46.000000000 -0600 +++ m4-1.4.9/m4/wint_t.m4 2007-03-23 07:14:43.000000000 -0600 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 1 (gettext-0.12) -dnl Copyright (C) 2003 Free Software Foundation, Inc. +# wint_t.m4 serial 2 (gettext-0.12) +dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,7 +11,15 @@ dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, - [AC_TRY_COMPILE([#include + [AC_TRY_COMPILE([ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then diff -ruNp m4-1.4.8/src/Makefile.in m4-1.4.9/src/Makefile.in --- m4-1.4.8/src/Makefile.in 2006-11-20 07:25:49.000000000 -0700 +++ m4-1.4.9/src/Makefile.in 2007-03-23 07:32:35.000000000 -0600 @@ -46,12 +46,13 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gl_list.m4 $(top_srcdir)/m4/gnulib-comp.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/longdouble.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.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 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ @@ -60,17 +61,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/a $(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/stdlib-safer.m4 $(top_srcdir)/m4/strcase.m4 \ - $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/tempname.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.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/tmpdir.m4 $(top_srcdir)/m4/ulonglong.m4 \ $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ - $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ - $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \ - $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac + $(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/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 @@ -102,7 +103,12 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ +ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ +ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ +ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ +ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ +ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ @@ -131,18 +137,39 @@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ +GLIBC21 = @GLIBC21@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_READLINK = @GNULIB_READLINK@ GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_READLINK = @HAVE_READLINK@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -169,6 +196,11 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ @@ -177,9 +209,11 @@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYS_STAT_H = @SYS_STAT_H@ -UNISTD_H = @UNISTD_H@ +SYS_TIME_H = @SYS_TIME_H@ VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ diff -ruNp m4-1.4.8/src/builtin.c m4-1.4.9/src/builtin.c --- m4-1.4.8/src/builtin.c 2006-11-20 06:55:47.000000000 -0700 +++ m4-1.4.9/src/builtin.c 2007-02-28 06:48:19.000000000 -0700 @@ -1,6 +1,6 @@ /* GNU m4 -- A simple macro processor - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2000, 2004, 2006 + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2000, 2004, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -27,7 +27,6 @@ extern FILE *popen (); #include "regex.h" -#include "strstr.h" #if HAVE_SYS_WAIT_H # include @@ -222,6 +221,68 @@ define_builtin (const char *name, const SYMBOL_FUNC (sym) = bp->func; } +/* Storage for the compiled regular expression of + --warn-macro-sequence. */ +static struct re_pattern_buffer macro_sequence_buf; + +/* Storage for the matches of --warn-macro-sequence. */ +static struct re_registers macro_sequence_regs; + +/* True if --warn-macro-sequence is in effect. */ +static bool macro_sequence_inuse; + +/*----------------------------------------. +| Clean up regular expression variables. | +`----------------------------------------*/ + +static void +free_pattern_buffer (struct re_pattern_buffer *buf, struct re_registers *regs) +{ + regfree (buf); + free (regs->start); + free (regs->end); +} + +/*-----------------------------------------------------------------. +| Set the regular expression of --warn-macro-sequence that will be | +| checked during define and pushdef. Exit on failure. | +`-----------------------------------------------------------------*/ +void +set_macro_sequence (const char *regexp) +{ + const char *msg; + + if (! regexp) + regexp = DEFAULT_MACRO_SEQUENCE; + else if (regexp[0] == '\0') + { + macro_sequence_inuse = false; + return; + } + + msg = re_compile_pattern (regexp, strlen (regexp), ¯o_sequence_buf); + if (msg != NULL) + { + M4ERROR ((EXIT_FAILURE, 0, + "--warn-macro-sequence: bad regular expression `%s': %s", + regexp, msg)); + } + re_set_registers (¯o_sequence_buf, ¯o_sequence_regs, + macro_sequence_regs.num_regs, + macro_sequence_regs.start, macro_sequence_regs.end); + macro_sequence_inuse = true; +} + +/*------------------------------------------------------------. +| Free dynamic memory utilized by the define sequence regular | +| expression. | +`------------------------------------------------------------*/ +void +free_macro_sequence (void) +{ + free_pattern_buffer (¯o_sequence_buf, ¯o_sequence_regs); +} + /*-------------------------------------------------------------------------. | Define a predefined or user-defined macro, with name NAME, and expansion | | TEXT. MODE destinguishes between the "define" and the "pushdef" case. | @@ -232,13 +293,44 @@ void define_user_macro (const char *name, const char *text, symbol_lookup mode) { symbol *s; + char *defn = xstrdup (text ? text : ""); s = lookup_symbol (name, mode); if (SYMBOL_TYPE (s) == TOKEN_TEXT) free (SYMBOL_TEXT (s)); SYMBOL_TYPE (s) = TOKEN_TEXT; - SYMBOL_TEXT (s) = xstrdup (text ? text : ""); + SYMBOL_TEXT (s) = defn; + + /* Implement --warn-macro-sequence. */ + if (macro_sequence_inuse && text) + { + regoff_t offset = 0; + size_t len = strlen (defn); + + while ((offset = re_search (¯o_sequence_buf, defn, len, offset, + len - offset, ¯o_sequence_regs)) >= 0) + { + /* Skip empty matches. */ + if (macro_sequence_regs.start[0] == macro_sequence_regs.end[0]) + offset++; + else + { + char tmp; + offset = macro_sequence_regs.end[0]; + tmp = defn[offset]; + defn[offset] = '\0'; + M4ERROR ((warning_status, 0, + "Warning: definition of `%s' contains sequence `%s'", + name, defn + macro_sequence_regs.start[0])); + defn[offset] = tmp; + } + } + if (offset == -2) + M4ERROR ((warning_status, 0, + "error checking --warn-macro-sequence for macro `%s'", + name)); + } } /*-----------------------------------------------. @@ -359,10 +451,10 @@ numeric_arg (token_data *macro, const ch static char const digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; static const char * -ntoa (eval_t value, int radix) +ntoa (int32_t value, int radix) { bool negative; - unsigned_eval_t uvalue; + uint32_t uvalue; static char str[256]; char *s = &str[sizeof str]; @@ -371,12 +463,12 @@ ntoa (eval_t value, int radix) if (value < 0) { negative = true; - uvalue = (unsigned_eval_t) -value; + uvalue = -(uint32_t) value; } else { negative = false; - uvalue = (unsigned_eval_t) value; + uvalue = (uint32_t) value; } do @@ -401,7 +493,7 @@ shipout_int (struct obstack *obs, int va { const char *s; - s = ntoa ((eval_t) val, 10); + s = ntoa ((int32_t) val, 10); obstack_grow (obs, s, strlen (s)); } @@ -940,7 +1032,7 @@ m4_sysval (struct obstack *obs, int argc static void m4_eval (struct obstack *obs, int argc, token_data **argv) { - eval_t value = 0; + int32_t value = 0; int radix = 10; int min = 1; const char *s; @@ -954,8 +1046,8 @@ m4_eval (struct obstack *obs, int argc, if (radix < 1 || radix > (int) strlen (digits)) { M4ERROR ((warning_status, 0, - "radix in builtin `%s' out of range (radix = %d)", - ARG (0), radix)); + "radix %d in builtin `%s' out of range", + radix, ARG (0))); return; } @@ -1209,8 +1301,10 @@ include (int argc, token_data **argv, bo if (fp == NULL) { if (!silent) - M4ERROR ((warning_status, errno, - "cannot open `%s'", ARG (1))); + { + M4ERROR ((warning_status, errno, "cannot open `%s'", ARG (1))); + retcode = EXIT_FAILURE; + } return; } @@ -1304,7 +1398,7 @@ m4_maketemp (struct obstack *obs, int ar if (str[i - 1] != 'X') break; obstack_grow (obs, str, i); - str = ntoa ((eval_t) getpid (), 10); + str = ntoa ((int32_t) getpid (), 10); len2 = strlen (str); if (len2 > len - i) obstack_grow0 (obs, str + len2 - (len - i), len - i); @@ -1827,27 +1921,18 @@ Warning: trailing \\ ignored in replacem | Initialize regular expression variables. | `------------------------------------------*/ -static void +void init_pattern_buffer (struct re_pattern_buffer *buf, struct re_registers *regs) { buf->translate = NULL; buf->fastmap = NULL; buf->buffer = NULL; buf->allocated = 0; - regs->start = NULL; - regs->end = NULL; -} - -/*----------------------------------------. -| Clean up regular expression variables. | -`----------------------------------------*/ - -static void -free_pattern_buffer (struct re_pattern_buffer *buf, struct re_registers *regs) -{ - regfree (buf); - free (regs->start); - free (regs->end); + if (regs) + { + regs->start = NULL; + regs->end = NULL; + } } /*--------------------------------------------------------------------------. diff -ruNp m4-1.4.8/src/eval.c m4-1.4.9/src/eval.c --- m4-1.4.8/src/eval.c 2006-11-20 06:55:47.000000000 -0700 +++ m4-1.4.9/src/eval.c 2007-01-09 09:12:43.000000000 -0700 @@ -1,6 +1,6 @@ /* GNU m4 -- A simple macro processor - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2006 + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -22,8 +22,7 @@ /* This file contains the functions to evaluate integer expressions for the "eval" macro. It is a little, fairly self-contained module, with its own scanner, and a recursive descent parser. The only entry point - is evaluate (). For POSIX semantics of the "eval" macro, the type - eval_t must be a 32-bit signed integer. */ + is evaluate (). */ #include "m4.h" @@ -31,11 +30,11 @@ typedef enum eval_token { - ERROR, + ERROR, BADOP, PLUS, MINUS, EXPONENT, TIMES, DIVIDE, MODULO, - EQ, NOTEQ, GT, GTEQ, LS, LSEQ, + ASSIGN, EQ, NOTEQ, GT, GTEQ, LS, LSEQ, LSHIFT, RSHIFT, LNOT, LAND, LOR, NOT, AND, OR, XOR, @@ -49,29 +48,33 @@ eval_token; typedef enum eval_error { NO_ERROR, - MISSING_RIGHT, + DIVIDE_ZERO, + MODULO_ZERO, + NEGATIVE_EXPONENT, + /* All errors prior to SYNTAX_ERROR can be ignored in a dead + branch of && and ||. All errors after are just more details + about a syntax error. */ SYNTAX_ERROR, + MISSING_RIGHT, UNKNOWN_INPUT, EXCESS_INPUT, - DIVIDE_ZERO, - MODULO_ZERO + INVALID_OPERATOR } eval_error; -static eval_error logical_or_term (eval_token, eval_t *); -static eval_error logical_and_term (eval_token, eval_t *); -static eval_error or_term (eval_token, eval_t *); -static eval_error xor_term (eval_token, eval_t *); -static eval_error and_term (eval_token, eval_t *); -static eval_error not_term (eval_token, eval_t *); -static eval_error logical_not_term (eval_token, eval_t *); -static eval_error cmp_term (eval_token, eval_t *); -static eval_error shift_term (eval_token, eval_t *); -static eval_error add_term (eval_token, eval_t *); -static eval_error mult_term (eval_token, eval_t *); -static eval_error exp_term (eval_token, eval_t *); -static eval_error unary_term (eval_token, eval_t *); -static eval_error simple_term (eval_token, eval_t *); +static eval_error logical_or_term (eval_token, int32_t *); +static eval_error logical_and_term (eval_token, int32_t *); +static eval_error or_term (eval_token, int32_t *); +static eval_error xor_term (eval_token, int32_t *); +static eval_error and_term (eval_token, int32_t *); +static eval_error equality_term (eval_token, int32_t *); +static eval_error cmp_term (eval_token, int32_t *); +static eval_error shift_term (eval_token, int32_t *); +static eval_error add_term (eval_token, int32_t *); +static eval_error mult_term (eval_token, int32_t *); +static eval_error exp_term (eval_token, int32_t *); +static eval_error unary_term (eval_token, int32_t *); +static eval_error simple_term (eval_token, int32_t *); /*--------------------. | Lexical functions. | @@ -100,7 +103,7 @@ eval_undo (void) /* VAL is numerical value, if any. */ static eval_token -eval_lex (eval_t *val) +eval_lex (int32_t *val) { while (isspace (to_uchar (*eval_text))) eval_text++; @@ -149,7 +152,8 @@ eval_lex (eval_t *val) else base = 10; - (*val) = 0; + /* FIXME - this calculation can overflow. Consider xstrtol. */ + *val = 0; for (; *eval_text; eval_text++) { if (isdigit (to_uchar (*eval_text))) @@ -173,7 +177,7 @@ eval_lex (eval_t *val) else if (digit >= base) break; else - (*val) = (*val) * base + digit; + *val = *val * base + digit; } return NUMBER; } @@ -181,8 +185,12 @@ eval_lex (eval_t *val) switch (*eval_text++) { case '+': + if (*eval_text == '+' || *eval_text == '=') + return BADOP; return PLUS; case '-': + if (*eval_text == '-' || *eval_text == '=') + return BADOP; return MINUS; case '*': if (*eval_text == '*') @@ -190,24 +198,31 @@ eval_lex (eval_t *val) eval_text++; return EXPONENT; } - else - return TIMES; + else if (*eval_text == '=') + return BADOP; + return TIMES; case '/': + if (*eval_text == '=') + return BADOP; return DIVIDE; case '%': + if (*eval_text == '=') + return BADOP; return MODULO; case '=': if (*eval_text == '=') - eval_text++; - return EQ; + { + eval_text++; + return EQ; + } + return ASSIGN; case '!': if (*eval_text == '=') { eval_text++; return NOTEQ; } - else - return LNOT; + return LNOT; case '>': if (*eval_text == '=') { @@ -216,11 +231,11 @@ eval_lex (eval_t *val) } else if (*eval_text == '>') { - eval_text++; + if (*++eval_text == '=') + return BADOP; return RSHIFT; } - else - return GT; + return GT; case '<': if (*eval_text == '=') { @@ -229,12 +244,14 @@ eval_lex (eval_t *val) } else if (*eval_text == '<') { - eval_text++; + if (*++eval_text == '=') + return BADOP; return LSHIFT; } - else - return LS; + return LS; case '^': + if (*eval_text == '=') + return BADOP; return XOR; case '~': return NOT; @@ -244,16 +261,18 @@ eval_lex (eval_t *val) eval_text++; return LAND; } - else - return AND; + else if (*eval_text == '=') + return BADOP; + return AND; case '|': if (*eval_text == '|') { eval_text++; return LOR; } - else - return OR; + else if (*eval_text == '=') + return BADOP; + return OR; case '(': return LEFTP; case ')': @@ -268,7 +287,7 @@ eval_lex (eval_t *val) `---------------------------------------*/ bool -evaluate (const char *expr, eval_t *val) +evaluate (const char *expr, int32_t *val) { eval_token et; eval_error err; @@ -278,7 +297,12 @@ evaluate (const char *expr, eval_t *val) err = logical_or_term (et, val); if (err == NO_ERROR && *eval_text != '\0') - err = EXCESS_INPUT; + { + if (eval_lex (val) == BADOP) + err = INVALID_OPERATOR; + else + err = EXCESS_INPUT; + } switch (err) { @@ -306,6 +330,12 @@ evaluate (const char *expr, eval_t *val) "bad expression in eval (excess input): %s", expr)); break; + case INVALID_OPERATOR: + M4ERROR ((warning_status, 0, + "invalid operator in eval: %s", expr)); + retcode = EXIT_FAILURE; + break; + case DIVIDE_ZERO: M4ERROR ((warning_status, 0, "divide by zero in eval: %s", expr)); @@ -316,6 +346,11 @@ evaluate (const char *expr, eval_t *val) "modulo by zero in eval: %s", expr)); break; + case NEGATIVE_EXPONENT: + M4ERROR ((warning_status, 0, + "negative exponent in eval: %s", expr)); + break; + default: M4ERROR ((warning_status, 0, "INTERNAL ERROR: bad error code in evaluate ()")); @@ -330,9 +365,9 @@ evaluate (const char *expr, eval_t *val) `---------------------------*/ static eval_error -logical_or_term (eval_token et, eval_t *v1) +logical_or_term (eval_token et, int32_t *v1) { - eval_t v2; + int32_t v2; eval_error er; if ((er = logical_and_term (et, v1)) != NO_ERROR) @@ -344,10 +379,14 @@ logical_or_term (eval_token et, eval_t * if (et == ERROR) return UNKNOWN_INPUT; - if ((er = logical_and_term (et, &v2)) != NO_ERROR) + /* Implement short-circuiting of valid syntax. */ + er = logical_and_term (et, &v2); + if (er == NO_ERROR) + *v1 = *v1 || v2; + else if (*v1 != 0 && er < SYNTAX_ERROR) + *v1 = 1; + else return er; - - *v1 = *v1 || v2; } if (et == ERROR) return UNKNOWN_INPUT; @@ -357,9 +396,9 @@ logical_or_term (eval_token et, eval_t * } static eval_error -logical_and_term (eval_token et, eval_t *v1) +logical_and_term (eval_token et, int32_t *v1) { - eval_t v2; + int32_t v2; eval_error er; if ((er = or_term (et, v1)) != NO_ERROR) @@ -371,10 +410,14 @@ logical_and_term (eval_token et, eval_t if (et == ERROR) return UNKNOWN_INPUT; - if ((er = or_term (et, &v2)) != NO_ERROR) + /* Implement short-circuiting of valid syntax. */ + er = or_term (et, &v2); + if (er == NO_ERROR) + *v1 = *v1 && v2; + else if (*v1 == 0 && er < SYNTAX_ERROR) + ; /* v1 is already 0 */ + else return er; - - *v1 = *v1 && v2; } if (et == ERROR) return UNKNOWN_INPUT; @@ -384,9 +427,9 @@ logical_and_term (eval_token et, eval_t } static eval_error -or_term (eval_token et, eval_t *v1) +or_term (eval_token et, int32_t *v1) { - eval_t v2; + int32_t v2; eval_error er; if ((er = xor_term (et, v1)) != NO_ERROR) @@ -401,7 +444,7 @@ or_term (eval_token et, eval_t *v1) if ((er = xor_term (et, &v2)) != NO_ERROR) return er; - *v1 = *v1 | v2; + *v1 |= v2; } if (et == ERROR) return UNKNOWN_INPUT; @@ -411,9 +454,9 @@ or_term (eval_token et, eval_t *v1) } static eval_error -xor_term (eval_token et, eval_t *v1) +xor_term (eval_token et, int32_t *v1) { - eval_t v2; + int32_t v2; eval_error er; if ((er = and_term (et, v1)) != NO_ERROR) @@ -428,7 +471,7 @@ xor_term (eval_token et, eval_t *v1) if ((er = and_term (et, &v2)) != NO_ERROR) return er; - *v1 = *v1 ^ v2; + *v1 ^= v2; } if (et == ERROR) return UNKNOWN_INPUT; @@ -438,12 +481,12 @@ xor_term (eval_token et, eval_t *v1) } static eval_error -and_term (eval_token et, eval_t *v1) +and_term (eval_token et, int32_t *v1) { - eval_t v2; + int32_t v2; eval_error er; - if ((er = not_term (et, v1)) != NO_ERROR) + if ((er = equality_term (et, v1)) != NO_ERROR) return er; while ((et = eval_lex (&v2)) == AND) @@ -452,10 +495,10 @@ and_term (eval_token et, eval_t *v1) if (et == ERROR) return UNKNOWN_INPUT; - if ((er = not_term (et, &v2)) != NO_ERROR) + if ((er = equality_term (et, &v2)) != NO_ERROR) return er; - *v1 = *v1 & v2; + *v1 &= v2; } if (et == ERROR) return UNKNOWN_INPUT; @@ -465,61 +508,53 @@ and_term (eval_token et, eval_t *v1) } static eval_error -not_term (eval_token et, eval_t *v1) +equality_term (eval_token et, int32_t *v1) { + eval_token op; + int32_t v2; eval_error er; - if (et == NOT) - { - et = eval_lex (v1); - if (et == ERROR) - return UNKNOWN_INPUT; - - if ((er = not_term (et, v1)) != NO_ERROR) - return er; - *v1 = ~*v1; - } - else - if ((er = logical_not_term (et, v1)) != NO_ERROR) - return er; - - return NO_ERROR; -} - -static eval_error -logical_not_term (eval_token et, eval_t *v1) -{ - eval_error er; + if ((er = cmp_term (et, v1)) != NO_ERROR) + return er; - if (et == LNOT) + /* In the 1.4.x series, we maintain the traditional behavior that + '=' is a synonym for '=='; however, this is contrary to POSIX and + we hope to convert '=' to mean assignment in 2.0. */ + while ((op = eval_lex (&v2)) == EQ || op == NOTEQ || op == ASSIGN) { - et = eval_lex (v1); + et = eval_lex (&v2); if (et == ERROR) return UNKNOWN_INPUT; - if ((er = logical_not_term (et, v1)) != NO_ERROR) + if ((er = cmp_term (et, &v2)) != NO_ERROR) return er; - *v1 = !*v1; + + if (op == ASSIGN) + { + M4ERROR ((warning_status, 0, "\ +Warning: recommend ==, not =, for equality operator")); + op = EQ; + } + *v1 = (op == EQ) == (*v1 == v2); } - else - if ((er = cmp_term (et, v1)) != NO_ERROR) - return er; + if (op == ERROR) + return UNKNOWN_INPUT; + eval_undo (); return NO_ERROR; } static eval_error -cmp_term (eval_token et, eval_t *v1) +cmp_term (eval_token et, int32_t *v1) { eval_token op; - eval_t v2; + int32_t v2; eval_error er; if ((er = shift_term (et, v1)) != NO_ERROR) return er; - while ((op = eval_lex (&v2)) == EQ || op == NOTEQ - || op == GT || op == GTEQ + while ((op = eval_lex (&v2)) == GT || op == GTEQ || op == LS || op == LSEQ) { @@ -532,14 +567,6 @@ cmp_term (eval_token et, eval_t *v1) switch (op) { - case EQ: - *v1 = *v1 == v2; - break; - - case NOTEQ: - *v1 = *v1 != v2; - break; - case GT: *v1 = *v1 > v2; break; @@ -570,10 +597,11 @@ cmp_term (eval_token et, eval_t *v1) } static eval_error -shift_term (eval_token et, eval_t *v1) +shift_term (eval_token et, int32_t *v1) { eval_token op; - eval_t v2; + int32_t v2; + uint32_t u1; eval_error er; if ((er = add_term (et, v1)) != NO_ERROR) @@ -589,20 +617,24 @@ shift_term (eval_token et, eval_t *v1) if ((er = add_term (et, &v2)) != NO_ERROR) return er; - /* Shifting by a negative number, or by greater than the width, is - undefined in C, but POSIX requires eval to operate on 32-bit signed - numbers. Explicitly mask the right argument to ensure defined - behavior. */ + /* Minimize undefined C behavior (shifting by a negative number, + shifting by the width or greater, left shift overflow, or + right shift of a negative number). Implement Java 32-bit + wrap-around semantics. This code assumes that the + implementation-defined overflow when casting unsigned to + signed is a silent twos-complement wrap-around. */ switch (op) { case LSHIFT: - *v1 = *v1 << (v2 & 0x1f); + u1 = *v1; + u1 <<= (uint32_t) (v2 & 0x1f); + *v1 = u1; break; case RSHIFT: - /* This assumes 2's-complement with sign-extension, since shifting - a negative number right is implementation-defined in C. */ - *v1 = *v1 >> (v2 & 0x1f); + u1 = *v1 < 0 ? ~*v1 : *v1; + u1 >>= (uint32_t) (v2 & 0x1f); + *v1 = *v1 < 0 ? ~u1 : u1; break; default: @@ -619,10 +651,10 @@ shift_term (eval_token et, eval_t *v1) } static eval_error -add_term (eval_token et, eval_t *v1) +add_term (eval_token et, int32_t *v1) { eval_token op; - eval_t v2; + int32_t v2; eval_error er; if ((er = mult_term (et, v1)) != NO_ERROR) @@ -637,10 +669,14 @@ add_term (eval_token et, eval_t *v1) if ((er = mult_term (et, &v2)) != NO_ERROR) return er; + /* Minimize undefined C behavior on overflow. This code assumes + that the implementation-defined overflow when casting + unsigned to signed is a silent twos-complement + wrap-around. */ if (op == PLUS) - *v1 = *v1 + v2; + *v1 = (int32_t) ((uint32_t) *v1 + (uint32_t) v2); else - *v1 = *v1 - v2; + *v1 = (int32_t) ((uint32_t) *v1 - (uint32_t) v2); } if (op == ERROR) return UNKNOWN_INPUT; @@ -650,10 +686,10 @@ add_term (eval_token et, eval_t *v1) } static eval_error -mult_term (eval_token et, eval_t *v1) +mult_term (eval_token et, int32_t *v1) { eval_token op; - eval_t v2; + int32_t v2; eval_error er; if ((er = exp_term (et, v1)) != NO_ERROR) @@ -668,10 +704,14 @@ mult_term (eval_token et, eval_t *v1) if ((er = exp_term (et, &v2)) != NO_ERROR) return er; + /* Minimize undefined C behavior on overflow. This code assumes + that the implementation-defined overflow when casting + unsigned to signed is a silent twos-complement + wrap-around. */ switch (op) { case TIMES: - *v1 = *v1 * v2; + *v1 = (int32_t) ((uint32_t) *v1 * (uint32_t) v2); break; case DIVIDE: @@ -679,9 +719,9 @@ mult_term (eval_token et, eval_t *v1) return DIVIDE_ZERO; else if (v2 == -1) /* Avoid the x86 SIGFPE on INT_MIN / -1. */ - *v1 = -*v1; + *v1 = (int32_t) -(uint32_t) *v1; else - *v1 = *v1 / v2; + *v1 = (int32_t) ((uint32_t) *v1 / (uint32_t) v2); break; case MODULO: @@ -691,7 +731,7 @@ mult_term (eval_token et, eval_t *v1) /* Avoid the x86 SIGFPE on INT_MIN % -1. */ *v1 = 0; else - *v1 = *v1 % v2; + *v1 %= v2; break; default: @@ -708,15 +748,14 @@ mult_term (eval_token et, eval_t *v1) } static eval_error -exp_term (eval_token et, eval_t *v1) +exp_term (eval_token et, int32_t *v1) { - register eval_t result; - eval_t v2; + uint32_t result; + int32_t v2; eval_error er; if ((er = unary_term (et, v1)) != NO_ERROR) return er; - result = *v1; while ((et = eval_lex (&v2)) == EXPONENT) { @@ -727,9 +766,17 @@ exp_term (eval_token et, eval_t *v1) if ((er = exp_term (et, &v2)) != NO_ERROR) return er; + /* Minimize undefined C behavior on overflow. This code assumes + that the implementation-defined overflow when casting + unsigned to signed is a silent twos-complement + wrap-around. */ result = 1; + if (v2 < 0) + return NEGATIVE_EXPONENT; + if (*v1 == 0 && v2 == 0) + return DIVIDE_ZERO; while (v2-- > 0) - result *= *v1; + result *= (uint32_t) *v1; *v1 = result; } if (et == ERROR) @@ -740,34 +787,41 @@ exp_term (eval_token et, eval_t *v1) } static eval_error -unary_term (eval_token et, eval_t *v1) +unary_term (eval_token et, int32_t *v1) { eval_token et2 = et; eval_error er; - if (et == PLUS || et == MINUS) + if (et == PLUS || et == MINUS || et == NOT || et == LNOT) { et2 = eval_lex (v1); if (et2 == ERROR) return UNKNOWN_INPUT; - if ((er = simple_term (et2, v1)) != NO_ERROR) + if ((er = unary_term (et2, v1)) != NO_ERROR) return er; + /* Minimize undefined C behavior on overflow. This code assumes + that the implementation-defined overflow when casting + unsigned to signed is a silent twos-complement + wrap-around. */ if (et == MINUS) - *v1 = -*v1; + *v1 = (int32_t) -(uint32_t) *v1; + else if (et == NOT) + *v1 = ~*v1; + else if (et == LNOT) + *v1 = *v1 == 0 ? 1 : 0; } - else - if ((er = simple_term (et, v1)) != NO_ERROR) - return er; + else if ((er = simple_term (et, v1)) != NO_ERROR) + return er; return NO_ERROR; } static eval_error -simple_term (eval_token et, eval_t *v1) +simple_term (eval_token et, int32_t *v1) { - eval_t v2; + int32_t v2; eval_error er; switch (et) @@ -792,6 +846,9 @@ simple_term (eval_token et, eval_t *v1) case NUMBER: break; + case BADOP: + return INVALID_OPERATOR; + default: return SYNTAX_ERROR; } diff -ruNp m4-1.4.8/src/input.c m4-1.4.9/src/input.c --- m4-1.4.8/src/input.c 2006-11-20 06:55:47.000000000 -0700 +++ m4-1.4.9/src/input.c 2007-02-05 06:43:36.000000000 -0700 @@ -1,6 +1,6 @@ /* GNU m4 -- A simple macro processor - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006 + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -86,10 +86,10 @@ struct input_block u_s; /* INPUT_STRING */ struct { - FILE *fp; /* input file handle */ - bool end : 1; /* true if peek has seen EOF */ - bool close : 1; /* true if we should close file on pop */ - bool advance_line : 1; /* track previous start_of_input_line */ + FILE *fp; /* input file handle */ + bool_bitfield end : 1; /* true if peek has seen EOF */ + bool_bitfield close : 1; /* true if we should close file on pop */ + bool_bitfield advance : 1; /* track previous start_of_input_line */ } u_f; /* INPUT_FILE */ builtin_func *func; /* pointer to macro's function */ @@ -197,7 +197,7 @@ push_file (FILE *fp, const char *title, i->u.u_f.fp = fp; i->u.u_f.end = false; i->u.u_f.close = close; - i->u.u_f.advance_line = start_of_input_line; + i->u.u_f.advance = start_of_input_line; output_current_line = -1; i->prev = isp; @@ -352,7 +352,7 @@ pop_input (void) M4ERROR ((warning_status, errno, "error reading file")); retcode = EXIT_FAILURE; } - start_of_input_line = isp->u.u_f.advance_line; + start_of_input_line = isp->u.u_f.advance; output_current_line = -1; break; @@ -752,15 +752,6 @@ set_comment (const char *bc, const char #ifdef ENABLE_CHANGEWORD -static void -init_pattern_buffer (struct re_pattern_buffer *buf) -{ - buf->translate = NULL; - buf->fastmap = NULL; - buf->buffer = NULL; - buf->allocated = 0; -} - void set_word_regexp (const char *regexp) { @@ -776,7 +767,7 @@ set_word_regexp (const char *regexp) } /* Dry run to see whether the new expression is compilable. */ - init_pattern_buffer (&new_word_regexp); + init_pattern_buffer (&new_word_regexp, NULL); msg = re_compile_pattern (regexp, strlen (regexp), &new_word_regexp); regfree (&new_word_regexp); diff -ruNp m4-1.4.8/src/m4.c m4-1.4.9/src/m4.c --- m4-1.4.8/src/m4.c 2006-11-20 06:55:47.000000000 -0700 +++ m4-1.4.9/src/m4.c 2007-02-28 06:48:19.000000000 -0700 @@ -1,7 +1,7 @@ /* GNU m4 -- A simple macro processor - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006 Free - Software Foundation, Inc. + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,10 @@ #include #include +#include "version-etc.h" + +#define AUTHORS "Rene' Seindal" + static void usage (int); /* Enable sync output for /lib/cpp (-s). */ @@ -48,6 +52,9 @@ int max_debug_argument_length = 0; /* Suppress warnings about missing arguments. */ int suppress_warnings = 0; +/* If true, then warnings affect exit status. */ +static bool fatal_warnings = false; + /* If not zero, then value of exit status for warning diagnostics. */ int warning_status = 0; @@ -62,6 +69,10 @@ const char *user_word_regexp = ""; /* The name this program was run with. */ const char *program_name; +/* Global catchall for any errors that should affect final error status, but + where we try to continue execution in the meantime. */ +int retcode; + struct macro_definition { struct macro_definition *next; @@ -83,6 +94,8 @@ m4_error (int status, int errnum, const va_start (args, format); verror_at_line (status, errnum, current_line ? current_file : NULL, current_line, format, args); + if (fatal_warnings && ! retcode) + retcode = EXIT_FAILURE; } /*-------------------------------. @@ -96,6 +109,8 @@ m4_error_at_line (int status, int errnum va_list args; va_start (args, format); verror_at_line (status, errnum, line ? file : NULL, line, format, args); + if (fatal_warnings && ! retcode) + retcode = EXIT_FAILURE; } #ifdef USE_STACKOVF @@ -138,11 +153,17 @@ for short options too.\n\ Operation modes:\n\ --help display this help and exit\n\ --version output version information and exit\n\ - -E, --fatal-warnings stop execution after first warning\n\ +", stdout); + printf ("\ + -E, --fatal-warnings once: warnings become errors, twice: stop\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\ -", stdout); + --warn-macro-sequence[=REGEXP]\n\ + warn if macro definition matches REGEXP,\n\ + default %s\n\ +", DEFAULT_MACRO_SEQUENCE); #ifdef ENABLE_CHANGEWORD fputs ("\ -W, --word-regexp=REGEXP use REGEXP for macro name syntax\n\ @@ -217,6 +238,7 @@ enum { DEBUGFILE_OPTION = CHAR_MAX + 1, /* no short opt */ DIVERSIONS_OPTION, /* not quite -N, because of message */ + WARN_MACRO_SEQUENCE_OPTION, /* no short opt */ HELP_OPTION, /* no short opt */ VERSION_OPTION /* no short opt */ @@ -246,6 +268,7 @@ static const struct option long_options[ {"debugfile", required_argument, NULL, DEBUGFILE_OPTION}, {"diversions", required_argument, NULL, DIVERSIONS_OPTION}, + {"warn-macro-sequence", optional_argument, NULL, WARN_MACRO_SEQUENCE_OPTION}, {"help", no_argument, NULL, HELP_OPTION}, {"version", no_argument, NULL, VERSION_OPTION}, @@ -253,10 +276,6 @@ static const struct option long_options[ { NULL, 0, NULL, 0 }, }; -/* Global catchall for any errors that should affect final error status, but - where we try to continue execution in the meantime. */ -int retcode; - /* Process a command line file NAME, and return true only if it was stdin. */ static bool @@ -317,6 +336,7 @@ main (int argc, char *const *argv, char const char *debugfile = NULL; const char *frozen_file_to_read = NULL; const char *frozen_file_to_write = NULL; + const char *macro_sequence = ""; program_name = argv[0]; retcode = EXIT_SUCCESS; @@ -376,7 +396,10 @@ main (int argc, char *const *argv, char break; case 'E': - warning_status = EXIT_FAILURE; + if (! fatal_warnings) + fatal_warnings = true; + else + warning_status = EXIT_FAILURE; break; case 'F': @@ -451,15 +474,16 @@ main (int argc, char *const *argv, char 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; + break; + case VERSION_OPTION: - printf ("%s\n", PACKAGE_STRING); - fputs ("\ -Copyright (C) 2006 Free Software Foundation, Inc.\n\ -This is free software; see the source for copying conditions. There is NO\n\ -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -\n\ -Written by Rene' Seindal.\n\ -", stdout); + version_etc (stdout, PACKAGE, PACKAGE_NAME, VERSION, AUTHORS, NULL); exit (EXIT_SUCCESS); break; @@ -477,6 +501,7 @@ Written by Rene' Seindal.\n\ input_init (); output_init (); symtab_init (); + set_macro_sequence (macro_sequence); include_env_init (); if (frozen_file_to_read) @@ -534,8 +559,7 @@ Written by Rene' Seindal.\n\ break; default: - M4ERROR ((warning_status, 0, - "INTERNAL ERROR: bad code in deferred arguments")); + M4ERROR ((0, 0, "INTERNAL ERROR: bad code in deferred arguments")); abort (); } @@ -551,8 +575,7 @@ Written by Rene' Seindal.\n\ read_stdin = process_file ("-"); else for (; optind < argc; optind++) - if (process_file (defines->arg)) - read_stdin = true; + read_stdin |= process_file (argv[optind]); /* Now handle wrapup text. */ @@ -563,9 +586,9 @@ Written by Rene' Seindal.\n\ stream and detect any errors it might have encountered. Close stdin if we read from it, to detect any errors. */ debug_set_output (NULL); - if (read_stdin && fclose (stdin) == EOF) + if (read_stdin && close_stream (stdin) == EOF) { - M4ERROR ((warning_status, errno, "error reading file")); + M4ERROR ((warning_status, errno, "error reading stdin")); retcode = EXIT_FAILURE; } @@ -577,5 +600,6 @@ Written by Rene' Seindal.\n\ undivert_all (); } output_exit (); + free_macro_sequence (); exit (retcode); } diff -ruNp m4-1.4.8/src/m4.h m4-1.4.9/src/m4.h --- m4-1.4.8/src/m4.h 2006-11-20 06:55:47.000000000 -0700 +++ m4-1.4.9/src/m4.h 2007-03-02 19:32:24.000000000 -0700 @@ -1,7 +1,7 @@ /* GNU m4 -- A simple macro processor - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006 Free - Software Foundation, Inc. + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -37,7 +38,6 @@ #include "close-stream.h" #include "closeout.h" #include "error.h" -#include "exit.h" #include "exitfail.h" #include "obstack.h" #include "stdio--.h" @@ -85,6 +85,15 @@ typedef struct string STRING; typedef struct token_data token_data; typedef void builtin_func (struct obstack *, int, token_data **); +/* Gnulib's stdbool doesn't work with bool bitfields. For nicer + debugging, use bool when we know it works, but use the more + portable unsigned int elsewhere. */ +#if __GNUC__ > 2 +typedef bool bool_bitfield; +#else +typedef unsigned int bool_bitfield; +#endif /* ! __GNUC__ */ + /* Take advantage of GNU C compiler source level optimization hints, using portable macros. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 6) @@ -334,11 +343,11 @@ enum symbol_lookup struct symbol { struct symbol *next; - bool traced : 1; - bool shadowed : 1; - bool macro_args : 1; - bool blind_no_args : 1; - bool deleted : 1; + bool_bitfield traced : 1; + bool_bitfield shadowed : 1; + bool_bitfield macro_args : 1; + bool_bitfield blind_no_args : 1; + bool_bitfield deleted : 1; int pending_expansions; char *name; @@ -380,9 +389,9 @@ void call_macro (symbol *, int, token_da struct builtin { const char *name; - bool gnu_extension : 1; - bool groks_macro_args : 1; - bool blind_if_no_args : 1; + bool_bitfield gnu_extension : 1; + bool_bitfield groks_macro_args : 1; + bool_bitfield blind_if_no_args : 1; builtin_func *func; }; @@ -395,13 +404,23 @@ struct predefined typedef struct builtin builtin; typedef struct predefined predefined; +struct re_pattern_buffer; +struct re_registers; + +/* The default sequence detects multi-digit parameters (obsolete after + 1.4.x), and any use of extended arguments with the default ${} + syntax (new in 2.0). */ +#define DEFAULT_MACRO_SEQUENCE "\\$\\({[^}]*}\\|[0-9][0-9]+\\)" void builtin_init (void); void define_builtin (const char *, const builtin *, symbol_lookup); +void set_macro_sequence (const char *); +void free_macro_sequence (void); void define_user_macro (const char *, const char *, symbol_lookup); void undivert_all (void); void expand_user_macro (struct obstack *, symbol *, int, token_data **); void m4_placeholder (struct obstack *, int, token_data **); +void init_pattern_buffer (struct re_pattern_buffer *, struct re_registers *); const builtin *find_builtin_by_addr (builtin_func *); const builtin *find_builtin_by_name (const char *); @@ -415,11 +434,7 @@ FILE *m4_path_search (const char *, char /* File: eval.c --- expression evaluation. */ -/* eval_t and unsigned_eval_t should be at least 32 bits. */ -typedef int eval_t; -typedef unsigned int unsigned_eval_t; - -bool evaluate (const char *, eval_t *); +bool evaluate (const char *, int32_t *); /* File: format.c --- printf like formatting. */ diff -ruNp m4-1.4.8/src/output.c m4-1.4.9/src/output.c --- m4-1.4.8/src/output.c 2006-11-20 06:55:47.000000000 -0700 +++ m4-1.4.9/src/output.c 2007-03-23 06:40:03.000000000 -0600 @@ -1,7 +1,7 @@ /* GNU m4 -- A simple macro processor - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006 Free - Software Foundation, Inc. + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006, + 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -131,7 +131,8 @@ threshold_diversion_CB (const void *elt, void output_init (void) { - diversion_table = gl_oset_create_empty (GL_AVLTREE_OSET, cmp_diversion_CB); + diversion_table = gl_oset_create_empty (GL_AVLTREE_OSET, cmp_diversion_CB, + NULL); div0.u.file = stdout; output_diversion = &div0; output_file = stdout; diff -ruNp m4-1.4.8/src/stackovf.c m4-1.4.9/src/stackovf.c --- m4-1.4.8/src/stackovf.c 2006-09-23 22:28:04.000000000 -0600 +++ m4-1.4.9/src/stackovf.c 2007-03-02 19:32:24.000000000 -0700 @@ -1,5 +1,5 @@ /* Detect stack overflow (when getrlimit and sigaction or sigvec are available) - Copyright (C) 1993, 1994, 2006 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 2006, 2007 Free Software Foundation, Inc. Jim Avera , October 1993. This program is free software; you can redistribute it and/or modify @@ -341,6 +341,11 @@ Error - Do not know how to set up stack- { stack_t ss; +# ifndef HAVE_STACK_T_SS_SP + /* This workaround is for BSD/OS 4.0.1: + http://lists.gnu.org/archive/html/bug-m4/2006-12/msg00004.html */ +# define ss_sp ss_base +# endif ss.ss_size = SIGSTKSZ; ss.ss_sp = xmalloc ((unsigned) ss.ss_size);