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.
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
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 @}'}
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
#
# 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
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
_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
## 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.
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 #
# ------------ #
[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)
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