autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: m4_builtins and Autoconf core


From: Akim Demaille
Subject: FYI: m4_builtins and Autoconf core
Date: 03 Nov 2000 12:05:10 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * 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  <address@hidden>

Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.613
diff -u -u -r1.613 acgeneral.m4
--- acgeneral.m4 2000/11/03 10:39:27 1.613
+++ acgeneral.m4 2000/11/03 11:06:27
@@ -229,7 +229,7 @@
 #
 # - 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.'
@@ -370,7 +370,7 @@
 # ------------
 # 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])])
 
 
@@ -378,7 +378,7 @@
 # ---------------
 # 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.
@@ -603,7 +603,8 @@
 #
 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
@@ -663,7 +664,8 @@
 # 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], address@hidden:@ From configure.in translit([$1], 
$"").])dnl
+[m4_divert([REVISION],
+           address@hidden:@ From configure.in m4_translit([$1], $"").])dnl
 ])
 
 
@@ -679,23 +681,23 @@
 # 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])])])
 
 
@@ -3657,7 +3659,7 @@
 # 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
 ])
@@ -3775,7 +3777,7 @@
 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
Index: aclang.m4
===================================================================
RCS file: /cvs/autoconf/aclang.m4,v
retrieving revision 1.78
diff -u -u -r1.78 aclang.m4
--- aclang.m4 2000/11/02 14:12:18 1.78
+++ aclang.m4 2000/11/03 11:06:28
@@ -104,7 +104,7 @@
 # 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])])])
 
 
@@ -421,31 +421,31 @@
 # 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)]))
 
 
 
@@ -503,7 +503,7 @@
 # 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
@@ -1739,7 +1739,7 @@
   *)      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"
Index: autoconf.m4
===================================================================
RCS file: /cvs/autoconf/autoconf.m4,v
retrieving revision 1.17
diff -u -u -r1.17 autoconf.m4
--- autoconf.m4 2000/11/03 09:08:03 1.17
+++ autoconf.m4 2000/11/03 11:06:29
@@ -26,13 +26,22 @@
 
 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])
@@ -49,10 +58,3 @@
 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])
Index: m4sugar.m4
===================================================================
RCS file: /cvs/autoconf/m4sugar.m4,v
retrieving revision 2.13
diff -u -u -r2.13 m4sugar.m4
--- m4sugar.m4 2000/11/03 10:39:28 2.13
+++ m4sugar.m4 2000/11/03 11:06:29
@@ -632,7 +632,7 @@
 # return makeNUMBER.
 m4_define([_m4_divert],
 [ifdef([_m4_divert($1)],
-       [indir([_m4_divert($1)])],
+       [m4_indir([_m4_divert($1)])],
        [$1])])
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]