]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Let autoupdate change AC_PREREQ to require the current version of
authorAkim Demaille <akim@epita.fr>
Mon, 23 Oct 2000 17:41:27 +0000 (17:41 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 23 Oct 2000 17:41:27 +0000 (17:41 +0000)
Autoconf.
* acgeneral.m4 (_AC_VERSION_UNLETTER, _AC_VERSION_COMPARE): Move
to...
* libm4.m4 (m4_version_unletter, m4_version_compare): here.
Adjust dependencies.
* acgeneral.m4 (AU::AC_PREREQ): New macro.
* autoupdate.sh: Fail when `m4 input.m4' fails.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4
libm4.m4

index 1312c970aa7f1048e84db3b936f7d6d29d42687a..22ea98ebece600bf1ca3929d57c67977a0f2c7f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2000-10-23  Akim Demaille  <akim@epita.fr>
+
+       Let autoupdate change AC_PREREQ to require the current version of
+       Autoconf.
+
+       * acgeneral.m4 (_AC_VERSION_UNLETTER, _AC_VERSION_COMPARE): Move
+       to...
+       * libm4.m4 (m4_version_unletter, m4_version_compare): here.
+       Adjust dependencies.
+       * acgeneral.m4 (AU::AC_PREREQ): New macro.
+       * autoupdate.sh: Fail when `m4 input.m4' fails.
+
 2000-10-21  Pavel Roskin  <proski@gnu.org>
 
        * acfunctions.m4 (AC_FUNC_CHOWN): Remove temporary files on exit.
index c45bd409893db107003b0650a1086a89175ea42c..0fbfd6a43c9c6b1eae2e279e4b891e967b6bb9b4 100644 (file)
@@ -1221,43 +1221,28 @@ define([AC_REVISION],
 ## ---------------------------------------- ##
 
 
-# _AC_VERSION_UNLETTER(VERSION)
-# -----------------------------
-# Normalize beta version numbers with letters to numbers only for comparison.
-#
-#   Nl -> (N+1).-1.(l#)
-#
-#i.e., 2.14a -> 2.15.-1.1, 2.14b -> 2.15.-1.2, etc.
-# This macro is absolutely not robust to active macro, it expects
-# reasonable version numbers and is valid up to `z', no double letters.
-define([_AC_VERSION_UNLETTER],
-[translit(patsubst(patsubst(patsubst([$1],
-                                     [\([0-9]+\)\([abcdefghi]\)],
-                                     [m4_eval(\1 + 1).-1.\2]),
-                            [\([0-9]+\)\([jklmnopqrs]\)],
-                            [m4_eval(\1 + 1).-1.1\2]),
-          [\([0-9]+\)\([tuvwxyz]\)],
-          [m4_eval(\1 + 1).-1.2\2]),
-          abcdefghijklmnopqrstuvwxyz,
-          12345678901234567890123456)])
-
-
-# _AC_VERSION_COMPARE(VERSION-1, VERSION-2)
-# -----------------------------------------
-# Compare the two version numbers and expand into
-#  -1 if VERSION-1 < VERSION-2
-#   0 if           =
-#   1 if           >
-define([_AC_VERSION_COMPARE],
-[m4_list_cmp((m4_split(_AC_VERSION_UNLETTER([$1]), [\.])),
-             (m4_split(_AC_VERSION_UNLETTER([$2]), [\.])))])
+# AU::AC_PREREQ(VERSION)
+# ----------------------
+# 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
+# `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,
+    [m4_fatal([Autoconf version $1 or higher is required for this script])])dnl
+[AC_PREREQ(]]defn([AC_ACVERSION])[[)]])
 
 
 # AC_PREREQ(VERSION)
 # ------------------
 # Complain and exit if the Autoconf version is less than VERSION.
 define([AC_PREREQ],
-[ifelse(_AC_VERSION_COMPARE(AC_ACVERSION, [$1]), -1,
+[ifelse(m4_version_compare(defn([AC_ACVERSION]), [$1]), -1,
      [AC_FATAL([Autoconf version $1 or higher is required for this script])])])
 
 
index c45bd409893db107003b0650a1086a89175ea42c..0fbfd6a43c9c6b1eae2e279e4b891e967b6bb9b4 100644 (file)
@@ -1221,43 +1221,28 @@ define([AC_REVISION],
 ## ---------------------------------------- ##
 
 
-# _AC_VERSION_UNLETTER(VERSION)
-# -----------------------------
-# Normalize beta version numbers with letters to numbers only for comparison.
-#
-#   Nl -> (N+1).-1.(l#)
-#
-#i.e., 2.14a -> 2.15.-1.1, 2.14b -> 2.15.-1.2, etc.
-# This macro is absolutely not robust to active macro, it expects
-# reasonable version numbers and is valid up to `z', no double letters.
-define([_AC_VERSION_UNLETTER],
-[translit(patsubst(patsubst(patsubst([$1],
-                                     [\([0-9]+\)\([abcdefghi]\)],
-                                     [m4_eval(\1 + 1).-1.\2]),
-                            [\([0-9]+\)\([jklmnopqrs]\)],
-                            [m4_eval(\1 + 1).-1.1\2]),
-          [\([0-9]+\)\([tuvwxyz]\)],
-          [m4_eval(\1 + 1).-1.2\2]),
-          abcdefghijklmnopqrstuvwxyz,
-          12345678901234567890123456)])
-
-
-# _AC_VERSION_COMPARE(VERSION-1, VERSION-2)
-# -----------------------------------------
-# Compare the two version numbers and expand into
-#  -1 if VERSION-1 < VERSION-2
-#   0 if           =
-#   1 if           >
-define([_AC_VERSION_COMPARE],
-[m4_list_cmp((m4_split(_AC_VERSION_UNLETTER([$1]), [\.])),
-             (m4_split(_AC_VERSION_UNLETTER([$2]), [\.])))])
+# AU::AC_PREREQ(VERSION)
+# ----------------------
+# 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
+# `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,
+    [m4_fatal([Autoconf version $1 or higher is required for this script])])dnl
+[AC_PREREQ(]]defn([AC_ACVERSION])[[)]])
 
 
 # AC_PREREQ(VERSION)
 # ------------------
 # Complain and exit if the Autoconf version is less than VERSION.
 define([AC_PREREQ],
-[ifelse(_AC_VERSION_COMPARE(AC_ACVERSION, [$1]), -1,
+[ifelse(m4_version_compare(defn([AC_ACVERSION]), [$1]), -1,
      [AC_FATAL([Autoconf version $1 or higher is required for this script])])])
 
 
index 06bad9589a99e90c789df72e14e3b63a6e5bda8c..1b86fc9aa224cfee267728a8bee9f78165acaef4 100644 (file)
--- a/libm4.m4
+++ b/libm4.m4
@@ -616,6 +616,44 @@ ifdef([$1], [defn([$1]), ])[$2])])
 
 
 
+## -------------------- ##
+## Version processing.  ##
+## -------------------- ##
+
+
+# m4_version_unletter(VERSION)
+# ----------------------------
+# Normalize beta version numbers with letters to numbers only for comparison.
+#
+#   Nl -> (N+1).-1.(l#)
+#
+#i.e., 2.14a -> 2.15.-1.1, 2.14b -> 2.15.-1.2, etc.
+# This macro is absolutely not robust to active macro, it expects
+# reasonable version numbers and is valid up to `z', no double letters.
+define([m4_version_unletter],
+[translit(patsubst(patsubst(patsubst([$1],
+                                     [\([0-9]+\)\([abcdefghi]\)],
+                                     [m4_eval(\1 + 1).-1.\2]),
+                            [\([0-9]+\)\([jklmnopqrs]\)],
+                            [m4_eval(\1 + 1).-1.1\2]),
+          [\([0-9]+\)\([tuvwxyz]\)],
+          [m4_eval(\1 + 1).-1.2\2]),
+          abcdefghijklmnopqrstuvwxyz,
+          12345678901234567890123456)])
+
+
+# m4_version_compare(VERSION-1, VERSION-2)
+# ----------------------------------------
+# Compare the two version numbers and expand into
+#  -1 if VERSION-1 < VERSION-2
+#   0 if           =
+#   1 if           >
+define([m4_version_compare],
+[m4_list_cmp((m4_split(m4_version_unletter([$1]), [\.])),
+             (m4_split(m4_version_unletter([$2]), [\.])))])
+
+
+
 ## ----------------------------------- ##
 ## Helping macros to display strings.  ##
 ## ----------------------------------- ##