+Thanks to everybody who's submitted changes and additions to Autoconf!
+I've incorporated some of them, and am still considering others for
+future releases -- but I didn't want to postpone this release indefinitely.
+
Major changes in release 2.0:
** New files:
** New macros:
* AC_CACHE_VAL to share results of tests between configure runs.
+* AC_DEFUN to define macros and automatically AC_PROVIDE them.
* AC_CONFIG_AUX_DIR, AC_CANONICAL_SYSTEM, AC_LINK_FILES to
support deciding unguessable features based on the host and target types.
* AC_CONFIG_SUBDIRS to recursively configure a source tree.
macro calls.
Producing configuration scripts using Autoconf requires GNU m4. You
-should install GNU m4 before configuring Autoconf, so that Autoconf's
-configure script can find it. The configuration scripts produced by
-Autoconf are self-contained, so their users do not need to have
-Autoconf (or GNU m4).
+should install GNU m4 (version 1.1 or later) before configuring
+Autoconf, so that Autoconf's configure script can find it. The
+configuration scripts produced by Autoconf are self-contained, so
+their users do not need to have Autoconf (or GNU m4).
Also, some optional utilities that come with Autoconf use Perl, Bash,
TCL, and the TCL packages Expect and DejaGNU. However, none of those
dnl Parameterized macros that do not check for something specific.
+dnl Requires GNU m4.
dnl This file is part of Autoconf.
dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
dnl
M4 environment variable to its path name.
)m4exit(2)])dnl
dnl
-define(AC_ACVERSION, 1.98)dnl
+define(AC_ACVERSION, 1.99)dnl
dnl This is defined by the --version option of the autoconf script.
ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
m4exit(0)])dnl
define(AC_DIVERSION_NORMAL, 0)dnl normal output
define(AC_DIVERSION_SED, 1)dnl sed substitutions for config.status
define(AC_DIVERSION_VAR, 2)dnl variable assignments for config.status
-define(AC_DIVERSION_HELP_ENABLE, 3)dnl --enable/--disable help strings
-define(AC_DIVERSION_ARG_ENABLE, 4)dnl --enable/--disable actions
-define(AC_DIVERSION_HELP_WITH, 5)dnl --with/--without help strings
-define(AC_DIVERSION_ARG_WITH, 6)dnl --with/--without actions
+define(AC_DIVERSION_HELP, 3)dnl --enable/--with help strings
+define(AC_DIVERSION_ARG, 4)dnl --enable/--with actions
+divert(AC_DIVERSION_NORMAL)dnl
+dnl
+dnl Define a macro which automatically provides itself.
+dnl Use instead of define for macros to be used as functions.
+dnl
+dnl AC_DEFUN(NAME, EXPANSION)
+define([AC_DEFUN],
+[define($1,
+[define([AC_PROVIDE_$1], )][$2])])dnl
dnl
-define(AC_INIT_NOTICE,
+AC_DEFUN(AC_INIT_NOTICE,
[# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version] AC_ACVERSION [
# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
])dnl
dnl
-define(AC_INIT_PARSEARGS,
+AC_DEFUN(AC_INIT_PARSEARGS,
[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
AC_BEFORE([$0], [AC_ARG_WITH])dnl
# Save the original args to write them into config.status later.
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
---enable/--disable options recognized:
-undivert(AC_DIVERSION_HELP_ENABLE)dnl
---with/--without options recognized:
-undivert(AC_DIVERSION_HELP_WITH)"dnl
+--enable/--with options recognized:
+undivert(AC_DIVERSION_HELP)"dnl
changequote([, ])dnl
# Initialize some variables set by options.
dnl
dnl Try to have only one #! line, just so it doesn't look funny.
dnl
-define(AC_BINSH,
-[AC_PROVIDE([AC_BINSH])dnl
-dnl AC_REQUIRE inserts a newline after this.
-#!/bin/sh])dnl
+AC_DEFUN(AC_BINSH,
+[#!/bin/sh
+])dnl
dnl
-define(AC_INIT,
+AC_DEFUN(AC_INIT,
[AC_REQUIRE([AC_BINSH])dnl
AC_INIT_NOTICE
AC_INIT_PARSEARGS
AC_INIT_PREPARE($1)])dnl
dnl
dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
-define(AC_INIT_PREPARE,
+AC_DEFUN(AC_INIT_PREPARE,
[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
AC_BEFORE([$0], [AC_ARG_WITH])dnl
AC_BEFORE([$0], [AC_CONFIG_HEADER])dnl
AC_BEFORE([$0], [AC_REVISION])dnl
AC_BEFORE([$0], [AC_PREREQ])dnl
-AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
+dnl AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
trap 'rm -fr confdefs* $ac_clean_files' 0
AC_CACHE_LOAD
AC_LANG_C
-undivert(AC_DIVERSION_ARG_ENABLE)dnl
-undivert(AC_DIVERSION_ARG_WITH)dnl
+undivert(AC_DIVERSION_ARG)dnl
])dnl
dnl
dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_ARG_ENABLE,
-[AC_PROVIDE([$0])dnl
-divert(AC_DIVERSION_HELP_ENABLE)dnl
+AC_DEFUN(AC_ARG_ENABLE,
+[divert(AC_DIVERSION_HELP)dnl
$2
-divert(AC_DIVERSION_ARG_ENABLE)dnl
+divert(AC_DIVERSION_ARG)dnl
AC_ENABLE_INTERNAL([$1], [$3], [$4])dnl
divert(AC_DIVERSION_NORMAL)dnl
])dnl
dnl
-define(AC_ENABLE,
+AC_DEFUN(AC_ENABLE,
[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE before AC_INIT])dnl
AC_ENABLE_INTERNAL([$1], [$2], [$3])dnl
])dnl
dnl
dnl AC_ENABLE_INTERNAL(FEATURE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_ENABLE_INTERNAL,
+AC_DEFUN(AC_ENABLE_INTERNAL,
[[#] Check whether --enable-$1 or --disable-$1 was given.
enableval="[$enable_]patsubst($1, -, _)"
if test -n "$enableval"; then
])dnl
dnl
dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_ARG_WITH,
-[AC_PROVIDE([$0])dnl
-divert(AC_DIVERSION_HELP_WITH)dnl
+AC_DEFUN(AC_ARG_WITH,
+[divert(AC_DIVERSION_HELP)dnl
$2
-divert(AC_DIVERSION_ARG_WITH)dnl
+divert(AC_DIVERSION_ARG)dnl
AC_WITH_INTERNAL([$1], [$3], [$4])dnl
divert(AC_DIVERSION_NORMAL)dnl
])dnl
dnl
-define(AC_WITH,
+AC_DEFUN(AC_WITH,
[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH before AC_INIT])dnl
AC_WITH_INTERNAL([$1], [$2], [$3])dnl
])dnl
dnl
dnl AC_WITH_INTERNAL(PACKAGE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_WITH_INTERNAL,
+AC_DEFUN(AC_WITH_INTERNAL,
[[#] Check whether --with-$1 or --without-$1 was given.
withval="[$with_]patsubst($1, -, _)"
if test -n "$withval"; then
])dnl
dnl
dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
-define(AC_CONFIG_HEADER, [AC_PROVIDE([$0])define(AC_LIST_HEADERS, $1)])dnl
+AC_DEFUN(AC_CONFIG_HEADER,
+[define(AC_LIST_HEADERS, $1)])dnl
dnl
dnl AC_REVISION(REVISION-INFO)
-define(AC_REVISION, [AC_PROVIDE([$0])AC_REQUIRE([AC_BINSH])dnl
+AC_DEFUN(AC_REVISION,
+[AC_REQUIRE([AC_BINSH])dnl
[# From configure.in] translit([$1], $")])dnl
dnl
dnl Subroutines of AC_PREREQ.
dnl
dnl Change the dots in version number $1 into commas.
-define(AC_PREREQ_SPLIT, [translit($1, ., [, ])])dnl
+AC_DEFUN(AC_PREREQ_SPLIT,
+[translit($1, ., [, ])])dnl
dnl
dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0).
-define(AC_PREREQ_CANON, [$1, $2, ifelse([$3], , 0, [$3])])dnl
+AC_DEFUN(AC_PREREQ_CANON,
+[$1, $2, ifelse([$3], , 0, [$3])])dnl
dnl
dnl Complain and exit if the version number in $1 through $3 is less than
dnl the version number in $4 through $6.
dnl $7 is the printable version of the second version number.
-define(AC_PREREQ_COMPARE,
+AC_DEFUN(AC_PREREQ_COMPARE,
[ifelse(builtin([eval],
[$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]), 1,
[errprint(Autoconf version $7 or higher is required
dnl
dnl Complain and exit if the Autoconf version is less than $1.
dnl AC_PREREQ(VERSION)
-define(AC_PREREQ,
-[AC_PROVIDE([$0])dnl
-AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
+AC_DEFUN(AC_PREREQ,
+[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])dnl
dnl
dnl Run configure in subdirectories $1.
dnl Not actually done until AC_OUTPUT_SUBDIRS.
dnl AC_CONFIG_SUBDIRS(DIR ...)
-define(AC_CONFIG_SUBDIRS,
-[AC_PROVIDE([$0])dnl
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_DEFUN(AC_CONFIG_SUBDIRS,
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
define([AC_LIST_SUBDIRS], [$1])])dnl
dnl
dnl Guess the value for the `prefix' variable by looking for
dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
dnl set `prefix' to /usr/local/gnu.
dnl AC_PREFIX_PROGRAM(PROGRAM)
-define(AC_PREFIX_PROGRAM, [define([AC_LIST_PREFIX_PROGRAM], [$1])])dnl
-define(AC_PREFIX_INTERNAL,
+AC_DEFUN(AC_PREFIX_PROGRAM,
+[define([AC_LIST_PREFIX_PROGRAM], [$1])])dnl
+AC_DEFUN(AC_PREFIX_INTERNAL,
[if test "x$prefix" = xNONE; then
changequote(<<, >>)dnl
define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
fi
undefine(AC_VAR_NAME)dnl
])dnl
-define(AC_PREFIX,
+AC_DEFUN(AC_PREFIX,
[AC_OBSOLETE([$0], [; instead use AC_PREFIX_PROGRAM before AC_INIT])dnl
AC_PREFIX_INTERNAL([$1])])dnl
dnl
dnl in directory $1. These are auxiliary files used in configuration.
dnl $1 can be either absolute or relative to ${srcdir}.
dnl AC_CONFIG_AUX_DIR(DIR)
-define(AC_CONFIG_AUX_DIR,
+AC_DEFUN(AC_CONFIG_AUX_DIR,
[AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)])dnl
dnl
dnl The default is `${srcdir}' or `${srcdir}/..' or `${srcdir}/../..'.
dnl There's no need to call this macro explicitly; just AC_REQUIRE it.
-define(AC_CONFIG_AUX_DIR_DEFAULT,
+AC_DEFUN(AC_CONFIG_AUX_DIR_DEFAULT,
[AC_CONFIG_AUX_DIRS(${srcdir} ${srcdir}/.. ${srcdir}/../..)])dnl
dnl
dnl Internal subroutine.
dnl We look only for install.sh, so users of AC_PROG_INSTALL
dnl do not automatically need to distribute the other auxiliary files.
dnl AC_CONFIG_AUX_DIRS(DIR ...)
-define(AC_CONFIG_AUX_DIRS,
+AC_DEFUN(AC_CONFIG_AUX_DIRS,
[ac_aux_dir=
for ac_dir in $1; do
if test -f $ac_dir/install.sh; then
])dnl
dnl
dnl Canonicalize the host, target, and build system types.
-define(AC_CANONICAL_SYSTEM,
+AC_DEFUN(AC_CANONICAL_SYSTEM,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Do some error checking and defaulting for the host and target type.
# The inputs are:
dnl
dnl Subroutines of AC_CANONICAL_SYSTEM.
dnl
-define(AC_CANONICAL_HOST,
+AC_DEFUN(AC_CANONICAL_HOST,
[AC_MSG_CHECKING(host system type)
case "${host_alias}" in
AC_SUBST(host_os)dnl
])dnl
dnl
-define(AC_CANONICAL_TARGET,
+AC_DEFUN(AC_CANONICAL_TARGET,
[AC_MSG_CHECKING(target system type)
case "${target_alias}" in
AC_SUBST(target_os)dnl
])dnl
dnl
-define(AC_CANONICAL_BUILD,
+AC_DEFUN(AC_CANONICAL_BUILD,
[AC_MSG_CHECKING(build system type)
case "${build_alias}" in
dnl link name in $1.
dnl Not actually done until AC_OUTPUT_LINKS.
dnl AC_LINK_FILES(LINK ..., FILE ...)
-define(AC_LINK_FILES,
+AC_DEFUN(AC_LINK_FILES,
[define([AC_LIST_LINKS], [$1])define([AC_LIST_FILES], [$2])])dnl
dnl
dnl
dnl
dnl
dnl Look for site or system specific initialization scripts.
-define(AC_SITE_LOAD,
+AC_DEFUN(AC_SITE_LOAD,
[ac_site_dirs=/usr/local
if test "x$prefix" != xNONE; then
ac_site_dirs=$prefix
done
])dnl
dnl
-define(AC_CACHE_LOAD,
+AC_DEFUN(AC_CACHE_LOAD,
[if test -r "$cache_file"; then
echo "loading cache $cache_file"
. $cache_file
else
echo "creating cache $cache_file"
> $cache_file
-fi])dnl
+fi
+])dnl
dnl
-define(AC_CACHE_SAVE,
+AC_DEFUN(AC_CACHE_SAVE,
[if test -w $cache_file; then
echo "updating cache $cache_file"
cat > $cache_file <<\CEOF
# Ultrix sh set writes to stderr and can't be redirected directly.
(set) 2>&1 | sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1-'\2'}/p" >> $cache_file
changequote([, ])dnl
-fi])dnl
+fi
+])dnl
dnl
dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
-define(AC_CACHE_VAL,
+AC_DEFUN(AC_CACHE_VAL,
[AC_REQUIRE([AC_PROG_ECHO_N])dnl
dnl We used to use the below line, but it fails if the 1st arg is a
dnl shell variable, so we need the eval.
dnl Several simple subroutines to do various flavors of quoting.
dnl
dnl Quote $1 against shell "s.
-define(AC_QUOTE_DQUOTE, [dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
+AC_DEFUN(AC_QUOTE_DQUOTE,
+[dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
patsubst($1, changequote(, )\([$"`\\]\)changequote([, ]), \\\1)])dnl
dnl
dnl Quote $1 against shell 's.
-define(AC_QUOTE_SQUOTE, [patsubst($1, ', '\\'')])dnl
+AC_DEFUN(AC_QUOTE_SQUOTE,
+[patsubst($1, ', '\\'')])dnl
dnl
dnl Quote $1 against shell here documents (<<EOF).
-define(AC_QUOTE_HERE, [changequote({, })dnl
+AC_DEFUN(AC_QUOTE_HERE,
+[changequote({, })dnl
dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
patsubst(patsubst($1, \(\\[$`\\]\), \\\1), \([$`]\), \\\1){}dnl
changequote([, ])])dnl
dnl
dnl Quote $1 against the right hand side of a sed substitution.
-define(AC_QUOTE_SED, [changequote({, })dnl
+AC_DEFUN(AC_QUOTE_SED,
+[changequote({, })dnl
dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
dnl % and @ and ! are commonly used as the sed s separator character.
patsubst($1, \([&\\%@!]\), \\\1){}dnl
changequote([, ])])dnl
dnl
dnl Quote $1 against tokenization.
-define(AC_QUOTE_TOKEN, [changequote({, })dnl
+AC_DEFUN(AC_QUOTE_TOKEN,
+[changequote({, })dnl
patsubst($1, \([ ]\), \\\1){}dnl
changequote([, ])])dnl
dnl
dnl Subroutines of AC_DEFINE. Does more quoting magic than any sane person
dnl should be able to understand. The point of it all is that what goes into
dnl Makefile et al should be verbatim what was written in configure.in.
-define(AC_DEFINE_QUOTE, [dnl
-AC_QUOTE_TOKEN(AC_QUOTE_SQUOTE(AC_QUOTE_DQUOTE($1)))])dnl
+AC_DEFUN(AC_DEFINE_QUOTE,
+[AC_QUOTE_TOKEN(AC_QUOTE_SQUOTE(AC_QUOTE_DQUOTE($1)))])dnl
dnl
-define(AC_DEFINE_SEDQUOTE, [dnl
-AC_QUOTE_DQUOTE(AC_QUOTE_HERE(AC_QUOTE_HERE(AC_QUOTE_SED($1))))])dnl
+AC_DEFUN(AC_DEFINE_SEDQUOTE,
+[AC_QUOTE_DQUOTE(AC_QUOTE_HERE(AC_QUOTE_HERE(AC_QUOTE_SED($1))))])dnl
dnl
dnl Don't compare $2 to a blank, so we can support "-Dfoo=".
dnl If creating a configuration header file, we add
dnl and the value to give it.
dnl The newlines around the curly braces prevent sh syntax errors.
dnl AC_DEFINE(VARIABLE [, VALUE])
-define(AC_DEFINE, [
+AC_DEFUN(AC_DEFINE,
+[
{
dnl Uniformly use AC_DEFINE_[SED]QUOTE, so callers of AC_DEFINE_UNQUOTED
dnl can use AC_QUOTE_* manually if they want to.
dnl it doesn't distinguish between the arguments to the outer
dnl function, which should be expanded, and the arguments to the inner
dnl function, which shouldn't yet.
-define(AC_QUOTE_IDENTITY, $1)dnl
-define(AC_DEFINE_UNQUOTED, [dnl
-pushdef([AC_QUOTE_SQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
+AC_DEFUN(AC_QUOTE_IDENTITY,
+$1)dnl
+AC_DEFUN(AC_DEFINE_UNQUOTED,
+[pushdef([AC_QUOTE_SQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
pushdef([AC_DEFINE_SEDQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
AC_DEFINE($1, $2)dnl
popdef([AC_DEFINE_SEDQUOTE])dnl
dnl This macro protects the argument from being diverted twice
dnl if this macro is called twice for it.
dnl AC_SUBST(VARIABLE)
-define(AC_SUBST,
+AC_DEFUN(AC_SUBST,
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
divert(AC_DIVERSION_SED)dnl
])])dnl
dnl
dnl AC_SUBST_FILE(VARIABLE, FILE)
-define(AC_SUBST_FILE,
+AC_DEFUN(AC_SUBST_FILE,
[if test -f $2; then
echo using $2 for $1)
AC_INSERT_FILE($1, $2)
AC_INSERT_FILE($1, ${srcdir}/$2)
fi
])dnl
-define(AC_INSERT_FILE,
+AC_DEFUN(AC_INSERT_FILE,
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
divert(AC_DIVERSION_SED)dnl
dnl
dnl
dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION)
-define(AC_MSG_CHECKING,
+AC_DEFUN(AC_MSG_CHECKING,
[AC_REQUIRE([AC_PROG_ECHO_N])dnl
echo $ac_n "checking $1""... $ac_c" 1>&4])dnl
dnl
-define(AC_CHECKING,
-[AC_OBSOLETE([$0], [; instead use AC_MSG_CHECKING])dnl
-echo "checking $1" 1>&4])dnl
+AC_DEFUN(AC_CHECKING,
+[echo "checking $1" 1>&4])dnl
dnl
dnl AC_MSG_RESULT(RESULT-DESCRIPTION)
-define(AC_MSG_RESULT,
+AC_DEFUN(AC_MSG_RESULT,
[AC_REQUIRE([AC_PROG_ECHO_N])dnl
echo "$ac_t""$1" 1>&4])dnl
dnl
-define(AC_VERBOSE,
+AC_DEFUN(AC_VERBOSE,
[AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl
echo " $1" 1>&4])dnl
dnl
dnl AC_MSG_WARN(PROBLEM-DESCRIPTION)
-define(AC_MSG_WARN,
+AC_DEFUN(AC_MSG_WARN,
[echo "configure: warning: $1" 1>&2])dnl
dnl
dnl AC_MSG_ERROR(ERROR-DESCRIPTION)
-define(AC_MSG_ERROR,
+AC_DEFUN(AC_MSG_ERROR,
[echo "configure: $1" 1>&2; exit 1])dnl
dnl
dnl
dnl ### Selecting which language to use for testing
dnl
dnl
-define(AC_LANG_C,
+AC_DEFUN(AC_LANG_C,
[define([AC_LANG], [C])dnl
-AC_PROVIDE([$0])dnl
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='${CPP}'
ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&5 2>&5'
])dnl
dnl
-define(AC_LANG_CPLUSPLUS,
+AC_DEFUN(AC_LANG_CPLUSPLUS,
[define([AC_LANG], [CPLUSPLUS])dnl
-AC_PROVIDE([$0])dnl
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='${CXXCPP}'
])dnl
dnl
dnl Push the current language on a stack.
-define(AC_LANG_SAVE, [pushdef([AC_LANG_STACK], AC_LANG)])dnl
+AC_DEFUN(AC_LANG_SAVE,
+[pushdef([AC_LANG_STACK], AC_LANG)])dnl
dnl
dnl Restore the current language from the stack.
-define(AC_LANG_RESTORE,
+AC_DEFUN(AC_LANG_RESTORE,
[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])dnl
dnl
dnl
dnl
dnl
dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
-define(AC_BEFORE,
+AC_DEFUN(AC_BEFORE,
[ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1
])])])dnl
dnl
dnl AC_REQUIRE(MACRO-NAME)
-define(AC_REQUIRE,
-[ifdef([AC_PROVIDE_$1], , [indir([$1])
-])])dnl
+AC_DEFUN(AC_REQUIRE,
+[ifdef([AC_PROVIDE_$1], , [indir([$1])])])dnl
dnl
dnl AC_PROVIDE(MACRO-NAME)
define(AC_PROVIDE,
[define([AC_PROVIDE_$1], )])dnl
dnl
dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION])
-define(AC_OBSOLETE,
+AC_DEFUN(AC_OBSOLETE,
[errprint(__file__:__line__: warning: [$1] is obsolete[$2]
)])dnl
dnl
dnl
dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
dnl [, VALUE-IF-NOT-FOUND])
-define(AC_CHECK_PROG,
+AC_DEFUN(AC_CHECK_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
])dnl
fi])dnl
$1="$ac_cv_prog_$1"
-test -n "[$]$1" && AC_MSG_RESULT([$]$1)
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
AC_SUBST($1)dnl
])dnl
dnl
dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
-define(AC_PATH_PROG,
+AC_DEFUN(AC_PATH_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
;;
esac])dnl
$1="$ac_cv_path_$1"
-test -n "[$]$1" && AC_MSG_RESULT([$]$1)
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
AC_SUBST($1)dnl
])dnl
dnl
dnl
dnl
dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
-define(AC_CHECK_PROGS,
+AC_DEFUN(AC_CHECK_PROGS,
[for ac_prog in $2
do
AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, )
])])dnl
dnl
dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
-define(AC_PATH_PROGS,
+AC_DEFUN(AC_PATH_PROGS,
[for ac_prog in $2
do
AC_PATH_PROG($1, [$]ac_prog)
dnl
dnl AC_CHECK_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
-define(AC_CHECK_LIB,
+AC_DEFUN(AC_CHECK_LIB,
[changequote(/, /)dnl
define(/AC_LIB_NAME/, dnl
patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl
dnl
dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
-define(AC_HAVE_LIBRARY,
+AC_DEFUN(AC_HAVE_LIBRARY,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl
AC_CHECK_LIB([$1], main, [$2], [$3], [$4])dnl
])dnl
dnl
dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
dnl ACTION-IF-NOT-FOUND])
-define(AC_EGREP_HEADER,
-[AC_PROVIDE([$0])dnl
-AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])])dnl
+AC_DEFUN(AC_EGREP_HEADER,
+[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])])dnl
dnl
-dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must come early,
-dnl it is not included in AC_BEFORE checks.
+dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
+dnl come early, it is not included in AC_BEFORE checks.
dnl AC_EGREP_CPP(PATTERN, PROGRAM, ACTION-IF-FOUND [,
dnl ACTION-IF-NOT-FOUND])
-define(AC_EGREP_CPP,
+AC_DEFUN(AC_EGREP_CPP,
[AC_REQUIRE_CPP()dnl
-AC_PROVIDE([$0])dnl
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
[$2]
dnl
dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-define(AC_COMPILE_CHECK,
-[AC_PROVIDE([$0])dnl
-dnl It's actually ok to use this, if you don't care about caching.
+AC_DEFUN(AC_COMPILE_CHECK,
+[dnl It's actually ok to use this, if you don't care about caching.
dnl AC_OBSOLETE([$0], [; instead use AC_TRY_LINK])dnl
ifelse([$1], , , [AC_CHECKING([for $1])
])dnl
dnl
dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-define(AC_TRY_LINK,
-[AC_PROVIDE([$0])dnl
-dnl We use return because because C++ requires a prototype for exit.
+AC_DEFUN(AC_TRY_LINK,
+[dnl We use return because because C++ requires a prototype for exit.
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
[$1]
dnl
dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
dnl [, ACTION-IF-CROSS-COMPILING]])
-define(AC_TRY_RUN,
-[AC_PROVIDE([$0])dnl
-AC_REQUIRE([AC_C_CROSS])dnl
+AC_DEFUN(AC_TRY_RUN,
+[AC_REQUIRE([AC_C_CROSS])dnl
if test "$cross_compiling" = yes; then
ifelse([$4], , AC_MSG_ERROR(can not run test program while cross compiling),
[AC_MSG_WARN(using default for cross-compiling)
rm -fr conftest*])dnl
dnl
dnl AC_TRY_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_TRY_CPP,
+AC_DEFUN(AC_TRY_CPP,
[AC_REQUIRE_CPP()dnl
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
dnl
dnl
dnl AC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-define(AC_CHECK_HEADER,
+AC_DEFUN(AC_CHECK_HEADER,
[dnl Do the transliteration at runtime so arg 1 can be a shell variable.
ac_var=`echo "$1" | tr './' '__'`
AC_MSG_CHECKING([for $1])
])dnl
dnl
dnl AC_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-define(AC_CHECK_FUNC,
+AC_DEFUN(AC_CHECK_FUNC,
[AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(ac_cv_func_$1,
[AC_TRY_LINK(
])dnl
dnl
dnl AC_CHECK_FUNCS(FUNCTION...)
-define(AC_CHECK_FUNCS,
+AC_DEFUN(AC_CHECK_FUNCS,
[for ac_func in $1
do
changequote(, )dnl
])dnl
dnl
dnl AC_CHECK_HEADERS(HEADER-FILE...)
-define(AC_CHECK_HEADERS,
+AC_DEFUN(AC_CHECK_HEADERS,
[AC_REQUIRE_CPP()dnl Make sure the cpp check happens outside the loop.
for ac_hdr in $1
do
])dnl
dnl
dnl AC_REPLACE_FUNCS(FUNCTION-NAME...)
-define(AC_REPLACE_FUNCS,
+AC_DEFUN(AC_REPLACE_FUNCS,
[for ac_func in $1
do
AC_CHECK_FUNC(${ac_func}, , [LIBOBJS="$LIBOBJS ${ac_func}.o"])
])dnl
dnl
dnl AC_CHECK_SIZEOF(TYPE)
-define(AC_CHECK_SIZEOF,
+AC_DEFUN(AC_CHECK_SIZEOF,
[changequote(<<, >>)dnl
dnl The name to #define.
define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
])dnl
dnl
dnl AC_CHECK_TYPE(TYPE, DEFAULT)
-define(AC_CHECK_TYPE,
+AC_DEFUN(AC_CHECK_TYPE,
[AC_MSG_CHECKING(for $1 in sys/types.h)
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_HEADER($1, sys/types.h, ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
dnl
dnl
dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS])
-define(AC_OUTPUT,
+AC_DEFUN(AC_OUTPUT,
[AC_CACHE_SAVE
test "x$prefix" = xNONE && prefix=/usr/local
[divert(AC_DIVERSION_SED)dnl
s%@DEFS@%-DHAVE_CONFIG_H%],
[divert(AC_DIVERSION_SED)dnl
-s%@DEFS@%$DEFS%]
-[divert(AC_DIVERSION_VAR)dnl
+s%@DEFS@%$DEFS%
+divert(AC_DIVERSION_VAR)dnl
DEFS='$DEFS'
])dnl
divert(AC_DIVERSION_VAR)dnl
extrasub='$extrasub'
divert(AC_DIVERSION_NORMAL)dnl
-# Some shells look in PATH for config.status without the "./".
+# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
trap "rm -f ${CONFIG_STATUS}; exit 1" 1 2 15
dnl Create the header files listed in $1.
dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
dnl here document whose contents are going into config.status.
-define(AC_OUTPUT_HEADER,
+AC_DEFUN(AC_OUTPUT_HEADER,
[changequote(<<, >>)dnl
# These sed commands are put into ac_sed_defs when defining a macro.
])dnl
dnl
-define(AC_OUTPUT_LINKS,
+AC_DEFUN(AC_OUTPUT_LINKS,
[ac_links="$1"
ac_files="$2"
while test -n "${ac_files}"; do
done
])dnl
dnl
-define(AC_OUTPUT_SUBDIRS,
+AC_DEFUN(AC_OUTPUT_SUBDIRS,
[if test -z "${norecursion}"; then
# Remove --cache-file and --srcdir arguments so they do not pile up.
dnl checking messages from result messages.
dnl Idea borrowed from dist 3.0.
dnl Internal use only.
-define(AC_PROG_ECHO_N,
-[AC_PROVIDE([$0])dnl
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+AC_DEFUN(AC_PROG_ECHO_N,
+[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
if (echo -n testing; echo 1,2,3) | grep -e -n > /dev/null; then
ac_n= ac_c='
' ac_t=' '
fi
else
ac_n= ac_c='\c' ac_t=
-fi])dnl
+fi
+])dnl
dnl
-define(AC_PROG_CC,
+AC_DEFUN(AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_PROVIDE([$0])dnl
AC_CHECK_PROG(CC, gcc, gcc, cc)
AC_MSG_CHECKING(whether we are using GNU C)
if test $ac_cv_prog_gcc = yes; then GCC=yes; else GCC= ; fi
])dnl
dnl
-define(AC_PROG_CXX,
+AC_DEFUN(AC_PROG_CXX,
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
-AC_PROVIDE([$0])dnl
AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc)
# Find out if we are using GNU C++, under whatever name.
if test $ac_cv_prog_gxx = yes; then GXX=yes; else GXX= ; fi
])dnl
dnl
-define(AC_PROG_GCC_TRADITIONAL,
+AC_DEFUN(AC_PROG_GCC_TRADITIONAL,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
if test $ac_cv_prog_gcc = yes; then
fi
])dnl
dnl
-define(AC_PROG_CC_C_O,
+AC_DEFUN(AC_PROG_CC_C_O,
[if test "x$CC" != xcc; then
AC_MSG_CHECKING(whether $CC and cc understand -c and -o together)
else
])dnl
dnl
dnl Define SET_MAKE to set ${MAKE} if make doesn't.
-define(AC_PROG_MAKE_SET,
+AC_DEFUN(AC_PROG_MAKE_SET,
[AC_MSG_CHECKING(whether ${MAKE-make} sets \$MAKE)
set dummy ${MAKE-make}; ac_make=[$]2
AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
AC_SUBST([SET_MAKE])dnl
])dnl
dnl
-define(AC_PROG_RANLIB, [AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])dnl
+AC_DEFUN(AC_PROG_RANLIB,
+[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])dnl
dnl
-define(AC_PROG_AWK, [AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])dnl
+AC_DEFUN(AC_PROG_AWK,
+[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])dnl
dnl
-define(AC_PROG_YACC, [AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])dnl
+AC_DEFUN(AC_PROG_YACC,
+[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])dnl
dnl
-define(AC_PROG_CPP,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(how to run the C preprocessor)
+AC_DEFUN(AC_PROG_CPP,
+[AC_MSG_CHECKING(how to run the C preprocessor)
if test -z "$CPP"; then
AC_CACHE_VAL(ac_cv_prog_CPP,
[ # This must be in double quotes, not single quotes, because CPP may get
AC_SUBST(CPP)dnl
])dnl
dnl
-define(AC_PROG_CXXCPP,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(how to run the C++ preprocessor)
+AC_DEFUN(AC_PROG_CXXCPP,
+[AC_MSG_CHECKING(how to run the C++ preprocessor)
if test -z "$CXXCPP"; then
AC_CACHE_VAL(ac_cv_prog_CXXCPP,
[AC_LANG_SAVE[]dnl
dnl
dnl Require finding the C or C++ preprocessor, whichever is the
dnl current language.
-define(AC_REQUIRE_CPP,
+AC_DEFUN(AC_REQUIRE_CPP,
[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])])dnl
dnl
-define(AC_PROG_LEX,
-[AC_PROVIDE([$0])dnl
-AC_CHECK_PROG(LEX, flex, flex, lex)
+AC_DEFUN(AC_PROG_LEX,
+[AC_CHECK_PROG(LEX, flex, flex, lex)
AC_MSG_CHECKING(for $LEX library)
if test -z "$LEXLIB"
then
AC_MSG_RESULT($LEXLIB)
AC_SUBST(LEXLIB)])dnl
dnl
-define(AC_DECL_YYTEXT,
+AC_DEFUN(AC_DECL_YYTEXT,
[AC_REQUIRE_CPP()dnl
AC_REQUIRE([AC_PROG_LEX])dnl
AC_MSG_CHECKING(for yytext declaration)
AC_SUBST(LEX_OUTPUT_ROOT)dnl
])dnl
dnl
-define(AC_PROG_INSTALL,
+AC_DEFUN(AC_PROG_INSTALL,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Make sure to not get the incompatible SysV /etc/install and
# /usr/sbin/install, which might be in PATH before a BSD-like install,
AC_SUBST(INSTALL_DATA)dnl
])dnl
dnl
-define(AC_PROG_LN_S,
+AC_DEFUN(AC_PROG_LN_S,
[AC_MSG_CHECKING(whether ln -s works)
AC_CACHE_VAL(ac_cv_prog_LN_S,
[rm -f conftestdata
AC_SUBST(LN_S)dnl
])dnl
dnl
-define(AC_PROG_RSH,
+AC_DEFUN(AC_PROG_RSH,
[AC_MSG_CHECKING(for remote shell)
AC_CACHE_VAL(ac_cv_path_RSH,
[ac_cv_path_RSH=no
dnl ### Checks for header files
dnl
dnl
-define(AC_HEADER_STDC,
+AC_DEFUN(AC_HEADER_STDC,
[AC_REQUIRE_CPP()dnl
AC_MSG_CHECKING(for ANSI C header files)
AC_CACHE_VAL(ac_cv_header_stdc,
AC_MSG_RESULT($ac_cv_header_stdc)
if test $ac_cv_header_stdc = yes; then
AC_DEFINE(STDC_HEADERS)
-fi])dnl
+fi
+])dnl
dnl
-define(AC_UNISTD_H,
+AC_DEFUN(AC_UNISTD_H,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl
AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])dnl
dnl
-define(AC_USG,
+AC_DEFUN(AC_USG,
[AC_OBSOLETE([$0],
[; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl
AC_MSG_CHECKING([for BSD string and memory functions])
dnl
dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
dnl To avoid problems, don't check for gcc2 built-ins.
-define(AC_MEMORY_H,
+AC_DEFUN(AC_MEMORY_H,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])dnl
AC_MSG_CHECKING(whether string.h declares mem functions)
AC_EGREP_HEADER(memchr, string.h, ac_found=yes, ac_found=no)
AC_MSG_RESULT($ac_found)
if test $ac_found = no; then
AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)])
-fi])dnl
+fi
+])dnl
dnl
-define(AC_HEADER_MAJOR,
+AC_DEFUN(AC_HEADER_MAJOR,
[AC_MSG_CHECKING([for major, minor and makedev header])
AC_CACHE_VAL(ac_cv_header_major,
[AC_TRY_LINK([#include <sys/types.h>],
esac
])dnl
dnl
-define(AC_HEADER_DIRENT,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(for directory library header)
+AC_DEFUN(AC_HEADER_DIRENT,
+[AC_MSG_CHECKING(for directory library header)
dnl We don't use AC_CHECK_HEADERS so we can stop when we get a match.
AC_CACHE_VAL(ac_cv_header_dir,
[ac_cv_header_dir=no
])dnl
dnl
dnl Obsolete.
-define(AC_DIR_HEADER,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(for directory library header)
+AC_DEFUN(AC_DIR_HEADER,
+[AC_MSG_CHECKING(for directory library header)
AC_CACHE_VAL(ac_cv_header_dir,
[ac_cv_header_dir=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
fi
])dnl
dnl
-define(AC_HEADER_STAT,
+AC_DEFUN(AC_HEADER_STAT,
[AC_MSG_CHECKING(for broken stat file mode macros)
AC_CACHE_VAL(ac_cv_header_stat_broken,
[AC_EGREP_CPP([You lose], [#include <sys/types.h>
fi
])dnl
dnl
-define(AC_DECL_SYS_SIGLIST,
+AC_DEFUN(AC_DECL_SYS_SIGLIST,
[AC_MSG_CHECKING([for sys_siglist declaration in signal.h or unistd.h])
AC_CACHE_VAL(ac_cv_decl_sys_siglist,
[AC_TRY_LINK([#include <sys/types.h>
dnl ### Checks for typedefs
dnl
dnl
-define(AC_TYPE_GETGROUPS,
+AC_DEFUN(AC_TYPE_GETGROUPS,
[AC_REQUIRE([AC_TYPE_UID_T])dnl
AC_MSG_CHECKING(type of array argument to getgroups)
AC_CACHE_VAL(ac_cv_type_getgroups,
AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
])dnl
dnl
-define(AC_TYPE_UID_T,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(for uid_t in sys/types.h)
+AC_DEFUN(AC_TYPE_UID_T,
+[AC_MSG_CHECKING(for uid_t in sys/types.h)
AC_CACHE_VAL(ac_cv_type_uid_t,
[AC_EGREP_HEADER(uid_t, sys/types.h,
ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)])dnl
fi
])dnl
dnl
-define(AC_TYPE_SIZE_T, [AC_CHECK_TYPE(size_t, unsigned)])dnl
+AC_DEFUN(AC_TYPE_SIZE_T,
+[AC_CHECK_TYPE(size_t, unsigned)])dnl
dnl
-define(AC_TYPE_PID_T, [AC_CHECK_TYPE(pid_t, int)])dnl
+AC_DEFUN(AC_TYPE_PID_T,
+[AC_CHECK_TYPE(pid_t, int)])dnl
dnl
-define(AC_TYPE_OFF_T,
-[AC_PROVIDE([$0])dnl
-AC_CHECK_TYPE(off_t, long)])dnl
+AC_DEFUN(AC_TYPE_OFF_T,
+[AC_CHECK_TYPE(off_t, long)])dnl
dnl
-define(AC_TYPE_MODE_T, [AC_CHECK_TYPE(mode_t, int)])dnl
+AC_DEFUN(AC_TYPE_MODE_T,
+[AC_CHECK_TYPE(mode_t, int)])dnl
dnl
dnl Note that identifiers starting with SIG are reserved by ANSI C.
-define(AC_TYPE_SIGNAL,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING([return type of signal handlers])
+AC_DEFUN(AC_TYPE_SIGNAL,
+[AC_MSG_CHECKING([return type of signal handlers])
AC_CACHE_VAL(ac_cv_type_signal,
[AC_TRY_LINK([#include <sys/types.h>
#include <signal.h>
dnl ### Checks for functions
dnl
dnl
-define(AC_FUNC_MMAP,
+AC_DEFUN(AC_FUNC_MMAP,
[AC_MSG_CHECKING(for working mmap)
AC_CACHE_VAL(ac_cv_func_mmap,
[AC_TRY_RUN([/* Thanks to Mike Haertel and Jim Avera for this test. */
fi
])dnl
dnl
-define(AC_FUNC_VPRINTF,
+AC_DEFUN(AC_FUNC_VPRINTF,
[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
if test "$ac_cv_func_vprintf" != yes; then
AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
fi
])dnl
dnl
-define(AC_FUNC_VFORK,
+AC_DEFUN(AC_FUNC_VFORK,
[AC_REQUIRE([AC_TYPE_PID_T])dnl
AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H))
AC_MSG_CHECKING(for working vfork)
fi
])dnl
dnl
-define(AC_FUNC_WAIT3,
+AC_DEFUN(AC_FUNC_WAIT3,
[AC_MSG_CHECKING(for wait3 that fills in rusage)
AC_CACHE_VAL(ac_cv_func_wait3,
[AC_TRY_RUN([#include <sys/types.h>
fi
])dnl
dnl
-define(AC_FUNC_ALLOCA,
+AC_DEFUN(AC_FUNC_ALLOCA,
[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
AC_MSG_CHECKING([for working alloca.h])
AC_SUBST(ALLOCA)dnl
])dnl
dnl
-define(AC_FUNC_GETLOADAVG,
+AC_DEFUN(AC_FUNC_GETLOADAVG,
[# Some definitions of getloadavg require that the program be installed setgid.
NEED_SETGID=false
AC_SUBST(NEED_SETGID)dnl
AC_SUBST(KMEM_GROUP)dnl
])dnl
dnl
-define(AC_FUNC_UTIME_NULL,
+AC_DEFUN(AC_FUNC_UTIME_NULL,
[AC_MSG_CHECKING(whether utime accepts a null argument)
AC_CACHE_VAL(ac_cv_func_utime_null,
[rm -f conftestdata; > conftestdata
fi
])dnl
dnl
-define(AC_FUNC_STRCOLL,
+AC_DEFUN(AC_FUNC_STRCOLL,
[AC_MSG_CHECKING(for strcoll)
AC_CACHE_VAL(ac_cv_func_strcoll,
[AC_TRY_RUN([#include <string.h>
fi
])dnl
dnl
-define(AC_FUNC_SETVBUF_REVERSED,
+AC_DEFUN(AC_FUNC_SETVBUF_REVERSED,
[AC_MSG_CHECKING(whether setvbuf arguments are reversed)
AC_CACHE_VAL(ac_cv_func_setvbuf_reversed,
[AC_TRY_RUN([#include <stdio.h>
dnl ### Checks for structure members
dnl
dnl
-define(AC_STRUCT_TM,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING([whether struct tm is in sys/time.h or time.h])
+AC_DEFUN(AC_STRUCT_TM,
+[AC_MSG_CHECKING([whether struct tm is in sys/time.h or time.h])
AC_CACHE_VAL(ac_cv_struct_tm,
[AC_TRY_LINK([#include <sys/types.h>
#include <time.h>],
fi
])dnl
dnl
-define(AC_HEADER_TIME,
+AC_DEFUN(AC_HEADER_TIME,
[AC_MSG_CHECKING([whether time.h and sys/time.h may both be included])
AC_CACHE_VAL(ac_cv_header_time,
[AC_TRY_LINK([#include <sys/types.h>
fi
])dnl
dnl
-define(AC_STRUCT_TIMEZONE,
+AC_DEFUN(AC_STRUCT_TIMEZONE,
[AC_REQUIRE([AC_STRUCT_TM])dnl
AC_MSG_CHECKING([for tm_zone in struct tm])
AC_CACHE_VAL(ac_cv_struct_tm_zone,
fi
])dnl
dnl
-define(AC_STRUCT_ST_BLOCKS,
+AC_DEFUN(AC_STRUCT_ST_BLOCKS,
[AC_MSG_CHECKING([for st_blocks in struct stat])
AC_CACHE_VAL(ac_cv_struct_st_blocks,
[AC_TRY_LINK([#include <sys/types.h>
AC_SUBST(LIBOBJS)dnl
])dnl
dnl
-define(AC_STRUCT_ST_BLKSIZE,
+AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
[AC_MSG_CHECKING([for st_blksize in struct stat])
AC_CACHE_VAL(ac_cv_struct_st_blksize,
[AC_TRY_LINK([#include <sys/types.h>
fi
])dnl
dnl
-define(AC_STRUCT_ST_RDEV,
+AC_DEFUN(AC_STRUCT_ST_RDEV,
[AC_MSG_CHECKING([for st_rdev in struct stat])
AC_CACHE_VAL(ac_cv_struct_st_rdev,
[AC_TRY_LINK([#include <sys/types.h>
dnl ### Checks for compiler characteristics
dnl
dnl
-define(AC_C_CROSS,
-[AC_PROVIDE([$0])dnl
-# If we cannot run a trivial program, we must be cross compiling.
+AC_DEFUN(AC_C_CROSS,
+[# If we cannot run a trivial program, we must be cross compiling.
AC_MSG_CHECKING(whether cross-compiling)
AC_CACHE_VAL(ac_cv_c_cross,
[AC_TRY_RUN([main(){exit(0);}], ac_cv_c_cross=no, ac_cv_c_cross=yes)])dnl
AC_MSG_RESULT($ac_cv_c_cross)
])dnl
dnl
-define(AC_C_CHAR_UNSIGNED,
+AC_DEFUN(AC_C_CHAR_UNSIGNED,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING(whether char is unsigned)
AC_CACHE_VAL(ac_cv_c_char_unsigned,
fi
])dnl
dnl
-define(AC_C_LONG_DOUBLE,
+AC_DEFUN(AC_C_LONG_DOUBLE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING(for long double)
AC_CACHE_VAL(ac_cv_c_long_double,
fi
])dnl
dnl
-define(AC_INT_16_BITS,
+AC_DEFUN(AC_INT_16_BITS,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])
AC_MSG_CHECKING(integer size)
AC_TRY_RUN([main() { exit(sizeof(int) != 2); }],
AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(not 16 bits))
])dnl
dnl
-define(AC_LONG_64_BITS,
+AC_DEFUN(AC_LONG_64_BITS,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])
AC_MSG_CHECKING(for 64-bit long ints)
AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }],
AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(not 64 bits))
])dnl
dnl
-define(AC_C_BIGENDIAN,
+AC_DEFUN(AC_C_BIGENDIAN,
[AC_MSG_CHECKING(whether byte ordering is bigendian)
AC_CACHE_VAL(ac_cv_c_bigendian,
[AC_TRY_RUN([main () {
fi
])dnl
dnl
-define(AC_C_ARG_ARRAY,
+AC_DEFUN(AC_C_ARG_ARRAY,
[AC_MSG_CHECKING(whether the address of an argument can be used as an array)
AC_CACHE_VAL(ac_cv_c_arg_array,
[AC_TRY_RUN([main() {
fi
])dnl
dnl
-define(AC_C_INLINE,
+AC_DEFUN(AC_C_INLINE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING([for inline])
AC_CACHE_VAL(ac_cv_c_inline,
AC_DEFINE(inline, __inline)
fi
])dnl
-define(AC_C_CONST,
+AC_DEFUN(AC_C_CONST,
[dnl This message is consistent in form with the other checking messages,
dnl and with the result message.
AC_MSG_CHECKING([for working const])
dnl ### Checks for operating system services
dnl
dnl
-define(AC_HAVE_POUNDBANG,
+dnl This macro is an oddball -- the only specific test that takes args.
+AC_DEFUN(AC_HAVE_POUNDBANG,
[AC_MSG_CHECKING(whether [#]! works in shell scripts)
AC_CACHE_VAL(ac_cv_sys_interpreter,
[echo '#!/bin/cat
])dnl
fi
])dnl
-define(AC_SYS_REMOTE_TAPE,
+AC_DEFUN(AC_SYS_REMOTE_TAPE,
[AC_CHECK_HEADER(sys/mtio.h, AC_DEFINE(HAVE_SYS_MTIO_H))
-if test "$ac_cv_header_mtio_h" = yes; then
+if test "$ac_cv_header_sys_mtio_h" = yes; then
AC_MSG_CHECKING(for remote tape header files)
AC_CACHE_VAL(ac_cv_header_rmt,
[AC_TRY_CPP([#include <sgtty.h>
AC_SUBST(PROGS)dnl
])dnl
dnl
-define(AC_SYS_LONG_FILE_NAMES,
+AC_DEFUN(AC_SYS_LONG_FILE_NAMES,
[AC_MSG_CHECKING(for long file names)
AC_CACHE_VAL(ac_cv_sys_long_file_names,
[ac_cv_sys_long_file_names=yes
fi
])dnl
dnl
-define(AC_SYS_RESTARTABLE_SYSCALLS,
+AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS,
[AC_MSG_CHECKING(for restartable system calls)
AC_CACHE_VAL(ac_cv_sys_restartable_syscalls,
[AC_TRY_RUN(
fi
])dnl
dnl
-define(AC_PATH_X,
+AC_DEFUN(AC_PATH_X,
[AC_REQUIRE_CPP()dnl Set CPP; we run AC_PATH_X_DIRECT conditionally.
-AC_PROVIDE([$0])dnl
# If we find X, set shell vars x_includes and x_libraries to the paths.
no_x=yes
if test "x$with_x" != xno; then
])dnl
dnl
dnl Internal subroutine of AC_PATH_X.
-define(AC_PATH_X_XMKMF,
+AC_DEFUN(AC_PATH_X_XMKMF,
[AC_CHECKING(for X include and library files with xmkmf)
rm -fr conftestdir
if mkdir conftestdir; then
])dnl
dnl
dnl Internal subroutine of AC_PATH_X.
-define(AC_PATH_X_DIRECT,
+AC_DEFUN(AC_PATH_X_DIRECT,
[AC_CHECKING(for X include and library files directly)
test -z "$x_direct_test_library" && x_direct_test_library=Xt
test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
done)])dnl
dnl
dnl Find additional X libraries, magic flags, etc.
-define(AC_PATH_XTRA,
+AC_DEFUN(AC_PATH_XTRA,
[AC_REQUIRE([AC_OS_ISC])dnl
AC_REQUIRE([AC_PATH_X])dnl
AC_CHECKING(for additional X libraries and flags)
dnl These are kludges; we need a more systematic approach.
dnl
dnl
-define(AC_OS_AIX,
+AC_DEFUN(AC_OS_AIX,
[AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_BEFORE([$0], [AC_TRY_CPP])dnl
AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes,
[#ifdef _AIX
], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no))
])dnl
dnl
-define(AC_OS_MINIX,
+AC_DEFUN(AC_OS_MINIX,
[AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_BEFORE([$0], [AC_TRY_CPP])dnl
AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=)
# The Minix shell can not assign to the same variable on the same line!
if test "$MINIX" = yes; then
fi
])dnl
dnl
-define(AC_OS_ISC,
-[AC_PROVIDE([$0])dnl
-AC_BEFORE([$0], [AC_TRY_LINK])dnl
+AC_DEFUN(AC_OS_ISC,
+[AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_BEFORE([$0], [AC_TRY_CPP])dnl
AC_MSG_CHECKING(for POSIXized ISC)
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
fi
])dnl
dnl
-define(AC_OS_XENIX,
+AC_DEFUN(AC_OS_XENIX,
[AC_REQUIRE([AC_DIR_HEADER])dnl
AC_MSG_CHECKING(for Xenix)
AC_EGREP_CPP(yes,
[#if defined(M_XENIX) && !defined(M_UNIX)
yes
#endif
-], [XENIX=yes AC_MSG_RESULT(yes)], [XENIX= AC_MSG_RESULT(no)])
+], [AC_MSG_RESULT(yes); XENIX=yes], [AC_MSG_RESULT(no); XENIX=])
if test "$XENIX" = yes; then
LIBS="$LIBS -lx"
case "$DEFS" in
fi
])dnl
dnl
-define(AC_OS_SCO,
+AC_DEFUN(AC_OS_SCO,
[AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl")
])dnl
dnl
-define(AC_OS_IRIX,
+AC_DEFUN(AC_OS_IRIX,
[AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun")
])dnl
dnl
-define(AC_OS_DYNIX,
+AC_DEFUN(AC_OS_DYNIX,
[AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq")
])dnl
@c @setchapternewpage odd
@c %**end of header
-@set EDITION 1.98
-@set VERSION 1.98
+@set EDITION 1.99
+@set VERSION 1.99
@set UPDATED August 1994
@iftex
* Setup:: Controlling Autoconf operation.
* File Existence:: Checking whether particular files exist.
-* C Features:: Checking for features of the C system.
+* C System Output:: Checking output of C compiler system.
+* C Features:: Checking for particular features of C.
* Command Line:: Checking command line arguments.
* Setting Variables:: Setting shell and @code{make} variables.
* Printing Messages:: Notifying users of progress or problems.
Autoconf requires GNU @code{m4} in order to generate the scripts. It
uses features that some UNIX versions of @code{m4} do not have. It also
overflows internal limits of some versions of @code{m4}, including GNU
-@code{m4} 1.0; so use a later version of GNU @code{m4}.
+@code{m4} 1.0; so use version 1.1 or later of GNU @code{m4}.
Autoconf does not work well with GNU C library releases before 1.06.
The GNU C library contains stubs (which always return an error) for
releases 1.06 and later of the GNU C library, which define C
preprocessor macros that the Autoconf macros @code{AC_CHECK_FUNC} and
@code{AC_REPLACE_FUNCS} test, indicating that certain functions are
-stubs (@pxref{C Features}, for more information on checking for
-functions).
+stubs (@pxref{C Features}, for more information on checking
+for functions).
@ifinfo
Autoconf was written by David MacKenzie, with help from Franc,ois
The following macros check for the presence or behavior of particular
programs:
-@defmac AC_PROG_GCC_TRADITIONAL
-@maindex PROG_GCC_TRADITIONAL
-Add @samp{-traditional} to @code{make} variable @code{CC} if using the
-GNU C compiler and @code{ioctl} does not work properly without
-@samp{-traditional}. This macro calls @code{AC_PROG_CC} and
-@code{AC_PROG_CPP} if they haven't been called already.
-@end defmac
-
-@defmac AC_PROG_LN_S
-@maindex PROG_LN_S
-If @samp{ln -s} works on the current filesystem (the operating system
-and filesystem support symbolic links), set shell and @code{make}
-variable @code{LN_S} to @samp{ln -s}, otherwise set it to @samp{ln}.
-@end defmac
+@defmac AC_DECL_YYTEXT
+@maindex DECL_YYTEXT
+@vindex YYTEXT_POINTER
+Define @code{YYTEXT_POINTER} if @code{yytext} is a @samp{char *} instead
+of a @samp{char []}. This depends on whether @code{lex} or @code{flex}
+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.
-@defmac AC_PROG_CC_C_O
-@maindex PROG_CC_C_O
-@vindex NO_MINUS_C_MINUS_O
-If the C compiler does not accept the @samp{-c} and @samp{-o} options
-simultaneously, define @code{NO_MINUS_C_MINUS_O}.
+This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work.
@end defmac
@defmac AC_PROG_AWK
set @code{GCC} to be empty.
@end defmac
+@defmac AC_PROG_CC_C_O
+@maindex PROG_CC_C_O
+@vindex NO_MINUS_C_MINUS_O
+If the C compiler does not accept the @samp{-c} and @samp{-o} options
+simultaneously, define @code{NO_MINUS_C_MINUS_O}.
+@end defmac
+
@defmac AC_PROG_CPP
@maindex PROG_CPP
Set shell and @code{make} variable @code{CPP} to a command that runs the
@code{AC_PROG_CXX} if it hasn't been called already.
@end defmac
+@defmac AC_PROG_GCC_TRADITIONAL
+@maindex PROG_GCC_TRADITIONAL
+Add @samp{-traditional} to @code{make} variable @code{CC} if using the
+GNU C compiler and @code{ioctl} does not work properly without
+@samp{-traditional}. This macro calls @code{AC_PROG_CC} and
+@code{AC_PROG_CPP} if they haven't been called already.
+@end defmac
+
@defmac AC_PROG_INSTALL
@maindex PROG_INSTALL
Set @code{make} variable @code{INSTALL} to @samp{install -c} if
@code{LEXLIB} to @samp{-ll}.
@end defmac
-@defmac AC_PROG_RANLIB
-@maindex PROG_RANLIB
-Set @code{make} variable @code{RANLIB} to @samp{ranlib} if @code{ranlib}
-is found, otherwise to @samp{:} (do nothing).
-@end defmac
-
-@defmac AC_PROG_YACC
-@maindex PROG_YACC
-If @code{bison} is found, set @code{make} variable @code{YACC} to
-@samp{bison -y}. Otherwise, if @code{byacc} is found, set @code{YACC}
-to @samp{byacc}. Otherwise set @code{YACC} to @samp{yacc}.
-@end defmac
-
-@defmac AC_PROG_RSH
-@maindex PROG_RSH
-@vindex RSH
-@vindex NO_REMOTE
-@vindex HAVE_NETDB_H
-If a remote shell is available, set @code{make} variable @code{RSH} to
-its pathname. Otherwise, if @file{netdb.h} exists (implying the
-@code{rexec} function), define @code{HAVE_NETDB_H}. If either is true,
-also put @samp{rtapelib.o} in @code{make} variable @code{RTAPELIB}.
-Otherwise, define @code{NO_REMOTE}.
+@defmac AC_PROG_LN_S
+@maindex PROG_LN_S
+If @samp{ln -s} works on the current filesystem (the operating system
+and filesystem support symbolic links), set shell and @code{make}
+variable @code{LN_S} to @samp{ln -s}, otherwise set it to @samp{ln}.
@end defmac
@defmac AC_PROG_MAKE_SET
@end example
@end defmac
-@defmac AC_DECL_YYTEXT
-@maindex DECL_YYTEXT
-@vindex YYTEXT_POINTER
-Define @code{YYTEXT_POINTER} if @code{yytext} is a @samp{char *} instead
-of a @samp{char []}. This depends on whether @code{lex} or @code{flex}
-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.
+@defmac AC_PROG_RANLIB
+@maindex PROG_RANLIB
+Set @code{make} variable @code{RANLIB} to @samp{ranlib} if @code{ranlib}
+is found, otherwise to @samp{:} (do nothing).
+@end defmac
-This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work.
+@defmac AC_PROG_RSH
+@maindex PROG_RSH
+@vindex RSH
+@vindex NO_REMOTE
+@vindex HAVE_NETDB_H
+If a remote shell is available, set @code{make} variable @code{RSH} to
+its pathname. Otherwise, if @file{netdb.h} exists (implying the
+@code{rexec} function), define @code{HAVE_NETDB_H}. If either is true,
+also put @samp{rtapelib.o} in @code{make} variable @code{RTAPELIB}.
+Otherwise, define @code{NO_REMOTE}.
+@end defmac
+
+@defmac AC_PROG_YACC
+@maindex PROG_YACC
+If @code{bison} is found, set @code{make} variable @code{YACC} to
+@samp{bison -y}. Otherwise, if @code{byacc} is found, set @code{YACC}
+to @samp{byacc}. Otherwise set @code{YACC} to @samp{yacc}.
@end defmac
@node Header Files, Typedefs, Alternative Programs, Specific Tests
The following macros check for the presence of certain C header files:
+@defmac AC_DECL_SYS_SIGLIST
+@maindex DECL_SYS_SIGLIST
+@vindex SYS_SIGLIST_DECLARED
+Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist} is
+declared in a system header file, either @file{signal.h} or
+@file{unistd.h}.
+@end defmac
+
@defmac AC_DIR_HEADER
@maindex DIR_HEADER
@vindex DIRENT
@code{MAJOR_IN_SYSMACROS}.
@end defmac
-@defmac AC_MEMORY_H
-@maindex MEMORY_H
-@vindex NEED_MEMORY_H
-Define @code{NEED_MEMORY_H} if @code{memcpy}, @code{memcmp}, etc. are
-not declared in @file{string.h} and @file{memory.h} exists. This macro
-is obsolete; instead, use @code{AC_CHECK_HEADERS(memory.h)}. See the
-example for @code{AC_HEADER_STDC}.
-@end defmac
-
@defmac AC_HEADER_STDC
@maindex HEADER_STDC
@vindex STDC_HEADERS
been called already.
@end defmac
+@defmac AC_MEMORY_H
+@maindex MEMORY_H
+@vindex NEED_MEMORY_H
+Define @code{NEED_MEMORY_H} if @code{memcpy}, @code{memcmp}, etc. are
+not declared in @file{string.h} and @file{memory.h} exists. This macro
+is obsolete; instead, use @code{AC_CHECK_HEADERS(memory.h)}. See the
+example for @code{AC_HEADER_STDC}.
+@end defmac
+
@defmac AC_UNISTD_H
@maindex UNISTD_H
@vindex HAVE_UNISTD_H
code. See the example for @code{AC_HEADER_STDC}.
@end defmac
-@defmac AC_DECL_SYS_SIGLIST
-@maindex DECL_SYS_SIGLIST
-@vindex SYS_SIGLIST_DECLARED
-Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist} is
-declared in a system header file, either @file{signal.h} or
-@file{unistd.h}.
-@end defmac
-
@node Typedefs, Library Functions, Header Files, Specific Tests
@section Typedefs
Amdahl UTS and Motorola System V/88.
@end defmac
-@defmac AC_STRUCT_ST_BLKSIZE
-@maindex STRUCT_ST_BLKSIZE
-@vindex HAVE_ST_BLKSIZE
-If @code{struct stat} contains an @code{st_blksize} member, define
-@code{HAVE_ST_BLKSIZE}.
-@end defmac
-
-@defmac AC_STRUCT_ST_BLOCKS
-@maindex STRUCT_ST_BLOCKS
-@vindex HAVE_ST_BLOCKS
-If @code{struct stat} contains an @code{st_blocks} member, define
-@code{HAVE_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o} to the
-@code{make} variable @code{LIBOBJS}.
-@end defmac
-
-@defmac AC_STRUCT_ST_RDEV
-@maindex STRUCT_ST_RDEV
-@vindex HAVE_ST_RDEV
-If @code{struct stat} contains an @code{st_rdev} member, define
-@code{HAVE_ST_RDEV}.
-@end defmac
-
@defmac AC_HEADER_TIME
@maindex HEADER_TIME
@vindex TIME_WITH_SYS_TIME
@end example
@end defmac
+@defmac AC_STRUCT_ST_BLKSIZE
+@maindex STRUCT_ST_BLKSIZE
+@vindex HAVE_ST_BLKSIZE
+If @code{struct stat} contains an @code{st_blksize} member, define
+@code{HAVE_ST_BLKSIZE}.
+@end defmac
+
+@defmac AC_STRUCT_ST_BLOCKS
+@maindex STRUCT_ST_BLOCKS
+@vindex HAVE_ST_BLOCKS
+If @code{struct stat} contains an @code{st_blocks} member, define
+@code{HAVE_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o} to the
+@code{make} variable @code{LIBOBJS}.
+@end defmac
+
+@defmac AC_STRUCT_ST_RDEV
+@maindex STRUCT_ST_RDEV
+@vindex HAVE_ST_RDEV
+If @code{struct stat} contains an @code{st_rdev} member, define
+@code{HAVE_ST_RDEV}.
+@end defmac
+
@defmac AC_STRUCT_TM
@maindex STRUCT_TM
@vindex TM_IN_SYS_TIME
were an array of values.
@end defmac
-@defmac AC_C_CROSS
-@maindex C_CROSS
-If the C compiler being used does not produce executables that can run
-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 Features}).
+@defmac AC_C_BIGENDIAN
+@maindex C_BIGENDIAN
+@vindex WORDS_BIGENDIAN
+If words are stored with the most significant byte first (like Motorola
+and SPARC, but not Intel and VAX, CPUs), define @code{WORDS_BIGENDIAN}.
@end defmac
@defmac AC_C_CHAR_UNSIGNED
declarations.)
@end defmac
+@defmac AC_C_CROSS
+@maindex C_CROSS
+If the C compiler being used does not produce executables that can run
+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}).
+@end defmac
+
@defmac AC_C_INLINE
@maindex C_INLINE
@vindex inline
that define @code{__STDC__} do not support @code{long double}.
@end defmac
-@defmac AC_C_BIGENDIAN
-@maindex C_BIGENDIAN
-@vindex WORDS_BIGENDIAN
-If words are stored with the most significant byte first (like Motorola
-and SPARC, but not Intel and VAX, CPUs), define @code{WORDS_BIGENDIAN}.
-@end defmac
-
@node System Services, UNIX Variants, Compiler Characteristics, Specific Tests
@section System Services
The following macros check for operating system services:
+@defmac AC_HAVE_POUNDBANG (@var{action-if-supported} @r{[},
+@var{action-if-not-supported}@r{]})
+@maindex HAVE_POUNDBANG
+Check whether the system supports starting shell scripts with a line of
+the form @samp{#!/bin/csh} to select the shell to use. If @samp{#!}
+works, execute shell commands @var{action-if-supported}; if not, execute
+@var{action-if-not-supported}.
+@end defmac
+
@defmac AC_PATH_X
@maindex PATH_X
Try to locate the X Window System include files and libraries. Try
you should let it call @code{AC_PATH_X} rather than doing that yourself.
@end defmac
-@defmac AC_HAVE_POUNDBANG (@var{action-if-supported} @r{[},
-@var{action-if-not-supported}@r{]})
-@maindex HAVE_POUNDBANG
-Check whether the system supports starting shell scripts with a line of
-the form @samp{#!/bin/csh} to select the shell to use. If @samp{#!}
-works, execute shell commands @var{action-if-supported}; if not, execute
-@var{action-if-not-supported}.
-@end defmac
-
@defmac AC_SYS_LONG_FILE_NAMES
@maindex SYS_LONG_FILE_NAMES
@vindex HAVE_LONG_FILE_NAMES
@menu
* Setup:: Controlling Autoconf operation.
* File Existence:: Checking whether particular files exist.
-* C Features:: Checking for features of the C system.
+* C System Output:: Checking output of C compiler system.
+* C Features:: Checking for particular features of C.
* Command Line:: Checking command line arguments.
* Setting Variables:: Setting shell and @code{make} variables.
* Printing Messages:: Notifying users of progress or problems.
fact does (@pxref{Invoking configure}, for more information).
@end defmac
+@defmac AC_INIT_PREPARE (@var{unique-file-in-source-dir})
+@maindex INIT_PREPARE
+Find the source code directory and set up shell variables necessary for
+other Autoconf macros to work. @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). @code{AC_INIT_PREPARE} is the last thing done by
+@code{AC_INIT}. Use @code{AC_INIT_PREPARE} instead of @code{AC_INIT} if you
+want to do argument parsing yourself; never use both.
+@end defmac
+
@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{]})
@maindex OUTPUT
Create output files (typically one or more @file{Makefile}s) and
@file{config.status} to be run after all its other processing.
@end defmac
+@defmac AC_PREFIX (@var{program})
+@maindex PREFIX
+This macro is like @code{AC_PREFIX_PROGRAM}, except that it does not
+find the site-wide defaults file correctly, so it is obsolete.
+@end defmac
+
@defmac AC_PREFIX_PROGRAM (@var{program})
@maindex PREFIX_PROGRAM
If the user did not specify an installation prefix (using the
set the prefix to @file{/usr/local/gnu}.
@end defmac
-@defmac AC_INIT_PREPARE (@var{unique-file-in-source-dir})
-@maindex INIT_PREPARE
-Find the source code directory and set up shell variables necessary for
-other Autoconf macros to work. @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). @code{AC_INIT_PREPARE} is the last thing done by
-@code{AC_INIT}. Use @code{AC_INIT_PREPARE} instead of @code{AC_INIT} if you
-want to do argument parsing yourself; never use both.
-@end defmac
-
@defmac AC_PREREQ (@var{version})
@maindex PREREQ
Ensure that a recent enough version of Autoconf is being used. If the
@end example
@end defmac
-@node File Existence, C Features, Setup, General Purpose Macros
+@node File Existence, C System Output, Setup, General Purpose Macros
@section Checking Whether Particular Files Exist
-These macros check whether particular files exist.
+These macros check whether particular files exist. They cache the
+results of their tests for future use (@pxref{Caching Values}, for more
+information).
@defmac AC_CHECK_LIB (@var{library}, @var{function}, @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]})
@maindex CHECK_LIB
unresolved symbols.
@end defmac
-@defmac AC_HAVE_LIBRARY (@var{library}, @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]})
-@maindex HAVE_LIBRARY
-This macro is equivalent to calling @code{AC_CHECK_LIB} with a
-@var{function} argument of @code{main}. It is considered obsolete,
-because some linkers (e.g., Apollo's) do not fail when asked to link
-with a nonexistent library if there are no unresolved sybols.
-@end defmac
-
-@defmac AC_PREFIX (@var{program})
-@maindex PREFIX
-This macro is like @code{AC_PREFIX_PROGRAM}, except that it prevents
-finding the site-wide defaults file correctly, so it is obsolete.
-@end defmac
-
@defmac AC_CHECK_PROG (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]})
@maindex CHECK_PROG
Check whether program @var{prog-to-check-for} exists in @code{PATH}. If
do nothing. Calls @code{AC_SUBST} for @var{variable}.
@end defmac
-@defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PATH_PROG
-Similar to @code{AC_CHECK_PROG}, but set @var{variable} to the entire
-path of @var{prog-to-check-for} if found. Otherwise, set @var{variable}
-to @var{value-if-not-found}, if given. If @var{variable} was already
-set, do nothing. Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
@defmac AC_CHECK_PROGS (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
@maindex CHECK_PROGS
Check for each program in the whitespace-separated list
is not changed. Calls @code{AC_SUBST} for @var{variable}.
@end defmac
+@defmac AC_HAVE_LIBRARY (@var{library}, @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]})
+@maindex HAVE_LIBRARY
+This macro is equivalent to calling @code{AC_CHECK_LIB} with a
+@var{function} argument of @code{main}. It is considered obsolete,
+because some linkers (e.g., Apollo's) do not fail when asked to link
+with a nonexistent library if there are no unresolved sybols.
+@end defmac
+
+@defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PATH_PROG
+Similar to @code{AC_CHECK_PROG}, but set @var{variable} to the entire
+path of @var{prog-to-check-for} if found. Otherwise, set @var{variable}
+to @var{value-if-not-found}, if given. If @var{variable} was already
+set, do nothing. Calls @code{AC_SUBST} for @var{variable}.
+@end defmac
+
@defmac AC_PATH_PROGS (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
@maindex PATH_PROGS
Like @code{AC_CHECK_PROGS}, but if any of @var{progs-to-check-for}
found.
@end defmac
-@node C Features, Command Line, File Existence, General Purpose Macros
-@section Checking For C Features
+@node C System Output, C Features, File Existence, General Purpose Macros
+@section Checking C Compiler System Output
-These macros check for features of the C compiler, libraries, and headers.
-
-@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
-@samp{unsigned}.
-@end defmac
+These macros check the output of the C compiler system. They @emph{do
+not} cache the results of their tests for future use (@pxref{Caching
+Values}), because they don't know enough about the information they are
+checking for to generate a cache variable name. The checks for
+particular kinds of C features call these macros and do cache their
+results (@pxref{C Features}).
@defmac AC_COMPILE_CHECK (@var{echo-text}, @var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
@maindex COMPILE_CHECK
prints @samp{checking for @var{echo-text}} to the standard output first.
@end defmac
-@defmac AC_CHECK_FUNC (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex CHECK_FUNC
-If @var{function} is available, run shell commands
-@var{action-if-found}, otherwise @var{action-if-not-found}. If the
-functions might be in libraries other than the default C library, first
-call @code{AC_CHECK_LIB} for those libraries. If you just want to
-define a symbol if the function is available, consider using
-@code{AC_CHECK_FUNCS} instead.
-@end defmac
-
-@defmac AC_CHECK_FUNCS (@var{function}@dots{})
-@maindex CHECK_FUNCS
-@vindex HAVE_@var{function}
-For each given @var{function} in the whitespace-separated argument list
-that is available, define @code{HAVE_@var{function}} (in all caps).
-@xref{Specific Tests}, for a precise definition of ``define'' as it
-is used here. If the functions might be in libraries other than the
-default C library, first call @code{AC_CHECK_LIB} for those libraries.
-@end defmac
-
-@defmac AC_CHECK_HEADERS (@var{header-file}@dots{})
-@maindex CHECK_HEADERS
-@vindex HAVE_@var{header}
-For each given system header file @var{header-file} in the
-whitespace-separated argument list that exists, define
-@code{HAVE_@var{header-file}} (in all caps). @xref{Specific Tests}, for
-a precise definition of ``define'' as it is used here.
-@end defmac
+@defmac AC_EGREP_CPP (@var{pattern}, @var{program}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
+@maindex EGREP_CPP
+@var{program} is the text of a C or C++ program, on which shell variable and
+backquote substitutions are performed. If the output of running the
+preprocessor on @var{program} contains the @code{egrep} regular
+expression @var{pattern}, execute shell commands @var{action-if-found},
+otherwise execute @var{action-if-not-found}. (It is an unfortunate
+oversight that we use the word @code{PROGRAM} in Autoconf macro names to
+sometimes mean C or C++ source code and sometimes mean a UNIX command.)
-@defmac AC_CHECK_HEADER (@var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex CHECK_HEADER
-If the system header file @var{header-file} exists, execute shell commands
-@var{action-if-found}, otherwise execute @var{action-if-not-found}. If
-you just want to define a symbol if the header file is available,
-consider using @code{AC_CHECK_HEADERS} instead.
+This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending
+on which language is current, @pxref{Language Choice}), if it hasn't
+been called already.
@end defmac
@defmac AC_EGREP_HEADER (@var{pattern}, @var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
your programs.
@end defmac
-@defmac AC_EGREP_CPP (@var{pattern}, @var{program}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex EGREP_CPP
-@var{program} is the text of a C or C++ program, on which shell variable and
-backquote substitutions are performed. If the output of running the
-preprocessor on @var{program} contains the @code{egrep} regular
-expression @var{pattern}, execute shell commands @var{action-if-found},
-otherwise execute @var{action-if-not-found}. (It is an unfortunate
-oversight that we use the word @code{PROGRAM} in Autoconf macro names to
-sometimes mean C or C++ source code and sometimes mean a UNIX command.)
-
-This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending
-on which language is current, @pxref{Language Choice}), if it hasn't
-been called already.
-@end defmac
-
-@defmac AC_REPLACE_FUNCS (@var{function-name}@dots{})
-@maindex REPLACE_FUNCS
-For each given @var{function-name} in the whitespace-separated argument
-list that is not in the C library, add @samp{@var{function-name}.o} to
-the value of the @code{make} variable @code{LIBOBJS}. If the functions
-might be in libraries other than the default C library, first call
-@code{AC_CHECK_LIB} for those libraries.
-@end defmac
-
-@defmac AC_CHECK_SIZEOF (@var{type})
-@maindex CHECK_SIZEOF
-Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or
-C++) builtin type @var{type}, e.g. @samp{int} or @samp{char *}. If
-@samp{type} is unknown to the compiler, gets a size of 0. @var{uctype}
-is @var{type}, with lowercase converted to uppercase, spaces changed to
-underscores, and asterisks changed to @samp{P}. For example, the call
-@example
-AC_CHECK_SIZEOF(int *)
-@end example
-@noindent
-defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems.
-@end defmac
-
@defmac AC_TRY_CPP (@var{includes}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex TRY_CPP
@var{includes} is C or C++ @code{#include} statements and declarations, on
when possible. @xref{Test Programs}, for more information.
@end defmac
+@node C Features, Command Line, C System Output, General Purpose Macros
+@section Checking For C Features
+
+These macros check for particular kinds of features of the C compiler,
+libraries, and headers. They cache the results of their tests for
+future use (@pxref{Caching Values}, for more information).
+
+@defmac AC_CHECK_FUNC (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
+@maindex CHECK_FUNC
+If @var{function} is available, run shell commands
+@var{action-if-found}, otherwise @var{action-if-not-found}. If the
+functions might be in libraries other than the default C library, first
+call @code{AC_CHECK_LIB} for those libraries. If you just want to
+define a symbol if the function is available, consider using
+@code{AC_CHECK_FUNCS} instead.
+@end defmac
+
+@defmac AC_CHECK_FUNCS (@var{function}@dots{})
+@maindex CHECK_FUNCS
+@vindex HAVE_@var{function}
+For each given @var{function} in the whitespace-separated argument list
+that is available, define @code{HAVE_@var{function}} (in all caps).
+@xref{Specific Tests}, for a precise definition of ``define'' as it
+is used here. If the functions might be in libraries other than the
+default C library, first call @code{AC_CHECK_LIB} for those libraries.
+@end defmac
+
+@defmac AC_CHECK_HEADER (@var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
+@maindex CHECK_HEADER
+If the system header file @var{header-file} exists, execute shell commands
+@var{action-if-found}, otherwise execute @var{action-if-not-found}. If
+you just want to define a symbol if the header file is available,
+consider using @code{AC_CHECK_HEADERS} instead.
+@end defmac
+
+@defmac AC_CHECK_HEADERS (@var{header-file}@dots{})
+@maindex CHECK_HEADERS
+@vindex HAVE_@var{header}
+For each given system header file @var{header-file} in the
+whitespace-separated argument list that exists, define
+@code{HAVE_@var{header-file}} (in all caps). @xref{Specific Tests}, for
+a precise definition of ``define'' as it is used here.
+@end defmac
+
+@defmac AC_CHECK_SIZEOF (@var{type})
+@maindex CHECK_SIZEOF
+Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or
+C++) builtin type @var{type}, e.g. @samp{int} or @samp{char *}. If
+@samp{type} is unknown to the compiler, gets a size of 0. @var{uctype}
+is @var{type}, with lowercase converted to uppercase, spaces changed to
+underscores, and asterisks changed to @samp{P}. For example, the call
+@example
+AC_CHECK_SIZEOF(int *)
+@end example
+@noindent
+defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems.
+@end defmac
+
+@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
+@samp{unsigned}.
+@end defmac
+
+@defmac AC_REPLACE_FUNCS (@var{function-name}@dots{})
+@maindex REPLACE_FUNCS
+For each given @var{function-name} in the whitespace-separated argument
+list that is not in the C library, add @samp{@var{function-name}.o} to
+the value of the @code{make} variable @code{LIBOBJS}. If the functions
+might be in libraries other than the default C library, first call
+@code{AC_CHECK_LIB} for those libraries.
+@end defmac
+
@node Command Line, Setting Variables, C Features, General Purpose Macros
@section Checking Command Line Arguments
@defmac AC_CHECKING (@var{feature-description})
@maindex CHECKING
This macro is similar to @code{AC_MSG_CHECKING}, except that it prints a
-newline after the @var{feature-description}. It is considered obsolete.
+newline after the @var{feature-description}. It is useful mainly to
+print a general description of the overall purpose of a group of feature
+checks, e.g.
+
+@example
+AC_CHECKING(if stack overflow is detectable)
+@end example
@end defmac
@defmac AC_MSG_CHECKING (@var{feature-description})
Make @code{m4} print a warning message on the standard error output if
@var{called-macro-name} has already been called. @var{this-macro-name}
should be the name of the macro that is calling @code{AC_BEFORE}. The
-macro @var{called-macro-name} must contain a call to @code{AC_PROVIDE}
-to indicate that it has been called.
+macro @var{called-macro-name} must have been defined using
+@code{AC_DEFUN} or else contain a call to @code{AC_PROVIDE} to indicate
+that it has been called.
This macro should be used when one macro makes changes that might affect
another macro, so that the other macro should probably not be called
@defmac AC_PROVIDE (@var{macro-name})
@maindex PROVIDE
-Set a flag recording that @var{macro-name} has been called. The
-argument should be the name of the macro that is calling
+Set a flag recording that @var{macro-name} has been called. This macro
+is called automatically when using @code{AC_DEFUN} to define a macro.
+
+The argument should be the name of the macro that is calling
@code{AC_PROVIDE}. An easy way to get it is from the @code{m4} builtin
variable @code{$0}, like this:
@maindex REQUIRE
If the @code{m4} macro @var{macro-name} has not already been called,
call it (without any arguments). Make sure to quote @var{macro-name}
-with square brackets. The body of @var{macro-name} must contain a call
-to @code{AC_PROVIDE} to indicate that it has been called.
+with square brackets. The body of @var{macro-name} must have been
+defined using @code{AC_DEFUN} or else contain a call to
+@code{AC_PROVIDE} to indicate that it has been called.
Macros that need some other macro to be called before they are called
can use @code{AC_REQUIRE} to ensure that it has been, in case the person
who made @file{configure.in} forgot or didn't know to do it.
-@code{AC_REQUIRE} and @code{AC_PROVIDE} together can ensure that a macro
+@code{AC_REQUIRE} can ensure that a macro
is only called if it is needed, and only called once.
@xref{Dependencies Between Macros}, for more information.
@end defmac
@node Macro Format, Macro Naming, , Writing Macros
@section Macro Format
-Autoconf macros are defined as arguments to the @code{m4} builtin
-command @code{define}. Their overall structure looks like this:
+@maindex DEFUN
+Autoconf macros are defined as arguments to the @code{AC_DEFUN} macro,
+which is similar to the @code{m4} builtin @code{define} macro. In
+addition to defining the macro, @code{AC_DEFUN} causes the macro, when
+it is called, to set a flag which is used to constrain the order in
+which macros are called (@pxref{Prerequisite Macros}).
+
+An Autoconf macro definition looks like this:
@example
-define(@var{macro-name}, [@var{macro-body}])dnl
+AC_DEFUN(@var{macro-name}, [@var{macro-body}])dnl
@end example
@noindent
been called first to set the shell variable @code{CPP}
(@pxref{Alternative Programs}).
-Rather than forcing the user of the macros to keep track of all of the
-dependencies between them, you can use the macros @code{AC_PROVIDE} and
-@code{AC_REQUIRE} to do it automatically. @xref{Macro Ordering}, for more
-information on their syntax.
+Rather than forcing the user of the macros to keep track of the
+dependencies between them, you can use the @code{AC_REQUIRE} macro to do
+it automatically. @xref{Macro Ordering}, for more information on its
+syntax.
The new macro that runs the C preprocessor should contain, somewhere
before @code{CPP} is used, the statement
AC_REQUIRE([AC_PROG_CPP])
@end example
-@noindent
-and the macro @code{AC_PROG_CPP} should contain the statement (anywhere
-in its body)
-
-@example
-AC_PROVIDE([$0])
-@end example
-
-@noindent
-Then, when the new macro is run, it will invoke @code{AC_PROG_CPP} if
-and only if @code{AC_PROG_CPP} has not already been run.
+The macro @code{AC_PROG_CPP} should be defined using @code{AC_DEFUN},
+which as well as defining the macro, causes it to set a flag when it is
+called. Then, when the new macro is run, it will invoke
+@code{AC_PROG_CPP} if and only if @code{AC_PROG_CPP} has not already
+been run.
@node Suggested Ordering, , Prerequisite Macros, Dependencies Between Macros
@subsection Suggested Ordering
The @code{AC_BEFORE} macro causes @code{m4} to print a warning message
on the standard error output when a macro is used before another macro
which might change its behavior. The macro which should come first
-should contain a call to @code{AC_BEFORE} and the macro which should
-come later should contain a call to @code{AC_PROVIDE}.
+should contain a call to @code{AC_BEFORE}.
For example, @code{AC_OS_AIX} contains
AC_BEFORE([$0], [AC_TRY_LINK])
@end example
-@noindent
-and @code{AC_TRY_LINK} contains
-
-@example
-AC_PROVIDE([$0])
-@end example
-
@noindent
As a result, if @code{AC_OS_AIX} is called after @code{AC_TRY_LINK},
it will note that @code{AC_TRY_LINK} has already been called and
If you need to check whether a symbol is defined in a C header file, you
can use @code{AC_EGREP_HEADER} if the symbol is not a C preprocessor
-macro (@pxref{C Features}), or compile a small test program that includes
-the file and references the symbol (@pxref{Test Programs}). Don't
-directly @code{grep} for the symbol in the file, because on some systems
-it might be defined in another header file that the file you are
-checking @samp{#include}s.
+macro (@pxref{C System Output}), or compile a small test program
+that includes the file and references the symbol (@pxref{Test
+Programs}). Don't directly @code{grep} for the symbol in the file,
+because on some systems it might be defined in another header file that
+the file you are checking @samp{#include}s.
However, if you need to check for a particular UNIX variant which is
distinguished by having certain text in a certain file, then use
If you need to check for a condition other than whether some symbol
exists on the system or has a certain value, then you can't use
-@code{AC_TRY_LINK} (@pxref{C Features}). You have to write a
+@code{AC_TRY_LINK} (@pxref{C System Output}). You have to write a
test program by hand. You can compile and run it using
-@code{AC_TRY_RUN} (@pxref{C Features}).
+@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
@c @setchapternewpage odd
@c %**end of header
-@set EDITION 1.98
-@set VERSION 1.98
+@set EDITION 1.99
+@set VERSION 1.99
@set UPDATED August 1994
@iftex
* Setup:: Controlling Autoconf operation.
* File Existence:: Checking whether particular files exist.
-* C Features:: Checking for features of the C system.
+* C System Output:: Checking output of C compiler system.
+* C Features:: Checking for particular features of C.
* Command Line:: Checking command line arguments.
* Setting Variables:: Setting shell and @code{make} variables.
* Printing Messages:: Notifying users of progress or problems.
Autoconf requires GNU @code{m4} in order to generate the scripts. It
uses features that some UNIX versions of @code{m4} do not have. It also
overflows internal limits of some versions of @code{m4}, including GNU
-@code{m4} 1.0; so use a later version of GNU @code{m4}.
+@code{m4} 1.0; so use version 1.1 or later of GNU @code{m4}.
Autoconf does not work well with GNU C library releases before 1.06.
The GNU C library contains stubs (which always return an error) for
releases 1.06 and later of the GNU C library, which define C
preprocessor macros that the Autoconf macros @code{AC_CHECK_FUNC} and
@code{AC_REPLACE_FUNCS} test, indicating that certain functions are
-stubs (@pxref{C Features}, for more information on checking for
-functions).
+stubs (@pxref{C Features}, for more information on checking
+for functions).
@ifinfo
Autoconf was written by David MacKenzie, with help from Franc,ois
The following macros check for the presence or behavior of particular
programs:
-@defmac AC_PROG_GCC_TRADITIONAL
-@maindex PROG_GCC_TRADITIONAL
-Add @samp{-traditional} to @code{make} variable @code{CC} if using the
-GNU C compiler and @code{ioctl} does not work properly without
-@samp{-traditional}. This macro calls @code{AC_PROG_CC} and
-@code{AC_PROG_CPP} if they haven't been called already.
-@end defmac
-
-@defmac AC_PROG_LN_S
-@maindex PROG_LN_S
-If @samp{ln -s} works on the current filesystem (the operating system
-and filesystem support symbolic links), set shell and @code{make}
-variable @code{LN_S} to @samp{ln -s}, otherwise set it to @samp{ln}.
-@end defmac
+@defmac AC_DECL_YYTEXT
+@maindex DECL_YYTEXT
+@vindex YYTEXT_POINTER
+Define @code{YYTEXT_POINTER} if @code{yytext} is a @samp{char *} instead
+of a @samp{char []}. This depends on whether @code{lex} or @code{flex}
+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.
-@defmac AC_PROG_CC_C_O
-@maindex PROG_CC_C_O
-@vindex NO_MINUS_C_MINUS_O
-If the C compiler does not accept the @samp{-c} and @samp{-o} options
-simultaneously, define @code{NO_MINUS_C_MINUS_O}.
+This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work.
@end defmac
@defmac AC_PROG_AWK
set @code{GCC} to be empty.
@end defmac
+@defmac AC_PROG_CC_C_O
+@maindex PROG_CC_C_O
+@vindex NO_MINUS_C_MINUS_O
+If the C compiler does not accept the @samp{-c} and @samp{-o} options
+simultaneously, define @code{NO_MINUS_C_MINUS_O}.
+@end defmac
+
@defmac AC_PROG_CPP
@maindex PROG_CPP
Set shell and @code{make} variable @code{CPP} to a command that runs the
@code{AC_PROG_CXX} if it hasn't been called already.
@end defmac
+@defmac AC_PROG_GCC_TRADITIONAL
+@maindex PROG_GCC_TRADITIONAL
+Add @samp{-traditional} to @code{make} variable @code{CC} if using the
+GNU C compiler and @code{ioctl} does not work properly without
+@samp{-traditional}. This macro calls @code{AC_PROG_CC} and
+@code{AC_PROG_CPP} if they haven't been called already.
+@end defmac
+
@defmac AC_PROG_INSTALL
@maindex PROG_INSTALL
Set @code{make} variable @code{INSTALL} to @samp{install -c} if
@code{LEXLIB} to @samp{-ll}.
@end defmac
-@defmac AC_PROG_RANLIB
-@maindex PROG_RANLIB
-Set @code{make} variable @code{RANLIB} to @samp{ranlib} if @code{ranlib}
-is found, otherwise to @samp{:} (do nothing).
-@end defmac
-
-@defmac AC_PROG_YACC
-@maindex PROG_YACC
-If @code{bison} is found, set @code{make} variable @code{YACC} to
-@samp{bison -y}. Otherwise, if @code{byacc} is found, set @code{YACC}
-to @samp{byacc}. Otherwise set @code{YACC} to @samp{yacc}.
-@end defmac
-
-@defmac AC_PROG_RSH
-@maindex PROG_RSH
-@vindex RSH
-@vindex NO_REMOTE
-@vindex HAVE_NETDB_H
-If a remote shell is available, set @code{make} variable @code{RSH} to
-its pathname. Otherwise, if @file{netdb.h} exists (implying the
-@code{rexec} function), define @code{HAVE_NETDB_H}. If either is true,
-also put @samp{rtapelib.o} in @code{make} variable @code{RTAPELIB}.
-Otherwise, define @code{NO_REMOTE}.
+@defmac AC_PROG_LN_S
+@maindex PROG_LN_S
+If @samp{ln -s} works on the current filesystem (the operating system
+and filesystem support symbolic links), set shell and @code{make}
+variable @code{LN_S} to @samp{ln -s}, otherwise set it to @samp{ln}.
@end defmac
@defmac AC_PROG_MAKE_SET
@end example
@end defmac
-@defmac AC_DECL_YYTEXT
-@maindex DECL_YYTEXT
-@vindex YYTEXT_POINTER
-Define @code{YYTEXT_POINTER} if @code{yytext} is a @samp{char *} instead
-of a @samp{char []}. This depends on whether @code{lex} or @code{flex}
-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.
+@defmac AC_PROG_RANLIB
+@maindex PROG_RANLIB
+Set @code{make} variable @code{RANLIB} to @samp{ranlib} if @code{ranlib}
+is found, otherwise to @samp{:} (do nothing).
+@end defmac
-This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work.
+@defmac AC_PROG_RSH
+@maindex PROG_RSH
+@vindex RSH
+@vindex NO_REMOTE
+@vindex HAVE_NETDB_H
+If a remote shell is available, set @code{make} variable @code{RSH} to
+its pathname. Otherwise, if @file{netdb.h} exists (implying the
+@code{rexec} function), define @code{HAVE_NETDB_H}. If either is true,
+also put @samp{rtapelib.o} in @code{make} variable @code{RTAPELIB}.
+Otherwise, define @code{NO_REMOTE}.
+@end defmac
+
+@defmac AC_PROG_YACC
+@maindex PROG_YACC
+If @code{bison} is found, set @code{make} variable @code{YACC} to
+@samp{bison -y}. Otherwise, if @code{byacc} is found, set @code{YACC}
+to @samp{byacc}. Otherwise set @code{YACC} to @samp{yacc}.
@end defmac
@node Header Files, Typedefs, Alternative Programs, Specific Tests
The following macros check for the presence of certain C header files:
+@defmac AC_DECL_SYS_SIGLIST
+@maindex DECL_SYS_SIGLIST
+@vindex SYS_SIGLIST_DECLARED
+Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist} is
+declared in a system header file, either @file{signal.h} or
+@file{unistd.h}.
+@end defmac
+
@defmac AC_DIR_HEADER
@maindex DIR_HEADER
@vindex DIRENT
@code{MAJOR_IN_SYSMACROS}.
@end defmac
-@defmac AC_MEMORY_H
-@maindex MEMORY_H
-@vindex NEED_MEMORY_H
-Define @code{NEED_MEMORY_H} if @code{memcpy}, @code{memcmp}, etc. are
-not declared in @file{string.h} and @file{memory.h} exists. This macro
-is obsolete; instead, use @code{AC_CHECK_HEADERS(memory.h)}. See the
-example for @code{AC_HEADER_STDC}.
-@end defmac
-
@defmac AC_HEADER_STDC
@maindex HEADER_STDC
@vindex STDC_HEADERS
been called already.
@end defmac
+@defmac AC_MEMORY_H
+@maindex MEMORY_H
+@vindex NEED_MEMORY_H
+Define @code{NEED_MEMORY_H} if @code{memcpy}, @code{memcmp}, etc. are
+not declared in @file{string.h} and @file{memory.h} exists. This macro
+is obsolete; instead, use @code{AC_CHECK_HEADERS(memory.h)}. See the
+example for @code{AC_HEADER_STDC}.
+@end defmac
+
@defmac AC_UNISTD_H
@maindex UNISTD_H
@vindex HAVE_UNISTD_H
code. See the example for @code{AC_HEADER_STDC}.
@end defmac
-@defmac AC_DECL_SYS_SIGLIST
-@maindex DECL_SYS_SIGLIST
-@vindex SYS_SIGLIST_DECLARED
-Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist} is
-declared in a system header file, either @file{signal.h} or
-@file{unistd.h}.
-@end defmac
-
@node Typedefs, Library Functions, Header Files, Specific Tests
@section Typedefs
Amdahl UTS and Motorola System V/88.
@end defmac
-@defmac AC_STRUCT_ST_BLKSIZE
-@maindex STRUCT_ST_BLKSIZE
-@vindex HAVE_ST_BLKSIZE
-If @code{struct stat} contains an @code{st_blksize} member, define
-@code{HAVE_ST_BLKSIZE}.
-@end defmac
-
-@defmac AC_STRUCT_ST_BLOCKS
-@maindex STRUCT_ST_BLOCKS
-@vindex HAVE_ST_BLOCKS
-If @code{struct stat} contains an @code{st_blocks} member, define
-@code{HAVE_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o} to the
-@code{make} variable @code{LIBOBJS}.
-@end defmac
-
-@defmac AC_STRUCT_ST_RDEV
-@maindex STRUCT_ST_RDEV
-@vindex HAVE_ST_RDEV
-If @code{struct stat} contains an @code{st_rdev} member, define
-@code{HAVE_ST_RDEV}.
-@end defmac
-
@defmac AC_HEADER_TIME
@maindex HEADER_TIME
@vindex TIME_WITH_SYS_TIME
@end example
@end defmac
+@defmac AC_STRUCT_ST_BLKSIZE
+@maindex STRUCT_ST_BLKSIZE
+@vindex HAVE_ST_BLKSIZE
+If @code{struct stat} contains an @code{st_blksize} member, define
+@code{HAVE_ST_BLKSIZE}.
+@end defmac
+
+@defmac AC_STRUCT_ST_BLOCKS
+@maindex STRUCT_ST_BLOCKS
+@vindex HAVE_ST_BLOCKS
+If @code{struct stat} contains an @code{st_blocks} member, define
+@code{HAVE_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o} to the
+@code{make} variable @code{LIBOBJS}.
+@end defmac
+
+@defmac AC_STRUCT_ST_RDEV
+@maindex STRUCT_ST_RDEV
+@vindex HAVE_ST_RDEV
+If @code{struct stat} contains an @code{st_rdev} member, define
+@code{HAVE_ST_RDEV}.
+@end defmac
+
@defmac AC_STRUCT_TM
@maindex STRUCT_TM
@vindex TM_IN_SYS_TIME
were an array of values.
@end defmac
-@defmac AC_C_CROSS
-@maindex C_CROSS
-If the C compiler being used does not produce executables that can run
-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 Features}).
+@defmac AC_C_BIGENDIAN
+@maindex C_BIGENDIAN
+@vindex WORDS_BIGENDIAN
+If words are stored with the most significant byte first (like Motorola
+and SPARC, but not Intel and VAX, CPUs), define @code{WORDS_BIGENDIAN}.
@end defmac
@defmac AC_C_CHAR_UNSIGNED
declarations.)
@end defmac
+@defmac AC_C_CROSS
+@maindex C_CROSS
+If the C compiler being used does not produce executables that can run
+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}).
+@end defmac
+
@defmac AC_C_INLINE
@maindex C_INLINE
@vindex inline
that define @code{__STDC__} do not support @code{long double}.
@end defmac
-@defmac AC_C_BIGENDIAN
-@maindex C_BIGENDIAN
-@vindex WORDS_BIGENDIAN
-If words are stored with the most significant byte first (like Motorola
-and SPARC, but not Intel and VAX, CPUs), define @code{WORDS_BIGENDIAN}.
-@end defmac
-
@node System Services, UNIX Variants, Compiler Characteristics, Specific Tests
@section System Services
The following macros check for operating system services:
+@defmac AC_HAVE_POUNDBANG (@var{action-if-supported} @r{[},
+@var{action-if-not-supported}@r{]})
+@maindex HAVE_POUNDBANG
+Check whether the system supports starting shell scripts with a line of
+the form @samp{#!/bin/csh} to select the shell to use. If @samp{#!}
+works, execute shell commands @var{action-if-supported}; if not, execute
+@var{action-if-not-supported}.
+@end defmac
+
@defmac AC_PATH_X
@maindex PATH_X
Try to locate the X Window System include files and libraries. Try
you should let it call @code{AC_PATH_X} rather than doing that yourself.
@end defmac
-@defmac AC_HAVE_POUNDBANG (@var{action-if-supported} @r{[},
-@var{action-if-not-supported}@r{]})
-@maindex HAVE_POUNDBANG
-Check whether the system supports starting shell scripts with a line of
-the form @samp{#!/bin/csh} to select the shell to use. If @samp{#!}
-works, execute shell commands @var{action-if-supported}; if not, execute
-@var{action-if-not-supported}.
-@end defmac
-
@defmac AC_SYS_LONG_FILE_NAMES
@maindex SYS_LONG_FILE_NAMES
@vindex HAVE_LONG_FILE_NAMES
@menu
* Setup:: Controlling Autoconf operation.
* File Existence:: Checking whether particular files exist.
-* C Features:: Checking for features of the C system.
+* C System Output:: Checking output of C compiler system.
+* C Features:: Checking for particular features of C.
* Command Line:: Checking command line arguments.
* Setting Variables:: Setting shell and @code{make} variables.
* Printing Messages:: Notifying users of progress or problems.
fact does (@pxref{Invoking configure}, for more information).
@end defmac
+@defmac AC_INIT_PREPARE (@var{unique-file-in-source-dir})
+@maindex INIT_PREPARE
+Find the source code directory and set up shell variables necessary for
+other Autoconf macros to work. @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). @code{AC_INIT_PREPARE} is the last thing done by
+@code{AC_INIT}. Use @code{AC_INIT_PREPARE} instead of @code{AC_INIT} if you
+want to do argument parsing yourself; never use both.
+@end defmac
+
@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{]})
@maindex OUTPUT
Create output files (typically one or more @file{Makefile}s) and
@file{config.status} to be run after all its other processing.
@end defmac
+@defmac AC_PREFIX (@var{program})
+@maindex PREFIX
+This macro is like @code{AC_PREFIX_PROGRAM}, except that it does not
+find the site-wide defaults file correctly, so it is obsolete.
+@end defmac
+
@defmac AC_PREFIX_PROGRAM (@var{program})
@maindex PREFIX_PROGRAM
If the user did not specify an installation prefix (using the
set the prefix to @file{/usr/local/gnu}.
@end defmac
-@defmac AC_INIT_PREPARE (@var{unique-file-in-source-dir})
-@maindex INIT_PREPARE
-Find the source code directory and set up shell variables necessary for
-other Autoconf macros to work. @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). @code{AC_INIT_PREPARE} is the last thing done by
-@code{AC_INIT}. Use @code{AC_INIT_PREPARE} instead of @code{AC_INIT} if you
-want to do argument parsing yourself; never use both.
-@end defmac
-
@defmac AC_PREREQ (@var{version})
@maindex PREREQ
Ensure that a recent enough version of Autoconf is being used. If the
@end example
@end defmac
-@node File Existence, C Features, Setup, General Purpose Macros
+@node File Existence, C System Output, Setup, General Purpose Macros
@section Checking Whether Particular Files Exist
-These macros check whether particular files exist.
+These macros check whether particular files exist. They cache the
+results of their tests for future use (@pxref{Caching Values}, for more
+information).
@defmac AC_CHECK_LIB (@var{library}, @var{function}, @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]})
@maindex CHECK_LIB
unresolved symbols.
@end defmac
-@defmac AC_HAVE_LIBRARY (@var{library}, @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]})
-@maindex HAVE_LIBRARY
-This macro is equivalent to calling @code{AC_CHECK_LIB} with a
-@var{function} argument of @code{main}. It is considered obsolete,
-because some linkers (e.g., Apollo's) do not fail when asked to link
-with a nonexistent library if there are no unresolved sybols.
-@end defmac
-
-@defmac AC_PREFIX (@var{program})
-@maindex PREFIX
-This macro is like @code{AC_PREFIX_PROGRAM}, except that it prevents
-finding the site-wide defaults file correctly, so it is obsolete.
-@end defmac
-
@defmac AC_CHECK_PROG (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]})
@maindex CHECK_PROG
Check whether program @var{prog-to-check-for} exists in @code{PATH}. If
do nothing. Calls @code{AC_SUBST} for @var{variable}.
@end defmac
-@defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PATH_PROG
-Similar to @code{AC_CHECK_PROG}, but set @var{variable} to the entire
-path of @var{prog-to-check-for} if found. Otherwise, set @var{variable}
-to @var{value-if-not-found}, if given. If @var{variable} was already
-set, do nothing. Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
@defmac AC_CHECK_PROGS (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
@maindex CHECK_PROGS
Check for each program in the whitespace-separated list
is not changed. Calls @code{AC_SUBST} for @var{variable}.
@end defmac
+@defmac AC_HAVE_LIBRARY (@var{library}, @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]})
+@maindex HAVE_LIBRARY
+This macro is equivalent to calling @code{AC_CHECK_LIB} with a
+@var{function} argument of @code{main}. It is considered obsolete,
+because some linkers (e.g., Apollo's) do not fail when asked to link
+with a nonexistent library if there are no unresolved sybols.
+@end defmac
+
+@defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PATH_PROG
+Similar to @code{AC_CHECK_PROG}, but set @var{variable} to the entire
+path of @var{prog-to-check-for} if found. Otherwise, set @var{variable}
+to @var{value-if-not-found}, if given. If @var{variable} was already
+set, do nothing. Calls @code{AC_SUBST} for @var{variable}.
+@end defmac
+
@defmac AC_PATH_PROGS (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
@maindex PATH_PROGS
Like @code{AC_CHECK_PROGS}, but if any of @var{progs-to-check-for}
found.
@end defmac
-@node C Features, Command Line, File Existence, General Purpose Macros
-@section Checking For C Features
+@node C System Output, C Features, File Existence, General Purpose Macros
+@section Checking C Compiler System Output
-These macros check for features of the C compiler, libraries, and headers.
-
-@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
-@samp{unsigned}.
-@end defmac
+These macros check the output of the C compiler system. They @emph{do
+not} cache the results of their tests for future use (@pxref{Caching
+Values}), because they don't know enough about the information they are
+checking for to generate a cache variable name. The checks for
+particular kinds of C features call these macros and do cache their
+results (@pxref{C Features}).
@defmac AC_COMPILE_CHECK (@var{echo-text}, @var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
@maindex COMPILE_CHECK
prints @samp{checking for @var{echo-text}} to the standard output first.
@end defmac
-@defmac AC_CHECK_FUNC (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex CHECK_FUNC
-If @var{function} is available, run shell commands
-@var{action-if-found}, otherwise @var{action-if-not-found}. If the
-functions might be in libraries other than the default C library, first
-call @code{AC_CHECK_LIB} for those libraries. If you just want to
-define a symbol if the function is available, consider using
-@code{AC_CHECK_FUNCS} instead.
-@end defmac
-
-@defmac AC_CHECK_FUNCS (@var{function}@dots{})
-@maindex CHECK_FUNCS
-@vindex HAVE_@var{function}
-For each given @var{function} in the whitespace-separated argument list
-that is available, define @code{HAVE_@var{function}} (in all caps).
-@xref{Specific Tests}, for a precise definition of ``define'' as it
-is used here. If the functions might be in libraries other than the
-default C library, first call @code{AC_CHECK_LIB} for those libraries.
-@end defmac
-
-@defmac AC_CHECK_HEADERS (@var{header-file}@dots{})
-@maindex CHECK_HEADERS
-@vindex HAVE_@var{header}
-For each given system header file @var{header-file} in the
-whitespace-separated argument list that exists, define
-@code{HAVE_@var{header-file}} (in all caps). @xref{Specific Tests}, for
-a precise definition of ``define'' as it is used here.
-@end defmac
+@defmac AC_EGREP_CPP (@var{pattern}, @var{program}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
+@maindex EGREP_CPP
+@var{program} is the text of a C or C++ program, on which shell variable and
+backquote substitutions are performed. If the output of running the
+preprocessor on @var{program} contains the @code{egrep} regular
+expression @var{pattern}, execute shell commands @var{action-if-found},
+otherwise execute @var{action-if-not-found}. (It is an unfortunate
+oversight that we use the word @code{PROGRAM} in Autoconf macro names to
+sometimes mean C or C++ source code and sometimes mean a UNIX command.)
-@defmac AC_CHECK_HEADER (@var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex CHECK_HEADER
-If the system header file @var{header-file} exists, execute shell commands
-@var{action-if-found}, otherwise execute @var{action-if-not-found}. If
-you just want to define a symbol if the header file is available,
-consider using @code{AC_CHECK_HEADERS} instead.
+This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending
+on which language is current, @pxref{Language Choice}), if it hasn't
+been called already.
@end defmac
@defmac AC_EGREP_HEADER (@var{pattern}, @var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
your programs.
@end defmac
-@defmac AC_EGREP_CPP (@var{pattern}, @var{program}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex EGREP_CPP
-@var{program} is the text of a C or C++ program, on which shell variable and
-backquote substitutions are performed. If the output of running the
-preprocessor on @var{program} contains the @code{egrep} regular
-expression @var{pattern}, execute shell commands @var{action-if-found},
-otherwise execute @var{action-if-not-found}. (It is an unfortunate
-oversight that we use the word @code{PROGRAM} in Autoconf macro names to
-sometimes mean C or C++ source code and sometimes mean a UNIX command.)
-
-This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending
-on which language is current, @pxref{Language Choice}), if it hasn't
-been called already.
-@end defmac
-
-@defmac AC_REPLACE_FUNCS (@var{function-name}@dots{})
-@maindex REPLACE_FUNCS
-For each given @var{function-name} in the whitespace-separated argument
-list that is not in the C library, add @samp{@var{function-name}.o} to
-the value of the @code{make} variable @code{LIBOBJS}. If the functions
-might be in libraries other than the default C library, first call
-@code{AC_CHECK_LIB} for those libraries.
-@end defmac
-
-@defmac AC_CHECK_SIZEOF (@var{type})
-@maindex CHECK_SIZEOF
-Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or
-C++) builtin type @var{type}, e.g. @samp{int} or @samp{char *}. If
-@samp{type} is unknown to the compiler, gets a size of 0. @var{uctype}
-is @var{type}, with lowercase converted to uppercase, spaces changed to
-underscores, and asterisks changed to @samp{P}. For example, the call
-@example
-AC_CHECK_SIZEOF(int *)
-@end example
-@noindent
-defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems.
-@end defmac
-
@defmac AC_TRY_CPP (@var{includes}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
@maindex TRY_CPP
@var{includes} is C or C++ @code{#include} statements and declarations, on
when possible. @xref{Test Programs}, for more information.
@end defmac
+@node C Features, Command Line, C System Output, General Purpose Macros
+@section Checking For C Features
+
+These macros check for particular kinds of features of the C compiler,
+libraries, and headers. They cache the results of their tests for
+future use (@pxref{Caching Values}, for more information).
+
+@defmac AC_CHECK_FUNC (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
+@maindex CHECK_FUNC
+If @var{function} is available, run shell commands
+@var{action-if-found}, otherwise @var{action-if-not-found}. If the
+functions might be in libraries other than the default C library, first
+call @code{AC_CHECK_LIB} for those libraries. If you just want to
+define a symbol if the function is available, consider using
+@code{AC_CHECK_FUNCS} instead.
+@end defmac
+
+@defmac AC_CHECK_FUNCS (@var{function}@dots{})
+@maindex CHECK_FUNCS
+@vindex HAVE_@var{function}
+For each given @var{function} in the whitespace-separated argument list
+that is available, define @code{HAVE_@var{function}} (in all caps).
+@xref{Specific Tests}, for a precise definition of ``define'' as it
+is used here. If the functions might be in libraries other than the
+default C library, first call @code{AC_CHECK_LIB} for those libraries.
+@end defmac
+
+@defmac AC_CHECK_HEADER (@var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
+@maindex CHECK_HEADER
+If the system header file @var{header-file} exists, execute shell commands
+@var{action-if-found}, otherwise execute @var{action-if-not-found}. If
+you just want to define a symbol if the header file is available,
+consider using @code{AC_CHECK_HEADERS} instead.
+@end defmac
+
+@defmac AC_CHECK_HEADERS (@var{header-file}@dots{})
+@maindex CHECK_HEADERS
+@vindex HAVE_@var{header}
+For each given system header file @var{header-file} in the
+whitespace-separated argument list that exists, define
+@code{HAVE_@var{header-file}} (in all caps). @xref{Specific Tests}, for
+a precise definition of ``define'' as it is used here.
+@end defmac
+
+@defmac AC_CHECK_SIZEOF (@var{type})
+@maindex CHECK_SIZEOF
+Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or
+C++) builtin type @var{type}, e.g. @samp{int} or @samp{char *}. If
+@samp{type} is unknown to the compiler, gets a size of 0. @var{uctype}
+is @var{type}, with lowercase converted to uppercase, spaces changed to
+underscores, and asterisks changed to @samp{P}. For example, the call
+@example
+AC_CHECK_SIZEOF(int *)
+@end example
+@noindent
+defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems.
+@end defmac
+
+@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
+@samp{unsigned}.
+@end defmac
+
+@defmac AC_REPLACE_FUNCS (@var{function-name}@dots{})
+@maindex REPLACE_FUNCS
+For each given @var{function-name} in the whitespace-separated argument
+list that is not in the C library, add @samp{@var{function-name}.o} to
+the value of the @code{make} variable @code{LIBOBJS}. If the functions
+might be in libraries other than the default C library, first call
+@code{AC_CHECK_LIB} for those libraries.
+@end defmac
+
@node Command Line, Setting Variables, C Features, General Purpose Macros
@section Checking Command Line Arguments
@defmac AC_CHECKING (@var{feature-description})
@maindex CHECKING
This macro is similar to @code{AC_MSG_CHECKING}, except that it prints a
-newline after the @var{feature-description}. It is considered obsolete.
+newline after the @var{feature-description}. It is useful mainly to
+print a general description of the overall purpose of a group of feature
+checks, e.g.
+
+@example
+AC_CHECKING(if stack overflow is detectable)
+@end example
@end defmac
@defmac AC_MSG_CHECKING (@var{feature-description})
Make @code{m4} print a warning message on the standard error output if
@var{called-macro-name} has already been called. @var{this-macro-name}
should be the name of the macro that is calling @code{AC_BEFORE}. The
-macro @var{called-macro-name} must contain a call to @code{AC_PROVIDE}
-to indicate that it has been called.
+macro @var{called-macro-name} must have been defined using
+@code{AC_DEFUN} or else contain a call to @code{AC_PROVIDE} to indicate
+that it has been called.
This macro should be used when one macro makes changes that might affect
another macro, so that the other macro should probably not be called
@defmac AC_PROVIDE (@var{macro-name})
@maindex PROVIDE
-Set a flag recording that @var{macro-name} has been called. The
-argument should be the name of the macro that is calling
+Set a flag recording that @var{macro-name} has been called. This macro
+is called automatically when using @code{AC_DEFUN} to define a macro.
+
+The argument should be the name of the macro that is calling
@code{AC_PROVIDE}. An easy way to get it is from the @code{m4} builtin
variable @code{$0}, like this:
@maindex REQUIRE
If the @code{m4} macro @var{macro-name} has not already been called,
call it (without any arguments). Make sure to quote @var{macro-name}
-with square brackets. The body of @var{macro-name} must contain a call
-to @code{AC_PROVIDE} to indicate that it has been called.
+with square brackets. The body of @var{macro-name} must have been
+defined using @code{AC_DEFUN} or else contain a call to
+@code{AC_PROVIDE} to indicate that it has been called.
Macros that need some other macro to be called before they are called
can use @code{AC_REQUIRE} to ensure that it has been, in case the person
who made @file{configure.in} forgot or didn't know to do it.
-@code{AC_REQUIRE} and @code{AC_PROVIDE} together can ensure that a macro
+@code{AC_REQUIRE} can ensure that a macro
is only called if it is needed, and only called once.
@xref{Dependencies Between Macros}, for more information.
@end defmac
@node Macro Format, Macro Naming, , Writing Macros
@section Macro Format
-Autoconf macros are defined as arguments to the @code{m4} builtin
-command @code{define}. Their overall structure looks like this:
+@maindex DEFUN
+Autoconf macros are defined as arguments to the @code{AC_DEFUN} macro,
+which is similar to the @code{m4} builtin @code{define} macro. In
+addition to defining the macro, @code{AC_DEFUN} causes the macro, when
+it is called, to set a flag which is used to constrain the order in
+which macros are called (@pxref{Prerequisite Macros}).
+
+An Autoconf macro definition looks like this:
@example
-define(@var{macro-name}, [@var{macro-body}])dnl
+AC_DEFUN(@var{macro-name}, [@var{macro-body}])dnl
@end example
@noindent
been called first to set the shell variable @code{CPP}
(@pxref{Alternative Programs}).
-Rather than forcing the user of the macros to keep track of all of the
-dependencies between them, you can use the macros @code{AC_PROVIDE} and
-@code{AC_REQUIRE} to do it automatically. @xref{Macro Ordering}, for more
-information on their syntax.
+Rather than forcing the user of the macros to keep track of the
+dependencies between them, you can use the @code{AC_REQUIRE} macro to do
+it automatically. @xref{Macro Ordering}, for more information on its
+syntax.
The new macro that runs the C preprocessor should contain, somewhere
before @code{CPP} is used, the statement
AC_REQUIRE([AC_PROG_CPP])
@end example
-@noindent
-and the macro @code{AC_PROG_CPP} should contain the statement (anywhere
-in its body)
-
-@example
-AC_PROVIDE([$0])
-@end example
-
-@noindent
-Then, when the new macro is run, it will invoke @code{AC_PROG_CPP} if
-and only if @code{AC_PROG_CPP} has not already been run.
+The macro @code{AC_PROG_CPP} should be defined using @code{AC_DEFUN},
+which as well as defining the macro, causes it to set a flag when it is
+called. Then, when the new macro is run, it will invoke
+@code{AC_PROG_CPP} if and only if @code{AC_PROG_CPP} has not already
+been run.
@node Suggested Ordering, , Prerequisite Macros, Dependencies Between Macros
@subsection Suggested Ordering
The @code{AC_BEFORE} macro causes @code{m4} to print a warning message
on the standard error output when a macro is used before another macro
which might change its behavior. The macro which should come first
-should contain a call to @code{AC_BEFORE} and the macro which should
-come later should contain a call to @code{AC_PROVIDE}.
+should contain a call to @code{AC_BEFORE}.
For example, @code{AC_OS_AIX} contains
AC_BEFORE([$0], [AC_TRY_LINK])
@end example
-@noindent
-and @code{AC_TRY_LINK} contains
-
-@example
-AC_PROVIDE([$0])
-@end example
-
@noindent
As a result, if @code{AC_OS_AIX} is called after @code{AC_TRY_LINK},
it will note that @code{AC_TRY_LINK} has already been called and
If you need to check whether a symbol is defined in a C header file, you
can use @code{AC_EGREP_HEADER} if the symbol is not a C preprocessor
-macro (@pxref{C Features}), or compile a small test program that includes
-the file and references the symbol (@pxref{Test Programs}). Don't
-directly @code{grep} for the symbol in the file, because on some systems
-it might be defined in another header file that the file you are
-checking @samp{#include}s.
+macro (@pxref{C System Output}), or compile a small test program
+that includes the file and references the symbol (@pxref{Test
+Programs}). Don't directly @code{grep} for the symbol in the file,
+because on some systems it might be defined in another header file that
+the file you are checking @samp{#include}s.
However, if you need to check for a particular UNIX variant which is
distinguished by having certain text in a certain file, then use
If you need to check for a condition other than whether some symbol
exists on the system or has a certain value, then you can't use
-@code{AC_TRY_LINK} (@pxref{C Features}). You have to write a
+@code{AC_TRY_LINK} (@pxref{C System Output}). You have to write a
test program by hand. You can compile and run it using
-@code{AC_TRY_RUN} (@pxref{C Features}).
+@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
dnl Parameterized macros that do not check for something specific.
+dnl Requires GNU m4.
dnl This file is part of Autoconf.
dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
dnl
M4 environment variable to its path name.
)m4exit(2)])dnl
dnl
-define(AC_ACVERSION, 1.98)dnl
+define(AC_ACVERSION, 1.99)dnl
dnl This is defined by the --version option of the autoconf script.
ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
m4exit(0)])dnl
define(AC_DIVERSION_NORMAL, 0)dnl normal output
define(AC_DIVERSION_SED, 1)dnl sed substitutions for config.status
define(AC_DIVERSION_VAR, 2)dnl variable assignments for config.status
-define(AC_DIVERSION_HELP_ENABLE, 3)dnl --enable/--disable help strings
-define(AC_DIVERSION_ARG_ENABLE, 4)dnl --enable/--disable actions
-define(AC_DIVERSION_HELP_WITH, 5)dnl --with/--without help strings
-define(AC_DIVERSION_ARG_WITH, 6)dnl --with/--without actions
+define(AC_DIVERSION_HELP, 3)dnl --enable/--with help strings
+define(AC_DIVERSION_ARG, 4)dnl --enable/--with actions
+divert(AC_DIVERSION_NORMAL)dnl
+dnl
+dnl Define a macro which automatically provides itself.
+dnl Use instead of define for macros to be used as functions.
+dnl
+dnl AC_DEFUN(NAME, EXPANSION)
+define([AC_DEFUN],
+[define($1,
+[define([AC_PROVIDE_$1], )][$2])])dnl
dnl
-define(AC_INIT_NOTICE,
+AC_DEFUN(AC_INIT_NOTICE,
[# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version] AC_ACVERSION [
# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
])dnl
dnl
-define(AC_INIT_PARSEARGS,
+AC_DEFUN(AC_INIT_PARSEARGS,
[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
AC_BEFORE([$0], [AC_ARG_WITH])dnl
# Save the original args to write them into config.status later.
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
---enable/--disable options recognized:
-undivert(AC_DIVERSION_HELP_ENABLE)dnl
---with/--without options recognized:
-undivert(AC_DIVERSION_HELP_WITH)"dnl
+--enable/--with options recognized:
+undivert(AC_DIVERSION_HELP)"dnl
changequote([, ])dnl
# Initialize some variables set by options.
dnl
dnl Try to have only one #! line, just so it doesn't look funny.
dnl
-define(AC_BINSH,
-[AC_PROVIDE([AC_BINSH])dnl
-dnl AC_REQUIRE inserts a newline after this.
-#!/bin/sh])dnl
+AC_DEFUN(AC_BINSH,
+[#!/bin/sh
+])dnl
dnl
-define(AC_INIT,
+AC_DEFUN(AC_INIT,
[AC_REQUIRE([AC_BINSH])dnl
AC_INIT_NOTICE
AC_INIT_PARSEARGS
AC_INIT_PREPARE($1)])dnl
dnl
dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
-define(AC_INIT_PREPARE,
+AC_DEFUN(AC_INIT_PREPARE,
[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
AC_BEFORE([$0], [AC_ARG_WITH])dnl
AC_BEFORE([$0], [AC_CONFIG_HEADER])dnl
AC_BEFORE([$0], [AC_REVISION])dnl
AC_BEFORE([$0], [AC_PREREQ])dnl
-AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
+dnl AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
trap 'rm -fr confdefs* $ac_clean_files' 0
AC_CACHE_LOAD
AC_LANG_C
-undivert(AC_DIVERSION_ARG_ENABLE)dnl
-undivert(AC_DIVERSION_ARG_WITH)dnl
+undivert(AC_DIVERSION_ARG)dnl
])dnl
dnl
dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_ARG_ENABLE,
-[AC_PROVIDE([$0])dnl
-divert(AC_DIVERSION_HELP_ENABLE)dnl
+AC_DEFUN(AC_ARG_ENABLE,
+[divert(AC_DIVERSION_HELP)dnl
$2
-divert(AC_DIVERSION_ARG_ENABLE)dnl
+divert(AC_DIVERSION_ARG)dnl
AC_ENABLE_INTERNAL([$1], [$3], [$4])dnl
divert(AC_DIVERSION_NORMAL)dnl
])dnl
dnl
-define(AC_ENABLE,
+AC_DEFUN(AC_ENABLE,
[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE before AC_INIT])dnl
AC_ENABLE_INTERNAL([$1], [$2], [$3])dnl
])dnl
dnl
dnl AC_ENABLE_INTERNAL(FEATURE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_ENABLE_INTERNAL,
+AC_DEFUN(AC_ENABLE_INTERNAL,
[[#] Check whether --enable-$1 or --disable-$1 was given.
enableval="[$enable_]patsubst($1, -, _)"
if test -n "$enableval"; then
])dnl
dnl
dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_ARG_WITH,
-[AC_PROVIDE([$0])dnl
-divert(AC_DIVERSION_HELP_WITH)dnl
+AC_DEFUN(AC_ARG_WITH,
+[divert(AC_DIVERSION_HELP)dnl
$2
-divert(AC_DIVERSION_ARG_WITH)dnl
+divert(AC_DIVERSION_ARG)dnl
AC_WITH_INTERNAL([$1], [$3], [$4])dnl
divert(AC_DIVERSION_NORMAL)dnl
])dnl
dnl
-define(AC_WITH,
+AC_DEFUN(AC_WITH,
[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH before AC_INIT])dnl
AC_WITH_INTERNAL([$1], [$2], [$3])dnl
])dnl
dnl
dnl AC_WITH_INTERNAL(PACKAGE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_WITH_INTERNAL,
+AC_DEFUN(AC_WITH_INTERNAL,
[[#] Check whether --with-$1 or --without-$1 was given.
withval="[$with_]patsubst($1, -, _)"
if test -n "$withval"; then
])dnl
dnl
dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
-define(AC_CONFIG_HEADER, [AC_PROVIDE([$0])define(AC_LIST_HEADERS, $1)])dnl
+AC_DEFUN(AC_CONFIG_HEADER,
+[define(AC_LIST_HEADERS, $1)])dnl
dnl
dnl AC_REVISION(REVISION-INFO)
-define(AC_REVISION, [AC_PROVIDE([$0])AC_REQUIRE([AC_BINSH])dnl
+AC_DEFUN(AC_REVISION,
+[AC_REQUIRE([AC_BINSH])dnl
[# From configure.in] translit([$1], $")])dnl
dnl
dnl Subroutines of AC_PREREQ.
dnl
dnl Change the dots in version number $1 into commas.
-define(AC_PREREQ_SPLIT, [translit($1, ., [, ])])dnl
+AC_DEFUN(AC_PREREQ_SPLIT,
+[translit($1, ., [, ])])dnl
dnl
dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0).
-define(AC_PREREQ_CANON, [$1, $2, ifelse([$3], , 0, [$3])])dnl
+AC_DEFUN(AC_PREREQ_CANON,
+[$1, $2, ifelse([$3], , 0, [$3])])dnl
dnl
dnl Complain and exit if the version number in $1 through $3 is less than
dnl the version number in $4 through $6.
dnl $7 is the printable version of the second version number.
-define(AC_PREREQ_COMPARE,
+AC_DEFUN(AC_PREREQ_COMPARE,
[ifelse(builtin([eval],
[$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]), 1,
[errprint(Autoconf version $7 or higher is required
dnl
dnl Complain and exit if the Autoconf version is less than $1.
dnl AC_PREREQ(VERSION)
-define(AC_PREREQ,
-[AC_PROVIDE([$0])dnl
-AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
+AC_DEFUN(AC_PREREQ,
+[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])dnl
dnl
dnl Run configure in subdirectories $1.
dnl Not actually done until AC_OUTPUT_SUBDIRS.
dnl AC_CONFIG_SUBDIRS(DIR ...)
-define(AC_CONFIG_SUBDIRS,
-[AC_PROVIDE([$0])dnl
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_DEFUN(AC_CONFIG_SUBDIRS,
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
define([AC_LIST_SUBDIRS], [$1])])dnl
dnl
dnl Guess the value for the `prefix' variable by looking for
dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
dnl set `prefix' to /usr/local/gnu.
dnl AC_PREFIX_PROGRAM(PROGRAM)
-define(AC_PREFIX_PROGRAM, [define([AC_LIST_PREFIX_PROGRAM], [$1])])dnl
-define(AC_PREFIX_INTERNAL,
+AC_DEFUN(AC_PREFIX_PROGRAM,
+[define([AC_LIST_PREFIX_PROGRAM], [$1])])dnl
+AC_DEFUN(AC_PREFIX_INTERNAL,
[if test "x$prefix" = xNONE; then
changequote(<<, >>)dnl
define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
fi
undefine(AC_VAR_NAME)dnl
])dnl
-define(AC_PREFIX,
+AC_DEFUN(AC_PREFIX,
[AC_OBSOLETE([$0], [; instead use AC_PREFIX_PROGRAM before AC_INIT])dnl
AC_PREFIX_INTERNAL([$1])])dnl
dnl
dnl in directory $1. These are auxiliary files used in configuration.
dnl $1 can be either absolute or relative to ${srcdir}.
dnl AC_CONFIG_AUX_DIR(DIR)
-define(AC_CONFIG_AUX_DIR,
+AC_DEFUN(AC_CONFIG_AUX_DIR,
[AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)])dnl
dnl
dnl The default is `${srcdir}' or `${srcdir}/..' or `${srcdir}/../..'.
dnl There's no need to call this macro explicitly; just AC_REQUIRE it.
-define(AC_CONFIG_AUX_DIR_DEFAULT,
+AC_DEFUN(AC_CONFIG_AUX_DIR_DEFAULT,
[AC_CONFIG_AUX_DIRS(${srcdir} ${srcdir}/.. ${srcdir}/../..)])dnl
dnl
dnl Internal subroutine.
dnl We look only for install.sh, so users of AC_PROG_INSTALL
dnl do not automatically need to distribute the other auxiliary files.
dnl AC_CONFIG_AUX_DIRS(DIR ...)
-define(AC_CONFIG_AUX_DIRS,
+AC_DEFUN(AC_CONFIG_AUX_DIRS,
[ac_aux_dir=
for ac_dir in $1; do
if test -f $ac_dir/install.sh; then
])dnl
dnl
dnl Canonicalize the host, target, and build system types.
-define(AC_CANONICAL_SYSTEM,
+AC_DEFUN(AC_CANONICAL_SYSTEM,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Do some error checking and defaulting for the host and target type.
# The inputs are:
dnl
dnl Subroutines of AC_CANONICAL_SYSTEM.
dnl
-define(AC_CANONICAL_HOST,
+AC_DEFUN(AC_CANONICAL_HOST,
[AC_MSG_CHECKING(host system type)
case "${host_alias}" in
AC_SUBST(host_os)dnl
])dnl
dnl
-define(AC_CANONICAL_TARGET,
+AC_DEFUN(AC_CANONICAL_TARGET,
[AC_MSG_CHECKING(target system type)
case "${target_alias}" in
AC_SUBST(target_os)dnl
])dnl
dnl
-define(AC_CANONICAL_BUILD,
+AC_DEFUN(AC_CANONICAL_BUILD,
[AC_MSG_CHECKING(build system type)
case "${build_alias}" in
dnl link name in $1.
dnl Not actually done until AC_OUTPUT_LINKS.
dnl AC_LINK_FILES(LINK ..., FILE ...)
-define(AC_LINK_FILES,
+AC_DEFUN(AC_LINK_FILES,
[define([AC_LIST_LINKS], [$1])define([AC_LIST_FILES], [$2])])dnl
dnl
dnl
dnl
dnl
dnl Look for site or system specific initialization scripts.
-define(AC_SITE_LOAD,
+AC_DEFUN(AC_SITE_LOAD,
[ac_site_dirs=/usr/local
if test "x$prefix" != xNONE; then
ac_site_dirs=$prefix
done
])dnl
dnl
-define(AC_CACHE_LOAD,
+AC_DEFUN(AC_CACHE_LOAD,
[if test -r "$cache_file"; then
echo "loading cache $cache_file"
. $cache_file
else
echo "creating cache $cache_file"
> $cache_file
-fi])dnl
+fi
+])dnl
dnl
-define(AC_CACHE_SAVE,
+AC_DEFUN(AC_CACHE_SAVE,
[if test -w $cache_file; then
echo "updating cache $cache_file"
cat > $cache_file <<\CEOF
# Ultrix sh set writes to stderr and can't be redirected directly.
(set) 2>&1 | sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1-'\2'}/p" >> $cache_file
changequote([, ])dnl
-fi])dnl
+fi
+])dnl
dnl
dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
-define(AC_CACHE_VAL,
+AC_DEFUN(AC_CACHE_VAL,
[AC_REQUIRE([AC_PROG_ECHO_N])dnl
dnl We used to use the below line, but it fails if the 1st arg is a
dnl shell variable, so we need the eval.
dnl Several simple subroutines to do various flavors of quoting.
dnl
dnl Quote $1 against shell "s.
-define(AC_QUOTE_DQUOTE, [dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
+AC_DEFUN(AC_QUOTE_DQUOTE,
+[dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
patsubst($1, changequote(, )\([$"`\\]\)changequote([, ]), \\\1)])dnl
dnl
dnl Quote $1 against shell 's.
-define(AC_QUOTE_SQUOTE, [patsubst($1, ', '\\'')])dnl
+AC_DEFUN(AC_QUOTE_SQUOTE,
+[patsubst($1, ', '\\'')])dnl
dnl
dnl Quote $1 against shell here documents (<<EOF).
-define(AC_QUOTE_HERE, [changequote({, })dnl
+AC_DEFUN(AC_QUOTE_HERE,
+[changequote({, })dnl
dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
patsubst(patsubst($1, \(\\[$`\\]\), \\\1), \([$`]\), \\\1){}dnl
changequote([, ])])dnl
dnl
dnl Quote $1 against the right hand side of a sed substitution.
-define(AC_QUOTE_SED, [changequote({, })dnl
+AC_DEFUN(AC_QUOTE_SED,
+[changequote({, })dnl
dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
dnl % and @ and ! are commonly used as the sed s separator character.
patsubst($1, \([&\\%@!]\), \\\1){}dnl
changequote([, ])])dnl
dnl
dnl Quote $1 against tokenization.
-define(AC_QUOTE_TOKEN, [changequote({, })dnl
+AC_DEFUN(AC_QUOTE_TOKEN,
+[changequote({, })dnl
patsubst($1, \([ ]\), \\\1){}dnl
changequote([, ])])dnl
dnl
dnl Subroutines of AC_DEFINE. Does more quoting magic than any sane person
dnl should be able to understand. The point of it all is that what goes into
dnl Makefile et al should be verbatim what was written in configure.in.
-define(AC_DEFINE_QUOTE, [dnl
-AC_QUOTE_TOKEN(AC_QUOTE_SQUOTE(AC_QUOTE_DQUOTE($1)))])dnl
+AC_DEFUN(AC_DEFINE_QUOTE,
+[AC_QUOTE_TOKEN(AC_QUOTE_SQUOTE(AC_QUOTE_DQUOTE($1)))])dnl
dnl
-define(AC_DEFINE_SEDQUOTE, [dnl
-AC_QUOTE_DQUOTE(AC_QUOTE_HERE(AC_QUOTE_HERE(AC_QUOTE_SED($1))))])dnl
+AC_DEFUN(AC_DEFINE_SEDQUOTE,
+[AC_QUOTE_DQUOTE(AC_QUOTE_HERE(AC_QUOTE_HERE(AC_QUOTE_SED($1))))])dnl
dnl
dnl Don't compare $2 to a blank, so we can support "-Dfoo=".
dnl If creating a configuration header file, we add
dnl and the value to give it.
dnl The newlines around the curly braces prevent sh syntax errors.
dnl AC_DEFINE(VARIABLE [, VALUE])
-define(AC_DEFINE, [
+AC_DEFUN(AC_DEFINE,
+[
{
dnl Uniformly use AC_DEFINE_[SED]QUOTE, so callers of AC_DEFINE_UNQUOTED
dnl can use AC_QUOTE_* manually if they want to.
dnl it doesn't distinguish between the arguments to the outer
dnl function, which should be expanded, and the arguments to the inner
dnl function, which shouldn't yet.
-define(AC_QUOTE_IDENTITY, $1)dnl
-define(AC_DEFINE_UNQUOTED, [dnl
-pushdef([AC_QUOTE_SQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
+AC_DEFUN(AC_QUOTE_IDENTITY,
+$1)dnl
+AC_DEFUN(AC_DEFINE_UNQUOTED,
+[pushdef([AC_QUOTE_SQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
pushdef([AC_DEFINE_SEDQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
AC_DEFINE($1, $2)dnl
popdef([AC_DEFINE_SEDQUOTE])dnl
dnl This macro protects the argument from being diverted twice
dnl if this macro is called twice for it.
dnl AC_SUBST(VARIABLE)
-define(AC_SUBST,
+AC_DEFUN(AC_SUBST,
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
divert(AC_DIVERSION_SED)dnl
])])dnl
dnl
dnl AC_SUBST_FILE(VARIABLE, FILE)
-define(AC_SUBST_FILE,
+AC_DEFUN(AC_SUBST_FILE,
[if test -f $2; then
echo using $2 for $1)
AC_INSERT_FILE($1, $2)
AC_INSERT_FILE($1, ${srcdir}/$2)
fi
])dnl
-define(AC_INSERT_FILE,
+AC_DEFUN(AC_INSERT_FILE,
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
divert(AC_DIVERSION_SED)dnl
dnl
dnl
dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION)
-define(AC_MSG_CHECKING,
+AC_DEFUN(AC_MSG_CHECKING,
[AC_REQUIRE([AC_PROG_ECHO_N])dnl
echo $ac_n "checking $1""... $ac_c" 1>&4])dnl
dnl
-define(AC_CHECKING,
-[AC_OBSOLETE([$0], [; instead use AC_MSG_CHECKING])dnl
-echo "checking $1" 1>&4])dnl
+AC_DEFUN(AC_CHECKING,
+[echo "checking $1" 1>&4])dnl
dnl
dnl AC_MSG_RESULT(RESULT-DESCRIPTION)
-define(AC_MSG_RESULT,
+AC_DEFUN(AC_MSG_RESULT,
[AC_REQUIRE([AC_PROG_ECHO_N])dnl
echo "$ac_t""$1" 1>&4])dnl
dnl
-define(AC_VERBOSE,
+AC_DEFUN(AC_VERBOSE,
[AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl
echo " $1" 1>&4])dnl
dnl
dnl AC_MSG_WARN(PROBLEM-DESCRIPTION)
-define(AC_MSG_WARN,
+AC_DEFUN(AC_MSG_WARN,
[echo "configure: warning: $1" 1>&2])dnl
dnl
dnl AC_MSG_ERROR(ERROR-DESCRIPTION)
-define(AC_MSG_ERROR,
+AC_DEFUN(AC_MSG_ERROR,
[echo "configure: $1" 1>&2; exit 1])dnl
dnl
dnl
dnl ### Selecting which language to use for testing
dnl
dnl
-define(AC_LANG_C,
+AC_DEFUN(AC_LANG_C,
[define([AC_LANG], [C])dnl
-AC_PROVIDE([$0])dnl
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='${CPP}'
ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&5 2>&5'
])dnl
dnl
-define(AC_LANG_CPLUSPLUS,
+AC_DEFUN(AC_LANG_CPLUSPLUS,
[define([AC_LANG], [CPLUSPLUS])dnl
-AC_PROVIDE([$0])dnl
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='${CXXCPP}'
])dnl
dnl
dnl Push the current language on a stack.
-define(AC_LANG_SAVE, [pushdef([AC_LANG_STACK], AC_LANG)])dnl
+AC_DEFUN(AC_LANG_SAVE,
+[pushdef([AC_LANG_STACK], AC_LANG)])dnl
dnl
dnl Restore the current language from the stack.
-define(AC_LANG_RESTORE,
+AC_DEFUN(AC_LANG_RESTORE,
[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])dnl
dnl
dnl
dnl
dnl
dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
-define(AC_BEFORE,
+AC_DEFUN(AC_BEFORE,
[ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1
])])])dnl
dnl
dnl AC_REQUIRE(MACRO-NAME)
-define(AC_REQUIRE,
-[ifdef([AC_PROVIDE_$1], , [indir([$1])
-])])dnl
+AC_DEFUN(AC_REQUIRE,
+[ifdef([AC_PROVIDE_$1], , [indir([$1])])])dnl
dnl
dnl AC_PROVIDE(MACRO-NAME)
define(AC_PROVIDE,
[define([AC_PROVIDE_$1], )])dnl
dnl
dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION])
-define(AC_OBSOLETE,
+AC_DEFUN(AC_OBSOLETE,
[errprint(__file__:__line__: warning: [$1] is obsolete[$2]
)])dnl
dnl
dnl
dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
dnl [, VALUE-IF-NOT-FOUND])
-define(AC_CHECK_PROG,
+AC_DEFUN(AC_CHECK_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
])dnl
fi])dnl
$1="$ac_cv_prog_$1"
-test -n "[$]$1" && AC_MSG_RESULT([$]$1)
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
AC_SUBST($1)dnl
])dnl
dnl
dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
-define(AC_PATH_PROG,
+AC_DEFUN(AC_PATH_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
;;
esac])dnl
$1="$ac_cv_path_$1"
-test -n "[$]$1" && AC_MSG_RESULT([$]$1)
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
AC_SUBST($1)dnl
])dnl
dnl
dnl
dnl
dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
-define(AC_CHECK_PROGS,
+AC_DEFUN(AC_CHECK_PROGS,
[for ac_prog in $2
do
AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, )
])])dnl
dnl
dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
-define(AC_PATH_PROGS,
+AC_DEFUN(AC_PATH_PROGS,
[for ac_prog in $2
do
AC_PATH_PROG($1, [$]ac_prog)
dnl
dnl AC_CHECK_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
-define(AC_CHECK_LIB,
+AC_DEFUN(AC_CHECK_LIB,
[changequote(/, /)dnl
define(/AC_LIB_NAME/, dnl
patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl
dnl
dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
-define(AC_HAVE_LIBRARY,
+AC_DEFUN(AC_HAVE_LIBRARY,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl
AC_CHECK_LIB([$1], main, [$2], [$3], [$4])dnl
])dnl
dnl
dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
dnl ACTION-IF-NOT-FOUND])
-define(AC_EGREP_HEADER,
-[AC_PROVIDE([$0])dnl
-AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])])dnl
+AC_DEFUN(AC_EGREP_HEADER,
+[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])])dnl
dnl
-dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must come early,
-dnl it is not included in AC_BEFORE checks.
+dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
+dnl come early, it is not included in AC_BEFORE checks.
dnl AC_EGREP_CPP(PATTERN, PROGRAM, ACTION-IF-FOUND [,
dnl ACTION-IF-NOT-FOUND])
-define(AC_EGREP_CPP,
+AC_DEFUN(AC_EGREP_CPP,
[AC_REQUIRE_CPP()dnl
-AC_PROVIDE([$0])dnl
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
[$2]
dnl
dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-define(AC_COMPILE_CHECK,
-[AC_PROVIDE([$0])dnl
-dnl It's actually ok to use this, if you don't care about caching.
+AC_DEFUN(AC_COMPILE_CHECK,
+[dnl It's actually ok to use this, if you don't care about caching.
dnl AC_OBSOLETE([$0], [; instead use AC_TRY_LINK])dnl
ifelse([$1], , , [AC_CHECKING([for $1])
])dnl
dnl
dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-define(AC_TRY_LINK,
-[AC_PROVIDE([$0])dnl
-dnl We use return because because C++ requires a prototype for exit.
+AC_DEFUN(AC_TRY_LINK,
+[dnl We use return because because C++ requires a prototype for exit.
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
[$1]
dnl
dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
dnl [, ACTION-IF-CROSS-COMPILING]])
-define(AC_TRY_RUN,
-[AC_PROVIDE([$0])dnl
-AC_REQUIRE([AC_C_CROSS])dnl
+AC_DEFUN(AC_TRY_RUN,
+[AC_REQUIRE([AC_C_CROSS])dnl
if test "$cross_compiling" = yes; then
ifelse([$4], , AC_MSG_ERROR(can not run test program while cross compiling),
[AC_MSG_WARN(using default for cross-compiling)
rm -fr conftest*])dnl
dnl
dnl AC_TRY_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-define(AC_TRY_CPP,
+AC_DEFUN(AC_TRY_CPP,
[AC_REQUIRE_CPP()dnl
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
dnl
dnl
dnl AC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-define(AC_CHECK_HEADER,
+AC_DEFUN(AC_CHECK_HEADER,
[dnl Do the transliteration at runtime so arg 1 can be a shell variable.
ac_var=`echo "$1" | tr './' '__'`
AC_MSG_CHECKING([for $1])
])dnl
dnl
dnl AC_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-define(AC_CHECK_FUNC,
+AC_DEFUN(AC_CHECK_FUNC,
[AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(ac_cv_func_$1,
[AC_TRY_LINK(
])dnl
dnl
dnl AC_CHECK_FUNCS(FUNCTION...)
-define(AC_CHECK_FUNCS,
+AC_DEFUN(AC_CHECK_FUNCS,
[for ac_func in $1
do
changequote(, )dnl
])dnl
dnl
dnl AC_CHECK_HEADERS(HEADER-FILE...)
-define(AC_CHECK_HEADERS,
+AC_DEFUN(AC_CHECK_HEADERS,
[AC_REQUIRE_CPP()dnl Make sure the cpp check happens outside the loop.
for ac_hdr in $1
do
])dnl
dnl
dnl AC_REPLACE_FUNCS(FUNCTION-NAME...)
-define(AC_REPLACE_FUNCS,
+AC_DEFUN(AC_REPLACE_FUNCS,
[for ac_func in $1
do
AC_CHECK_FUNC(${ac_func}, , [LIBOBJS="$LIBOBJS ${ac_func}.o"])
])dnl
dnl
dnl AC_CHECK_SIZEOF(TYPE)
-define(AC_CHECK_SIZEOF,
+AC_DEFUN(AC_CHECK_SIZEOF,
[changequote(<<, >>)dnl
dnl The name to #define.
define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
])dnl
dnl
dnl AC_CHECK_TYPE(TYPE, DEFAULT)
-define(AC_CHECK_TYPE,
+AC_DEFUN(AC_CHECK_TYPE,
[AC_MSG_CHECKING(for $1 in sys/types.h)
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_HEADER($1, sys/types.h, ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
dnl
dnl
dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS])
-define(AC_OUTPUT,
+AC_DEFUN(AC_OUTPUT,
[AC_CACHE_SAVE
test "x$prefix" = xNONE && prefix=/usr/local
[divert(AC_DIVERSION_SED)dnl
s%@DEFS@%-DHAVE_CONFIG_H%],
[divert(AC_DIVERSION_SED)dnl
-s%@DEFS@%$DEFS%]
-[divert(AC_DIVERSION_VAR)dnl
+s%@DEFS@%$DEFS%
+divert(AC_DIVERSION_VAR)dnl
DEFS='$DEFS'
])dnl
divert(AC_DIVERSION_VAR)dnl
extrasub='$extrasub'
divert(AC_DIVERSION_NORMAL)dnl
-# Some shells look in PATH for config.status without the "./".
+# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
trap "rm -f ${CONFIG_STATUS}; exit 1" 1 2 15
dnl Create the header files listed in $1.
dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
dnl here document whose contents are going into config.status.
-define(AC_OUTPUT_HEADER,
+AC_DEFUN(AC_OUTPUT_HEADER,
[changequote(<<, >>)dnl
# These sed commands are put into ac_sed_defs when defining a macro.
])dnl
dnl
-define(AC_OUTPUT_LINKS,
+AC_DEFUN(AC_OUTPUT_LINKS,
[ac_links="$1"
ac_files="$2"
while test -n "${ac_files}"; do
done
])dnl
dnl
-define(AC_OUTPUT_SUBDIRS,
+AC_DEFUN(AC_OUTPUT_SUBDIRS,
[if test -z "${norecursion}"; then
# Remove --cache-file and --srcdir arguments so they do not pile up.
dnl checking messages from result messages.
dnl Idea borrowed from dist 3.0.
dnl Internal use only.
-define(AC_PROG_ECHO_N,
-[AC_PROVIDE([$0])dnl
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+AC_DEFUN(AC_PROG_ECHO_N,
+[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
if (echo -n testing; echo 1,2,3) | grep -e -n > /dev/null; then
ac_n= ac_c='
' ac_t=' '
fi
else
ac_n= ac_c='\c' ac_t=
-fi])dnl
+fi
+])dnl
dnl
-define(AC_PROG_CC,
+AC_DEFUN(AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_PROVIDE([$0])dnl
AC_CHECK_PROG(CC, gcc, gcc, cc)
AC_MSG_CHECKING(whether we are using GNU C)
if test $ac_cv_prog_gcc = yes; then GCC=yes; else GCC= ; fi
])dnl
dnl
-define(AC_PROG_CXX,
+AC_DEFUN(AC_PROG_CXX,
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
-AC_PROVIDE([$0])dnl
AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc)
# Find out if we are using GNU C++, under whatever name.
if test $ac_cv_prog_gxx = yes; then GXX=yes; else GXX= ; fi
])dnl
dnl
-define(AC_PROG_GCC_TRADITIONAL,
+AC_DEFUN(AC_PROG_GCC_TRADITIONAL,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
if test $ac_cv_prog_gcc = yes; then
fi
])dnl
dnl
-define(AC_PROG_CC_C_O,
+AC_DEFUN(AC_PROG_CC_C_O,
[if test "x$CC" != xcc; then
AC_MSG_CHECKING(whether $CC and cc understand -c and -o together)
else
])dnl
dnl
dnl Define SET_MAKE to set ${MAKE} if make doesn't.
-define(AC_PROG_MAKE_SET,
+AC_DEFUN(AC_PROG_MAKE_SET,
[AC_MSG_CHECKING(whether ${MAKE-make} sets \$MAKE)
set dummy ${MAKE-make}; ac_make=[$]2
AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
AC_SUBST([SET_MAKE])dnl
])dnl
dnl
-define(AC_PROG_RANLIB, [AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])dnl
+AC_DEFUN(AC_PROG_RANLIB,
+[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])dnl
dnl
-define(AC_PROG_AWK, [AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])dnl
+AC_DEFUN(AC_PROG_AWK,
+[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])dnl
dnl
-define(AC_PROG_YACC, [AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])dnl
+AC_DEFUN(AC_PROG_YACC,
+[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])dnl
dnl
-define(AC_PROG_CPP,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(how to run the C preprocessor)
+AC_DEFUN(AC_PROG_CPP,
+[AC_MSG_CHECKING(how to run the C preprocessor)
if test -z "$CPP"; then
AC_CACHE_VAL(ac_cv_prog_CPP,
[ # This must be in double quotes, not single quotes, because CPP may get
AC_SUBST(CPP)dnl
])dnl
dnl
-define(AC_PROG_CXXCPP,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(how to run the C++ preprocessor)
+AC_DEFUN(AC_PROG_CXXCPP,
+[AC_MSG_CHECKING(how to run the C++ preprocessor)
if test -z "$CXXCPP"; then
AC_CACHE_VAL(ac_cv_prog_CXXCPP,
[AC_LANG_SAVE[]dnl
dnl
dnl Require finding the C or C++ preprocessor, whichever is the
dnl current language.
-define(AC_REQUIRE_CPP,
+AC_DEFUN(AC_REQUIRE_CPP,
[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])])dnl
dnl
-define(AC_PROG_LEX,
-[AC_PROVIDE([$0])dnl
-AC_CHECK_PROG(LEX, flex, flex, lex)
+AC_DEFUN(AC_PROG_LEX,
+[AC_CHECK_PROG(LEX, flex, flex, lex)
AC_MSG_CHECKING(for $LEX library)
if test -z "$LEXLIB"
then
AC_MSG_RESULT($LEXLIB)
AC_SUBST(LEXLIB)])dnl
dnl
-define(AC_DECL_YYTEXT,
+AC_DEFUN(AC_DECL_YYTEXT,
[AC_REQUIRE_CPP()dnl
AC_REQUIRE([AC_PROG_LEX])dnl
AC_MSG_CHECKING(for yytext declaration)
AC_SUBST(LEX_OUTPUT_ROOT)dnl
])dnl
dnl
-define(AC_PROG_INSTALL,
+AC_DEFUN(AC_PROG_INSTALL,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Make sure to not get the incompatible SysV /etc/install and
# /usr/sbin/install, which might be in PATH before a BSD-like install,
AC_SUBST(INSTALL_DATA)dnl
])dnl
dnl
-define(AC_PROG_LN_S,
+AC_DEFUN(AC_PROG_LN_S,
[AC_MSG_CHECKING(whether ln -s works)
AC_CACHE_VAL(ac_cv_prog_LN_S,
[rm -f conftestdata
AC_SUBST(LN_S)dnl
])dnl
dnl
-define(AC_PROG_RSH,
+AC_DEFUN(AC_PROG_RSH,
[AC_MSG_CHECKING(for remote shell)
AC_CACHE_VAL(ac_cv_path_RSH,
[ac_cv_path_RSH=no
dnl ### Checks for header files
dnl
dnl
-define(AC_HEADER_STDC,
+AC_DEFUN(AC_HEADER_STDC,
[AC_REQUIRE_CPP()dnl
AC_MSG_CHECKING(for ANSI C header files)
AC_CACHE_VAL(ac_cv_header_stdc,
AC_MSG_RESULT($ac_cv_header_stdc)
if test $ac_cv_header_stdc = yes; then
AC_DEFINE(STDC_HEADERS)
-fi])dnl
+fi
+])dnl
dnl
-define(AC_UNISTD_H,
+AC_DEFUN(AC_UNISTD_H,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl
AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])dnl
dnl
-define(AC_USG,
+AC_DEFUN(AC_USG,
[AC_OBSOLETE([$0],
[; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl
AC_MSG_CHECKING([for BSD string and memory functions])
dnl
dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
dnl To avoid problems, don't check for gcc2 built-ins.
-define(AC_MEMORY_H,
+AC_DEFUN(AC_MEMORY_H,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])dnl
AC_MSG_CHECKING(whether string.h declares mem functions)
AC_EGREP_HEADER(memchr, string.h, ac_found=yes, ac_found=no)
AC_MSG_RESULT($ac_found)
if test $ac_found = no; then
AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)])
-fi])dnl
+fi
+])dnl
dnl
-define(AC_HEADER_MAJOR,
+AC_DEFUN(AC_HEADER_MAJOR,
[AC_MSG_CHECKING([for major, minor and makedev header])
AC_CACHE_VAL(ac_cv_header_major,
[AC_TRY_LINK([#include <sys/types.h>],
esac
])dnl
dnl
-define(AC_HEADER_DIRENT,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(for directory library header)
+AC_DEFUN(AC_HEADER_DIRENT,
+[AC_MSG_CHECKING(for directory library header)
dnl We don't use AC_CHECK_HEADERS so we can stop when we get a match.
AC_CACHE_VAL(ac_cv_header_dir,
[ac_cv_header_dir=no
])dnl
dnl
dnl Obsolete.
-define(AC_DIR_HEADER,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(for directory library header)
+AC_DEFUN(AC_DIR_HEADER,
+[AC_MSG_CHECKING(for directory library header)
AC_CACHE_VAL(ac_cv_header_dir,
[ac_cv_header_dir=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
fi
])dnl
dnl
-define(AC_HEADER_STAT,
+AC_DEFUN(AC_HEADER_STAT,
[AC_MSG_CHECKING(for broken stat file mode macros)
AC_CACHE_VAL(ac_cv_header_stat_broken,
[AC_EGREP_CPP([You lose], [#include <sys/types.h>
fi
])dnl
dnl
-define(AC_DECL_SYS_SIGLIST,
+AC_DEFUN(AC_DECL_SYS_SIGLIST,
[AC_MSG_CHECKING([for sys_siglist declaration in signal.h or unistd.h])
AC_CACHE_VAL(ac_cv_decl_sys_siglist,
[AC_TRY_LINK([#include <sys/types.h>
dnl ### Checks for typedefs
dnl
dnl
-define(AC_TYPE_GETGROUPS,
+AC_DEFUN(AC_TYPE_GETGROUPS,
[AC_REQUIRE([AC_TYPE_UID_T])dnl
AC_MSG_CHECKING(type of array argument to getgroups)
AC_CACHE_VAL(ac_cv_type_getgroups,
AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
])dnl
dnl
-define(AC_TYPE_UID_T,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING(for uid_t in sys/types.h)
+AC_DEFUN(AC_TYPE_UID_T,
+[AC_MSG_CHECKING(for uid_t in sys/types.h)
AC_CACHE_VAL(ac_cv_type_uid_t,
[AC_EGREP_HEADER(uid_t, sys/types.h,
ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)])dnl
fi
])dnl
dnl
-define(AC_TYPE_SIZE_T, [AC_CHECK_TYPE(size_t, unsigned)])dnl
+AC_DEFUN(AC_TYPE_SIZE_T,
+[AC_CHECK_TYPE(size_t, unsigned)])dnl
dnl
-define(AC_TYPE_PID_T, [AC_CHECK_TYPE(pid_t, int)])dnl
+AC_DEFUN(AC_TYPE_PID_T,
+[AC_CHECK_TYPE(pid_t, int)])dnl
dnl
-define(AC_TYPE_OFF_T,
-[AC_PROVIDE([$0])dnl
-AC_CHECK_TYPE(off_t, long)])dnl
+AC_DEFUN(AC_TYPE_OFF_T,
+[AC_CHECK_TYPE(off_t, long)])dnl
dnl
-define(AC_TYPE_MODE_T, [AC_CHECK_TYPE(mode_t, int)])dnl
+AC_DEFUN(AC_TYPE_MODE_T,
+[AC_CHECK_TYPE(mode_t, int)])dnl
dnl
dnl Note that identifiers starting with SIG are reserved by ANSI C.
-define(AC_TYPE_SIGNAL,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING([return type of signal handlers])
+AC_DEFUN(AC_TYPE_SIGNAL,
+[AC_MSG_CHECKING([return type of signal handlers])
AC_CACHE_VAL(ac_cv_type_signal,
[AC_TRY_LINK([#include <sys/types.h>
#include <signal.h>
dnl ### Checks for functions
dnl
dnl
-define(AC_FUNC_MMAP,
+AC_DEFUN(AC_FUNC_MMAP,
[AC_MSG_CHECKING(for working mmap)
AC_CACHE_VAL(ac_cv_func_mmap,
[AC_TRY_RUN([/* Thanks to Mike Haertel and Jim Avera for this test. */
fi
])dnl
dnl
-define(AC_FUNC_VPRINTF,
+AC_DEFUN(AC_FUNC_VPRINTF,
[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
if test "$ac_cv_func_vprintf" != yes; then
AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
fi
])dnl
dnl
-define(AC_FUNC_VFORK,
+AC_DEFUN(AC_FUNC_VFORK,
[AC_REQUIRE([AC_TYPE_PID_T])dnl
AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H))
AC_MSG_CHECKING(for working vfork)
fi
])dnl
dnl
-define(AC_FUNC_WAIT3,
+AC_DEFUN(AC_FUNC_WAIT3,
[AC_MSG_CHECKING(for wait3 that fills in rusage)
AC_CACHE_VAL(ac_cv_func_wait3,
[AC_TRY_RUN([#include <sys/types.h>
fi
])dnl
dnl
-define(AC_FUNC_ALLOCA,
+AC_DEFUN(AC_FUNC_ALLOCA,
[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
AC_MSG_CHECKING([for working alloca.h])
AC_SUBST(ALLOCA)dnl
])dnl
dnl
-define(AC_FUNC_GETLOADAVG,
+AC_DEFUN(AC_FUNC_GETLOADAVG,
[# Some definitions of getloadavg require that the program be installed setgid.
NEED_SETGID=false
AC_SUBST(NEED_SETGID)dnl
AC_SUBST(KMEM_GROUP)dnl
])dnl
dnl
-define(AC_FUNC_UTIME_NULL,
+AC_DEFUN(AC_FUNC_UTIME_NULL,
[AC_MSG_CHECKING(whether utime accepts a null argument)
AC_CACHE_VAL(ac_cv_func_utime_null,
[rm -f conftestdata; > conftestdata
fi
])dnl
dnl
-define(AC_FUNC_STRCOLL,
+AC_DEFUN(AC_FUNC_STRCOLL,
[AC_MSG_CHECKING(for strcoll)
AC_CACHE_VAL(ac_cv_func_strcoll,
[AC_TRY_RUN([#include <string.h>
fi
])dnl
dnl
-define(AC_FUNC_SETVBUF_REVERSED,
+AC_DEFUN(AC_FUNC_SETVBUF_REVERSED,
[AC_MSG_CHECKING(whether setvbuf arguments are reversed)
AC_CACHE_VAL(ac_cv_func_setvbuf_reversed,
[AC_TRY_RUN([#include <stdio.h>
dnl ### Checks for structure members
dnl
dnl
-define(AC_STRUCT_TM,
-[AC_PROVIDE([$0])dnl
-AC_MSG_CHECKING([whether struct tm is in sys/time.h or time.h])
+AC_DEFUN(AC_STRUCT_TM,
+[AC_MSG_CHECKING([whether struct tm is in sys/time.h or time.h])
AC_CACHE_VAL(ac_cv_struct_tm,
[AC_TRY_LINK([#include <sys/types.h>
#include <time.h>],
fi
])dnl
dnl
-define(AC_HEADER_TIME,
+AC_DEFUN(AC_HEADER_TIME,
[AC_MSG_CHECKING([whether time.h and sys/time.h may both be included])
AC_CACHE_VAL(ac_cv_header_time,
[AC_TRY_LINK([#include <sys/types.h>
fi
])dnl
dnl
-define(AC_STRUCT_TIMEZONE,
+AC_DEFUN(AC_STRUCT_TIMEZONE,
[AC_REQUIRE([AC_STRUCT_TM])dnl
AC_MSG_CHECKING([for tm_zone in struct tm])
AC_CACHE_VAL(ac_cv_struct_tm_zone,
fi
])dnl
dnl
-define(AC_STRUCT_ST_BLOCKS,
+AC_DEFUN(AC_STRUCT_ST_BLOCKS,
[AC_MSG_CHECKING([for st_blocks in struct stat])
AC_CACHE_VAL(ac_cv_struct_st_blocks,
[AC_TRY_LINK([#include <sys/types.h>
AC_SUBST(LIBOBJS)dnl
])dnl
dnl
-define(AC_STRUCT_ST_BLKSIZE,
+AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
[AC_MSG_CHECKING([for st_blksize in struct stat])
AC_CACHE_VAL(ac_cv_struct_st_blksize,
[AC_TRY_LINK([#include <sys/types.h>
fi
])dnl
dnl
-define(AC_STRUCT_ST_RDEV,
+AC_DEFUN(AC_STRUCT_ST_RDEV,
[AC_MSG_CHECKING([for st_rdev in struct stat])
AC_CACHE_VAL(ac_cv_struct_st_rdev,
[AC_TRY_LINK([#include <sys/types.h>
dnl ### Checks for compiler characteristics
dnl
dnl
-define(AC_C_CROSS,
-[AC_PROVIDE([$0])dnl
-# If we cannot run a trivial program, we must be cross compiling.
+AC_DEFUN(AC_C_CROSS,
+[# If we cannot run a trivial program, we must be cross compiling.
AC_MSG_CHECKING(whether cross-compiling)
AC_CACHE_VAL(ac_cv_c_cross,
[AC_TRY_RUN([main(){exit(0);}], ac_cv_c_cross=no, ac_cv_c_cross=yes)])dnl
AC_MSG_RESULT($ac_cv_c_cross)
])dnl
dnl
-define(AC_C_CHAR_UNSIGNED,
+AC_DEFUN(AC_C_CHAR_UNSIGNED,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING(whether char is unsigned)
AC_CACHE_VAL(ac_cv_c_char_unsigned,
fi
])dnl
dnl
-define(AC_C_LONG_DOUBLE,
+AC_DEFUN(AC_C_LONG_DOUBLE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING(for long double)
AC_CACHE_VAL(ac_cv_c_long_double,
fi
])dnl
dnl
-define(AC_INT_16_BITS,
+AC_DEFUN(AC_INT_16_BITS,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])
AC_MSG_CHECKING(integer size)
AC_TRY_RUN([main() { exit(sizeof(int) != 2); }],
AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(not 16 bits))
])dnl
dnl
-define(AC_LONG_64_BITS,
+AC_DEFUN(AC_LONG_64_BITS,
[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])
AC_MSG_CHECKING(for 64-bit long ints)
AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }],
AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(not 64 bits))
])dnl
dnl
-define(AC_C_BIGENDIAN,
+AC_DEFUN(AC_C_BIGENDIAN,
[AC_MSG_CHECKING(whether byte ordering is bigendian)
AC_CACHE_VAL(ac_cv_c_bigendian,
[AC_TRY_RUN([main () {
fi
])dnl
dnl
-define(AC_C_ARG_ARRAY,
+AC_DEFUN(AC_C_ARG_ARRAY,
[AC_MSG_CHECKING(whether the address of an argument can be used as an array)
AC_CACHE_VAL(ac_cv_c_arg_array,
[AC_TRY_RUN([main() {
fi
])dnl
dnl
-define(AC_C_INLINE,
+AC_DEFUN(AC_C_INLINE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING([for inline])
AC_CACHE_VAL(ac_cv_c_inline,
AC_DEFINE(inline, __inline)
fi
])dnl
-define(AC_C_CONST,
+AC_DEFUN(AC_C_CONST,
[dnl This message is consistent in form with the other checking messages,
dnl and with the result message.
AC_MSG_CHECKING([for working const])
dnl ### Checks for operating system services
dnl
dnl
-define(AC_HAVE_POUNDBANG,
+dnl This macro is an oddball -- the only specific test that takes args.
+AC_DEFUN(AC_HAVE_POUNDBANG,
[AC_MSG_CHECKING(whether [#]! works in shell scripts)
AC_CACHE_VAL(ac_cv_sys_interpreter,
[echo '#!/bin/cat
])dnl
fi
])dnl
-define(AC_SYS_REMOTE_TAPE,
+AC_DEFUN(AC_SYS_REMOTE_TAPE,
[AC_CHECK_HEADER(sys/mtio.h, AC_DEFINE(HAVE_SYS_MTIO_H))
-if test "$ac_cv_header_mtio_h" = yes; then
+if test "$ac_cv_header_sys_mtio_h" = yes; then
AC_MSG_CHECKING(for remote tape header files)
AC_CACHE_VAL(ac_cv_header_rmt,
[AC_TRY_CPP([#include <sgtty.h>
AC_SUBST(PROGS)dnl
])dnl
dnl
-define(AC_SYS_LONG_FILE_NAMES,
+AC_DEFUN(AC_SYS_LONG_FILE_NAMES,
[AC_MSG_CHECKING(for long file names)
AC_CACHE_VAL(ac_cv_sys_long_file_names,
[ac_cv_sys_long_file_names=yes
fi
])dnl
dnl
-define(AC_SYS_RESTARTABLE_SYSCALLS,
+AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS,
[AC_MSG_CHECKING(for restartable system calls)
AC_CACHE_VAL(ac_cv_sys_restartable_syscalls,
[AC_TRY_RUN(
fi
])dnl
dnl
-define(AC_PATH_X,
+AC_DEFUN(AC_PATH_X,
[AC_REQUIRE_CPP()dnl Set CPP; we run AC_PATH_X_DIRECT conditionally.
-AC_PROVIDE([$0])dnl
# If we find X, set shell vars x_includes and x_libraries to the paths.
no_x=yes
if test "x$with_x" != xno; then
])dnl
dnl
dnl Internal subroutine of AC_PATH_X.
-define(AC_PATH_X_XMKMF,
+AC_DEFUN(AC_PATH_X_XMKMF,
[AC_CHECKING(for X include and library files with xmkmf)
rm -fr conftestdir
if mkdir conftestdir; then
])dnl
dnl
dnl Internal subroutine of AC_PATH_X.
-define(AC_PATH_X_DIRECT,
+AC_DEFUN(AC_PATH_X_DIRECT,
[AC_CHECKING(for X include and library files directly)
test -z "$x_direct_test_library" && x_direct_test_library=Xt
test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
done)])dnl
dnl
dnl Find additional X libraries, magic flags, etc.
-define(AC_PATH_XTRA,
+AC_DEFUN(AC_PATH_XTRA,
[AC_REQUIRE([AC_OS_ISC])dnl
AC_REQUIRE([AC_PATH_X])dnl
AC_CHECKING(for additional X libraries and flags)
dnl These are kludges; we need a more systematic approach.
dnl
dnl
-define(AC_OS_AIX,
+AC_DEFUN(AC_OS_AIX,
[AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_BEFORE([$0], [AC_TRY_CPP])dnl
AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes,
[#ifdef _AIX
], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no))
])dnl
dnl
-define(AC_OS_MINIX,
+AC_DEFUN(AC_OS_MINIX,
[AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_BEFORE([$0], [AC_TRY_CPP])dnl
AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=)
# The Minix shell can not assign to the same variable on the same line!
if test "$MINIX" = yes; then
fi
])dnl
dnl
-define(AC_OS_ISC,
-[AC_PROVIDE([$0])dnl
-AC_BEFORE([$0], [AC_TRY_LINK])dnl
+AC_DEFUN(AC_OS_ISC,
+[AC_BEFORE([$0], [AC_TRY_LINK])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_BEFORE([$0], [AC_TRY_CPP])dnl
AC_MSG_CHECKING(for POSIXized ISC)
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
fi
])dnl
dnl
-define(AC_OS_XENIX,
+AC_DEFUN(AC_OS_XENIX,
[AC_REQUIRE([AC_DIR_HEADER])dnl
AC_MSG_CHECKING(for Xenix)
AC_EGREP_CPP(yes,
[#if defined(M_XENIX) && !defined(M_UNIX)
yes
#endif
-], [XENIX=yes AC_MSG_RESULT(yes)], [XENIX= AC_MSG_RESULT(no)])
+], [AC_MSG_RESULT(yes); XENIX=yes], [AC_MSG_RESULT(no); XENIX=])
if test "$XENIX" = yes; then
LIBS="$LIBS -lx"
case "$DEFS" in
fi
])dnl
dnl
-define(AC_OS_SCO,
+AC_DEFUN(AC_OS_SCO,
[AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl")
])dnl
dnl
-define(AC_OS_IRIX,
+AC_DEFUN(AC_OS_IRIX,
[AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun")
])dnl
dnl
-define(AC_OS_DYNIX,
+AC_DEFUN(AC_OS_DYNIX,
[AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq")
])dnl