]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/status.m4 (_AC_SED_CMD_LIMIT): The limit for
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 6 Mar 2006 22:34:34 +0000 (22:34 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 6 Mar 2006 22:34:34 +0000 (22:34 +0000)
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.

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

index 3dc16d395cd7ac07a9a04d20ad0cd521c0376250..5b4c6d7b77389b5ad492bd618d8bf9aa2a5e9efe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2006-03-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * 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
index a39faba15cd00b44ac06875080b334e40313b1f4..21106c482a02c6530ad08b1f41d9c4e0fb6a49b8 100644 (file)
@@ -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
index 7d128636dc2b5ae3cef6b2384f35f89d15ffe863..9553d31d6859e07d3c87568c08dcd983c6cc31f9 100644 (file)
@@ -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
index cfb2008510a920c98c61a0462b627f4699c730c2..79095f755fcb933435ae58abb1f22b3ea2c27f4f 100644 (file)
@@ -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