From 18c8136a84aeacee5836373aab2beb85395029b4 Mon Sep 17 00:00:00 2001 From: David MacKenzie Date: Sat, 13 Aug 1994 02:19:11 +0000 Subject: [PATCH] use AC_DEFUN, alphabetize manual --- NEWS | 5 + README | 8 +- acgeneral.m4 | 282 ++++++++++--------- acspecific.m4 | 206 +++++++------- autoconf.texi | 580 ++++++++++++++++++++------------------- doc/autoconf.texi | 580 ++++++++++++++++++++------------------- lib/autoconf/general.m4 | 282 ++++++++++--------- lib/autoconf/specific.m4 | 206 +++++++------- 8 files changed, 1101 insertions(+), 1048 deletions(-) diff --git a/NEWS b/NEWS index f5e03bbb..73f70f4c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +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: @@ -11,6 +15,7 @@ Major changes in release 2.0: ** 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. diff --git a/README b/README index d7897014..7a4456fa 100644 --- a/README +++ b/README @@ -9,10 +9,10 @@ operating system features that the package can use, in the form of m4 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 diff --git a/acgeneral.m4 b/acgeneral.m4 index aca3adf5..207489e6 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -1,4 +1,5 @@ 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 @@ -34,7 +35,7 @@ Install it before installing Autoconf or set the 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 @@ -47,12 +48,19 @@ dnl m4 diversions: 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 -define(AC_INIT_NOTICE, +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 +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. @@ -72,7 +80,7 @@ define(AC_INIT_NOTICE, # 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. @@ -105,10 +113,8 @@ Features and packages: --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. @@ -358,25 +364,24 @@ fi 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 @@ -465,27 +470,25 @@ AC_SITE_LOAD 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 @@ -497,22 +500,21 @@ fi ])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 @@ -524,24 +526,28 @@ fi ])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 @@ -549,17 +555,15 @@ define(AC_PREREQ_COMPARE, 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 @@ -567,8 +571,9 @@ dnl the argument program along PATH and taking its parent. 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(<>, translit($1, [a-z], [A-Z]))dnl @@ -582,7 +587,7 @@ changequote([, ])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 @@ -594,12 +599,12 @@ dnl Find install.sh, config.sub, config.guess, and Cygnus configure 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. @@ -607,7 +612,7 @@ dnl Search for the configuration auxiliary files in directory list $1. 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 @@ -625,7 +630,7 @@ AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl ])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: @@ -663,7 +668,7 @@ AC_CANONICAL_BUILD 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 @@ -689,7 +694,7 @@ AC_SUBST(host_vendor)dnl 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 @@ -712,7 +717,7 @@ AC_SUBST(target_vendor)dnl 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 @@ -736,7 +741,7 @@ dnl Link each of the existing files in $2 to the corresponding 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 @@ -744,7 +749,7 @@ dnl ### Caching test results 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 @@ -762,16 +767,17 @@ for ac_site_dir in $ac_site_dirs; do 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 @@ -793,11 +799,12 @@ dnl Allow a site initialization script to override cache values. # 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. @@ -816,38 +823,43 @@ dnl 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 (<&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}' @@ -981,10 +992,11 @@ ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1 ])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 @@ -992,21 +1004,20 @@ dnl ### Enforcing ordering constraints 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 @@ -1016,7 +1027,7 @@ 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]) @@ -1039,12 +1050,16 @@ ifelse([$4], , , [ test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4" ])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]) @@ -1070,7 +1085,11 @@ ifelse([$3], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3" ;; 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 @@ -1079,7 +1098,7 @@ dnl ### Checking for files - derived (caching) 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, ) @@ -1089,7 +1108,7 @@ ifelse([$3], , , [test -n "[$]$1" || $1="$3" ])])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) @@ -1100,7 +1119,7 @@ ifelse([$3], , , [test -n "[$]$1" || $1="$3" 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 @@ -1129,7 +1148,7 @@ undefine(AC_CV_NAME)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 @@ -1140,17 +1159,15 @@ 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} < conftest.${ac_ext} < conftest.${ac_ext} <>)dnl dnl The name to #define. define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl @@ -1352,7 +1366,7 @@ undefine(AC_CV_NAME)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 @@ -1367,7 +1381,7 @@ dnl ### The big finish 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 @@ -1401,8 +1415,8 @@ ifdef([AC_LIST_HEADERS], [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 @@ -1410,7 +1424,7 @@ ac_vpsub='$ac_vpsub' 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 @@ -1546,7 +1560,7 @@ dnl 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. @@ -1661,7 +1675,7 @@ rm -f conftest.sed ])dnl dnl -define(AC_OUTPUT_LINKS, +AC_DEFUN(AC_OUTPUT_LINKS, [ac_links="$1" ac_files="$2" while test -n "${ac_files}"; do @@ -1683,7 +1697,7 @@ 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. diff --git a/acspecific.m4 b/acspecific.m4 index e5827018..8c70890b 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -28,9 +28,8 @@ dnl Check whether to use -n, \c, or newline-tab to separate 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=' ' @@ -39,11 +38,11 @@ if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then 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) @@ -62,9 +61,8 @@ AC_MSG_RESULT($ac_cv_prog_gcc) 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. @@ -82,7 +80,7 @@ fi])dnl 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 @@ -106,7 +104,7 @@ Autoconf TCGETA' 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 @@ -145,7 +143,7 @@ fi ])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, @@ -173,15 +171,17 @@ fi 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 @@ -201,9 +201,8 @@ AC_MSG_RESULT($CPP) 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 @@ -220,12 +219,11 @@ AC_SUBST(CXXCPP)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 @@ -237,7 +235,7 @@ fi 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) @@ -271,7 +269,7 @@ fi 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, @@ -331,7 +329,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' 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 @@ -351,7 +349,7 @@ fi 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 @@ -379,7 +377,7 @@ dnl 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, @@ -412,13 +410,14 @@ fi])dnl 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]) @@ -428,16 +427,17 @@ dnl dnl dnl If memchr and the like aren't declared in , include . 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 ], @@ -455,9 +455,8 @@ sys/sysmacros.h) AC_DEFINE(MAJOR_IN_SYSMACROS) ;; 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 @@ -488,9 +487,8 @@ fi ])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 @@ -519,7 +517,7 @@ if test $ac_cv_func_closedir_void = yes; then 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 @@ -551,7 +549,7 @@ if test $ac_cv_header_stat_broken = yes; then 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 @@ -571,7 +569,7 @@ dnl 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, @@ -604,9 +602,8 @@ AC_MSG_RESULT($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 @@ -617,20 +614,21 @@ if test $ac_cv_type_uid_t = no; then 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 #include @@ -647,7 +645,7 @@ dnl 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. */ @@ -723,14 +721,14 @@ if test $ac_cv_func_mmap = yes; then 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) @@ -842,7 +840,7 @@ if test $ac_cv_func_vfork = no; then 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 @@ -878,7 +876,7 @@ if test $ac_cv_func_wait3 = yes; then 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]) @@ -963,7 +961,7 @@ fi 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 @@ -1059,7 +1057,7 @@ fi 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 @@ -1079,7 +1077,7 @@ if test $ac_cv_func_utime_null = yes; then 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 @@ -1095,7 +1093,7 @@ if test $ac_cv_func_strcoll = yes; then 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 @@ -1120,9 +1118,8 @@ dnl 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 #include ], @@ -1134,7 +1131,7 @@ if test $ac_cv_struct_tm = sys/time.h; then 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 @@ -1147,7 +1144,7 @@ if test $ac_cv_header_time = yes; then 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, @@ -1173,7 +1170,7 @@ extern char *tzname[]; /* RS6000 and others reject char **tzname. */ 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 @@ -1188,7 +1185,7 @@ fi 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 @@ -1200,7 +1197,7 @@ if test $ac_cv_struct_st_blksize = yes; then 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 @@ -1216,9 +1213,8 @@ dnl 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 @@ -1226,7 +1222,7 @@ cross_compiling=$ac_cv_c_cross 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, @@ -1245,7 +1241,7 @@ if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then 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, @@ -1265,7 +1261,7 @@ if test $ac_cv_c_long_double = yes; then 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); }], @@ -1273,7 +1269,7 @@ 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); }], @@ -1281,7 +1277,7 @@ 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 () { @@ -1300,7 +1296,7 @@ if test $ac_cv_c_bigendian = yes; then 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() { @@ -1321,7 +1317,7 @@ if test $ac_cv_c_arg_array = no; then 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, @@ -1335,7 +1331,7 @@ if test $ac_cv_c_inline = no; then 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]) @@ -1392,7 +1388,8 @@ dnl 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 @@ -1414,10 +1411,10 @@ ifelse([$2], , , [else ])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 @@ -1430,7 +1427,7 @@ fi 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 @@ -1461,7 +1458,7 @@ if test $ac_cv_sys_long_file_names = yes; then 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( @@ -1486,9 +1483,8 @@ if test $ac_cv_sys_restartable_syscalls = yes; then 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 @@ -1525,7 +1521,7 @@ fi # No --with-x=no. ])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 @@ -1559,7 +1555,7 @@ fi ])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 @@ -1658,7 +1654,7 @@ do 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) @@ -1715,10 +1711,9 @@ dnl ### Checks for UNIX variants 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 @@ -1727,10 +1722,9 @@ AC_EGREP_CPP(yes, ], [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 @@ -1740,11 +1734,9 @@ 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 @@ -1763,14 +1755,14 @@ else 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 @@ -1780,14 +1772,14 @@ if test "$XENIX" = yes; then 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 diff --git a/autoconf.texi b/autoconf.texi index eddb52f8..d706bde4 100644 --- a/autoconf.texi +++ b/autoconf.texi @@ -6,8 +6,8 @@ @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 @@ -136,7 +136,8 @@ General Purpose Macros * 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. @@ -237,7 +238,7 @@ Autoconf imposes some restrictions on the names of macros used with 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 @@ -247,8 +248,8 @@ those functions are available. This problem does not exist with 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 @@ -753,26 +754,16 @@ what existing GNU programs use. These macros are defined in the file 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_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_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_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 @@ -789,6 +780,13 @@ If @code{gcc} is found, set @code{make} variable @code{CC} to 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 @@ -830,6 +828,14 @@ this macro first if it hasn't been called already. This macro calls @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 @@ -858,29 +864,11 @@ standard place. Otherwise set @code{LEX} to @samp{lex} and @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 @@ -903,16 +891,29 @@ If you use this macro, simply place a line like this in your @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 @@ -920,6 +921,14 @@ This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work. 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 @@ -1024,15 +1033,6 @@ If @file{sys/types.h} does not define @code{major}, @code{minor}, and @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 @@ -1100,6 +1100,15 @@ on which language is current, @pxref{Language Choice}), if it hasn't 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 @@ -1139,14 +1148,6 @@ The symbol @code{USG} is obsolete. Instead of this macro, use 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 @@ -1391,28 +1392,6 @@ define @code{STAT_MACROS_BROKEN}. This is the case on Tektronix UTekV, 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 @@ -1439,6 +1418,28 @@ example, @code{struct timeval} or @code{struct timezone} as well as @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 @@ -1472,14 +1473,11 @@ a sequence of arguments with the same type to be accessed as if they 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 @@ -1503,6 +1501,16 @@ include it before any other header files, to prevent inconsistencies in 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 @@ -1537,18 +1545,20 @@ If the C compiler supports the @code{long double} type, define 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 @@ -1582,15 +1592,6 @@ been called. Because of the macro dependencies, if you call this macro, 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 @@ -1717,7 +1718,8 @@ These macros are defined in the file @file{acgeneral.m4}. @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. @@ -1806,6 +1808,18 @@ make sure that the directory that it is told contains the source code in 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 @@ -1830,6 +1844,12 @@ If you pass @var{extra-cmds}, those commands will be inserted into @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 @@ -1842,18 +1862,6 @@ is found, set the prefix to the parent of the directory containing 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 @@ -1899,10 +1907,12 @@ produces this in @file{configure}: @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 @@ -1928,20 +1938,6 @@ present, because linking the test program will always fail with 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 @@ -1950,14 +1946,6 @@ it is found, set @var{variable} to @var{value-if-found}, otherwise to 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 @@ -1969,6 +1957,22 @@ list are found, set @var{variable} to @var{value-if-not-found}; if 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} @@ -1976,17 +1980,15 @@ are found, set @var{variable} to the entire pathname of the program 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 @@ -1994,41 +1996,19 @@ This is an obsolete alias for @code{AC_TRY_LINK}, with the addition that it 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_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_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_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{]}) @@ -2049,44 +2029,6 @@ almost always detect them by simply using @code{#ifdef} directives in 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 @@ -2133,6 +2075,80 @@ It is preferable to use @code{AC_TRY_LINK} instead of @code{AC_TRY_RUN}, 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 @@ -2360,7 +2376,13 @@ callers change automatically. @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}) @@ -2476,8 +2498,9 @@ called in the correct order. 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 @@ -2513,8 +2536,10 @@ AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead]) @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: @@ -2527,13 +2552,14 @@ AC_PROVIDE([$0]) @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 @@ -2690,11 +2716,17 @@ number, which you can get by running @samp{autoconf --version}. @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 @@ -2828,10 +2860,10 @@ that uses the C preprocessor, it depends on @code{AC_PROG_CPP} having 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 @@ -2840,17 +2872,11 @@ 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 @@ -2870,8 +2896,7 @@ not when running @file{configure}. It is not a fatal error; 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 @@ -2879,13 +2904,6 @@ 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 @@ -2912,11 +2930,11 @@ Do not use @samp{test -x}, because 4.3BSD does not have it. Use 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 @@ -2959,9 +2977,9 @@ than scanning the libraries. 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 diff --git a/doc/autoconf.texi b/doc/autoconf.texi index eddb52f8..d706bde4 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -6,8 +6,8 @@ @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 @@ -136,7 +136,8 @@ General Purpose Macros * 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. @@ -237,7 +238,7 @@ Autoconf imposes some restrictions on the names of macros used with 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 @@ -247,8 +248,8 @@ those functions are available. This problem does not exist with 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 @@ -753,26 +754,16 @@ what existing GNU programs use. These macros are defined in the file 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_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_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_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 @@ -789,6 +780,13 @@ If @code{gcc} is found, set @code{make} variable @code{CC} to 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 @@ -830,6 +828,14 @@ this macro first if it hasn't been called already. This macro calls @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 @@ -858,29 +864,11 @@ standard place. Otherwise set @code{LEX} to @samp{lex} and @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 @@ -903,16 +891,29 @@ If you use this macro, simply place a line like this in your @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 @@ -920,6 +921,14 @@ This macro replaces @code{AC_DECLARE_YYTEXT}, which didn't work. 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 @@ -1024,15 +1033,6 @@ If @file{sys/types.h} does not define @code{major}, @code{minor}, and @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 @@ -1100,6 +1100,15 @@ on which language is current, @pxref{Language Choice}), if it hasn't 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 @@ -1139,14 +1148,6 @@ The symbol @code{USG} is obsolete. Instead of this macro, use 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 @@ -1391,28 +1392,6 @@ define @code{STAT_MACROS_BROKEN}. This is the case on Tektronix UTekV, 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 @@ -1439,6 +1418,28 @@ example, @code{struct timeval} or @code{struct timezone} as well as @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 @@ -1472,14 +1473,11 @@ a sequence of arguments with the same type to be accessed as if they 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 @@ -1503,6 +1501,16 @@ include it before any other header files, to prevent inconsistencies in 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 @@ -1537,18 +1545,20 @@ If the C compiler supports the @code{long double} type, define 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 @@ -1582,15 +1592,6 @@ been called. Because of the macro dependencies, if you call this macro, 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 @@ -1717,7 +1718,8 @@ These macros are defined in the file @file{acgeneral.m4}. @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. @@ -1806,6 +1808,18 @@ make sure that the directory that it is told contains the source code in 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 @@ -1830,6 +1844,12 @@ If you pass @var{extra-cmds}, those commands will be inserted into @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 @@ -1842,18 +1862,6 @@ is found, set the prefix to the parent of the directory containing 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 @@ -1899,10 +1907,12 @@ produces this in @file{configure}: @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 @@ -1928,20 +1938,6 @@ present, because linking the test program will always fail with 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 @@ -1950,14 +1946,6 @@ it is found, set @var{variable} to @var{value-if-found}, otherwise to 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 @@ -1969,6 +1957,22 @@ list are found, set @var{variable} to @var{value-if-not-found}; if 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} @@ -1976,17 +1980,15 @@ are found, set @var{variable} to the entire pathname of the program 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 @@ -1994,41 +1996,19 @@ This is an obsolete alias for @code{AC_TRY_LINK}, with the addition that it 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_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_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_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{]}) @@ -2049,44 +2029,6 @@ almost always detect them by simply using @code{#ifdef} directives in 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 @@ -2133,6 +2075,80 @@ It is preferable to use @code{AC_TRY_LINK} instead of @code{AC_TRY_RUN}, 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 @@ -2360,7 +2376,13 @@ callers change automatically. @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}) @@ -2476,8 +2498,9 @@ called in the correct order. 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 @@ -2513,8 +2536,10 @@ AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead]) @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: @@ -2527,13 +2552,14 @@ AC_PROVIDE([$0]) @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 @@ -2690,11 +2716,17 @@ number, which you can get by running @samp{autoconf --version}. @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 @@ -2828,10 +2860,10 @@ that uses the C preprocessor, it depends on @code{AC_PROG_CPP} having 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 @@ -2840,17 +2872,11 @@ 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 @@ -2870,8 +2896,7 @@ not when running @file{configure}. It is not a fatal error; 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 @@ -2879,13 +2904,6 @@ 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 @@ -2912,11 +2930,11 @@ Do not use @samp{test -x}, because 4.3BSD does not have it. Use 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 @@ -2959,9 +2977,9 @@ than scanning the libraries. 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 diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index aca3adf5..207489e6 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1,4 +1,5 @@ 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 @@ -34,7 +35,7 @@ Install it before installing Autoconf or set the 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 @@ -47,12 +48,19 @@ dnl m4 diversions: 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 -define(AC_INIT_NOTICE, +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 +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. @@ -72,7 +80,7 @@ define(AC_INIT_NOTICE, # 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. @@ -105,10 +113,8 @@ Features and packages: --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. @@ -358,25 +364,24 @@ fi 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 @@ -465,27 +470,25 @@ AC_SITE_LOAD 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 @@ -497,22 +500,21 @@ fi ])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 @@ -524,24 +526,28 @@ fi ])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 @@ -549,17 +555,15 @@ define(AC_PREREQ_COMPARE, 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 @@ -567,8 +571,9 @@ dnl the argument program along PATH and taking its parent. 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(<>, translit($1, [a-z], [A-Z]))dnl @@ -582,7 +587,7 @@ changequote([, ])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 @@ -594,12 +599,12 @@ dnl Find install.sh, config.sub, config.guess, and Cygnus configure 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. @@ -607,7 +612,7 @@ dnl Search for the configuration auxiliary files in directory list $1. 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 @@ -625,7 +630,7 @@ AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl ])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: @@ -663,7 +668,7 @@ AC_CANONICAL_BUILD 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 @@ -689,7 +694,7 @@ AC_SUBST(host_vendor)dnl 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 @@ -712,7 +717,7 @@ AC_SUBST(target_vendor)dnl 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 @@ -736,7 +741,7 @@ dnl Link each of the existing files in $2 to the corresponding 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 @@ -744,7 +749,7 @@ dnl ### Caching test results 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 @@ -762,16 +767,17 @@ for ac_site_dir in $ac_site_dirs; do 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 @@ -793,11 +799,12 @@ dnl Allow a site initialization script to override cache values. # 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. @@ -816,38 +823,43 @@ dnl 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 (<&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}' @@ -981,10 +992,11 @@ ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1 ])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 @@ -992,21 +1004,20 @@ dnl ### Enforcing ordering constraints 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 @@ -1016,7 +1027,7 @@ 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]) @@ -1039,12 +1050,16 @@ ifelse([$4], , , [ test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4" ])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]) @@ -1070,7 +1085,11 @@ ifelse([$3], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3" ;; 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 @@ -1079,7 +1098,7 @@ dnl ### Checking for files - derived (caching) 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, ) @@ -1089,7 +1108,7 @@ ifelse([$3], , , [test -n "[$]$1" || $1="$3" ])])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) @@ -1100,7 +1119,7 @@ ifelse([$3], , , [test -n "[$]$1" || $1="$3" 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 @@ -1129,7 +1148,7 @@ undefine(AC_CV_NAME)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 @@ -1140,17 +1159,15 @@ 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} < conftest.${ac_ext} < conftest.${ac_ext} <>)dnl dnl The name to #define. define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl @@ -1352,7 +1366,7 @@ undefine(AC_CV_NAME)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 @@ -1367,7 +1381,7 @@ dnl ### The big finish 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 @@ -1401,8 +1415,8 @@ ifdef([AC_LIST_HEADERS], [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 @@ -1410,7 +1424,7 @@ ac_vpsub='$ac_vpsub' 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 @@ -1546,7 +1560,7 @@ dnl 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. @@ -1661,7 +1675,7 @@ rm -f conftest.sed ])dnl dnl -define(AC_OUTPUT_LINKS, +AC_DEFUN(AC_OUTPUT_LINKS, [ac_links="$1" ac_files="$2" while test -n "${ac_files}"; do @@ -1683,7 +1697,7 @@ 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. diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index e5827018..8c70890b 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -28,9 +28,8 @@ dnl Check whether to use -n, \c, or newline-tab to separate 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=' ' @@ -39,11 +38,11 @@ if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then 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) @@ -62,9 +61,8 @@ AC_MSG_RESULT($ac_cv_prog_gcc) 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. @@ -82,7 +80,7 @@ fi])dnl 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 @@ -106,7 +104,7 @@ Autoconf TCGETA' 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 @@ -145,7 +143,7 @@ fi ])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, @@ -173,15 +171,17 @@ fi 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 @@ -201,9 +201,8 @@ AC_MSG_RESULT($CPP) 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 @@ -220,12 +219,11 @@ AC_SUBST(CXXCPP)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 @@ -237,7 +235,7 @@ fi 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) @@ -271,7 +269,7 @@ fi 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, @@ -331,7 +329,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' 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 @@ -351,7 +349,7 @@ fi 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 @@ -379,7 +377,7 @@ dnl 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, @@ -412,13 +410,14 @@ fi])dnl 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]) @@ -428,16 +427,17 @@ dnl dnl dnl If memchr and the like aren't declared in , include . 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 ], @@ -455,9 +455,8 @@ sys/sysmacros.h) AC_DEFINE(MAJOR_IN_SYSMACROS) ;; 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 @@ -488,9 +487,8 @@ fi ])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 @@ -519,7 +517,7 @@ if test $ac_cv_func_closedir_void = yes; then 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 @@ -551,7 +549,7 @@ if test $ac_cv_header_stat_broken = yes; then 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 @@ -571,7 +569,7 @@ dnl 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, @@ -604,9 +602,8 @@ AC_MSG_RESULT($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 @@ -617,20 +614,21 @@ if test $ac_cv_type_uid_t = no; then 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 #include @@ -647,7 +645,7 @@ dnl 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. */ @@ -723,14 +721,14 @@ if test $ac_cv_func_mmap = yes; then 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) @@ -842,7 +840,7 @@ if test $ac_cv_func_vfork = no; then 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 @@ -878,7 +876,7 @@ if test $ac_cv_func_wait3 = yes; then 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]) @@ -963,7 +961,7 @@ fi 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 @@ -1059,7 +1057,7 @@ fi 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 @@ -1079,7 +1077,7 @@ if test $ac_cv_func_utime_null = yes; then 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 @@ -1095,7 +1093,7 @@ if test $ac_cv_func_strcoll = yes; then 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 @@ -1120,9 +1118,8 @@ dnl 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 #include ], @@ -1134,7 +1131,7 @@ if test $ac_cv_struct_tm = sys/time.h; then 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 @@ -1147,7 +1144,7 @@ if test $ac_cv_header_time = yes; then 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, @@ -1173,7 +1170,7 @@ extern char *tzname[]; /* RS6000 and others reject char **tzname. */ 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 @@ -1188,7 +1185,7 @@ fi 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 @@ -1200,7 +1197,7 @@ if test $ac_cv_struct_st_blksize = yes; then 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 @@ -1216,9 +1213,8 @@ dnl 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 @@ -1226,7 +1222,7 @@ cross_compiling=$ac_cv_c_cross 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, @@ -1245,7 +1241,7 @@ if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then 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, @@ -1265,7 +1261,7 @@ if test $ac_cv_c_long_double = yes; then 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); }], @@ -1273,7 +1269,7 @@ 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); }], @@ -1281,7 +1277,7 @@ 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 () { @@ -1300,7 +1296,7 @@ if test $ac_cv_c_bigendian = yes; then 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() { @@ -1321,7 +1317,7 @@ if test $ac_cv_c_arg_array = no; then 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, @@ -1335,7 +1331,7 @@ if test $ac_cv_c_inline = no; then 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]) @@ -1392,7 +1388,8 @@ dnl 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 @@ -1414,10 +1411,10 @@ ifelse([$2], , , [else ])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 @@ -1430,7 +1427,7 @@ fi 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 @@ -1461,7 +1458,7 @@ if test $ac_cv_sys_long_file_names = yes; then 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( @@ -1486,9 +1483,8 @@ if test $ac_cv_sys_restartable_syscalls = yes; then 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 @@ -1525,7 +1521,7 @@ fi # No --with-x=no. ])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 @@ -1559,7 +1555,7 @@ fi ])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 @@ -1658,7 +1654,7 @@ do 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) @@ -1715,10 +1711,9 @@ dnl ### Checks for UNIX variants 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 @@ -1727,10 +1722,9 @@ AC_EGREP_CPP(yes, ], [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 @@ -1740,11 +1734,9 @@ 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 @@ -1763,14 +1755,14 @@ else 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 @@ -1780,14 +1772,14 @@ if test "$XENIX" = yes; then 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