+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
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.
# _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.
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],
[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"
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
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],
]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
[@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
X@file@
@file@X
]])
+ AT_CHECK([cmp allowed-chars Zardoz])
AT_CHECK_DEFINES([[#define foo X*'[]+ ",& &`\($foo !
]])
done