]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Use `$AWK'
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 5 Dec 2006 06:00:42 +0000 (06:00 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 5 Dec 2006 06:00:42 +0000 (06:00 +0000)
instead of `awk' consistently.
(_AC_OUTPUT_CONFIG_STATUS): Initialize $AWK.
* tests/torture.at (Torturing config.status): Test both the
result of AC_PROG_AWK and plain awk.
(Substitute a 2000-byte string): Likewise.
(Substitute and define special characters): Likewise.
(Substitute a newline): Likewise.

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

index bb6f50a437536b7468bf8997048e655a8cd82eef..0b57caa347270b8555efd62db7931dad5d5683ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-12-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Use `$AWK'
+       instead of `awk' consistently.
+       (_AC_OUTPUT_CONFIG_STATUS): Initialize $AWK.
+       * tests/torture.at (Torturing config.status): Test both the
+       result of AC_PROG_AWK and plain awk.
+       (Substitute a 2000-byte string): Likewise.
+       (Substitute and define special characters): Likewise.
+       (Substitute a newline): Likewise.
+
 2006-12-04  Paul Eggert  <eggert@cs.ucla.edu>
 
        * lib/autoconf/functions.m4 (AC_FUNC_FSEEKO): Check that fseeko
index 318544b1cf18c82745cb8bd6122ea3d239ff8d66..6a7398d75080b6715d83669c93f7feb73450efa0 100644 (file)
@@ -346,7 +346,7 @@ dnl Otherwise, do the interpolation in sh, which is slower.
 dnl Without any AC_SUBST_FILE, omit all related code.
 dnl Note the expansion is double-quoted for readability.
 m4_ifdef([_AC_SUBST_FILES],
-[[if awk 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
+[[if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
   ac_cs_awk_getline=:
   ac_cs_awk_pipe_init=
   ac_cs_awk_read_file='
@@ -368,12 +368,12 @@ dnl Define the pipe that does the substitution.
 m4_ifdef([_AC_SUBST_FILES],
 [m4_define([_AC_SUBST_CMDS], [|
 if $ac_cs_awk_getline; then
-  awk -f "$tmp/subs.awk"
+  $AWK -f "$tmp/subs.awk"
 else
-  awk -f "$tmp/subs.awk" | $SHELL
+  $AWK -f "$tmp/subs.awk" | $SHELL
 fi])],
 [m4_define([_AC_SUBST_CMDS],
-[| awk -f "$tmp/subs.awk"])])dnl
+[| $AWK -f "$tmp/subs.awk"])])dnl
 
 echo 'BEGIN {' >"$tmp/subs.awk"
 _ACEOF
@@ -1302,6 +1302,10 @@ AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
 AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
 [MKDIR_P='$MKDIR_P'
 ])dnl
+AC_PROVIDE_IFELSE([AC_PROG_AWK],
+[AWK='$AWK'
+])dnl
+test -n "\$AWK" || AWK=awk
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
index ebe5345f707dadf3bf80a09bb8ea979bd42ee315..4c8500eaef0450a7b3032b6d3ca50527495ae05d 100644 (file)
@@ -490,15 +490,18 @@ AC_CONFIG_HEADERS(config.h:config.hin)
 AC_CONFIG_FILES(dummy)
 m4_for(AC_Count, 1, 100, 1,
        [AC_DEFUBST(AC_Count)])
+AC_PROG_AWK
 AC_OUTPUT
 ]])# configure.ac
 
 AT_CHECK_AUTOCONF
 AT_CHECK_AUTOHEADER
-AT_CHECK_CONFIGURE
+# Check both awk and the result of AC_PROG_AWK
+for awk_arg in FOO= AWK=awk; do
+  AT_CHECK_CONFIGURE([$awk_arg])
 
-# Checking that AC_DEFINE worked properly.
-AT_DATA([expout],
+  # Checking that AC_DEFINE worked properly.
+  AT_DATA([expout],
 [/* Define to the address where bug reports for this package should be sent. */
 #define PACKAGE_BUGREPORT ""
 
@@ -518,16 +521,18 @@ m4_for(AT_Count, 1, 100, 1,
 /* AT_DESCRIPTION */
 [#define] AT_DUMMY_VAR(AT_Count) "AT_BIG_VALUE"
 ])])
-AT_CHECK([sed -n '4,$ p' config.h], 0, expout)
 
-# Checking that AC_SUBST worked properly.
-AT_DATA([expout],
+  AT_CHECK([sed -n '4,$ p' config.h], 0, expout)
+
+  # Checking that AC_SUBST worked properly.
+  AT_DATA([expout],
 [m4_for(AT_Count, 1, 100, 1,
 [AT_BIG_VALUE
 content of file AT_Count
 ])])
 
-AT_CHECK([cat dummy], 0, expout)
+  AT_CHECK([cat dummy], 0, expout)
+done
 
 AT_CLEANUP
 
@@ -563,14 +568,17 @@ AC_OUTPUT
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_CONFIGURE
-AT_CHECK([cat Foo], 0, m4_for([n], 1, 100,, ....................)
+# 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, m4_for([n], 1, 100,, ....................)
 )
-AT_CHECK([cat Bar], 0, m4_for([n], 1, 100,, @ @ @ @ @ @ @ @ @ @@)
+  AT_CHECK([cat Bar], 0, m4_for([n], 1, 100,, @ @ @ @ @ @ @ @ @ @@)
 )
-AT_CHECK([cat Baz], 0, m4_for([n], 1, 4,, m4_for([m], 1, 25,, ... ... ... ... ....)
+  AT_CHECK([cat Baz], 0, m4_for([n], 1, 4,, m4_for([m], 1, 25,, ... ... ... ... ....)
 )
 )
+done
 AT_CLEANUP
 
 
@@ -633,8 +641,10 @@ AC_CONFIG_FILES([Foo])]])
 
 AT_CHECK_AUTOCONF
 AT_CHECK_AUTOHEADER
-AT_CHECK_CONFIGURE
-AT_CHECK([cat Foo], 0, [[X*'[]+ ",& &`\($foo \& \\& \\\& \\\\& \ \\ \\\ !
+# 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, [[X*'[]+ ",& &`\($foo \& \\& \\\& \\\\& \ \\ \\\ !
 @foo@ @baz@@notsubsted@bla stray @ and more@@bla
 abc@foo@ @baz@baz@baz
 abc@foo@ @baz@blabaz
@@ -647,8 +657,9 @@ abc@bar blabla
 X@file@
 @file@X
 ]])
-AT_CHECK_DEFINES([[#define foo X*'[]+ ",& &`\($foo !
+  AT_CHECK_DEFINES([[#define foo X*'[]+ ",& &`\($foo !
 ]])
+done
 AT_CLEANUP
 
 
@@ -673,10 +684,13 @@ AC_OUTPUT
 ]])
 
 AT_CHECK_AUTOCONF
-AT_CHECK_CONFIGURE
-AT_CHECK([cat Foo], 0, [one
+# 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
 ])
+done
 AT_CLEANUP