automake-patches
[Top][All Lists]
Advanced

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

Re: expose m4_PACKAGE_VERSION,m4_version_compare


From: Ralf Wildenhues
Subject: Re: expose m4_PACKAGE_VERSION,m4_version_compare
Date: Thu, 11 Oct 2007 01:48:25 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

[ http://lists.gnu.org/archive/html/autoconf-patches/2007-09/msg00026.html ]

Hello Eric, all,

Sorry to chime in even later.

* Eric Blake wrote on Sat, Sep 15, 2007 at 02:30:03PM CEST:
> > 
> > 2007-09-13  Eric Blake  <address@hidden>
> > 
> >     Use 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.
> 
> No comments on this followup patch, so I'm applying it.  Now the only
> documented way to grab the autoconf version is AC_VERSION (so at some
> point in the future, automake should be changed to use this instead of the
> undocumented m4_PACKAGE_VERSION, once it has other dependencies on
> autoconf 2.62+).

That logic is a bit off.  It would be nice if older Automake versions
also continued to work with newer (future) Autoconf versions; we do fix
issues that we encounter to this extent.  Thus how about applying this
to Automake HEAD and branch-1-10 so at least 1.10.1+ will continue to
work even when you kill m4_PACKAGE_VERSION?  This Automake guard can be
dropped once Automake requires Autoconf 2.62+ anyways, not the other way
round.

As to naming the beast, I must unfortunately admit that I don't like
AC_VERSION much.  An ancient Autoconf version used AC_ACVERSION.  Some
bootstrap scripts like to use AC_VERSION as shell variable (of course
that's no problem, as those bootstrap scripts are typically not
generated), and at least one configure.in did a long while ago[1].
However, also the naming convention between autotools is inconsistent:
Libtool HEAD has LT_PACKAGE_VERSION, Automake has AM_AUTOMAKE_VERSION, 
gettext has AM_GNU_GETTEXT_VERSION, and moreover, each but the first has
different semantics, too!

I would have suggested AC_AUTOCONF_VERSION, because AC_ is really just
the namespace prefix, and without it, it's not clear what is just being
versioned.  But maybe just leave it as it is, I dunno.  In retrospect
this naming divergence has all been rather unfortunate.

Part of my caution stems also from experience with a typical Libtool
user approach to use LT_VERSION as a symbol that defines the library
version of the only shared library that a package happens to build.
Yes, as a m4_define([LT_VERSION], [1:2:3]) in configure.ac.  :-/

Cheers,
Ralf

[1] http://lists.spi-inc.org/pipermail/fresco-devel/2001-March/002410.html

2007-10-10  Ralf Wildenhues  <address@hidden>

        Accommodate for new defined macro AC_VERSION.
        * aclocal.in (write_aclocal): Use AC_VERSION rather than
        m4_PACKAGE_VERSION.  Define the former if not defined.
        * m4/amversion.in (AM_SET_CURRENT_AUTOMAKE_VERSION): Likewise.
        * tests/missing4.test: Use AC_VERSION.

diff --git a/aclocal.in b/aclocal.in
index 4efb7af..525b655 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -782,7 +782,9 @@ sub write_aclocal ($@)
       # Do not use "$output_file" here for the same reason we do not
       # use it in the header below.  autom4te will output the name of
       # the file in the diagnostic anyway.
-      $output = "m4_if(m4_PACKAGE_VERSION, [$ac_version],,
+      $output = "m4_ifndef([AC_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_VERSION])])dnl
+m4_if(AC_VERSION, [$ac_version],,
 [m4_warning([this file was generated for autoconf $ac_version.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
diff --git a/aclocal.m4 b/aclocal.m4
index 7ae7e5b..d60bf75 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -11,8 +11,10 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-m4_if(m4_PACKAGE_VERSION, [2.61],,
-[m4_warning([this file was generated for autoconf 2.61.
+m4_ifndef([AC_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_VERSION])])dnl
+m4_if(AC_VERSION, [2.61b],,
+[m4_warning([this file was generated for autoconf 2.61b.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 
`autoreconf'.])])
diff --git a/m4/amversion.in b/m4/amversion.in
index c820cf0..2b4c264 100644
--- a/m4/amversion.in
+++ b/m4/amversion.in
@@ -1,6 +1,6 @@
 ##                                                          -*- Autoconf -*-
 ## @configure_input@
-# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -32,4 +32,6 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
 [AM_AUTOMAKE_VERSION(address@hidden@])dnl
-_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+m4_ifndef([AC_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_VERSION)])
diff --git a/m4/amversion.m4 b/m4/amversion.m4
index d7b5f9f..8042a31 100644
--- a/m4/amversion.m4
+++ b/m4/amversion.m4
@@ -1,6 +1,6 @@
 ##                                                          -*- Autoconf -*-
 ## Generated from amversion.in; do not edit by hand.
-# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -32,4 +32,6 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
 [AM_AUTOMAKE_VERSION([1.10a])dnl
-_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+m4_ifndef([AC_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_VERSION)])
diff --git a/tests/missing4.test b/tests/missing4.test
index 5fab894..6bffa3b 100755
--- a/tests/missing4.test
+++ b/tests/missing4.test
@@ -35,7 +35,7 @@ $AUTOMAKE
 ./configure
 $MAKE
 
-sed '1,20 s/m4_PACKAGE_VERSION,/&9999/' < aclocal.m4 > aclocal.tmp
+sed '1,20 s/AC_VERSION,/&9999/' < aclocal.m4 > aclocal.tmp
 cmp aclocal.m4 aclocal.tmp && exit 1
 
 mv aclocal.tmp aclocal.m4




reply via email to

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