+Major changes in release 2.2:
+
+\f
Major changes in release 2.1:
* Fix C++ problems.
I've incorporated many of them, and am still considering others for
future releases -- but I didn't want to postpone this release indefinitely.
-Caution: don't indiscriminantly rebuild configure scripts with
+Caution: don't indiscriminately rebuild configure scripts with
Autoconf version 2. Some configure.in files need minor adjustments to
work with it; the documentation has a chapter on upgrading. A few
configure.in files, including those for GNU Emacs and the GNU C
* Mike Haertel's suggestions:
-** Provide files containing decls for alloca, strings, etc.
+** Provide header files containing decls for alloca, strings, etc.
** Cross compiling:
------------------------------------------------------------------------------
+For AC_TYPE_SIGNAL signal handlers, provide a way for code to know
+whether to do "return 0" or "return" (int vs void) to avoid compiler
+warnings. (Roland McGrath)
+
+------------------------------------------------------------------------------
+
+It would be very useful if autoconf allowed checking for multiple libraries
+that are required together. For example:
+
+AC_HAVE_LIBRARY([-lsocket -lnsl], [LIBS="$LIBS -lsocket -lnsl"])
+
+I have been informed that SVR4 requires both -lnsl to be used with -lsocket,
+so a test just for -lsocket fails, as that will not compile.
+From: markd@grizzly.COM (Mark Diekhans)
+
+------------------------------------------------------------------------------
+
+In config.status comment, put the host/target/build types, if used.
+
+------------------------------------------------------------------------------
+
+Support a way of including makefile fragments that then have @var@
+substitutions done on them.
+
+------------------------------------------------------------------------------
+
+Have AC_CANONICAL_HOST cache the host/build/target types.
+
+------------------------------------------------------------------------------
+
+ AC_OUTPUT(Makefile.out:Makefile.in)
+generates
+ trap 'rm -f Makefile.out:Makefile.in; exit 1' 1 2 15
+
+------------------------------------------------------------------------------
+
+Look at contributions:
+ ac_include (Karl Berry)
+ tool_prefix (Roland McGrath)
+ aclocal.h tom@basil.icce.rug.NL (Tom R.Hageman)
+ inline rewrite (Jim Avera)
+ getpgrp and stringize (Arnold Robbins)
+ caching AC_DECL_YYTEXT (Karl Berry, John something)
+
+------------------------------------------------------------------------------
+
+ The argument HELP-STRING is a description of the option which
+ ...
+ Avoid tabs in the help string. You'll need to enclose it in `['
+ and `]' in order to produce the leading spaces.
+
+Except that [...] is the convention for telling the user the default,
+So I guess a changequote(`,') or something would be in order in some cases.
+From: "K. Berry" <kb@cs.umb.edu>
+
+------------------------------------------------------------------------------
+
+I would find it a wonderful boon if config.log contained not just the
+output from the compilers, but also the invocation. Almost all
+the errors I've found are due to the wrong options getting passed for
+one reason or another.
+
+Saving the input test file(s) that failed would be useful, too.
+From: "K. Berry" <kb@cs.umb.edu>
+
+------------------------------------------------------------------------------
+
+The default of unlimited permission is fine, but there should be some easy
+way for configure to have copyright terms passed through from configure.in.
+Maybe AC_LICENSE([...]).
+From: roland@gnu.ai.mit.edu (Roland McGrath)
+
+------------------------------------------------------------------------------
+
+autoconf-2.1 AC_EGREP_HEADER does not work if [square brackets]
+are used in the egrep pattern. This makes egrep fairly useless to
+find, for example, a space or tab followed by something.
+
+Putting changequotes around the PATTERN parameter makes no difference.
+-Jim Avera (jima@netcom.com)
+
+------------------------------------------------------------------------------
+
+AC_MSG_CHECKING([checking for ANSI #stringize])
+AC_REVISION([ #(@) revision 2.1 ])
+
+causes bogus code to be generated for whatever immediately follows. The
+problem goes away if the '#' is removed. Probably the macros are not
+disabling the m4 "comment" feature when processing user-supplied strings.
+-Jim Avera jima@netcom.com
+
+------------------------------------------------------------------------------
+
+- I would like the default behavior of the library command to change
+so that the newly tested library is tried in front of $LIBS instead of
+after it. This makes it possible to test for more complicated sets of
+dependencies. For instance: on some SVR4 systems (e.g. Sequent),
+-lsocket requires -linet and -lnsl. The link order must be
+"-lsocket -linet -lnsl". On some other SVR4 systems either -linet or
+-lnsl does not exist. Now if I test for -lnsl first, the test for
+-linet fails because it tries "-lnsl -linet"; but if I test for
+-linet it fails because it only works if -lnsl is also specified.
+--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
+
+------------------------------------------------------------------------------
+
+on hal.gnu.ai.mit.edu, configure is getting the wrong answer for
+AC_CHECK_FUNCS(select).
+
+The problem here is that there's severe namespace pollution: when
+conftest.c includes <ctype.h> to pick up any __stub macro definitions,
+it's getting a prototype declaration for select(), which collides
+with the dummy declaration in conftest.c. (The chain of includes
+is conftest.c -> <ctype.h> -> <sys/localedef.h> -> <sys/lc_core.h>
+-> <sys/types.h> -> <sys/select.h>.)
+
+ #define $ac_func __dummy_$ac_func
+ #include <ctype.h>
+ #undef $ac_func
+From: kwzh@gnu.ai.mit.edu (Karl Heuer)
+
+------------------------------------------------------------------------------
+
+put all the config.* stuff somewhere like config/?
+All these extrainious file sure clutter up a toplevel directory.
+From: "Randall S. Winchester" <rsw@eng.umd.edu>
+
+------------------------------------------------------------------------------
+
+It would be nice if I could (in the Makefile.in files) set
+the path to config.h. You have config.h ../config.h ../../config.h's all
+over the place, in the findutils-4.1 directory.
+From: "Randall S. Winchester" <rsw@eng.umd.edu>
+
+------------------------------------------------------------------------------
+
+ define([AC_DEFUN],
+ [define($1, [AC_PRO([$1])[$2][]AC_EPI()])])
+to fix a quoting bug (Noah Friedman).
+
+------------------------------------------------------------------------------
+
* Test suite: more things to test:
** That the shell scripts produce correct output on some simple data.
** Configuration header files. That autoheader does the right thing,
#undef C_ALLOCA
/* Define if type char is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
#undef __CHAR_UNSIGNED__
+#endif
/* Define if the closedir function returns void instead of int. */
#undef CLOSEDIR_VOID
dnl m4 output diversions. We let m4 output them all in order at the end,
dnl except that we explicitly undivert AC_DIVERSION_SED.
-dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #!/bin/sh line
+dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #! /bin/sh line
define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings
define(AC_DIVERSION_INIT, 2)dnl initialization code
define(AC_DIVERSION_SED, 3)dnl variable substitutions in config.status
dnl for users of AC_REVISION.
dnl AC_INIT_BINSH()
AC_DEFUN(AC_INIT_BINSH,
-[#!/bin/sh
+[#! /bin/sh
])
dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
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 conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
# File descriptor usage:
-# 0 unused; standard input
+# 0 standard input
# 1 file creation
# 2 errors and warnings
-# 3 unused; some systems may open it to /dev/tty
-define(AC_FD_MSG, 4)dnl
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+define(AC_FD_MSG, 6)dnl
[#] AC_FD_MSG checking for... messages and results
define(AC_FD_CC, 5)dnl
[#] AC_FD_CC compiler messages saved in config.log
ac_help="$ac_help
[$2]"
AC_DIVERT_POP()dnl
-[#] Check whether --enable-$1 or --disable-$1 was given.
-enableval="[$enable_]patsubst($1, -, _)"
+[#] Check whether --enable-[$1] or --disable-[$1] was given.
+enableval="[$enable_]patsubst([$1], -, _)"
if test -n "$enableval"; then
ifelse([$3], , :, [$3])
ifelse([$4], , , [else
ac_help="$ac_help
[$2]"
AC_DIVERT_POP()dnl
-[#] Check whether --with-$1 or --without-$1 was given.
-withval="[$with_]patsubst($1, -, _)"
+[#] Check whether --with-[$1] or --without-[$1] was given.
+withval="[$with_]patsubst([$1], -, _)"
if test -n "$withval"; then
ifelse([$3], , :, [$3])
ifelse([$4], , , [else
EOF
changequote(, )dnl
dnl Allow a site initialization script to override cache values.
-# Ultrix sh set writes to stderr and can't be redirected directly.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
+ sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
>> $cache_file
changequote([, ])dnl
else
if (!f) exit(1);
fprintf(f, "%d\n", sizeof($1));
exit(0);
-}], AC_CV_NAME=`cat conftestval`)])dnl
+}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0)])dnl
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
undefine([AC_TYPE_NAME])dnl
define(AC_OUTPUT,
[trap '' 1 2 15
AC_CACHE_SAVE
-trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
-#!/bin/sh
+#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
dnl config.status should not do recursion.
ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
])dnl
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
changequote(, )dnl
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
# The dest file is in a subdirectory.
test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/$ac_dest_dir"
+ ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dest_dir_suffix.
changequote(, )dnl
ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
done
])
-This is a subroutine of AC_OUTPUT. It is called after running config.status.
+dnl This is a subroutine of AC_OUTPUT.
+dnl It is called after running config.status.
dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
define(AC_OUTPUT_SUBDIRS,
[
# Make the cache file name correct relative to the subdirectory.
changequote(, )dnl
# A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo /$ac_config_dir|sed 's%/[^/]*%../%g'`
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%/[^/]*%../%g' -e 's%^%/%`
changequote([, ])dnl
case "$cache_file" in
/*) ac_sub_cache_file=$cache_file ;;
*) # Relative path.
ac_sub_cache_file="$ac_dots$cache_file" ;;
esac
+ifdef([AC_PROVIDE_AC_PROG_INSTALL],
+ [ case "$ac_given_INSTALL" in
+changequote(, )dnl
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+changequote([, ])dnl
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+])dnl
echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
# The eval makes quoting arguments work.
AC_DEFUN(AC_DECL_YYTEXT,
[AC_REQUIRE_CPP()dnl
AC_REQUIRE([AC_PROG_LEX])dnl
-AC_MSG_CHECKING(for yytext declaration)
+AC_MSG_CHECKING(whether yytext is a pointer)
AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer,
[# POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent. Figure out which it is, since
elif test -f lexyy.c; then
LEX_OUTPUT_ROOT=lexyy
else
- AC_MSG_ERROR(cannot find output from $LEX, giving up)
+ AC_MSG_ERROR([cannot find output from $LEX, giving up])
fi
-echo 'extern char *yytext; main () { exit (0); }' >>$LEX_OUTPUT_ROOT.c
+echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LEXLIB"
-AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, ac_cv_prog_lex_yytext_pointer=yes)
+AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, , ac_cv_prog_lex_yytext_pointer=yes)
LIBS="$ac_save_LIBS"
rm -f "${LEX_OUTPUT_ROOT}.c"])dnl
AC_MSG_RESULT($ac_cv_prog_lex_yytext_pointer)
/* Use a field that we can force nonzero --
voluntary context switches.
For systems like NeXT and OSF/1 that don't set it,
- also use the system CPU time. */
+ also use the system CPU time. And page faults (I/O) for Linux. */
r.ru_nvcsw = 0;
r.ru_stime.tv_sec = 0;
r.ru_stime.tv_usec = 0;
+ r.ru_majflt = r.ru_minflt = 0;
switch (fork()) {
case 0: /* Child. */
sleep(1); /* Give up the CPU. */
default: /* Parent. */
wait3(&i, 0, &r);
sleep(1); /* Avoid "text file busy" from rm on fast HP-UX machines. */
- exit(r.ru_nvcsw == 0
+ exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
&& r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
}
}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])dnl
&& t.st_mtime - s.st_mtime < 120));
}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no,
ac_cv_func_utime_null=no)
-rm -f core])dnl
+rm -f core core.* *.core])dnl
AC_MSG_RESULT($ac_cv_func_utime_null)
if test $ac_cv_func_utime_null = yes; then
AC_DEFINE(HAVE_UTIME_NULL)
putc('\r', stdout);
exit(0); /* Non-reversed systems segv here. */
}], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no)
-rm -f core])dnl
+rm -f core core.* *.core])dnl
AC_MSG_RESULT($ac_cv_func_setvbuf_reversed)
if test $ac_cv_func_setvbuf_reversed = yes; then
AC_DEFINE(SETVBUF_REVERSED)
AC_MSG_CHECKING(whether cross-compiling)
AC_CACHE_VAL(ac_cv_c_cross,
[AC_TRY_RUN([main(){return(0);}],
- ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_cross=yes)])dnl
+ ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_c_cross=yes)])dnl
cross_compiling=$ac_cv_c_cross
AC_MSG_RESULT($ac_cv_c_cross)
])
ac_msg="whether #! works in shell scripts"
AC_MSG_CHECKING($ac_msg)
AC_CACHE_VAL(ac_cv_sys_interpreter,
-[echo '#!/bin/cat
+[echo '#! /bin/cat
exit 69
' > conftest
chmod u+x conftest
# These have to be linked with before -lX11, unlike the other
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
- AC_CHECK_LIB(ICE, IceConnectionNumbers,
+ AC_CHECK_LIB(ICE, IceConnectionNumber,
[X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"])
LDFLAGS="$ac_save_LDFLAGS"
-#!/bin/sh
+#! /bin/sh
# autoconf -- create `configure' using m4 macros
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@
-test -z "${M4}" && M4=@M4@
+: ${AC_MACRODIR=@datadir@}
+: ${M4=@M4@}
case "${M4}" in
/*) # Handle the case that m4 has moved since we were configured.
# It may have been found originally in a build directory.
-#!/bin/sh
+#! /bin/sh
# autoconf -- create `configure' using m4 macros
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@
-test -z "${M4}" && M4=@M4@
+: ${AC_MACRODIR=@datadir@}
+: ${M4=@M4@}
case "${M4}" in
/*) # Handle the case that m4 has moved since we were configured.
# It may have been found originally in a build directory.
Substitutions in Makefiles
* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Compiling in a different directory.
+* Build Directories:: Supporting multiple concurrent compiles.
* Automatic Remaking:: Makefile rules for configuring.
Configuration Header Files
* Basic Installation:: Instructions for typical cases.
* Compilers and Options:: Selecting compilers and optimization.
-* Build Directory:: Configuring in a different directory.
+* Multiple Architectures:: Compiling for multiple architectures at once.
* Installation Names:: Installing in different directories.
* Optional Features:: Selecting optional features.
* System Type:: Specifying the system type.
@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. Occasionally people accidentally specify the wrong directory
+with @samp{--srcdir}; this is a safety check. @xref{Invoking configure},
+for more information.
@end defmac
Packages that do manual configuration or use the @code{install} program
@menu
* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Compiling in a different directory.
+* Build Directories:: Supporting multiple concurrent compiles.
* Automatic Remaking:: Makefile rules for configuring.
@end menu
example, an input shell script should begin like this:
@example
-#!/bin/sh
+#! /bin/sh
# @@configure_input@@
@end example
@node Build Directories, Automatic Remaking, Preset Output Variables, Makefile Substitutions
@subsection Build Directories
-You might want to compile a software package in a different directory
-from the one that contains the source code. Doing this allows you to
-compile the package for several architectures simultaneously from the
-same copy of the source code and keep multiple sets of object files on
-disk.
+You can support compiling a software package for several architectures
+simultaneously from the same copy of the source code. The object files
+for each architecture are kept in their own directory.
To support doing this, @code{make} uses the @code{VPATH} variable to
find the files that are in the source directory. GNU @code{make} and
variable substitutions on the value of @code{VPATH}.
@code{configure} substitutes in the correct value for @code{srcdir} when
-it produces @file{Makefile.in}.
+it produces @file{Makefile}.
Do not use the @code{make} variable @code{$<}, which expands to the
pathname of the file in the source directory (found with @code{VPATH}),
It is a good idea to call this macro before @code{AC_INIT} so that the
revision number is near the top of both @file{configure.in} and
@code{configure}. To support doing that, the @code{AC_REVISION} output
-begins with @samp{#!/bin/sh}, like the normal start of a
+begins with @samp{#! /bin/sh}, like the normal start of a
@code{configure} script does.
For example, this line in @file{configure.in}:
produces this in @code{configure}:
@example
-#!/bin/sh
+#! /bin/sh
# From configure.in Revision: 1.30
@end example
@end defmac
If linking with @var{library} results in unresolved symbols, which would
be resolved by linking with additional libraries, give those libraries
-as the @var{other-libraries} argument, separated by spaces: @samp{-lX11
--lXt}. Otherwise this macro will fail to detect that @var{library} is
+as the @var{other-libraries} argument, separated by spaces: @samp{-lXt
+-lX11}. Otherwise this macro will fail to detect that @var{library} is
present, because linking the test program will always fail with
unresolved symbols.
@end defmac
@defmac AC_SYS_INTERPRETER
@maindex SYS_INTERPRETER
Check whether the system supports starting scripts with a line of the
-form @samp{#!/bin/csh} to select the interpreter to use for the script.
+form @samp{#! /bin/csh} to select the interpreter to use for the script.
After running this macro, shell code in @code{configure.in} can check
the variable @code{ac_cv_sys_interpreter}; it will be set to @samp{yes}
if the system supports @samp{#!}, @samp{no} if not.
features call these macros and do cache their results and print messages
about what they're checking for.
+When you write a feature test that could be applicable to more than one
+software package, the best thing to do is encapsulate it in a new macro.
+@xref{Writing Macros}, for how to do that.
+
@menu
* Examining Declarations:: Detecting header files and declarations.
* Examining Syntax:: Detecting language syntax features.
configuration scripts produced by Autoconf unusable on those systems.
However, some of them can be given options that make the exit status
correct. This is a problem that Autoconf does not currently handle
-automatically.
+automatically. If users encounter this problem, they might be able to
+solve it by setting @code{LDFLAGS} in the environment to pass whatever
+options the linker needs (for example, @samp{-Wl,-dn} on MIPS RISC/OS).
@code{AC_TRY_LINK} is used to compile test programs to test for
functions and global variables. It is also used (by
You should not use shell functions, aliases, negated character classes,
or other features that are not found in all Bourne-compatible shells;
restrict yourself to the lowest common denominator. Even @code{unset}
-is not supported by all shells!
+is not supported by all shells! Also, include a space after the
+exclamation point in interpreter specifications, like this:
+@example
+#! /usr/bin/perl
+@end example
+If you omit the space before the path, then 4.2BSD based systems (such
+as Sequent DYNIX) will ignore the line, because they interpret @samp{#! /}
+as a 4-byte magic number.
The set of external programs you should run in a @code{configure} script
is fairly small. @xref{Utilities in Makefiles, , Utilities in
@maindex MSG_ERROR
Notify the user of an error that prevents @code{configure} from
completing. This macro prints an error message on the standard error
-stream and exits @code{configure} with a nonzero status.
+output and exits @code{configure} with a nonzero status.
@var{error-description} should be something like @samp{invalid value
$HOME for \$HOME}.
@end defmac
@defmac AC_MSG_WARN (@var{problem-description})
@maindex MSG_WARN
Notify the @code{configure} user of a possible problem. This macro
-prints the message on the standard error stream; @code{configure}
+prints the message on the standard error output; @code{configure}
continues running afterward, so macros that call @code{AC_MSG_WARN} should
provide a default (back-up) behavior for the situations they warn about.
@var{problem-description} should be something like @samp{ln -s seems to
user asked to use it. Whether each package is used or not by
default, and which arguments are valid, is up to you.
-@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@maindex ARG_WITH
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}. The name @var{package} indicates another
+@var{action-if-given}. Otherwise run shell commands
+@var{action-if-not-given}. The name @var{package} indicates another
software package that this program should work with. It should consist
only of alphanumeric characters and dashes.
The option's argument is available to the shell commands
-@var{action-if-true} in the shell variable @code{withval}.
+@var{action-if-given} in the shell variable @code{withval}.
The argument @var{help-string} is a description of the option which
looks like this:
and @samp{]} in order to produce the leading spaces.
@end defmac
-@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@defmac AC_WITH (@var{package}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@maindex WITH
This is an obsolete version of @code{AC_ARG_WITH} that does not
support providing a help string.
to include it. Whether each feature is included or not by default, and
which arguments are valid, is up to you.
-@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-given} @r{[}, @var{action-if-not-given}@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} indicates an optional
+shell commands @var{action-if-given}. Otherwise run shell commands
+@var{action-if-not-given}. The name @var{feature} indicates an optional
user-level facility. It should consist only of alphanumeric characters
and dashes.
The option's argument is available to the shell commands
-@var{action-if-true} in the shell variable @code{enableval}.
+@var{action-if-given} in the shell variable @code{enableval}.
The @var{help-string} argument is like that of @code{AC_ARG_WITH}
(@pxref{External Software}).
@end defmac
-@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@defmac AC_ENABLE (@var{feature}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@maindex ENABLE
This is an obsolete version of @code{AC_ARG_ENABLE} that does not
support providing a help string.
can either be based on the @code{prefix} variable, or be a standard
location such as the user's home directory. It could even be specified
by an environment variable. The programs should examine that file at
-run time, rather than at compile time. That approach is more convenient
-for users and makes the configuration process simpler than getting the
-information while configuring. @xref{Directory Variables, , Variables
-for Installation Directories, standards, GNU Coding Standards}, for more
-information on where to put data files.
+run time, rather than at compile time. Run time configuration is more
+convenient for users and makes the configuration process simpler than
+getting the information while configuring. @xref{Directory Variables, ,
+Variables for Installation Directories, standards, GNU Coding
+Standards}, for more information on where to put data files.
@node Transforming Names, Site Defaults, Site Details, Site Configuration
@section Transforming Program Names When Installing
@menu
* Basic Installation:: Instructions for typical cases.
* Compilers and Options:: Selecting compilers and optimization.
-* Build Directory:: Configuring in a different directory.
+* Multiple Architectures:: Compiling for multiple architectures at once.
* Installation Names:: Installing in different directories.
* Optional Features:: Selecting optional features.
* System Type:: Specifying the system type.
Finally, Mark Eichin notes:
Imake isn't all that extensible, either. In order to add new features to
-Imake, you need to provide you own project template, and duplicate most
+Imake, you need to provide your own project template, and duplicate most
of the features of the existing one. This means that for a sophisticated
project, using the vendor-provided Imake templates fails to provide any
leverage---since they don't cover anything that your own project needs
of those variables in the environment when @code{configure} is run.
Doing this isn't necessary, but it's a convenience for users.
-Also add @samp{@@configure_input@@} in a comment to each input file for
+Also add @samp{@@configure_input@@} in a comment to each non-@file{Makefile}
+input file for
@code{AC_OUTPUT}, so that the output files will contain a comment saying
they were produced by @code{configure}. Automatically selecting the
right comment syntax for all the kinds of files that people call
@end example
@noindent
-The old feature of replacing those variables without @samp{@@}
+The old behavior of replacing those variables without @samp{@@}
characters around them has been removed.
@node Changed Macros, Invoking autoupdate, Changed Makefiles, Upgrading
-#!/bin/sh
+#! /bin/sh
# autoheader -- create `config.h.in' from `configure.in'
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-#!/bin/sh
+#! /bin/sh
# autoheader -- create `config.h.in' from `configure.in'
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-#!/bin/sh
+#! /bin/sh
# autoreconf - remake all Autoconf configure scripts in a directory tree
# Copyright (C) 1994 Free Software Foundation, Inc.
-#!/bin/sh
+#! /bin/sh
# autoreconf - remake all Autoconf configure scripts in a directory tree
# Copyright (C) 1994 Free Software Foundation, Inc.
-#!@PERL@
+#! @PERL@
# autoscan - Create configure.scan (a preliminary configure.in) for a package.
# Copyright (C) 1994 Free Software Foundation, Inc.
-#!@PERL@
+#! @PERL@
# autoscan - Create configure.scan (a preliminary configure.in) for a package.
# Copyright (C) 1994 Free Software Foundation, Inc.
-#!/bin/sh
+#! /bin/sh
# autoconf -- create `configure' using m4 macros
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@
-test -z "${M4}" && M4=@M4@
+: ${AC_MACRODIR=@datadir@}
+: ${M4=@M4@}
case "${M4}" in
/*) # Handle the case that m4 has moved since we were configured.
# It may have been found originally in a build directory.
-#!/bin/sh
+#! /bin/sh
# autoheader -- create `config.h.in' from `configure.in'
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-#!/bin/sh
+#! /bin/sh
# autoreconf - remake all Autoconf configure scripts in a directory tree
# Copyright (C) 1994 Free Software Foundation, Inc.
-#!@PERL@
+#! @PERL@
# autoscan - Create configure.scan (a preliminary configure.in) for a package.
# Copyright (C) 1994 Free Software Foundation, Inc.
-#!/bin/sh
+#! /bin/sh
# ifnames - print the identifiers used in C preprocessor conditionals
-# Copyright (C) 1994 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Writes to stdout.
# Written by David MacKenzie <djm@gnu.ai.mit.edu>
+# and Paul Eggert <eggert@twinsun.com>.
usage="\
Usage: ifnames [-h] [--help] [-m dir] [--macrodir=dir] [--version] [file...]"
show_version=no
-test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@
+test -z "$AC_MACRODIR" && AC_MACRODIR=/usr/local/gnu/share/autoconf
while test $# -gt 0; do
case "$1" in
exit 0
fi
-if test $# -eq 0; then
- cat > stdin
- set stdin
- trap 'rm -f stdin' 0
- trap 'rm -f stdin; exit 1' 1 3 15
-fi
+mawk '
+ # Record that sym was found in FILENAME.
+ function file_sym(sym, i, fs) {
+ if (sym ~ /^[A-Za-z_]/) {
+ if (!found[sym,FILENAME]) {
+ found[sym,FILENAME] = 1
+
+ # Insert FILENAME into files[sym], keeping the list sorted.
+ i = 1
+ fs = files[sym]
+ while (match(substr(fs, i), /^ [^ ]*/) \
+ && substr(fs, i + 1, RLENGTH - 1) < FILENAME) {
+ i += RLENGTH
+ }
+ files[sym] = substr(fs, 1, i - 1) " " FILENAME substr(fs, i)
+ }
+ }
+ }
+
+ /^[\t ]*#/ {
+ if (sub(/^[\t ]*#[\t ]*ifn?def[\t ]+/, "", $0)) {
+ sub(/[^A-Za-z_0-9].*/, "", $0)
+ file_sym($0)
+ }
+ if (sub(/^[\t ]*#[\t ]*(el)?if[\t ]+/, "", $0)) {
+ # Remove comments. Not perfect, but close enough.
+ gsub(/\/\*[^\/]*(\*\/)?/, "", $0)
+
+ for (i = split($0, field, /[^A-Za-z_0-9]+/); 1 <= i; i--) {
+ if (field[i] != "defined") {
+ file_sym(field[i])
+ }
+ }
+ }
+ }
-for arg
-do
-# The first two substitutions remove comments. Not perfect, but close enough.
-# The second is for comments that end on a later line. The others do:
-# Enclose identifiers in @ and a space.
-# Handle "#if 0" -- there are no @s to trigger removal.
-# Remove non-identifiers.
-# Remove any spaces at the end.
-# Translate any other spaces to newlines.
-sed -n '
-s%/\*[^/]*\*/%%g
-s%/\*[^/]*%%g
-/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p
-/^[ ]*#[ ]*e*l*if[ ]/{
- s///
- s/@//g
- s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g
- s/$/@ /
- s/@defined //g
- s/[^@]*@\([^ ]* \)[^@]*/\1/g
- s/ *$//
- s/ /\
-/g
- p
-}
-' $arg | sort -u | sed 's%$% '$arg'%'
-done | awk '
-{ files[$1] = files[$1] " " $2 }
-END { for (sym in files) print sym files[sym] }' | sort
+ END {
+ for (sym in files) {
+ print sym files[sym]
+ }
+ }
+' ${1+"$@"} | sort
Substitutions in Makefiles
* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Compiling in a different directory.
+* Build Directories:: Supporting multiple concurrent compiles.
* Automatic Remaking:: Makefile rules for configuring.
Configuration Header Files
* Basic Installation:: Instructions for typical cases.
* Compilers and Options:: Selecting compilers and optimization.
-* Build Directory:: Configuring in a different directory.
+* Multiple Architectures:: Compiling for multiple architectures at once.
* Installation Names:: Installing in different directories.
* Optional Features:: Selecting optional features.
* System Type:: Specifying the system type.
@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. Occasionally people accidentally specify the wrong directory
+with @samp{--srcdir}; this is a safety check. @xref{Invoking configure},
+for more information.
@end defmac
Packages that do manual configuration or use the @code{install} program
@menu
* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Compiling in a different directory.
+* Build Directories:: Supporting multiple concurrent compiles.
* Automatic Remaking:: Makefile rules for configuring.
@end menu
example, an input shell script should begin like this:
@example
-#!/bin/sh
+#! /bin/sh
# @@configure_input@@
@end example
@node Build Directories, Automatic Remaking, Preset Output Variables, Makefile Substitutions
@subsection Build Directories
-You might want to compile a software package in a different directory
-from the one that contains the source code. Doing this allows you to
-compile the package for several architectures simultaneously from the
-same copy of the source code and keep multiple sets of object files on
-disk.
+You can support compiling a software package for several architectures
+simultaneously from the same copy of the source code. The object files
+for each architecture are kept in their own directory.
To support doing this, @code{make} uses the @code{VPATH} variable to
find the files that are in the source directory. GNU @code{make} and
variable substitutions on the value of @code{VPATH}.
@code{configure} substitutes in the correct value for @code{srcdir} when
-it produces @file{Makefile.in}.
+it produces @file{Makefile}.
Do not use the @code{make} variable @code{$<}, which expands to the
pathname of the file in the source directory (found with @code{VPATH}),
It is a good idea to call this macro before @code{AC_INIT} so that the
revision number is near the top of both @file{configure.in} and
@code{configure}. To support doing that, the @code{AC_REVISION} output
-begins with @samp{#!/bin/sh}, like the normal start of a
+begins with @samp{#! /bin/sh}, like the normal start of a
@code{configure} script does.
For example, this line in @file{configure.in}:
produces this in @code{configure}:
@example
-#!/bin/sh
+#! /bin/sh
# From configure.in Revision: 1.30
@end example
@end defmac
If linking with @var{library} results in unresolved symbols, which would
be resolved by linking with additional libraries, give those libraries
-as the @var{other-libraries} argument, separated by spaces: @samp{-lX11
--lXt}. Otherwise this macro will fail to detect that @var{library} is
+as the @var{other-libraries} argument, separated by spaces: @samp{-lXt
+-lX11}. Otherwise this macro will fail to detect that @var{library} is
present, because linking the test program will always fail with
unresolved symbols.
@end defmac
@defmac AC_SYS_INTERPRETER
@maindex SYS_INTERPRETER
Check whether the system supports starting scripts with a line of the
-form @samp{#!/bin/csh} to select the interpreter to use for the script.
+form @samp{#! /bin/csh} to select the interpreter to use for the script.
After running this macro, shell code in @code{configure.in} can check
the variable @code{ac_cv_sys_interpreter}; it will be set to @samp{yes}
if the system supports @samp{#!}, @samp{no} if not.
features call these macros and do cache their results and print messages
about what they're checking for.
+When you write a feature test that could be applicable to more than one
+software package, the best thing to do is encapsulate it in a new macro.
+@xref{Writing Macros}, for how to do that.
+
@menu
* Examining Declarations:: Detecting header files and declarations.
* Examining Syntax:: Detecting language syntax features.
configuration scripts produced by Autoconf unusable on those systems.
However, some of them can be given options that make the exit status
correct. This is a problem that Autoconf does not currently handle
-automatically.
+automatically. If users encounter this problem, they might be able to
+solve it by setting @code{LDFLAGS} in the environment to pass whatever
+options the linker needs (for example, @samp{-Wl,-dn} on MIPS RISC/OS).
@code{AC_TRY_LINK} is used to compile test programs to test for
functions and global variables. It is also used (by
You should not use shell functions, aliases, negated character classes,
or other features that are not found in all Bourne-compatible shells;
restrict yourself to the lowest common denominator. Even @code{unset}
-is not supported by all shells!
+is not supported by all shells! Also, include a space after the
+exclamation point in interpreter specifications, like this:
+@example
+#! /usr/bin/perl
+@end example
+If you omit the space before the path, then 4.2BSD based systems (such
+as Sequent DYNIX) will ignore the line, because they interpret @samp{#! /}
+as a 4-byte magic number.
The set of external programs you should run in a @code{configure} script
is fairly small. @xref{Utilities in Makefiles, , Utilities in
@maindex MSG_ERROR
Notify the user of an error that prevents @code{configure} from
completing. This macro prints an error message on the standard error
-stream and exits @code{configure} with a nonzero status.
+output and exits @code{configure} with a nonzero status.
@var{error-description} should be something like @samp{invalid value
$HOME for \$HOME}.
@end defmac
@defmac AC_MSG_WARN (@var{problem-description})
@maindex MSG_WARN
Notify the @code{configure} user of a possible problem. This macro
-prints the message on the standard error stream; @code{configure}
+prints the message on the standard error output; @code{configure}
continues running afterward, so macros that call @code{AC_MSG_WARN} should
provide a default (back-up) behavior for the situations they warn about.
@var{problem-description} should be something like @samp{ln -s seems to
user asked to use it. Whether each package is used or not by
default, and which arguments are valid, is up to you.
-@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@maindex ARG_WITH
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}. The name @var{package} indicates another
+@var{action-if-given}. Otherwise run shell commands
+@var{action-if-not-given}. The name @var{package} indicates another
software package that this program should work with. It should consist
only of alphanumeric characters and dashes.
The option's argument is available to the shell commands
-@var{action-if-true} in the shell variable @code{withval}.
+@var{action-if-given} in the shell variable @code{withval}.
The argument @var{help-string} is a description of the option which
looks like this:
and @samp{]} in order to produce the leading spaces.
@end defmac
-@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@defmac AC_WITH (@var{package}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@maindex WITH
This is an obsolete version of @code{AC_ARG_WITH} that does not
support providing a help string.
to include it. Whether each feature is included or not by default, and
which arguments are valid, is up to you.
-@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-given} @r{[}, @var{action-if-not-given}@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} indicates an optional
+shell commands @var{action-if-given}. Otherwise run shell commands
+@var{action-if-not-given}. The name @var{feature} indicates an optional
user-level facility. It should consist only of alphanumeric characters
and dashes.
The option's argument is available to the shell commands
-@var{action-if-true} in the shell variable @code{enableval}.
+@var{action-if-given} in the shell variable @code{enableval}.
The @var{help-string} argument is like that of @code{AC_ARG_WITH}
(@pxref{External Software}).
@end defmac
-@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@defmac AC_ENABLE (@var{feature}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]})
@maindex ENABLE
This is an obsolete version of @code{AC_ARG_ENABLE} that does not
support providing a help string.
can either be based on the @code{prefix} variable, or be a standard
location such as the user's home directory. It could even be specified
by an environment variable. The programs should examine that file at
-run time, rather than at compile time. That approach is more convenient
-for users and makes the configuration process simpler than getting the
-information while configuring. @xref{Directory Variables, , Variables
-for Installation Directories, standards, GNU Coding Standards}, for more
-information on where to put data files.
+run time, rather than at compile time. Run time configuration is more
+convenient for users and makes the configuration process simpler than
+getting the information while configuring. @xref{Directory Variables, ,
+Variables for Installation Directories, standards, GNU Coding
+Standards}, for more information on where to put data files.
@node Transforming Names, Site Defaults, Site Details, Site Configuration
@section Transforming Program Names When Installing
@menu
* Basic Installation:: Instructions for typical cases.
* Compilers and Options:: Selecting compilers and optimization.
-* Build Directory:: Configuring in a different directory.
+* Multiple Architectures:: Compiling for multiple architectures at once.
* Installation Names:: Installing in different directories.
* Optional Features:: Selecting optional features.
* System Type:: Specifying the system type.
Finally, Mark Eichin notes:
Imake isn't all that extensible, either. In order to add new features to
-Imake, you need to provide you own project template, and duplicate most
+Imake, you need to provide your own project template, and duplicate most
of the features of the existing one. This means that for a sophisticated
project, using the vendor-provided Imake templates fails to provide any
leverage---since they don't cover anything that your own project needs
of those variables in the environment when @code{configure} is run.
Doing this isn't necessary, but it's a convenience for users.
-Also add @samp{@@configure_input@@} in a comment to each input file for
+Also add @samp{@@configure_input@@} in a comment to each non-@file{Makefile}
+input file for
@code{AC_OUTPUT}, so that the output files will contain a comment saying
they were produced by @code{configure}. Automatically selecting the
right comment syntax for all the kinds of files that people call
@end example
@noindent
-The old feature of replacing those variables without @samp{@@}
+The old behavior of replacing those variables without @samp{@@}
characters around them has been removed.
@node Changed Macros, Invoking autoupdate, Changed Makefiles, Upgrading
documentation.
@item
-You can remove the program binaries and object files from the source
+You can remove the program binaries and object files from the source code
directory by typing @samp{make clean}. To also remove the files that
@code{configure} created (so you can compile the package for a different
-kind of computer), type @samp{make distclean}.
+kind of computer), type @samp{make distclean}. There is also a
+@samp{make realclean} target, but that is intended mainly for the
+package's developers. If you use it, you may have to get all sorts of
+other programs in order to regenerate files that came with the distribution.
@end enumerate
@node Compilers and Options
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
@end example
-@node Build Directory
-@section Using a Different Build Directory
+@node Multiple Architectures
+@section Compiling For Multiple Architectures
-You can compile the package in a different directory from the one
-containing the source code. Doing so allows you to compile it on more
-than one kind of computer at the same time. To do this, you must use a
-version of @code{make} that supports the @code{VPATH} variable, such as
-GNU @code{make}. @code{cd} to the directory where you want the object
-files and executables to go and run the @code{configure} script.
-@code{configure} automatically checks for the source code in the
-directory that @code{configure} is in and in @file{..}.
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of @code{make} that
+supports the @code{VPATH} variable, such as GNU @code{make}. @code{cd}
+to the directory where you want the object files and executables to go
+and run the @code{configure} script. @code{configure} automatically
+checks for the source code in the directory that @code{configure} is in
+and in @file{..}.
+
+If you have to use a @code{make} that does not supports the @code{VPATH}
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use @samp{make distclean} before reconfiguring for
+another architecture.
@node Installation Names
@section Installation Names
@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
+Use and 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 @code{configure}.
@item --help
-#!/bin/sh
+#! /bin/sh
# ifnames - print the identifiers used in C preprocessor conditionals
-# Copyright (C) 1994 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Writes to stdout.
# Written by David MacKenzie <djm@gnu.ai.mit.edu>
+# and Paul Eggert <eggert@twinsun.com>.
usage="\
Usage: ifnames [-h] [--help] [-m dir] [--macrodir=dir] [--version] [file...]"
show_version=no
-test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@
+test -z "$AC_MACRODIR" && AC_MACRODIR=/usr/local/gnu/share/autoconf
while test $# -gt 0; do
case "$1" in
exit 0
fi
-if test $# -eq 0; then
- cat > stdin
- set stdin
- trap 'rm -f stdin' 0
- trap 'rm -f stdin; exit 1' 1 3 15
-fi
+mawk '
+ # Record that sym was found in FILENAME.
+ function file_sym(sym, i, fs) {
+ if (sym ~ /^[A-Za-z_]/) {
+ if (!found[sym,FILENAME]) {
+ found[sym,FILENAME] = 1
+
+ # Insert FILENAME into files[sym], keeping the list sorted.
+ i = 1
+ fs = files[sym]
+ while (match(substr(fs, i), /^ [^ ]*/) \
+ && substr(fs, i + 1, RLENGTH - 1) < FILENAME) {
+ i += RLENGTH
+ }
+ files[sym] = substr(fs, 1, i - 1) " " FILENAME substr(fs, i)
+ }
+ }
+ }
+
+ /^[\t ]*#/ {
+ if (sub(/^[\t ]*#[\t ]*ifn?def[\t ]+/, "", $0)) {
+ sub(/[^A-Za-z_0-9].*/, "", $0)
+ file_sym($0)
+ }
+ if (sub(/^[\t ]*#[\t ]*(el)?if[\t ]+/, "", $0)) {
+ # Remove comments. Not perfect, but close enough.
+ gsub(/\/\*[^\/]*(\*\/)?/, "", $0)
+
+ for (i = split($0, field, /[^A-Za-z_0-9]+/); 1 <= i; i--) {
+ if (field[i] != "defined") {
+ file_sym(field[i])
+ }
+ }
+ }
+ }
-for arg
-do
-# The first two substitutions remove comments. Not perfect, but close enough.
-# The second is for comments that end on a later line. The others do:
-# Enclose identifiers in @ and a space.
-# Handle "#if 0" -- there are no @s to trigger removal.
-# Remove non-identifiers.
-# Remove any spaces at the end.
-# Translate any other spaces to newlines.
-sed -n '
-s%/\*[^/]*\*/%%g
-s%/\*[^/]*%%g
-/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p
-/^[ ]*#[ ]*e*l*if[ ]/{
- s///
- s/@//g
- s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g
- s/$/@ /
- s/@defined //g
- s/[^@]*@\([^ ]* \)[^@]*/\1/g
- s/ *$//
- s/ /\
-/g
- p
-}
-' $arg | sort -u | sed 's%$% '$arg'%'
-done | awk '
-{ files[$1] = files[$1] " " $2 }
-END { for (sym in files) print sym files[sym] }' | sort
+ END {
+ for (sym in files) {
+ print sym files[sym]
+ }
+ }
+' ${1+"$@"} | sort
-#!/bin/sh
+#! /bin/sh
# ifnames - print the identifiers used in C preprocessor conditionals
-# Copyright (C) 1994 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Writes to stdout.
# Written by David MacKenzie <djm@gnu.ai.mit.edu>
+# and Paul Eggert <eggert@twinsun.com>.
usage="\
Usage: ifnames [-h] [--help] [-m dir] [--macrodir=dir] [--version] [file...]"
show_version=no
-test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@
+test -z "$AC_MACRODIR" && AC_MACRODIR=/usr/local/gnu/share/autoconf
while test $# -gt 0; do
case "$1" in
exit 0
fi
-if test $# -eq 0; then
- cat > stdin
- set stdin
- trap 'rm -f stdin' 0
- trap 'rm -f stdin; exit 1' 1 3 15
-fi
+mawk '
+ # Record that sym was found in FILENAME.
+ function file_sym(sym, i, fs) {
+ if (sym ~ /^[A-Za-z_]/) {
+ if (!found[sym,FILENAME]) {
+ found[sym,FILENAME] = 1
+
+ # Insert FILENAME into files[sym], keeping the list sorted.
+ i = 1
+ fs = files[sym]
+ while (match(substr(fs, i), /^ [^ ]*/) \
+ && substr(fs, i + 1, RLENGTH - 1) < FILENAME) {
+ i += RLENGTH
+ }
+ files[sym] = substr(fs, 1, i - 1) " " FILENAME substr(fs, i)
+ }
+ }
+ }
+
+ /^[\t ]*#/ {
+ if (sub(/^[\t ]*#[\t ]*ifn?def[\t ]+/, "", $0)) {
+ sub(/[^A-Za-z_0-9].*/, "", $0)
+ file_sym($0)
+ }
+ if (sub(/^[\t ]*#[\t ]*(el)?if[\t ]+/, "", $0)) {
+ # Remove comments. Not perfect, but close enough.
+ gsub(/\/\*[^\/]*(\*\/)?/, "", $0)
+
+ for (i = split($0, field, /[^A-Za-z_0-9]+/); 1 <= i; i--) {
+ if (field[i] != "defined") {
+ file_sym(field[i])
+ }
+ }
+ }
+ }
-for arg
-do
-# The first two substitutions remove comments. Not perfect, but close enough.
-# The second is for comments that end on a later line. The others do:
-# Enclose identifiers in @ and a space.
-# Handle "#if 0" -- there are no @s to trigger removal.
-# Remove non-identifiers.
-# Remove any spaces at the end.
-# Translate any other spaces to newlines.
-sed -n '
-s%/\*[^/]*\*/%%g
-s%/\*[^/]*%%g
-/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p
-/^[ ]*#[ ]*e*l*if[ ]/{
- s///
- s/@//g
- s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g
- s/$/@ /
- s/@defined //g
- s/[^@]*@\([^ ]* \)[^@]*/\1/g
- s/ *$//
- s/ /\
-/g
- p
-}
-' $arg | sort -u | sed 's%$% '$arg'%'
-done | awk '
-{ files[$1] = files[$1] " " $2 }
-END { for (sym in files) print sym files[sym] }' | sort
+ END {
+ for (sym in files) {
+ print sym files[sym]
+ }
+ }
+' ${1+"$@"} | sort
documentation.
@item
-You can remove the program binaries and object files from the source
+You can remove the program binaries and object files from the source code
directory by typing @samp{make clean}. To also remove the files that
@code{configure} created (so you can compile the package for a different
-kind of computer), type @samp{make distclean}.
+kind of computer), type @samp{make distclean}. There is also a
+@samp{make realclean} target, but that is intended mainly for the
+package's developers. If you use it, you may have to get all sorts of
+other programs in order to regenerate files that came with the distribution.
@end enumerate
@node Compilers and Options
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
@end example
-@node Build Directory
-@section Using a Different Build Directory
+@node Multiple Architectures
+@section Compiling For Multiple Architectures
-You can compile the package in a different directory from the one
-containing the source code. Doing so allows you to compile it on more
-than one kind of computer at the same time. To do this, you must use a
-version of @code{make} that supports the @code{VPATH} variable, such as
-GNU @code{make}. @code{cd} to the directory where you want the object
-files and executables to go and run the @code{configure} script.
-@code{configure} automatically checks for the source code in the
-directory that @code{configure} is in and in @file{..}.
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of @code{make} that
+supports the @code{VPATH} variable, such as GNU @code{make}. @code{cd}
+to the directory where you want the object files and executables to go
+and run the @code{configure} script. @code{configure} automatically
+checks for the source code in the directory that @code{configure} is in
+and in @file{..}.
+
+If you have to use a @code{make} that does not supports the @code{VPATH}
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use @samp{make distclean} before reconfiguring for
+another architecture.
@node Installation Names
@section Installation Names
@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
+Use and 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 @code{configure}.
@item --help
dnl m4 output diversions. We let m4 output them all in order at the end,
dnl except that we explicitly undivert AC_DIVERSION_SED.
-dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #!/bin/sh line
+dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #! /bin/sh line
define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings
define(AC_DIVERSION_INIT, 2)dnl initialization code
define(AC_DIVERSION_SED, 3)dnl variable substitutions in config.status
dnl for users of AC_REVISION.
dnl AC_INIT_BINSH()
AC_DEFUN(AC_INIT_BINSH,
-[#!/bin/sh
+[#! /bin/sh
])
dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
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 conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
# File descriptor usage:
-# 0 unused; standard input
+# 0 standard input
# 1 file creation
# 2 errors and warnings
-# 3 unused; some systems may open it to /dev/tty
-define(AC_FD_MSG, 4)dnl
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+define(AC_FD_MSG, 6)dnl
[#] AC_FD_MSG checking for... messages and results
define(AC_FD_CC, 5)dnl
[#] AC_FD_CC compiler messages saved in config.log
ac_help="$ac_help
[$2]"
AC_DIVERT_POP()dnl
-[#] Check whether --enable-$1 or --disable-$1 was given.
-enableval="[$enable_]patsubst($1, -, _)"
+[#] Check whether --enable-[$1] or --disable-[$1] was given.
+enableval="[$enable_]patsubst([$1], -, _)"
if test -n "$enableval"; then
ifelse([$3], , :, [$3])
ifelse([$4], , , [else
ac_help="$ac_help
[$2]"
AC_DIVERT_POP()dnl
-[#] Check whether --with-$1 or --without-$1 was given.
-withval="[$with_]patsubst($1, -, _)"
+[#] Check whether --with-[$1] or --without-[$1] was given.
+withval="[$with_]patsubst([$1], -, _)"
if test -n "$withval"; then
ifelse([$3], , :, [$3])
ifelse([$4], , , [else
EOF
changequote(, )dnl
dnl Allow a site initialization script to override cache values.
-# Ultrix sh set writes to stderr and can't be redirected directly.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
+ sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
>> $cache_file
changequote([, ])dnl
else
if (!f) exit(1);
fprintf(f, "%d\n", sizeof($1));
exit(0);
-}], AC_CV_NAME=`cat conftestval`)])dnl
+}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0)])dnl
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
undefine([AC_TYPE_NAME])dnl
define(AC_OUTPUT,
[trap '' 1 2 15
AC_CACHE_SAVE
-trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
-#!/bin/sh
+#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
dnl config.status should not do recursion.
ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
])dnl
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
changequote(, )dnl
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
# The dest file is in a subdirectory.
test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/$ac_dest_dir"
+ ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dest_dir_suffix.
changequote(, )dnl
ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
done
])
-This is a subroutine of AC_OUTPUT. It is called after running config.status.
+dnl This is a subroutine of AC_OUTPUT.
+dnl It is called after running config.status.
dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
define(AC_OUTPUT_SUBDIRS,
[
# Make the cache file name correct relative to the subdirectory.
changequote(, )dnl
# A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo /$ac_config_dir|sed 's%/[^/]*%../%g'`
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%/[^/]*%../%g' -e 's%^%/%`
changequote([, ])dnl
case "$cache_file" in
/*) ac_sub_cache_file=$cache_file ;;
*) # Relative path.
ac_sub_cache_file="$ac_dots$cache_file" ;;
esac
+ifdef([AC_PROVIDE_AC_PROG_INSTALL],
+ [ case "$ac_given_INSTALL" in
+changequote(, )dnl
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+changequote([, ])dnl
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+])dnl
echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
# The eval makes quoting arguments work.
AC_DEFUN(AC_DECL_YYTEXT,
[AC_REQUIRE_CPP()dnl
AC_REQUIRE([AC_PROG_LEX])dnl
-AC_MSG_CHECKING(for yytext declaration)
+AC_MSG_CHECKING(whether yytext is a pointer)
AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer,
[# POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent. Figure out which it is, since
elif test -f lexyy.c; then
LEX_OUTPUT_ROOT=lexyy
else
- AC_MSG_ERROR(cannot find output from $LEX, giving up)
+ AC_MSG_ERROR([cannot find output from $LEX, giving up])
fi
-echo 'extern char *yytext; main () { exit (0); }' >>$LEX_OUTPUT_ROOT.c
+echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LEXLIB"
-AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, ac_cv_prog_lex_yytext_pointer=yes)
+AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, , ac_cv_prog_lex_yytext_pointer=yes)
LIBS="$ac_save_LIBS"
rm -f "${LEX_OUTPUT_ROOT}.c"])dnl
AC_MSG_RESULT($ac_cv_prog_lex_yytext_pointer)
/* Use a field that we can force nonzero --
voluntary context switches.
For systems like NeXT and OSF/1 that don't set it,
- also use the system CPU time. */
+ also use the system CPU time. And page faults (I/O) for Linux. */
r.ru_nvcsw = 0;
r.ru_stime.tv_sec = 0;
r.ru_stime.tv_usec = 0;
+ r.ru_majflt = r.ru_minflt = 0;
switch (fork()) {
case 0: /* Child. */
sleep(1); /* Give up the CPU. */
default: /* Parent. */
wait3(&i, 0, &r);
sleep(1); /* Avoid "text file busy" from rm on fast HP-UX machines. */
- exit(r.ru_nvcsw == 0
+ exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
&& r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
}
}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])dnl
&& t.st_mtime - s.st_mtime < 120));
}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no,
ac_cv_func_utime_null=no)
-rm -f core])dnl
+rm -f core core.* *.core])dnl
AC_MSG_RESULT($ac_cv_func_utime_null)
if test $ac_cv_func_utime_null = yes; then
AC_DEFINE(HAVE_UTIME_NULL)
putc('\r', stdout);
exit(0); /* Non-reversed systems segv here. */
}], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no)
-rm -f core])dnl
+rm -f core core.* *.core])dnl
AC_MSG_RESULT($ac_cv_func_setvbuf_reversed)
if test $ac_cv_func_setvbuf_reversed = yes; then
AC_DEFINE(SETVBUF_REVERSED)
AC_MSG_CHECKING(whether cross-compiling)
AC_CACHE_VAL(ac_cv_c_cross,
[AC_TRY_RUN([main(){return(0);}],
- ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_cross=yes)])dnl
+ ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_c_cross=yes)])dnl
cross_compiling=$ac_cv_c_cross
AC_MSG_RESULT($ac_cv_c_cross)
])
ac_msg="whether #! works in shell scripts"
AC_MSG_CHECKING($ac_msg)
AC_CACHE_VAL(ac_cv_sys_interpreter,
-[echo '#!/bin/cat
+[echo '#! /bin/cat
exit 69
' > conftest
chmod u+x conftest
# These have to be linked with before -lX11, unlike the other
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
- AC_CHECK_LIB(ICE, IceConnectionNumbers,
+ AC_CHECK_LIB(ICE, IceConnectionNumber,
[X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"])
LDFLAGS="$ac_save_LDFLAGS"