+2000-11-03 Akim Demaille <akim@epita.fr>
+
+ * autoconf.m4: Instead of reactivating the macros before reading
+ Autoconf's file, do it afterwards, so that Autoconf promotes the
+ right use, but users still can use the old names.
+ Of course this revealed numerous non updated uses of old macros in
+ Autoconf's files. Adjust them.
+ But for the time being, keep `define' alive for Autoconf.
+
2000-11-03 Akim Demaille <akim@epita.fr>
AC_REQUIRE and AC_DEFUN_ONCE don't work properly together. This
#
# - BODY-TO-EXPAND == m4_indir([NAME-TO-CHECK])
# In the case of macros with irregular names. For instance:
-# _AC_REQUIRE([AC_LANG_COMPILER(C)], [indir([AC_LANG_COMPILER(C)])])
+# _AC_REQUIRE([AC_LANG_COMPILER(C)], [m4_indir([AC_LANG_COMPILER(C)])])
# which means `if the macro named `AC_LANG_COMPILER(C)' (the parens are
# part of the name, it is not an argument) has not been run, then
# call it.'
# ------------
# Output TEXT at the top of `config.h.in'.
define([AH_TOP],
-[define([_AH_COUNTER], incr(_AH_COUNTER))dnl
+[define([_AH_COUNTER], m4_incr(_AH_COUNTER))dnl
AH_VERBATIM([0000]_AH_COUNTER, [$1])])
# ---------------
# Output TEXT at the bottom of `config.h.in'.
define([AH_BOTTOM],
-[define([_AH_COUNTER], incr(_AH_COUNTER))dnl
+[define([_AH_COUNTER], m4_incr(_AH_COUNTER))dnl
AH_VERBATIM([zzzz]_AH_COUNTER, [$1])])
# Initialize.
#
define([AC_HELP_STRING],
[m4_pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
-m4_pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
+m4_pushdef([AC_Prefix_Format],
+ [ %-]m4_eval(m4_len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
m4_text_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
m4_popdef([AC_Prefix_Format])dnl
m4_popdef([AC_Prefix])dnl
# The second quote in the translit is just to cope with font-lock-mode
# which sees the opening of a string.
define([AC_REVISION],
-[m4_divert([REVISION], [@%:@ From configure.in translit([$1], $"").])dnl
+[m4_divert([REVISION],
+ [@%:@ From configure.in m4_translit([$1], $"").])dnl
])
# Update this `AC_PREREQ' statement to require the current version of
# Autoconf. But fail if ever this autoupdate is too old.
#
-# Note that `defn([AC_ACVERSION])' below are expanded before calling
+# Note that `m4_defn([AC_ACVERSION])' below are expanded before calling
# `AU_DEFUN', i.e., it is hard coded. Otherwise it would be quite
# complex for autoupdate to import the value of `AC_ACVERSION'. We
# could `AU_DEFUN' `AC_ACVERSION', but this would replace all its
# occurrences with the current version of Autoconf, which is certainly
# not what mean the user.
AU_DEFUN([AC_PREREQ],
-[ifelse(m4_version_compare(]defn([AC_ACVERSION])[, [$1]), -1,
+[ifelse(m4_version_compare(]m4_defn([AC_ACVERSION])[, [$1]), -1,
[m4_fatal([Autoconf version $1 or higher is required for this script])])dnl
-[AC_PREREQ(]]defn([AC_ACVERSION])[[)]])
+[AC_PREREQ(]]m4_defn([AC_ACVERSION])[[)]])
# AC_PREREQ(VERSION)
# ------------------
# Complain and exit if the Autoconf version is less than VERSION.
define([AC_PREREQ],
-[ifelse(m4_version_compare(defn([AC_ACVERSION]), [$1]), -1,
+[ifelse(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1,
[AC_FATAL([Autoconf version $1 or higher is required for this script])])])
# clashes :( On the other hand, I'd like to avoid weird keys (e.g.,
# depending upon __file__ or the pid).
AU_DEFUN([AC_OUTPUT_COMMANDS],
-[define([_AC_OUTPUT_COMMANDS_CNT], incr(_AC_OUTPUT_COMMANDS_CNT))dnl
+[define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl
dnl Double quoted since that was the case in the original macro.
AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
])
AU_DEFUN([AC_LINK_FILES],
[ifelse($#, 2, ,
[m4_fatal([$0: incorrect number of arguments])])dnl
-define([_AC_LINK_FILES_CNT], incr(_AC_LINK_FILES_CNT))dnl
+define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
ac_sources="$1"
ac_dests="$2"
while test -n "$ac_sources"; do
# unavailable.
define([_AC_LANG_DISPATCH],
[ifdef([$1($2)],
- [indir([$1($2)], m4_shiftn(2, $@))],
+ [m4_indir([$1($2)], m4_shiftn(2, $@))],
[AC_FATAL([$1: unknown language: $2])])])
# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
# ----------------------------------------
# Same as C.
-define([AC_LANG_PROGRAM(C++)], defn([AC_LANG_PROGRAM(C)]))
+define([AC_LANG_PROGRAM(C++)], m4_defn([AC_LANG_PROGRAM(C)]))
# AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
# -------------------------------------
# Same as C.
-define([AC_LANG_CALL(C++)], defn([AC_LANG_CALL(C)]))
+define([AC_LANG_CALL(C++)], m4_defn([AC_LANG_CALL(C)]))
# AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION)
# ------------------------------------
# Same as C.
-define([AC_LANG_FUNC_LINK_TRY(C++)], defn([AC_LANG_FUNC_LINK_TRY(C)]))
+define([AC_LANG_FUNC_LINK_TRY(C++)], m4_defn([AC_LANG_FUNC_LINK_TRY(C)]))
# AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION)
# ---------------------------------------------------
# Same as C.
-define([AC_LANG_BOOL_COMPILE_TRY(C++)], defn([AC_LANG_BOOL_COMPILE_TRY(C)]))
+define([AC_LANG_BOOL_COMPILE_TRY(C++)], m4_defn([AC_LANG_BOOL_COMPILE_TRY(C)]))
# AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION)
# -------------------------------------------
# Same as C.
-define([AC_LANG_INT_SAVE(C++)], defn([AC_LANG_INT_SAVE(C)]))
+define([AC_LANG_INT_SAVE(C++)], m4_defn([AC_LANG_INT_SAVE(C)]))
# Ensure we have a compiler for the current LANG.
AC_DEFUN([AC_LANG_COMPILER_REQUIRE],
[_AC_REQUIRE([AC_LANG_COMPILER(]_AC_LANG[)],
- [indir([AC_LANG_COMPILER(]_AC_LANG[)])])])
+ [m4_indir([AC_LANG_COMPILER(]_AC_LANG[)])])])
# AC_REQUIRE_CPP
*) ac_val="unknown" ;;
esac
case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-ifelse(index([$1],[_]),-1,[],
+ifelse(m4_index([$1],[_]),-1,[],
[case $ac_cv_f77_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
])
m4_default([$2],[$1])="$ac_val"
m4_include([m4sh.m4])
-# M4sugar and M4sh use exclusively the `m4_' prefix, but Autoconf,
-# for historical reasons, uses the old names.
+m4_copy_unm4([m4_define])
+
+m4_include([acversion.m4])
+m4_include([acgeneral.m4])
+m4_include([aclang.m4])
+m4_include([acfunctions.m4])
+m4_include([acspecific.m4])
+m4_include([acoldnames.m4])
+
+# We discourage the use of the non prefixed macro names: M4sugar maps
+# them all into `m4_'. Autoconf has been converted to these names
+# too. But users may still depend upon these, so reestablish them.
m4_copy_unm4([m4_builtin])
m4_copy_unm4([m4_changequote])
m4_copy_unm4([m4_decr])
-m4_copy_unm4([m4_define])
m4_copy_unm4([m4_defn])
m4_copy_unm4([m4_incr])
m4_copy_unm4([m4_index])
m4_copy_unm4([m4_traceon])
m4_copy_unm4([m4_translit])
m4_copy_unm4([m4_undefine])
-
-m4_include([acversion.m4])
-m4_include([acgeneral.m4])
-m4_include([aclang.m4])
-m4_include([acfunctions.m4])
-m4_include([acspecific.m4])
-m4_include([acoldnames.m4])
m4_include([m4sh.m4])
-# M4sugar and M4sh use exclusively the `m4_' prefix, but Autoconf,
-# for historical reasons, uses the old names.
+m4_copy_unm4([m4_define])
+
+m4_include([acversion.m4])
+m4_include([acgeneral.m4])
+m4_include([aclang.m4])
+m4_include([acfunctions.m4])
+m4_include([acspecific.m4])
+m4_include([acoldnames.m4])
+
+# We discourage the use of the non prefixed macro names: M4sugar maps
+# them all into `m4_'. Autoconf has been converted to these names
+# too. But users may still depend upon these, so reestablish them.
m4_copy_unm4([m4_builtin])
m4_copy_unm4([m4_changequote])
m4_copy_unm4([m4_decr])
-m4_copy_unm4([m4_define])
m4_copy_unm4([m4_defn])
m4_copy_unm4([m4_incr])
m4_copy_unm4([m4_index])
m4_copy_unm4([m4_traceon])
m4_copy_unm4([m4_translit])
m4_copy_unm4([m4_undefine])
-
-m4_include([acversion.m4])
-m4_include([acgeneral.m4])
-m4_include([aclang.m4])
-m4_include([acfunctions.m4])
-m4_include([acspecific.m4])
-m4_include([acoldnames.m4])
# unavailable.
define([_AC_LANG_DISPATCH],
[ifdef([$1($2)],
- [indir([$1($2)], m4_shiftn(2, $@))],
+ [m4_indir([$1($2)], m4_shiftn(2, $@))],
[AC_FATAL([$1: unknown language: $2])])])
# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
# ----------------------------------------
# Same as C.
-define([AC_LANG_PROGRAM(C++)], defn([AC_LANG_PROGRAM(C)]))
+define([AC_LANG_PROGRAM(C++)], m4_defn([AC_LANG_PROGRAM(C)]))
# AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
# -------------------------------------
# Same as C.
-define([AC_LANG_CALL(C++)], defn([AC_LANG_CALL(C)]))
+define([AC_LANG_CALL(C++)], m4_defn([AC_LANG_CALL(C)]))
# AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION)
# ------------------------------------
# Same as C.
-define([AC_LANG_FUNC_LINK_TRY(C++)], defn([AC_LANG_FUNC_LINK_TRY(C)]))
+define([AC_LANG_FUNC_LINK_TRY(C++)], m4_defn([AC_LANG_FUNC_LINK_TRY(C)]))
# AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION)
# ---------------------------------------------------
# Same as C.
-define([AC_LANG_BOOL_COMPILE_TRY(C++)], defn([AC_LANG_BOOL_COMPILE_TRY(C)]))
+define([AC_LANG_BOOL_COMPILE_TRY(C++)], m4_defn([AC_LANG_BOOL_COMPILE_TRY(C)]))
# AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION)
# -------------------------------------------
# Same as C.
-define([AC_LANG_INT_SAVE(C++)], defn([AC_LANG_INT_SAVE(C)]))
+define([AC_LANG_INT_SAVE(C++)], m4_defn([AC_LANG_INT_SAVE(C)]))
# Ensure we have a compiler for the current LANG.
AC_DEFUN([AC_LANG_COMPILER_REQUIRE],
[_AC_REQUIRE([AC_LANG_COMPILER(]_AC_LANG[)],
- [indir([AC_LANG_COMPILER(]_AC_LANG[)])])])
+ [m4_indir([AC_LANG_COMPILER(]_AC_LANG[)])])])
# AC_REQUIRE_CPP
*) ac_val="unknown" ;;
esac
case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-ifelse(index([$1],[_]),-1,[],
+ifelse(m4_index([$1],[_]),-1,[],
[case $ac_cv_f77_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
])
m4_default([$2],[$1])="$ac_val"
# unavailable.
define([_AC_LANG_DISPATCH],
[ifdef([$1($2)],
- [indir([$1($2)], m4_shiftn(2, $@))],
+ [m4_indir([$1($2)], m4_shiftn(2, $@))],
[AC_FATAL([$1: unknown language: $2])])])
# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
# ----------------------------------------
# Same as C.
-define([AC_LANG_PROGRAM(C++)], defn([AC_LANG_PROGRAM(C)]))
+define([AC_LANG_PROGRAM(C++)], m4_defn([AC_LANG_PROGRAM(C)]))
# AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
# -------------------------------------
# Same as C.
-define([AC_LANG_CALL(C++)], defn([AC_LANG_CALL(C)]))
+define([AC_LANG_CALL(C++)], m4_defn([AC_LANG_CALL(C)]))
# AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION)
# ------------------------------------
# Same as C.
-define([AC_LANG_FUNC_LINK_TRY(C++)], defn([AC_LANG_FUNC_LINK_TRY(C)]))
+define([AC_LANG_FUNC_LINK_TRY(C++)], m4_defn([AC_LANG_FUNC_LINK_TRY(C)]))
# AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION)
# ---------------------------------------------------
# Same as C.
-define([AC_LANG_BOOL_COMPILE_TRY(C++)], defn([AC_LANG_BOOL_COMPILE_TRY(C)]))
+define([AC_LANG_BOOL_COMPILE_TRY(C++)], m4_defn([AC_LANG_BOOL_COMPILE_TRY(C)]))
# AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION)
# -------------------------------------------
# Same as C.
-define([AC_LANG_INT_SAVE(C++)], defn([AC_LANG_INT_SAVE(C)]))
+define([AC_LANG_INT_SAVE(C++)], m4_defn([AC_LANG_INT_SAVE(C)]))
# Ensure we have a compiler for the current LANG.
AC_DEFUN([AC_LANG_COMPILER_REQUIRE],
[_AC_REQUIRE([AC_LANG_COMPILER(]_AC_LANG[)],
- [indir([AC_LANG_COMPILER(]_AC_LANG[)])])])
+ [m4_indir([AC_LANG_COMPILER(]_AC_LANG[)])])])
# AC_REQUIRE_CPP
*) ac_val="unknown" ;;
esac
case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-ifelse(index([$1],[_]),-1,[],
+ifelse(m4_index([$1],[_]),-1,[],
[case $ac_cv_f77_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
])
m4_default([$2],[$1])="$ac_val"
#
# - BODY-TO-EXPAND == m4_indir([NAME-TO-CHECK])
# In the case of macros with irregular names. For instance:
-# _AC_REQUIRE([AC_LANG_COMPILER(C)], [indir([AC_LANG_COMPILER(C)])])
+# _AC_REQUIRE([AC_LANG_COMPILER(C)], [m4_indir([AC_LANG_COMPILER(C)])])
# which means `if the macro named `AC_LANG_COMPILER(C)' (the parens are
# part of the name, it is not an argument) has not been run, then
# call it.'
# ------------
# Output TEXT at the top of `config.h.in'.
define([AH_TOP],
-[define([_AH_COUNTER], incr(_AH_COUNTER))dnl
+[define([_AH_COUNTER], m4_incr(_AH_COUNTER))dnl
AH_VERBATIM([0000]_AH_COUNTER, [$1])])
# ---------------
# Output TEXT at the bottom of `config.h.in'.
define([AH_BOTTOM],
-[define([_AH_COUNTER], incr(_AH_COUNTER))dnl
+[define([_AH_COUNTER], m4_incr(_AH_COUNTER))dnl
AH_VERBATIM([zzzz]_AH_COUNTER, [$1])])
# Initialize.
#
define([AC_HELP_STRING],
[m4_pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
-m4_pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
+m4_pushdef([AC_Prefix_Format],
+ [ %-]m4_eval(m4_len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
m4_text_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
m4_popdef([AC_Prefix_Format])dnl
m4_popdef([AC_Prefix])dnl
# The second quote in the translit is just to cope with font-lock-mode
# which sees the opening of a string.
define([AC_REVISION],
-[m4_divert([REVISION], [@%:@ From configure.in translit([$1], $"").])dnl
+[m4_divert([REVISION],
+ [@%:@ From configure.in m4_translit([$1], $"").])dnl
])
# Update this `AC_PREREQ' statement to require the current version of
# Autoconf. But fail if ever this autoupdate is too old.
#
-# Note that `defn([AC_ACVERSION])' below are expanded before calling
+# Note that `m4_defn([AC_ACVERSION])' below are expanded before calling
# `AU_DEFUN', i.e., it is hard coded. Otherwise it would be quite
# complex for autoupdate to import the value of `AC_ACVERSION'. We
# could `AU_DEFUN' `AC_ACVERSION', but this would replace all its
# occurrences with the current version of Autoconf, which is certainly
# not what mean the user.
AU_DEFUN([AC_PREREQ],
-[ifelse(m4_version_compare(]defn([AC_ACVERSION])[, [$1]), -1,
+[ifelse(m4_version_compare(]m4_defn([AC_ACVERSION])[, [$1]), -1,
[m4_fatal([Autoconf version $1 or higher is required for this script])])dnl
-[AC_PREREQ(]]defn([AC_ACVERSION])[[)]])
+[AC_PREREQ(]]m4_defn([AC_ACVERSION])[[)]])
# AC_PREREQ(VERSION)
# ------------------
# Complain and exit if the Autoconf version is less than VERSION.
define([AC_PREREQ],
-[ifelse(m4_version_compare(defn([AC_ACVERSION]), [$1]), -1,
+[ifelse(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1,
[AC_FATAL([Autoconf version $1 or higher is required for this script])])])
# clashes :( On the other hand, I'd like to avoid weird keys (e.g.,
# depending upon __file__ or the pid).
AU_DEFUN([AC_OUTPUT_COMMANDS],
-[define([_AC_OUTPUT_COMMANDS_CNT], incr(_AC_OUTPUT_COMMANDS_CNT))dnl
+[define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl
dnl Double quoted since that was the case in the original macro.
AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
])
AU_DEFUN([AC_LINK_FILES],
[ifelse($#, 2, ,
[m4_fatal([$0: incorrect number of arguments])])dnl
-define([_AC_LINK_FILES_CNT], incr(_AC_LINK_FILES_CNT))dnl
+define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
ac_sources="$1"
ac_dests="$2"
while test -n "$ac_sources"; do
# unavailable.
define([_AC_LANG_DISPATCH],
[ifdef([$1($2)],
- [indir([$1($2)], m4_shiftn(2, $@))],
+ [m4_indir([$1($2)], m4_shiftn(2, $@))],
[AC_FATAL([$1: unknown language: $2])])])
# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY])
# ----------------------------------------
# Same as C.
-define([AC_LANG_PROGRAM(C++)], defn([AC_LANG_PROGRAM(C)]))
+define([AC_LANG_PROGRAM(C++)], m4_defn([AC_LANG_PROGRAM(C)]))
# AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
# -------------------------------------
# Same as C.
-define([AC_LANG_CALL(C++)], defn([AC_LANG_CALL(C)]))
+define([AC_LANG_CALL(C++)], m4_defn([AC_LANG_CALL(C)]))
# AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION)
# ------------------------------------
# Same as C.
-define([AC_LANG_FUNC_LINK_TRY(C++)], defn([AC_LANG_FUNC_LINK_TRY(C)]))
+define([AC_LANG_FUNC_LINK_TRY(C++)], m4_defn([AC_LANG_FUNC_LINK_TRY(C)]))
# AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION)
# ---------------------------------------------------
# Same as C.
-define([AC_LANG_BOOL_COMPILE_TRY(C++)], defn([AC_LANG_BOOL_COMPILE_TRY(C)]))
+define([AC_LANG_BOOL_COMPILE_TRY(C++)], m4_defn([AC_LANG_BOOL_COMPILE_TRY(C)]))
# AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION)
# -------------------------------------------
# Same as C.
-define([AC_LANG_INT_SAVE(C++)], defn([AC_LANG_INT_SAVE(C)]))
+define([AC_LANG_INT_SAVE(C++)], m4_defn([AC_LANG_INT_SAVE(C)]))
# Ensure we have a compiler for the current LANG.
AC_DEFUN([AC_LANG_COMPILER_REQUIRE],
[_AC_REQUIRE([AC_LANG_COMPILER(]_AC_LANG[)],
- [indir([AC_LANG_COMPILER(]_AC_LANG[)])])])
+ [m4_indir([AC_LANG_COMPILER(]_AC_LANG[)])])])
# AC_REQUIRE_CPP
*) ac_val="unknown" ;;
esac
case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac
-ifelse(index([$1],[_]),-1,[],
+ifelse(m4_index([$1],[_]),-1,[],
[case $ac_cv_f77_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac
])
m4_default([$2],[$1])="$ac_val"
# return makeNUMBER.
m4_define([_m4_divert],
[ifdef([_m4_divert($1)],
- [indir([_m4_divert($1)])],
+ [m4_indir([_m4_divert($1)])],
[$1])])
# return makeNUMBER.
m4_define([_m4_divert],
[ifdef([_m4_divert($1)],
- [indir([_m4_divert($1)])],
+ [m4_indir([_m4_divert($1)])],
[$1])])