From: Ralf Wildenhues Date: Mon, 6 Mar 2006 22:34:34 +0000 (+0000) Subject: * lib/autoconf/status.m4 (_AC_SED_CMD_LIMIT): The limit for X-Git-Tag: AUTOCONF-2.59c~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2602ca4aa5878633fc86bc1eaf6fbdb4f42d3ffe;p=thirdparty%2Fautoconf.git * lib/autoconf/status.m4 (_AC_SED_CMD_LIMIT): The limit for HP-UX sed is 99 commands, not 100. (_AC_OUTPUT_FILES_PREPARE): Do not count the `}' of an _AC_SUBST_FILES fragment. Separate `{' and `r' commands by newline for portability. * tests/torture.at (Torturing config.status): Also test 100 AC_SUBST_FILE invocations. Fix test to actually verify the AC_CONFIG_FILES output. * doc/autoconf.texi (Limitations of Usual Tools): Document HP-UX command, label, and read-file `r' limits. Unify HP-UX spelling. --- diff --git a/ChangeLog b/ChangeLog index 3dc16d395..5b4c6d7b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2006-03-06 Ralf Wildenhues + * lib/autoconf/status.m4 (_AC_SED_CMD_LIMIT): The limit for + HP-UX sed is 99 commands, not 100. + (_AC_OUTPUT_FILES_PREPARE): Do not count the `}' of an + _AC_SUBST_FILES fragment. Separate `{' and `r' commands by + newline for portability. + * tests/torture.at (Torturing config.status): Also test 100 + AC_SUBST_FILE invocations. Fix test to actually verify the + AC_CONFIG_FILES output. + * doc/autoconf.texi (Limitations of Usual Tools): Document HP-UX + command, label, and read-file `r' limits. Unify HP-UX spelling. + * tests/Makefile.am (edit, $(wrappers)): Do not use `$<' in non-suffix rule. ($(TESTSUITE_GENERATED_AT)): Use `$(srcdir)` for the benefit of diff --git a/doc/autoconf.texi b/doc/autoconf.texi index a39faba15..21106c482 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -11818,7 +11818,7 @@ bar foo @end example -Some Awk implementations, such as HPUX 11.0's native one, mishandle anchors: +Some Awk implementations, such as HP-UX 11.0's native one, mishandle anchors: @example $ @kbd{echo xfoo | $AWK '/foo|^bar/ @{ print @}'} @@ -12483,7 +12483,9 @@ them. Unicos 9 @command{sed} loops endlessly on patterns like @samp{.*\n.*}. Sed scripts should not use branch labels longer than 8 characters and -should not contain comments. +should not contain comments. HP-UX sed has a limit of 99 commands and +48 labels, which can not be circumvented by using more than one script +file. It can execute up to 19 reads with the @samp{r} command per cycle. Avoid redundant @samp{;}, as some @command{sed} implementations, such as Net@acronym{BSD} 1.4.2's, incorrectly try to interpret the second diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index 7d128636d..9553d31d6 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -303,8 +303,8 @@ AC_DEFUN([AC_CONFIG_FILES], [_AC_CONFIG_FOOS([FILES], $@)]) # # Some seds have small command number limits, like on Digital OSF/1 and HP-UX. m4_define([_AC_SED_CMD_LIMIT], -dnl One cannot portably go further than 100 commands because of HP-UX. -[100]) +dnl One cannot portably go further than 99 commands because of HP-UX. +[99]) # _AC_OUTPUT_FILES_PREPARE @@ -343,7 +343,7 @@ m4_ifdef([_AC_SUBST_FILES], m4_foreach_w([_AC_Var], m4_defn([_AC_SUBST_FILES]), [dnl End fragments at beginning of loop so that last fragment is not ended. -m4_if(m4_eval(_AC_SED_CMD_NUM + 4 > _AC_SED_CMD_LIMIT), 1, +m4_if(m4_eval(_AC_SED_CMD_NUM + 3 > _AC_SED_CMD_LIMIT), 1, [dnl Fragment is full and not the last one, so no need for the final un-escape. dnl Increment fragment number. m4_define([_AC_SED_FRAG_NUM], m4_incr(_AC_SED_FRAG_NUM))dnl @@ -359,10 +359,11 @@ cat >"\$tmp/subs-]_AC_SED_FRAG_NUM[.sed" <<\CEOF _ACEOF ]m4_define([_AC_SED_CMD_NUM], 2)m4_define([_AC_SED_FRAG])dnl ])dnl Last fragment ended. -m4_define([_AC_SED_CMD_NUM], m4_eval(_AC_SED_CMD_NUM + 4))dnl +m4_define([_AC_SED_CMD_NUM], m4_eval(_AC_SED_CMD_NUM + 3))dnl m4_define([_AC_SED_FRAG], m4_defn([_AC_SED_FRAG])dnl -[/^[ ]*@]_AC_Var[@[ ]*$/{ r $]_AC_Var[ +[/^[ ]*@]_AC_Var[@[ ]*$/{ +r $]_AC_Var[ d } ])dnl diff --git a/tests/torture.at b/tests/torture.at index cfb200851..79095f755 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -363,9 +363,9 @@ AT_CLEANUP ## Torturing config.status. ## ## ------------------------- ## -## Require 100 AC_DEFINE and AC_SUBST with a significantly big value. -## This is mostly to check that Autoconf produces portable sed scripts -## in config.status. sed is used to skip the first two lines +## Require 100 AC_DEFINE and AC_SUBST and AC_SUBST_FILE with a significantly +## big value. This is mostly to check that Autoconf produces portable sed +## scripts in config.status. sed is used to skip the first two lines ## `Generated by...'. # We use m4_for many times. @@ -402,9 +402,17 @@ m4_define([AT_DUMMY_VAR], AT_DATA([dummy.in], [m4_for([AT_Count], 1, 100, 1, [@AT_DUMMY_VAR(AT_Count)@ +@[f]AT_Count@ ])]) +i=1 +while test $i != 101; do + echo "content of file $i" > file_$i + i=`expr $i + 1` +done + + # ------------ # # configure.ac # # ------------ # @@ -430,7 +438,10 @@ m4_defun([AC_DEFUBST], [AC_DUMMY_VAR($1)="AC_BIG_VALUE" AC_DEFINE_UNQUOTED(AC_DUMMY_VAR($1), "$AC_DUMMY_VAR($1)", AC_DESCRIPTION) -AC_SUBST(AC_DUMMY_VAR($1))]) +AC_SUBST(AC_DUMMY_VAR($1)) +AC_SUBST_FILE([f]$1) +f$1=file_$1 +]) AC_INIT AC_CONFIG_HEADERS(config.h:config.hin) @@ -471,8 +482,11 @@ AT_CHECK([sed -n '4,$ p' config.h], 0, expout) 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_CLEANUP