Tue Nov 19 10:29:06 1996 David J MacKenzie <djm@catapult.va.pubnix.com>
- * acgeneral.m4 (AC_TRY_RUN_NATIVE): Fail if linking fails, and
- remove conftest* before running success code, like in AC_TRY_LINK.
+ * testsuite/autoconf.g/sizeof.exp: Use the v2 macro name.
+
+ * acgeneral.m4 (AC_OUTPUT_FILES, AC_OUTPUT_HEADER): Support
+ creating output files from multiple pieces, concatenated.
+ Suggested by "Theodore Ts'o" <tytso@MIT.EDU>.
+ (AC_LINK_FILES): If called more than once, concatenate the
+ arguments. From Roland McGrath.
+ (AC_CONFIG_SUBDIRS): Likewise.
+ (AC_OUTPUT_COMMANDS): New macro. Suggested by
+ Tom Tromey <tromey@creche.cygnus.com>.
+ (AC_OUTPUT): Use the lists it sets.
+
+ * acgeneral.m4 (AC_TRY_RUN_NATIVE): Fail if linking fails, like
+ AC_TRY_LINK.
(AC_TRY_RUN): Don't require AC_C_CROSS.
(AC_TRY_COMPILER): New macro.
(AC_LANG_C, AC_LANG_CPLUSPLUS): Set cross_compiling.
-
* acspecific.m4 (AC_PROG_CC_WORKS, AC_PROG_CXX_WORKS): Use
AC_TRY_COMPILER instead of AC_TRY_LINK.
(AC_PROG_CC_GNU, AC_PROG_CC_G): Split out of AC_PROG_CC.
Major changes in release 2.12:
+* AC_OUTPUT and AC_CONFIG_HEADER can create output files by
+ concatenating multiple input files separated by colons, like so:
+ AC_CONFIG_HEADER(config.h:conf.pre:config.h.in:conf.post)
+ AC_OUTPUT(Makefile:Makefile.in:Makefile.rules)
+ The arguments may be shell variables, to compute the lists on the fly.
+* AC_LINK_FILES and AC_CONFIG_SUBDIRS may be called multiple times.
+* New macro AC_OUTPUT_COMMANDS adds more commands to run in config.status.
* Bug fixes.
\f
Major changes in release 2.11:
* Look at user contributed macros:
prototypes
IEEE double precision math
+ more
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-configure-time pasting together of output files from multiple pieces.
-AC_OUTPUT(Makefile:$pre_in:Makefile.in:$pre_out)
-
-This would concatenate the files $pre_in, Makefile.in, and $pre_out
-before running sed to do the substitutions.
-From: "Theodore Ts'o" <tytso@MIT.EDU>
-
-Support a way of including makefile fragments that then have @var@
-substitutions done on them.
-
-Or ac_include?
-
-------------------------------------------------------------------------------
-
I wonder if it is possible to get the path for X11's app-defaults
directory by autoconf. Moreover, I'd like to have a general way of
accessing imake variables by autoconf, something like
------------------------------------------------------------------------------
-Whichever AC_LINK_FILES directive comes last is that one that gets
-done.
-
-From Jim Meyering
-
-This is trivial, but I'm unsure of the m4 quoting reality. Is it:
-
-AC_DEFUN(AC_LINK_FILES,
-[define([AC_LIST_FILES], ifdef([AC_LIST_FILES], AC_LIST_FILES ,)[$1])dnl
-define([AC_LIST_LINKS], ifdef([AC_LIST_LINKS], AC_LIST_LINKS ,)[$2])])
-
-Roland McGrath
-
-------------------------------------------------------------------------------
-
Question: at least one common UNIX variant has a "cc" that is old K&R
and "c89" for ANSI C. Is there any reason why AC_PROG_CC couldn't
check for c89 before cc if it can't find gcc?
------------------------------------------------------------------------------
-Modify the meaning of autoheader --localdir to add an additional
-directory to look for acconfig.h instead of replacing the directory
-containing configure.in. Also, autoreconf recurses on all
-subdirectories containing a configure.in, not just those given by an
-AC_CONFIG_SUBDIRS directive, so you can't have both directories that
-are parts of a large package, and directories that are independent
-packages.
-
-Marc Horowitz <marc@MIT.EDU>
-
-------------------------------------------------------------------------------
-
Cache consistency checking: ignore cache if environment
(CC or PATH) differs.
From Mike Haertel
------------------------------------------------------------------------------
-in order to use the AC_CANONICAL_SYSTEM macro, I have to
-have install-sh somewhere nearby --- why is this? I have no real
-reason to distribute install-sh, other than that its absence breaks
-this code.
-
-Shouldn't the above loop be looking for config.sub and config.guess?
-From: jimb@totoro.bio.indiana.edu (Jim Blandy)
-
-adding AC_CANONICAL_HOST to my configure.in script caused
-all sorts of odd/unexplained errors. Obviously, I had to go
-get copies of config.guess, config.sub and install-sh from the
-autoconf distribution, but the error messages and autoconf docs
-didn't explain that very well.
-From: bostic@bsdi.com (Keith Bostic)
-
-------------------------------------------------------------------------------
-
-Perhaps also have AC_TRY_COMPILER try to link an invalid program, and
-die if the compiler seemed to succeed--in which case it's not usable
-with autoconf scripts.
-
-------------------------------------------------------------------------------
-
When using CONFIG_FILES= and CONFIG_HEADERS= for controlling
partial configuration, any AC_LINK_FILES is repeated in each case
(that is, usually, once for config.h and once per subdirectory).
------------------------------------------------------------------------------
-It would be nice if there were some way for an autoconf macro to add
-code to be run at the same time as the `EXTRA-CMDS' argument to
-AC_OUTPUT.
-it would be most useful if it could be
-run any number of times (and have all the command concatenated).
-
-From: Tom Tromey <tromey@creche.cygnus.com>
-
-------------------------------------------------------------------------------
-
I'd much prefer to see the absolute paths substituted for all the
standard "dir" variables. It would be nice to have variables in
configure that held the absolute paths. And it is nice to be able to
------------------------------------------------------------------------------
-Is it safe to remove the getpagesize references from AC_FUNC_MMAP?
+Modify the meaning of autoheader --localdir to add an additional
+directory to look for acconfig.h instead of replacing the directory
+containing configure.in. Also, autoreconf recurses on all
+subdirectories containing a configure.in, not just those given by an
+AC_CONFIG_SUBDIRS directive, so you can't have both directories that
+are parts of a large package, and directories that are independent
+packages.
+
+Marc Horowitz <marc@MIT.EDU>
+
+------------------------------------------------------------------------------
+
+in order to use the AC_CANONICAL_SYSTEM macro, I have to
+have install-sh somewhere nearby --- why is this? I have no real
+reason to distribute install-sh, other than that its absence breaks
+this code.
+
+Shouldn't the above loop be looking for config.sub and config.guess?
+From: jimb@totoro.bio.indiana.edu (Jim Blandy)
+
+adding AC_CANONICAL_HOST to my configure.in script caused
+all sorts of odd/unexplained errors. Obviously, I had to go
+get copies of config.guess, config.sub and install-sh from the
+autoconf distribution, but the error messages and autoconf docs
+didn't explain that very well.
+From: bostic@bsdi.com (Keith Bostic)
------------------------------------------------------------------------------
+Perhaps also have AC_TRY_COMPILER try to link an invalid program, and
+die if the compiler seemed to succeed--in which case it's not usable
+with autoconf scripts.
+
+------------------------------------------------------------------------------
undefine([AC_VAR_NAME])dnl
])
-dnl Check whether the current compiler produces executables, and
-dnl whether those executables are native to the build system.
+dnl Sets WORKING_VAR to yes if the current compiler works, else no;
+dnl sets CROSS-VAR to yes if it produces non-native executables, else no.
dnl Before calling this, call AC_LANG_* to set the right language.
-dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-CACHE-ID, CROSS-CACHE-ID)
+dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
AC_DEFUN(AC_TRY_COMPILER,
[cat > conftest.$ac_ext <<EOF
[#]line __oline__ "configure"
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest && (./conftest; exit) 2>/dev/null
then
- ifelse([$2], , :, [rm -rf conftest*
- $2])
+dnl Don't remove the temporary files here, so they can be examined.
+ ifelse([$2], , :, [$2])
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_CPP(dnl
-changequote(<<<,>>>)dnl
-<<<$1[^a-zA-Z_0-9]>>>dnl
+changequote(<<,>>)dnl
+<<$1[^a-zA-Z_0-9]>>dnl
changequote([,]), [#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
dnl link name in DEST...
dnl AC_LINK_FILES(SOURCE..., DEST...)
AC_DEFUN(AC_LINK_FILES,
-[define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])])
+[dnl
+define([AC_LIST_FILES], ifdef([AC_LIST_FILES], [AC_LIST_FILES ],)[$1])dnl
+define([AC_LIST_LINKS], ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$2])])
+
+dnl Add additional commands for AC_OUTPUT to put into config.status.
+dnl I have concluded that m4's quoting rules make it impossible to
+dnl make this robust in the presence of commas in $1 or $2 and
+dnl an arbitrary number of calls. I tried putting the defines
+dnl inside the ifdefs, with no success that way either. -djm
+dnl AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
+AC_DEFUN(AC_OUTPUT_COMMANDS,
+[dnl
+define([AC_LIST_EXTRA], ifdef([AC_LIST_EXTRA], [AC_LIST_EXTRA
+],)[$1])dnl
+define([AC_LIST_INIT], ifdef([AC_LIST_INIT], [AC_LIST_INIT
+],)[$2])])
dnl AC_CONFIG_SUBDIRS(DIR ...)
AC_DEFUN(AC_CONFIG_SUBDIRS,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-define([AC_LIST_SUBDIRS], [$1])dnl
+define([AC_LIST_SUBDIRS], ifdef([AC_LIST_SUBDIRS], [AC_LIST_SUBDIRS ],)[$1])dnl
subdirs="AC_LIST_SUBDIRS"
AC_SUBST(subdirs)dnl
])
AC_OUTPUT_FILES($1)
ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_FILES, AC_LIST_LINKS)])dnl
-ifelse([$3], , ,
+ifelse([$3][AC_LIST_INIT], , ,
[EOF
cat >> $CONFIG_STATUS <<EOF
+ifdef([AC_LIST_INIT], [AC_LIST_INIT
+],)[]dnl
$3
EOF
cat >> $CONFIG_STATUS <<\EOF])
+ifdef([AC_LIST_EXTRA], [AC_LIST_EXTRA
+],)[]dnl
$2
exit 0
EOF
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
-dnl Specifying an input file breaks the trap to clean up on interrupt,
-dnl but that's not a huge problem.
- # Support "outfile[:infile]", defaulting infile="outfile.in".
+changequote(, )dnl
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
-changequote(, )dnl
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
changequote([, ])dnl
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# $configure_input" ;;
*) ac_comsub= ;;
esac
+
+ 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
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_given_srcdir/$ac_file_in | (eval "$ac_sed_cmds") > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
dnl This would break Makefile dependencies.
dnl if cmp -s $ac_file conftest.out 2>/dev/null; then
dnl echo "$ac_file is unchanged"
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
+changequote(, )dnl
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
+changequote([, ])dnl
echo creating $ac_file
rm -f conftest.frag conftest.in conftest.out
- cp $ac_given_srcdir/$ac_file_in conftest.in
+ 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
EOF
AC_MSG_CHECKING(for a BSD compatible install)
if test -z "$INSTALL"; then
AC_CACHE_VAL(ac_cv_path_install,
-[ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
;;
esac
done
- IFS="$ac_save_ifs"
+ IFS="$ac_save_IFS"
])dnl
if test "${ac_cv_path_install+set}" = set; then
INSTALL="$ac_cv_path_install"
optional other files resulting from configuration. The only other
required macro is @code{AC_INIT} (@pxref{Input}).
-@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{] [,}@var{init-cmds}@r{]})
+@defmac AC_OUTPUT (@r{[}@var{file}@dots{} @r{[}, @var{extra-cmds} @r{[}, @var{init-cmds}@r{]]]})
@maindex OUTPUT
Create output files. Call this macro once, at the end of @file{configure.in}.
The @var{file}@dots{} argument is a
AC_OUTPUT(Makefile src/Makefile man/Makefile X/Imakefile)
@end example
-You can override an input file name by appending it to @var{file},
-separated by a colon. For example,
+You can override an input file name by appending to @var{file} a
+colon-separated list of input files. Examples:
@example
AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk)
+AC_OUTPUT(Makefile:templates/vars.mk:Makefile.in:templates/rules.mk)
@end example
+Doing this allows you to keep your file names acceptable to MS-DOS, or
+to prepend and/or append boilerplate to the file.
If you pass @var{extra-cmds}, those commands will be inserted into
@file{config.status} to be run after all its other processing. If
@var{extra-cmds}, with shell variable, command, and backslash
substitutions performed on them in @code{configure}. You can use
@var{init-cmds} to pass variables from @code{configure} to the
-@var{extra-cmds}.
+@var{extra-cmds}. If @code{AC_OUTPUT_COMMANDS} has been called, the
+commands given to it are run just before the commands passed to this macro.
+@end defmac
+
+@defmac AC_OUTPUT_COMMANDS (@var{extra-cmds} @r{[}, @var{init-cmds}@r{]})
+Specify additional shell commands to run at the end of
+@file{config.status}, and shell commands to initialize any variables
+from @code{configure}. This macro may be called multiple times.
+If the shell commands contain commas, you must add an extra layer of
+@code{m4} quotes for each additional time you call this macro, due to
+the insanity of @code{m4} quoting. Like this:
+
+@example
+fubar=27
+AC_OUTPUT_COMMANDS([[echo this is extra $fubar, and so on.]], fubar=$fubar)
+AC_OUTPUT_COMMANDS([[echo this is another, extra, bit]], [[echo init, bit]])
+@end example
@end defmac
If you run @code{make} on subdirectories, you should run it using the
files that depend on the header file to be recompiled.
Usually the input file is named @file{@var{header-to-create}.in};
-however, you can override the input file name by appending it to
-@var{header-to-create}, separated by a colon. For example,
+however, you can override the input file name by appending to
+@var{header-to-create}, a colon-separated list of input files.
+Examples:
@example
AC_CONFIG_HEADER(defines.h:defines.hin)
+AC_CONFIG_HEADER(defines.h:defs.pre:defines.h.in:defs.post)
@end example
@noindent
-Doing this allows you to keep your file names acceptable to MS-DOS.
+Doing this allows you to keep your file names acceptable to MS-DOS, or
+to prepend and/or append boilerplate to the file.
@end defmac
@menu
configure whichever parts of a large source tree are present. If a
given @var{dir} contains @file{configure.in} but no @code{configure},
the Cygnus @code{configure} script found by @code{AC_CONFIG_AUXDIR} is
-used. The subdirectory @code{configure} scripts are given the same
+used.
+
+The subdirectory @code{configure} scripts are given the same
command line options that were given to this @code{configure} script,
with minor changes if needed (e.g., to adjust a relative path for the
cache file or source directory). This macro also sets the output
variable @code{subdirs} to the list of directories @samp{@var{dir}
@dots{}}. @file{Makefile} rules can use this variable to determine
-which subdirectories to recurse into.
+which subdirectories to recurse into. This macro may be called multiple
+times.
@end defmac
@node Default Prefix, Versions, Subdirectories, Setup
the corresponding link name @var{dest}. Makes a symbolic link if
possible, otherwise a hard link. The @var{dest} and @var{source} names
should be relative to the top level source or build directory.
+This macro may be called multiple times.
For example, this call:
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.11
+# Generated automatically using autoconf version 2.11.1
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.11"
+ echo "configure generated by autoconf version 2.11.1"
exit 0 ;;
-with-* | --with-*)
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
;;
esac
done
- IFS="$ac_save_ifs"
+ IFS="$ac_save_IFS"
fi
if test "${ac_cv_path_install+set}" = set; then
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.11"
+ echo "$CONFIG_STATUS generated by autoconf version 2.11.1"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
# $configure_input" ;;
*) ac_comsub= ;;
esac
+
+ 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_given_srcdir/$ac_file_in | eval "$ac_sed_cmds" > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*
+EOF
+cat >> $CONFIG_STATUS <<EOF
+EOF
+cat >> $CONFIG_STATUS <<\EOF
exit 0
EOF
optional other files resulting from configuration. The only other
required macro is @code{AC_INIT} (@pxref{Input}).
-@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{] [,}@var{init-cmds}@r{]})
+@defmac AC_OUTPUT (@r{[}@var{file}@dots{} @r{[}, @var{extra-cmds} @r{[}, @var{init-cmds}@r{]]]})
@maindex OUTPUT
Create output files. Call this macro once, at the end of @file{configure.in}.
The @var{file}@dots{} argument is a
AC_OUTPUT(Makefile src/Makefile man/Makefile X/Imakefile)
@end example
-You can override an input file name by appending it to @var{file},
-separated by a colon. For example,
+You can override an input file name by appending to @var{file} a
+colon-separated list of input files. Examples:
@example
AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk)
+AC_OUTPUT(Makefile:templates/vars.mk:Makefile.in:templates/rules.mk)
@end example
+Doing this allows you to keep your file names acceptable to MS-DOS, or
+to prepend and/or append boilerplate to the file.
If you pass @var{extra-cmds}, those commands will be inserted into
@file{config.status} to be run after all its other processing. If
@var{extra-cmds}, with shell variable, command, and backslash
substitutions performed on them in @code{configure}. You can use
@var{init-cmds} to pass variables from @code{configure} to the
-@var{extra-cmds}.
+@var{extra-cmds}. If @code{AC_OUTPUT_COMMANDS} has been called, the
+commands given to it are run just before the commands passed to this macro.
+@end defmac
+
+@defmac AC_OUTPUT_COMMANDS (@var{extra-cmds} @r{[}, @var{init-cmds}@r{]})
+Specify additional shell commands to run at the end of
+@file{config.status}, and shell commands to initialize any variables
+from @code{configure}. This macro may be called multiple times.
+If the shell commands contain commas, you must add an extra layer of
+@code{m4} quotes for each additional time you call this macro, due to
+the insanity of @code{m4} quoting. Like this:
+
+@example
+fubar=27
+AC_OUTPUT_COMMANDS([[echo this is extra $fubar, and so on.]], fubar=$fubar)
+AC_OUTPUT_COMMANDS([[echo this is another, extra, bit]], [[echo init, bit]])
+@end example
@end defmac
If you run @code{make} on subdirectories, you should run it using the
files that depend on the header file to be recompiled.
Usually the input file is named @file{@var{header-to-create}.in};
-however, you can override the input file name by appending it to
-@var{header-to-create}, separated by a colon. For example,
+however, you can override the input file name by appending to
+@var{header-to-create}, a colon-separated list of input files.
+Examples:
@example
AC_CONFIG_HEADER(defines.h:defines.hin)
+AC_CONFIG_HEADER(defines.h:defs.pre:defines.h.in:defs.post)
@end example
@noindent
-Doing this allows you to keep your file names acceptable to MS-DOS.
+Doing this allows you to keep your file names acceptable to MS-DOS, or
+to prepend and/or append boilerplate to the file.
@end defmac
@menu
configure whichever parts of a large source tree are present. If a
given @var{dir} contains @file{configure.in} but no @code{configure},
the Cygnus @code{configure} script found by @code{AC_CONFIG_AUXDIR} is
-used. The subdirectory @code{configure} scripts are given the same
+used.
+
+The subdirectory @code{configure} scripts are given the same
command line options that were given to this @code{configure} script,
with minor changes if needed (e.g., to adjust a relative path for the
cache file or source directory). This macro also sets the output
variable @code{subdirs} to the list of directories @samp{@var{dir}
@dots{}}. @file{Makefile} rules can use this variable to determine
-which subdirectories to recurse into.
+which subdirectories to recurse into. This macro may be called multiple
+times.
@end defmac
@node Default Prefix, Versions, Subdirectories, Setup
the corresponding link name @var{dest}. Makes a symbolic link if
possible, otherwise a hard link. The @var{dest} and @var{source} names
should be relative to the top level source or build directory.
+This macro may be called multiple times.
For example, this call:
undefine([AC_VAR_NAME])dnl
])
-dnl Check whether the current compiler produces executables, and
-dnl whether those executables are native to the build system.
+dnl Sets WORKING_VAR to yes if the current compiler works, else no;
+dnl sets CROSS-VAR to yes if it produces non-native executables, else no.
dnl Before calling this, call AC_LANG_* to set the right language.
-dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-CACHE-ID, CROSS-CACHE-ID)
+dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR)
AC_DEFUN(AC_TRY_COMPILER,
[cat > conftest.$ac_ext <<EOF
[#]line __oline__ "configure"
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest && (./conftest; exit) 2>/dev/null
then
- ifelse([$2], , :, [rm -rf conftest*
- $2])
+dnl Don't remove the temporary files here, so they can be examined.
+ ifelse([$2], , :, [$2])
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_CPP(dnl
-changequote(<<<,>>>)dnl
-<<<$1[^a-zA-Z_0-9]>>>dnl
+changequote(<<,>>)dnl
+<<$1[^a-zA-Z_0-9]>>dnl
changequote([,]), [#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
dnl link name in DEST...
dnl AC_LINK_FILES(SOURCE..., DEST...)
AC_DEFUN(AC_LINK_FILES,
-[define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])])
+[dnl
+define([AC_LIST_FILES], ifdef([AC_LIST_FILES], [AC_LIST_FILES ],)[$1])dnl
+define([AC_LIST_LINKS], ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$2])])
+
+dnl Add additional commands for AC_OUTPUT to put into config.status.
+dnl I have concluded that m4's quoting rules make it impossible to
+dnl make this robust in the presence of commas in $1 or $2 and
+dnl an arbitrary number of calls. I tried putting the defines
+dnl inside the ifdefs, with no success that way either. -djm
+dnl AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
+AC_DEFUN(AC_OUTPUT_COMMANDS,
+[dnl
+define([AC_LIST_EXTRA], ifdef([AC_LIST_EXTRA], [AC_LIST_EXTRA
+],)[$1])dnl
+define([AC_LIST_INIT], ifdef([AC_LIST_INIT], [AC_LIST_INIT
+],)[$2])])
dnl AC_CONFIG_SUBDIRS(DIR ...)
AC_DEFUN(AC_CONFIG_SUBDIRS,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-define([AC_LIST_SUBDIRS], [$1])dnl
+define([AC_LIST_SUBDIRS], ifdef([AC_LIST_SUBDIRS], [AC_LIST_SUBDIRS ],)[$1])dnl
subdirs="AC_LIST_SUBDIRS"
AC_SUBST(subdirs)dnl
])
AC_OUTPUT_FILES($1)
ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_FILES, AC_LIST_LINKS)])dnl
-ifelse([$3], , ,
+ifelse([$3][AC_LIST_INIT], , ,
[EOF
cat >> $CONFIG_STATUS <<EOF
+ifdef([AC_LIST_INIT], [AC_LIST_INIT
+],)[]dnl
$3
EOF
cat >> $CONFIG_STATUS <<\EOF])
+ifdef([AC_LIST_EXTRA], [AC_LIST_EXTRA
+],)[]dnl
$2
exit 0
EOF
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
-dnl Specifying an input file breaks the trap to clean up on interrupt,
-dnl but that's not a huge problem.
- # Support "outfile[:infile]", defaulting infile="outfile.in".
+changequote(, )dnl
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
-changequote(, )dnl
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
changequote([, ])dnl
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# $configure_input" ;;
*) ac_comsub= ;;
esac
+
+ 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
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_given_srcdir/$ac_file_in | (eval "$ac_sed_cmds") > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
dnl This would break Makefile dependencies.
dnl if cmp -s $ac_file conftest.out 2>/dev/null; then
dnl echo "$ac_file is unchanged"
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
+changequote(, )dnl
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
+changequote([, ])dnl
echo creating $ac_file
rm -f conftest.frag conftest.in conftest.out
- cp $ac_given_srcdir/$ac_file_in conftest.in
+ 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
EOF
AC_MSG_CHECKING(for a BSD compatible install)
if test -z "$INSTALL"; then
AC_CACHE_VAL(ac_cv_path_install,
-[ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
;;
esac
done
- IFS="$ac_save_ifs"
+ IFS="$ac_save_IFS"
])dnl
if test "${ac_cv_path_install+set}" = set; then
INSTALL="$ac_cv_path_install"
-autoconf_test AC_SIZEOF_TYPE "AC_SIZEOF_TYPE(long *)"
+autoconf_test AC_CHECK_SIZEOF "AC_CHECK_SIZEOF(long *)"