summaryrefslogtreecommitdiff
path: root/m4/init.m4
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-08-24 10:47:17 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-08-24 11:42:41 +0200
commit2abe18335cffce365cbe09bdc1d0315f5ed8f24d (patch)
treeb12884139c48a64958446b165b7fcf33dc9174ff /m4/init.m4
parentc6cc38027572445a25d749db99473f82521cc79e (diff)
downloadautomake-2abe18335cffce365cbe09bdc1d0315f5ed8f24d.tar.gz
AM_INIT_AUTOMAKE: allow obsolescent two-args invocation once again
This partially reverts commit 'v1.12-67-ge186355' of 2012-05-25, "init: obsolete usages of AM_INIT_AUTOMAKE not supported anymore" Some users still need to be able to define the version number for their package dynamically, at configure runtime. Their user case is that, for development snapshots, they want to be able to base the complete version of the package on the VCS revision ID (mostly Git or Mercurial). They could of course do so by specifying such version dynamically in their call to AC_INIT, as is done by several GNU packages. But then they would need to regenerate and re-run the configure script before each snapshot, which might be very time-consuming for complex packages, to the point of slowing down and even somewhat impeding development. The situation should truly be solved in Autoconf, by allowing a way to specify the version dynamically in a way that doesn't force the configure script to be regenerated and re-run every time the package version changes. But until Autoconf has been improved to allow this, Automake will have to support the obsolescent two-arguments invocation for AM_INIT_AUTOMAKE, to avoid regressing the suboptimal but working solution for the use case described above. See also: <http://lists.gnu.org/archive/html/automake/2012-08/msg00025.html> * NEWS: Update. * m4/init.m4 (AM_INIT_AUTOMAKE): Support once again invocation with two or three arguments. * t/aminit-moreargs-no-more.sh: Renamed ... * t/aminit-moreargs-deprecated.sh: ... like this, and updated. * t/nodef.sh: Recovered test, with minor adjustments. * t/backcompat.sh: Likewise. * t/backcompat2.sh: Likewise. * t/backcompat3.sh: Likewise. * t/backcompat6.sh: Likewise. * t/list-of-tests.mk: Adjust. Suggested-by: Bob Friesenhahn n<bfriesen@simple.dallas.tx.us> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'm4/init.m4')
-rw-r--r--m4/init.m426
1 files changed, 19 insertions, 7 deletions
diff --git a/m4/init.m4 b/m4/init.m4
index 1d5dffd95..fc0514897 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -9,8 +9,17 @@
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
-# ---------------------------
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
@@ -39,18 +48,21 @@ fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
-dnl Error out on old-style AM_INIT_AUTOMAKE calls.
-m4_ifval([$2], [m4_fatal(
-[$0: old-style two- and three-arguments forms are now unsupported. For more info:
-http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])])
-_AM_SET_OPTIONS([$1])dnl
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])