+2006-05-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lib/autoconf/status.m4 (_AC_OUTPUT_HEADER): Simplify ac_dA and
+ ac_dB slightly, to save bytes in the script.
+ Max out at 50 lines, rather than 96; this is more likely
+ (though not guaranteed) to avoid obscure 'sed' failures.
+
2006-05-23 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/autotest/general.m4 (AT_INIT): UnixWare `tr' may interpret
# just an empty string.
#
dnl Quote, for the `[ ]' and `define'.
-[ ac_dA='s,^\([ ]*#[ ]*\)[^ ]*\([ ][ ]*'
- ac_dB='\)[ (].*$,\1define\2'
+[ ac_dA='s,^\([ #]*\)[^ ]*\([ ]*'
+ ac_dB='\)[ (].*,\1define\2'
ac_dC=' '
ac_dD=' ,']
dnl ac_dD used to contain `;t' at the end, but that was both slow and incorrect.
[s,^[ #]*u.*,/* & */,]' >>conftest.defines
# Break up conftest.defines:
-ac_max_sed_lines=m4_eval(_AC_SED_CMD_LIMIT - 3)
+dnl If we cared only about not exceeding line count limits, we would use this:
+dnl ac_max_sed_lines=m4_eval(_AC_SED_CMD_LIMIT - 3)
+dnl But in practice this can generate scripts that contain too many bytes;
+dnl and this can cause obscure 'sed' failures, e.g.,
+dnl http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00127.html
+dnl So instead, we use the following, which is about half the size we'd like:
+ac_max_sed_lines=50
+dnl In the future, let's use awk or sh instead of sed to do substitutions,
+dnl since we have so many problems with sed.
# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"