From: Ralf Wildenhues Date: Tue, 5 Dec 2006 06:00:42 +0000 (+0000) Subject: * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Use `$AWK' X-Git-Tag: AUTOCONF-2.61a~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=396c94b2777a02b22bfcdc611756234a186da2bb;p=thirdparty%2Fautoconf.git * 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. --- diff --git a/ChangeLog b/ChangeLog index bb6f50a4..0b57caa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-12-05 Ralf Wildenhues + + * 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 * lib/autoconf/functions.m4 (AC_FUNC_FSEEKO): Check that fseeko diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index 318544b1..6a7398d7 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -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; then +[[if $AWK 'BEGIN { getline <"/dev/null" }' /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 diff --git a/tests/torture.at b/tests/torture.at index ebe5345f..4c8500ea 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -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