diff --git a/ChangeLog b/ChangeLog index a6ed6170..55544556 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2000-08-09 Akim Demaille + + * autoconf.sh (finalize.awk): Don't leave spaces before the user + function calls. + Reported by John David Anglin. + * doc/autoconf.texi (Limitations of Usual Tools): Start the AWK + section. + * tests/tools.m4 (AWK portability): New test. + 2000-08-0 Pavel Roskin * Makefile.am: substitute @bindir@ in shell scripts, needed by diff --git a/autoconf.in b/autoconf.in index 8bb4d9dd..517dd626 100644 --- a/autoconf.in +++ b/autoconf.in @@ -364,12 +364,12 @@ case $task in if (index (\$0, macro)) { delete macros [macro] - undefined ("$infile", line, macro) + undefined("$infile", line, macro) } } close ("$infile") for (macro in macros) - undefined ("$outfile", macros [macro], macro) + undefined("$outfile", macros [macro], macro) exit 1 } } diff --git a/autoconf.sh b/autoconf.sh index 8bb4d9dd..517dd626 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -364,12 +364,12 @@ case $task in if (index (\$0, macro)) { delete macros [macro] - undefined ("$infile", line, macro) + undefined("$infile", line, macro) } } close ("$infile") for (macro in macros) - undefined ("$outfile", macros [macro], macro) + undefined("$outfile", macros [macro], macro) exit 1 } } diff --git a/bin/autoconf.in b/bin/autoconf.in index 8bb4d9dd..517dd626 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -364,12 +364,12 @@ case $task in if (index (\$0, macro)) { delete macros [macro] - undefined ("$infile", line, macro) + undefined("$infile", line, macro) } } close ("$infile") for (macro in macros) - undefined ("$outfile", macros [macro], macro) + undefined("$outfile", macros [macro], macro) exit 1 } } diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 8a041f46..a0ed8b59 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -5092,14 +5092,14 @@ often possible to avoid this problem using @samp{echo "x$word"}, taking the @samp{x} into account later in the pipe. @table @asis -@item @command{break} -@cindex @command{break} -The use of @samp{break 2} etc. is safe. - @item @command{!} @cindex @command{!} You can't use @command{!}, you'll have to rewrite your code. +@item @command{break} +@cindex @command{break} +The use of @samp{break 2} etc. is safe. + @item @command{case} @cindex @command{case} You don't need to quote the argument, no splitting is performed. @@ -5353,6 +5353,21 @@ The small set of tools you can expect to find on any machine can still find some limitations you should be aware of. @table @asis +@item @command{awk} +@cindex @command{awk} +Don't leave white spaces before the parentheses in user functions calls, +@sc{gnu} awk will reject it: + +@example +$ gawk 'function die () @{ print "Aaaaarg!" @} + BEGIN @{ die () @}' +gawk: cmd. line:2: BEGIN @{ die () @} +gawk: cmd. line:2: ^ parse error +$ gawk 'function die () @{ print "Aaaaarg!" @} + BEGIN @{ die() @}' +Aaaaarg! +@end example + @item @command{cat} @cindex @command{cat} Don't rely on any option. diff --git a/tests/tools.m4 b/tests/tools.m4 index 3889f74b..6bceef1a 100644 --- a/tests/tools.m4 +++ b/tests/tools.m4 @@ -262,3 +262,28 @@ configure:3: warning: undefined macro: AC_OUTPUT ]]) AT_CLEANUP(configure) + + + + + +## ---------------------------- ## +## autoconf's AWK portability. ## +## ---------------------------- ## + +AT_SETUP(AWK portability) + +AT_DATA([configure.in], +[[AC_INIT +]]) + +if (gawk --version) >/dev/null 2>&1; then + # Generation of the script. + AT_CHECK([AWK='gawk --posix' ../autoconf --autoconf-dir .. -l $at_srcdir], 0, + [], []) + # Tracing. + AT_CHECK([AWK='gawk --posix' ../autoconf --autoconf-dir .. -l $at_srcdir -t AC_INIT], 0, + ignore, []) +fi + +AT_CLEANUP(configure)