autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

remove CEOF$ac_eof marker; expose other marker in testsuite


From: Ralf Wildenhues
Subject: remove CEOF$ac_eof marker; expose other marker in testsuite
Date: Wed, 6 Dec 2006 20:15:29 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

With awk, the part of the substitution script that initializes the array
consists of lines that start either with `S["' or with `"', no matter
what the variable contents.  So there is no need for the `CEOF$ac_eof'
escaping any more.

I've always felt uneasy about the special markers not being exposed by
the testsuite (although a casual test shows that the implementation
works well).  The patch below exposes the marker that is still used.

OK?

Cheers,
Ralf

        * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Drop the
        `CEOF$ac_eof' special marker, the awk script cannot contain a
        line matching `^CEOF', so this is not needed any more.
        * tests/torture.at (Substitute a newline): Expose the `%!_!# '
        special marker in the test.

Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.123
diff -u -r1.123 status.m4
--- lib/autoconf/status.m4      5 Dec 2006 21:36:25 -0000       1.123
+++ lib/autoconf/status.m4      6 Dec 2006 19:11:41 -0000
@@ -412,12 +412,6 @@
 done
 rm -f conf$$subs.sh
 
-dnl Similarly, avoid grep here too.
-ac_eof=`sed -n '/^CEOF[[0-9]]*$/s/CEOF/0/p' conf$$subs.awk`
-if test -n "$ac_eof"; then
-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
-  ac_eof=`expr $ac_eof + 1`
-fi
 dnl Initialize an awk array of substitutions, keyed by variable name.
 dnl
 dnl The initial line contains the variable name VAR, then a `!'.
@@ -445,7 +439,7 @@
 dnl
 dnl m4-double-quote most of the scripting for readability.
 [cat >>$CONFIG_STATUS <<_ACEOF
-cat >>"\$tmp/subs.awk" <<\CEOF$ac_eof
+cat >>"\$tmp/subs.awk" <<\CEOF
 _ACEOF
 sed -n '
 h
@@ -492,7 +486,7 @@
 ' >>$CONFIG_STATUS
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
+CEOF
 cat >>"\$tmp/subs.awk" <<CEOF
   for (key in S) S_is_set[key] = 1
   FS = ""
Index: tests/torture.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/torture.at,v
retrieving revision 1.77
diff -u -r1.77 torture.at
--- tests/torture.at    5 Dec 2006 21:36:26 -0000       1.77
+++ tests/torture.at    6 Dec 2006 19:11:41 -0000
@@ -674,6 +674,7 @@
 
 AT_DATA([Foo.in],
 address@hidden@
address@hidden@
 ])
 
 AT_DATA([configure.ac],
@@ -681,19 +682,25 @@
 AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
 foo='one
 two'
+bar='%!_!# ''
+x'
 AC_SUBST([foo])
+AC_SUBST([bar])
 AC_CONFIG_FILES([Foo])
 AC_PROG_AWK
 AC_OUTPUT
 ]])
 
+echo 'one
+two
+%!_!# ''
+x' >expout
+
 AT_CHECK_AUTOCONF
 # Check both awk and the result of AC_PROG_AWK
 for awk_arg in FOO= AWK=awk; do
   AT_CHECK_CONFIGURE([$awk_arg])
-  AT_CHECK([cat Foo], 0, [one
-two
-])
+  AT_CHECK([cat Foo], 0, [expout])
 done
 AT_CLEANUP
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]