-# The code produced used to be extremely costly: there are was a
-# single sed script (n lines) handling both `#define' templates,
-# `#undef' templates with trailing space, and `#undef' templates
-# without trailing spaces. The full script was run on each of the m
-# lines of `config.h.in', i.e., about n x m.
-#
-# Now there are two scripts: `conftest.defines' for the `#define'
-# templates, and `conftest.undef' for the `#undef' templates.
-#
-# Optimization 1. It is incredibly costly to run two `#undef'
-# scripts, so just remove trailing spaces first. Removes about a
-# third of the cost.
-#
-# Optimization 2. Since `#define' are rare and obsoleted,
-# `conftest.defines' is built and run only if grep says there are
-# `#define'. Improves by at least a factor 2, since in addition we
-# avoid the cost of *producing* the sed script.
-#
-# Optimization 3. In each script, first check that the current input
-# line is a template. This avoids running the full sed script on
-# empty lines and comments (divides the cost by about 3 since each
-# template chunk is typically a comment, a template, an empty line).
-#
-# Optimization 4. Once a substitution performed, since there can be
-# only one per line, immediately restart the script on the next input
-# line (using the `t' sed instruction). Divides by about 2.
-# *Note:* In the case of the AC_SUBST sed script (_AC_OUTPUT_FILES)
-# this optimization cannot be applied as is, because there can be
-# several substitutions per line.
-#
-#
-# The result is about, hm, ... times blah... plus.... Ahem. The
-# result is about much faster.
-m4_define([_AC_OUTPUT_HEADERS],
-[cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-dnl Double quote for the `[ ]' and `define'.
-[ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='[ ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t']
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- test x"$ac_file" != x- && AC_MSG_NOTICE([creating $ac_file])
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [[\\/$]]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || AC_MSG_ERROR([cannot find input file: $f])
- # Do quote $f, to prevent DOS paths from being IFS'd.
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- AC_MSG_ERROR([cannot find input file: $f])
- fi;;
- esac
- done` || AS_EXIT([1])
- # Remove the trailing spaces.
- sed 's/[[ ]]*$//' $ac_file_inputs >$tmp/in
-