# Files that can be generated, but should be up to date for a distribution.
DISTDEP = info Makefile
# Files to distribute.
-DISTFILES = COPYING ChangeLog INSTALL Makefile.in NEWS README TODO \
+DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL Makefile.in NEWS \
+ README TODO \
acconfig.h acfunctions acgeneral.m4 acheaders acidentifiers \
acmakevars acoldnames.m4 acprograms acspecific.m4 autoconf.info* \
autoconf.sh autoconf.texi install.texi \
files when they are not enclosed in @ signs.
* AC_OUTPUT allows the optional environment variable CONFIG_STATUS to
override the file name "config.status".
+* AC_OUTPUT and AC_CONFIG_HEADER allow you to override the input-file names.
* AC_PROG_INSTALL looks for install.sh in the directory specified by
AC_CONFIG_AUXDIR, or srcdir or srcdir/.. or srcdir/../.. by default.
configure.
* ifnames to list the symbols used in #if and #ifdef directives in a
source tree.
+
+* Changed utilities:
+* autoheader can take pieces of acconfig.h to replace config.h.{top,bot}.
\f
Major changes in release 1.11:
------------------------------------------------------------------------------
-* Support AC_OUTPUT and AC_CONFIG_HEADER creating FILE from other than FILE.in.
-(Design is a problem; might not do it.)
-
-------------------------------------------------------------------------------
-
* Add AC_{INCLUDE,LIB}_DIR? (Noah Friedman's suggestion.)
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-* Integrate aclocal.m4, config.h.top, config.h.bot, config.h.in (?).
-Make autoheader search the resulting file. Use @DEFS@ (?) to
-indicate where autoheader should insert its stuff, defaulting to the
-end.
-
-------------------------------------------------------------------------------
-
* Document chapter addressing misconceptions.
------------------------------------------------------------------------------
undefine([shift])dnl
undefine([format])dnl
dnl
+dnl Some old m4's don't support m4exit. But they provide
+dnl equivalent functionality by core dumping because of the
+dnl long macros we define.
ifdef([__gnu__], , [errprint(Autoconf requires GNU m4.
Install it before installing Autoconf or set the
M4 environment variable to its path name.
CONFIG_FILES=${CONFIG_FILES-"$1"}
for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
# Remove last slash and all that follows it. Not all systems have dirname.
changequote(, )dnl
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
echo creating "$ac_file"
rm -f "$ac_file"
- comment_str="Generated automatically from `echo $ac_file|sed 's|.*/||'`.in by configure."
+ comment_str="Generated automatically from `echo $ac_file_in|sed 's|.*/||'` by configure."
case "$ac_file" in
*.c | *.h | *.C | *.cc | *.m )
ac_comsub="1i\\
$extrasub
dnl Insert the sed substitutions.
undivert(AC_DIVERSION_SED)dnl
-" $ac_given_srcdir/${ac_file}.in > $ac_file
+" $ac_given_srcdir/$ac_file_in > $ac_file
fi; done
ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl
ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS, AC_LIST_FILES)])dnl
CONFIG_HEADERS=${CONFIG_HEADERS-"$1"}
for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
echo creating $ac_file
- cp $ac_given_srcdir/$ac_file.in conftest.h1
+ cp $ac_given_srcdir/$ac_file_in conftest.h1
cp conftest.sed conftest.stm
while :
do
test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4"
MACROFILES="${print_version} ${MACROFILES} ${infile}"
-$M4 $MACROFILES > $tmpout || { st=$?; rm -f $tmpin $tmpout; exit $st; }
+$M4 $MACROFILES > $tmpout || { rm -f $tmpin $tmpout; exit 2; }
if test -n "$print_version"; then
cat $tmpout
test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4"
MACROFILES="${print_version} ${MACROFILES} ${infile}"
-$M4 $MACROFILES > $tmpout || { st=$?; rm -f $tmpin $tmpout; exit $st; }
+$M4 $MACROFILES > $tmpout || { rm -f $tmpin $tmpout; exit 2; }
if test -n "$print_version"; then
cat $tmpout
produce the script. If you write your own feature tests to supplement
those that come with Autoconf, you might also write a file called
@file{aclocal.m4}. If you use a C header file to contain @code{#define}
-directives, you might also write @file{config.h.top},
-@file{config.h.bot}, and @file{acconfig.h}, and you will distribute the
-Autoconf-generated file @file{config.h.in} with the package.
+directives, you might also write @file{acconfig.h}, @file{config.h.top},
+and @file{config.h.bot}, and you will distribute the Autoconf-generated
+file @file{config.h.in} with the package.
Here is a diagram showing how the files that can be used in
configuration are produced. Programs that are executed are suffixed by
rather than copying them from a file, since the possible symbols are
effectively limitless.
-The file that @code{autoheader} creates usually contains only
-@code{#define} and @code{#undef} statements and their accompanying
-comments. However, if a file called @file{@var{file}.top} (typically
-@file{config.h.top}) exists in the current directory, @code{autoheader}
-copies that file to the beginning of its output. Similarly, if
-@file{@var{file}.bot} exists, it copies that file to the end of its output.
+The file that @code{autoheader} creates contains mainly @code{#define}
+and @code{#undef} statements and their accompanying comments. If
+@file{./acconfig.h} contains the string @samp{@@TOP@@},
+@code{autoheader} copies the lines before the line containing
+@samp{@@TOP@@} into the top of the file that it generates. Similarly,
+if @file{./acconfig.h} contains the string @samp{@@BOTTOM@@},
+@code{autoheader} copies the lines after that line to the end of the
+file it generates. Either of those strings may be omitted.
+
+An obsolete way to produce the same effect is to create the files
+@file{@var{file}.top} (typically @file{config.h.top}) and/or
+@file{@var{file}.bot} in the current directory. If they exist,
+@code{autoheader} copies them to the beginning and end, respectively, of
+its output. Their use is discouraged because they have file names that
+contain two periods, and so can not be stored on MS-DOS; also, they are
+two more files to clutter up the directory.
If you give @code{autoheader} an argument, it uses that file instead of
@file{configure.in} and writes the header file to the standard output
allows some changes in configuration without needlessly causing object
files that depend on the header file to be recompiled.
-Your distribution should contain a file @file{@var{header-to-create}.in}
+Your distribution should contain an input file
that looks as you want the final header file to look, including
comments, with default values in the @code{#define} statements. A
default value can be to @code{#undef} the variable instead of to define
it to a value, if your code tests for configuration options using
-@code{#ifdef} instead of @code{#if}.
+@code{#ifdef} instead of @code{#if}. Usually this 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,
+@example
+AC_CONFIG_HEADER(defines.h:defines.hin)
+@end example
+@noindent
+Doing this allows you to keep your filenames acceptable to MS-DOS.
-You can use the program @code{autoheader} to create
-@file{@var{header-to-create}.in} (@pxref{Invoking autoheader}).
+You can use the program @code{autoheader} to create the input file
+(@pxref{Invoking autoheader}).
@end defmac
@defmac AC_CONFIG_SUBDIRS (@var{dir} @dots{})
create the header file that was named as its argument. The argument is
a whitespace-separated list of files to create; if it is omitted, no
files are created. @code{AC_OUTPUT} creates each file @file{@var{file}}
-in the list by copying @file{@var{file}.in}, substituting the variable
-values that have been selected by calling @code{AC_SUBST}. It creates
-the directory that each file is in if it doesn't exist (but not the
-parents of that directory). A plausible value for the argument to
-@code{AC_OUTPUT} is @samp{Makefile src/Makefile man/Makefile
-X/Imakefile}.
+in the list by copying an input file (by default named
+@file{@var{file}.in}), substituting the variable values that have been
+selected by calling @code{AC_SUBST}. It creates the directory that each
+file is in if it doesn't exist (but not the parents of that directory).
+A plausible value for the argument to @code{AC_OUTPUT} is @samp{Makefile
+src/Makefile man/Makefile X/Imakefile}.
+
+You can override an input file name by appending it to @var{file},
+separated by a colon. For example,
+@example
+AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk)
+@end example
If you pass @var{extra-cmds}, those commands will be inserted into
@file{config.status} to be run after all its other processing.
exec > $tmpout
fi
+# Support "outfile[:infile]", defaulting infile="outfile.in".
+case "$config_h" in
+*:*) config_h_in=`echo "$config_h"|sed 's%.*:%%'`
+ config_h=`echo "$config_h"|sed 's%:.*%%'` ;;
+*) config_h_in="${config_h}.in" ;;
+esac
+
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
-echo "/* ${config_h}.in. Generated automatically from $infile by autoheader. */"
+echo "/* ${config_h_in}. Generated automatically from $infile by autoheader. */"
-test -f ${config_h}.top && cat ${config_h}.top
+test -r ${config_h}.top && cat ${config_h}.top
+test -r acconfig.h && grep @TOP@ acconfig.h >/dev/null &&
+ sed '/@TOP@/,$d' acconfig.h
# This puts each template paragraph on its own line, separated by @s.
if test -n "$syms"; then
#undef HAVE_LIB${sym}"
done
+test -r acconfig.h && grep @BOTTOM@ acconfig.h >/dev/null &&
+ sed '1,/@BOTTOM@/d' acconfig.h
test -f ${config_h}.bot && cat ${config_h}.bot
status=0
if test $# -eq 0; then
if test $status -eq 0; then
- if cmp -s $tmpout ${config_h}.in; then
+ if cmp -s $tmpout ${config_h_in}; then
rm -f $tmpout
else
- mv -f $tmpout ${config_h}.in
+ mv -f $tmpout ${config_h_in}
fi
else
rm -f $tmpout
exec > $tmpout
fi
+# Support "outfile[:infile]", defaulting infile="outfile.in".
+case "$config_h" in
+*:*) config_h_in=`echo "$config_h"|sed 's%.*:%%'`
+ config_h=`echo "$config_h"|sed 's%:.*%%'` ;;
+*) config_h_in="${config_h}.in" ;;
+esac
+
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
-echo "/* ${config_h}.in. Generated automatically from $infile by autoheader. */"
+echo "/* ${config_h_in}. Generated automatically from $infile by autoheader. */"
-test -f ${config_h}.top && cat ${config_h}.top
+test -r ${config_h}.top && cat ${config_h}.top
+test -r acconfig.h && grep @TOP@ acconfig.h >/dev/null &&
+ sed '/@TOP@/,$d' acconfig.h
# This puts each template paragraph on its own line, separated by @s.
if test -n "$syms"; then
#undef HAVE_LIB${sym}"
done
+test -r acconfig.h && grep @BOTTOM@ acconfig.h >/dev/null &&
+ sed '1,/@BOTTOM@/d' acconfig.h
test -f ${config_h}.bot && cat ${config_h}.bot
status=0
if test $# -eq 0; then
if test $status -eq 0; then
- if cmp -s $tmpout ${config_h}.in; then
+ if cmp -s $tmpout ${config_h_in}; then
rm -f $tmpout
else
- mv -f $tmpout ${config_h}.in
+ mv -f $tmpout ${config_h_in}
fi
else
rm -f $tmpout
test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4"
MACROFILES="${print_version} ${MACROFILES} ${infile}"
-$M4 $MACROFILES > $tmpout || { st=$?; rm -f $tmpin $tmpout; exit $st; }
+$M4 $MACROFILES > $tmpout || { rm -f $tmpin $tmpout; exit 2; }
if test -n "$print_version"; then
cat $tmpout
exec > $tmpout
fi
+# Support "outfile[:infile]", defaulting infile="outfile.in".
+case "$config_h" in
+*:*) config_h_in=`echo "$config_h"|sed 's%.*:%%'`
+ config_h=`echo "$config_h"|sed 's%:.*%%'` ;;
+*) config_h_in="${config_h}.in" ;;
+esac
+
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
-echo "/* ${config_h}.in. Generated automatically from $infile by autoheader. */"
+echo "/* ${config_h_in}. Generated automatically from $infile by autoheader. */"
-test -f ${config_h}.top && cat ${config_h}.top
+test -r ${config_h}.top && cat ${config_h}.top
+test -r acconfig.h && grep @TOP@ acconfig.h >/dev/null &&
+ sed '/@TOP@/,$d' acconfig.h
# This puts each template paragraph on its own line, separated by @s.
if test -n "$syms"; then
#undef HAVE_LIB${sym}"
done
+test -r acconfig.h && grep @BOTTOM@ acconfig.h >/dev/null &&
+ sed '1,/@BOTTOM@/d' acconfig.h
test -f ${config_h}.bot && cat ${config_h}.bot
status=0
if test $# -eq 0; then
if test $status -eq 0; then
- if cmp -s $tmpout ${config_h}.in; then
+ if cmp -s $tmpout ${config_h_in}; then
rm -f $tmpout
else
- mv -f $tmpout ${config_h}.in
+ mv -f $tmpout ${config_h_in}
fi
else
rm -f $tmpout
# Files that can be generated, but should be up to date for a distribution.
DISTDEP = info Makefile
# Files to distribute.
-DISTFILES = COPYING ChangeLog INSTALL Makefile.in NEWS README TODO \
+DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL Makefile.in NEWS \
+ README TODO \
acconfig.h acfunctions acgeneral.m4 acheaders acidentifiers \
acmakevars acoldnames.m4 acprograms acspecific.m4 autoconf.info* \
autoconf.sh autoconf.texi install.texi \
produce the script. If you write your own feature tests to supplement
those that come with Autoconf, you might also write a file called
@file{aclocal.m4}. If you use a C header file to contain @code{#define}
-directives, you might also write @file{config.h.top},
-@file{config.h.bot}, and @file{acconfig.h}, and you will distribute the
-Autoconf-generated file @file{config.h.in} with the package.
+directives, you might also write @file{acconfig.h}, @file{config.h.top},
+and @file{config.h.bot}, and you will distribute the Autoconf-generated
+file @file{config.h.in} with the package.
Here is a diagram showing how the files that can be used in
configuration are produced. Programs that are executed are suffixed by
rather than copying them from a file, since the possible symbols are
effectively limitless.
-The file that @code{autoheader} creates usually contains only
-@code{#define} and @code{#undef} statements and their accompanying
-comments. However, if a file called @file{@var{file}.top} (typically
-@file{config.h.top}) exists in the current directory, @code{autoheader}
-copies that file to the beginning of its output. Similarly, if
-@file{@var{file}.bot} exists, it copies that file to the end of its output.
+The file that @code{autoheader} creates contains mainly @code{#define}
+and @code{#undef} statements and their accompanying comments. If
+@file{./acconfig.h} contains the string @samp{@@TOP@@},
+@code{autoheader} copies the lines before the line containing
+@samp{@@TOP@@} into the top of the file that it generates. Similarly,
+if @file{./acconfig.h} contains the string @samp{@@BOTTOM@@},
+@code{autoheader} copies the lines after that line to the end of the
+file it generates. Either of those strings may be omitted.
+
+An obsolete way to produce the same effect is to create the files
+@file{@var{file}.top} (typically @file{config.h.top}) and/or
+@file{@var{file}.bot} in the current directory. If they exist,
+@code{autoheader} copies them to the beginning and end, respectively, of
+its output. Their use is discouraged because they have file names that
+contain two periods, and so can not be stored on MS-DOS; also, they are
+two more files to clutter up the directory.
If you give @code{autoheader} an argument, it uses that file instead of
@file{configure.in} and writes the header file to the standard output
allows some changes in configuration without needlessly causing object
files that depend on the header file to be recompiled.
-Your distribution should contain a file @file{@var{header-to-create}.in}
+Your distribution should contain an input file
that looks as you want the final header file to look, including
comments, with default values in the @code{#define} statements. A
default value can be to @code{#undef} the variable instead of to define
it to a value, if your code tests for configuration options using
-@code{#ifdef} instead of @code{#if}.
+@code{#ifdef} instead of @code{#if}. Usually this 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,
+@example
+AC_CONFIG_HEADER(defines.h:defines.hin)
+@end example
+@noindent
+Doing this allows you to keep your filenames acceptable to MS-DOS.
-You can use the program @code{autoheader} to create
-@file{@var{header-to-create}.in} (@pxref{Invoking autoheader}).
+You can use the program @code{autoheader} to create the input file
+(@pxref{Invoking autoheader}).
@end defmac
@defmac AC_CONFIG_SUBDIRS (@var{dir} @dots{})
create the header file that was named as its argument. The argument is
a whitespace-separated list of files to create; if it is omitted, no
files are created. @code{AC_OUTPUT} creates each file @file{@var{file}}
-in the list by copying @file{@var{file}.in}, substituting the variable
-values that have been selected by calling @code{AC_SUBST}. It creates
-the directory that each file is in if it doesn't exist (but not the
-parents of that directory). A plausible value for the argument to
-@code{AC_OUTPUT} is @samp{Makefile src/Makefile man/Makefile
-X/Imakefile}.
+in the list by copying an input file (by default named
+@file{@var{file}.in}), substituting the variable values that have been
+selected by calling @code{AC_SUBST}. It creates the directory that each
+file is in if it doesn't exist (but not the parents of that directory).
+A plausible value for the argument to @code{AC_OUTPUT} is @samp{Makefile
+src/Makefile man/Makefile X/Imakefile}.
+
+You can override an input file name by appending it to @var{file},
+separated by a colon. For example,
+@example
+AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk)
+@end example
If you pass @var{extra-cmds}, those commands will be inserted into
@file{config.status} to be run after all its other processing.
undefine([shift])dnl
undefine([format])dnl
dnl
+dnl Some old m4's don't support m4exit. But they provide
+dnl equivalent functionality by core dumping because of the
+dnl long macros we define.
ifdef([__gnu__], , [errprint(Autoconf requires GNU m4.
Install it before installing Autoconf or set the
M4 environment variable to its path name.
CONFIG_FILES=${CONFIG_FILES-"$1"}
for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
# Remove last slash and all that follows it. Not all systems have dirname.
changequote(, )dnl
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
echo creating "$ac_file"
rm -f "$ac_file"
- comment_str="Generated automatically from `echo $ac_file|sed 's|.*/||'`.in by configure."
+ comment_str="Generated automatically from `echo $ac_file_in|sed 's|.*/||'` by configure."
case "$ac_file" in
*.c | *.h | *.C | *.cc | *.m )
ac_comsub="1i\\
$extrasub
dnl Insert the sed substitutions.
undivert(AC_DIVERSION_SED)dnl
-" $ac_given_srcdir/${ac_file}.in > $ac_file
+" $ac_given_srcdir/$ac_file_in > $ac_file
fi; done
ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl
ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS, AC_LIST_FILES)])dnl
CONFIG_HEADERS=${CONFIG_HEADERS-"$1"}
for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
echo creating $ac_file
- cp $ac_given_srcdir/$ac_file.in conftest.h1
+ cp $ac_given_srcdir/$ac_file_in conftest.h1
cp conftest.sed conftest.stm
while :
do