]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Provide AC_VERSION, not m4_AUTOCONF_VERSION.
authorEric Blake <ebb9@byu.net>
Sat, 15 Sep 2007 12:41:08 +0000 (12:41 +0000)
committerEric Blake <ebb9@byu.net>
Sat, 15 Sep 2007 12:41:08 +0000 (12:41 +0000)
* doc/autoconf.texi (Text processing Macros): Remove mention of
m4_AUTOCONF_VERSION, and leave m4_PACKAGE_VERSION undocumented
once again.
(Notices): Move AC_PREREQ...
(Versioning): ...to this new section, alongside the new AC_VERSION
alias for the undocumented m4_PACKAGE_VERSION.
* lib/m4sugar/m4sugar.m4 (m4_AUTOCONF_VERSION): Revert change.
* lib/autoconf/general.m4 (AC_VERSION): New macro.
* NEWS: Update to match this rename.
* tests/m4sugar.at (m4@&t@_version_compare): Remove tests of
m4_PACKAGE_VERSION.
* tests/tools.at (autoconf: AC_VERSION): New test.
Suggested by Paolo Bonzini and Benoit Sigoure.

ChangeLog
NEWS
doc/autoconf.texi
lib/autoconf/general.m4
lib/m4sugar/m4sugar.m4
tests/m4sugar.at
tests/tools.at

index 8df3b58e4559fa3f67c1600be353a0933ca851f6..2bf5aa12a22e73606afb0f823ca3cfe06b4c098e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2007-09-15  Eric Blake  <ebb9@byu.net>
+
+       Provide AC_VERSION, not m4_AUTOCONF_VERSION.
+       * doc/autoconf.texi (Text processing Macros): Remove mention of
+       m4_AUTOCONF_VERSION, and leave m4_PACKAGE_VERSION undocumented
+       once again.
+       (Notices): Move AC_PREREQ...
+       (Versioning): ...to this new section, alongside the new AC_VERSION
+       alias for the undocumented m4_PACKAGE_VERSION.
+       * lib/m4sugar/m4sugar.m4 (m4_AUTOCONF_VERSION): Revert change.
+       * lib/autoconf/general.m4 (AC_VERSION): New macro.
+       * NEWS: Update to match this rename.
+       * tests/m4sugar.at (m4@&t@_version_compare): Remove tests of
+       m4_PACKAGE_VERSION.
+       * tests/tools.at (autoconf: AC_VERSION): New test.
+       Suggested by Paolo Bonzini and Benoit Sigoure.
+
 2007-09-14  Eric Blake  <ebb9@byu.net>
 
        Prepare for conversion to git.
diff --git a/NEWS b/NEWS
index 1b8e24835cb568741d2716de5f51a98ae215b1b0..73ee6e9cd8483e183af56277c05cc5f65a13c09b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,7 @@ GNU Autoconf NEWS - User visible changes.
    generated by autoconf under the license of your own program.
  FIXME - revisit this line once exception clause is finalized.
 
-** New Autoconf macros AC_OPENMP, AC_PATH_PROGS_FEATURE_CHECK.
+** New Autoconf macros AC_OPENMP, AC_PATH_PROGS_FEATURE_CHECK, AC_VERSION.
 
 ** AC_C_BIGENDIAN now supports universal binaries a la Mac OS X.
 
@@ -47,12 +47,10 @@ GNU Autoconf NEWS - User visible changes.
    Autoconf and Automake.  GNU M4 1.4.8 or later is recommended.  The
    configure search for a working M4 is improved.
 
-** New m4sugar macro m4_AUTOCONF_VERSION.  Also, document the m4sugar macros
-   m4_ifndef, m4_version_compare, and m4_PACKAGE_VERSION (available
-   without documentation since at least autoconf 2.53), in part so
-   that packages can make decisions based on the current version of
-   autoconf used to evaluate a given configure.ac.  The name
-   m4_PACKAGE_VERSION may be marked obsolescent in a future release.
+** Document the m4sugar macros m4_ifndef and m4_version_compare
+   (available without documentation since at least autoconf 2.53).
+   Packages using the undocumented m4sugar macro m4_PACKAGE_VERSION
+   should consider using the new AC_VERSION instead.
 
 ** Warnings are now generated by default when an installer invokes
    'configure' with an unknown --enable-* or --with-* option.
index e5d2fee137ef0b1d5dad09faf60e3d96f2116aa5..a2af90cce688a8150551e6c9905a177d7c6a04da 100644 (file)
@@ -302,6 +302,7 @@ Writing @file{configure.ac}
 Initialization and Output Files
 
 * Initializing configure::      Option processing etc.
+* Versioning::                  Dealing with Autoconf versions
 * Notices::                     Copyright, version numbers in @command{configure}
 * Input::                       Where Autoconf should find files
 * Output::                      Outputting results from the configuration
@@ -1681,6 +1682,7 @@ initialization and the creation of output files.
 
 @menu
 * Initializing configure::      Option processing etc.
+* Versioning::                  Dealing with Autoconf versions
 * Notices::                     Copyright, version numbers in @command{configure}
 * Input::                       Where Autoconf should find files
 * Output::                      Outputting results from the configuration
@@ -1767,15 +1769,15 @@ of updating @samp{$@@} and @samp{$*}.  However, we suggest that you use
 standard macros like @code{AC_ARG_ENABLE} instead of attempting to
 implement your own option processing.  @xref{Site Configuration}.
 
+@node Versioning
+@section Dealing with Autoconf versions
+@cindex Autoconf version
+@cindex version, Autoconf
 
-@node Notices
-@section Notices in @command{configure}
-@cindex Notices in @command{configure}
-
-The following macros manage version numbers for @command{configure}
-scripts.  Using them is optional.
+The following optional macros can be used to help choose the minimum
+version of Autoconf that can successfully compile a given
+@file{configure.ac}.
 
-@c FIXME: AC_PREREQ should not be here
 @defmac AC_PREREQ (@var{version})
 @acindex{PREREQ}
 @cindex Version
@@ -1792,6 +1794,26 @@ This macro is the only macro that may be used before @code{AC_INIT}, but
 for consistency, you are invited not to do so.
 @end defmac
 
+@defmac AC_VERSION
+@acindex{VERSION}
+This macro was introduced in Autoconf 2.62.  It identifies the version
+of Autoconf that is currently parsing the input file, in a format
+suitable for @code{m4_version_compare} (@pxref{m4_version_compare}); in
+other words, for this release of Autoconf, its value is
+@samp{@value{VERSION}}.  One potential use of this macro is for writing
+conditional fallbacks based on when a feature was added to Autoconf,
+rather than using @code{AC_PREREQ} to require the newer version of
+Autoconf.  However, remember that the Autoconf philosophy favors feature
+checks over version checks.
+@end defmac
+
+@node Notices
+@section Notices in @command{configure}
+@cindex Notices in @command{configure}
+
+The following macros manage version numbers for @command{configure}
+scripts.  Using them is optional.
+
 @defmac AC_COPYRIGHT (@var{copyright-notice})
 @acindex{COPYRIGHT}
 @cindex Copyright Notice
@@ -10278,6 +10300,7 @@ added.  @code{m4_append} can be used to grow strings, and
 @code{m4_append_uniq} to grow strings without duplicating substrings.
 @end defmac
 
+@anchor{m4_version_compare}
 @defmac m4_version_compare (@var{version-1}, @var{version-2})
 @msindex{version_compare}
 Introduced in autoconf 2.53.  Compare the version strings
@@ -10285,9 +10308,9 @@ Introduced in autoconf 2.53.  Compare the version strings
 @var{version-1} is smaller, @samp{0} if they are the same, or @samp{1}
 @var{version-2} is smaller.  Version strings must be a list of elements
 separated by @samp{.}, where each element is a number along with an
-optional letter.  The comparison stops at the leftmost element that
-contains a difference, although a 0 element compares equal to a missing
-element.
+optional lower case letter.  The comparison stops at the leftmost
+element that contains a difference, although a 0 element compares equal
+to a missing element.
 
 @example
 m4_version_compare([1.1], [2.0])
@@ -10303,35 +10326,6 @@ m4_version_compare([1.0], [1])
 @end example
 @end defmac
 
-@defmac m4_AUTOCONF_VERSION
-@defmacx m4_PACKAGE_VERSION
-@msindex{AUTOCONF_VERSION}
-@msindex{PACKAGE_VERSION}
-These macros identify the version of Autoconf that is currently parsing
-the input file, in a format suitable for @code{m4_version_compare}.  The
-name @code{m4_AUTOCONF_VERSION} was introduced in Autoconf 2.62.  The
-synonym @code{m4_PACKAGE_VERSION} existed since Autoconf 2.53, but was
-undocumented for many years because it is not named very well, and it
-may be withdrawn in a future release.  One use of these macros is for
-writing conditional fallbacks based on when a feature was added to
-Autoconf, rather than using @code{AC_PREREQ} to require the newer
-version of Autoconf.
-
-For an example, @code{AC_USE_SYSTEM_EXTENSIONS} was only added in
-Autoconf 2.60 (@pxref{AC_USE_SYSTEM_EXTENSIONS}).  A @file{configure.ac}
-designed to work even with Autoconf 2.59 can do the following in a
-compatibility section, then use the newer macros elsewhere without
-worrying about Autoconf versions:
-
-@example
-m4_ifndef([m4_AUTOCONF_VERSION],
-          [m4_define([m4_AUTOCONF_VERSION],
-                     m4_defn([m4_PACKAGE_VERSION]))])
-m4_if(m4_version_compare(m4_AUTOCONF_VERSION, [2.60]), [-1],
-      [AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], [AC_GNU_SOURCE])])
-@end example
-@end defmac
-
 
 @node Forbidden Patterns
 @subsection Forbidden Patterns
index 1c10580c30da5922b912828a9eb6047ba5a53589..1938c3a2aac1448b29f9ab823f63fd8119bed1e7 100644 (file)
@@ -299,6 +299,11 @@ AU_DEFUN([AC_PREREQ],
 m4_copy([m4_version_prereq], [AC_PREREQ])
 
 
+# AC_VERSION
+# ----------
+# The current version of Autoconf parsing this file.
+m4_copy([m4_PACKAGE_VERSION], [AC_VERSION])
+
 
 
 
index 4574a77a1d31b314777c463bcf22e24d022f04b8..72c896c31ac46d34abb2604aa6516f4e0857bd5d 100644 (file)
@@ -1725,15 +1725,6 @@ m4_define([m4_version_compare],
 m4_include([m4sugar/version.m4])
 
 
-# m4_AUTOCONF_VERSION
-# -------------------
-# A nicer synonym for the name m4_PACKAGE_VERSION.  However, since
-# automake 1.10 decided to use m4_PACKAGE_VERSION while it was still
-# undocumented, it will be a while before we can try to obsolete the
-# confusing name.
-m4_copy([m4_PACKAGE_VERSION], [m4_AUTOCONF_VERSION])
-
-
 # m4_version_prereq(VERSION, [IF-OK], [IF-NOT = FAIL])
 # ----------------------------------------------------
 # Check this Autoconf version against VERSION.
index 6e3f1059f6a7fef0fd225b29e5ca124dff73d418..6f3da587d87eabc9740171d5c2d4912a2f7c328a 100644 (file)
@@ -193,9 +193,6 @@ AT_CLEANUP
 
 AT_SETUP([m4@&t@_version_compare])
 
-# In addition to version checks, also check m4_AUTOCONF_VERSION, added
-# for autoconf 2.62.
-
 AT_CHECK_M4SUGAR_TEXT(
 [[m4_version_compare([1.1], [2.0])
 m4_version_compare([2.0b], [2.0a])
@@ -205,8 +202,6 @@ m4_version_compare([1.2], [1.1.1a])
 m4_version_compare([1.0], [1])
 m4_version_compare([1.0a], [1.0a])
 m4_version_compare([1.1a], [1.1a.1])
-m4_version_compare(m4_AUTOCONF_VERSION, [2.61])
-m4_version_compare(m4_defn([m4_AUTOCONF_VERSION]), [2.61])
 ]],
 [[-1
 1
@@ -216,8 +211,6 @@ m4_version_compare(m4_defn([m4_AUTOCONF_VERSION]), [2.61])
 0
 0
 -1
-1
-1
 ]])
 
 AT_CLEANUP
index 80a84a1ec854f36c667dcb408c336c2607cd5c07..f5a21e028366b76679548c875099eca92e8fe07b 100644 (file)
@@ -2,7 +2,8 @@
 
 AT_BANNER([Executables (autoheader, autoupdate...).])
 
-# Copyright (C) 2000, 2001, 2003, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2004, 2006, 2007 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
@@ -404,6 +405,22 @@ AT_CHECK([echo 'AC_INIT(X, 2.0, bug-autoconf@gnu.org)' | autoconf -t AC_INIT -],
 AT_CLEANUP
 
 
+# autoconf: AC_VERSION
+# --------------------------------------
+AT_SETUP([autoconf: AC_VERSION])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+version AC_VERSION version
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK([[grep 'version ]]AT_PACKAGE_VERSION[[ version' configure]],
+0, [ignore])
+
+AT_CLEANUP
+
 
 
 ## --------- ##