From: Eric Blake Date: Sat, 15 Sep 2007 12:41:08 +0000 (+0000) Subject: Provide AC_VERSION, not m4_AUTOCONF_VERSION. X-Git-Tag: v2.62~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5547b4a0f22debc6d63d6c797adf873fab7c87c3;p=thirdparty%2Fautoconf.git 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. --- diff --git a/ChangeLog b/ChangeLog index 8df3b58e..2bf5aa12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2007-09-15 Eric Blake + + 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 Prepare for conversion to git. diff --git a/NEWS b/NEWS index 1b8e2483..73ee6e9c 100644 --- 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. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index e5d2fee1..a2af90cc 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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 diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 1c10580c..1938c3a2 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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]) + diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4 index 4574a77a..72c896c3 100644 --- a/lib/m4sugar/m4sugar.m4 +++ b/lib/m4sugar/m4sugar.m4 @@ -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. diff --git a/tests/m4sugar.at b/tests/m4sugar.at index 6e3f1059..6f3da587 100644 --- a/tests/m4sugar.at +++ b/tests/m4sugar.at @@ -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 diff --git a/tests/tools.at b/tests/tools.at index 80a84a1e..f5a21e02 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -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 + ## --------- ##