From: Ralf Wildenhues Date: Fri, 19 Jan 2007 06:54:34 +0000 (+0000) Subject: * doc/autoconf.texi (Setting Output Variables): Mention that X-Git-Tag: v2.62~367 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb7dd74777d5db4caf7bf875c24c3b1a410ca78f;p=thirdparty%2Fautoconf.git * doc/autoconf.texi (Setting Output Variables): Mention that all non-NUL characters are ok in substituted values. * lib/autoconf/status.m4 (_AC_SED_CMD_LIMIT): Fix comment typo. (_AC_OUTPUT_FILES_PREPARE): Test and use backslash escaping of carriage return for $AWK, needed for BSD awk. * tests/torture.at (Substitute and define special characters): Test all 8 bit non-NUL characters. Report against Automake by Patrick Welche. --- diff --git a/ChangeLog b/ChangeLog index b8f80d9b..c97ea01d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-01-19 Ralf Wildenhues + + * doc/autoconf.texi (Setting Output Variables): Mention that + all non-NUL characters are ok in substituted values. + * lib/autoconf/status.m4 (_AC_SED_CMD_LIMIT): Fix comment typo. + (_AC_OUTPUT_FILES_PREPARE): Test and use backslash escaping of + carriage return for $AWK, needed for BSD awk. + * tests/torture.at (Substitute and define special characters): + Test all 8 bit non-NUL characters. + Report against Automake by Patrick Welche. + 2007-01-15 Stepan Kasal * doc/autoconf.texi (Specifying Names): `--host' does not diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 0c384f04..b56c2f91 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -8354,7 +8354,8 @@ substitute the variable @var{variable} into output files (typically one or more makefiles). This means that @code{AC_OUTPUT} replaces instances of @samp{@@@var{variable}@@} in input files with the value that the shell variable @var{variable} has when @code{AC_OUTPUT} -is called. The value can contain newlines. +is called. The value can contain any non-@code{NUL} character, including +newline. Variable occurrences should not overlap: e.g., an input file should not contain @samp{@@@var{var1}@@@var{var2}@@} if @var{var1} and @var{var2} are variable names. diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index ab406060..ecccb7b9 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -313,7 +313,7 @@ dnl One cannot portably go further than 99 commands because of HP-UX. # _AC_AWK_LITERAL_LIMIT # --------------------- -# Evaluate the maximum number of characters to put in an awk +# Evaluate to the maximum number of characters to put in an awk # string literal, not counting escape characters. # # Some awk's have small limits, such as Solaris and AIX awk. @@ -362,7 +362,9 @@ else print "cat " F[key] '$ac_cs_awk_pipe_init ac_cs_awk_pipe_fini='END { print "|#_!!_#|" }' -fi]])dnl +fi]]) +ac_cs_awk_cr=`$AWK 'BEGIN { print "a b" }' 2>/dev/null` +if test "$ac_cs_awk_cr" = 'a b'; then ac_cs_awk_cr=; else ac_cs_awk_cr='\\'; fi dnl dnl Define the pipe that does the substitution. m4_ifdef([_AC_SUBST_FILES], @@ -375,14 +377,14 @@ fi])], [m4_define([_AC_SUBST_CMDS], [| $AWK -f "$tmp/subs.awk"])])dnl -echo 'BEGIN {' >"$tmp/subs.awk" +echo 'BEGIN {' >"$tmp/subs1.awk" _ACEOF m4_ifdef([_AC_SUBST_FILES], [# Create commands to substitute file output variables. { echo "cat >>$CONFIG_STATUS <<_ACEOF" - echo 'cat >>"\$tmp/subs.awk" <<\CEOF' + echo 'cat >>"\$tmp/subs1.awk" <<\CEOF' echo "$ac_subst_files" | sed 's/.*/F@<:@"&"@:>@="$&"/' echo "CEOF" echo "_ACEOF" @@ -439,7 +441,7 @@ dnl - Writing `$ 0' prevents expansion by both the shell and m4 here. dnl dnl m4-double-quote most of the scripting for readability. [cat >>$CONFIG_STATUS <<_ACEOF -cat >>"\$tmp/subs.awk" <<\CEOF +cat >>"\$tmp/subs1.awk" <<\CEOF _ACEOF sed -n ' h @@ -487,7 +489,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF CEOF -cat >>"\$tmp/subs.awk" <>"\$tmp/subs1.awk" <>"\$tmp/subs.awk" < "\$tmp/subs.awk" _ACEOF ]dnl end of double-quoted part diff --git a/tests/torture.at b/tests/torture.at index 5c3bf808..8674d1c1 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -632,18 +632,35 @@ AT_DATA([File], [@foo@@bar@ ]) +AT_DATA([Zardoz.in], [@zardoz@ +]) + AT_CONFIGURE_AC( [[foo="AS@&t@_ESCAPE([[X*'[]+ ",& &`\($foo \& \\& \\\& \\\\& \ \\ \\\ !]])" bar="@foo@ @baz@" baz=bla +( for i in 0 1 2 3; do + for j in 0 1 2 3 4 5 6 7; do + for k in 0 1 2 3 4 5 6 7; do + case $i$j$k in #( + 000) ;; #( + *) printf \\$i$j$k ;; + esac + done + done + done + printf \\n +) >allowed-chars +zardoz=`cat allowed-chars` AC_SUBST([foo]) AC_SUBST([bar]) AC_SUBST([baz]) +AC_SUBST([zardoz]) file=File AC_SUBST_FILE([file]) AC_DEFINE([foo], [[X*'[]+ ",& &`\($foo !]], [Awful value.]) AC_PROG_AWK -AC_CONFIG_FILES([Foo])]]) +AC_CONFIG_FILES([Foo Zardoz])]]) AT_CHECK_AUTOCONF AT_CHECK_AUTOHEADER @@ -663,6 +680,7 @@ abc@bar blabla X@file@ @file@X ]]) + AT_CHECK([cmp allowed-chars Zardoz]) AT_CHECK_DEFINES([[#define foo X*'[]+ ",& &`\($foo ! ]]) done