various little fixes

This commit is contained in:
David MacKenzie 1994-09-05 20:12:21 +00:00
parent 91afa15ab1
commit 5be1a80cca
12 changed files with 416 additions and 312 deletions

View File

@ -211,6 +211,6 @@ dist: $(DISTDEP)
ln $$file $$distname/$$file \
|| { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \
done; \
chmod -R a+rX $$distname; \
chmod -R a+rwX $$distname; \
tar -chz -f $$distname.tar.gz $$distname; \
rm -fr $$distname

7
NEWS
View File

@ -19,7 +19,7 @@ Major changes in release 2.0:
* AC_CACHE_VAL to share results of tests between configure runs.
* AC_DEFUN to define macros, automatically AC_PROVIDE them, and ensure
that macros invoked with AC_REQUIRE don't interrupt other macros.
* AC_CONFIG_AUX_DIR, AC_CANONICAL_SYSTEM, AC_LINK_FILES to
* AC_CONFIG_AUX_DIR, AC_CANONICAL_SYSTEM, AC_CANONICAL_HOST, AC_LINK_FILES to
support deciding unguessable features based on the host and target types.
* AC_CONFIG_SUBDIRS to recursively configure a source tree.
* AC_CHECK_TYPE, which checks whether sys/types.h defines a given type.
@ -29,13 +29,16 @@ Major changes in release 2.0:
* AC_SUBST_FILE, to insert one file into another.
** Changed macros:
* Many macros renamed, but old names are accepted for backward compatibility.
* Many macros renamed systematically, but old names are accepted for
backward compatibility.
* AC_OUTPUT adds the "automatically generated" comment after "#!" lines,
not before them.
* AC_OUTPUT does not replace "prefix" and "exec_prefix" in generated
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 takes an optional argument for passing variables from
configure to config.status.
* AC_OUTPUT and AC_CONFIG_HEADER allow you to override the input-file names.
* AC_OUTPUT automatically substitutes the values of CFLAGS, CXXFLAGS,
CPPFLAGS, and LDFLAGS from the environment, with default values.

5
TODO
View File

@ -20,6 +20,11 @@ Select the right C compiler and POSIX/ANSI C options automatically.
------------------------------------------------------------------------------
* Doc: Centralize information on POSIX, MS-DOS, cross-compiling, and
other important topics.
------------------------------------------------------------------------------
* Split up AC_SUBST substitutions using a loop to accomodate shells
with severely limited here document sizes, if it turns out to be a problem.
I'm not sure whether the limit is on lines or bytes; if bytes, it

View File

@ -24,7 +24,7 @@ dnl
divert(-1)dnl Throw away output until AC_INIT is called.
changequote([, ])
define(AC_ACVERSION, 1.110)
define(AC_ACVERSION, 1.111)
dnl Some old m4's don't support m4exit. But they provide
dnl equivalent functionality by core dumping because of the
@ -171,7 +171,7 @@ exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
norecursion=
no_recursion=
prefix=NONE
program_prefix=
program_suffix=
@ -279,9 +279,9 @@ EOF
| --no-cr | --no-c)
no_create=yes ;;
-norecursion | --norecursion | --norecursio | --norecursi \
| --norecurs | --norecur | --norecu | --norec | --nore | --nor)
norecursion=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
@ -430,7 +430,6 @@ AC_DIVERT_POP()dnl to NORMAL
dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
AC_DEFUN(AC_INIT_PREPARE,
[trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
trap 'rm -fr confdefs* $ac_clean_files' 0
# File descriptor usage:
# 0 unused; standard input
@ -455,15 +454,15 @@ running configure, to aid debugging if configure makes a mistake.
# Save the original args if we used an alternate arg parser.
ac_configure_temp="${configure_args-[$]@}"
# Strip out --no-create and --norecursion so they do not pile up.
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing spaces.
configure_args=
for ac_arg in $ac_configure_temp; do
case "$ac_arg" in
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c) ;;
-norecursion | --norecursion | --norecursio | --norecursi \
| --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
changequote(, )dnl
*[" "]*) configure_args="$configure_args '$ac_arg'" ;;
changequote([, ])dnl
@ -842,7 +841,7 @@ cat > $cache_file <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs. It is not useful on other systems.
# If its contents are invalid for some reason, you may delete or edit it.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already. You can give configure
@ -1266,12 +1265,11 @@ cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
[$1]
EOF
dnl Capture the stderr of cpp.
dnl eval is necessary to expand ac_cpp.
dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
dnl Coherent sh does redirections in the wrong order, so separate them.
# Note: sh -x echos commands on subshell stderr, making this test fail.
ac_err=`(eval "$ac_cpp conftest.${ac_ext} >/dev/null") 2>&1`
dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp.
dnl We used to copy stderr to stdout and capture it in a variable, but
dnl that breaks under sh -x.
eval "$ac_cpp conftest.${ac_ext} >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
ifelse([$2], , :, [rm -rf conftest*
$2])
@ -1456,8 +1454,8 @@ for ac_option
do
case "[\$]ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]configure_args --no-create --norecursion
exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]configure_args --no-create --norecursion ;;
echo running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]configure_args --no-create --no-recursion
exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]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 ;;
@ -1488,12 +1486,14 @@ $2
exit 0
EOF
chmod +x ${CONFIG_STATUS}
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} ${CONFIG_STATUS}
dnl config.status should not do recursion.
ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
])dnl
dnl
dnl This is a subroutine of AC_OUTPUT.
dnl It is called inside configure, outside of config.status.
dnl AC_OUTPUT_MAKE_DEFS()
AC_DEFUN(AC_OUTPUT_MAKE_DEFS,
[# Transform confdefs.h into DEFS.
@ -1511,8 +1511,8 @@ changequote([, ])dnl
EOF
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
rm -f conftest.defs
])dnl
dnl
])
dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted
dnl here document whose contents are going into config.status.
dnl AC_OUTPUT_FILES(FILE...)
@ -1610,8 +1610,8 @@ ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
fi; done
rm -f conftest.subs
])dnl
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_HEADER(HEADER-FILE...)
@ -1706,7 +1706,7 @@ do
done
rm -f conftest.vals
# Now back to your regularly scheduled config.status.
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
@ -1721,8 +1721,8 @@ cat >> ${CONFIG_STATUS} <<\EOF
fi
fi; done
])dnl
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(DEST..., SOURCE...)
@ -1730,34 +1730,35 @@ AC_DEFUN(AC_OUTPUT_LINKS,
[EOF
cat >> ${CONFIG_STATUS} <<EOF
ac_links="$1"
ac_files="$2"
ac_dests="$1"
ac_sources="$2"
EOF
cat >> ${CONFIG_STATUS} <<\EOF
while test -n "${ac_files}"; do
set ${ac_links}; ac_link=[$]1; shift; ac_links=[$]*
set ${ac_files}; ac_file=[$]1; shift; ac_files=[$]*
srcdir=$ac_given_srcdir
while test -n "${ac_sources}"; do
set ${ac_dests}; ac_dest=[$]1; shift; ac_dests=[$]*
set ${ac_sources}; ac_source=[$]1; shift; ac_sources=[$]*
echo "linking ${ac_link} to ${srcdir}/${ac_file}"
echo "linking ${ac_dest} to ${srcdir}/${ac_source}"
if test ! -r ${srcdir}/${ac_file}; then
AC_MSG_ERROR(${srcdir}/${ac_file}: File not found)
if test ! -r ${srcdir}/${ac_source}; then
AC_MSG_ERROR(${srcdir}/${ac_source}: File not found)
fi
rm -f ${ac_link}
rm -f ${ac_dest}
# Make a symlink if possible; otherwise try a hard link.
if ln -s ${srcdir}/${ac_file} ${ac_link} 2>/dev/null ||
ln ${srcdir}/${ac_file} ${ac_link}; then :
if ln -s ${srcdir}/${ac_source} ${ac_dest} 2>/dev/null ||
ln ${srcdir}/${ac_source} ${ac_dest}; then :
else
AC_MSG_ERROR(can not link ${ac_link} to ${srcdir}/${ac_file})
AC_MSG_ERROR(can not link ${ac_dest} to ${srcdir}/${ac_source})
fi
done
])dnl
dnl
])
dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
AC_DEFUN(AC_OUTPUT_SUBDIRS,
[
if test "${norecursion}" != yes; then
if test "${no_recursion}" != yes; then
# Remove --cache-file and --srcdir arguments so they do not pile up.
ac_sub_configure_args=

View File

@ -186,6 +186,7 @@ AC_SUBST([SET_MAKE])dnl
AC_DEFUN(AC_PROG_RANLIB,
[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])
dnl Check for mawk first since it's said to be faster.
AC_DEFUN(AC_PROG_AWK,
[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])
@ -303,8 +304,8 @@ AC_CACHE_VAL(ac_cv_path_install,
case "$ac_dir" in
''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
for ac_prog in ginstall installbsd scoinst install; do
# OSF1, X11, and SCO ODT 3.0 have their own names for install.
for ac_prog in ginstall installbsd bsdinst scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
@ -447,7 +448,10 @@ AC_DEFUN(AC_HEADER_DIRENT,
[ac_header_dir=no
AC_CHECK_HEADERS(dirent.h sys/ndir.h sys/dir.h ndir.h,
[ac_header_dir=$ac_hdr; break])
])
AC_DEFUN(AC_FUNC_CLOSEDIR_VOID,
[AC_REQUIRE([AC_HEADER_DIRENT])dnl
AC_MSG_CHECKING(whether closedir returns void)
AC_CACHE_VAL(ac_cv_func_closedir_void,
[AC_TRY_RUN([#include <sys/types.h>
@ -690,7 +694,7 @@ main()
exit(1);
exit(0);
}
], ac_cv_func_mmap=yes, ac_cv_func_mmap=no)])dnl
], ac_cv_func_mmap=yes, ac_cv_func_mmap=no, ac_cv_func_mmap=no)])dnl
AC_MSG_RESULT($ac_cv_func_mmap)
if test $ac_cv_func_mmap = yes; then
AC_DEFINE(HAVE_MMAP)
@ -814,7 +818,7 @@ main() {
|| fstat(fileno(stdout), &st) != 0
);
}
}], ac_cv_func_vfork=yes, ac_cv_func_vfork=no)])dnl
}], ac_cv_func_vfork=yes, ac_cv_func_vfork=no, ac_cv_func_vfork=no)])dnl
AC_MSG_RESULT($ac_cv_func_vfork)
if test $ac_cv_func_vfork = no; then
AC_DEFINE(vfork, fork)
@ -850,7 +854,7 @@ main() {
exit(r.ru_nvcsw == 0
&& r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
}
}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no)])dnl
}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])dnl
AC_MSG_RESULT($ac_cv_func_wait3)
if test $ac_cv_func_wait3 = yes; then
AC_DEFINE(HAVE_WAIT3)
@ -1005,6 +1009,9 @@ if test $ac_cv_struct_nlist_n_un = yes; then
fi
])dnl
dnl FIXME two bugs here:
dnl Hardwiring the path of getloadavg.c in the top-level directory,
dnl and not checking whether a getloadavg from a library needs privileges.
AC_MSG_CHECKING(whether getloadavg requires setgid)
AC_CACHE_VAL(ac_cv_func_getloadavg_setgid,
[AC_EGREP_CPP([Yowza Am I SETGID yet],
@ -1052,7 +1059,8 @@ struct stat s, t;
exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
&& t.st_mtime - s.st_mtime < 120));
}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no)
}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no,
ac_cv_func_utime_null=no)
rm -f core])dnl
AC_MSG_RESULT($ac_cv_func_utime_null)
if test $ac_cv_func_utime_null = yes; then
@ -1069,7 +1077,7 @@ main ()
exit (strcoll ("abc", "def") >= 0 ||
strcoll ("ABC", "DEF") >= 0 ||
strcoll ("123", "456") >= 0);
}], ac_cv_func_strcoll=yes, ac_cv_func_strcoll=no)])dnl
}], ac_cv_func_strcoll=yes, ac_cv_func_strcoll=no, ac_cv_func_strcoll=no)])dnl
AC_MSG_RESULT($ac_cv_func_strcoll)
if test $ac_cv_func_strcoll = yes; then
AC_DEFINE(HAVE_STRCOLL)
@ -1443,6 +1451,7 @@ AC_DEFUN(AC_PATH_X,
# --without-x overrides everything else, but does not touch the cache.
AC_MSG_CHECKING(for X)
AC_ARG_WITH(x, [ --with-x use the X Window System])
if test "x$with_x" = xno; then
no_x=yes
else

View File

@ -6,9 +6,9 @@
@c @setchapternewpage odd
@c %**end of header
@set EDITION 1.110
@set VERSION 1.110
@set UPDATED August 1994
@set EDITION 1.111
@set VERSION 1.111
@set UPDATED September 1994
@iftex
@finalout
@ -17,7 +17,7 @@
@ifinfo
@format
START-INFO-DIR-ENTRY
* autoconf: (autoconf). The Autoconf configuration system.
* Autoconf: (autoconf). Create source code configuration scripts.
END-INFO-DIR-ENTRY
@end format
@ -194,6 +194,7 @@ Dependencies Between Macros
Test Programs
* Alternatives:: Approaches preferred over test programs.
* Guidelines:: General rules for writing test programs.
* Test Functions:: Special ways to work around problems.
@ -274,7 +275,7 @@ independent of Autoconf when they are run, so their users do not need to
have Autoconf.
The configuration scripts produced by Autoconf require no manual user
intervention when run; they do not normally even take an argument
intervention when run; they do not normally even need an argument
specifying the system type. Instead, they test for the presence of each
feature that the software package they are for might need individually.
(Before each check, they print a one-line message stating what they are
@ -285,13 +286,13 @@ need to maintain files that list the features supported by each release
of each variant of UNIX.
For each software package that Autoconf is used with, it creates a
configuration script from a template file that lists the operating
system features that the package can use. After the shell code to
recognize and respond to an operating system feature has been written,
configuration script from a template file that lists the
system features that the package needs or can use. After the shell code to
recognize and respond to a system feature has been written,
Autoconf allows it to be shared by many software packages that can
use (or need) that feature. If it later turns out that the shell code
needs adjustment for some reason, it needs to be changed in only one
place; all of the the configuration scripts can be regenerated
place; all of the configuration scripts can be regenerated
automatically to take advantage of the updated code.
Larry Wall's Metaconfig package is similar in purpose to Autoconf, but
@ -472,7 +473,7 @@ dnl Process this file with autoconf to produce a configure script.
@end example
@node Invoking autoconf, Invoking autoheader, Writing configure.in, Making configure Scripts
@section Invoking @code{autoconf}
@section Using @code{autoconf} to Create @file{configure}
To create @code{configure} from @file{configure.in}, run the
@code{autoconf} program with no arguments. @code{autoconf} processes
@ -489,7 +490,7 @@ distributed with Autoconf; @code{autoconf} reads them first. Then it
looks for the optional file @file{acsite.m4} in the directory that
contains the distributed Autoconf macro files, and for the optional file
@file{aclocal.m4} in the current directory. Those files can contain
your site's own locally written Autoconf macro definitions
your site's or the package's own Autoconf macro definitions
(@pxref{Writing Macros}, for more information). If a macro is defined
in more than one of the files that @code{autoconf} reads, the last
definition it reads overrides the earlier ones.
@ -505,7 +506,7 @@ the Autoconf version number and exits, and @code{--help}, which prints a
summary of the command-line options and exits.
@node Invoking autoheader, Invoking autoscan, Invoking autoconf, Making configure Scripts
@section Invoking @code{autoheader}
@section Using @code{autoheader} to Create @file{config.h.in}
You can use the @code{autoheader} program to create a template file of C
@samp{#define} statements for @code{configure} to use. By default, the
@ -518,13 +519,12 @@ preprocessor symbols it might define. It copies comments and
@code{#define} and @code{#undef} statements from a file called
@file{acconfig.h}, which comes with and is installed with Autoconf. It
also uses a file called @file{acconfig.h} in the current directory, if
present; you must create that file to contain entries for any additional
symbols that you @code{AC_DEFINE}. For symbols defined by
present. If you @code{AC_DEFINE} any additional symbols, you must
create that file with entries for them. For symbols defined by
@code{AC_CHECK_HEADERS}, @code{AC_CHECK_FUNCS}, @code{AC_CHECK_SIZEOF},
or @code{AC_CHECK_LIB},
@code{autoheader} generates comments and @code{#undef} statements itself
rather than copying them from a file, since the possible symbols are
effectively limitless.
or @code{AC_CHECK_LIB}, @code{autoheader} generates comments and
@code{#undef} statements itself rather than copying them from a file,
since the possible symbols are effectively limitless.
The file that @code{autoheader} creates contains mainly @code{#define}
and @code{#undef} statements and their accompanying comments. If
@ -541,7 +541,8 @@ An obsolete way to produce the same effect is to create the files
@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.
two more files to clutter up the directory. (@pxref{Output}, for more
information about avoiding file names that MS-DOS cannot store.)
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
@ -561,7 +562,7 @@ the Autoconf version number and exits, and @code{--help}, which prints a
summary of the command-line options and exits.
@node Invoking autoscan, Invoking ifnames, Invoking autoheader, Making configure Scripts
@section Invoking @code{autoscan}
@section Using @code{autoscan} to Create @file{configure.in}
The @code{autoscan} program can help you create a @file{configure.in}
file for a software package. @code{autoscan} examines source files in
@ -569,13 +570,15 @@ the directory tree rooted at a directory given as a command line
argument, or the current directory if none is given. It searches the
source files for common portability problems and creates a file
@file{configure.scan} which is a preliminary @file{configure.in} for
that package. You should manually examine @file{configure.scan} before
renaming it to @file{configure.in}; it will probably need some
adjustments. If you want the package to use a configuration header
file, you will have to add a call to @code{AC_CONFIG_HEADER}. You might
have to change or add some @code{#if} directives to your program in
order to make it work with Autoconf (@pxref{Invoking ifnames}, for
information about a program that might help with that job).
that package.
You should manually examine @file{configure.scan} before renaming it to
@file{configure.in}; it will probably need some adjustments. For
example, if you want the package to use a configuration header file, you
will have to add a call to @code{AC_CONFIG_HEADER}. You might have to
change or add some @code{#if} directives to your program in order to
make it work with Autoconf (@pxref{Invoking ifnames}, for information
about a program that might help with that job).
@code{autoscan} uses several data files, which are installed with the
distributed Autoconf macro files, to determine which macros to output
@ -605,7 +608,7 @@ Print the version number of @code{autoscan} and exit.
@end table
@node Invoking ifnames, Invoking autoreconf, Invoking autoscan, Making configure Scripts
@section Invoking @code{ifnames}
@section Using @code{ifnames} to List Conditionals
@code{ifnames} can help when writing a @file{configure.in} for a
software package. It prints the identifiers used in C preprocessor
@ -637,13 +640,14 @@ Print the version number of @code{ifnames} and exit.
@end table
@node Invoking autoreconf, Invoking autoupdate, Invoking ifnames, Making configure Scripts
@section Invoking @code{autoreconf}
@section Using @code{autoreconf} to Recreate @file{configure}
If you have a lot of Autoconf-generated @code{configure} scripts and you
get a new version of Autoconf, the @code{autoreconf} program can be
handy. It runs @code{autoconf} (and @code{autoheader}, where
appropriate) repeatedly to remake all of the Autoconf @code{configure}
scripts in a directory tree.
scripts in a directory tree. @xref{Automatic Remaking}, for further
information about automatic remaking of @code{configure} scripts.
@noindent
@code{autoreconf} accepts the following options:
@ -668,7 +672,7 @@ Print the version number of @code{autoreconf} and exit.
@end table
@node Invoking autoupdate, , Invoking autoreconf, Making configure Scripts
@section Invoking @code{autoupdate}
@section Using @code{autoupdate} to Modernize @file{configure}
The @code{autoupdate} program updates a @file{configure.in} file that
calls Autoconf macros by their old names to use the current macro names.
@ -743,7 +747,8 @@ Process the command-line arguments and find the source code directory.
@var{unique-file-in-source-dir} is some file that is in the package's
source directory; @code{configure} checks for this file's existence to
make sure that the directory that it is told contains the source code in
fact does (@pxref{Invoking configure}, for more information).
fact does (@pxref{Invoking configure}, for more information). This
macro is required in every @file{configure.in}.
@end defmac
@node Output, Package Options, Input, Operation
@ -807,16 +812,16 @@ Create output files (typically one or more @file{Makefile}s) and
@file{config.status}. If @code{AC_CONFIG_HEADER} has been called, also
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 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}.
files are created. This macro is required in every @file{configure.in}.
You can override an input file name by appending it to @var{file},
separated by a colon. For example,
@code{AC_OUTPUT} creates each file @file{@var{file}} 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
@ -834,16 +839,9 @@ substitutions performed on them in @code{configure}. You can use
@section Checking for Package Options
These macros check whether the user gave @code{configure} command line
arguments to select optional features of the package. These macros may
arguments to select optional features of the package. They may
take an argument to use if the argument was given and one for if it was
not given.
@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex ARG_ENABLE
If the user gave @code{configure} the option
@samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run
shell commands @var{action-if-true}. Otherwise run shell commands
@var{action-if-false}. @var{help-string} is a description of
not given. The argument @var{help-string} is a description of
the option which looks like this:
@example
--enable-editing support fancy command line editing
@ -854,6 +852,13 @@ 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.
@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex ARG_ENABLE
If the user gave @code{configure} the option
@samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run
shell commands @var{action-if-true}. Otherwise run shell commands
@var{action-if-false}.
The name @var{feature} should consist only of alphanumeric characters
and dashes. The @var{feature} indicates an optional user-level
facility. This option allows users to choose which optional features to
@ -881,16 +886,7 @@ require the items to be separated by commas instead.
If the user gave @code{configure} the option @samp{--with-@var{package}}
or @samp{--without-@var{package}}, run shell commands
@var{action-if-true}. Otherwise run shell commands
@var{action-if-false}. @var{help-string} is a description of
the option which looks like this:
@example
--with-gnu-as use the GNU assembler
@end example
@noindent
@var{help-string} may be more than one line long, if more detail is
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.
@var{action-if-false}.
The name @var{package} should consist only of alphanumeric characters
and dashes. The @var{package} indicates another software package that
@ -918,13 +914,13 @@ require the items to be separated by commas instead.
@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex ENABLE
This is an obsolete version of @code{AC_ARG_ENABLE} that does not
provide a help string.
support providing a help string.
@end defmac
@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex WITH
This is an obsolete version of @code{AC_ARG_WITH} that does not
provide a help string.
support providing a help string.
@end defmac
@node Versions, , Package Options, Operation
@ -936,8 +932,12 @@ The following macros manage version numbers for @code{configure} scripts.
@maindex PREREQ
Ensure that a recent enough version of Autoconf is being used. If the
version of Autoconf being used to create @code{configure} is earlier
than @var{version} (e.g., @samp{1.8}), print an error message on the
standard error output and do not create @code{configure}.
than @var{version}, print an error message on the standard error output
and do not create @code{configure}. For example:
@example
AC_PREREQ(1.8)
@end example
This macro is useful if your @file{configure.in} relies on non-obvious
behavior that changed between Autoconf releases. If it merely needs
@ -964,6 +964,7 @@ begins with @samp{#!/bin/sh}, like the normal start of a
For example, this line in @file{configure.in}:
@c The asis prevents RCS from changing the example in the manual.
@example
AC_REVISION($@asis{Revision: 1.30 }$)dnl
@end example
@ -980,7 +981,7 @@ produces this in @file{configure}:
@node Existing Tests, Primitives, Operation, Top
@chapter Existing Tests
These macros test for particular operating system features that packages
These macros test for particular system features that packages
might need or want to use. If you need to test for a kind of feature
that none of these macros check for, you can probably do it by calling
primitive test macros with appropriate arguments (@pxref{Primitives}).
@ -1040,7 +1041,7 @@ is being used. This macro calls @code{AC_PROG_CPP} (or
@code{AC_PROG_CXXCPP} if C++ is the current language, @pxref{Language
Choice}) and @code{AC_PROG_LEX} if they haven't been called already.
This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work.
This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work reliably.
@end defmac
@defmac AC_PROG_AWK
@ -1055,7 +1056,7 @@ finds.
Determine a C compiler to use. If @code{CC} is not already set in the
environment, check for @code{gcc}, and use @code{cc} if it's not found.
Set @code{make} variable @code{CC} to the name of the compiler found.
Set shell variable @code{GCC} to @samp{yes} if it found the GNU C
Set shell variable @code{GCC} to @samp{yes} if using the GNU C
compiler, empty otherwise, and if @code{make} variable @code{CFLAGS} was
not already set, set it to @samp{-g -O} for the GNU C compiler or
@samp{-g} for other compilers.
@ -1091,7 +1092,7 @@ variable @code{CXX} to its value. Otherwise search for a C++ compiler
under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, and
@code{cxx}). If none of those checks succeed, as a last resort set
@code{CXX} to @code{gcc}. Also set shell variable @code{GXX} to
@samp{yes} if it found the GNU C++ compiler, empty otherwise, and if
@samp{yes} if using the GNU C++ compiler, empty otherwise, and if
@code{make} variable @code{CXXFLAGS} was not already set, set it to
@samp{-g -O} for the GNU C++ compiler or @samp{-g} for other compilers.
@end defmac
@ -1276,7 +1277,7 @@ This macro is equivalent to calling @code{AC_CHECK_LIB} with a
@var{function} argument of @code{main}. In addition, @var{library} can
be written as any of @samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}. In
all of those cases, the compiler is passed @samp{-lfoo}. However,
@var{library} can not be a shell variable; it must be a constant.
@var{library} can not be a shell variable; it must be a literal name.
This macro is considered obsolete, because some linkers (e.g., Apollo's)
do not fail when asked to link with a nonexistent library if there are
@ -1316,9 +1317,10 @@ declared in a system header file, either @file{signal.h} or
@cvindex SYSNDIR
@cvindex NDIR
@cvindex VOID_CLOSEDIR
Like @code{AC_HEADER_DIRENT}, but defines a different set of C
preprocessor macros to indicate which header file is found. This macro
and the names it defines are considered obsolete. The names it defines are:
Like calling @code{AC_HEADER_DIRENT} and @code{AC_FUNC_CLOSEDIR_VOID},
but defines a different set of C preprocessor macros to indicate which
header file is found. This macro and the names it defines are
considered obsolete. The names it defines are:
@table @file
@item dirent.h
@ -1334,9 +1336,8 @@ and the names it defines are considered obsolete. The names it defines are:
@code{NDIR}
@end table
Also, if the directory library header file contains a declaration of the
@code{closedir} function with a @code{void} return type, define
@code{VOID_CLOSEDIR}.
If the @code{closedir} function does not return a meaningful value,
define @code{VOID_CLOSEDIR}.
@end defmac
@defmac AC_HEADER_DIRENT
@ -1345,7 +1346,6 @@ Also, if the directory library header file contains a declaration of the
@cvindex HAVE_NDIR_H
@cvindex HAVE_SYS_DIR_H
@cvindex HAVE_SYS_NDIR_H
@cvindex CLOSEDIR_VOID
Check for the the following header files, and for the first one that is
found, define the listed C preprocessor macro:
@ -1363,10 +1363,6 @@ found, define the listed C preprocessor macro:
@code{HAVE_NDIR_H}
@end table
Also, if the directory library header file contains a declaration of the
@code{closedir} function with a @code{void} return type, define
@code{CLOSEDIR_VOID}.
The directory library declarations in the source code should look
something like the following, which assumes that you have also called
@samp{AC_CHECK_HEADERS(unistd.h)}:
@ -1648,7 +1644,7 @@ particular test macros.
@defmac AC_CHECK_TYPE (@var{type}, @var{default})
@maindex CHECK_TYPE
If the type @var{type} is not defined in @file{sys/types.h}, define it
to be the C (or C++) builtin type @var{default}, e.g. @samp{short} or
to be the C (or C++) builtin type @var{default}; e.g., @samp{short} or
@samp{unsigned}.
@end defmac
@ -1738,6 +1734,16 @@ char *alloca ();
@end example
@end defmac
@defmac AC_FUNC_CLOSEDIR_VOID
@maindex FUNC_CLOSEDIR_VOID
@cvindex CLOSEDIR_VOID
If the @code{closedir} function does not return a meaningful value,
define @code{CLOSEDIR_VOID}. Otherwise, callers ought to check its
return value for an error indicator. This macro calls
@code{AC_HEADER_DIRENT} if it has not been called yet already
(@pxref{Particular Headers}).
@end defmac
@defmac AC_FUNC_GETLOADAVG
@maindex FUNC_GETLOADAVG
@cvindex SVR4
@ -2007,7 +2013,8 @@ on the system where @code{configure} is being run, set the shell
variable @code{cross_compiling} to @samp{yes}, otherwise @samp{no}.
This information can be used by @code{AC_TRY_RUN} to determine whether
to take a default action instead of trying to run a test program
(@pxref{C System Output}).
(@pxref{C System Output}). For more information on dealing with
cross-compiling, @xref{Alternatives}.
@end defmac
@defmac AC_C_INLINE
@ -2286,9 +2293,15 @@ not run. If the optional shell commands @var{action-if-cross-compiling}
are given, they are run instead and this macro calls @code{AC_C_CROSS}
if it has not already been called (@pxref{Compiler Characteristics}).
Otherwise, @code{configure} prints an error message and exits.
@code{autoconf} prints a warning message when creating @code{configure}
each time it encounters a call to @code{AC_TRY_RUN} with no
@var{action-if-cross-compiling} argument given. You may ignore the
warning, though users will not be able to configure your package for
cross-compiling. A few of the macros distributed with Autoconf produce
this warning message.
It is preferable to use @code{AC_TRY_LINK} instead of @code{AC_TRY_RUN},
when possible. @xref{Test Programs}, for more information.
when possible. @xref{Test Programs}, for a fuller explanation.
@end defmac
@node Setting Variables, Printing Messages, C System Output, Primitives
@ -2978,23 +2991,38 @@ exists on the system or has a certain value, then you can't use
test program by hand. You can compile and run it using
@code{AC_TRY_RUN} (@pxref{C System Output}).
Try to avoid running test programs if possible, because using them
prevents people from configuring your package for cross-compiling. If
it's really best that you test for a run-time behavior, try to provide a
default ``worst case'' value to use when cross-compiling makes run-time
tests impossible. You do this by passing the optional last argument to
@code{AC_TRY_RUN}. To configure for cross-compiling you can also set up
a test results cache file with the correct values for the target system
(@pxref{Caching Values}). But that is a last resort. Alternatively,
choose a value for those parameters based on the canonical system name
(@pxref{Manual Configuration}).
@menu
* Alternatives:: Approaches preferred over test programs.
* Guidelines:: General rules for writing test programs.
* Test Functions:: Special ways to work around problems.
@end menu
@node Guidelines, Test Functions, , Test Programs
@node Alternatives, Guidelines, , Test Programs
@subsection Alternatives to Test Programs
Avoid running test programs if possible, because using them prevents
people from configuring your package for cross-compiling. If you can,
make the checks at run-time instead of at configure-time. You can check
for things like the machine's endianness when your program initializes
itself instead of when configuring it.
If you still need to test for a run-time behavior while configuring, try
to provide a default pessimistic value to use when cross-compiling
makes run-time tests impossible. You do this by passing the optional
last argument to @code{AC_TRY_RUN}. To configure for cross-compiling
you can also choose a value for those parameters based on the canonical
system name (@pxref{Manual Configuration}). Alternatively, set up a
test results cache file with the correct values for the target system
(@pxref{Caching Values}). But that is a quick-hack solution to the
problem.
To provide a default for calls of @code{AC_TRY_RUN} that are embedded in
other macros, including a few of the ones that come with Autoconf, you
can call @code{AC_C_CROSS} before running them. Then if the shell
variable @code{cross_compiling} is set to @samp{yes}, use an alternate
method to get the results instead of calling the macros.
@node Guidelines, Test Functions, Alternatives, Test Programs
@subsection Guidelines for Test Programs
Test programs should not write anything to the standard output. They
@ -3348,10 +3376,10 @@ i960-*-bout) obj_format=bout ;;
esac
@end example
@defmac AC_LINK_FILES (@var{link} @dots{}, @var{file} @dots{})
@defmac AC_LINK_FILES (@var{dest} @dots{}, @var{source} @dots{})
@maindex LINK_FILES
Link each of the existing files @var{file} to the corresponding link
name @var{link}. Makes a symbolic link if possible, otherwise a hard
Link each of the existing files @var{source} to the corresponding link
name @var{dest}. Makes a symbolic link if possible, otherwise a hard
link. For example, this call:
@example
@ -3541,12 +3569,9 @@ stamp-h.in: configure.in aclocal.m4 acconfig.h config.h.top config.h.bot
touch $@{srcdir@}/stamp-h.in
# config.status might not change config.h
# Don't rerun config.status if we just configured.
# Use || so the command line always returns success.
config.h: stamp-h
stamp-h: config.h.in config.status
test ! -f stamp-h || ./config.status
touch stamp-h
./config.status
Makefile: Makefile.in config.status
./config.status
@ -3556,6 +3581,11 @@ config.status: configure
@end group
@end example
In addition, you should pass @samp{touch stamp-h} in the @var{extra-cmds}
argument to @code{AC_OUTPUT}, so @file{config.status} will ensure that
@file{config.h} is considered up to date. @xref{Output}, for more
information about @code{AC_OUTPUT}.
@xref{Invoking config.status}, for more information on handling
configuration-related dependencies.
@ -3595,7 +3625,7 @@ 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{--norecursion} option,
@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},

View File

@ -211,6 +211,6 @@ dist: $(DISTDEP)
ln $$file $$distname/$$file \
|| { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \
done; \
chmod -R a+rX $$distname; \
chmod -R a+rwX $$distname; \
tar -chz -f $$distname.tar.gz $$distname; \
rm -fr $$distname

View File

@ -6,9 +6,9 @@
@c @setchapternewpage odd
@c %**end of header
@set EDITION 1.110
@set VERSION 1.110
@set UPDATED August 1994
@set EDITION 1.111
@set VERSION 1.111
@set UPDATED September 1994
@iftex
@finalout
@ -17,7 +17,7 @@
@ifinfo
@format
START-INFO-DIR-ENTRY
* autoconf: (autoconf). The Autoconf configuration system.
* Autoconf: (autoconf). Create source code configuration scripts.
END-INFO-DIR-ENTRY
@end format
@ -194,6 +194,7 @@ Dependencies Between Macros
Test Programs
* Alternatives:: Approaches preferred over test programs.
* Guidelines:: General rules for writing test programs.
* Test Functions:: Special ways to work around problems.
@ -274,7 +275,7 @@ independent of Autoconf when they are run, so their users do not need to
have Autoconf.
The configuration scripts produced by Autoconf require no manual user
intervention when run; they do not normally even take an argument
intervention when run; they do not normally even need an argument
specifying the system type. Instead, they test for the presence of each
feature that the software package they are for might need individually.
(Before each check, they print a one-line message stating what they are
@ -285,13 +286,13 @@ need to maintain files that list the features supported by each release
of each variant of UNIX.
For each software package that Autoconf is used with, it creates a
configuration script from a template file that lists the operating
system features that the package can use. After the shell code to
recognize and respond to an operating system feature has been written,
configuration script from a template file that lists the
system features that the package needs or can use. After the shell code to
recognize and respond to a system feature has been written,
Autoconf allows it to be shared by many software packages that can
use (or need) that feature. If it later turns out that the shell code
needs adjustment for some reason, it needs to be changed in only one
place; all of the the configuration scripts can be regenerated
place; all of the configuration scripts can be regenerated
automatically to take advantage of the updated code.
Larry Wall's Metaconfig package is similar in purpose to Autoconf, but
@ -472,7 +473,7 @@ dnl Process this file with autoconf to produce a configure script.
@end example
@node Invoking autoconf, Invoking autoheader, Writing configure.in, Making configure Scripts
@section Invoking @code{autoconf}
@section Using @code{autoconf} to Create @file{configure}
To create @code{configure} from @file{configure.in}, run the
@code{autoconf} program with no arguments. @code{autoconf} processes
@ -489,7 +490,7 @@ distributed with Autoconf; @code{autoconf} reads them first. Then it
looks for the optional file @file{acsite.m4} in the directory that
contains the distributed Autoconf macro files, and for the optional file
@file{aclocal.m4} in the current directory. Those files can contain
your site's own locally written Autoconf macro definitions
your site's or the package's own Autoconf macro definitions
(@pxref{Writing Macros}, for more information). If a macro is defined
in more than one of the files that @code{autoconf} reads, the last
definition it reads overrides the earlier ones.
@ -505,7 +506,7 @@ the Autoconf version number and exits, and @code{--help}, which prints a
summary of the command-line options and exits.
@node Invoking autoheader, Invoking autoscan, Invoking autoconf, Making configure Scripts
@section Invoking @code{autoheader}
@section Using @code{autoheader} to Create @file{config.h.in}
You can use the @code{autoheader} program to create a template file of C
@samp{#define} statements for @code{configure} to use. By default, the
@ -518,13 +519,12 @@ preprocessor symbols it might define. It copies comments and
@code{#define} and @code{#undef} statements from a file called
@file{acconfig.h}, which comes with and is installed with Autoconf. It
also uses a file called @file{acconfig.h} in the current directory, if
present; you must create that file to contain entries for any additional
symbols that you @code{AC_DEFINE}. For symbols defined by
present. If you @code{AC_DEFINE} any additional symbols, you must
create that file with entries for them. For symbols defined by
@code{AC_CHECK_HEADERS}, @code{AC_CHECK_FUNCS}, @code{AC_CHECK_SIZEOF},
or @code{AC_CHECK_LIB},
@code{autoheader} generates comments and @code{#undef} statements itself
rather than copying them from a file, since the possible symbols are
effectively limitless.
or @code{AC_CHECK_LIB}, @code{autoheader} generates comments and
@code{#undef} statements itself rather than copying them from a file,
since the possible symbols are effectively limitless.
The file that @code{autoheader} creates contains mainly @code{#define}
and @code{#undef} statements and their accompanying comments. If
@ -541,7 +541,8 @@ An obsolete way to produce the same effect is to create the files
@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.
two more files to clutter up the directory. (@pxref{Output}, for more
information about avoiding file names that MS-DOS cannot store.)
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
@ -561,7 +562,7 @@ the Autoconf version number and exits, and @code{--help}, which prints a
summary of the command-line options and exits.
@node Invoking autoscan, Invoking ifnames, Invoking autoheader, Making configure Scripts
@section Invoking @code{autoscan}
@section Using @code{autoscan} to Create @file{configure.in}
The @code{autoscan} program can help you create a @file{configure.in}
file for a software package. @code{autoscan} examines source files in
@ -569,13 +570,15 @@ the directory tree rooted at a directory given as a command line
argument, or the current directory if none is given. It searches the
source files for common portability problems and creates a file
@file{configure.scan} which is a preliminary @file{configure.in} for
that package. You should manually examine @file{configure.scan} before
renaming it to @file{configure.in}; it will probably need some
adjustments. If you want the package to use a configuration header
file, you will have to add a call to @code{AC_CONFIG_HEADER}. You might
have to change or add some @code{#if} directives to your program in
order to make it work with Autoconf (@pxref{Invoking ifnames}, for
information about a program that might help with that job).
that package.
You should manually examine @file{configure.scan} before renaming it to
@file{configure.in}; it will probably need some adjustments. For
example, if you want the package to use a configuration header file, you
will have to add a call to @code{AC_CONFIG_HEADER}. You might have to
change or add some @code{#if} directives to your program in order to
make it work with Autoconf (@pxref{Invoking ifnames}, for information
about a program that might help with that job).
@code{autoscan} uses several data files, which are installed with the
distributed Autoconf macro files, to determine which macros to output
@ -605,7 +608,7 @@ Print the version number of @code{autoscan} and exit.
@end table
@node Invoking ifnames, Invoking autoreconf, Invoking autoscan, Making configure Scripts
@section Invoking @code{ifnames}
@section Using @code{ifnames} to List Conditionals
@code{ifnames} can help when writing a @file{configure.in} for a
software package. It prints the identifiers used in C preprocessor
@ -637,13 +640,14 @@ Print the version number of @code{ifnames} and exit.
@end table
@node Invoking autoreconf, Invoking autoupdate, Invoking ifnames, Making configure Scripts
@section Invoking @code{autoreconf}
@section Using @code{autoreconf} to Recreate @file{configure}
If you have a lot of Autoconf-generated @code{configure} scripts and you
get a new version of Autoconf, the @code{autoreconf} program can be
handy. It runs @code{autoconf} (and @code{autoheader}, where
appropriate) repeatedly to remake all of the Autoconf @code{configure}
scripts in a directory tree.
scripts in a directory tree. @xref{Automatic Remaking}, for further
information about automatic remaking of @code{configure} scripts.
@noindent
@code{autoreconf} accepts the following options:
@ -668,7 +672,7 @@ Print the version number of @code{autoreconf} and exit.
@end table
@node Invoking autoupdate, , Invoking autoreconf, Making configure Scripts
@section Invoking @code{autoupdate}
@section Using @code{autoupdate} to Modernize @file{configure}
The @code{autoupdate} program updates a @file{configure.in} file that
calls Autoconf macros by their old names to use the current macro names.
@ -743,7 +747,8 @@ Process the command-line arguments and find the source code directory.
@var{unique-file-in-source-dir} is some file that is in the package's
source directory; @code{configure} checks for this file's existence to
make sure that the directory that it is told contains the source code in
fact does (@pxref{Invoking configure}, for more information).
fact does (@pxref{Invoking configure}, for more information). This
macro is required in every @file{configure.in}.
@end defmac
@node Output, Package Options, Input, Operation
@ -807,16 +812,16 @@ Create output files (typically one or more @file{Makefile}s) and
@file{config.status}. If @code{AC_CONFIG_HEADER} has been called, also
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 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}.
files are created. This macro is required in every @file{configure.in}.
You can override an input file name by appending it to @var{file},
separated by a colon. For example,
@code{AC_OUTPUT} creates each file @file{@var{file}} 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
@ -834,16 +839,9 @@ substitutions performed on them in @code{configure}. You can use
@section Checking for Package Options
These macros check whether the user gave @code{configure} command line
arguments to select optional features of the package. These macros may
arguments to select optional features of the package. They may
take an argument to use if the argument was given and one for if it was
not given.
@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex ARG_ENABLE
If the user gave @code{configure} the option
@samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run
shell commands @var{action-if-true}. Otherwise run shell commands
@var{action-if-false}. @var{help-string} is a description of
not given. The argument @var{help-string} is a description of
the option which looks like this:
@example
--enable-editing support fancy command line editing
@ -854,6 +852,13 @@ 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.
@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex ARG_ENABLE
If the user gave @code{configure} the option
@samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run
shell commands @var{action-if-true}. Otherwise run shell commands
@var{action-if-false}.
The name @var{feature} should consist only of alphanumeric characters
and dashes. The @var{feature} indicates an optional user-level
facility. This option allows users to choose which optional features to
@ -881,16 +886,7 @@ require the items to be separated by commas instead.
If the user gave @code{configure} the option @samp{--with-@var{package}}
or @samp{--without-@var{package}}, run shell commands
@var{action-if-true}. Otherwise run shell commands
@var{action-if-false}. @var{help-string} is a description of
the option which looks like this:
@example
--with-gnu-as use the GNU assembler
@end example
@noindent
@var{help-string} may be more than one line long, if more detail is
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.
@var{action-if-false}.
The name @var{package} should consist only of alphanumeric characters
and dashes. The @var{package} indicates another software package that
@ -918,13 +914,13 @@ require the items to be separated by commas instead.
@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex ENABLE
This is an obsolete version of @code{AC_ARG_ENABLE} that does not
provide a help string.
support providing a help string.
@end defmac
@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex WITH
This is an obsolete version of @code{AC_ARG_WITH} that does not
provide a help string.
support providing a help string.
@end defmac
@node Versions, , Package Options, Operation
@ -936,8 +932,12 @@ The following macros manage version numbers for @code{configure} scripts.
@maindex PREREQ
Ensure that a recent enough version of Autoconf is being used. If the
version of Autoconf being used to create @code{configure} is earlier
than @var{version} (e.g., @samp{1.8}), print an error message on the
standard error output and do not create @code{configure}.
than @var{version}, print an error message on the standard error output
and do not create @code{configure}. For example:
@example
AC_PREREQ(1.8)
@end example
This macro is useful if your @file{configure.in} relies on non-obvious
behavior that changed between Autoconf releases. If it merely needs
@ -964,6 +964,7 @@ begins with @samp{#!/bin/sh}, like the normal start of a
For example, this line in @file{configure.in}:
@c The asis prevents RCS from changing the example in the manual.
@example
AC_REVISION($@asis{Revision: 1.30 }$)dnl
@end example
@ -980,7 +981,7 @@ produces this in @file{configure}:
@node Existing Tests, Primitives, Operation, Top
@chapter Existing Tests
These macros test for particular operating system features that packages
These macros test for particular system features that packages
might need or want to use. If you need to test for a kind of feature
that none of these macros check for, you can probably do it by calling
primitive test macros with appropriate arguments (@pxref{Primitives}).
@ -1040,7 +1041,7 @@ is being used. This macro calls @code{AC_PROG_CPP} (or
@code{AC_PROG_CXXCPP} if C++ is the current language, @pxref{Language
Choice}) and @code{AC_PROG_LEX} if they haven't been called already.
This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work.
This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work reliably.
@end defmac
@defmac AC_PROG_AWK
@ -1055,7 +1056,7 @@ finds.
Determine a C compiler to use. If @code{CC} is not already set in the
environment, check for @code{gcc}, and use @code{cc} if it's not found.
Set @code{make} variable @code{CC} to the name of the compiler found.
Set shell variable @code{GCC} to @samp{yes} if it found the GNU C
Set shell variable @code{GCC} to @samp{yes} if using the GNU C
compiler, empty otherwise, and if @code{make} variable @code{CFLAGS} was
not already set, set it to @samp{-g -O} for the GNU C compiler or
@samp{-g} for other compilers.
@ -1091,7 +1092,7 @@ variable @code{CXX} to its value. Otherwise search for a C++ compiler
under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, and
@code{cxx}). If none of those checks succeed, as a last resort set
@code{CXX} to @code{gcc}. Also set shell variable @code{GXX} to
@samp{yes} if it found the GNU C++ compiler, empty otherwise, and if
@samp{yes} if using the GNU C++ compiler, empty otherwise, and if
@code{make} variable @code{CXXFLAGS} was not already set, set it to
@samp{-g -O} for the GNU C++ compiler or @samp{-g} for other compilers.
@end defmac
@ -1276,7 +1277,7 @@ This macro is equivalent to calling @code{AC_CHECK_LIB} with a
@var{function} argument of @code{main}. In addition, @var{library} can
be written as any of @samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}. In
all of those cases, the compiler is passed @samp{-lfoo}. However,
@var{library} can not be a shell variable; it must be a constant.
@var{library} can not be a shell variable; it must be a literal name.
This macro is considered obsolete, because some linkers (e.g., Apollo's)
do not fail when asked to link with a nonexistent library if there are
@ -1316,9 +1317,10 @@ declared in a system header file, either @file{signal.h} or
@cvindex SYSNDIR
@cvindex NDIR
@cvindex VOID_CLOSEDIR
Like @code{AC_HEADER_DIRENT}, but defines a different set of C
preprocessor macros to indicate which header file is found. This macro
and the names it defines are considered obsolete. The names it defines are:
Like calling @code{AC_HEADER_DIRENT} and @code{AC_FUNC_CLOSEDIR_VOID},
but defines a different set of C preprocessor macros to indicate which
header file is found. This macro and the names it defines are
considered obsolete. The names it defines are:
@table @file
@item dirent.h
@ -1334,9 +1336,8 @@ and the names it defines are considered obsolete. The names it defines are:
@code{NDIR}
@end table
Also, if the directory library header file contains a declaration of the
@code{closedir} function with a @code{void} return type, define
@code{VOID_CLOSEDIR}.
If the @code{closedir} function does not return a meaningful value,
define @code{VOID_CLOSEDIR}.
@end defmac
@defmac AC_HEADER_DIRENT
@ -1345,7 +1346,6 @@ Also, if the directory library header file contains a declaration of the
@cvindex HAVE_NDIR_H
@cvindex HAVE_SYS_DIR_H
@cvindex HAVE_SYS_NDIR_H
@cvindex CLOSEDIR_VOID
Check for the the following header files, and for the first one that is
found, define the listed C preprocessor macro:
@ -1363,10 +1363,6 @@ found, define the listed C preprocessor macro:
@code{HAVE_NDIR_H}
@end table
Also, if the directory library header file contains a declaration of the
@code{closedir} function with a @code{void} return type, define
@code{CLOSEDIR_VOID}.
The directory library declarations in the source code should look
something like the following, which assumes that you have also called
@samp{AC_CHECK_HEADERS(unistd.h)}:
@ -1648,7 +1644,7 @@ particular test macros.
@defmac AC_CHECK_TYPE (@var{type}, @var{default})
@maindex CHECK_TYPE
If the type @var{type} is not defined in @file{sys/types.h}, define it
to be the C (or C++) builtin type @var{default}, e.g. @samp{short} or
to be the C (or C++) builtin type @var{default}; e.g., @samp{short} or
@samp{unsigned}.
@end defmac
@ -1738,6 +1734,16 @@ char *alloca ();
@end example
@end defmac
@defmac AC_FUNC_CLOSEDIR_VOID
@maindex FUNC_CLOSEDIR_VOID
@cvindex CLOSEDIR_VOID
If the @code{closedir} function does not return a meaningful value,
define @code{CLOSEDIR_VOID}. Otherwise, callers ought to check its
return value for an error indicator. This macro calls
@code{AC_HEADER_DIRENT} if it has not been called yet already
(@pxref{Particular Headers}).
@end defmac
@defmac AC_FUNC_GETLOADAVG
@maindex FUNC_GETLOADAVG
@cvindex SVR4
@ -2007,7 +2013,8 @@ on the system where @code{configure} is being run, set the shell
variable @code{cross_compiling} to @samp{yes}, otherwise @samp{no}.
This information can be used by @code{AC_TRY_RUN} to determine whether
to take a default action instead of trying to run a test program
(@pxref{C System Output}).
(@pxref{C System Output}). For more information on dealing with
cross-compiling, @xref{Alternatives}.
@end defmac
@defmac AC_C_INLINE
@ -2286,9 +2293,15 @@ not run. If the optional shell commands @var{action-if-cross-compiling}
are given, they are run instead and this macro calls @code{AC_C_CROSS}
if it has not already been called (@pxref{Compiler Characteristics}).
Otherwise, @code{configure} prints an error message and exits.
@code{autoconf} prints a warning message when creating @code{configure}
each time it encounters a call to @code{AC_TRY_RUN} with no
@var{action-if-cross-compiling} argument given. You may ignore the
warning, though users will not be able to configure your package for
cross-compiling. A few of the macros distributed with Autoconf produce
this warning message.
It is preferable to use @code{AC_TRY_LINK} instead of @code{AC_TRY_RUN},
when possible. @xref{Test Programs}, for more information.
when possible. @xref{Test Programs}, for a fuller explanation.
@end defmac
@node Setting Variables, Printing Messages, C System Output, Primitives
@ -2978,23 +2991,38 @@ exists on the system or has a certain value, then you can't use
test program by hand. You can compile and run it using
@code{AC_TRY_RUN} (@pxref{C System Output}).
Try to avoid running test programs if possible, because using them
prevents people from configuring your package for cross-compiling. If
it's really best that you test for a run-time behavior, try to provide a
default ``worst case'' value to use when cross-compiling makes run-time
tests impossible. You do this by passing the optional last argument to
@code{AC_TRY_RUN}. To configure for cross-compiling you can also set up
a test results cache file with the correct values for the target system
(@pxref{Caching Values}). But that is a last resort. Alternatively,
choose a value for those parameters based on the canonical system name
(@pxref{Manual Configuration}).
@menu
* Alternatives:: Approaches preferred over test programs.
* Guidelines:: General rules for writing test programs.
* Test Functions:: Special ways to work around problems.
@end menu
@node Guidelines, Test Functions, , Test Programs
@node Alternatives, Guidelines, , Test Programs
@subsection Alternatives to Test Programs
Avoid running test programs if possible, because using them prevents
people from configuring your package for cross-compiling. If you can,
make the checks at run-time instead of at configure-time. You can check
for things like the machine's endianness when your program initializes
itself instead of when configuring it.
If you still need to test for a run-time behavior while configuring, try
to provide a default pessimistic value to use when cross-compiling
makes run-time tests impossible. You do this by passing the optional
last argument to @code{AC_TRY_RUN}. To configure for cross-compiling
you can also choose a value for those parameters based on the canonical
system name (@pxref{Manual Configuration}). Alternatively, set up a
test results cache file with the correct values for the target system
(@pxref{Caching Values}). But that is a quick-hack solution to the
problem.
To provide a default for calls of @code{AC_TRY_RUN} that are embedded in
other macros, including a few of the ones that come with Autoconf, you
can call @code{AC_C_CROSS} before running them. Then if the shell
variable @code{cross_compiling} is set to @samp{yes}, use an alternate
method to get the results instead of calling the macros.
@node Guidelines, Test Functions, Alternatives, Test Programs
@subsection Guidelines for Test Programs
Test programs should not write anything to the standard output. They
@ -3348,10 +3376,10 @@ i960-*-bout) obj_format=bout ;;
esac
@end example
@defmac AC_LINK_FILES (@var{link} @dots{}, @var{file} @dots{})
@defmac AC_LINK_FILES (@var{dest} @dots{}, @var{source} @dots{})
@maindex LINK_FILES
Link each of the existing files @var{file} to the corresponding link
name @var{link}. Makes a symbolic link if possible, otherwise a hard
Link each of the existing files @var{source} to the corresponding link
name @var{dest}. Makes a symbolic link if possible, otherwise a hard
link. For example, this call:
@example
@ -3541,12 +3569,9 @@ stamp-h.in: configure.in aclocal.m4 acconfig.h config.h.top config.h.bot
touch $@{srcdir@}/stamp-h.in
# config.status might not change config.h
# Don't rerun config.status if we just configured.
# Use || so the command line always returns success.
config.h: stamp-h
stamp-h: config.h.in config.status
test ! -f stamp-h || ./config.status
touch stamp-h
./config.status
Makefile: Makefile.in config.status
./config.status
@ -3556,6 +3581,11 @@ config.status: configure
@end group
@end example
In addition, you should pass @samp{touch stamp-h} in the @var{extra-cmds}
argument to @code{AC_OUTPUT}, so @file{config.status} will ensure that
@file{config.h} is considered up to date. @xref{Output}, for more
information about @code{AC_OUTPUT}.
@xref{Invoking config.status}, for more information on handling
configuration-related dependencies.
@ -3595,7 +3625,7 @@ 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{--norecursion} option,
@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},

View File

@ -12,13 +12,17 @@ those values to create a @file{Makefile} in each directory of the
package. It may also create one or more @file{.h} files containing
system-dependent definitions. Finally, it creates a shell script
@file{config.status} that you can run in the future to recreate the
current configuration, and a file @file{config.log} containing compiler
output (useful mainly for debugging @code{configure}).
current configuration, a file @file{config.cache} that saves the results
of its tests to speed up reconfiguring, and a file @file{config.log}
containing compiler output (useful mainly for debugging
@code{configure}).
If you need to do unusual things to compile the package, please try to
figure out how @code{configure} could check whether to do them, and mail
diffs or instructions to the address given in the @file{README} so they
can be considered for the next release.
can be considered for the next release. If at some point
@file{config.cache} contains results you don't want to keep, you may
remove or edit it.
The file @file{configure.in} is used to create @file{configure} by a
program called @code{autoconf}. You only need @file{configure.in} if
@ -155,6 +159,10 @@ optional part of the package. The @file{README} should mention any
@code{configure} also recognizes the following options:
@table @code
@item --cache-file=@var{file}
Save the results of the tests in @var{file} instead of @file{config.cache}.
Set @var{file} to @file{/dev/null} to disable caching, for debugging configure.
@item --help
Print a summary of the options to @code{configure}, and exit.

View File

@ -12,13 +12,17 @@ those values to create a @file{Makefile} in each directory of the
package. It may also create one or more @file{.h} files containing
system-dependent definitions. Finally, it creates a shell script
@file{config.status} that you can run in the future to recreate the
current configuration, and a file @file{config.log} containing compiler
output (useful mainly for debugging @code{configure}).
current configuration, a file @file{config.cache} that saves the results
of its tests to speed up reconfiguring, and a file @file{config.log}
containing compiler output (useful mainly for debugging
@code{configure}).
If you need to do unusual things to compile the package, please try to
figure out how @code{configure} could check whether to do them, and mail
diffs or instructions to the address given in the @file{README} so they
can be considered for the next release.
can be considered for the next release. If at some point
@file{config.cache} contains results you don't want to keep, you may
remove or edit it.
The file @file{configure.in} is used to create @file{configure} by a
program called @code{autoconf}. You only need @file{configure.in} if
@ -155,6 +159,10 @@ optional part of the package. The @file{README} should mention any
@code{configure} also recognizes the following options:
@table @code
@item --cache-file=@var{file}
Save the results of the tests in @var{file} instead of @file{config.cache}.
Set @var{file} to @file{/dev/null} to disable caching, for debugging configure.
@item --help
Print a summary of the options to @code{configure}, and exit.

View File

@ -24,7 +24,7 @@ dnl
divert(-1)dnl Throw away output until AC_INIT is called.
changequote([, ])
define(AC_ACVERSION, 1.110)
define(AC_ACVERSION, 1.111)
dnl Some old m4's don't support m4exit. But they provide
dnl equivalent functionality by core dumping because of the
@ -171,7 +171,7 @@ exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
norecursion=
no_recursion=
prefix=NONE
program_prefix=
program_suffix=
@ -279,9 +279,9 @@ EOF
| --no-cr | --no-c)
no_create=yes ;;
-norecursion | --norecursion | --norecursio | --norecursi \
| --norecurs | --norecur | --norecu | --norec | --nore | --nor)
norecursion=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
@ -430,7 +430,6 @@ AC_DIVERT_POP()dnl to NORMAL
dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
AC_DEFUN(AC_INIT_PREPARE,
[trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
trap 'rm -fr confdefs* $ac_clean_files' 0
# File descriptor usage:
# 0 unused; standard input
@ -455,15 +454,15 @@ running configure, to aid debugging if configure makes a mistake.
# Save the original args if we used an alternate arg parser.
ac_configure_temp="${configure_args-[$]@}"
# Strip out --no-create and --norecursion so they do not pile up.
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing spaces.
configure_args=
for ac_arg in $ac_configure_temp; do
case "$ac_arg" in
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c) ;;
-norecursion | --norecursion | --norecursio | --norecursi \
| --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
changequote(, )dnl
*[" "]*) configure_args="$configure_args '$ac_arg'" ;;
changequote([, ])dnl
@ -842,7 +841,7 @@ cat > $cache_file <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs. It is not useful on other systems.
# If its contents are invalid for some reason, you may delete or edit it.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already. You can give configure
@ -1266,12 +1265,11 @@ cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
[$1]
EOF
dnl Capture the stderr of cpp.
dnl eval is necessary to expand ac_cpp.
dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
dnl Coherent sh does redirections in the wrong order, so separate them.
# Note: sh -x echos commands on subshell stderr, making this test fail.
ac_err=`(eval "$ac_cpp conftest.${ac_ext} >/dev/null") 2>&1`
dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp.
dnl We used to copy stderr to stdout and capture it in a variable, but
dnl that breaks under sh -x.
eval "$ac_cpp conftest.${ac_ext} >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
ifelse([$2], , :, [rm -rf conftest*
$2])
@ -1456,8 +1454,8 @@ for ac_option
do
case "[\$]ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]configure_args --no-create --norecursion
exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]configure_args --no-create --norecursion ;;
echo running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]configure_args --no-create --no-recursion
exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]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 ;;
@ -1488,12 +1486,14 @@ $2
exit 0
EOF
chmod +x ${CONFIG_STATUS}
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} ${CONFIG_STATUS}
dnl config.status should not do recursion.
ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
])dnl
dnl
dnl This is a subroutine of AC_OUTPUT.
dnl It is called inside configure, outside of config.status.
dnl AC_OUTPUT_MAKE_DEFS()
AC_DEFUN(AC_OUTPUT_MAKE_DEFS,
[# Transform confdefs.h into DEFS.
@ -1511,8 +1511,8 @@ changequote([, ])dnl
EOF
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
rm -f conftest.defs
])dnl
dnl
])
dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted
dnl here document whose contents are going into config.status.
dnl AC_OUTPUT_FILES(FILE...)
@ -1610,8 +1610,8 @@ ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
fi; done
rm -f conftest.subs
])dnl
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_HEADER(HEADER-FILE...)
@ -1706,7 +1706,7 @@ do
done
rm -f conftest.vals
# Now back to your regularly scheduled config.status.
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
@ -1721,8 +1721,8 @@ cat >> ${CONFIG_STATUS} <<\EOF
fi
fi; done
])dnl
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(DEST..., SOURCE...)
@ -1730,34 +1730,35 @@ AC_DEFUN(AC_OUTPUT_LINKS,
[EOF
cat >> ${CONFIG_STATUS} <<EOF
ac_links="$1"
ac_files="$2"
ac_dests="$1"
ac_sources="$2"
EOF
cat >> ${CONFIG_STATUS} <<\EOF
while test -n "${ac_files}"; do
set ${ac_links}; ac_link=[$]1; shift; ac_links=[$]*
set ${ac_files}; ac_file=[$]1; shift; ac_files=[$]*
srcdir=$ac_given_srcdir
while test -n "${ac_sources}"; do
set ${ac_dests}; ac_dest=[$]1; shift; ac_dests=[$]*
set ${ac_sources}; ac_source=[$]1; shift; ac_sources=[$]*
echo "linking ${ac_link} to ${srcdir}/${ac_file}"
echo "linking ${ac_dest} to ${srcdir}/${ac_source}"
if test ! -r ${srcdir}/${ac_file}; then
AC_MSG_ERROR(${srcdir}/${ac_file}: File not found)
if test ! -r ${srcdir}/${ac_source}; then
AC_MSG_ERROR(${srcdir}/${ac_source}: File not found)
fi
rm -f ${ac_link}
rm -f ${ac_dest}
# Make a symlink if possible; otherwise try a hard link.
if ln -s ${srcdir}/${ac_file} ${ac_link} 2>/dev/null ||
ln ${srcdir}/${ac_file} ${ac_link}; then :
if ln -s ${srcdir}/${ac_source} ${ac_dest} 2>/dev/null ||
ln ${srcdir}/${ac_source} ${ac_dest}; then :
else
AC_MSG_ERROR(can not link ${ac_link} to ${srcdir}/${ac_file})
AC_MSG_ERROR(can not link ${ac_dest} to ${srcdir}/${ac_source})
fi
done
])dnl
dnl
])
dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
AC_DEFUN(AC_OUTPUT_SUBDIRS,
[
if test "${norecursion}" != yes; then
if test "${no_recursion}" != yes; then
# Remove --cache-file and --srcdir arguments so they do not pile up.
ac_sub_configure_args=

View File

@ -186,6 +186,7 @@ AC_SUBST([SET_MAKE])dnl
AC_DEFUN(AC_PROG_RANLIB,
[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])
dnl Check for mawk first since it's said to be faster.
AC_DEFUN(AC_PROG_AWK,
[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])
@ -303,8 +304,8 @@ AC_CACHE_VAL(ac_cv_path_install,
case "$ac_dir" in
''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
for ac_prog in ginstall installbsd scoinst install; do
# OSF1, X11, and SCO ODT 3.0 have their own names for install.
for ac_prog in ginstall installbsd bsdinst scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
@ -447,7 +448,10 @@ AC_DEFUN(AC_HEADER_DIRENT,
[ac_header_dir=no
AC_CHECK_HEADERS(dirent.h sys/ndir.h sys/dir.h ndir.h,
[ac_header_dir=$ac_hdr; break])
])
AC_DEFUN(AC_FUNC_CLOSEDIR_VOID,
[AC_REQUIRE([AC_HEADER_DIRENT])dnl
AC_MSG_CHECKING(whether closedir returns void)
AC_CACHE_VAL(ac_cv_func_closedir_void,
[AC_TRY_RUN([#include <sys/types.h>
@ -690,7 +694,7 @@ main()
exit(1);
exit(0);
}
], ac_cv_func_mmap=yes, ac_cv_func_mmap=no)])dnl
], ac_cv_func_mmap=yes, ac_cv_func_mmap=no, ac_cv_func_mmap=no)])dnl
AC_MSG_RESULT($ac_cv_func_mmap)
if test $ac_cv_func_mmap = yes; then
AC_DEFINE(HAVE_MMAP)
@ -814,7 +818,7 @@ main() {
|| fstat(fileno(stdout), &st) != 0
);
}
}], ac_cv_func_vfork=yes, ac_cv_func_vfork=no)])dnl
}], ac_cv_func_vfork=yes, ac_cv_func_vfork=no, ac_cv_func_vfork=no)])dnl
AC_MSG_RESULT($ac_cv_func_vfork)
if test $ac_cv_func_vfork = no; then
AC_DEFINE(vfork, fork)
@ -850,7 +854,7 @@ main() {
exit(r.ru_nvcsw == 0
&& r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
}
}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no)])dnl
}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])dnl
AC_MSG_RESULT($ac_cv_func_wait3)
if test $ac_cv_func_wait3 = yes; then
AC_DEFINE(HAVE_WAIT3)
@ -1005,6 +1009,9 @@ if test $ac_cv_struct_nlist_n_un = yes; then
fi
])dnl
dnl FIXME two bugs here:
dnl Hardwiring the path of getloadavg.c in the top-level directory,
dnl and not checking whether a getloadavg from a library needs privileges.
AC_MSG_CHECKING(whether getloadavg requires setgid)
AC_CACHE_VAL(ac_cv_func_getloadavg_setgid,
[AC_EGREP_CPP([Yowza Am I SETGID yet],
@ -1052,7 +1059,8 @@ struct stat s, t;
exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
&& t.st_mtime - s.st_mtime < 120));
}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no)
}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no,
ac_cv_func_utime_null=no)
rm -f core])dnl
AC_MSG_RESULT($ac_cv_func_utime_null)
if test $ac_cv_func_utime_null = yes; then
@ -1069,7 +1077,7 @@ main ()
exit (strcoll ("abc", "def") >= 0 ||
strcoll ("ABC", "DEF") >= 0 ||
strcoll ("123", "456") >= 0);
}], ac_cv_func_strcoll=yes, ac_cv_func_strcoll=no)])dnl
}], ac_cv_func_strcoll=yes, ac_cv_func_strcoll=no, ac_cv_func_strcoll=no)])dnl
AC_MSG_RESULT($ac_cv_func_strcoll)
if test $ac_cv_func_strcoll = yes; then
AC_DEFINE(HAVE_STRCOLL)
@ -1443,6 +1451,7 @@ AC_DEFUN(AC_PATH_X,
# --without-x overrides everything else, but does not touch the cache.
AC_MSG_CHECKING(for X)
AC_ARG_WITH(x, [ --with-x use the X Window System])
if test "x$with_x" = xno; then
no_x=yes
else