summaryrefslogtreecommitdiff
path: root/lib/m4sugar/m4sh.m4
Commit message (Collapse)AuthorAgeFilesLines
* configure: don't infloop when re-executing with $CONFIG_SHELLStefano Lattarini2012-03-031-0/+4
| | | | | | | | | | It turns out our guard against infinite recursion wasn't good enough when shells without $LINENO support were involved, since the creation-and-sourcing of configure.lineno broke the guard's expectations. Reports by Tim Rice and Paul Eggert. * lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Export '_as_can_reexec' to "no" before sourcing the just-created configure.lineno.
* maint: spelling fixesPaul Eggert2012-03-011-1/+1
|
* m4sh: make AS_EXECUTABLE_P publicEric Blake2012-02-241-2/+6
| | | | | | | | | | | | | In the process of making it public, factor it into a reusable function. This makes constructs like AC_CHECK_PROGRAM smaller, as well as making libtool's naughty use of $as_executable_p safer. * lib/m4sugar/m4sh.m4 (_AS_TEST_PREPARE): Add a shell function. (AS_EXECUTABLE_P): Forward to shell function. * doc/autoconf.texi (Common Shell Constructs): Document it. * NEWS: Mention this. Signed-off-by: Eric Blake <eblake@redhat.com>
* m4sh: require that 'test -x' worksEric Blake2012-02-241-35/+14
| | | | | | | | | | | | | | | | | | | 4.3BSD is no longer a reasonable portability target; and we are pretty sure that these days we can find at least one shell on any platform that supports 'test -x'. Drop a horribly unsafe use of eval as a result. :) Libtool still uses $as_executable_p without so much as calling either AS_TEST_X or AS_EXECUTABLE_P; even though the latter has existed, although undocumented, since at least 2.59; furthermore, libtool uses it in a context where filtering out directories would have been desirable. Shame on them. * lib/m4sugar/m4sh.m4 (_AS_TEST_X_WORKS): New probe. (AS_SHELL_SANITIZE, AS_INIT): Use it in shell searching. (AS_TEST_X, AS_EXECUTABLE_P): Simplify. Signed-off-by: Eric Blake <eblake@redhat.com>
* doc: fix grammar/doubled-word errorsJim Meyering2012-01-211-1/+1
| | | | | | | * doc/autoconf.texi: Remove/fix doubled-word errors. Also, s/can not/cannot/. * lib/m4sugar/m4sh.m4: Reword "if IF" comment to avoid triggering the doubled-word warning.
* maint: update copyright yearPaul Eggert2012-01-041-1/+1
| | | | All files changed to add 2012, via 'make update-copyright'.
* m4sh: allow forced re-execution with $CONFIG_SHELL, if it's setStefano Lattarini2011-12-261-0/+22
| | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): If the m4sh client has defined the macro `_AS_FORCE_REEXEC_WITH_CONFIG_SHELL' to "yes", emit code to always re-execute the current script with $CONFIG_SHELL, if that's set. * tests/m4sh.at: Add tests for the new and old semantics, in ... (Re-exec with CONFIG_SHELL, Forced re-exec with CONFIG_SHELL): ... these new test groups.
* m4sh: refactor _AS_DETECT_BETTER_SHELL, for future changesStefano Lattarini2011-12-261-15/+26
| | | | | | * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Move code to handle the re-execution of the shell ... (_AS_REEXEC_WITH_SHELL): ... in this new macro.
* AS_LN_S: fall back on 'cp -pR' (not 'cp -p') if 'ln -s' failsPaul Eggert2011-12-261-5/+5
| | | | | | | | | This works better for symlinks to directories. Problem reported by Eli Zaretskii via Werner Lemberg in <http://lists.gnu.org/archive/html/bug-autoconf/2011-12/msg00006.html>. * NEWS: * doc/autoconf.texi (Particular Programs): Document this. * lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): Implement this.
* maint: update copyright yearEric Blake2011-01-041-2/+1
| | | | | | All files changed to add 2011, via 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* AS_LITERAL_IF: Treat raw = as literal again.Eric Blake2010-10-081-2/+2
| | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_LITERAL_IF): Treat = like +. * tests/m4sh.at (AS@&t@_TR_SH and AS@&t@_TR_CPP) (AS@&t@_LITERAL_IF): Expand tests. * NEWS: Document the fix. Reported via Ben Pfaff; originally http://bugs.debian.org/593838 Signed-off-by: Eric Blake <eblake@redhat.com>
* m4sh: fix today's AS_BOX regressionEric Blake2010-09-161-1/+1
| | | | | | | * lib/m4sugar/m4sh.m4 (_AS_BOX_LITERAL): Fix underquotation. Reported by Stefano Lattarini. Signed-off-by: Eric Blake <eblake@redhat.com>
* m4sh: preserve set -vx over re-execEric Blake2010-09-081-1/+8
| | | | | | | | | | | See http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00035.html for the motivation for this patch. * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Trace through re-exec, to make it easier to debug script startup issues. Idea from recent bug-gnulib change to init.sh. Signed-off-by: Eric Blake <eblake@redhat.com>
* m4sh: protect LINENO against stray macroEric Blake2010-08-271-5/+5
| | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Double quote entire sed script, to avoid issue uncovered by automake testsuite where 'b' was an m4 macro that broke execution on dash. Reported by Stefano Lattarini. Signed-off-by: Eric Blake <eblake@redhat.com>
* m4sh: assume ${a:-b} supportEric Blake2010-08-271-5/+9
| | | | | | | | | | | * tests/m4sh.at (Null variable substitution): New test. * doc/autoconf.texi (Shell Substitutions) <${var:-value}>: Mention that m4sh guarantees support. (Limitations of Usual Tools) <mktemp>: Use it. * lib/m4sugar/m4sh.m4 (AS_LINENO_POP, AS_VAR_IF, AS_TMPDIR): Exploit use of colon for smaller files. Signed-off-by: Eric Blake <eblake@redhat.com>
* m4sh: revert regression in AS_TMPDIREric Blake2010-08-251-4/+7
| | | | | | | | | Regression introduced in e0ac12089ea4c934029baf77741e659f0bebd653. * lib/m4sugar/m4sh.m4 (AS_TMPDIR): The previous patch trying to rename $tmp to $as_tmp was wrong; config.status relies on it. Signed-off-by: Eric Blake <eblake@redhat.com>
* m4sh: reduce size of AS_VAR_TEST_SETEric Blake2010-08-251-4/+4
| | | | | | * lib/m4sugar/m4sh.m4 (AS_VAR_TEST_SET): Make more compact. Signed-off-by: Eric Blake <eblake@redhat.com>
* docs: mention cost of globbing during variable expansionEric Blake2010-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | * doc/autoconf.texi (Shell Substitutions) <${var=literal}>: Recommend quoting substitutions that might trigger globbing. (Limitations of Builtins) <:>: Likewise. * bin/autoconf.as: Follow our own advice. * lib/autoconf/functions.m4 (AC_FUNC_SELECT_ARGTYPES): Likewise. * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Likewise. * lib/autoconf/status.m4 (AC_OUTPUT): Likewise. * lib/autotest/general.m4 (_AT_FINISH): Likewise. * lib/m4sugar/m4sh.m4 (AS_TMPDIR): Likewise. * tests/autotest.at (parallel autotest and signal handling): Likewise. * tests/c.at (AC_OPENMP and C, AC_OPENMP and C++): Likewise. * tests/foreign.at (shtool): Likewise. * tests/fortran.at: Likewise. * tests/tools.at (autom4te preselections): Likewise. * tests/torture.at (VPATH): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* m4sh: fix some namespace safety issuesEric Blake2010-08-251-4/+6
| | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_SHELL_SANITIZE): Avoid problems if as_myself is inherited from environment. (AS_TMPDIR): Be namespace clean. Signed-off-by: Eric Blake <eblake@redhat.com>
* Relax AC_INIT requirements for PACKAGE and VERSION strings again.Ralf Wildenhues2010-07-191-0/+17
| | | | | | | | | | | | | * lib/m4sugar/m4sh.m4 (AS_LITERAL_HEREDOC_IF): New macro. (_AS_LITERAL_HEREDOC_IF, _AS_LITERAL_HEREDOC_IF_YES) (_AS_LITERAL_HEREDOC_IF_NO): New helper macros. * lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Use AS_LITERAL_HEREDOC_IF for PACKAGE and VERSION strings. * tests/base.at (AC_INIT with unusual version strings): New test. * tests/m4sh.at (AS@&t@_LITERAL_IF): Extend test. * NEWS: Update. Signed-off-by: Eric Blake <eblake@redhat.com>
* Fix regression of AC_CHECK_SIZEOF on pointer types.Eric Blake2010-07-101-2/+2
| | | | | | | | | | | | | | | | | * lib/autoconf/types.m4 (AC_CHECK_SIZEOF): Translate `*' to `p' when checking literal-ness of the type, for pointer types. * lib/m4sugar/m4sh.m4 (_AS_TR_SH): Also consider `*' as literal. (_AS_TR_CPP): Likewise. * tests/semantics.at (AC_CHECK_ALIGNOF struct): When checking for numeric answer, be sure to not allow variable references. (AC_CHECK_SIZEOF struct): Likewise. Also, test the `AC_CHECK_SIZEOF([int *])' example from the manual. * doc/autoconf.texi (Generic Compiler Characteristics): Add example marker. * NEWS: Update. Reports by Nishio Futoshi and Roberto Bagnara. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Make AS_TR_SH and AS_TR_CPP similar.Eric Blake2010-07-021-2/+2
| | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_TR_CPP_LITERAL): Avoid underquoting. (_AS_TR_CPP_INDIR): Handle all polymorphic variables. * tests/m4sh.at (AS@&t@_TR_SH and AS@&t@_TR_CPP): New test. * NEWS: Document the fix. Reported by Bruno Haible. Signed-off-by: Eric Blake <eblake@redhat.com>
* Optimize AS_BOX.Eric Blake2010-07-021-6/+6
| | | | | | | | | | * lib/m4sugar/m4sh.m4 (AS_BOX): Use less m4 time. (_AS_BOX_LITERAL): Use fewer forks in the common case. * doc/autoconf.texi (Common Shell Constructs) <AS_BOX>: Document the macro. * NEWS: Mention it. Signed-off-by: Eric Blake <eblake@redhat.com>
* Use new AS_LITERAL_IF argument when appropriate.Eric Blake2010-07-021-3/+6
| | | | | | | | | * lib/m4sugar/m4sh.m4 (AS_VAR_SET): Reduce m4 overhead. (AS_VAR_IF, AS_VAR_TEST_SET): Provide shorter variant for simple references. Suggested by Bruno Haible. Signed-off-by: Eric Blake <eblake@redhat.com>
* Add optional argument to AS_LITERAL_IF.Eric Blake2010-07-021-23/+44
| | | | | | | | | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_LITERAL_IF): Rewrite to generate macro name, without using m4_cond. (_AS_LITERAL_IF_, _AS_LITERAL_IF_YES, _AS_LITERAL_IF_NO): New helpers. (AS_LITERAL_IF, AS_LITERAL_WORD_IF, _AS_TR_SH, _AS_TR_CPP) (_AS_VAR_PUSHDEF): Adjust callers. * lib/autoconf/types.m4 (AC_CHECK_ALIGNOF): Relax restrictions on invalid bytes, since this allows inline struct layouts. (_AC_CHECK_ALIGNOF): New helper macro. * tests/m4sh.at (AS@&t@_LITERAL_IF): Update test. * doc/autoconf.texi (Polymorphic Variables) <AS_LITERAL_IF>: Update documentation. Signed-off-by: Eric Blake <eblake@redhat.com>
* Use AS_LITERAL_WORD_IF as appropriate.Eric Blake2010-07-021-6/+6
| | | | | | | | | | | | * lib/autoconf/autoheader.m4 (AH_VERBATIM): Use new macro. * lib/autoconf/general.m4 (AC_REQUIRE_AUX_FILE, AC_CACHE_VAL) (AS_CACHE_CHECK, AC_DEFINE_TRACE, _AC_LIBOBJ): Likewise. * lib/autoconf/libs.m4 (AC_CHECK_LIB): Likewise. * lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS): Likewise. * lib/m4sugar/m4sh.m4 (AS_UNSET, AS_VAR_COPY, AS_VAR_GET) (AS_VAR_IF, AS_VAR_SET, AS_VAR_TEST_SET): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* Add AS_LITERAL_WORD_IF.Eric Blake2010-07-021-10/+32
| | | | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_LITERAL_IF): Also reject shell quoting characters as non-literal, and provide way to reject space. (AS_LITERAL_WORD_IF): New macro. * doc/autoconf.texi (Polymorphic Variables) <AS_LITERAL_IF>: Document new macro. Fix example to match reality. * NEWS: Document change and new macro. * tests/m4sh.at (AS@&t@_LITERAL_IF): Update test. Signed-off-by: Eric Blake <eblake@redhat.com>
* Make AS_SET_CATFILE polymorphic, and add testsuite coverage.Ralf Wildenhues2010-06-081-4/+4
| | | | | | | | | | | * lib/m4sugar/m4sh.m4 (AS_SET_CATFILE): Use AS_VAR_SET to set the variable. * tests/m4sh.at (AS@&t@_SET_CATFILE): New test. * doc/autoconf.texi (Common Shell Constructs): Document that AS_SET_CATFILE is polymorphic in its VAR argument now. * NEWS: Update. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Formatting cleanups in macro comments.Ralf Wildenhues2010-03-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | For a list of candidate unaligned underlines, use this script: for f in `git ls-files`; do awk '{ len[NR] = length($0) } /----*/ && len[NR-1] != 0 { if (len[NR-1] != len[NR]) print FILENAME ":" NR ":" $0 }' $f done * lib/autoconf/c.m4, lib/autoconf/erlang.m4, lib/autoconf/fortran.m4, lib/autoconf/functions.m4, lib/autoconf/general.m4, lib/autoconf/lang.m4, lib/autoconf/programs.m4, lib/autoconf/specific.m4, lib/autoconf/status.m4, lib/autoconf/types.m4, lib/autotest/general.m4, lib/autotest/specific.m4, lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4, tests/autotest.at, tests/local.at, tests/m4sh.at, tests/semantics.at, tests/tools.at, tests/torture.at: Fix macro comment format. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Fix AS_ERROR for FreeBSD sh.Ralf Wildenhues2010-03-021-11/+10
| | | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_ERROR_PREPARE): Rewrite as_fn_error to take additional first argument STATUS instead of transporting $? across shell function entry, which does not work with FreeBSD sh. Shift all other arguments by one, adjust. (AS_ERROR): Pass EXIT-STATUS, defaulting to $?, to as_fn_error. Report by Václav Haisman. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Update copyright year.Eric Blake2010-01-051-1/+1
| | | | | | All files changed to add 2010, via 'make update-copyright'. Signed-off-by: Eric Blake <ebb9@byu.net>
* Warn if using unnamed diversion.Eric Blake2009-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * lib/m4sugar/m4sugar.m4 (_m4_divert, m4_divert_push): Add optional parameter, which controls warning. (m4_divert_pop, m4_cleardivert, m4_divert_require) (_m4_require_call): Adjust callers. * lib/m4sugar/m4sh.m4 (AS_REQUIRE): Likewise. * tests/m4sh.at (AT_DATA_LINENO): Avoid triggering the warning. * tests/m4sugar.at (AT_CHECK_M4SUGAR_TEXT, m4@&t@_append) (m4@&t@_text_wrap, recursion): Likewise. (m4@&t@_warn, m4@&t@_divert_stack): Adjust expected output. * tests/tools.at (autom4te and whitespace in file names) (autoconf: the empty token): Avoid triggering the warning. (autoconf: AC_PRESERVE_HELP_ORDER): New test. * tests/mktests.sh (ac_exclude_list): Retire prior test. * NEWS: Document the warning. * doc/autoconf.texi (Redefined M4 Macros) <m4_divert>, <m4_undivert>: Make even more explicit that using these directly is discouraged. (Diversion support): Further warn against improper diversion changes. <m4_divert_text>: Give an example of proper use. Reported by Mike Frysinger. Signed-off-by: Eric Blake <ebb9@byu.net>
* Fix corner cases in AS_LITERAL_IF and AS_TR_SH.Eric Blake2009-10-281-21/+38
| | | | | | | | | | | | | | | * lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Fix bug with unbalanced parens. Move guts... (_AS_LITERAL_IF): into new helper. (AS_TR_SH, AS_TR_CPP): Fix bugs with expansion of wrong macro. Move guts... (_AS_TR_SH, _AS_TR_SH_LITERAL, _AS_TR_SH_INDIR, _AS_TR_CPP) (_AS_TR_CPP_LITERAL, _AS_TR_CPP_INDIR): ...into new helpers. (AS_VAR_PUSHDEF): Hoist m4_require, by moving guts... (_AS_VAR_PUSHDEF): ...into new helper. * tests/m4sh.at (AS@&t@_LITERAL_IF): Enhance test. Signed-off-by: Eric Blake <ebb9@byu.net>
* Minor optimizations to m4sh.Eric Blake2009-10-281-15/+12
| | | | | | | | * lib/m4sugar/m4sh.m4 (AS_VAR_IF, AS_IDENTIFIER_IF) (AS_LITERAL_IF): Parse fewer bytes during expansion, by visiting if-true and if-false arguments only once. Signed-off-by: Eric Blake <ebb9@byu.net>
* Update License to GPLv3+ including new Autoconf Exception.Ralf Wildenhues2009-09-091-36/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS, README: Update licensing information. * COPYING.EXCEPTION: New file. * Makefile.am (EXTRA_DIST): Distribute it. * cfg.mk (autom4te-update): Remove copyright change warning. * lib/autoconf/autoconf.m4, lib/autoconf/autoheader.m4, lib/autoconf/autoscan.m4, lib/autoconf/autotest.m4, lib/autoconf/autoupdate.m4, lib/autoconf/c.m4, lib/autoconf/erlang.m4, lib/autoconf/fortran.m4, lib/autoconf/functions.m4, lib/autoconf/general.m4, lib/autoconf/headers.m4, lib/autoconf/lang.m4, lib/autoconf/libs.m4, lib/autoconf/oldnames.m4, lib/autoconf/programs.m4, lib/autoconf/specific.m4, lib/autoconf/status.m4, lib/autoconf/types.m4, lib/autotest/autotest.m4, lib/autotest/general.m4, lib/autotest/specific.m4, lib/m4sugar/foreach.m4, lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4: Update exception statement, bump to GPLv3. * bin/autoconf.as, bin/autoheader.in, bin/autom4te.in, bin/autoreconf.in, bin/autoscan.in, bin/autoupdate.in, bin/ifnames.in: Bump to GPLv3+, adjust --version output to reflect the GPLv3+ and the Autoconf Exception. * lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm, lib/Autom4te/General.pm, lib/Autom4te/Request.pm, lib/autom4te.in, lib/autoscan/autoscan.pre, lib/emacs/autoconf-mode.el, lib/emacs/autotest-mode.el, lib/freeze.mk, tests/atlocal.in, tests/autoscan.at, tests/autotest.at, tests/base.at, tests/c.at, tests/compile.at, tests/erlang.at, tests/foreign.at, tests/fortran.at, tests/local.at, tests/m4sh.at, tests/m4sugar.at, tests/mktests.sh, tests/semantics.at, tests/statesave.m4, tests/suite.at, tests/tools.at, tests/torture.at, tests/wrapper.as: Bump to GPLv3+.
* Fix AS_EXIT for FreeBSD sh.Eric Blake2009-07-241-6/+7
| | | | | | | | | * lib/m4sugar/m4sh.m4 (AS_EXIT): Always supply an argument to the shell function, since $? is not reliable on function entry. (_AS_EXIT_PREPARE): Simplify to assume argument. Reported by Ralf Wildenhues. Signed-off-by: Eric Blake <ebb9@byu.net>
* Avoid AIX 6.1 ksh88 ECHO_C command substitution bug.Jan Madzik2009-06-301-4/+9
| | | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_ECHO_N_PREPARE): Ensure more than one character is output with `\c'; reset echo output state if buggy ksh was detected, and set ECHO_T instead of ECHO_C. * doc/autoconf.texi (Limitations of Builtins): Document it. * tests/m4sh.at (ECHO_C): New test. * THANKS: Update. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Sanitize more problematic environment variables.Eric Blake2009-05-261-0/+3
| | | | | | | | | | | | | | * doc/autoconf.texi (Environment Variable Index): Add more entries, particularly for precious variables and known culprit variables. Needed to avoid overfull vbox. (Special Shell Variables) <CLICOLOR_FORCE, GREP_OPTIONS>: Add variables known to cause misbehavior. * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Unset variables known to cause problems. * THANKS: Update. Based on reports from Ilya Bobir and Joey Mingrone. Signed-off-by: Eric Blake <ebb9@byu.net>
* Fix yesterday's regression in AS_IF.Eric Blake2009-04-141-1/+1
| | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_IF_ELSE): Don't corrupt $? in else branch; it is up to the user to avoid syntax errors. * tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Adjust test. Signed-off-by: Eric Blake <ebb9@byu.net>
* Make AS_IF, AS_CASE, and AS_FOR more robust to blank arguments.Eric Blake2009-04-131-13/+16
| | | | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_CASE, _AS_CASE_DEFAULT, AS_FOR, _AS_IF) (_AS_IF_ELSE, AS_IF): Avoid syntax error on blank argument, including a macro with an empty expansion. * NEWS: Mention this. * tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE, AS@&t@_FOR): Update tests. Reported by Mike Frysinger. Signed-off-by: Eric Blake <ebb9@byu.net>
* Add undocumented _AS_CLEAN_DIR.Eric Blake2009-04-101-0/+11
| | | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_CLEAN_DIR): New macro; fixes m4 quoting in previous patch. * lib/autotest/general.m4 (AT_INIT) <at_fn_group_prepare>: Use new macro. * tests/m4sh.at (_AS@&t@_CLEAN_DIR): New test. Reported by Ralf Wildenhues. Signed-off-by: Eric Blake <ebb9@byu.net>
* Manual: fix a typo.Jim Meyering2009-03-171-2/+2
| | | | * lib/m4sugar/m4sh.m4: s/are/is/ => "there is no indirection"
* Fix a typo in comment for AS_LITERAL_IF.Allan Caffee2009-03-021-1/+1
| | | | | | | | | * lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Update a comment that fell out of date when this function was moved/renamed in 59ecd766. * THANKS: Update. Signed-off-by: Allan Caffee <allan.caffee@gmail.com> Signed-off-by: Eric Blake <ebb9@byu.net>
* Improve wording for AS_ESCAPE.Eric Blake2009-03-021-3/+3
| | | | | | | | | * doc/autoconf.texi (Common Shell Constructs) <AS_ESCAPE>: Touch up documentation. * lib/m4sugar/m4sh.m4 (_AS_ESCAPE): Fix comment typos. Reported by Ralf Wildenhues. Signed-off-by: Eric Blake <ebb9@byu.net>
* Use m4_translit more efficiently in AS_ESCAPE.Eric Blake2009-02-191-9/+25
| | | | | | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_ESCAPE): Alter API to take first byte of set separately from rest. (AS_ESCAPE, _AS_QUOTE_MODERN, AS_TR_SH, AS_VAR_GET): Adjust callers. * lib/autoconf/autoheader.m4 (AH_VERBATIM): Avoid duplicate characters in translit request. * doc/autoconf.texi (Common Shell Constructs) <AS_ESCAPE>: Document the macro. * NEWS: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Clean up some bugs caught by preliminary dependency validation.Eric Blake2009-01-201-2/+2
| | | | | | | | | * lib/autoconf/headers.m4 (AC_DIR_HEADER): Don't invoke AC_HEADER_DIRENT, since AC_FUNC_CLOSEDIR_VOID requires it. * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL) (_AS_SHELL_SANITIZE): Fix quoting bugs. Signed-off-by: Eric Blake <ebb9@byu.net>
* Speed up m4_require.Eric Blake2009-01-191-8/+4
| | | | | | | | | | | | * lib/m4sugar/m4sugar.m4 (_m4_divert_dump): Change semantics to always be defined, as either empty or a number. (_m4_defun_pro_outer, _m4_defun_epi_outer): Treat _m4_divert_dump as a stack, rather than a one-shot macro. (_m4_require_call): Expect third argument to be pre-expanded. (m4_divert_require, m4_require): Adjust clients accordingly. * lib/m4sugar/m4sh.m4 (AS_REQUIRE): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Fix typo in AS_MESSAGE_LOG_FD patch.Eric Blake2008-11-241-1/+1
| | | | | | * lib/m4sugar/m4sh.m4 (AS_ERROR): Check correct condition. Signed-off-by: Eric Blake <ebb9@byu.net>
* Clean up AS_MESSAGE_LOG_FD usage.Eric Blake2008-11-211-11/+35
| | | | | | | | | | | | | | | * lib/m4sugar/m4sh.m4 (AS_MESSAGE_FD, AS_MESSAGE_LOG_FD) (AS_ORIGINAL_STDIN_FD): Provide default M4sh values. (_AS_ECHO_LOG, AS_MESSAGE, _AS_ERROR_PREPARE, AS_ERROR): Simplify usage. (AS_INIT_GENERATED): Don't shuffle an unchanged AS_MESSAGE_FD. * tests/m4sh.at (AS@&t@_INIT_GENERATED): Update test. (AS@&t@_MESSAGE_FD): New test. * doc/autoconf.texi (Initialization Macros) <AS_INIT_GENERATED>: Give more details about fd manipulation. (File Descriptor Macros): Describe M4sh defaults for the fds. Signed-off-by: Eric Blake <ebb9@byu.net>
* Use shell function for AS_ERROR.Eric Blake2008-11-211-10/+55
| | | | | | | | | | * lib/m4sugar/m4sh.m4 (_AS_ERROR_PREPARE): New macro, defining a new shell function. (AS_ERROR): Use it. (_AS_LINENO_PREPARE): Break circular dependency. (AS_PREPARE, _AS_PREPARE): Initialize for child scripts. Signed-off-by: Eric Blake <ebb9@byu.net>