2000-02-08 02:03:54 +08:00
|
|
|
include(libm4.m4)dnl -*- Autoconf -*-
|
|
|
|
# This file is part of Autoconf.
|
|
|
|
# Driver and redefinitions of some Autoconf macros for autoheader.
|
|
|
|
# Copyright (C) 1994, 1995, 1999 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.
|
|
|
|
#
|
2000-02-08 19:46:51 +08:00
|
|
|
# Originally written by Roland McGrath.
|
2000-02-08 02:03:54 +08:00
|
|
|
#
|
|
|
|
m4_include(acversion.m4)
|
|
|
|
m4_include(acgeneral.m4)
|
|
|
|
m4_include(acspecific.m4)
|
|
|
|
m4_include(acoldnames.m4)
|
|
|
|
|
2000-02-08 19:46:51 +08:00
|
|
|
|
|
|
|
# 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.
|
2000-02-08 02:03:54 +08:00
|
|
|
#
|
|
|
|
# There are several motivations for not just defining to be equivalent to
|
|
|
|
# AUTOHEADER-NAME.
|
|
|
|
#
|
2000-02-08 19:46:51 +08:00
|
|
|
# Let autoconf::AC_FOO (abbreviated AC_FOO below) be
|
2000-02-08 02:03:54 +08:00
|
|
|
# | AC_DEFINE(FOO, 1)
|
|
|
|
# | AC_DEFINE(BAR, 1)
|
|
|
|
# | AC_DEFINE(BAZ, 1, The value of BAZ.)
|
2000-02-08 19:46:51 +08:00
|
|
|
# Let autoheader::AC_FOO (abbreviated AH_FOO below) be
|
2000-02-08 02:03:54 +08:00
|
|
|
# | 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.
|
|
|
|
#
|
2000-02-08 19:46:51 +08:00
|
|
|
#
|
|
|
|
# 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.
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
define(AH_DEFUN,
|
2000-02-08 19:46:51 +08:00
|
|
|
[m4_namespace_define(autoheader, [$1],
|
|
|
|
defn([$1])
|
|
|
|
[$2])])
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
|
|
|
|
|
2000-02-08 02:03:54 +08:00
|
|
|
# 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.
|
1994-09-09 04:42:23 +08:00
|
|
|
|
2000-02-08 19:46:51 +08:00
|
|
|
|
2000-02-08 02:03:54 +08:00
|
|
|
# Autoheader is not the right program to complain about cross-compiling.
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_TRY_RUN],
|
|
|
|
[$2
|
|
|
|
$3
|
|
|
|
$4])
|
|
|
|
|
2000-02-08 19:46:51 +08:00
|
|
|
|
2000-02-08 02:03:54 +08:00
|
|
|
# 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.
|
2000-02-08 19:46:51 +08:00
|
|
|
AH_DEFUN([AH_DEFINE],
|
1999-12-20 21:37:12 +08:00
|
|
|
[ifval([$3],
|
1999-10-30 22:17:20 +08:00
|
|
|
[AH_TEMPLATE([$1], [$3])],
|
|
|
|
[#
|
|
|
|
dnl Ignore CPP macro arguments.
|
|
|
|
@@@syms="$syms patsubst($1, [(.*$])"@@@
|
|
|
|
])])
|
|
|
|
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_DEFINE], [AH_DEFINE($@)])
|
|
|
|
AH_DEFUN([AC_DEFINE_UNQUOTED], [AH_DEFINE($@)])
|
|
|
|
|
|
|
|
|
2000-02-08 02:03:54 +08:00
|
|
|
# AH_TEMPLATE(KEY, DESCRIPTION)
|
|
|
|
# -----------------------------
|
|
|
|
# Issue an autoheader template for KEY, i.e., a comment composed
|
|
|
|
# of DESCRIPTION (properly wrapped), and then #undef KEY.
|
2000-02-08 19:46:51 +08:00
|
|
|
AH_DEFUN([AH_TEMPLATE],
|
1999-10-30 22:17:20 +08:00
|
|
|
[AH_VERBATIM([$1],
|
Create libm4.m4.
* Makefile.am: Adjusted for libm4.m4.
* acgeneral.m4 (m4_errprint, m4_warn, m4_fatal, m4_prefix,
m4_eval, m4_shift, m4_format, m4_include_unique, m4_include,
m4_sinclude, m4_quote, m4_split, m4_join, m4_strip, m4_append,
m4_list_append, ifval, ifset, m4_default, m4_case, m4_match,
m4_foreach): Moved from here, to...
* libm4.m4: here.
* acgeneral.m4 (AC_WRAP): Moved from here, to...
* libm4.m4 (m4_wrap): here. All callers changed.
* acgeneral.m4: Don't include acversion.m4.
* autoconf.m4: Include libm4.m4 and acversion.m4.
* autoheader.m4: Likewise.
2000-02-08 01:42:03 +08:00
|
|
|
m4_wrap([$2 */], [ ], [/* ])[
|
1999-10-30 22:17:20 +08:00
|
|
|
#undef $1])])
|
|
|
|
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
|
2000-02-08 02:03:54 +08:00
|
|
|
# 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.
|
2000-02-08 19:46:51 +08:00
|
|
|
AH_DEFUN([AH_VERBATIM],
|
1999-10-30 22:17:20 +08:00
|
|
|
[AC_VAR_IF_INDIR([$1],,
|
|
|
|
[#
|
|
|
|
@@@
|
|
|
|
ac_verbatim_$1="\
|
2000-02-04 18:23:15 +08:00
|
|
|
_AC_SH_QUOTE([$2])"
|
1999-10-30 22:17:20 +08:00
|
|
|
@@@
|
|
|
|
])])
|
|
|
|
|
2000-02-08 02:03:54 +08:00
|
|
|
# FIXME: To be rigorous, this should not be systematic: depending
|
|
|
|
# upon the arguments of AC_CHECK_LIB, we might not AC_DEFINE.
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_CHECK_LIB],
|
1999-12-21 21:44:54 +08:00
|
|
|
[AH_TEMPLATE(AC_TR_CPP(HAVE_LIB$1),
|
1999-10-30 22:17:20 +08:00
|
|
|
[Define if you have the `]$1[' library (-l]$1[).])
|
|
|
|
# Success
|
1995-11-23 01:42:19 +08:00
|
|
|
$3
|
1999-10-30 22:17:20 +08:00
|
|
|
# Failure
|
|
|
|
$4])
|
1994-09-10 04:13:30 +08:00
|
|
|
|
2000-02-08 19:46:51 +08:00
|
|
|
AH_DEFUN([AH_CHECK_HEADERS],
|
1999-10-30 22:17:20 +08:00
|
|
|
[AC_FOREACH([AC_Header], [$1],
|
|
|
|
[AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Header),
|
|
|
|
[Define if you have the <]AC_Header[> header file.])
|
2000-01-10 18:06:51 +08:00
|
|
|
# Success
|
|
|
|
$2
|
|
|
|
# Failure
|
|
|
|
$3])])
|
1994-09-10 04:13:30 +08:00
|
|
|
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_CHECK_HEADERS], [AH_CHECK_HEADERS($@)])
|
|
|
|
AH_DEFUN([AC_CHECK_HEADERS_DIRENT], [AH_CHECK_HEADERS($@)])
|
|
|
|
|
|
|
|
AH_DEFUN([AC_CHECK_DECLS],
|
2000-02-07 19:54:29 +08:00
|
|
|
[m4_foreach([AC_Symbol], [$1],
|
1999-12-20 21:40:18 +08:00
|
|
|
[AH_TEMPLATE(AC_TR_CPP([NEED_]AC_Symbol[_DECL]),
|
1999-10-30 22:17:20 +08:00
|
|
|
[Define if you need the declaration of `]AC_Symbol['.])
|
2000-01-10 18:06:51 +08:00
|
|
|
# Success
|
|
|
|
$2
|
|
|
|
# Failure
|
|
|
|
$3])])
|
1999-09-04 15:05:34 +08:00
|
|
|
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
|
|
|
|
AH_DEFUN([AC_CHECK_FUNCS],
|
1999-10-30 22:17:20 +08:00
|
|
|
[AC_FOREACH([AC_Func], [$1],
|
|
|
|
[AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Func),
|
|
|
|
[Define if you have the `]AC_Func[' function.])
|
1999-12-21 21:44:54 +08:00
|
|
|
# Success
|
|
|
|
$2
|
|
|
|
# Failure
|
|
|
|
$3])
|
1999-12-20 20:01:55 +08:00
|
|
|
])
|
1994-09-10 04:13:30 +08:00
|
|
|
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_CHECK_SIZEOF],
|
1999-10-30 22:17:20 +08:00
|
|
|
[AH_TEMPLATE(AC_TR_CPP(SIZEOF_$1),
|
|
|
|
[The number of bytes in a `]$1['.])])
|
1994-09-10 04:13:30 +08:00
|
|
|
|
2000-01-28 19:00:16 +08:00
|
|
|
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_PROG_LEX],
|
|
|
|
[AC_CHECK_LIB(fl)
|
|
|
|
AC_CHECK_LIB(l)])
|
1999-10-30 22:17:20 +08:00
|
|
|
|
2000-01-28 19:00:16 +08:00
|
|
|
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_CHECK_MEMBERS],
|
1999-12-20 20:01:55 +08:00
|
|
|
[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),
|
2000-01-28 19:00:16 +08:00
|
|
|
[Define if `]AC_Member_Member[' is member of]
|
1999-12-20 20:01:55 +08:00
|
|
|
[`]AC_Member_Aggregate['.])
|
|
|
|
popdef([AC_Member_Member])
|
|
|
|
popdef([AC_Member_Aggregate])
|
1999-12-21 21:44:54 +08:00
|
|
|
# Success
|
|
|
|
$2
|
|
|
|
# Failure
|
|
|
|
$3])
|
1999-12-20 20:01:55 +08:00
|
|
|
])
|
|
|
|
|
1999-11-01 Akim Demaille <akim@epita.fr>
Fix a bit of the brokenness of AC_CHECK_TYPE.
* acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): New macro, inspired from
the former AC_CHECK_TYPE. This macro is exactly the one that
ought to be named AC_CHECK_TYPE: it just checks, and executes user
actions. In the future, this macro ought to be renamed
AC_CHECK_TYPE.
There is a big difference with the former AC_CHECK_TYPE: instead
of grepping in the headers, it tries to compile a variable
declaration. This is both safer, slower, and better, since now we
can check for compiler types (e.g., unsigned long long).
(AC_CHECK_TYPES): The looping and AC_DEFINEing version of the
previous macro. Uses m4 loops.
(AC_CHECK_TYPE): Reimplemented on top of AC_CHECK_TYPE_INTERNAL.
* autoheader.m4 (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros,
hooked.
* autoconf.texi (@ovar): New macro, for optional variables.
(Generic Typedefs): Document AC_CHECK_TYPES.
* autoheader.texi: (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros.
(Epilogue): Hooks them.
2000-01-28 18:41:47 +08:00
|
|
|
|
2000-02-08 02:03:54 +08:00
|
|
|
# AC_CHECK_TYPE(TYPE, SUBTITUTE)
|
|
|
|
# ------------------------------
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_CHECK_TYPE],
|
1999-11-01 Akim Demaille <akim@epita.fr>
Fix a bit of the brokenness of AC_CHECK_TYPE.
* acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): New macro, inspired from
the former AC_CHECK_TYPE. This macro is exactly the one that
ought to be named AC_CHECK_TYPE: it just checks, and executes user
actions. In the future, this macro ought to be renamed
AC_CHECK_TYPE.
There is a big difference with the former AC_CHECK_TYPE: instead
of grepping in the headers, it tries to compile a variable
declaration. This is both safer, slower, and better, since now we
can check for compiler types (e.g., unsigned long long).
(AC_CHECK_TYPES): The looping and AC_DEFINEing version of the
previous macro. Uses m4 loops.
(AC_CHECK_TYPE): Reimplemented on top of AC_CHECK_TYPE_INTERNAL.
* autoheader.m4 (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros,
hooked.
* autoconf.texi (@ovar): New macro, for optional variables.
(Generic Typedefs): Document AC_CHECK_TYPES.
* autoheader.texi: (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros.
(Epilogue): Hooks them.
2000-01-28 18:41:47 +08:00
|
|
|
[AH_TEMPLATE([$1], [Define to `$2' if <sys/types.h> does not define.])])
|
1999-12-20 20:01:55 +08:00
|
|
|
|
2000-02-08 19:46:51 +08:00
|
|
|
|
|
|
|
# AC_FUNC_ALLOCA
|
|
|
|
# --------------
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_FUNC_ALLOCA],
|
2000-01-10 18:06:51 +08:00
|
|
|
[AH_VERBATIM([STACK_DIRECTION],
|
1999-10-30 22:17:20 +08:00
|
|
|
[/* 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.
|
1999-10-31 10:37:40 +08:00
|
|
|
STACK_DIRECTION > 0 => grows toward higher addresses
|
|
|
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
|
|
|
STACK_DIRECTION = 0 => direction of growth unknown */
|
2000-02-08 19:46:51 +08:00
|
|
|
#undef STACK_DIRECTION])
|
|
|
|
])dnl AH_FUNC_ALLOCA
|
1999-10-31 10:37:40 +08:00
|
|
|
|
1999-10-30 22:17:20 +08:00
|
|
|
|
2000-02-08 02:03:54 +08:00
|
|
|
# AH_CHECK_TYPES((TYPES, ...))
|
|
|
|
# ----------------------------
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
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],
|
1999-10-30 22:17:20 +08:00
|
|
|
[AH_VERBATIM([__CHAR_UNSIGNED__],
|
|
|
|
[/* Define if type `char' is unsigned and you are not using gcc. */
|
|
|
|
#ifndef __CHAR_UNSIGNED__
|
|
|
|
# undef __CHAR_UNSIGNED__
|
2000-02-08 19:46:51 +08:00
|
|
|
#endif])
|
|
|
|
])
|
1999-10-30 22:17:20 +08:00
|
|
|
|
1999-10-31 10:37:40 +08:00
|
|
|
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_AIX],
|
1999-10-30 22:17:20 +08:00
|
|
|
[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
|
2000-02-08 19:46:51 +08:00
|
|
|
#endif])
|
|
|
|
])
|
1999-10-30 22:17:20 +08:00
|
|
|
|
|
|
|
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
AH_DEFUN([AC_F77_WRAPPERS],
|
1999-10-30 22:17:20 +08:00
|
|
|
[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.])])
|
1994-09-10 04:13:30 +08:00
|
|
|
|
|
|
|
|
2000-02-07 23:39:16 +08:00
|
|
|
AH_DEFUN([AC_CONFIG_HEADERS],
|
Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro. Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 21:37:47 +08:00
|
|
|
[@@@config_h=patsubst($1, [ .*$], [])@@@
|
1994-09-10 04:13:30 +08:00
|
|
|
])
|
|
|
|
|
2000-02-08 19:46:51 +08:00
|
|
|
# Enter the `autoheader' name space
|
|
|
|
m4_enable(autoheader)
|