summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <akim@epita.fr>1999-09-14 14:22:46 +0000
committerAkim Demaille <akim@epita.fr>1999-09-14 14:22:46 +0000
commit642c88e6f7f96639249a568ab43905c36cd39e6a (patch)
tree8cfb0f99240d1f8c0f7138ab21534419c933b27e
parentcc528e32f04e9f3a3dc0fb4a1a34dbcb5e5d92e3 (diff)
downloadautoconf-642c88e6f7f96639249a568ab43905c36cd39e6a.tar.gz
1999-09-14 Akim Demaille <akim@epita.fr>
* acgeneral.m4 (AC_HELP_STRING): Rewrite in m4. Have m4 work, and give a break to sh. (_AC_FOREACH): Be careful not to evaluate the arguments. A loop over *quoted* macro names should loop over the macro names, not upon their expansion. (_AC_COMMATIZE): Also swallow end of lines. * autoconf.texi (Pretty Help Strings): Updated to reflect the changes. 1999-09-13 Akim Demaille <akim@epita.fr> * acgeneral.m4 (ifset): New helpy tiny macro. (AC_OUTPUT): Improved --help of config.status. (AC_OUTPUT): Remove inconditionaly all the files to be updated. (AC_OUTPUT): Use pid to define the temporary file names in order to allow parallel builds. * autoconf.sh: Substitute also /@BKL@/[/ /@BKR@/]/ /@DLR@/$/ so that these characters are more easily accessible from m4 without turning changequote juggling into a nightmare. * acgeneral.m4 (AC_WRAP): New macro, for word wrapping. * autoconf.texi: Update the direntry for more modern Texinfos. Add pointer to configure and config.status. Remove the dots from the menus: horizontal space is precious. (Invoking config.status): More traditional presentation of the options.
-rw-r--r--ChangeLog31
-rw-r--r--acgeneral.m4487
-rw-r--r--autoconf.sh5
-rw-r--r--autoconf.texi534
-rwxr-xr-xconfigure66
-rw-r--r--doc/autoconf.texi534
-rw-r--r--lib/autoconf/general.m4487
7 files changed, 1214 insertions, 930 deletions
diff --git a/ChangeLog b/ChangeLog
index afe1d0d2..287d7a4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+1999-09-14 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (AC_HELP_STRING): Rewrite in m4. Have m4 work, and
+ give a break to sh.
+ (_AC_FOREACH): Be careful not to evaluate the arguments. A loop
+ over *quoted* macro names should loop over the macro names, not
+ upon their expansion.
+ (_AC_COMMATIZE): Also swallow end of lines.
+
+ * autoconf.texi (Pretty Help Strings): Updated to reflect the
+ changes.
+
+1999-09-13 Akim Demaille <akim@epita.fr>
+
+ * acgeneral.m4 (ifset): New helpy tiny macro.
+ (AC_OUTPUT): Improved --help of config.status.
+ (AC_OUTPUT): Remove inconditionaly all the files to be updated.
+ (AC_OUTPUT): Use pid to define the temporary file names in order
+ to allow parallel builds.
+
+ * autoconf.sh: Substitute also /@BKL@/[/ /@BKR@/]/ /@DLR@/$/ so
+ that these characters are more easily accessible from m4 without
+ turning changequote juggling into a nightmare.
+
+ * acgeneral.m4 (AC_WRAP): New macro, for word wrapping.
+
+ * autoconf.texi: Update the direntry for more modern Texinfos.
+ Add pointer to configure and config.status.
+ Remove the dots from the menus: horizontal space is precious.
+ (Invoking config.status): More traditional presentation of the options.
+
1999-09-02 Tom Tromey <tromey@cygnus.com>
* autoheader.sh: Allow multiple spaces between #undef and symbol
diff --git a/acgeneral.m4 b/acgeneral.m4
index 6f381c53..44217731 100644
--- a/acgeneral.m4
+++ b/acgeneral.m4
@@ -73,6 +73,11 @@ m4_prefix([include])
m4_prefix([shift])
m4_prefix([format])
+dnl ifset(COND, IF-TRUE)
+dnl --------------------
+dnl If COND is not the empty string, expand IF-TRUE.
+define([ifset], [ifelse([$1],,,[$2])])
+
dnl ### Defining macros
@@ -282,7 +287,6 @@ dnl shell variables' content will be translated at run time (tr or sed).
dnl AC_TR(STRING, FROM, TO, ALPHABET, DEFAULT)
dnl ------------------------------------------
-dnl
dnl Perform tr 'FROM' 'TO' on STRING by m4 when possible, otherwise
dnl by the shell at configure time. After transliteration, any character
dnl which is not part of ALPHABET is then mapped to DEFAULT.
@@ -312,7 +316,6 @@ AC_VAR_IF_INDIR([$1],
dnl AC_TR_DEFINE(EXPRESSION)
dnl ------------------------
-dnl
dnl Map EXPRESSION to an upper case string which is valid as rhs for a
dnl `#define'. sh/m4 polymorphic.
define(AC_TR_DEFINE,
@@ -325,7 +328,6 @@ define(AC_TR_DEFINE,
dnl AC_TR_SH(EXPRESSION)
dnl --------------------
-dnl
dnl Transform EXPRESSION into a valid shell variable name.
dnl sh/m4 polymorphic. Because of a delicate problem of quoting,
dnl we cannot use the definition we had before:
@@ -341,33 +343,112 @@ define(AC_TR_SH,
dnl ### Implementing m4 loops
+dnl Implementing loops (`foreach' loops) in m4 is much more tricky than it
+dnl may seem. Actually, the example of a `foreach' loop in the m4
+dnl documentation is wrong: it does not quote the arguments properly,
+dnl which leads to undesired expansions.
+dnl
+dnl The example in the documentation is:
+dnl
+dnl | # foreach(x, (item_1, item_2, ..., item_n), stmt)
+dnl | define(`foreach',
+dnl | `pushdef(`$1', `')_foreach(`$1', `$2', `$3')popdef(`$1')')
+dnl | define(`_arg1', `$1')
+dnl | define(`_foreach',
+dnl | `ifelse(`$2', `()', ,
+dnl | `define(`$1', _arg1$2)$3`'_foreach(`$1', (shift$2), `$3')')')
+dnl
+dnl But then if you run
+dnl
+dnl | define(a, 1)
+dnl | define(b, 2)
+dnl | define(c, 3)
+dnl | foreach(`f', `(`a', `(b', `c)')', `echo f
+dnl | ')
+dnl
+dnl it gives
+dnl
+dnl | echo 1
+dnl | echo (2,3)
+dnl
+dnl which is not what is expected.
+dnl
+dnl Once you understood this, you turn yourself into a quopting wizard,
+dnl and come up with the following solution:
+dnl
+dnl | # foreach(x, (item_1, item_2, ..., item_n), stmt)
+dnl | define(`foreach', `pushdef(`$1', `')_foreach($@)popdef(`$1')')
+dnl | define(`_arg1', ``$1'')
+dnl | define(`_foreach',
+dnl | `ifelse($2, `()', ,
+dnl | `define(`$1', `_arg1$2')$3`'_foreach(`$1', `(shift$2)', `$3')')')
+dnl
+dnl which this time answers
+dnl
+dnl | echo a
+dnl | echo (b
+dnl | echo c)
+dnl
+dnl Bingo!
+
dnl AC_FOREACH_COMMA(VARIABLE, LIST, EXPRESSION)
dnl --------------------------------------------
-dnl Compute EXPRESSION assigning to VARIABLE each value of the LIST
-dnl (LIST has the form `(item_1, item_2, ..., item_n)').
+dnl Expand EXPRESSION assigning to VARIABLE each value of the LIST
+dnl (LIST should have the form `[(item_1, item_2, ..., item_n)]'),
+dnl i.e. the whole list should be *quoted*. Quote members too if
+dnl you don't want them to be expanded.
define(AC_FOREACH_COMMA,
-[pushdef([$1], [])_AC_FOREACH([$1], [$2], [$3])popdef([$1])])
+[pushdef([$1], [])_AC_FOREACH($@)popdef([$1])])
dnl Low level macros used to define AC_FOREACH_COMMA.
-define(_AC_CAR, [$1])
-define(_AC_CDR, [builtin(shift, $@)])
+define(_AC_CAR, [[$1]])
define(_AC_FOREACH,
-[ifelse([$2], [()], ,
- [define([$1], _AC_CAR$2)$3[]_AC_FOREACH([$1],
- (_AC_CDR$2),
+[ifelse($2, [()], ,
+ [define([$1], [_AC_CAR$2])$3[]_AC_FOREACH([$1],
+ [(m4_shift$2)],
[$3])])])
dnl _AC_COMMATIZE(LIST)
dnl -------------------
-dnl Use patsubst to go from an AC_FOREACH_COMMA list to a AC_FOREACH
-dnl list. Do not use `patsubst([$2], [\>\W+\<], [,])', since it swallows
+
+dnl Transform a shell LIST (i.e., white space separated) into a m4 list
+dnl (i.e., separated with commas). This is used to implement AC_FOREACH
+dnl with AC_FOREACH_COMMA.
+dnl
+dnl It quite tricky for several reasons:
+dnl - if there are quoted active symbols in input, on the output they
+dnl should still be quoted. I didn't manage to reach this goal yet,
+dnl but it doesn't seem to be such a necessity. FIXME: do it.
+dnl - if there are parentheses in the input, make sure *not* to think
+dnl this is an m4 list. This is especially important for
+dnl AC_HELP_STRING.
+dnl
+dnl This means that `_AC_COMMATIZE([a] [(b] [c)])' should expand into
+dnl `[a], [(b], [c)]'. Currently parentheses are correctly handled, but
+dnl the macro are expanded, i.e., the output is `[1],[(2],[3)]'.
+dnl
+dnl Do not use `patsubst([$2], [\>\W+\<], [,])', since it swallows
dnl the `$' from the variable names, so, 1. swallow `\[CR]' (I don't
dnl understand why I need two backslashes), 2. remove trailing spaces, 3.
dnl replace remaining sequences of spaces with commas.
-define([_AC_COMMATIZE],
-[patsubst(patsubst(patsubst([$1], [\\
-]), [[ ]+$]), [[ ]+], [,])])
-
+dnl
+dnl Pay attention to the changequotes. Inner changequotes exist for
+dnl obvious reasons (we want to insert square brackets). Outer
+dnl changequotes are needed because otherwise the m4 parser, when it
+dnl sees the closing bracket we add to the result believes it is the
+dnl end of the body of the macro we define.
+changequote(<, >)
+define(<_AC_COMMATIZE>,
+<changequote(`, ')dnl
+pushdef(`one_line', translit(patsubst(`$1', `\\
+'), `
+', ` '))dnl
+pushdef(`no_trailing_space', patsubst(one_line, `[ ]+$'))dnl
+[patsubst(no_trailing_space, `[ ]+', `],[')]dnl
+changequote([, ])dnl
+popdef(`no_trailing_space')dnl
+popdef(`one_line')>)
+changequote([, ])
dnl AC_FOREACH(VARIABLE, LIST, EXPRESSION)
dnl --------------------------------------
@@ -375,7 +456,7 @@ dnl
dnl Compute EXPRESSION assigning to VARIABLE each value of the LIST.
dnl (LIST has the form `item_1 item_2 ... item_n': there are no commas.)
dnl
-define(AC_FOREACH,
+define([AC_FOREACH],
[AC_FOREACH_COMMA([$1], (_AC_COMMATIZE([$2])), [$3])])
@@ -392,6 +473,98 @@ AC_DEFUN(AC_SPECIALIZE,
[indir([$1], m4_shift($@))])])
+dnl ## --------------------------------- ##
+dnl ## Helping macros to display strings ##
+dnl ## --------------------------------- ##
+
+
+dnl AC_WRAP(STRING [,WIDTH] [, PREFIX]]))
+dnl -------------------------------------
+dnl Expands into the STRING wrapped to hold in WIDTH (which defaults to
+dnl 79). Words longer than WIDTH are not split. Each line is prefixed
+dnl with PREFIX. Note that the length of PREFIX is taken into account
+dnl by this macro to compute the length of a line.
+dnl
+dnl FIXME: there is no checking of a longer PREFIX than WIDTH, but do
+dnl we really want to bother with people trying each single corner
+dnl of a software?
+define([AC_WRAP],
+[pushdef([ac_prefix], [$3])dnl
+pushdef([ac_width], m4_eval(ifelse([$2],, 79, $2) - len(ac_prefix)))dnl
+pushdef([ac_cursor], 0)dnl
+ac_prefix[]dnl
+AC_FOREACH([ac_word], $1,
+[define([ac_cursor], m4_eval(ac_cursor + len(ac_word) + 1))dnl
+ifelse(m4_eval(ac_cursor > ac_width),
+ 1, [define([ac_cursor], m4_eval(len(ac_word) + 1))]
+ac_prefix)dnl
+ac_word ])dnl
+popdef([ac_prefix])dnl
+popdef([ac_width])dnl
+popdef([ac_cursor])])
+
+
+dnl AC_HELP_STRING(LHS, RHS)
+dnl ------------------------
+dnl
+dnl Format an Autoconf macro's help string so that it looks pretty when
+dnl the user executes "configure --help". This macro takes two
+dnl arguments, a "left hand side" (LHS), and a "right hand side" (RHS).
+dnl
+dnl The resulting string is suitable for use in other macros that require
+dnl a help string (e.g. AC_ARG_WITH).
+dnl
+dnl Here is the sample string from the Autoconf manual (Node: External
+dnl Software) which shows the proper spacing for help strings.
+dnl
+dnl --with-readline support fancy command line editing
+dnl ^ ^ ^
+dnl | | |
+dnl | column 2 column 26
+dnl |
+dnl column 0
+dnl
+dnl A help string is made up of a "left hand side" (LHS) and a "right
+dnl hand side" (RHS). In the example above, the LHS is
+dnl "--with-readline", while the RHS is "support fancy command line
+dnl editing".
+dnl
+dnl If the LHS extends past column 24, then the LHS is terminated with a
+dnl newline so that the RHS is on a line of its own beginning in column
+dnl 26.
+dnl
+dnl Therefore, if the LHS were instead "--with-readline-blah-blah-blah",
+dnl then the AC_HELP_STRING macro would expand into:
+dnl
+dnl
+dnl --with-readline-blah-blah-blah
+dnl ^ ^ support fancy command line editing
+dnl | | ^
+dnl | column 2 |
+dnl column 0 column 26
+dnl
+dnl This macro is a adhoc version of AC_WRAP.
+define([AC_HELP_STRING],
+[pushdef([ac_prefix], [ ])dnl 26 spaces
+pushdef([ac_width], m4_eval(79 - len(ac_prefix)))dnl
+pushdef([ac_cursor], 0)dnl
+m4_format([ %-23s ], [$1])dnl
+dnl If the option is too wide, leave it alone on the line
+ifelse(m4_eval(len(m4_format([ %-23s ], [$1])) > 26),
+ 1, [
+]ac_prefix)dnl
+AC_FOREACH([ac_word], $2,
+[define([ac_cursor], m4_eval(ac_cursor + len(ac_word) + 1))dnl
+ifelse(m4_eval(ac_cursor > ac_width),
+ 1, [define([ac_cursor], m4_eval(len(ac_word) + 1))]
+ac_prefix)dnl
+ac_word ])dnl
+popdef([ac_prefix])dnl
+popdef([ac_width])dnl
+popdef([ac_cursor])])
+
+
+
dnl ### Initialization
@@ -983,6 +1156,7 @@ dnl ### Selecting optional features
dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
+dnl -----------------------------------------------------------------------
AC_DEFUN(AC_ARG_ENABLE,
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
ac_help="$ac_help
@@ -1029,121 +1203,12 @@ AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl
])
-dnl ### Pretty-printing help strings.
-
-dnl AC_HELP_STRING
-dnl --------------
-dnl
-dnl usage: AC_HELP_STRING(LHS, RHS, HELP-STRING)
-dnl
-dnl Format an Autoconf macro's help string so that it looks pretty when
-dnl the user executes "configure --help". This macro take three
-dnl arguments, a "left hand side" (LHS), a "right hand side" (RHS), and
-dnl a variable (HELP-STRING) to set to the pretty-printed concatenation
-dnl of LHS and RHS (the new, pretty-printed "help string").
-dnl
-dnl The resulting string in HELP-STRING is suitable for use in other
-dnl macros that require a help string (e.g. AC_ARG_WITH).
-dnl
-AC_DEFUN(AC_HELP_STRING,
-[
-dnl
-dnl Here is the sample string from the Autoconf manual (Node: External
-dnl Software) which shows the proper spacing for help strings.
-dnl
-dnl --with-readline support fancy command line editing
-dnl ^ ^ ^
-dnl | | |
-dnl | column 2 column 26
-dnl |
-dnl column 0
-dnl
-dnl A help string is made up of a "left hand side" (LHS) and a "right
-dnl hand side" (RHS). In the example above, the LHS is
-dnl "--with-readline", while the RHS is "support fancy command line
-dnl editing".
-dnl
-dnl If the LHS extends past column 24, then the LHS is terminated with a
-dnl newline so that the RHS is on a line of its own beginning in column
-dnl 26.
-dnl
-dnl Therefore, if the LHS were instead "--with-readline-blah-blah-blah",
-dnl then the MDL_PRETTY_HELP_STRING macro would expand into:
-dnl
-dnl
-dnl --with-readline-blah-blah-blah
-dnl ^ ^ support fancy command line editing
-dnl | | ^
-dnl | column 2 |
-dnl column 0 column 26
-
-dnl We divert everything to AC_DIVERSION_NOTICE (which gets output very
-dnl early in the configure script) because we want the user's help
-dnl string to be set before it is used.
-
-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-# This is from AC_HELP_STRING
-lhs="$1"
-rhs="$2"
-
-lhs_column=25
-rhs_column=`expr $lhs_column + 1`
-
-# Insure that the LHS begins with exactly two spaces.
-changequote(, )dnl
-lhs=`echo "$lhs" | sed -n -e "s/[ ]*\(.*\)/ \1/p"`
-changequote([, ])dnl
-
-# Is the length of the LHS less than $lhs_column?
-if ! `echo "$lhs" | grep ".\{$lhs_column\}" > /dev/null 2>&1`; then
-
- # Pad the LHS with spaces. Note that padding the LHS is an
- # "expensive" operation (i.e. expensive in the sense of there being
- # multiple calls to `grep') only the first time MDL_PRETTY_HELP_STRING
- # is called. Once this macro is called once, subsequent calls will be
- # nice and zippy.
- : ${lhs_pad=""}
-changequote(, )dnl
- while ! `echo "$lhs_pad" | grep "[ ]\{$lhs_column\}" > /dev/null 2>&1`; do
-changequote([, ])dnl
- lhs_pad=" $lhs_pad"
- done
-
- lhs="${lhs}${lhs_pad}"
-changequote(, )dnl
-$3=`echo "$lhs" | sed -n -e "/.\{$lhs_column\}[ ][ ]*$/ s/\(.\{$rhs_column\}\).*/\1$rhs/p"`
-changequote([, ])dnl
-
-else
-
- # Build up a string of spaces to pad the left-hand-side of the RHS
- # with. Note that padding the RHS is an "expensive" operation
- # (i.e. expensive in the sense of there being multiple calls to
- # `grep') only the first time AC_HELP_STRING is called. Once this
- # macro is called once, subsequent calls will be nice and zippy.
- : ${rhs_pad=""}
-changequote(, )dnl
- while ! `echo "$rhs_pad" | grep "[ ]\{$rhs_column\}" > /dev/null 2>&1`; do
-changequote([, ])dnl
- rhs_pad=" $rhs_pad"
- done
-
- # Strip all leading spaces from the RHS.
-changequote(, )dnl
- rhs=`echo "$rhs" | sed -n -e "s/[ ]*\(.*\)/\1/p"`
-changequote([, ])dnl
-
-$3="$lhs
-${rhs_pad}${rhs}"
-fi
-AC_DIVERT_POP()dnl
-])
-
dnl ### Transforming program names.
dnl AC_ARG_PROGRAM()
+dnl FIXME: Must be run only once.
AC_DEFUN(AC_ARG_PROGRAM,
[if test "$program_transform_name" = s,x,x,; then
program_transform_name=
@@ -1870,14 +1935,14 @@ fi
undefine([AC_VAR_NAME])dnl
])
+dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
+dnl -----------------------------------------------------
dnl Try to compile, link and execute TEST-PROGRAM. Set WORKING-VAR to
dnl `yes' if the current compiler works, otherwise set it ti `no'. Set
dnl CROSS-VAR to `yes' if the compiler and linker produce non-native
dnl executables, otherwise set it to `no'. Before calling
dnl `AC_TRY_COMPILER()', call `AC_LANG_*' to set-up for the right
dnl language.
-dnl
-dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
AC_DEFUN(AC_TRY_COMPILER,
[cat > conftest.$ac_ext << EOF
ifelse(AC_LANG, [FORTRAN77], ,
@@ -2444,9 +2509,11 @@ subdirs="AC_LIST_SUBDIRS"
AC_SUBST(subdirs)dnl
])
+dnl AC_OUTPUT([CONFIG_FILES...] [, EXTRA-CMDS] [, INIT-CMDS])
+dnl -------------------------------------------------
dnl The big finish.
dnl Produce config.status, config.h, and links; and configure subdirs.
-dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS])
+dnl The CONFIG_HEADERS are defined in the m4 variable AC_LIST_HEADER.
define(AC_OUTPUT,
[trap '' 1 2 15
AC_CACHE_SAVE
@@ -2488,9 +2555,32 @@ dnl so uname gets run too.
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
-changequote(, )dnl
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-changequote([, ])dnl
+ac_cs_usage="\
+Usage: $CONFIG_STATUS @BKL@OPTIONS@BKR@
+Configure files from templates according to the current configuration.
+
+ --recheck Update $CONFIG_STATUS by reconfiguring in the same conditions
+ --version Print the version of Autoconf and exit
+ --help Display this help and exit
+
+By default the following files will updated.
+ifset($1, [ Configuration files:
+AC_WRAP($1, 79, [ ])
+])dnl
+ifdef([AC_LIST_HEADER], [ Configuration headers:
+AC_WRAP(AC_LIST_HEADER, 79, [ ])]
+)dnl
+
+In order to configure a list a specified FILES and HEADERS, run
+ CONFIG_FILES=FILES CONFIG_HEADERS=HEADERS $CONFIG_STATUS
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+ac_cs_version="\
+$CONFIG_STATUS generated by autoconf version AC_ACVERSION.
+Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by running
+ [$]0 [$]ac_configure_args"
+
for ac_option
do
case "[\$]ac_option" in
@@ -2498,8 +2588,7 @@ do
echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion"
exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version AC_ACVERSION"
- exit 0 ;;
+ echo "[\$]ac_cs_version"; exit 0 ;;
-help | --help | --hel | --he | --h)
echo "[\$]ac_cs_usage"; exit 0 ;;
*) echo "[\$]ac_cs_usage"; exit 1 ;;
@@ -2509,14 +2598,18 @@ done
ac_given_srcdir=$srcdir
ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
])dnl
-
-changequote(<<, >>)dnl
-ifdef(<<AC_LIST_HEADER>>,
-<<trap 'rm -fr `echo "$1 AC_LIST_HEADER" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>,
-<<trap 'rm -fr `echo "$1" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>)
-changequote([, ])dnl
-EOF
-cat >> $CONFIG_STATUS <<EOF
+# Allow concurrent executions
+conftest=cft\$\$
+
+dnl Remove all of CONFIG_FILES and CONFIG_HEADERS, and trap to remove
+dnl the temp files. There is no need to trap for the config files
+dnl since they are built from `mv tmp-file config-file', hence their
+dnl update is atomic.
+: \${CONFIG_FILES="$1"}
+ifdef([AC_LIST_HEADER], [: \${CONFIG_HEADERS=AC_LIST_HEADER}
+])dnl
+rm -fr \`echo "\$CONFIG_FILES ifdef([AC_LIST_HEADER], \$CONFIG_HEADERS)" | sed "s/:@BKL@^ @BKR@*//g"\`
+trap 'rm -fr \$conftest*; exit 1' 1 2 15
AC_OUTPUT_FILES($1)
ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
@@ -2551,7 +2644,7 @@ dnl Using a here document instead of a string reduces the quoting nightmare.
# If the first sed substitution is executed (which looks for macros that
# take arguments), then we branch to the cleanup section. Otherwise,
# look for a macro that doesn't take arguments.
-cat > conftest.defs <<\EOF
+cat > $conftest.defs <<\EOF
changequote(<<, >>)dnl
s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)%-D\1=\2%g
t cleanup
@@ -2563,20 +2656,22 @@ s%\]%\\&%g
s%\$%$$%g
changequote([, ])dnl
EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
+DEFS=`sed -f $conftest.defs confdefs.h | tr '\012' ' '`
+rm -f $conftest.defs
])
+
+dnl AC_OUTPUT_FILES(CONFIG_FILES...)
+dnl --------------------------------
dnl Do the variable substitutions to create the Makefiles or whatever.
dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted
dnl here document whose contents are going into config.status, but
dnl upon returning, the here document is being quoted.
-dnl AC_OUTPUT_FILES(FILE...)
define(AC_OUTPUT_FILES,
[# Protect against being on the right side of a sed subst in config.status.
changequote(, )dnl
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > \$conftest.subs <<\\CEOF
changequote([, ])dnl
dnl These here document variables are unquoted when configure runs
dnl but quoted when config.status runs, so variables are expanded once.
@@ -2600,18 +2695,18 @@ ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "1,${ac_beg}d; ${ac_end}q" $conftest.subs > $conftest.s$ac_file
else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "${ac_end}q" $conftest.subs > $conftest.s$ac_file
fi
- if test ! -s conftest.s$ac_file; then
+ if test ! -s $conftest.s$ac_file; then
ac_more_lines=false
- rm -f conftest.s$ac_file
+ rm -f $conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
+ ac_sed_cmds="sed -f $conftest.s$ac_file"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
@@ -2623,10 +2718,6 @@ if test -z "$ac_sed_cmds"; then
fi
EOF
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"$1"}
-EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
changequote(, )dnl
@@ -2682,6 +2773,8 @@ changequote([, ])dnl
*) ac_comsub= ;;
esac
+# Don't redirect the output to AC_FILE directly: use `mv' so that updating
+# is atomic, and doesn't need trapping.
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
@@ -2690,23 +2783,25 @@ s%@top_srcdir@%$top_srcdir%g
ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
])dnl
dnl The parens around the eval prevent an "illegal io" in Ultrix sh.
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $conftest.out
dnl This would break Makefile dependencies.
-dnl if cmp -s $ac_file conftest.out 2>/dev/null; then
+dnl if cmp -s $ac_file $conftest.out 2>/dev/null; then
dnl echo "$ac_file is unchanged"
-dnl rm -f conftest.out
+dnl rm -f $conftest.out
dnl else
dnl rm -f $ac_file
-dnl mv conftest.out $ac_file
+dnl mv $conftest.out $ac_file
dnl fi
+ mv $conftest.out $ac_file
fi; done
-rm -f conftest.s*
+rm -f $conftest.s*
])
+dnl AC_OUTPUT_HEADER(HEADER-FILE...)
+dnl --------------------------------
dnl Create the config.h files from the config.h.in files.
dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
dnl here document whose contents are going into config.status.
-dnl AC_OUTPUT_HEADER(HEADER-FILE...)
define(AC_OUTPUT_HEADER,
[changequote(<<, >>)dnl
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
@@ -2749,20 +2844,20 @@ changequote([, ])dnl
echo creating $ac_file
- rm -f conftest.frag conftest.in conftest.out
+ rm -f $conftest.frag $conftest.in $conftest.out
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
+ cat $ac_file_inputs > $conftest.in
EOF
-# Transform confdefs.h into a sed script conftest.vals that substitutes
+# Transform confdefs.h into a sed script $conftest.vals that substitutes
# the proper values into config.h.in to produce config.h. And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
+rm -f $conftest.vals
dnl Using a here document instead of a string reduces the quoting nightmare.
dnl Putting comments in sed scripts is not portable.
-cat > conftest.hdr <<\EOF
+cat > $conftest.hdr <<\EOF
changequote(<<, >>)dnl
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
@@ -2774,50 +2869,53 @@ s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
changequote([, ])dnl
EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC_DEFINE to be honored.
+uniq confdefs.h | sed -n -f $conftest.hdr > $conftest.vals
+rm -f $conftest.hdr
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
+cat >> $conftest.vals <<\EOF
changequote(, )dnl
s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
changequote([, ])dnl
EOF
-# Break up conftest.vals because some shells have a limit on
+# Break up $conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.
-rm -f conftest.tail
+rm -f $conftest.tail
while :
do
- ac_lines=`grep -c . conftest.vals`
+ ac_lines=`grep -c . $conftest.vals`
# grep -c gives empty output for an empty file on some AIX systems.
if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ # Write a limited-size here document to $conftest.frag.
+ echo ' cat > $conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q $conftest.vals >> $CONFIG_STATUS
echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
+ sed -f $conftest.frag $conftest.in > $conftest.out
+ rm -f $conftest.in
+ mv $conftest.out $conftest.in
' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
+ sed 1,${ac_max_here_lines}d $conftest.vals > $conftest.tail
+ rm -f $conftest.vals
+ mv $conftest.tail $conftest.vals
done
-rm -f conftest.vals
+rm -f $conftest.vals
dnl Now back to your regularly scheduled config.status.
cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
+ rm -f $conftest.frag $conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > $conftest.h
+ cat $conftest.in >> $conftest.h
+ rm -f $conftest.in
+ if cmp -s $ac_file $conftest.h 2>/dev/null; then
echo "$ac_file is unchanged"
- rm -f conftest.h
+ rm -f $conftest.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
changequote(, )dnl
@@ -2828,15 +2926,16 @@ cat >> $CONFIG_STATUS <<\EOF
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
- mv conftest.h $ac_file
+ mv $conftest.h $ac_file
fi
fi; done
])
+dnl AC_OUTPUT_LINKS(SOURCE..., DEST...)
+dnl -----------------------------------
dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
dnl here document whose contents are going into config.status.
-dnl AC_OUTPUT_LINKS(SOURCE..., DEST...)
define(AC_OUTPUT_LINKS,
[EOF
diff --git a/autoconf.sh b/autoconf.sh
index c5e63eb8..c6934961 100644
--- a/autoconf.sh
+++ b/autoconf.sh
@@ -157,11 +157,16 @@ else
fi
# Put the real line numbers into configure to make config.log more helpful.
+# Because quoting can sometimes get really painful in m4, there are special
+# tokens to substitute.
$AWK '
/__oline__/ { printf "%d:", NR + 1 }
{ print }
' $tmpout | sed '
/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/
+s/@BKL@/[/g
+s/@BKR@/]/g
+s/@DLR@/$/g
' >&4
rm -f $tmpout
diff --git a/autoconf.texi b/autoconf.texi
index fcbb799d..6609c4f0 100644
--- a/autoconf.texi
+++ b/autoconf.texi
@@ -14,13 +14,28 @@
@finalout
@end iftex
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Autoconf: (autoconf). Create source code configuration scripts.
-END-INFO-DIR-ENTRY
-@end format
+@dircategory GNU admin
+@direntry
+* Autoconf: (autoconf). Create source code configuration scripts
+@end direntry
+
+@dircategory Individual utilities
+@direntry
+* autoscan: (autoconf)Invoking autoscan.
+ Semi-automatic @file{configure.in} writing
+* ifnames: (autoconf)Invoking ifnames.
+ Listing the conditionals in source code
+* autoconf: (autoconf)Invoking autoconf.
+ How to create configuration scripts
+* autoreconf: (autoconf)Invoking autoreconf.
+ Remaking multiple @code{configure} scripts
+* configure: (autoconf)Invoking aclocal.
+ How to use the Autoconf output
+* config.status: (autoconf)Invoking config.status.
+ Recreating a configuration
+@end direntry
+@ifinfo
Autoconf: Creating Automatic Configuration Scripts, by David MacKenzie.
This file documents the GNU Autoconf package for creating scripts to
@@ -95,201 +110,202 @@ by the Foundation.
@ifinfo
This file documents the GNU Autoconf package for creating scripts to
configure source code packages using templates and an @code{m4} macro
-package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}.
+package. This is edition @value{EDITION}, for Autoconf version
+@value{VERSION}.
@end ifinfo
@c The master menu, created with texinfo-master-menu, goes here.
@menu
-* Introduction:: Autoconf's purpose, strengths, and weaknesses.
-* Making configure Scripts:: How to organize and produce Autoconf scripts.
-* Setup:: Initialization and output.
-* Existing Tests:: Macros that check for particular features.
-* Writing Tests:: How to write new feature checks.
-* Results:: What to do with results from feature checks.
-* Writing Macros:: Adding new macros to Autoconf.
-* Manual Configuration:: Selecting features that can't be guessed.
-* Site Configuration:: Local defaults for @code{configure}.
-* Invoking configure:: How to use the Autoconf output.
-* Invoking config.status:: Recreating a configuration.
-* Questions:: Questions about Autoconf, with answers.
-* Upgrading:: Tips for upgrading from version 1.
-* History:: History of Autoconf.
-* Old Macro Names:: Backward compatibility macros.
-* Environment Variable Index:: Index of environment variables used.
-* Output Variable Index:: Index of variables set in output files.
-* Preprocessor Symbol Index:: Index of C preprocessor symbols defined.
-* Macro Index:: Index of Autoconf macros.
+* Introduction:: Autoconf's purpose, strengths, and weaknesses
+* Making configure Scripts:: How to organize and produce Autoconf scripts
+* Setup:: Initialization and output
+* Existing Tests:: Macros that check for particular features
+* Writing Tests:: How to write new feature checks
+* Results:: What to do with results from feature checks
+* Writing Macros:: Adding new macros to Autoconf
+* Manual Configuration:: Selecting features that can't be guessed
+* Site Configuration:: Local defaults for @code{configure}
+* Invoking configure:: How to use the Autoconf output
+* Invoking config.status:: Recreating a configuration
+* Questions:: Questions about Autoconf, with answers
+* Upgrading:: Tips for upgrading from version 1
+* History:: History of Autoconf
+* Old Macro Names:: Backward compatibility macros
+* Environment Variable Index:: Index of environment variables used
+* Output Variable Index:: Index of variables set in output files
+* Preprocessor Symbol Index:: Index of C preprocessor symbols defined
+* Macro Index:: Index of Autoconf macros
@detailmenu
--- The Detailed Node Listing ---
Making @code{configure} Scripts
-* Writing configure.in:: What to put in an Autoconf input file.
-* Invoking autoscan:: Semi-automatic @file{configure.in} writing.
-* Invoking ifnames:: Listing the conditionals in source code.
-* Invoking autoconf:: How to create configuration scripts.
-* Invoking autoreconf:: Remaking multiple @code{configure} scripts.
+* Writing configure.in:: What to put in an Autoconf input file
+* Invoking autoscan:: Semi-automatic @file{configure.in} writing
+* Invoking ifnames:: Listing the conditionals in source code
+* Invoking autoconf:: How to create configuration scripts
+* Invoking autoreconf:: Remaking multiple @code{configure} scripts
Initialization and Output Files
-* Input:: Where Autoconf should find files.
-* Output:: Creating output files.
-* Makefile Substitutions:: Using output variables in @file{Makefile}s.
-* Configuration Headers:: Creating a configuration header file.
-* Subdirectories:: Configuring independent packages together.
-* Default Prefix:: Changing the default installation prefix.
-* Versions:: Version numbers in @code{configure}.
+* Input:: Where Autoconf should find files
+* Output:: Creating output files
+* Makefile Substitutions:: Using output variables in @file{Makefile}s
+* Configuration Headers:: Creating a configuration header file
+* Subdirectories:: Configuring independent packages together
+* Default Prefix:: Changing the default installation prefix
+* Versions:: Version numbers in @code{configure}
Substitutions in Makefiles
-* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Supporting multiple concurrent compiles.
-* Automatic Remaking:: Makefile rules for configuring.
+* Preset Output Variables:: Output variables that are always set
+* Build Directories:: Supporting multiple concurrent compiles
+* Automatic Remaking:: Makefile rules for configuring
Configuration Header Files
-* Header Templates:: Input for the configuration headers.
-* Invoking autoheader:: How to create configuration templates.
+* Header Templates:: Input for the configuration headers
+* Invoking autoheader:: How to create configuration templates
Existing Tests
-* Alternative Programs:: Selecting between alternative programs.
-* Libraries:: Library archives that might be missing.
-* Library Functions:: C library functions that might be missing.
-* Header Files:: Header files that might be missing.
-* Structures:: Structures or members that might be missing.
-* Typedefs:: @code{typedef}s that might be missing.
-* C Compiler Characteristics::
-* Fortran 77 Compiler Characteristics::
-* System Services:: Operating system services.
-* UNIX Variants:: Special kludges for specific UNIX variants.
+* Alternative Programs:: Selecting between alternative programs
+* Libraries:: Library archives that might be missing
+* Library Functions:: C library functions that might be missing
+* Header Files:: Header files that might be missing
+* Structures:: Structures or members that might be missing
+* Typedefs:: @code{typedef}s that might be missing
+* C Compiler Characteristics::
+* Fortran 77 Compiler Characteristics::
+* System Services:: Operating system services
+* UNIX Variants:: Special kludges for specific UNIX variants
Alternative Programs
-* Particular Programs:: Special handling to find certain programs.
-* Generic Programs:: How to find other programs.
+* Particular Programs:: Special handling to find certain programs
+* Generic Programs:: How to find other programs
Library Functions
-* Particular Functions:: Special handling to find certain functions.
-* Generic Functions:: How to find other functions.
+* Particular Functions:: Special handling to find certain functions
+* Generic Functions:: How to find other functions
Header Files
-* Particular Headers:: Special handling to find certain headers.
-* Generic Headers:: How to find other headers.
+* Particular Headers:: Special handling to find certain headers
+* Generic Headers:: How to find other headers
Structures
-* Particular Structures:: Macros to check for certain stucture members.
-* Generic Structures:: How to find other structure members.
+* Particular Structures:: Macros to check for certain stucture members
+* Generic Structures:: How to find other structure members
Typedefs
-* Particular Typedefs:: Special handling to find certain types.
-* Generic Typedefs:: How to find other types.
+* Particular Typedefs:: Special handling to find certain types
+* Generic Typedefs:: How to find other types
Writing Tests
-* Examining Declarations:: Detecting header files and declarations.
-* Examining Syntax:: Detecting language syntax features.
-* Examining Libraries:: Detecting functions and global variables.
-* Run Time:: Testing for run-time features.
-* Portable Shell:: Shell script portability pitfalls.
-* Testing Values and Files:: Checking strings and files.
-* Multiple Cases:: Tests for several possible values.
-* Language Choice:: Selecting which language to use for testing.
+* Examining Declarations:: Detecting header files and declarations
+* Examining Syntax:: Detecting language syntax features
+* Examining Libraries:: Detecting functions and global variables
+* Run Time:: Testing for run-time features
+* Portable Shell:: Shell script portability pitfalls
+* Testing Values and Files:: Checking strings and files
+* Multiple Cases:: Tests for several possible values
+* Language Choice:: Selecting which language to use for testing
Checking Run Time Behavior
-* Test Programs:: Running test programs.
-* Guidelines:: General rules for writing test programs.
-* Test Functions:: Avoiding pitfalls in test programs.
+* Test Programs:: Running test programs
+* Guidelines:: General rules for writing test programs
+* Test Functions:: Avoiding pitfalls in test programs
Results of Tests
-* Defining Symbols:: Defining C preprocessor symbols.
-* Setting Output Variables:: Replacing variables in output files.
-* Caching Results:: Speeding up subsequent @code{configure} runs.
-* Printing Messages:: Notifying users of progress or problems.
+* Defining Symbols:: Defining C preprocessor symbols
+* Setting Output Variables:: Replacing variables in output files
+* Caching Results:: Speeding up subsequent @code{configure} runs
+* Printing Messages:: Notifying users of progress or problems
Caching Results
-* Cache Variable Names:: Shell variables used in caches.
-* Cache Files:: Files @code{configure} uses for caching.
+* Cache Variable Names:: Shell variables used in caches
+* Cache Files:: Files @code{configure} uses for caching
Writing Macros
-* Macro Definitions:: Basic format of an Autoconf macro.
-* Macro Names:: What to call your new macros.
-* Quoting:: Protecting macros from unwanted expansion.
-* Dependencies Between Macros:: What to do when macros depend on other macros.
+* Macro Definitions:: Basic format of an Autoconf macro
+* Macro Names:: What to call your new macros
+* Quoting:: Protecting macros from unwanted expansion
+* Dependencies Between Macros:: What to do when macros depend on other macros
Dependencies Between Macros
-* Prerequisite Macros:: Ensuring required information.
-* Suggested Ordering:: Warning about possible ordering problems.
-* Obsolete Macros:: Warning about old ways of doing things.
+* Prerequisite Macros:: Ensuring required information
+* Suggested Ordering:: Warning about possible ordering problems
+* Obsolete Macros:: Warning about old ways of doing things
Manual Configuration
-* Specifying Names:: Specifying the system type.
-* Canonicalizing:: Getting the canonical system type.
-* System Type Variables:: Variables containing the system type.
-* Using System Type:: What to do with the system type.
+* Specifying Names:: Specifying the system type
+* Canonicalizing:: Getting the canonical system type
+* System Type Variables:: Variables containing the system type
+* Using System Type:: What to do with the system type
Site Configuration
-* External Software:: Working with other optional software.
-* Package Options:: Selecting optional features.
-* Pretty Help Strings::
-* Site Details:: Configuring site details.
-* Transforming Names:: Changing program names when installing.
-* Site Defaults:: Giving @code{configure} local defaults.
+* External Software:: Working with other optional software
+* Package Options:: Selecting optional features
+* Pretty Help Strings::
+* Site Details:: Configuring site details
+* Transforming Names:: Changing program names when installing
+* Site Defaults:: Giving @code{configure} local defaults
Transforming Program Names When Installing
-* Transformation Options:: @code{configure} options to transform names.
-* Transformation Examples:: Sample uses of transforming names.
-* Transformation Rules:: @file{Makefile} uses of transforming names.
+* Transformation Options:: @code{configure} options to transform names
+* Transformation Examples:: Sample uses of transforming names
+* Transformation Rules:: @file{Makefile} uses of transforming names
Running @code{configure} Scripts
-* Basic Installation:: Instructions for typical cases.
-* Compilers and Options:: Selecting compilers and optimization.
-* Multiple Architectures:: Compiling for multiple architectures at once.
-* Installation Names:: Installing in different directories.
-* Optional Features:: Selecting optional features.
-* System Type:: Specifying the system type.
-* Sharing Defaults:: Setting site-wide defaults for @code{configure}.
-* Operation Controls:: Changing how @code{configure} runs.
+* Basic Installation:: Instructions for typical cases
+* Compilers and Options:: Selecting compilers and optimization
+* Multiple Architectures:: Compiling for multiple architectures at once
+* Installation Names:: Installing in different directories
+* Optional Features:: Selecting optional features
+* System Type:: Specifying the system type
+* Sharing Defaults:: Setting site-wide defaults for @code{configure}
+* Operation Controls:: Changing how @code{configure} runs
Questions About Autoconf
-* Distributing:: Distributing @code{configure} scripts.
+* Distributing:: Distributing @code{configure} scripts
* Why GNU m4:: Why not use the standard @code{m4}?
* Bootstrapping:: Autoconf and GNU @code{m4} require each other?
-* Why Not Imake:: Why GNU uses @code{configure} instead of Imake.
+* Why Not Imake:: Why GNU uses @code{configure} instead of Imake
Upgrading From Version 1
-* Changed File Names:: Files you might rename.
-* Changed Makefiles:: New things to put in @file{Makefile.in}.
-* Changed Macros:: Macro calls you might replace.
-* Invoking autoupdate:: Replacing old macro names in @code{configure.in}.
-* Changed Results:: Changes in how to check test results.
-* Changed Macro Writing:: Better ways to write your own macros.
+* Changed File Names:: Files you might rename
+* Changed Makefiles:: New things to put in @file{Makefile.in}
+* Changed Macros:: Macro calls you might replace
+* Invoking autoupdate:: Replacing old macro names in @code{configure.in}
+* Changed Results:: Changes in how to check test results
+* Changed Macro Writing:: Better ways to write your own macros
History of Autoconf
-* Genesis:: Prehistory and naming of @code{configure}.
-* Exodus:: The plagues of @code{m4} and Perl.
-* Leviticus:: The priestly code of portability arrives.
-* Numbers:: Growth and contributors.
-* Deuteronomy:: Approaching the promises of easy configuration.
+* Genesis:: Prehistory and naming of @code{configure}
+* Exodus:: The plagues of @code{m4} and Perl
+* Leviticus:: The priestly code of portability arrives
+* Numbers:: Growth and contributors
+* Deuteronomy:: Approaching the promises of easy configuration
@end detailmenu
@end menu
@@ -297,7 +313,7 @@ History of Autoconf
@node Introduction, Making configure Scripts, Top, Top
@chapter Introduction
-@display
+@flushright
A physicist, an engineer, and a computer scientist were
discussing the nature of God. Surely a Physicist, said the
physicist, because early in the Creation, God made Light; and you
@@ -310,7 +326,7 @@ liquids@dots{} The computer scientist shouted: And the Chaos,
where do you think it was coming from, hmm?
---Anonymous
-@end display
+@end flushright
@c (via Franc,ois Pinard)
Autoconf is a tool for producing shell scripts that automatically
@@ -449,11 +465,11 @@ Makefile.in ---' `-> Makefile ---'
@end example
@menu
-* Writing configure.in:: What to put in an Autoconf input file.
-* Invoking autoscan:: Semi-automatic @file{configure.in} writing.
-* Invoking ifnames:: Listing the conditionals in source code.
-* Invoking autoconf:: How to create configuration scripts.
-* Invoking autoreconf:: Remaking multiple @code{configure} scripts.
+* Writing configure.in:: What to put in an Autoconf input file
+* Invoking autoscan:: Semi-automatic @file{configure.in} writing
+* Invoking ifnames:: Listing the conditionals in source code
+* Invoking autoconf:: How to create configuration scripts
+* Invoking autoreconf:: Remaking multiple @code{configure} scripts
@end menu
@node Writing configure.in, Invoking autoscan, Making configure Scripts, Making configure Scripts
@@ -755,13 +771,13 @@ about the output files to produce. The following sections describe
initialization and creating output files.
@menu
-* Input:: Where Autoconf should find files.
-* Output:: Creating output files.
-* Makefile Substitutions:: Using output variables in @file{Makefile}s.
-* Configuration Headers:: Creating a configuration header file.
-* Subdirectories:: Configuring independent packages together.
-* Default Prefix:: Changing the default installation prefix.
-* Versions:: Version numbers in @code{configure}.
+* Input:: Where Autoconf should find files
+* Output:: Creating output files
+* Makefile Substitutions:: Using output variables in @file{Makefile}s
+* Configuration Headers:: Creating a configuration header file
+* Subdirectories:: Configuring independent packages together
+* Default Prefix:: Changing the default installation prefix
+* Versions:: Version numbers in @code{configure}
@end menu
@node Input, Output, Setup, Setup
@@ -918,9 +934,9 @@ GNU Coding Standards}, for more information on what to put in
@file{Makefile}s.
@menu
-* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Supporting multiple concurrent compiles.
-* Automatic Remaking:: Makefile rules for configuring.
+* Preset Output Variables:: Output variables that are always set
+* Build Directories:: Supporting multiple concurrent compiles
+* Automatic Remaking:: Makefile rules for configuring
@end menu
@node Preset Output Variables, Build Directories, Makefile Substitutions, Makefile Substitutions
@@ -1242,8 +1258,8 @@ to prepend and/or append boilerplate to the file.
@end defmac
@menu
-* Header Templates:: Input for the configuration headers.
-* Invoking autoheader:: How to create configuration templates.
+* Header Templates:: Input for the configuration headers
+* Invoking autoheader:: How to create configuration templates
@end menu
@node Header Templates, Invoking autoheader, Configuration Headers, Configuration Headers
@@ -1497,16 +1513,16 @@ preprocessor symbol @var{name} to the value 1''. @xref{Defining
Symbols}, for how to get those symbol definitions into your program.
@menu
-* Alternative Programs:: Selecting between alternative programs.
-* Libraries:: Library archives that might be missing.
-* Library Functions:: C library functions that might be missing.
-* Header Files:: Header files that might be missing.
-* Structures:: Structures or members that might be missing.
-* Typedefs:: @code{typedef}s that might be missing.
-* C Compiler Characteristics::
-* Fortran 77 Compiler Characteristics::
-* System Services:: Operating system services.
-* UNIX Variants:: Special kludges for specific UNIX variants.
+* Alternative Programs:: Selecting between alternative programs
+* Libraries:: Library archives that might be missing
+* Library Functions:: C library functions that might be missing
+* Header Files:: Header files that might be missing
+* Structures:: Structures or members that might be missing
+* Typedefs:: @code{typedef}s that might be missing
+* C Compiler Characteristics::
+* Fortran 77 Compiler Characteristics::
+* System Services:: Operating system services
+* UNIX Variants:: Special kludges for specific UNIX variants
@end menu
@node Alternative Programs, Libraries, Existing Tests, Existing Tests
@@ -1520,8 +1536,8 @@ and you don't need to check for any special properties of
it, then you can use one of the general program check macros.
@menu
-* Particular Programs:: Special handling to find certain programs.
-* Generic Programs:: How to find other programs.
+* Particular Programs:: Special handling to find certain programs
+* Generic Programs:: How to find other programs
@end menu
@node Particular Programs, Generic Programs, Alternative Programs, Alternative Programs
@@ -1945,8 +1961,8 @@ and you don't need to check for any special properties of
it, then you can use one of the general function check macros.
@menu
-* Particular Functions:: Special handling to find certain functions.
-* Generic Functions:: How to find other functions.
+* Particular Functions:: Special handling to find certain functions
+* Generic Functions:: How to find other functions
@end menu
@node Particular Functions, Generic Functions, Library Functions, Library Functions
@@ -2250,8 +2266,8 @@ and you don't need to check for any special properties of
it, then you can use one of the general header file check macros.
@menu
-* Particular Headers:: Special handling to find certain headers.
-* Generic Headers:: How to find other headers.
+* Particular Headers:: Special handling to find certain headers
+* Generic Headers:: How to find other headers
@end menu
@node Particular Headers, Generic Headers, Header Files, Header Files
@@ -2536,8 +2552,8 @@ member you need, then you can use the general structure member macro
@code{AC_TRY_COMPILE} (@pxref{Examining Syntax}).
@menu
-* Particular Structures:: Macros to check for certain stucture members.
-* Generic Structures:: How to find other structure members.
+* Particular Structures:: Macros to check for certain stucture members
+* Generic Structures:: How to find other structure members
@end menu
@node Particular Structures, Generic Structures, Structures, Structures
@@ -2652,8 +2668,8 @@ to check for any special properties of it, then you can use a general
typedef check macro.
@menu
-* Particular Typedefs:: Special handling to find certain types.
-* Generic Typedefs:: How to find other types.
+* Particular Typedefs:: Special handling to find certain types
+* Generic Typedefs:: How to find other types
@end menu
@node Particular Typedefs, Generic Typedefs, Typedefs, Typedefs
@@ -3185,14 +3201,14 @@ software package, the best thing to do is encapsulate it in a new macro.
@xref{Writing Macros}, for how to do that.
@menu
-* Examining Declarations:: Detecting header files and declarations.
-* Examining Syntax:: Detecting language syntax features.
-* Examining Libraries:: Detecting functions and global variables.
-* Run Time:: Testing for run-time features.
-* Portable Shell:: Shell script portability pitfalls.
-* Testing Values and Files:: Checking strings and files.
-* Multiple Cases:: Tests for several possible values.
-* Language Choice:: Selecting which language to use for testing.
+* Examining Declarations:: Detecting header files and declarations
+* Examining Syntax:: Detecting language syntax features
+* Examining Libraries:: Detecting functions and global variables
+* Run Time:: Testing for run-time features
+* Portable Shell:: Shell script portability pitfalls
+* Testing Values and Files:: Checking strings and files
+* Multiple Cases:: Tests for several possible values
+* Language Choice:: Selecting which language to use for testing
@end menu
@node Examining Declarations, Examining Syntax, Writing Tests, Writing Tests
@@ -3368,9 +3384,9 @@ possible, because using them prevents people from configuring your
package for cross-compiling.
@menu
-* Test Programs:: Running test programs.
-* Guidelines:: General rules for writing test programs.
-* Test Functions:: Avoiding pitfalls in test programs.
+* Test Programs:: Running test programs
+* Guidelines:: General rules for writing test programs
+* Test Functions:: Avoiding pitfalls in test programs
@end menu
@node Test Programs, Guidelines, Run Time, Run Time
@@ -3673,10 +3689,10 @@ save the result in a cache file for future @code{configure} runs, and
print a message letting the user know the result of the test.
@menu
-* Defining Symbols:: Defining C preprocessor symbols.
-* Setting Output Variables:: Replacing variables in output files.
-* Caching Results:: Speeding up subsequent @code{configure} runs.
-* Printing Messages:: Notifying users of progress or problems.
+* Defining Symbols:: Defining C preprocessor symbols
+* Setting Output Variables:: Replacing variables in output files
+* Caching Results:: Speeding up subsequent @code{configure} runs
+* Printing Messages:: Notifying users of progress or problems
@end menu
@node Defining Symbols, Setting Output Variables, Results, Results
@@ -3874,8 +3890,8 @@ checkpoints the cache in case of an early configure script abort.
@end defmac
@menu
-* Cache Variable Names:: Shell variables used in caches.
-* Cache Files:: Files @code{configure} uses for caching.
+* Cache Variable Names:: Shell variables used in caches
+* Cache Files:: Files @code{configure} uses for caching
@end menu
@node Cache Variable Names, Cache Files, Caching Results, Caching Results
@@ -4087,10 +4103,10 @@ software package, the best thing to do is encapsulate it in a new macro.
Here are some instructions and guidelines for writing Autoconf macros.
@menu
-* Macro Definitions:: Basic format of an Autoconf macro.
-* Macro Names:: What to call your new macros.
-* Quoting:: Protecting macros from unwanted expansion.
-* Dependencies Between Macros:: What to do when macros depend on other macros.
+* Macro Definitions:: Basic format of an Autoconf macro
+* Macro Names:: What to call your new macros
+* Quoting:: Protecting macros from unwanted expansion
+* Dependencies Between Macros:: What to do when macros depend on other macros
@end menu
@node Macro Definitions, Macro Names, Writing Macros, Writing Macros
@@ -4238,9 +4254,9 @@ macros are called if needed and a way to warn the user if macros are
called in an order that might cause incorrect operation.
@menu
-* Prerequisite Macros:: Ensuring required information.
-* Suggested Ordering:: Warning about possible ordering problems.
-* Obsolete Macros:: Warning about old ways of doing things.
+* Prerequisite Macros:: Ensuring required information
+* Suggested Ordering:: Warning about possible ordering problems
+* Obsolete Macros:: Warning about old ways of doing things
@end menu
@node Prerequisite Macros, Suggested Ordering, Dependencies Between Macros, Dependencies Between Macros
@@ -4357,10 +4373,10 @@ looking for libraries that are unique to particular systems. However,
Autoconf provides a uniform method for handling unguessable features.
@menu
-* Specifying Names:: Specifying the system type.
-* Canonicalizing:: Getting the canonical system type.
-* System Type Variables:: Variables containing the system type.
-* Using System Type:: What to do with the system type.
+* Specifying Names:: Specifying the system type
+* Canonicalizing:: Getting the canonical system type
+* System Type Variables:: Variables containing the system type
+* Using System Type:: What to do with the system type
@end menu
@node Specifying Names, Canonicalizing, Manual Configuration, Manual Configuration
@@ -4538,12 +4554,12 @@ under modified names, and set default values for @code{configure}
options.
@menu
-* External Software:: Working with other optional software.
-* Package Options:: Selecting optional features.
-* Pretty Help Strings::
-* Site Details:: Configuring site details.
-* Transforming Names:: Changing program names when installing.
-* Site Defaults:: Giving @code{configure} local defaults.
+* External Software:: Working with other optional software
+* Package Options:: Selecting optional features
+* Pretty Help Strings:: Formating help string
+* Site Details:: Configuring site details
+* Transforming Names:: Changing program names when installing
+* Site Defaults:: Giving @code{configure} local defaults
@end menu
@node External Software, Package Options, Site Configuration, Site Configuration
@@ -4613,10 +4629,8 @@ needed. Just make sure the columns line up in @samp{configure --help}.
Avoid tabs in the help string. You'll need to enclose it in @samp{[}
and @samp{]} in order to produce the leading spaces.
-If you find yourself using @code{AC_ARG_WITH} more than once (or you
-just like to have your @var{help-string}s look pretty), then you should
-first format your @var{help-string} with the macro @code{AC_HELP_STRING}
-(@pxref{Pretty Help Strings}).
+You should format your @var{help-string} with the macro
+@code{AC_HELP_STRING} (@pxref{Pretty Help Strings}).
@end defmac
@defmac AC_WITH (@var{package}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@@ -4681,10 +4695,8 @@ actually just the value of the shell variable
@var{help-string} argument is like that of @code{AC_ARG_WITH}
(@pxref{External Software}).
-If you find yourself using @code{AC_ARG_ENABLE} more than once (or you
-just like to have your @var{help-string}s look pretty), then you should
-first format your @var{help-string} with the macro @code{AC_HELP_STRING}
-(@pxref{Pretty Help Strings}).
+You should format your @var{help-string} with the macro
+@code{AC_HELP_STRING} (@pxref{Pretty Help Strings}).
@end defmac
@defmac AC_ENABLE (@var{feature}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@@ -4704,28 +4716,27 @@ your own @samp{help strings} to line up in the appropriate columns of
@samp{configure --help} just like the standard Autoconf @samp{help
strings} do. This is the purpose of the @code{AC_HELP_STRING} macro.
-@defmac AC_HELP_STRING (@var{left-hand-side}, @var{right-hand-side}, @var{formatted-help-string})
+@defmac AC_HELP_STRING (@var{left-hand-side}, @var{right-hand-side})
@maindex HELP_STRING
-Format an Autoconf macro's help string so that it looks pretty when the
-user executes @samp{configure --help}. The formatted help string is
-assigned to the third argument, @var{formatted-help-string}, which can
-then be used in @code{AC_ARG_WITH} (@pxref{External Software}) or
-@code{AC_ARG_ENABLE} (@pxref{Package Options}). The following example
-will make this clearer.
+Expands into an help string that looks pretty when the user executes
+@samp{configure --help}. It is typically used in @code{AC_ARG_WITH}
+(@pxref{External Software}) or @code{AC_ARG_ENABLE} (@pxref{Package
+Options}). The following example will make this clearer.
@example
AC_DEFUN(TEST_MACRO,
[
- AC_HELP_STRING([--with-foo], [use foo (default is NO)], foo_help_string)
- AC_ARG_WITH(foo, $foo_help_string, ac_cv_use_foo=$withval, ac_cv_use_foo=no)
-
+ AC_ARG_WITH(foo,
+ AC_HELP_STRING([--with-foo], [use foo (default is NO)],
+ ac_cv_use_foo=$withval, ac_cv_use_foo=no)
AC_CACHE_CHECK(whether to use foo, ac_cv_use_foo, ac_cv_use_foo=no)
])
@end example
-This will cause the last few lines of @samp{configure --help} to appear
-like this:
+Please note that the call to @code{AC_HELP_STRING} is @strong{unquoted}.
+Then the last few lines of @samp{configure --help} will appear like
+this:
@example
Features and packages:
@@ -4739,10 +4750,6 @@ Features and packages:
--with-foo use foo (default is NO)
@end example
-Notice how @samp{--with-foo} is properly prefixed with two spaces, and
-@samp{use foo (default is NO)} begins in column 26 with the rest of the
-Autoconf help strings.
-
The @code{AC_HELP_STRING} macro is particularly helpful when the
@var{left-hand-side} and/or @var{right-hand-side} are composed of macro
arguments, as shown in the following example.
@@ -4750,8 +4757,9 @@ arguments, as shown in the following example.
@example
AC_DEFUN(MY_ARG_WITH,
[
- AC_HELP_STRING([--with-$1], [use $1 (default is $2)], $1_help_string)
- AC_ARG_WITH($1, [$]$1_help_string, ac_cv_use_$1=$withval, ac_cv_use_$1=no)
+ AC_ARG_WITH($1,
+ AC_HELP_STRING([--with-$1], [use $1 (default is $2)]),
+ ac_cv_use_$1=$withval, ac_cv_use_$1=no)
AC_CACHE_CHECK(whether to use $1, ac_cv_use_$1, ac_cv_use_$1=$2)
])
@@ -4802,9 +4810,9 @@ is used as a prefix. Otherwise, no program name transformation is done.
@end defmac
@menu
-* Transformation Options:: @code{configure} options to transform names.
-* Transformation Examples:: Sample uses of transforming names.
-* Transformation Rules:: @file{Makefile} uses of transforming names.
+* Transformation Options:: @code{configure} options to transform names
+* Transformation Examples:: Sample uses of transforming names
+* Transformation Rules:: @file{Makefile} uses of transforming names
@end menu
@node Transformation Options, Transformation Examples, Transforming Names, Transforming Names
@@ -4988,14 +4996,14 @@ file in the package. A plain-text version of @file{INSTALL} which you
may use comes with Autoconf.
@menu
-* Basic Installation:: Instructions for typical cases.
-* Compilers and Options:: Selecting compilers and optimization.
-* Multiple Architectures:: Compiling for multiple architectures at once.
-* Installation Names:: Installing in different directories.
-* Optional Features:: Selecting optional features.
-* System Type:: Specifying the system type.
-* Sharing Defaults:: Setting site-wide defaults for @code{configure}.
-* Operation Controls:: Changing how @code{configure} runs.
+* Basic Installation:: Instructions for typical cases
+* Compilers and Options:: Selecting compilers and optimization
+* Multiple Architectures:: Compiling for multiple architectures at once
+* Installation Names:: Installing in different directories
+* Optional Features:: Selecting optional features
+* System Type:: Specifying the system type
+* Sharing Defaults:: Setting site-wide defaults for @code{configure}
+* Operation Controls:: Changing how @code{configure} runs
@end menu
@include install.texi
@@ -5008,22 +5016,28 @@ which describes which configuration options were specified when the
package was last configured. This file is a shell script which,
if run, will recreate the same configuration.
-You can give @file{config.status} the @samp{--recheck} option to update
-itself. This option is useful if you change @code{configure}, so that
-the results of some tests might be different from the previous run. The
-@samp{--recheck} option re-runs @code{configure} with the same arguments
-you used before, plus the @samp{--no-create} option, which prevent
-@code{configure} from running @file{config.status} and creating
-@file{Makefile} and other files, and the @samp{--no-recursion} option,
-which prevents @code{configure} from running other @code{configure}
-scripts in subdirectories. (This is so other @file{Makefile} rules can
-run @file{config.status} when it changes; @pxref{Automatic Remaking},
-for an example).
-
-@file{config.status} also accepts the options @samp{--help}, which
-prints a summary of the options to @file{config.status}, and
-@samp{--version}, which prints the version of Autoconf used to create
-the @code{configure} script that generated @file{config.status}.
+It supports the following options:
+@table @code
+@item --recheck
+Ask @file{config.status} to update itself. This option is useful if you
+change @code{configure}, so that the results of some tests might be
+different from the previous run. The @samp{--recheck} option re-runs
+@code{configure} with the same arguments you used before, plus the
+@samp{--no-create} option, which prevent @code{configure} from running
+@file{config.status} and creating @file{Makefile} and other files, and
+the @samp{--no-recursion} option, which prevents @code{configure} from
+running other @code{configure} scripts in subdirectories. (This is so
+other @file{Makefile} rules can run @file{config.status} when it
+changes; @pxref{Automatic Remaking}, for an example).
+
+@item --help
+@itemx -h
+Print a summary of the command line options and exit.
+
+@item --version
+Print the version number of Autoconf used to create the @code{configure}
+script that generated @file{config.status} and exit.
+@end table
@file{config.status} checks several optional environment variables that
can alter its behavior:
@@ -5091,10 +5105,10 @@ Several questions about Autoconf come up occasionally. Here some of them
are addressed.
@menu
-* Distributing:: Distributing @code{configure} scripts.
+* Distributing:: Distributing @code{configure} scripts
* Why GNU m4:: Why not use the standard @code{m4}?
* Bootstrapping:: Autoconf and GNU @code{m4} require each other?
-* Why Not Imake:: Why GNU uses @code{configure} instead of Imake.
+* Why Not Imake:: Why GNU uses @code{configure} instead of Imake
@end menu
@node Distributing, Why GNU m4, Questions, Questions
@@ -5277,12 +5291,12 @@ much faster than earlier versions, because as of version 1.3, GNU
freeze its internal state in a file that it can read back quickly.
@menu
-* Changed File Names:: Files you might rename.
-* Changed Makefiles:: New things to put in @file{Makefile.in}.
-* Changed Macros:: Macro calls you might replace.
-* Invoking autoupdate:: Replacing old macro names in @code{configure.in}.
-* Changed Results:: Changes in how to check test results.
-* Changed Macro Writing:: Better ways to write your own macros.
+* Changed File Names:: Files you might rename
+* Changed Makefiles:: New things to put in @file{Makefile.in}
+* Changed Macros:: Macro calls you might replace
+* Invoking autoupdate:: Replacing old macro names in @code{configure.in}
+* Changed Results:: Changes in how to check test results
+* Changed Macro Writing:: Better ways to write your own macros
@end menu
@node Changed File Names, Changed Makefiles, Upgrading, Upgrading
@@ -5496,11 +5510,11 @@ to you, and you might as well skip it. If you @emph{are} wondering,
then let there be light@dots{}
@menu
-* Genesis:: Prehistory and naming of @code{configure}.
-* Exodus:: The plagues of @code{m4} and Perl.
-* Leviticus:: The priestly code of portability arrives.
-* Numbers:: Growth and contributors.
-* Deuteronomy:: Approaching the promises of easy configuration.
+* Genesis:: Prehistory and naming of @code{configure}
+* Exodus:: The plagues of @code{m4} and Perl
+* Leviticus:: The priestly code of portability arrives
+* Numbers:: Growth and contributors
+* Deuteronomy:: Approaching the promises of easy configuration
@end menu
@node Genesis, Exodus, History, History
diff --git a/configure b/configure
index a295a8e8..291d7704 100755
--- a/configure
+++ b/configure
@@ -825,7 +825,7 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
# If the first sed substitution is executed (which looks for macros that
# take arguments), then we branch to the cleanup section. Otherwise,
# look for a macro that doesn't take arguments.
-cat > conftest.defs <<\EOF
+cat > $conftest.defs <<\EOF
s%^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)%-D\1=\2%g
t cleanup
s%^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)%-D\1=\2%g
@@ -835,8 +835,8 @@ s%\[%\\&%g
s%\]%\\&%g
s%\$%$$%g
EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
+DEFS=`sed -f $conftest.defs confdefs.h | tr '\012' ' '`
+rm -f $conftest.defs
# Without the "./", some shells look in PATH for config.status.
@@ -856,7 +856,28 @@ cat > $CONFIG_STATUS <<EOF
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+ac_cs_usage="\
+Usage: $CONFIG_STATUS @BKL@OPTIONS@BKR@
+Configure files from templates according to the current configuration.
+
+ --recheck Update $CONFIG_STATUS by reconfiguring in the same conditions
+ --version Print the version of Autoconf and exit
+ --help Display this help and exit
+
+By default the following files will updated.
+ Configuration files:
+ Makefile testsuite/Makefile
+
+In order to configure a list a specified FILES and HEADERS, run
+ CONFIG_FILES=FILES CONFIG_HEADERS=HEADERS $CONFIG_STATUS
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+ac_cs_version="\
+$CONFIG_STATUS generated by autoconf version 2.14.1.
+Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by running
+ $0 $ac_configure_args"
+
for ac_option
do
case "\$ac_option" in
@@ -864,8 +885,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.14.1"
- exit 0 ;;
+ echo "\$ac_cs_version"; exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
*) echo "\$ac_cs_usage"; exit 1 ;;
@@ -874,14 +894,17 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
+# Allow concurrent executions
+conftest=cft\$\$
-trap 'rm -fr `echo "Makefile testsuite/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+: \${CONFIG_FILES="Makefile
+testsuite/Makefile"}
+rm -fr \`echo "\$CONFIG_FILES " | sed "s/:@BKL@^ @BKR@*//g"\`
+trap 'rm -fr \$conftest*; exit 1' 1 2 15
# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > \$conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
@@ -932,18 +955,18 @@ ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "1,${ac_beg}d; ${ac_end}q" $conftest.subs > $conftest.s$ac_file
else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "${ac_end}q" $conftest.subs > $conftest.s$ac_file
fi
- if test ! -s conftest.s$ac_file; then
+ if test ! -s $conftest.s$ac_file; then
ac_more_lines=false
- rm -f conftest.s$ac_file
+ rm -f $conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
+ ac_sed_cmds="sed -f $conftest.s$ac_file"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
@@ -955,10 +978,6 @@ if test -z "$ac_sed_cmds"; then
fi
EOF
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile testsuite/Makefile"}
-EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
@@ -1006,15 +1025,18 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
*) ac_comsub= ;;
esac
+# Don't redirect the output to AC_FILE directly: use `mv' so that updating
+# is atomic, and doesn't need trapping.
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $conftest.out
+ mv $conftest.out $ac_file
fi; done
-rm -f conftest.s*
+rm -f $conftest.s*
EOF
cat >> $CONFIG_STATUS <<EOF
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index fcbb799d..6609c4f0 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -14,13 +14,28 @@
@finalout
@end iftex
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Autoconf: (autoconf). Create source code configuration scripts.
-END-INFO-DIR-ENTRY
-@end format
+@dircategory GNU admin
+@direntry
+* Autoconf: (autoconf). Create source code configuration scripts
+@end direntry
+
+@dircategory Individual utilities
+@direntry
+* autoscan: (autoconf)Invoking autoscan.
+ Semi-automatic @file{configure.in} writing
+* ifnames: (autoconf)Invoking ifnames.
+ Listing the conditionals in source code
+* autoconf: (autoconf)Invoking autoconf.
+ How to create configuration scripts
+* autoreconf: (autoconf)Invoking autoreconf.
+ Remaking multiple @code{configure} scripts
+* configure: (autoconf)Invoking aclocal.
+ How to use the Autoconf output
+* config.status: (autoconf)Invoking config.status.
+ Recreating a configuration
+@end direntry
+@ifinfo
Autoconf: Creating Automatic Configuration Scripts, by David MacKenzie.
This file documents the GNU Autoconf package for creating scripts to
@@ -95,201 +110,202 @@ by the Foundation.
@ifinfo
This file documents the GNU Autoconf package for creating scripts to
configure source code packages using templates and an @code{m4} macro
-package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}.
+package. This is edition @value{EDITION}, for Autoconf version
+@value{VERSION}.
@end ifinfo
@c The master menu, created with texinfo-master-menu, goes here.
@menu
-* Introduction:: Autoconf's purpose, strengths, and weaknesses.
-* Making configure Scripts:: How to organize and produce Autoconf scripts.
-* Setup:: Initialization and output.
-* Existing Tests:: Macros that check for particular features.
-* Writing Tests:: How to write new feature checks.
-* Results:: What to do with results from feature checks.
-* Writing Macros:: Adding new macros to Autoconf.
-* Manual Configuration:: Selecting features that can't be guessed.
-* Site Configuration:: Local defaults for @code{configure}.
-* Invoking configure:: How to use the Autoconf output.
-* Invoking config.status:: Recreating a configuration.
-* Questions:: Questions about Autoconf, with answers.
-* Upgrading:: Tips for upgrading from version 1.
-* History:: History of Autoconf.
-* Old Macro Names:: Backward compatibility macros.
-* Environment Variable Index:: Index of environment variables used.
-* Output Variable Index:: Index of variables set in output files.
-* Preprocessor Symbol Index:: Index of C preprocessor symbols defined.
-* Macro Index:: Index of Autoconf macros.
+* Introduction:: Autoconf's purpose, strengths, and weaknesses
+* Making configure Scripts:: How to organize and produce Autoconf scripts
+* Setup:: Initialization and output
+* Existing Tests:: Macros that check for particular features
+* Writing Tests:: How to write new feature checks
+* Results:: What to do with results from feature checks
+* Writing Macros:: Adding new macros to Autoconf
+* Manual Configuration:: Selecting features that can't be guessed
+* Site Configuration:: Local defaults for @code{configure}
+* Invoking configure:: How to use the Autoconf output
+* Invoking config.status:: Recreating a configuration
+* Questions:: Questions about Autoconf, with answers
+* Upgrading:: Tips for upgrading from version 1
+* History:: History of Autoconf
+* Old Macro Names:: Backward compatibility macros
+* Environment Variable Index:: Index of environment variables used
+* Output Variable Index:: Index of variables set in output files
+* Preprocessor Symbol Index:: Index of C preprocessor symbols defined
+* Macro Index:: Index of Autoconf macros
@detailmenu
--- The Detailed Node Listing ---
Making @code{configure} Scripts
-* Writing configure.in:: What to put in an Autoconf input file.
-* Invoking autoscan:: Semi-automatic @file{configure.in} writing.
-* Invoking ifnames:: Listing the conditionals in source code.
-* Invoking autoconf:: How to create configuration scripts.
-* Invoking autoreconf:: Remaking multiple @code{configure} scripts.
+* Writing configure.in:: What to put in an Autoconf input file
+* Invoking autoscan:: Semi-automatic @file{configure.in} writing
+* Invoking ifnames:: Listing the conditionals in source code
+* Invoking autoconf:: How to create configuration scripts
+* Invoking autoreconf:: Remaking multiple @code{configure} scripts
Initialization and Output Files
-* Input:: Where Autoconf should find files.
-* Output:: Creating output files.
-* Makefile Substitutions:: Using output variables in @file{Makefile}s.
-* Configuration Headers:: Creating a configuration header file.
-* Subdirectories:: Configuring independent packages together.
-* Default Prefix:: Changing the default installation prefix.
-* Versions:: Version numbers in @code{configure}.
+* Input:: Where Autoconf should find files
+* Output:: Creating output files
+* Makefile Substitutions:: Using output variables in @file{Makefile}s
+* Configuration Headers:: Creating a configuration header file
+* Subdirectories:: Configuring independent packages together
+* Default Prefix:: Changing the default installation prefix
+* Versions:: Version numbers in @code{configure}
Substitutions in Makefiles
-* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Supporting multiple concurrent compiles.
-* Automatic Remaking:: Makefile rules for configuring.
+* Preset Output Variables:: Output variables that are always set
+* Build Directories:: Supporting multiple concurrent compiles
+* Automatic Remaking:: Makefile rules for configuring
Configuration Header Files
-* Header Templates:: Input for the configuration headers.
-* Invoking autoheader:: How to create configuration templates.
+* Header Templates:: Input for the configuration headers
+* Invoking autoheader:: How to create configuration templates
Existing Tests
-* Alternative Programs:: Selecting between alternative programs.
-* Libraries:: Library archives that might be missing.
-* Library Functions:: C library functions that might be missing.
-* Header Files:: Header files that might be missing.
-* Structures:: Structures or members that might be missing.
-* Typedefs:: @code{typedef}s that might be missing.
-* C Compiler Characteristics::
-* Fortran 77 Compiler Characteristics::
-* System Services:: Operating system services.
-* UNIX Variants:: Special kludges for specific UNIX variants.
+* Alternative Programs:: Selecting between alternative programs
+* Libraries:: Library archives that might be missing
+* Library Functions:: C library functions that might be missing
+* Header Files:: Header files that might be missing
+* Structures:: Structures or members that might be missing
+* Typedefs:: @code{typedef}s that might be missing
+* C Compiler Characteristics::
+* Fortran 77 Compiler Characteristics::
+* System Services:: Operating system services
+* UNIX Variants:: Special kludges for specific UNIX variants
Alternative Programs
-* Particular Programs:: Special handling to find certain programs.
-* Generic Programs:: How to find other programs.
+* Particular Programs:: Special handling to find certain programs
+* Generic Programs:: How to find other programs
Library Functions
-* Particular Functions:: Special handling to find certain functions.
-* Generic Functions:: How to find other functions.
+* Particular Functions:: Special handling to find certain functions
+* Generic Functions:: How to find other functions
Header Files
-* Particular Headers:: Special handling to find certain headers.
-* Generic Headers:: How to find other headers.
+* Particular Headers:: Special handling to find certain headers
+* Generic Headers:: How to find other headers
Structures
-* Particular Structures:: Macros to check for certain stucture members.
-* Generic Structures:: How to find other structure members.
+* Particular Structures:: Macros to check for certain stucture members
+* Generic Structures:: How to find other structure members
Typedefs
-* Particular Typedefs:: Special handling to find certain types.
-* Generic Typedefs:: How to find other types.
+* Particular Typedefs:: Special handling to find certain types
+* Generic Typedefs:: How to find other types
Writing Tests
-* Examining Declarations:: Detecting header files and declarations.
-* Examining Syntax:: Detecting language syntax features.
-* Examining Libraries:: Detecting functions and global variables.
-* Run Time:: Testing for run-time features.
-* Portable Shell:: Shell script portability pitfalls.
-* Testing Values and Files:: Checking strings and files.
-* Multiple Cases:: Tests for several possible values.
-* Language Choice:: Selecting which language to use for testing.
+* Examining Declarations:: Detecting header files and declarations
+* Examining Syntax:: Detecting language syntax features
+* Examining Libraries:: Detecting functions and global variables
+* Run Time:: Testing for run-time features
+* Portable Shell:: Shell script portability pitfalls
+* Testing Values and Files:: Checking strings and files
+* Multiple Cases:: Tests for several possible values
+* Language Choice:: Selecting which language to use for testing
Checking Run Time Behavior
-* Test Programs:: Running test programs.
-* Guidelines:: General rules for writing test programs.
-* Test Functions:: Avoiding pitfalls in test programs.
+* Test Programs:: Running test programs
+* Guidelines:: General rules for writing test programs
+* Test Functions:: Avoiding pitfalls in test programs
Results of Tests
-* Defining Symbols:: Defining C preprocessor symbols.
-* Setting Output Variables:: Replacing variables in output files.
-* Caching Results:: Speeding up subsequent @code{configure} runs.
-* Printing Messages:: Notifying users of progress or problems.
+* Defining Symbols:: Defining C preprocessor symbols
+* Setting Output Variables:: Replacing variables in output files
+* Caching Results:: Speeding up subsequent @code{configure} runs
+* Printing Messages:: Notifying users of progress or problems
Caching Results
-* Cache Variable Names:: Shell variables used in caches.
-* Cache Files:: Files @code{configure} uses for caching.
+* Cache Variable Names:: Shell variables used in caches
+* Cache Files:: Files @code{configure} uses for caching
Writing Macros
-* Macro Definitions:: Basic format of an Autoconf macro.
-* Macro Names:: What to call your new macros.
-* Quoting:: Protecting macros from unwanted expansion.
-* Dependencies Between Macros:: What to do when macros depend on other macros.
+* Macro Definitions:: Basic format of an Autoconf macro
+* Macro Names:: What to call your new macros
+* Quoting:: Protecting macros from unwanted expansion
+* Dependencies Between Macros:: What to do when macros depend on other macros
Dependencies Between Macros
-* Prerequisite Macros:: Ensuring required information.
-* Suggested Ordering:: Warning about possible ordering problems.
-* Obsolete Macros:: Warning about old ways of doing things.
+* Prerequisite Macros:: Ensuring required information
+* Suggested Ordering:: Warning about possible ordering problems
+* Obsolete Macros:: Warning about old ways of doing things
Manual Configuration
-* Specifying Names:: Specifying the system type.
-* Canonicalizing:: Getting the canonical system type.
-* System Type Variables:: Variables containing the system type.
-* Using System Type:: What to do with the system type.
+* Specifying Names:: Specifying the system type
+* Canonicalizing:: Getting the canonical system type
+* System Type Variables:: Variables containing the system type
+* Using System Type:: What to do with the system type
Site Configuration
-* External Software:: Working with other optional software.
-* Package Options:: Selecting optional features.
-* Pretty Help Strings::
-* Site Details:: Configuring site details.
-* Transforming Names:: Changing program names when installing.
-* Site Defaults:: Giving @code{configure} local defaults.
+* External Software:: Working with other optional software
+* Package Options:: Selecting optional features
+* Pretty Help Strings::
+* Site Details:: Configuring site details
+* Transforming Names:: Changing program names when installing
+* Site Defaults:: Giving @code{configure} local defaults
Transforming Program Names When Installing
-* Transformation Options:: @code{configure} options to transform names.
-* Transformation Examples:: Sample uses of transforming names.
-* Transformation Rules:: @file{Makefile} uses of transforming names.
+* Transformation Options:: @code{configure} options to transform names
+* Transformation Examples:: Sample uses of transforming names
+* Transformation Rules:: @file{Makefile} uses of transforming names
Running @code{configure} Scripts
-* Basic Installation:: Instructions for typical cases.
-* Compilers and Options:: Selecting compilers and optimization.
-* Multiple Architectures:: Compiling for multiple architectures at once.
-* Installation Names:: Installing in different directories.
-* Optional Features:: Selecting optional features.
-* System Type:: Specifying the system type.
-* Sharing Defaults:: Setting site-wide defaults for @code{configure}.
-* Operation Controls:: Changing how @code{configure} runs.
+* Basic Installation:: Instructions for typical cases
+* Compilers and Options:: Selecting compilers and optimization
+* Multiple Architectures:: Compiling for multiple architectures at once
+* Installation Names:: Installing in different directories
+* Optional Features:: Selecting optional features
+* System Type:: Specifying the system type
+* Sharing Defaults:: Setting site-wide defaults for @code{configure}
+* Operation Controls:: Changing how @code{configure} runs
Questions About Autoconf
-* Distributing:: Distributing @code{configure} scripts.
+* Distributing:: Distributing @code{configure} scripts
* Why GNU m4:: Why not use the standard @code{m4}?
* Bootstrapping:: Autoconf and GNU @code{m4} require each other?
-* Why Not Imake:: Why GNU uses @code{configure} instead of Imake.
+* Why Not Imake:: Why GNU uses @code{configure} instead of Imake
Upgrading From Version 1
-* Changed File Names:: Files you might rename.
-* Changed Makefiles:: New things to put in @file{Makefile.in}.
-* Changed Macros:: Macro calls you might replace.
-* Invoking autoupdate:: Replacing old macro names in @code{configure.in}.
-* Changed Results:: Changes in how to check test results.
-* Changed Macro Writing:: Better ways to write your own macros.
+* Changed File Names:: Files you might rename
+* Changed Makefiles:: New things to put in @file{Makefile.in}
+* Changed Macros:: Macro calls you might replace
+* Invoking autoupdate:: Replacing old macro names in @code{configure.in}
+* Changed Results:: Changes in how to check test results
+* Changed Macro Writing:: Better ways to write your own macros
History of Autoconf
-* Genesis:: Prehistory and naming of @code{configure}.
-* Exodus:: The plagues of @code{m4} and Perl.
-* Leviticus:: The priestly code of portability arrives.
-* Numbers:: Growth and contributors.
-* Deuteronomy:: Approaching the promises of easy configuration.
+* Genesis:: Prehistory and naming of @code{configure}
+* Exodus:: The plagues of @code{m4} and Perl
+* Leviticus:: The priestly code of portability arrives
+* Numbers:: Growth and contributors
+* Deuteronomy:: Approaching the promises of easy configuration
@end detailmenu
@end menu
@@ -297,7 +313,7 @@ History of Autoconf
@node Introduction, Making configure Scripts, Top, Top
@chapter Introduction
-@display
+@flushright
A physicist, an engineer, and a computer scientist were
discussing the nature of God. Surely a Physicist, said the
physicist, because early in the Creation, God made Light; and you
@@ -310,7 +326,7 @@ liquids@dots{} The computer scientist shouted: And the Chaos,
where do you think it was coming from, hmm?
---Anonymous
-@end display
+@end flushright
@c (via Franc,ois Pinard)
Autoconf is a tool for producing shell scripts that automatically
@@ -449,11 +465,11 @@ Makefile.in ---' `-> Makefile ---'
@end example
@menu
-* Writing configure.in:: What to put in an Autoconf input file.
-* Invoking autoscan:: Semi-automatic @file{configure.in} writing.
-* Invoking ifnames:: Listing the conditionals in source code.
-* Invoking autoconf:: How to create configuration scripts.
-* Invoking autoreconf:: Remaking multiple @code{configure} scripts.
+* Writing configure.in:: What to put in an Autoconf input file
+* Invoking autoscan:: Semi-automatic @file{configure.in} writing
+* Invoking ifnames:: Listing the conditionals in source code
+* Invoking autoconf:: How to create configuration scripts
+* Invoking autoreconf:: Remaking multiple @code{configure} scripts
@end menu
@node Writing configure.in, Invoking autoscan, Making configure Scripts, Making configure Scripts
@@ -755,13 +771,13 @@ about the output files to produce. The following sections describe
initialization and creating output files.
@menu
-* Input:: Where Autoconf should find files.
-* Output:: Creating output files.
-* Makefile Substitutions:: Using output variables in @file{Makefile}s.
-* Configuration Headers:: Creating a configuration header file.
-* Subdirectories:: Configuring independent packages together.
-* Default Prefix:: Changing the default installation prefix.
-* Versions:: Version numbers in @code{configure}.
+* Input:: Where Autoconf should find files
+* Output:: Creating output files
+* Makefile Substitutions:: Using output variables in @file{Makefile}s
+* Configuration Headers:: Creating a configuration header file
+* Subdirectories:: Configuring independent packages together
+* Default Prefix:: Changing the default installation prefix
+* Versions:: Version numbers in @code{configure}
@end menu
@node Input, Output, Setup, Setup
@@ -918,9 +934,9 @@ GNU Coding Standards}, for more information on what to put in
@file{Makefile}s.
@menu
-* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Supporting multiple concurrent compiles.
-* Automatic Remaking:: Makefile rules for configuring.
+* Preset Output Variables:: Output variables that are always set
+* Build Directories:: Supporting multiple concurrent compiles
+* Automatic Remaking:: Makefile rules for configuring
@end menu
@node Preset Output Variables, Build Directories, Makefile Substitutions, Makefile Substitutions
@@ -1242,8 +1258,8 @@ to prepend and/or append boilerplate to the file.
@end defmac
@menu
-* Header Templates:: Input for the configuration headers.
-* Invoking autoheader:: How to create configuration templates.
+* Header Templates:: Input for the configuration headers
+* Invoking autoheader:: How to create configuration templates
@end menu
@node Header Templates, Invoking autoheader, Configuration Headers, Configuration Headers
@@ -1497,16 +1513,16 @@ preprocessor symbol @var{name} to the value 1''. @xref{Defining
Symbols}, for how to get those symbol definitions into your program.
@menu
-* Alternative Programs:: Selecting between alternative programs.
-* Libraries:: Library archives that might be missing.
-* Library Functions:: C library functions that might be missing.
-* Header Files:: Header files that might be missing.
-* Structures:: Structures or members that might be missing.
-* Typedefs:: @code{typedef}s that might be missing.
-* C Compiler Characteristics::
-* Fortran 77 Compiler Characteristics::
-* System Services:: Operating system services.
-* UNIX Variants:: Special kludges for specific UNIX variants.
+* Alternative Programs:: Selecting between alternative programs
+* Libraries:: Library archives that might be missing
+* Library Functions:: C library functions that might be missing
+* Header Files:: Header files that might be missing
+* Structures:: Structures or members that might be missing
+* Typedefs:: @code{typedef}s that might be missing
+* C Compiler Characteristics::
+* Fortran 77 Compiler Characteristics::
+* System Services:: Operating system services
+* UNIX Variants:: Special kludges for specific UNIX variants
@end menu
@node Alternative Programs, Libraries, Existing Tests, Existing Tests
@@ -1520,8 +1536,8 @@ and you don't need to check for any special properties of
it, then you can use one of the general program check macros.
@menu
-* Particular Programs:: Special handling to find certain programs.
-* Generic Programs:: How to find other programs.
+* Particular Programs:: Special handling to find certain programs
+* Generic Programs:: How to find other programs
@end menu
@node Particular Programs, Generic Programs, Alternative Programs, Alternative Programs
@@ -1945,8 +1961,8 @@ and you don't need to check for any special properties of
it, then you can use one of the general function check macros.
@menu
-* Particular Functions:: Special handling to find certain functions.
-* Generic Functions:: How to find other functions.
+* Particular Functions:: Special handling to find certain functions
+* Generic Functions:: How to find other functions
@end menu
@node Particular Functions, Generic Functions, Library Functions, Library Functions
@@ -2250,8 +2266,8 @@ and you don't need to check for any special properties of
it, then you can use one of the general header file check macros.
@menu
-* Particular Headers:: Special handling to find certain headers.
-* Generic Headers:: How to find other headers.
+* Particular Headers:: Special handling to find certain headers
+* Generic Headers:: How to find other headers
@end menu
@node Particular Headers, Generic Headers, Header Files, Header Files
@@ -2536,8 +2552,8 @@ member you need, then you can use the general structure member macro
@code{AC_TRY_COMPILE} (@pxref{Examining Syntax}).
@menu
-* Particular Structures:: Macros to check for certain stucture members.
-* Generic Structures:: How to find other structure members.
+* Particular Structures:: Macros to check for certain stucture members
+* Generic Structures:: How to find other structure members
@end menu
@node Particular Structures, Generic Structures, Structures, Structures
@@ -2652,8 +2668,8 @@ to check for any special properties of it, then you can use a general
typedef check macro.
@menu
-* Particular Typedefs:: Special handling to find certain types.
-* Generic Typedefs:: How to find other types.
+* Particular Typedefs:: Special handling to find certain types
+* Generic Typedefs:: How to find other types
@end menu
@node Particular Typedefs, Generic Typedefs, Typedefs, Typedefs
@@ -3185,14 +3201,14 @@ software package, the best thing to do is encapsulate it in a new macro.
@xref{Writing Macros}, for how to do that.
@menu
-* Examining Declarations:: Detecting header files and declarations.
-* Examining Syntax:: Detecting language syntax features.
-* Examining Libraries:: Detecting functions and global variables.
-* Run Time:: Testing for run-time features.
-* Portable Shell:: Shell script portability pitfalls.
-* Testing Values and Files:: Checking strings and files.
-* Multiple Cases:: Tests for several possible values.
-* Language Choice:: Selecting which language to use for testing.
+* Examining Declarations:: Detecting header files and declarations
+* Examining Syntax:: Detecting language syntax features
+* Examining Libraries:: Detecting functions and global variables
+* Run Time:: Testing for run-time features
+* Portable Shell:: Shell script portability pitfalls
+* Testing Values and Files:: Checking strings and files
+* Multiple Cases:: Tests for several possible values
+* Language Choice:: Selecting which language to use for testing
@end menu
@node Examining Declarations, Examining Syntax, Writing Tests, Writing Tests
@@ -3368,9 +3384,9 @@ possible, because using them prevents people from configuring your
package for cross-compiling.
@menu
-* Test Programs:: Running test programs.
-* Guidelines:: General rules for writing test programs.
-* Test Functions:: Avoiding pitfalls in test programs.
+* Test Programs:: Running test programs
+* Guidelines:: General rules for writing test programs
+* Test Functions:: Avoiding pitfalls in test programs
@end menu
@node Test Programs, Guidelines, Run Time, Run Time
@@ -3673,10 +3689,10 @@ save the result in a cache file for future @code{configure} runs, and
print a message letting the user know the result of the test.
@menu
-* Defining Symbols:: Defining C preprocessor symbols.
-* Setting Output Variables:: Replacing variables in output files.
-* Caching Results:: Speeding up subsequent @code{configure} runs.
-* Printing Messages:: Notifying users of progress or problems.
+* Defining Symbols:: Defining C preprocessor symbols
+* Setting Output Variables:: Replacing variables in output files
+* Caching Results:: Speeding up subsequent @code{configure} runs
+* Printing Messages:: Notifying users of progress or problems
@end menu
@node Defining Symbols, Setting Output Variables, Results, Results
@@ -3874,8 +3890,8 @@ checkpoints the cache in case of an early configure script abort.
@end defmac
@menu
-* Cache Variable Names:: Shell variables used in caches.
-* Cache Files:: Files @code{configure} uses for caching.
+* Cache Variable Names:: Shell variables used in caches
+* Cache Files:: Files @code{configure} uses for caching
@end menu
@node Cache Variable Names, Cache Files, Caching Results, Caching Results
@@ -4087,10 +4103,10 @@ software package, the best thing to do is encapsulate it in a new macro.
Here are some instructions and guidelines for writing Autoconf macros.
@menu
-* Macro Definitions:: Basic format of an Autoconf macro.
-* Macro Names:: What to call your new macros.
-* Quoting:: Protecting macros from unwanted expansion.
-* Dependencies Between Macros:: What to do when macros depend on other macros.
+* Macro Definitions:: Basic format of an Autoconf macro
+* Macro Names:: What to call your new macros
+* Quoting:: Protecting macros from unwanted expansion
+* Dependencies Between Macros:: What to do when macros depend on other macros
@end menu
@node Macro Definitions, Macro Names, Writing Macros, Writing Macros
@@ -4238,9 +4254,9 @@ macros are called if needed and a way to warn the user if macros are
called in an order that might cause incorrect operation.
@menu
-* Prerequisite Macros:: Ensuring required information.
-* Suggested Ordering:: Warning about possible ordering problems.
-* Obsolete Macros:: Warning about old ways of doing things.
+* Prerequisite Macros:: Ensuring required information
+* Suggested Ordering:: Warning about possible ordering problems
+* Obsolete Macros:: Warning about old ways of doing things
@end menu
@node Prerequisite Macros, Suggested Ordering, Dependencies Between Macros, Dependencies Between Macros
@@ -4357,10 +4373,10 @@ looking for libraries that are unique to particular systems. However,
Autoconf provides a uniform method for handling unguessable features.
@menu
-* Specifying Names:: Specifying the system type.
-* Canonicalizing:: Getting the canonical system type.
-* System Type Variables:: Variables containing the system type.
-* Using System Type:: What to do with the system type.
+* Specifying Names:: Specifying the system type
+* Canonicalizing:: Getting the canonical system type
+* System Type Variables:: Variables containing the system type
+* Using System Type:: What to do with the system type
@end menu
@node Specifying Names, Canonicalizing, Manual Configuration, Manual Configuration
@@ -4538,12 +4554,12 @@ under modified names, and set default values for @code{configure}
options.
@menu
-* External Software:: Working with other optional software.
-* Package Options:: Selecting optional features.
-* Pretty Help Strings::
-* Site Details:: Configuring site details.
-* Transforming Names:: Changing program names when installing.
-* Site Defaults:: Giving @code{configure} local defaults.
+* External Software:: Working with other optional software
+* Package Options:: Selecting optional features
+* Pretty Help Strings:: Formating help string
+* Site Details:: Configuring site details
+* Transforming Names:: Changing program names when installing
+* Site Defaults:: Giving @code{configure} local defaults
@end menu
@node External Software, Package Options, Site Configuration, Site Configuration
@@ -4613,10 +4629,8 @@ needed. Just make sure the columns line up in @samp{configure --help}.
Avoid tabs in the help string. You'll need to enclose it in @samp{[}
and @samp{]} in order to produce the leading spaces.
-If you find yourself using @code{AC_ARG_WITH} more than once (or you
-just like to have your @var{help-string}s look pretty), then you should
-first format your @var{help-string} with the macro @code{AC_HELP_STRING}
-(@pxref{Pretty Help Strings}).
+You should format your @var{help-string} with the macro
+@code{AC_HELP_STRING} (@pxref{Pretty Help Strings}).
@end defmac
@defmac AC_WITH (@var{package}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@@ -4681,10 +4695,8 @@ actually just the value of the shell variable
@var{help-string} argument is like that of @code{AC_ARG_WITH}
(@pxref{External Software}).
-If you find yourself using @code{AC_ARG_ENABLE} more than once (or you
-just like to have your @var{help-string}s look pretty), then you should
-first format your @var{help-string} with the macro @code{AC_HELP_STRING}
-(@pxref{Pretty Help Strings}).
+You should format your @var{help-string} with the macro
+@code{AC_HELP_STRING} (@pxref{Pretty Help Strings}).
@end defmac
@defmac AC_ENABLE (@var{feature}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@@ -4704,28 +4716,27 @@ your own @samp{help strings} to line up in the appropriate columns of
@samp{configure --help} just like the standard Autoconf @samp{help
strings} do. This is the purpose of the @code{AC_HELP_STRING} macro.
-@defmac AC_HELP_STRING (@var{left-hand-side}, @var{right-hand-side}, @var{formatted-help-string})
+@defmac AC_HELP_STRING (@var{left-hand-side}, @var{right-hand-side})
@maindex HELP_STRING
-Format an Autoconf macro's help string so that it looks pretty when the
-user executes @samp{configure --help}. The formatted help string is
-assigned to the third argument, @var{formatted-help-string}, which can
-then be used in @code{AC_ARG_WITH} (@pxref{External Software}) or
-@code{AC_ARG_ENABLE} (@pxref{Package Options}). The following example
-will make this clearer.
+Expands into an help string that looks pretty when the user executes
+@samp{configure --help}. It is typically used in @code{AC_ARG_WITH}
+(@pxref{External Software}) or @code{AC_ARG_ENABLE} (@pxref{Package
+Options}). The following example will make this clearer.
@example
AC_DEFUN(TEST_MACRO,
[
- AC_HELP_STRING([--with-foo], [use foo (default is NO)], foo_help_string)
- AC_ARG_WITH(foo, $foo_help_string, ac_cv_use_foo=$withval, ac_cv_use_foo=no)
-
+ AC_ARG_WITH(foo,
+ AC_HELP_STRING([--with-foo], [use foo (default is NO)],
+ ac_cv_use_foo=$withval, ac_cv_use_foo=no)
AC_CACHE_CHECK(whether to use foo, ac_cv_use_foo, ac_cv_use_foo=no)
])
@end example
-This will cause the last few lines of @samp{configure --help} to appear
-like this:
+Please note that the call to @code{AC_HELP_STRING} is @strong{unquoted}.
+Then the last few lines of @samp{configure --help} will appear like
+this:
@example
Features and packages:
@@ -4739,10 +4750,6 @@ Features and packages:
--with-foo use foo (default is NO)
@end example
-Notice how @samp{--with-foo} is properly prefixed with two spaces, and
-@samp{use foo (default is NO)} begins in column 26 with the rest of the
-Autoconf help strings.
-
The @code{AC_HELP_STRING} macro is particularly helpful when the
@var{left-hand-side} and/or @var{right-hand-side} are composed of macro
arguments, as shown in the following example.
@@ -4750,8 +4757,9 @@ arguments, as shown in the following example.
@example
AC_DEFUN(MY_ARG_WITH,
[
- AC_HELP_STRING([--with-$1], [use $1 (default is $2)], $1_help_string)
- AC_ARG_WITH($1, [$]$1_help_string, ac_cv_use_$1=$withval, ac_cv_use_$1=no)
+ AC_ARG_WITH($1,
+ AC_HELP_STRING([--with-$1], [use $1 (default is $2)]),
+ ac_cv_use_$1=$withval, ac_cv_use_$1=no)
AC_CACHE_CHECK(whether to use $1, ac_cv_use_$1, ac_cv_use_$1=$2)
])
@@ -4802,9 +4810,9 @@ is used as a prefix. Otherwise, no program name transformation is done.
@end defmac
@menu
-* Transformation Options:: @code{configure} options to transform names.
-* Transformation Examples:: Sample uses of transforming names.
-* Transformation Rules:: @file{Makefile} uses of transforming names.
+* Transformation Options:: @code{configure} options to transform names
+* Transformation Examples:: Sample uses of transforming names
+* Transformation Rules:: @file{Makefile} uses of transforming names
@end menu
@node Transformation Options, Transformation Examples, Transforming Names, Transforming Names
@@ -4988,14 +4996,14 @@ file in the package. A plain-text version of @file{INSTALL} which you
may use comes with Autoconf.
@menu
-* Basic Installation:: Instructions for typical cases.
-* Compilers and Options:: Selecting compilers and optimization.
-* Multiple Architectures:: Compiling for multiple architectures at once.
-* Installation Names:: Installing in different directories.
-* Optional Features:: Selecting optional features.
-* System Type:: Specifying the system type.
-* Sharing Defaults:: Setting site-wide defaults for @code{configure}.
-* Operation Controls:: Changing how @code{configure} runs.
+* Basic Installation:: Instructions for typical cases
+* Compilers and Options:: Selecting compilers and optimization
+* Multiple Architectures:: Compiling for multiple architectures at once
+* Installation Names:: Installing in different directories
+* Optional Features:: Selecting optional features
+* System Type:: Specifying the system type
+* Sharing Defaults:: Setting site-wide defaults for @code{configure}
+* Operation Controls:: Changing how @code{configure} runs
@end menu
@include install.texi
@@ -5008,22 +5016,28 @@ which describes which configuration options were specified when the
package was last configured. This file is a shell script which,
if run, will recreate the same configuration.
-You can give @file{config.status} the @samp{--recheck} option to update
-itself. This option is useful if you change @code{configure}, so that
-the results of some tests might be different from the previous run. The
-@samp{--recheck} option re-runs @code{configure} with the same arguments
-you used before, plus the @samp{--no-create} option, which prevent
-@code{configure} from running @file{config.status} and creating
-@file{Makefile} and other files, and the @samp{--no-recursion} option,
-which prevents @code{configure} from running other @code{configure}
-scripts in subdirectories. (This is so other @file{Makefile} rules can
-run @file{config.status} when it changes; @pxref{Automatic Remaking},
-for an example).
-
-@file{config.status} also accepts the options @samp{--help}, which
-prints a summary of the options to @file{config.status}, and
-@samp{--version}, which prints the version of Autoconf used to create
-the @code{configure} script that generated @file{config.status}.
+It supports the following options:
+@table @code
+@item --recheck
+Ask @file{config.status} to update itself. This option is useful if you
+change @code{configure}, so that the results of some tests might be
+different from the previous run. The @samp{--recheck} option re-runs
+@code{configure} with the same arguments you used before, plus the
+@samp{--no-create} option, which prevent @code{configure} from running
+@file{config.status} and creating @file{Makefile} and other files, and
+the @samp{--no-recursion} option, which prevents @code{configure} from
+running other @code{configure} scripts in subdirectories. (This is so
+other @file{Makefile} rules can run @file{config.status} when it
+changes; @pxref{Automatic Remaking}, for an example).
+
+@item --help
+@itemx -h
+Print a summary of the command line options and exit.
+
+@item --version
+Print the version number of Autoconf used to create the @code{configure}
+script that generated @file{config.status} and exit.
+@end table
@file{config.status} checks several optional environment variables that
can alter its behavior:
@@ -5091,10 +5105,10 @@ Several questions about Autoconf come up occasionally. Here some of them
are addressed.
@menu
-* Distributing:: Distributing @code{configure} scripts.
+* Distributing:: Distributing @code{configure} scripts
* Why GNU m4:: Why not use the standard @code{m4}?
* Bootstrapping:: Autoconf and GNU @code{m4} require each other?
-* Why Not Imake:: Why GNU uses @code{configure} instead of Imake.
+* Why Not Imake:: Why GNU uses @code{configure} instead of Imake
@end menu
@node Distributing, Why GNU m4, Questions, Questions
@@ -5277,12 +5291,12 @@ much faster than earlier versions, because as of version 1.3, GNU
freeze its internal state in a file that it can read back quickly.
@menu
-* Changed File Names:: Files you might rename.
-* Changed Makefiles:: New things to put in @file{Makefile.in}.
-* Changed Macros:: Macro calls you might replace.
-* Invoking autoupdate:: Replacing old macro names in @code{configure.in}.
-* Changed Results:: Changes in how to check test results.
-* Changed Macro Writing:: Better ways to write your own macros.
+* Changed File Names:: Files you might rename
+* Changed Makefiles:: New things to put in @file{Makefile.in}
+* Changed Macros:: Macro calls you might replace
+* Invoking autoupdate:: Replacing old macro names in @code{configure.in}
+* Changed Results:: Changes in how to check test results
+* Changed Macro Writing:: Better ways to write your own macros
@end menu
@node Changed File Names, Changed Makefiles, Upgrading, Upgrading
@@ -5496,11 +5510,11 @@ to you, and you might as well skip it. If you @emph{are} wondering,
then let there be light@dots{}
@menu
-* Genesis:: Prehistory and naming of @code{configure}.
-* Exodus:: The plagues of @code{m4} and Perl.
-* Leviticus:: The priestly code of portability arrives.
-* Numbers:: Growth and contributors.
-* Deuteronomy:: Approaching the promises of easy configuration.
+* Genesis:: Prehistory and naming of @code{configure}
+* Exodus:: The plagues of @code{m4} and Perl
+* Leviticus:: The priestly code of portability arrives
+* Numbers:: Growth and contributors
+* Deuteronomy:: Approaching the promises of easy configuration
@end menu
@node Genesis, Exodus, History, History
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 6f381c53..44217731 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -73,6 +73,11 @@ m4_prefix([include])
m4_prefix([shift])
m4_prefix([format])
+dnl ifset(COND, IF-TRUE)
+dnl --------------------
+dnl If COND is not the empty string, expand IF-TRUE.
+define([ifset], [ifelse([$1],,,[$2])])
+
dnl ### Defining macros
@@ -282,7 +287,6 @@ dnl shell variables' content will be translated at run time (tr or sed).
dnl AC_TR(STRING, FROM, TO, ALPHABET, DEFAULT)
dnl ------------------------------------------
-dnl
dnl Perform tr 'FROM' 'TO' on STRING by m4 when possible, otherwise
dnl by the shell at configure time. After transliteration, any character
dnl which is not part of ALPHABET is then mapped to DEFAULT.
@@ -312,7 +316,6 @@ AC_VAR_IF_INDIR([$1],
dnl AC_TR_DEFINE(EXPRESSION)
dnl ------------------------
-dnl
dnl Map EXPRESSION to an upper case string which is valid as rhs for a
dnl `#define'. sh/m4 polymorphic.
define(AC_TR_DEFINE,
@@ -325,7 +328,6 @@ define(AC_TR_DEFINE,
dnl AC_TR_SH(EXPRESSION)
dnl --------------------
-dnl
dnl Transform EXPRESSION into a valid shell variable name.
dnl sh/m4 polymorphic. Because of a delicate problem of quoting,
dnl we cannot use the definition we had before:
@@ -341,33 +343,112 @@ define(AC_TR_SH,
dnl ### Implementing m4 loops
+dnl Implementing loops (`foreach' loops) in m4 is much more tricky than it
+dnl may seem. Actually, the example of a `foreach' loop in the m4
+dnl documentation is wrong: it does not quote the arguments properly,
+dnl which leads to undesired expansions.
+dnl
+dnl The example in the documentation is:
+dnl
+dnl | # foreach(x, (item_1, item_2, ..., item_n), stmt)
+dnl | define(`foreach',
+dnl | `pushdef(`$1', `')_foreach(`$1', `$2', `$3')popdef(`$1')')
+dnl | define(`_arg1', `$1')
+dnl | define(`_foreach',
+dnl | `ifelse(`$2', `()', ,
+dnl | `define(`$1', _arg1$2)$3`'_foreach(`$1', (shift$2), `$3')')')
+dnl
+dnl But then if you run
+dnl
+dnl | define(a, 1)
+dnl | define(b, 2)
+dnl | define(c, 3)
+dnl | foreach(`f', `(`a', `(b', `c)')', `echo f
+dnl | ')
+dnl
+dnl it gives
+dnl
+dnl | echo 1
+dnl | echo (2,3)
+dnl
+dnl which is not what is expected.
+dnl
+dnl Once you understood this, you turn yourself into a quopting wizard,
+dnl and come up with the following solution:
+dnl
+dnl | # foreach(x, (item_1, item_2, ..., item_n), stmt)
+dnl | define(`foreach', `pushdef(`$1', `')_foreach($@)popdef(`$1')')
+dnl | define(`_arg1', ``$1'')
+dnl | define(`_foreach',
+dnl | `ifelse($2, `()', ,
+dnl | `define(`$1', `_arg1$2')$3`'_foreach(`$1', `(shift$2)', `$3')')')
+dnl
+dnl which this time answers
+dnl
+dnl | echo a
+dnl | echo (b
+dnl | echo c)
+dnl
+dnl Bingo!
+
dnl AC_FOREACH_COMMA(VARIABLE, LIST, EXPRESSION)
dnl --------------------------------------------
-dnl Compute EXPRESSION assigning to VARIABLE each value of the LIST
-dnl (LIST has the form `(item_1, item_2, ..., item_n)').
+dnl Expand EXPRESSION assigning to VARIABLE each value of the LIST
+dnl (LIST should have the form `[(item_1, item_2, ..., item_n)]'),
+dnl i.e. the whole list should be *quoted*. Quote members too if
+dnl you don't want them to be expanded.
define(AC_FOREACH_COMMA,
-[pushdef([$1], [])_AC_FOREACH([$1], [$2], [$3])popdef([$1])])
+[pushdef([$1], [])_AC_FOREACH($@)popdef([$1])])
dnl Low level macros used to define AC_FOREACH_COMMA.
-define(_AC_CAR, [$1])
-define(_AC_CDR, [builtin(shift, $@)])
+define(_AC_CAR, [[$1]])
define(_AC_FOREACH,
-[ifelse([$2], [()], ,
- [define([$1], _AC_CAR$2)$3[]_AC_FOREACH([$1],
- (_AC_CDR$2),
+[ifelse($2, [()], ,
+ [define([$1], [_AC_CAR$2])$3[]_AC_FOREACH([$1],
+ [(m4_shift$2)],
[$3])])])
dnl _AC_COMMATIZE(LIST)
dnl -------------------
-dnl Use patsubst to go from an AC_FOREACH_COMMA list to a AC_FOREACH
-dnl list. Do not use `patsubst([$2], [\>\W+\<], [,])', since it swallows
+
+dnl Transform a shell LIST (i.e., white space separated) into a m4 list
+dnl (i.e., separated with commas). This is used to implement AC_FOREACH
+dnl with AC_FOREACH_COMMA.
+dnl
+dnl It quite tricky for several reasons:
+dnl - if there are quoted active symbols in input, on the output they
+dnl should still be quoted. I didn't manage to reach this goal yet,
+dnl but it doesn't seem to be such a necessity. FIXME: do it.
+dnl - if there are parentheses in the input, make sure *not* to think
+dnl this is an m4 list. This is especially important for
+dnl AC_HELP_STRING.
+dnl
+dnl This means that `_AC_COMMATIZE([a] [(b] [c)])' should expand into
+dnl `[a], [(b], [c)]'. Currently parentheses are correctly handled, but
+dnl the macro are expanded, i.e., the output is `[1],[(2],[3)]'.
+dnl
+dnl Do not use `patsubst([$2], [\>\W+\<], [,])', since it swallows
dnl the `$' from the variable names, so, 1. swallow `\[CR]' (I don't
dnl understand why I need two backslashes), 2. remove trailing spaces, 3.
dnl replace remaining sequences of spaces with commas.
-define([_AC_COMMATIZE],
-[patsubst(patsubst(patsubst([$1], [\\
-]), [[ ]+$]), [[ ]+], [,])])
-
+dnl
+dnl Pay attention to the changequotes. Inner changequotes exist for
+dnl obvious reasons (we want to insert square brackets). Outer
+dnl changequotes are needed because otherwise the m4 parser, when it
+dnl sees the closing bracket we add to the result believes it is the
+dnl end of the body of the macro we define.
+changequote(<, >)
+define(<_AC_COMMATIZE>,
+<changequote(`, ')dnl
+pushdef(`one_line', translit(patsubst(`$1', `\\
+'), `
+', ` '))dnl
+pushdef(`no_trailing_space', patsubst(one_line, `[ ]+$'))dnl
+[patsubst(no_trailing_space, `[ ]+', `],[')]dnl
+changequote([, ])dnl
+popdef(`no_trailing_space')dnl
+popdef(`one_line')>)
+changequote([, ])
dnl AC_FOREACH(VARIABLE, LIST, EXPRESSION)
dnl --------------------------------------
@@ -375,7 +456,7 @@ dnl
dnl Compute EXPRESSION assigning to VARIABLE each value of the LIST.
dnl (LIST has the form `item_1 item_2 ... item_n': there are no commas.)
dnl
-define(AC_FOREACH,
+define([AC_FOREACH],
[AC_FOREACH_COMMA([$1], (_AC_COMMATIZE([$2])), [$3])])
@@ -392,6 +473,98 @@ AC_DEFUN(AC_SPECIALIZE,
[indir([$1], m4_shift($@))])])
+dnl ## --------------------------------- ##
+dnl ## Helping macros to display strings ##
+dnl ## --------------------------------- ##
+
+
+dnl AC_WRAP(STRING [,WIDTH] [, PREFIX]]))
+dnl -------------------------------------
+dnl Expands into the STRING wrapped to hold in WIDTH (which defaults to
+dnl 79). Words longer than WIDTH are not split. Each line is prefixed
+dnl with PREFIX. Note that the length of PREFIX is taken into account
+dnl by this macro to compute the length of a line.
+dnl
+dnl FIXME: there is no checking of a longer PREFIX than WIDTH, but do
+dnl we really want to bother with people trying each single corner
+dnl of a software?
+define([AC_WRAP],
+[pushdef([ac_prefix], [$3])dnl
+pushdef([ac_width], m4_eval(ifelse([$2],, 79, $2) - len(ac_prefix)))dnl
+pushdef([ac_cursor], 0)dnl
+ac_prefix[]dnl
+AC_FOREACH([ac_word], $1,
+[define([ac_cursor], m4_eval(ac_cursor + len(ac_word) + 1))dnl
+ifelse(m4_eval(ac_cursor > ac_width),
+ 1, [define([ac_cursor], m4_eval(len(ac_word) + 1))]
+ac_prefix)dnl
+ac_word ])dnl
+popdef([ac_prefix])dnl
+popdef([ac_width])dnl
+popdef([ac_cursor])])
+
+
+dnl AC_HELP_STRING(LHS, RHS)
+dnl ------------------------
+dnl
+dnl Format an Autoconf macro's help string so that it looks pretty when
+dnl the user executes "configure --help". This macro takes two
+dnl arguments, a "left hand side" (LHS), and a "right hand side" (RHS).
+dnl
+dnl The resulting string is suitable for use in other macros that require
+dnl a help string (e.g. AC_ARG_WITH).
+dnl
+dnl Here is the sample string from the Autoconf manual (Node: External
+dnl Software) which shows the proper spacing for help strings.
+dnl
+dnl --with-readline support fancy command line editing
+dnl ^ ^ ^
+dnl | | |
+dnl | column 2 column 26
+dnl |
+dnl column 0
+dnl
+dnl A help string is made up of a "left hand side" (LHS) and a "right
+dnl hand side" (RHS). In the example above, the LHS is
+dnl "--with-readline", while the RHS is "support fancy command line
+dnl editing".
+dnl
+dnl If the LHS extends past column 24, then the LHS is terminated with a
+dnl newline so that the RHS is on a line of its own beginning in column
+dnl 26.
+dnl
+dnl Therefore, if the LHS were instead "--with-readline-blah-blah-blah",
+dnl then the AC_HELP_STRING macro would expand into:
+dnl
+dnl
+dnl --with-readline-blah-blah-blah
+dnl ^ ^ support fancy command line editing
+dnl | | ^
+dnl | column 2 |
+dnl column 0 column 26
+dnl
+dnl This macro is a adhoc version of AC_WRAP.
+define([AC_HELP_STRING],
+[pushdef([ac_prefix], [ ])dnl 26 spaces
+pushdef([ac_width], m4_eval(79 - len(ac_prefix)))dnl
+pushdef([ac_cursor], 0)dnl
+m4_format([ %-23s ], [$1])dnl
+dnl If the option is too wide, leave it alone on the line
+ifelse(m4_eval(len(m4_format([ %-23s ], [$1])) > 26),
+ 1, [
+]ac_prefix)dnl
+AC_FOREACH([ac_word], $2,
+[define([ac_cursor], m4_eval(ac_cursor + len(ac_word) + 1))dnl
+ifelse(m4_eval(ac_cursor > ac_width),
+ 1, [define([ac_cursor], m4_eval(len(ac_word) + 1))]
+ac_prefix)dnl
+ac_word ])dnl
+popdef([ac_prefix])dnl
+popdef([ac_width])dnl
+popdef([ac_cursor])])
+
+
+
dnl ### Initialization
@@ -983,6 +1156,7 @@ dnl ### Selecting optional features
dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
+dnl -----------------------------------------------------------------------
AC_DEFUN(AC_ARG_ENABLE,
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
ac_help="$ac_help
@@ -1029,121 +1203,12 @@ AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl
])
-dnl ### Pretty-printing help strings.
-
-dnl AC_HELP_STRING
-dnl --------------
-dnl
-dnl usage: AC_HELP_STRING(LHS, RHS, HELP-STRING)
-dnl
-dnl Format an Autoconf macro's help string so that it looks pretty when
-dnl the user executes "configure --help". This macro take three
-dnl arguments, a "left hand side" (LHS), a "right hand side" (RHS), and
-dnl a variable (HELP-STRING) to set to the pretty-printed concatenation
-dnl of LHS and RHS (the new, pretty-printed "help string").
-dnl
-dnl The resulting string in HELP-STRING is suitable for use in other
-dnl macros that require a help string (e.g. AC_ARG_WITH).
-dnl
-AC_DEFUN(AC_HELP_STRING,
-[
-dnl
-dnl Here is the sample string from the Autoconf manual (Node: External
-dnl Software) which shows the proper spacing for help strings.
-dnl
-dnl --with-readline support fancy command line editing
-dnl ^ ^ ^
-dnl | | |
-dnl | column 2 column 26
-dnl |
-dnl column 0
-dnl
-dnl A help string is made up of a "left hand side" (LHS) and a "right
-dnl hand side" (RHS). In the example above, the LHS is
-dnl "--with-readline", while the RHS is "support fancy command line
-dnl editing".
-dnl
-dnl If the LHS extends past column 24, then the LHS is terminated with a
-dnl newline so that the RHS is on a line of its own beginning in column
-dnl 26.
-dnl
-dnl Therefore, if the LHS were instead "--with-readline-blah-blah-blah",
-dnl then the MDL_PRETTY_HELP_STRING macro would expand into:
-dnl
-dnl
-dnl --with-readline-blah-blah-blah
-dnl ^ ^ support fancy command line editing
-dnl | | ^
-dnl | column 2 |
-dnl column 0 column 26
-
-dnl We divert everything to AC_DIVERSION_NOTICE (which gets output very
-dnl early in the configure script) because we want the user's help
-dnl string to be set before it is used.
-
-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-# This is from AC_HELP_STRING
-lhs="$1"
-rhs="$2"
-
-lhs_column=25
-rhs_column=`expr $lhs_column + 1`
-
-# Insure that the LHS begins with exactly two spaces.
-changequote(, )dnl
-lhs=`echo "$lhs" | sed -n -e "s/[ ]*\(.*\)/ \1/p"`
-changequote([, ])dnl
-
-# Is the length of the LHS less than $lhs_column?
-if ! `echo "$lhs" | grep ".\{$lhs_column\}" > /dev/null 2>&1`; then
-
- # Pad the LHS with spaces. Note that padding the LHS is an
- # "expensive" operation (i.e. expensive in the sense of there being
- # multiple calls to `grep') only the first time MDL_PRETTY_HELP_STRING
- # is called. Once this macro is called once, subsequent calls will be
- # nice and zippy.
- : ${lhs_pad=""}
-changequote(, )dnl
- while ! `echo "$lhs_pad" | grep "[ ]\{$lhs_column\}" > /dev/null 2>&1`; do
-changequote([, ])dnl
- lhs_pad=" $lhs_pad"
- done
-
- lhs="${lhs}${lhs_pad}"
-changequote(, )dnl
-$3=`echo "$lhs" | sed -n -e "/.\{$lhs_column\}[ ][ ]*$/ s/\(.\{$rhs_column\}\).*/\1$rhs/p"`
-changequote([, ])dnl
-
-else
-
- # Build up a string of spaces to pad the left-hand-side of the RHS
- # with. Note that padding the RHS is an "expensive" operation
- # (i.e. expensive in the sense of there being multiple calls to
- # `grep') only the first time AC_HELP_STRING is called. Once this
- # macro is called once, subsequent calls will be nice and zippy.
- : ${rhs_pad=""}
-changequote(, )dnl
- while ! `echo "$rhs_pad" | grep "[ ]\{$rhs_column\}" > /dev/null 2>&1`; do
-changequote([, ])dnl
- rhs_pad=" $rhs_pad"
- done
-
- # Strip all leading spaces from the RHS.
-changequote(, )dnl
- rhs=`echo "$rhs" | sed -n -e "s/[ ]*\(.*\)/\1/p"`
-changequote([, ])dnl
-
-$3="$lhs
-${rhs_pad}${rhs}"
-fi
-AC_DIVERT_POP()dnl
-])
-
dnl ### Transforming program names.
dnl AC_ARG_PROGRAM()
+dnl FIXME: Must be run only once.
AC_DEFUN(AC_ARG_PROGRAM,
[if test "$program_transform_name" = s,x,x,; then
program_transform_name=
@@ -1870,14 +1935,14 @@ fi
undefine([AC_VAR_NAME])dnl
])
+dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
+dnl -----------------------------------------------------
dnl Try to compile, link and execute TEST-PROGRAM. Set WORKING-VAR to
dnl `yes' if the current compiler works, otherwise set it ti `no'. Set
dnl CROSS-VAR to `yes' if the compiler and linker produce non-native
dnl executables, otherwise set it to `no'. Before calling
dnl `AC_TRY_COMPILER()', call `AC_LANG_*' to set-up for the right
dnl language.
-dnl
-dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
AC_DEFUN(AC_TRY_COMPILER,
[cat > conftest.$ac_ext << EOF
ifelse(AC_LANG, [FORTRAN77], ,
@@ -2444,9 +2509,11 @@ subdirs="AC_LIST_SUBDIRS"
AC_SUBST(subdirs)dnl
])
+dnl AC_OUTPUT([CONFIG_FILES...] [, EXTRA-CMDS] [, INIT-CMDS])
+dnl -------------------------------------------------
dnl The big finish.
dnl Produce config.status, config.h, and links; and configure subdirs.
-dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS])
+dnl The CONFIG_HEADERS are defined in the m4 variable AC_LIST_HEADER.
define(AC_OUTPUT,
[trap '' 1 2 15
AC_CACHE_SAVE
@@ -2488,9 +2555,32 @@ dnl so uname gets run too.
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
-changequote(, )dnl
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-changequote([, ])dnl
+ac_cs_usage="\
+Usage: $CONFIG_STATUS @BKL@OPTIONS@BKR@
+Configure files from templates according to the current configuration.
+
+ --recheck Update $CONFIG_STATUS by reconfiguring in the same conditions
+ --version Print the version of Autoconf and exit
+ --help Display this help and exit
+
+By default the following files will updated.
+ifset($1, [ Configuration files:
+AC_WRAP($1, 79, [ ])
+])dnl
+ifdef([AC_LIST_HEADER], [ Configuration headers:
+AC_WRAP(AC_LIST_HEADER, 79, [ ])]
+)dnl
+
+In order to configure a list a specified FILES and HEADERS, run
+ CONFIG_FILES=FILES CONFIG_HEADERS=HEADERS $CONFIG_STATUS
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+ac_cs_version="\
+$CONFIG_STATUS generated by autoconf version AC_ACVERSION.
+Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by running
+ [$]0 [$]ac_configure_args"
+
for ac_option
do
case "[\$]ac_option" in
@@ -2498,8 +2588,7 @@ do
echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion"
exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version AC_ACVERSION"
- exit 0 ;;
+ echo "[\$]ac_cs_version"; exit 0 ;;
-help | --help | --hel | --he | --h)
echo "[\$]ac_cs_usage"; exit 0 ;;
*) echo "[\$]ac_cs_usage"; exit 1 ;;
@@ -2509,14 +2598,18 @@ done
ac_given_srcdir=$srcdir
ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
])dnl
-
-changequote(<<, >>)dnl
-ifdef(<<AC_LIST_HEADER>>,
-<<trap 'rm -fr `echo "$1 AC_LIST_HEADER" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>,
-<<trap 'rm -fr `echo "$1" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>)
-changequote([, ])dnl
-EOF
-cat >> $CONFIG_STATUS <<EOF
+# Allow concurrent executions
+conftest=cft\$\$
+
+dnl Remove all of CONFIG_FILES and CONFIG_HEADERS, and trap to remove
+dnl the temp files. There is no need to trap for the config files
+dnl since they are built from `mv tmp-file config-file', hence their
+dnl update is atomic.
+: \${CONFIG_FILES="$1"}
+ifdef([AC_LIST_HEADER], [: \${CONFIG_HEADERS=AC_LIST_HEADER}
+])dnl
+rm -fr \`echo "\$CONFIG_FILES ifdef([AC_LIST_HEADER], \$CONFIG_HEADERS)" | sed "s/:@BKL@^ @BKR@*//g"\`
+trap 'rm -fr \$conftest*; exit 1' 1 2 15
AC_OUTPUT_FILES($1)
ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
@@ -2551,7 +2644,7 @@ dnl Using a here document instead of a string reduces the quoting nightmare.
# If the first sed substitution is executed (which looks for macros that
# take arguments), then we branch to the cleanup section. Otherwise,
# look for a macro that doesn't take arguments.
-cat > conftest.defs <<\EOF
+cat > $conftest.defs <<\EOF
changequote(<<, >>)dnl
s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)%-D\1=\2%g
t cleanup
@@ -2563,20 +2656,22 @@ s%\]%\\&%g
s%\$%$$%g
changequote([, ])dnl
EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
+DEFS=`sed -f $conftest.defs confdefs.h | tr '\012' ' '`
+rm -f $conftest.defs
])
+
+dnl AC_OUTPUT_FILES(CONFIG_FILES...)
+dnl --------------------------------
dnl Do the variable substitutions to create the Makefiles or whatever.
dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted
dnl here document whose contents are going into config.status, but
dnl upon returning, the here document is being quoted.
-dnl AC_OUTPUT_FILES(FILE...)
define(AC_OUTPUT_FILES,
[# Protect against being on the right side of a sed subst in config.status.
changequote(, )dnl
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > \$conftest.subs <<\\CEOF
changequote([, ])dnl
dnl These here document variables are unquoted when configure runs
dnl but quoted when config.status runs, so variables are expanded once.
@@ -2600,18 +2695,18 @@ ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "1,${ac_beg}d; ${ac_end}q" $conftest.subs > $conftest.s$ac_file
else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ sed "${ac_end}q" $conftest.subs > $conftest.s$ac_file
fi
- if test ! -s conftest.s$ac_file; then
+ if test ! -s $conftest.s$ac_file; then
ac_more_lines=false
- rm -f conftest.s$ac_file
+ rm -f $conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
+ ac_sed_cmds="sed -f $conftest.s$ac_file"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
@@ -2623,10 +2718,6 @@ if test -z "$ac_sed_cmds"; then
fi
EOF
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"$1"}
-EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
changequote(, )dnl
@@ -2682,6 +2773,8 @@ changequote([, ])dnl
*) ac_comsub= ;;
esac
+# Don't redirect the output to AC_FILE directly: use `mv' so that updating
+# is atomic, and doesn't need trapping.
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
@@ -2690,23 +2783,25 @@ s%@top_srcdir@%$top_srcdir%g
ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
])dnl
dnl The parens around the eval prevent an "illegal io" in Ultrix sh.
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $conftest.out
dnl This would break Makefile dependencies.
-dnl if cmp -s $ac_file conftest.out 2>/dev/null; then
+dnl if cmp -s $ac_file $conftest.out 2>/dev/null; then
dnl echo "$ac_file is unchanged"
-dnl rm -f conftest.out
+dnl rm -f $conftest.out
dnl else
dnl rm -f $ac_file
-dnl mv conftest.out $ac_file
+dnl mv $conftest.out $ac_file
dnl fi
+ mv $conftest.out $ac_file
fi; done
-rm -f conftest.s*
+rm -f $conftest.s*
])
+dnl AC_OUTPUT_HEADER(HEADER-FILE...)
+dnl --------------------------------
dnl Create the config.h files from the config.h.in files.
dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
dnl here document whose contents are going into config.status.
-dnl AC_OUTPUT_HEADER(HEADER-FILE...)
define(AC_OUTPUT_HEADER,
[changequote(<<, >>)dnl
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
@@ -2749,20 +2844,20 @@ changequote([, ])dnl
echo creating $ac_file
- rm -f conftest.frag conftest.in conftest.out
+ rm -f $conftest.frag $conftest.in $conftest.out
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
+ cat $ac_file_inputs > $conftest.in
EOF
-# Transform confdefs.h into a sed script conftest.vals that substitutes
+# Transform confdefs.h into a sed script $conftest.vals that substitutes
# the proper values into config.h.in to produce config.h. And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
+rm -f $conftest.vals
dnl Using a here document instead of a string reduces the quoting nightmare.
dnl Putting comments in sed scripts is not portable.
-cat > conftest.hdr <<\EOF
+cat > $conftest.hdr <<\EOF
changequote(<<, >>)dnl
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
@@ -2774,50 +2869,53 @@ s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
changequote([, ])dnl
EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC_DEFINE to be honored.
+uniq confdefs.h | sed -n -f $conftest.hdr > $conftest.vals
+rm -f $conftest.hdr
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
+cat >> $conftest.vals <<\EOF
changequote(, )dnl
s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
changequote([, ])dnl
EOF
-# Break up conftest.vals because some shells have a limit on
+# Break up $conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.
-rm -f conftest.tail
+rm -f $conftest.tail
while :
do
- ac_lines=`grep -c . conftest.vals`
+ ac_lines=`grep -c . $conftest.vals`
# grep -c gives empty output for an empty file on some AIX systems.
if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ # Write a limited-size here document to $conftest.frag.
+ echo ' cat > $conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q $conftest.vals >> $CONFIG_STATUS
echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
+ sed -f $conftest.frag $conftest.in > $conftest.out
+ rm -f $conftest.in
+ mv $conftest.out $conftest.in
' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
+ sed 1,${ac_max_here_lines}d $conftest.vals > $conftest.tail
+ rm -f $conftest.vals
+ mv $conftest.tail $conftest.vals
done
-rm -f conftest.vals
+rm -f $conftest.vals
dnl Now back to your regularly scheduled config.status.
cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
+ rm -f $conftest.frag $conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > $conftest.h
+ cat $conftest.in >> $conftest.h
+ rm -f $conftest.in
+ if cmp -s $ac_file $conftest.h 2>/dev/null; then
echo "$ac_file is unchanged"
- rm -f conftest.h
+ rm -f $conftest.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
changequote(, )dnl
@@ -2828,15 +2926,16 @@ cat >> $CONFIG_STATUS <<\EOF
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
- mv conftest.h $ac_file
+ mv $conftest.h $ac_file
fi
fi; done
])
+dnl AC_OUTPUT_LINKS(SOURCE..., DEST...)
+dnl -----------------------------------
dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
dnl here document whose contents are going into config.status.
-dnl AC_OUTPUT_LINKS(SOURCE..., DEST...)
define(AC_OUTPUT_LINKS,
[EOF