+2000-03-29 Akim Demaille <akim@epita.fr>
+
+ Rewrite the autoheader chain on top of `autoconf --trace'.
+
+ * autoheader.m4: Dispatch the prototypes next to there AC_
+ siblings.
+ (AH_TEMPLATE, AH_VERBATIM): Move to...
+ * acgeneral.m4: here.
+ (AH_OUTPUT): New macro.
+ * autoheader.sh: Run `autoconf --trace' instead of `m4 autoheader.m4'.
+ * autoheader.m4: Remove.
+ * Makefile.am: Adjust.
+ * tests/tools.m4 (AH_DEFUN): Remove, no longer makes sense.
+ * tests/actests.m4 (autoheader::AC_TATOOINE): Remove, was used by
+ the test above.
+
2000-03-29 Akim Demaille <akim@epita.fr>
silent.m4 depends upon the current quotation in m4, which changes
distpkgdataDATA = \
acfunctions acheaders acidentifiers acmakevars acprograms \
-libm4.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoconf.m4 autoheader.m4 \
+libm4.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoconf.m4 \
autoupdate.m4 aclang.m4
-nodistpkgdataDATA = autoconf.m4f autoheader.m4f autoupdate.m4f acversion.m4
+nodistpkgdataDATA = autoconf.m4f autoupdate.m4f acversion.m4
pkgdata_DATA = $(distpkgdataDATA) $(nodistpkgdataDATA)
# Files that should be removed, but which Automake does not know:
# the frozen files and the scripts.
-CLEANFILES = autoconf.m4f autoheader.m4f autoupdate.m4f \
+CLEANFILES = autoconf.m4f autoupdate.m4f \
$(bin_SCRIPTS)
# INSTALL is a special case. Automake seems to have a single name space
aclang.m4
autoconf.m4f: autoconf.m4 $(common)
-autoheader.m4f: autoheader.m4 $(common)
autoupdate.m4f: autoupdate.m4 $(common)
# s/nodistpackageDATA/nodist_pkgdata_DATA/
# and adapt dependencies once we use a more recent Automake
-distpkgdataDATA = acfunctions acheaders acidentifiers acmakevars acprograms libm4.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoconf.m4 autoheader.m4 autoupdate.m4 aclang.m4
+distpkgdataDATA = acfunctions acheaders acidentifiers acmakevars acprograms libm4.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoconf.m4 autoupdate.m4 aclang.m4
-nodistpkgdataDATA = autoconf.m4f autoheader.m4f autoupdate.m4f acversion.m4
+nodistpkgdataDATA = autoconf.m4f autoupdate.m4f acversion.m4
pkgdata_DATA = $(distpkgdataDATA) $(nodistpkgdataDATA)
# Files that should be removed, but which Automake does not know:
# the frozen files and the scripts.
-CLEANFILES = autoconf.m4f autoheader.m4f autoupdate.m4f $(bin_SCRIPTS)
+CLEANFILES = autoconf.m4f autoupdate.m4f $(bin_SCRIPTS)
# The scripts.
esac
autoconf.m4f: autoconf.m4 $(common)
-autoheader.m4f: autoheader.m4 $(common)
autoupdate.m4f: autoupdate.m4 $(common)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
+## ------------------------- ##
+## Interface to autoheader. ##
+## ------------------------- ##
+
+
+# AH_OUTPUT(TEXT)
+# ---------------
+# Pass TEXT to autoheader.
+# This macro is `read' only via `autoconf --trace', it outputs nothing.
+define([AH_OUTPUT], [])
+
+
+# AH_VERBATIM(KEY, TEMPLATE)
+# --------------------------
+# If KEY is direct (i.e., no indirection such as in KEY=$my_func which
+# may occur if there is AC_CHECK_FUNCS($my_func)), issue an autoheader
+# TEMPLATE associated to the KEY. Otherwise, do nothing. TEMPLATE is
+# output as is, with no formating.
+define([AH_VERBATIM],
+[AC_VAR_IF_INDIR([$1],,
+[#
+AH_OUTPUT(ac_verbatim_$1="\
+_AC_SH_QUOTE([$2])"
+)
+])])
+
+
+# AH_TEMPLATE(KEY, DESCRIPTION)
+# -----------------------------
+# Issue an autoheader template for KEY, i.e., a comment composed of
+# DESCRIPTION (properly wrapped), and then #undef KEY.
+define([AH_TEMPLATE],
+[AH_VERBATIM([$1],
+ m4_wrap([$2 */], [ ], [/* ])[
+#undef $1])])
+
+
+
## --------------------- ##
## Some /bin/sh idioms. ##
## --------------------- ##
# and if VARIABLE is affected the same VALUE, do nothing, else
# die. The third argument is used by autoheader.
define(AC_DEFINE,
-[cat >>confdefs.h <<\EOF
+[ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
+cat >>confdefs.h <<\EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
# ----------------------------------------------------
# Similar, but perform shell substitutions $ ` \ once on VALUE.
define(AC_DEFINE_UNQUOTED,
-[cat >>confdefs.h <<EOF
+[ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
+cat >>confdefs.h <<EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
AC_DEFUN(AC_CHECK_MEMBERS,
[m4_foreach([AC_Member], [$1],
[AC_SPECIALIZE([AC_CHECK_MEMBER], AC_Member,
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member))
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member), 1,
+ [Define if `]patsubst(AC_Member, [.*\.])[' is
+ member of `]patsubst(AC_Member, [\.[^.]*])['.])
$2],
[$3],
[$4])])])
# whatever the FUNCTION, in addition to not being a *S macro. Note
# that the cache does depend upon the function we are looking for.
AC_DEFUN(AC_CHECK_LIB,
-[AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
+[AH_CHECK_LIB([$1])dnl
+AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
[ac_save_LIBS="$LIBS"
LIBS="-l$1 $5 $LIBS"
LIBS="$ac_save_LIBS"])
AC_SHELL_IFELSE([test AC_VAR_GET(ac_Lib) = yes],
[m4_default([$3],
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
LIBS="-l$1 $LIBS"
])],
[$4])dnl
])# AC_CHECK_LIB
+# AH_CHECK_LIB(LIBNAME)
+# ---------------------
+# FIXME: To be rigorous, this should not be systematic: depending
+# upon the arguments of AC_CHECK_LIB, we might not AC_DEFINE.
+define([AH_CHECK_LIB],
+[AH_TEMPLATE(AC_TR_CPP(HAVE_LIB$1),
+ [Define if you have the `]$1[' library (-l]$1[).])])
+
# AC_HAVE_LIBRARY(LIBRARY,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
])# AC_CHECK_HEADER
+define(AH_CHECK_HEADERS,
+[AC_FOREACH([AC_Header], [$1],
+ [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Header),
+ [Define if you have the <]AC_Header[> header file.])])])
+
# AC_CHECK_HEADERS(HEADER-FILE...
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ----------------------------------------------------------
AC_DEFUN(AC_CHECK_HEADERS,
-[for ac_header in $1
+[AH_CHECK_HEADERS([$1])dnl
+for ac_header in $1
do
AC_CHECK_HEADER($ac_header,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_header)) $2],
AC_DEFUN(AC_CHECK_FILES,
[AC_FOREACH([AC_FILE_NAME], [$1],
[AC_SPECIALIZE([AC_CHECK_FILE], AC_FILE_NAME,
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_FILE_NAME))
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_FILE_NAME), 1,
+ [Define if you have the file `]AC_File['.])
$2],
[$3])])])
AC_DEFUN([AC_CHECK_DECLS],
[m4_foreach([AC_Symbol], [$1],
[AC_SPECIALIZE([AC_CHECK_DECL], AC_Symbol,
- [AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_DECL_]AC_Symbol), 1)
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_DECL_]AC_Symbol), 1,
+ [Define to 1 if you have the declaration
+ of `]AC_Symbol[', and to 0 if you don't.])
$2],
[AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_DECL_]AC_Symbol), 0)
$3],
# FIXME: Should we die if there are not enough arguments, or just
# ignore?
AC_DEFUN(AC_CHECK_FUNCS,
-[for ac_func in $1
+[AC_FOREACH([AC_Func], [$1],
+ [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Func),
+ [Define if you have the `]AC_Func[' function.])])dnl
+for ac_func in $1
do
AC_CHECK_FUNC($ac_func,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_func)) $2],
AC_VAR_SET(ac_Sizeof, `cat conftestval`),
AC_VAR_SET(ac_Sizeof, 0),
ifval([$2], AC_VAR_SET(ac_Sizeof, $2)))])
-AC_DEFINE_UNQUOTED(AC_TR_CPP(sizeof_$1), AC_VAR_GET(ac_Sizeof))
+AC_DEFINE_UNQUOTED(AC_TR_CPP(sizeof_$1),
+ AC_VAR_GET(ac_Sizeof),
+ [The number of bytes in a `]$1['.])
AC_VAR_POPDEF([ac_Sizeof])dnl
])
AC_DEFUN([AC_CHECK_TYPES],
[m4_foreach([AC_Type], [$1],
[AC_SPECIALIZE([_AC_CHECK_TYPE_NEW], AC_Type,
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Type))
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Type), 1,
+ [Define if the system has the type
+ `]AC_Type['.])
$2],
[$3],
[$4])])])
# have to clean this up.
AC_DEFUN([_AC_CHECK_TYPE_OLD],
[_AC_CHECK_TYPE_NEW([$1],,
- [AC_DEFINE_UNQUOTED([$1], [$2])])dnl
+ [AC_DEFINE_UNQUOTED([$1], [$2],
+ [Define to `$2' if <sys/types.h> does not define.])])dnl
])# _AC_CHECK_TYPE_OLD
# AC_C_CHAR_UNSIGNED
# ------------------
AC_DEFUN(AC_C_CHAR_UNSIGNED,
-[AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
+[AH_VERBATIM([__CHAR_UNSIGNED__],
+[/* Define if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif])dnl
+AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
[if test "$GCC" = yes; then
# GCC predefines this symbol on systems where it applies.
AC_EGREP_CPP(yes,
# underscores, respectively, so that they match the name mangling
# scheme used by the Fortran 77 compiler.
AC_DEFUN(AC_F77_WRAPPERS,
-[AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
+[AH_TEMPLATE([F77_FUNC],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does not* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])dnl
+AH_TEMPLATE([F77_FUNC_],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])dnl
+AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
ac_cv_f77_wrappers,
[# Be optimistic at first.
ac_cv_f77_wrappers="yes"
# AC_PROG_LEX
# -----------
AC_DEFUN(AC_PROG_LEX,
-[AC_CHECK_PROG(LEX, flex, flex, lex)
+[AH_CHECK_LIB(fl)dnl
+AH_CHECK_LIB(l)dnl
+AC_CHECK_PROG(LEX, flex, flex, lex)
if test -z "$LEXLIB"
then
case "$LEX" in
# Like AC_CHECK_HEADERS, except succeed only for a HEADER-FILE that
# defines `DIR'.
define(_AC_CHECK_HEADERS_DIRENT,
-[for ac_hdr in $1
+[AH_CHECK_HEADERS([$1])dnl
+for ac_hdr in $1
do
_AC_CHECK_HEADER_DIRENT($ac_hdr,
[changequote(, )dnl
# AC_FUNC_ALLOCA
# --------------
AC_DEFUN(AC_FUNC_ALLOCA,
-[AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
+[AH_VERBATIM([STACK_DIRECTION],
+[/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+@%:@undef STACK_DIRECTION])dnl
+AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
AC_CACHE_CHECK([for working alloca.h], ac_cv_working_alloca_h,
# AC_AIX
# ------
AC_DEFUN(AC_AIX,
-[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
+[AH_VERBATIM([_ALL_SOURCE],
+[/* Define if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif])dnl
+AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes,
# would break.
ac_LF_and_DOT=`echo; echo .`
-# Find GNU m4.
-# Handle the case that m4 has moved since we were configured.
-# It may have been found originally in a build directory.
-: ${M4=@M4@}
-case "$M4" in
-/*) test -f "$M4" || M4=m4 ;;
-esac
-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
-case `$M4 --help </dev/null 2>&1` in
-*reload-state*);;
-*) echo "$me: Autoconf requires GNU m4 1.4 or later" >&2; exit 1 ;;
-esac
-
# Variables.
: ${AC_MACRODIR=@datadir@}
debug=false
esac
done
-# Running m4.
-test -n "$localdir" && use_localdir="-I$localdir"
-run_m4="$M4 $use_localdir -I $AC_MACRODIR autoheader.m4"
-run_m4f="$M4 $use_localdir --reload $AC_MACRODIR/autoheader.m4f"
-
acconfigs=
test -r $localdir/acconfig.h && acconfigs="$acconfigs $localdir/acconfig.h"
config_h=
syms=
-# Extract assignments of `ah_verbatim_SYMBOL' from the modified
-# autoconf processing of the input file. The sed hair is necessary to
-# win for multi-line macro invocations.
-$run_m4f $infile >$tmpbase.exp
-sed -n -e '
- : again
- /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
- /^@@@/{
- s/^@@@//p
- n
- s/^/@@@/
- b again
- }' $tmpbase.exp >$tmpbase.decls
+# Source what the traces are trying to tell us.
+autoconf=`echo "$0" | sed -e 's/autoheader$/autoconf/'`
+test -n "$localdir" && autoconf="$autoconf -l $localdir"
+export AC_MACRODIR
+$autoconf --trace AH_OUTPUT:'$1' --trace AC_CONFIG_HEADERS:'config_h="$1"' \
+ $infile >$tmpbase.decls
. $tmpbase.decls
-$debug || rm -f $tmpbase.exp $tmpbase.decls
+$debug || rm -f $tmpbase.decls
# Make SYMS newline-separated rather than blank-separated, and remove dups.
# Start each symbol with a blank (to match the blank after "#undef")
# is a substring of it.
syms=`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`
+
+# We template only the first CONFIG_HEADER.
+config_h=`echo "$config_h" | sed -e 's/ .*//'`
# Support "outfile[:infile]", defaulting infile="outfile.in".
case "$config_h" in
"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;;
*) config_h_in="$config_h.in" ;;
esac
+
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
cat <<EOF >$tmpout
+++ /dev/null
-include(libm4.m4)# -*- Autoconf -*-
-# This file is part of Autoconf.
-# Driver and redefinitions of some Autoconf macros for autoheader.
-# Copyright (C) 1994, 95, 99, 2000 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-# Originally written by Roland McGrath.
-#
-# Do not sinclude acsite.m4 here, because it may not be installed
-# yet when Autoconf is frozen.
-# Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
-m4_include(acversion.m4)
-m4_include(acgeneral.m4)
-m4_include(aclang.m4)
-m4_include(acspecific.m4)
-m4_include(acoldnames.m4)
-m4_namespace_push(autoheader)
-
-
-# AH_DEFUN(MACRO, VALUE)
-# ----------------------
-#
-# Assign VALUE *and* the current value of MACRO to MACRO, in the
-# namespace `autoheader'. We enter the namespace `autoheader' when
-# running autoheader.
-#
-# There are several motivations for not just defining to be equivalent to
-# AUTOHEADER-NAME.
-#
-# Let autoconf::AC_FOO (abbreviated AC_FOO below) be
-# | AC_DEFINE(FOO, 1)
-# | AC_DEFINE(BAR, 1)
-# | AC_DEFINE(BAZ, 1, The value of BAZ.)
-# Let autoheader::AC_FOO (abbreviated AH_FOO below) be
-# | AH_TEMPLATE(FOO, The value of FOO.)
-#
-# If we hook AC_FOO to be AH_FOO only, then only FOO will be templated.
-# If we hook AC_FOO to expand in both the former AC_FOO and AH_FOO, then
-# both FOO and BAZ are templated.
-#
-# Additionaly, if AC_FOO is hooked to AH_FOO only, then we loose track
-# of the other AC_DEFINE, and the autoheader machinery (see the use of
-# the shell variable SYMS in AC_TEMPLATE) won't be able to see that BAR
-# is not templated at all. Hooking AC_FOO on both its AC_ and AH_ faces
-# makes sure we keep track of non templated DEFINEs.
-#
-#
-# Finally, if AC_FOO requires a macro which AC_DEFINEs a symbol,
-# then, if we used AH_FOO only, the required macro would not be
-# expanded, thus its symbols would not be prototyped.
-define(AH_DEFUN,
-[m4_namespace_define(autoheader, [$1],
-defn([$1])
-[$2])])
-
-# The definition of `AH_DEFUN' above is used for accumulating the
-# definitions before entering the `autoheader' namespace. Once we
-# enter the autoheader::, `AH_DEFUN' must be understood as immediatly
-# defining. This happens when we read user m4 files.
-m4_define([autoheader::AH_DEFUN],
-defn([m4_define]))
-m4_namespace_register([AH_DEFUN], [autoheader])
-
-
-
-# These are alternate definitions of some macros, which produce
-# strings in the output marked with "@@@" so we can easily extract
-# the information we want. The `#' at the end of the first line of
-# each definition seems to be necessary to prevent m4 from eating
-# the newline, which makes the @@@ not always be at the beginning of
-# a line.
-
-
-# Autoheader is not the right program to complain about cross-compiling.
-AH_DEFUN([AC_TRY_RUN],
-[$2
-$3
-$4])
-
-
-# AH_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
-# -------------------------------------------
-# When running autoheader, this macro replaces AC_DEFINE and
-# AC_DEFINE_UNQUOTED.
-#
-# If DESCRIPTION is not given, then there is a risk that VARIABLE will
-# not be properly templated. To control later that it has been
-# templated elsewhere, store VARIABLE in a shell growing string, SYMS.
-AH_DEFUN([AH_DEFINE],
-[ifval([$3],
- [AH_TEMPLATE([$1], [$3])],
- [#
-dnl Ignore CPP macro arguments.
-@@@syms="$syms patsubst($1, [(.*$])"@@@
-])])
-
-AH_DEFUN([AC_DEFINE], [AH_DEFINE($@)])
-AH_DEFUN([AC_DEFINE_UNQUOTED], [AH_DEFINE($@)])
-
-
-# AH_TEMPLATE(KEY, DESCRIPTION)
-# -----------------------------
-# Issue an autoheader template for KEY, i.e., a comment composed
-# of DESCRIPTION (properly wrapped), and then #undef KEY.
-AH_DEFUN([AH_TEMPLATE],
-[AH_VERBATIM([$1],
- m4_wrap([$2 */], [ ], [/* ])[
-#undef $1])])
-
-
-# AH_VERBATIM(KEY, TEMPLATE)
-# --------------------------
-# If KEY is direct (i.e., no indirection such as in KEY=$my_func which may
-# occur if there is AC_CHECK_FUNCS($my_func)), issue an autoheader TEMPLATE
-# associated to the KEY. Otherwise, do nothing.
-# TEMPLATE is output as is, with no formating.
-AH_DEFUN([AH_VERBATIM],
-[AC_VAR_IF_INDIR([$1],,
-[#
-@@@
-ac_verbatim_$1="\
-_AC_SH_QUOTE([$2])"
-@@@
-])])
-
-# FIXME: To be rigorous, this should not be systematic: depending
-# upon the arguments of AC_CHECK_LIB, we might not AC_DEFINE.
-AH_DEFUN([AC_CHECK_LIB],
-[AH_TEMPLATE(AC_TR_CPP(HAVE_LIB$1),
- [Define if you have the `]$1[' library (-l]$1[).])
-# Success
-$3
-# Failure
-$4])
-
-AH_DEFUN([AH_CHECK_HEADERS],
-[AC_FOREACH([AC_Header], [$1],
- [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Header),
- [Define if you have the <]AC_Header[> header file.])
- # Success
- $2
- # Failure
- $3])])
-
-AH_DEFUN([AC_CHECK_HEADERS], [AH_CHECK_HEADERS($@)])
-AH_DEFUN([_AC_CHECK_HEADERS_DIRENT], [AH_CHECK_HEADERS($@)])
-
-
-AH_DEFUN([AC_CHECK_FILES],
-[AC_FOREACH([AC_File], [$1],
- [AH_TEMPLATE(AC_TR_CPP([HAVE_]AC_File),
- [Define if you have the file `]AC_File['.])
- # Success
- $2
- # Failure
- $3])])
-
-
-AH_DEFUN([AC_CHECK_DECLS],
-[m4_foreach([AC_Symbol], [$1],
- [AH_TEMPLATE(AC_TR_CPP([HAVE_DECL_]AC_Symbol),
- [Define to 1 if you have the declaration of `]AC_Symbol[',
- and to 0 if you don't.])
- # Success
- $2
- # Failure
- $3])])
-
-
-AH_DEFUN([AC_CHECK_FUNCS],
-[AC_FOREACH([AC_Func], [$1],
- [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Func),
- [Define if you have the `]AC_Func[' function.])
- # Success
- $2
- # Failure
- $3])
-])
-
-AH_DEFUN([AC_CHECK_SIZEOF],
-[AH_TEMPLATE(AC_TR_CPP(SIZEOF_$1),
- [The number of bytes in a `]$1['.])])
-
-
-AH_DEFUN([AC_PROG_LEX],
-[AC_CHECK_LIB(fl)
-AC_CHECK_LIB(l)])
-
-
-AH_DEFUN([AC_CHECK_MEMBERS],
-[m4_foreach([AC_Member], [$1],
- [pushdef(AC_Member_Aggregate, [patsubst(AC_Member, [\.[^.]*])])
- pushdef(AC_Member_Member, [patsubst(AC_Member, [.*\.])])
- AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Member),
- [Define if `]AC_Member_Member[' is member of]
- [`]AC_Member_Aggregate['.])
- popdef([AC_Member_Member])
- popdef([AC_Member_Aggregate])
- # Success
- $2
- # Failure
- $3])
-])
-
-
-# _AC_CHECK_TYPE_OLD(TYPE, DEFAULT)
-# ---------------------------------
-AH_DEFUN([_AC_CHECK_TYPE_OLD],
-[AH_TEMPLATE([$1], [Define to `$2' if <sys/types.h> does not define.])])
-
-
-# AC_FUNC_ALLOCA
-# --------------
-AH_DEFUN([AC_FUNC_ALLOCA],
-[AH_VERBATIM([STACK_DIRECTION],
-[/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION])
-])dnl AH_FUNC_ALLOCA
-
-
-# AH_CHECK_TYPES((TYPES, ...))
-# ----------------------------
-AH_DEFUN([AC_CHECK_TYPES],
-[m4_foreach([AC_Type], [$1],
- [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Type),
- [Define if the system has the type `]AC_Type['.])
- # Success
- $2
- # Failure
- $3])
-])
-
-
-AH_DEFUN([AC_C_CHAR_UNSIGNED],
-[AH_VERBATIM([__CHAR_UNSIGNED__],
-[/* Define if type `char' is unsigned and you are not using gcc. */
-#ifndef __CHAR_UNSIGNED__
-# undef __CHAR_UNSIGNED__
-#endif])
-])
-
-
-AH_DEFUN([AC_AIX],
-[AH_VERBATIM([_ALL_SOURCE],
-[/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif])
-])
-
-
-AH_DEFUN([AC_F77_WRAPPERS],
-[AH_TEMPLATE([F77_FUNC],
- [Define to a macro that performs the appropriate name
- mangling on its argument to make the C identifier, which
- *does not* contain underscores, match the name mangling
- scheme of the Fortran 77 compiler.])
-AH_TEMPLATE([F77_FUNC_],
- [Define to a macro that performs the appropriate name
- mangling on its argument to make the C identifier, which
- *does* contain underscores, match the name mangling
- scheme of the Fortran 77 compiler.])])
-
-
-AH_DEFUN([AC_CONFIG_HEADERS],
-[@@@config_h=patsubst($1, [ .*$], [])@@@
-])
-
-# Enter the `autoheader' name space
-m4_enable(autoheader)
# would break.
ac_LF_and_DOT=`echo; echo .`
-# Find GNU m4.
-# Handle the case that m4 has moved since we were configured.
-# It may have been found originally in a build directory.
-: ${M4=@M4@}
-case "$M4" in
-/*) test -f "$M4" || M4=m4 ;;
-esac
-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
-case `$M4 --help </dev/null 2>&1` in
-*reload-state*);;
-*) echo "$me: Autoconf requires GNU m4 1.4 or later" >&2; exit 1 ;;
-esac
-
# Variables.
: ${AC_MACRODIR=@datadir@}
debug=false
esac
done
-# Running m4.
-test -n "$localdir" && use_localdir="-I$localdir"
-run_m4="$M4 $use_localdir -I $AC_MACRODIR autoheader.m4"
-run_m4f="$M4 $use_localdir --reload $AC_MACRODIR/autoheader.m4f"
-
acconfigs=
test -r $localdir/acconfig.h && acconfigs="$acconfigs $localdir/acconfig.h"
config_h=
syms=
-# Extract assignments of `ah_verbatim_SYMBOL' from the modified
-# autoconf processing of the input file. The sed hair is necessary to
-# win for multi-line macro invocations.
-$run_m4f $infile >$tmpbase.exp
-sed -n -e '
- : again
- /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
- /^@@@/{
- s/^@@@//p
- n
- s/^/@@@/
- b again
- }' $tmpbase.exp >$tmpbase.decls
+# Source what the traces are trying to tell us.
+autoconf=`echo "$0" | sed -e 's/autoheader$/autoconf/'`
+test -n "$localdir" && autoconf="$autoconf -l $localdir"
+export AC_MACRODIR
+$autoconf --trace AH_OUTPUT:'$1' --trace AC_CONFIG_HEADERS:'config_h="$1"' \
+ $infile >$tmpbase.decls
. $tmpbase.decls
-$debug || rm -f $tmpbase.exp $tmpbase.decls
+$debug || rm -f $tmpbase.decls
# Make SYMS newline-separated rather than blank-separated, and remove dups.
# Start each symbol with a blank (to match the blank after "#undef")
# is a substring of it.
syms=`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`
+
+# We template only the first CONFIG_HEADER.
+config_h=`echo "$config_h" | sed -e 's/ .*//'`
# Support "outfile[:infile]", defaulting infile="outfile.in".
case "$config_h" in
"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;;
*) config_h_in="$config_h.in" ;;
esac
+
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
cat <<EOF >$tmpout
# would break.
ac_LF_and_DOT=`echo; echo .`
-# Find GNU m4.
-# Handle the case that m4 has moved since we were configured.
-# It may have been found originally in a build directory.
-: ${M4=@M4@}
-case "$M4" in
-/*) test -f "$M4" || M4=m4 ;;
-esac
-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
-case `$M4 --help </dev/null 2>&1` in
-*reload-state*);;
-*) echo "$me: Autoconf requires GNU m4 1.4 or later" >&2; exit 1 ;;
-esac
-
# Variables.
: ${AC_MACRODIR=@datadir@}
debug=false
esac
done
-# Running m4.
-test -n "$localdir" && use_localdir="-I$localdir"
-run_m4="$M4 $use_localdir -I $AC_MACRODIR autoheader.m4"
-run_m4f="$M4 $use_localdir --reload $AC_MACRODIR/autoheader.m4f"
-
acconfigs=
test -r $localdir/acconfig.h && acconfigs="$acconfigs $localdir/acconfig.h"
config_h=
syms=
-# Extract assignments of `ah_verbatim_SYMBOL' from the modified
-# autoconf processing of the input file. The sed hair is necessary to
-# win for multi-line macro invocations.
-$run_m4f $infile >$tmpbase.exp
-sed -n -e '
- : again
- /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
- /^@@@/{
- s/^@@@//p
- n
- s/^/@@@/
- b again
- }' $tmpbase.exp >$tmpbase.decls
+# Source what the traces are trying to tell us.
+autoconf=`echo "$0" | sed -e 's/autoheader$/autoconf/'`
+test -n "$localdir" && autoconf="$autoconf -l $localdir"
+export AC_MACRODIR
+$autoconf --trace AH_OUTPUT:'$1' --trace AC_CONFIG_HEADERS:'config_h="$1"' \
+ $infile >$tmpbase.decls
. $tmpbase.decls
-$debug || rm -f $tmpbase.exp $tmpbase.decls
+$debug || rm -f $tmpbase.decls
# Make SYMS newline-separated rather than blank-separated, and remove dups.
# Start each symbol with a blank (to match the blank after "#undef")
# is a substring of it.
syms=`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`
+
+# We template only the first CONFIG_HEADER.
+config_h=`echo "$config_h" | sed -e 's/ .*//'`
# Support "outfile[:infile]", defaulting infile="outfile.in".
case "$config_h" in
"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;;
*) config_h_in="$config_h.in" ;;
esac
+
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
cat <<EOF >$tmpout
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
fi
+#
+
cat >>confdefs.h <<EOF
#define PACKAGE "$PACKAGE"
EOF
+#
+
cat >>confdefs.h <<EOF
#define VERSION "$VERSION"
EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ECHO_N "checking for working aclocal... $ECHO_C" 1>&6
-echo "configure:738: checking for working aclocal" 1>&5
+echo "configure:740: checking for working aclocal" 1>&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ECHO_N "checking for working autoconf... $ECHO_C" 1>&6
-echo "configure:750: checking for working autoconf" 1>&5
+echo "configure:752: checking for working autoconf" 1>&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ECHO_N "checking for working automake... $ECHO_C" 1>&6
-echo "configure:762: checking for working automake" 1>&5
+echo "configure:764: checking for working automake" 1>&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ECHO_N "checking for working autoheader... $ECHO_C" 1>&6
-echo "configure:774: checking for working autoheader" 1>&5
+echo "configure:776: checking for working autoheader" 1>&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ECHO_N "checking for working makeinfo... $ECHO_C" 1>&6
-echo "configure:786: checking for working makeinfo" 1>&5
+echo "configure:788: checking for working makeinfo" 1>&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
-echo "configure:803: checking for $ac_word" 1>&5
+echo "configure:805: checking for $ac_word" 1>&5
if test "${ac_cv_path_M4+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6
else
test -n "$M4" || M4="m4"
echo $ECHO_N "checking whether m4 supports frozen files... $ECHO_C" 1>&6
-echo "configure:835: checking whether m4 supports frozen files" 1>&5
+echo "configure:837: checking whether m4 supports frozen files" 1>&5
if test "${ac_cv_prog_gnu_m4+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
-echo "configure:855: checking for $ac_word" 1>&5
+echo "configure:857: checking for $ac_word" 1>&5
if test "${ac_cv_prog_AWK+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6
else
done
echo $ECHO_N "checking for working help2man... $ECHO_C" 1>&6
-echo "configure:886: checking for working help2man" 1>&5
+echo "configure:888: checking for working help2man" 1>&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
-echo "configure:900: checking for $ac_word" 1>&5
+echo "configure:902: checking for $ac_word" 1>&5
if test "${ac_cv_path_PERL+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6
else
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" 1>&6
-echo "configure:946: checking for a BSD compatible install" 1>&5
+echo "configure:948: checking for a BSD compatible install" 1>&5
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" 1>&6
# AC_C_CHAR_UNSIGNED
# ------------------
AC_DEFUN(AC_C_CHAR_UNSIGNED,
-[AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
+[AH_VERBATIM([__CHAR_UNSIGNED__],
+[/* Define if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif])dnl
+AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
[if test "$GCC" = yes; then
# GCC predefines this symbol on systems where it applies.
AC_EGREP_CPP(yes,
# underscores, respectively, so that they match the name mangling
# scheme used by the Fortran 77 compiler.
AC_DEFUN(AC_F77_WRAPPERS,
-[AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
+[AH_TEMPLATE([F77_FUNC],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does not* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])dnl
+AH_TEMPLATE([F77_FUNC_],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])dnl
+AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
ac_cv_f77_wrappers,
[# Be optimistic at first.
ac_cv_f77_wrappers="yes"
# AC_C_CHAR_UNSIGNED
# ------------------
AC_DEFUN(AC_C_CHAR_UNSIGNED,
-[AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
+[AH_VERBATIM([__CHAR_UNSIGNED__],
+[/* Define if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif])dnl
+AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
[if test "$GCC" = yes; then
# GCC predefines this symbol on systems where it applies.
AC_EGREP_CPP(yes,
# underscores, respectively, so that they match the name mangling
# scheme used by the Fortran 77 compiler.
AC_DEFUN(AC_F77_WRAPPERS,
-[AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
+[AH_TEMPLATE([F77_FUNC],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does not* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])dnl
+AH_TEMPLATE([F77_FUNC_],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])dnl
+AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
ac_cv_f77_wrappers,
[# Be optimistic at first.
ac_cv_f77_wrappers="yes"
+## ------------------------- ##
+## Interface to autoheader. ##
+## ------------------------- ##
+
+
+# AH_OUTPUT(TEXT)
+# ---------------
+# Pass TEXT to autoheader.
+# This macro is `read' only via `autoconf --trace', it outputs nothing.
+define([AH_OUTPUT], [])
+
+
+# AH_VERBATIM(KEY, TEMPLATE)
+# --------------------------
+# If KEY is direct (i.e., no indirection such as in KEY=$my_func which
+# may occur if there is AC_CHECK_FUNCS($my_func)), issue an autoheader
+# TEMPLATE associated to the KEY. Otherwise, do nothing. TEMPLATE is
+# output as is, with no formating.
+define([AH_VERBATIM],
+[AC_VAR_IF_INDIR([$1],,
+[#
+AH_OUTPUT(ac_verbatim_$1="\
+_AC_SH_QUOTE([$2])"
+)
+])])
+
+
+# AH_TEMPLATE(KEY, DESCRIPTION)
+# -----------------------------
+# Issue an autoheader template for KEY, i.e., a comment composed of
+# DESCRIPTION (properly wrapped), and then #undef KEY.
+define([AH_TEMPLATE],
+[AH_VERBATIM([$1],
+ m4_wrap([$2 */], [ ], [/* ])[
+#undef $1])])
+
+
+
## --------------------- ##
## Some /bin/sh idioms. ##
## --------------------- ##
# and if VARIABLE is affected the same VALUE, do nothing, else
# die. The third argument is used by autoheader.
define(AC_DEFINE,
-[cat >>confdefs.h <<\EOF
+[ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
+cat >>confdefs.h <<\EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
# ----------------------------------------------------
# Similar, but perform shell substitutions $ ` \ once on VALUE.
define(AC_DEFINE_UNQUOTED,
-[cat >>confdefs.h <<EOF
+[ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
+cat >>confdefs.h <<EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
AC_DEFUN(AC_CHECK_MEMBERS,
[m4_foreach([AC_Member], [$1],
[AC_SPECIALIZE([AC_CHECK_MEMBER], AC_Member,
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member))
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member), 1,
+ [Define if `]patsubst(AC_Member, [.*\.])[' is
+ member of `]patsubst(AC_Member, [\.[^.]*])['.])
$2],
[$3],
[$4])])])
# whatever the FUNCTION, in addition to not being a *S macro. Note
# that the cache does depend upon the function we are looking for.
AC_DEFUN(AC_CHECK_LIB,
-[AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
+[AH_CHECK_LIB([$1])dnl
+AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
[ac_save_LIBS="$LIBS"
LIBS="-l$1 $5 $LIBS"
LIBS="$ac_save_LIBS"])
AC_SHELL_IFELSE([test AC_VAR_GET(ac_Lib) = yes],
[m4_default([$3],
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
LIBS="-l$1 $LIBS"
])],
[$4])dnl
])# AC_CHECK_LIB
+# AH_CHECK_LIB(LIBNAME)
+# ---------------------
+# FIXME: To be rigorous, this should not be systematic: depending
+# upon the arguments of AC_CHECK_LIB, we might not AC_DEFINE.
+define([AH_CHECK_LIB],
+[AH_TEMPLATE(AC_TR_CPP(HAVE_LIB$1),
+ [Define if you have the `]$1[' library (-l]$1[).])])
+
# AC_HAVE_LIBRARY(LIBRARY,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
])# AC_CHECK_HEADER
+define(AH_CHECK_HEADERS,
+[AC_FOREACH([AC_Header], [$1],
+ [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Header),
+ [Define if you have the <]AC_Header[> header file.])])])
+
# AC_CHECK_HEADERS(HEADER-FILE...
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ----------------------------------------------------------
AC_DEFUN(AC_CHECK_HEADERS,
-[for ac_header in $1
+[AH_CHECK_HEADERS([$1])dnl
+for ac_header in $1
do
AC_CHECK_HEADER($ac_header,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_header)) $2],
AC_DEFUN(AC_CHECK_FILES,
[AC_FOREACH([AC_FILE_NAME], [$1],
[AC_SPECIALIZE([AC_CHECK_FILE], AC_FILE_NAME,
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_FILE_NAME))
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_FILE_NAME), 1,
+ [Define if you have the file `]AC_File['.])
$2],
[$3])])])
AC_DEFUN([AC_CHECK_DECLS],
[m4_foreach([AC_Symbol], [$1],
[AC_SPECIALIZE([AC_CHECK_DECL], AC_Symbol,
- [AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_DECL_]AC_Symbol), 1)
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_DECL_]AC_Symbol), 1,
+ [Define to 1 if you have the declaration
+ of `]AC_Symbol[', and to 0 if you don't.])
$2],
[AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_DECL_]AC_Symbol), 0)
$3],
# FIXME: Should we die if there are not enough arguments, or just
# ignore?
AC_DEFUN(AC_CHECK_FUNCS,
-[for ac_func in $1
+[AC_FOREACH([AC_Func], [$1],
+ [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Func),
+ [Define if you have the `]AC_Func[' function.])])dnl
+for ac_func in $1
do
AC_CHECK_FUNC($ac_func,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_$ac_func)) $2],
AC_VAR_SET(ac_Sizeof, `cat conftestval`),
AC_VAR_SET(ac_Sizeof, 0),
ifval([$2], AC_VAR_SET(ac_Sizeof, $2)))])
-AC_DEFINE_UNQUOTED(AC_TR_CPP(sizeof_$1), AC_VAR_GET(ac_Sizeof))
+AC_DEFINE_UNQUOTED(AC_TR_CPP(sizeof_$1),
+ AC_VAR_GET(ac_Sizeof),
+ [The number of bytes in a `]$1['.])
AC_VAR_POPDEF([ac_Sizeof])dnl
])
AC_DEFUN([AC_CHECK_TYPES],
[m4_foreach([AC_Type], [$1],
[AC_SPECIALIZE([_AC_CHECK_TYPE_NEW], AC_Type,
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Type))
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Type), 1,
+ [Define if the system has the type
+ `]AC_Type['.])
$2],
[$3],
[$4])])])
# have to clean this up.
AC_DEFUN([_AC_CHECK_TYPE_OLD],
[_AC_CHECK_TYPE_NEW([$1],,
- [AC_DEFINE_UNQUOTED([$1], [$2])])dnl
+ [AC_DEFINE_UNQUOTED([$1], [$2],
+ [Define to `$2' if <sys/types.h> does not define.])])dnl
])# _AC_CHECK_TYPE_OLD
# AC_C_CHAR_UNSIGNED
# ------------------
AC_DEFUN(AC_C_CHAR_UNSIGNED,
-[AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
+[AH_VERBATIM([__CHAR_UNSIGNED__],
+[/* Define if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif])dnl
+AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
[if test "$GCC" = yes; then
# GCC predefines this symbol on systems where it applies.
AC_EGREP_CPP(yes,
# underscores, respectively, so that they match the name mangling
# scheme used by the Fortran 77 compiler.
AC_DEFUN(AC_F77_WRAPPERS,
-[AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
+[AH_TEMPLATE([F77_FUNC],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does not* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])dnl
+AH_TEMPLATE([F77_FUNC_],
+ [Define to a macro that performs the appropriate name
+ mangling on its argument to make the C identifier, which
+ *does* contain underscores, match the name mangling
+ scheme of the Fortran 77 compiler.])dnl
+AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
ac_cv_f77_wrappers,
[# Be optimistic at first.
ac_cv_f77_wrappers="yes"
# AC_PROG_LEX
# -----------
AC_DEFUN(AC_PROG_LEX,
-[AC_CHECK_PROG(LEX, flex, flex, lex)
+[AH_CHECK_LIB(fl)dnl
+AH_CHECK_LIB(l)dnl
+AC_CHECK_PROG(LEX, flex, flex, lex)
if test -z "$LEXLIB"
then
case "$LEX" in
# Like AC_CHECK_HEADERS, except succeed only for a HEADER-FILE that
# defines `DIR'.
define(_AC_CHECK_HEADERS_DIRENT,
-[for ac_hdr in $1
+[AH_CHECK_HEADERS([$1])dnl
+for ac_hdr in $1
do
_AC_CHECK_HEADER_DIRENT($ac_hdr,
[changequote(, )dnl
# AC_FUNC_ALLOCA
# --------------
AC_DEFUN(AC_FUNC_ALLOCA,
-[AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
+[AH_VERBATIM([STACK_DIRECTION],
+[/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+@%:@undef STACK_DIRECTION])dnl
+AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
AC_CACHE_CHECK([for working alloca.h], ac_cv_working_alloca_h,
# AC_AIX
# ------
AC_DEFUN(AC_AIX,
-[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
+[AH_VERBATIM([_ALL_SOURCE],
+[/* Define if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif])dnl
+AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
AC_BEFORE([$0], [AC_TRY_RUN])dnl
AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes,
[Define to a long string if your `Autoconf' works
properly.])
AC_SUBST(AC_DUMMY_VAR($1))])
-
-
-# autoheader::AC_TATOOINE
-# -----------------------
-# Template a dummy entries for config header.
-AH_DEFUN(AC_TATOOINE,
-[AH_TEMPLATE(Tatooine, The planet where Luke was raised.)])
-## ---------- ##
-## AH_DEFUN. ##
-## ---------- ##
-
-# We check that both the AH_DEFUN given in auxiliary files and in
-# `configure.in' function properly.
-AT_SETUP(AH_DEFUN)
-
-AT_DATA(configure.in,
-[[AC_INCLUDE(actest.m4)
-AH_DEFUN(AC_ANAKIN,
-[AH_TEMPLATE(Anakin, [The future Darth Vador?])])
-AC_INIT
-AC_TATOOINE
-AC_ANAKIN
-AC_CONFIG_HEADERS(config.h:config.hin)
-AC_OUTPUT
-]])
-
-# Checking `autoheader'.
-AT_CHECK([../autoheader -m .. -l $at_srcdir], 0)
-AT_CHECK([cat config.hin], 0,
-[/* config.hin. Generated automatically from configure.in by autoheader. */
-
-/* The future Darth Vador? */
-#undef Anakin
-
-/* The planet where Luke was raised. */
-#undef Tatooine
-])
-
-AT_CLEANUP(config.hin)
-
-
-
-
## ------------ ##
## autoupdate. ##
## ------------ ##