]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Setting Output Variables): Mention that
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 19 Jan 2007 06:54:34 +0000 (06:54 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 19 Jan 2007 06:54:34 +0000 (06:54 +0000)
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.

ChangeLog
doc/autoconf.texi
lib/autoconf/status.m4
tests/torture.at

index b8f80d9b86e066dbc85b6a39361a6695effa0285..c97ea01d88cd587fa084ed33e76f7d6edbe625d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-01-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * 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  <kasal@ucw.cz>
 
        * doc/autoconf.texi (Specifying Names): `--host' does not
index 0c384f04fabafbc23feaa2e065107841ae9459e5..b56c2f915f47ca8ec4fc85ea73571b6554ada8c5 100644 (file)
@@ -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.
index ab4060609fdc4f71944782bdf9109db1e458986c..ecccb7b9c7a234c5e2555c75ec75f4a0e34fc2ed 100644 (file)
@@ -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\rb" }' 2>/dev/null`
+if test "$ac_cs_awk_cr" = 'a\rb'; 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" <<CEOF
+cat >>"\$tmp/subs1.awk" <<CEOF
   for (key in S) S_is_set[key] = 1
   FS = "\a"
 ]m4_ifdef([_AC_SUBST_FILES],
@@ -522,6 +524,7 @@ cat >>"\$tmp/subs.awk" <<CEOF
 ]m4_ifdef([_AC_SUBST_FILES],
 [\$ac_cs_awk_pipe_fini])[
 CEOF
+sed "s,\r$,,; s,\r,\$ac_cs_awk_cr&,g" < "\$tmp/subs1.awk" > "\$tmp/subs.awk"
 _ACEOF
 ]dnl end of double-quoted part
 
index 5c3bf808748bec31993a035452dbadc18499d187..8674d1c1ab639b8bd069914709a70a4a3c6513e0 100644 (file)
@@ -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