+2000-06-26 Akim Demaille <akim@epita.fr>
+
+ Various cleanups.
+
+ * acgeneral.m4 (AC_PRO, AC_EPI): Rename as _AC_DEFUN_PRO and
+ _AC_DEFUN_EPI.
+ Adjust dependencies.
+ (AC_DEFUN): Remove the not-to-be-released specializing mechanism.
+ (AC_SPECIALIZE): Remove for the same reasons.
+ Adjust dependencies.
+ (_AC_INIT_DEFAULTS, _AC_INIT_PARSE_ARGS, _AC_INIT_VERSION,
+ _AC_INIT_PREPARE, _AC_CANONICAL_SPLIT, _AC_CHECK_TYPE_NEW,
+ _AC_CHECK_TYPE_OLD): Define via `define' instead of `AC_DEFUN':
+ they are not related to AC_REQUIRE in any way.
+ * acspecific.m4 (AC_PROG_ECHO, _AC_DECL_YYTEXT, _AC_PATH_X_XMKMF,
+ _AC_PATH_X_DIRECT): Define via `define' instead of `AC_DEFUN'.
+
2000-06-19 Steven G. Johnson <stevenj@gil-galad.mit.edu>
* acgeneral.m4 (AC_CHECK_TOOL): Use two variables in order to
- This file is part of Autoconf. -*- Autoconf -*-
+# This file is part of Autoconf. -*- Autoconf -*-
# Parameterized macros.
# Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
# Free Software Foundation, Inc.
## ------------------------------- ##
-# AC_PRO(MACRO-NAME)
-# ------------------
+# _AC_DEFUN_PRO(MACRO-NAME)
+# -------------------------
# The prologue for Autoconf macros.
-define([AC_PRO],
+define([_AC_DEFUN_PRO],
[AC_PROVIDE([$1])dnl
ifelse(AC_DIVERT_DIVERSION, _AC_DIVERT([NORMAL]),
[AC_DIVERT_PUSH(m4_eval(AC_DIVERT_DIVERSION - 1))],
])
-# AC_EPI
-# ------
-# The Epilogue for Autoconf macros.
-define([AC_EPI],
+# _AC_DEFUN_EPI(MACRO-NAME)
+# -------------------------
+# The Epilogue for Autoconf macros. MACRO-NAME only helps tracing
+# the PRO/EPI pairs.
+define([_AC_DEFUN_EPI],
[AC_DIVERT_POP()dnl
ifelse(AC_DIVERT_DIVERSION, _AC_DIVERT([NORMAL]),
[undivert(_AC_DIVERT([NORMAL_4]))dnl
])
-# AC_DEFUN(NAME, [REPLACED-FUNCTION, ARGUMENT, ]EXPANSION)
-# --------------------------------------------------------
+# AC_DEFUN(NAME, EXPANSION)
+# -------------------------
#
# Define a macro which automatically provides itself. Add machinery
# so the macro automatically switches expansion to the diversion
# macros. We don't use this macro to define some frequently called
# macros that are not involved in ordering constraints, to save m4
# processing.
-#
-# If the REPLACED-FUNCTION and ARGUMENT are defined, then declare that
-# NAME is a specialized version of REPLACED-FUNCTION when its first
-# argument is ARGUMENT. For instance AC_TYPE_SIZE_T is a specialization
-# of AC_CHECK_TYPE applied to `size_t'.
-#
-# This feature is not documented on purpose. It might change in the
-# future.
define([AC_DEFUN],
-[ifelse([$3],,
- [define([$1], [AC_PRO([$1])$2[]AC_EPI()])],
- [define([$2-$3], [$1])
-define([$1], [AC_PRO([$1])$4[]AC_EPI()])])])
+[define([$1], [_AC_DEFUN_PRO([$1])$2[]_AC_DEFUN_EPI([$1])])])
# AC_DEFUN_ONCE(NAME, EXPANSION)
[define([$1],
[AC_PROVIDE_IFELSE([$1],
[AC_DIAGNOSE([syntax], [$1 invoked multiple times])],
- [AC_PRO([$1])$2[]AC_EPI()])])])
+ [_AC_DEFUN_PRO([$1])$2[]_AC_DEFUN_EPI([$1])])])])
# AC_DEFUNCT(NAME, COMMENT)
[AC_DIAGNOSE([obsolete], [$1 is obsolete$2])])
-# AC_SPECIALIZE(MACRO, ARG1 [, ARGS...])
-# --------------------------------------
-#
-# Basically calls the macro MACRO with arguments ARG1, ARGS... But if
-# there exist a specialized version of MACRO for ARG1, use this macro
-# instead with arguments ARGS (i.e., ARG1 is *not* given). See the
-# definition of `AC_DEFUN'.
-define([AC_SPECIALIZE],
-[ifdef([$1-$2],
- [indir([$1-$2], m4_shift(m4_shift($@)))],
- [$1(m4_shift($@))])])
-
# _AC_INIT_DEFAULTS
# -----------------
# Values which defaults can be set from `configure.in'.
-AC_DEFUN([_AC_INIT_DEFAULTS],
+define([_AC_INIT_DEFAULTS],
[AC_DIVERT_PUSH([DEFAULTS])dnl
#
# _AC_INIT_PARSE_ARGS
# -------------------
-AC_DEFUN([_AC_INIT_PARSE_ARGS],
+define([_AC_INIT_PARSE_ARGS],
[AC_DIVERT_PUSH([INIT_PARSE_ARGS])dnl
# Initialize some variables set by options.
# _AC_INIT_VERSION
# ----------------
# Handle the `configure --version' message.
-AC_DEFUN([_AC_INIT_VERSION],
+define([_AC_INIT_VERSION],
[AC_DIVERT([VERSION_BEGIN],
[if $ac_init_version; then
cat <<\EOF])dnl
# 3. Remember the options given to `configure' for `config.status --recheck'.
# 4. Ensure a correct environment
# 5. Required macros (cache, default AC_SUBST etc.)
-AC_DEFUN([_AC_INIT_PREPARE],
+define([_AC_INIT_PREPARE],
[AC_DIVERT_PUSH([INIT_PREPARE])dnl
_AC_INIT_PREPARE_ENVIRONMENT
# --------------
# This macro is expanded only once, to avoid that `foo' ends up being
# installed as `ggfoo'.
-AC_DEFUN_ONCE(AC_ARG_PROGRAM,
+AC_DEFUN_ONCE([AC_ARG_PROGRAM],
[dnl Document the options.
AC_DIVERT_PUSH([HELP_BEGIN])dnl
# _AC_CANONICAL_SPLIT(THING)
# --------------------------
# Generate the variables THING, THING_{alias cpu vendor os}.
-AC_DEFUN([_AC_CANONICAL_SPLIT],
+define([_AC_CANONICAL_SPLIT],
[AC_SUBST([$1], [$ac_cv_$1])dnl
dnl FIXME: AC_SUBST([$1_alias], [$ac_cv_$1_alias])dnl
AC_SUBST([$1_cpu],
# The first argument is an m4 list.
AC_DEFUN([AC_CHECK_MEMBERS],
[m4_foreach([AC_Member], [$1],
- [AC_SPECIALIZE([AC_CHECK_MEMBER], AC_Member,
+ [AC_CHECK_MEMBER(AC_Member,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member), 1,
[Define if `]patsubst(AC_Member, [^[^.]*\.])[' is
member of `]patsubst(AC_Member, [\..*])['.])
# -----------------------------------------------------------------
AC_DEFUN([AC_CHECK_FILES],
[AC_FOREACH([AC_FILE_NAME], [$1],
- [AC_SPECIALIZE([AC_CHECK_FILE], AC_FILE_NAME,
+ [AC_CHECK_FILE(AC_FILE_NAME,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_FILE_NAME), 1,
[Define if you have the file `]AC_File['.])
$2],
# other AC_CHECK_*S macros. SYMBOLS is an m4 list.
AC_DEFUN([AC_CHECK_DECLS],
[m4_foreach([AC_Symbol], [$1],
- [AC_SPECIALIZE([AC_CHECK_DECL], AC_Symbol,
+ [AC_CHECK_DECL(AC_Symbol,
[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.])
# (not necessarily size_t etc.). Equally, instead of defining an unused
# variable, we just use a cast to avoid warnings from the compiler.
# Suggested by Paul Eggert.
-AC_DEFUN([_AC_CHECK_TYPE_NEW],
+define([_AC_CHECK_TYPE_NEW],
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl
AC_CACHE_CHECK([for $1], ac_Type,
# AC_CHECK_TYPE.
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), 1,
- [Define if the system has the type
- `]AC_Type['.])
+ [_AC_CHECK_TYPE_NEW(AC_Type,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Type), 1,
+ [Define if the system has the type
+ `]AC_Type['.])
$2],
- [$3],
- [$4])])])
+ [$3],
+ [$4])])])
# _AC_CHECK_TYPE_OLD(TYPE, DEFAULT)
# FIXME: This is an extremely badly chosen name, since this
# macro actually performs an AC_REPLACE_TYPE. Some day we
# have to clean this up.
-AC_DEFUN([_AC_CHECK_TYPE_OLD],
+define([_AC_CHECK_TYPE_OLD],
[_AC_CHECK_TYPE_NEW([$1],,
[AC_DEFINE_UNQUOTED([$1], [$2],
[Define to `$2' if <sys/types.h> does not define.])])dnl
# display the checking message. In addition, caching something used once
# has little interest.
# Idea borrowed from dist 3.0.
-AC_DEFUN([_AC_PROG_ECHO],
+define([_AC_PROG_ECHO],
[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says Kaveh R. Ghazi.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
# _AC_DECL_YYTEXT
# ---------------
# Check if lex declares yytext as a char * by default, not a char[].
-AC_DEFUN([_AC_DECL_YYTEXT],
+define([_AC_DECL_YYTEXT],
[AC_REQUIRE_CPP()dnl
AC_CACHE_CHECK(lex output file root, ac_cv_prog_lex_root,
[# The minimal lex program is just a single line: %%. But some broken lexes
# ---------------
# Internal subroutine of AC_PATH_X.
# Set ac_x_includes and/or ac_x_libraries.
-AC_DEFUN([_AC_PATH_X_XMKMF],
+define([_AC_PATH_X_XMKMF],
[rm -fr conftestdir
if mkdir conftestdir; then
cd conftestdir
# ----------------
# Internal subroutine of AC_PATH_X.
# Set ac_x_includes and/or ac_x_libraries.
-AC_DEFUN([_AC_PATH_X_DIRECT],
+define([_AC_PATH_X_DIRECT],
[# Standard set of common directories for X headers.
# Check X11 before X11Rn because it is often a symlink to the current release.
ac_x_header_dirs='
- This file is part of Autoconf. -*- Autoconf -*-
+# This file is part of Autoconf. -*- Autoconf -*-
# Parameterized macros.
# Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
# Free Software Foundation, Inc.
## ------------------------------- ##
-# AC_PRO(MACRO-NAME)
-# ------------------
+# _AC_DEFUN_PRO(MACRO-NAME)
+# -------------------------
# The prologue for Autoconf macros.
-define([AC_PRO],
+define([_AC_DEFUN_PRO],
[AC_PROVIDE([$1])dnl
ifelse(AC_DIVERT_DIVERSION, _AC_DIVERT([NORMAL]),
[AC_DIVERT_PUSH(m4_eval(AC_DIVERT_DIVERSION - 1))],
])
-# AC_EPI
-# ------
-# The Epilogue for Autoconf macros.
-define([AC_EPI],
+# _AC_DEFUN_EPI(MACRO-NAME)
+# -------------------------
+# The Epilogue for Autoconf macros. MACRO-NAME only helps tracing
+# the PRO/EPI pairs.
+define([_AC_DEFUN_EPI],
[AC_DIVERT_POP()dnl
ifelse(AC_DIVERT_DIVERSION, _AC_DIVERT([NORMAL]),
[undivert(_AC_DIVERT([NORMAL_4]))dnl
])
-# AC_DEFUN(NAME, [REPLACED-FUNCTION, ARGUMENT, ]EXPANSION)
-# --------------------------------------------------------
+# AC_DEFUN(NAME, EXPANSION)
+# -------------------------
#
# Define a macro which automatically provides itself. Add machinery
# so the macro automatically switches expansion to the diversion
# macros. We don't use this macro to define some frequently called
# macros that are not involved in ordering constraints, to save m4
# processing.
-#
-# If the REPLACED-FUNCTION and ARGUMENT are defined, then declare that
-# NAME is a specialized version of REPLACED-FUNCTION when its first
-# argument is ARGUMENT. For instance AC_TYPE_SIZE_T is a specialization
-# of AC_CHECK_TYPE applied to `size_t'.
-#
-# This feature is not documented on purpose. It might change in the
-# future.
define([AC_DEFUN],
-[ifelse([$3],,
- [define([$1], [AC_PRO([$1])$2[]AC_EPI()])],
- [define([$2-$3], [$1])
-define([$1], [AC_PRO([$1])$4[]AC_EPI()])])])
+[define([$1], [_AC_DEFUN_PRO([$1])$2[]_AC_DEFUN_EPI([$1])])])
# AC_DEFUN_ONCE(NAME, EXPANSION)
[define([$1],
[AC_PROVIDE_IFELSE([$1],
[AC_DIAGNOSE([syntax], [$1 invoked multiple times])],
- [AC_PRO([$1])$2[]AC_EPI()])])])
+ [_AC_DEFUN_PRO([$1])$2[]_AC_DEFUN_EPI([$1])])])])
# AC_DEFUNCT(NAME, COMMENT)
[AC_DIAGNOSE([obsolete], [$1 is obsolete$2])])
-# AC_SPECIALIZE(MACRO, ARG1 [, ARGS...])
-# --------------------------------------
-#
-# Basically calls the macro MACRO with arguments ARG1, ARGS... But if
-# there exist a specialized version of MACRO for ARG1, use this macro
-# instead with arguments ARGS (i.e., ARG1 is *not* given). See the
-# definition of `AC_DEFUN'.
-define([AC_SPECIALIZE],
-[ifdef([$1-$2],
- [indir([$1-$2], m4_shift(m4_shift($@)))],
- [$1(m4_shift($@))])])
-
# _AC_INIT_DEFAULTS
# -----------------
# Values which defaults can be set from `configure.in'.
-AC_DEFUN([_AC_INIT_DEFAULTS],
+define([_AC_INIT_DEFAULTS],
[AC_DIVERT_PUSH([DEFAULTS])dnl
#
# _AC_INIT_PARSE_ARGS
# -------------------
-AC_DEFUN([_AC_INIT_PARSE_ARGS],
+define([_AC_INIT_PARSE_ARGS],
[AC_DIVERT_PUSH([INIT_PARSE_ARGS])dnl
# Initialize some variables set by options.
# _AC_INIT_VERSION
# ----------------
# Handle the `configure --version' message.
-AC_DEFUN([_AC_INIT_VERSION],
+define([_AC_INIT_VERSION],
[AC_DIVERT([VERSION_BEGIN],
[if $ac_init_version; then
cat <<\EOF])dnl
# 3. Remember the options given to `configure' for `config.status --recheck'.
# 4. Ensure a correct environment
# 5. Required macros (cache, default AC_SUBST etc.)
-AC_DEFUN([_AC_INIT_PREPARE],
+define([_AC_INIT_PREPARE],
[AC_DIVERT_PUSH([INIT_PREPARE])dnl
_AC_INIT_PREPARE_ENVIRONMENT
# --------------
# This macro is expanded only once, to avoid that `foo' ends up being
# installed as `ggfoo'.
-AC_DEFUN_ONCE(AC_ARG_PROGRAM,
+AC_DEFUN_ONCE([AC_ARG_PROGRAM],
[dnl Document the options.
AC_DIVERT_PUSH([HELP_BEGIN])dnl
# _AC_CANONICAL_SPLIT(THING)
# --------------------------
# Generate the variables THING, THING_{alias cpu vendor os}.
-AC_DEFUN([_AC_CANONICAL_SPLIT],
+define([_AC_CANONICAL_SPLIT],
[AC_SUBST([$1], [$ac_cv_$1])dnl
dnl FIXME: AC_SUBST([$1_alias], [$ac_cv_$1_alias])dnl
AC_SUBST([$1_cpu],
# The first argument is an m4 list.
AC_DEFUN([AC_CHECK_MEMBERS],
[m4_foreach([AC_Member], [$1],
- [AC_SPECIALIZE([AC_CHECK_MEMBER], AC_Member,
+ [AC_CHECK_MEMBER(AC_Member,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member), 1,
[Define if `]patsubst(AC_Member, [^[^.]*\.])[' is
member of `]patsubst(AC_Member, [\..*])['.])
# -----------------------------------------------------------------
AC_DEFUN([AC_CHECK_FILES],
[AC_FOREACH([AC_FILE_NAME], [$1],
- [AC_SPECIALIZE([AC_CHECK_FILE], AC_FILE_NAME,
+ [AC_CHECK_FILE(AC_FILE_NAME,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_FILE_NAME), 1,
[Define if you have the file `]AC_File['.])
$2],
# other AC_CHECK_*S macros. SYMBOLS is an m4 list.
AC_DEFUN([AC_CHECK_DECLS],
[m4_foreach([AC_Symbol], [$1],
- [AC_SPECIALIZE([AC_CHECK_DECL], AC_Symbol,
+ [AC_CHECK_DECL(AC_Symbol,
[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.])
# (not necessarily size_t etc.). Equally, instead of defining an unused
# variable, we just use a cast to avoid warnings from the compiler.
# Suggested by Paul Eggert.
-AC_DEFUN([_AC_CHECK_TYPE_NEW],
+define([_AC_CHECK_TYPE_NEW],
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl
AC_CACHE_CHECK([for $1], ac_Type,
# AC_CHECK_TYPE.
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), 1,
- [Define if the system has the type
- `]AC_Type['.])
+ [_AC_CHECK_TYPE_NEW(AC_Type,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Type), 1,
+ [Define if the system has the type
+ `]AC_Type['.])
$2],
- [$3],
- [$4])])])
+ [$3],
+ [$4])])])
# _AC_CHECK_TYPE_OLD(TYPE, DEFAULT)
# FIXME: This is an extremely badly chosen name, since this
# macro actually performs an AC_REPLACE_TYPE. Some day we
# have to clean this up.
-AC_DEFUN([_AC_CHECK_TYPE_OLD],
+define([_AC_CHECK_TYPE_OLD],
[_AC_CHECK_TYPE_NEW([$1],,
[AC_DEFINE_UNQUOTED([$1], [$2],
[Define to `$2' if <sys/types.h> does not define.])])dnl
# display the checking message. In addition, caching something used once
# has little interest.
# Idea borrowed from dist 3.0.
-AC_DEFUN([_AC_PROG_ECHO],
+define([_AC_PROG_ECHO],
[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says Kaveh R. Ghazi.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
# _AC_DECL_YYTEXT
# ---------------
# Check if lex declares yytext as a char * by default, not a char[].
-AC_DEFUN([_AC_DECL_YYTEXT],
+define([_AC_DECL_YYTEXT],
[AC_REQUIRE_CPP()dnl
AC_CACHE_CHECK(lex output file root, ac_cv_prog_lex_root,
[# The minimal lex program is just a single line: %%. But some broken lexes
# ---------------
# Internal subroutine of AC_PATH_X.
# Set ac_x_includes and/or ac_x_libraries.
-AC_DEFUN([_AC_PATH_X_XMKMF],
+define([_AC_PATH_X_XMKMF],
[rm -fr conftestdir
if mkdir conftestdir; then
cd conftestdir
# ----------------
# Internal subroutine of AC_PATH_X.
# Set ac_x_includes and/or ac_x_libraries.
-AC_DEFUN([_AC_PATH_X_DIRECT],
+define([_AC_PATH_X_DIRECT],
[# Standard set of common directories for X headers.
# Check X11 before X11Rn because it is often a symlink to the current release.
ac_x_header_dirs='