automake-patches
[Top][All Lists]
Advanced

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

Patch: FYI: 1.4 versioned install


From: Tom Tromey
Subject: Patch: FYI: 1.4 versioned install
Date: 14 Jul 2002 11:44:34 -0600

This patch back-ports the versioned install code to the 1.4 branch.
It passes the test suite and seems to install correctly.

I've probably said that there wouldn't be another 1.4 release.  Well,
I lied :-).  There probably will be one, once this has been tested a
bit more.  It turns out that some groups can use this to help them
transition to 1.6 piecemeal.  (In this case the impetus came from
Gnome.)

So, we'll most likely do one final 1.4 release that will allow 1.4 and
1.[67...] to be installed simultaneously.  Then such groups can
explicitly invoke `automake-1.4' or `automake-1.6' from their build
scripts.

I guess they'll run into problems when 1.7 comes out.  Not sure what
to do about that.

I had to fix a buglet in the AC_OUTPUT `:' processing for this patch
to work.  That buglet is already fixed in the main line.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        Versioned installs:
        * m4/Makefile.am (m4datadir): Use APIVERSION.
        (m4data_DATA): Added amversion.m4.
        (DISTCLEANFILES): New macro.
        * Makefile.am (install-exec-hook): New target.
        (uninstall-hook): Likewise.
        (pkgvdata_DATA): Use pkgvdatadir.
        (scriptdir): Likewise.
        (EXTRA_DIST): Use pkgvdata_DATA.
        * configure: Rebuilt.
        * configure.in (APIVERSION): New subst.
        (pkgvdatadir): Likewise.
        (m4/amversion): Create.
        (LN): New subst; check for working ln.
        * aclocal.in ($APIVERSION): New global.
        (parse_arguments): Use APIVERSION.
        (default_acdir): New global.
        Don't explicitly pass acdir to scan_m4_files.
        * automake.in (am_dir): Use APIVERSION.
        (handle_configure): Don't overwrite entries in @other_input_files
        when processing.
        * m4/amversion.in: New file.
        * m4/init.m4 (AM_INIT_AUTOMAKE): Look for versioned aclocal,
        automake.
        * missing: Accept versioned aclocal.

Index: Makefile.am
===================================================================
RCS file: /cvs/automake/automake/Makefile.am,v
retrieving revision 1.126.4.3
diff -u -r1.126.4.3 Makefile.am
--- Makefile.am 9 Jun 2001 13:04:23 -0000 1.126.4.3
+++ Makefile.am 14 Jul 2002 17:35:11 -0000
@@ -18,12 +18,12 @@
 program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am \
 subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
 
-pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 $(amfiles)
+pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 $(amfiles)
 
 ## These must all be executable when installed.  However, if we use
 ## _SCRIPTS, then the program transform will be applied, which is not
 ## what we want.  So we make them executable by hand.
-scriptdir = $(pkgdatadir)
+scriptdir = $(pkgvdatadir)
 script_DATA = config.guess config.sub install-sh mdate-sh missing \
 mkinstalldirs elisp-comp ylwrap acinstall
 
@@ -32,7 +32,27 @@
          chmod +x $(DESTDIR)$(scriptdir)/$$prog; \
        done
 
-EXTRA_DIST = acinstall $(pkgdata_DATA) $(script_DATA)
+## Make versioned links.  We only run the transform on the root name;
+## then we make a versioned link with the transformed base name.  This
+## seemed like the most reasonable approach.
+install-exec-hook:
+       @$(POST_INSTALL)
+       @for p in $(bin_SCRIPTS); do \
+         f="`echo $$p|sed '$(transform)'`"; \
+         fv="$$f-$(APIVERSION)"; \
+         rm -f $(DESTDIR)$(bindir)/$$fv; \
+         echo " $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv"; \
+         $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv; \
+       done
+
+uninstall-hook:
+       @for p in $(bin_SCRIPTS); do \
+         f="`echo $$p|sed '$(transform)'`"; \
+         fv="$$f-$(APIVERSION)"; \
+         rm -f $(DESTDIR)$(bindir)/$$fv; \
+       done
+
+EXTRA_DIST = acinstall $(pkgvdata_DATA) $(script_DATA)
 
 # The following requires a fixed version of the Emacs 19.30 etags.
 ETAGS_ARGS = automake.in aclocal.in --lang=none \
Index: aclocal.in
===================================================================
RCS file: /cvs/automake/automake/aclocal.in,v
retrieving revision 1.40.4.4
diff -u -r1.40.4.4 aclocal.in
--- aclocal.in 15 Jul 2001 11:06:17 -0000 1.40.4.4
+++ aclocal.in 14 Jul 2002 17:35:12 -0000
@@ -3,7 +3,7 @@
 # @configure_input@
 
 # aclocal - create aclocal.m4 by scanning configure.ac
-# Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002 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
@@ -29,10 +29,13 @@
 
 # Some constants.
 $VERSION = "@VERSION@";
+$APIVERSION = "@APIVERSION@";
 $PACKAGE = "@PACKAGE@";
 $prefix = "@prefix@";
 # Note that this isn't pkgdatadir, but a separate directory.
+# Note also that the versioned directory is handled later.
 $acdir = "@datadir@/aclocal";
+$default_acdir = $acdir;
 
 # Some globals.
 
@@ -106,7 +109,7 @@
 
 
 local (@dirlist) = &parse_arguments (@ARGV);
-&scan_m4_files ($acdir, @dirlist);
+&scan_m4_files (@dirlist);
 &scan_configure;
 if (! $exit_status)
 {
@@ -194,6 +197,18 @@
        print $acdir, "\n";
        exit 0;
     }
+
+    # Search the versioned directory near the end, and then the
+    # unversioned directory last.  Only do this if the user didn't
+    # override acdir.
+    push (@dirlist, "$acdir-$APIVERSION")
+       if $acdir eq $default_acdir;
+
+    # By default $(datadir)/aclocal doesn't exist.  We don't want to
+    # get an error in the case where we are searching the default
+    # directory and it hasn't been created.
+    push (@dirlist, $acdir)
+       unless $acdir eq $default_acdir && ! -d $acdir;
 
     return @dirlist;
 }
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.644.4.20
diff -u -r1.644.4.20 automake.in
--- automake.in 23 Aug 2001 04:39:03 -0000 1.644.4.20
+++ automake.in 14 Jul 2002 17:35:17 -0000
@@ -6,7 +6,7 @@
     if 0;
 
 # automake - create Makefile.in from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001 Free Software 
Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002 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
@@ -32,7 +32,7 @@
 $VERSION = "@VERSION@";
 $PACKAGE = "@PACKAGE@";
 $prefix = "@prefix@";
-$am_dir = "@datadir@/@PACKAGE@";
+$am_dir = "@datadir@/@address@hidden@APIVERSION@";
 $TAR = "@TAR@";
 
 # String constants.
@@ -3233,12 +3233,13 @@
     # Now look for other files in this directory which must be remade
     # by config.status, and generate rules for them.
     local (@actual_other_files) = ();
-    local ($file, $local);
+    local ($lfile, $local);
     local (@inputs, @rewritten_inputs, $single);
     local ($need_rewritten);
-    foreach $file (@other_input_files)
+    foreach $lfile (@other_input_files)
     {
-       if ($file =~ /^([^:]*):(.*)$/)
+       local ($file);
+       if ($lfile =~ /^([^:]*):(.*)$/)
        {
            # This is the ":" syntax of AC_OUTPUT.
            $file = $1;
@@ -3250,6 +3251,7 @@
        else
        {
            # Normal usage.
+           $file = $lfile;
            $local = &basename ($file);
            @inputs = ($local . '.in');
            @rewritten_inputs =
Index: configure.in
===================================================================
RCS file: /cvs/automake/automake/configure.in,v
retrieving revision 1.67.4.11
diff -u -r1.67.4.11 configure.in
--- configure.in 15 Jul 2001 17:43:12 -0000 1.67.4.11
+++ configure.in 14 Jul 2002 17:35:18 -0000
@@ -14,5 +14,36 @@
    AC_MSG_ERROR([perl 5.001 has bug which causes automake to fail])
 fi
 
-AC_OUTPUT([Makefile automake aclocal m4/Makefile tests/Makefile],
+# The API version is the base version.  We must guarantee
+# compatibility for all releases with the same API version.
+# Our current rule is that:
+# * All releases, including the prereleases, in an X.Y series
+#   are compatible.  So 1.5.1c is compatible with 1.5.
+# * Prereleases on the trunk are all incompatible -- 1.5b and 1.5c
+#   aren't the same.
+APIVERSION=`echo "$VERSION" | sed -e 
's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'`
+AC_SUBST(APIVERSION)
+
+# A versioned directory, defined here for convenience.
+pkgvdatadir="\${datadir}/automake-${APIVERSION}"
+AC_SUBST(pkgvdatadir)
+
+# Test for ln.  We need use it to install the versioned binaries.
+AC_MSG_CHECKING([whether ln works])
+AC_CACHE_VAL([am_cv_prog_ln], [
+rm -f conftest conftest.file
+: >conftest.file
+if ln conftest.file conftest 2>/dev/null; then
+  am_cv_prog_ln=ln
+else
+  am_cv_prog_ln='cp -p'
+fi
+rm -f conftest conftest.file])
+LN="$am_cv_prog_ln"
+AC_SUBST([LN])
+result=no
+test "x$am_cv_prog_ln" = xln && result=yes
+AC_MSG_RESULT([$result])
+
+AC_OUTPUT([Makefile automake aclocal m4/amversion.m4:m4/amversion.in 
m4/Makefile tests/Makefile],
 [chmod +x automake aclocal])
Index: missing
===================================================================
RCS file: /cvs/automake/automake/missing,v
retrieving revision 1.7.6.3
diff -u -r1.7.6.3 missing
--- missing 15 Jul 2001 16:39:57 -0000 1.7.6.3
+++ missing 14 Jul 2002 17:35:18 -0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
 # Franc,ois Pinard <address@hidden>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -66,7 +66,7 @@
     exit 1
     ;;
 
-  aclocal)
+  aclocal*)
     echo 1>&2 "\
 WARNING: \`$1' is missing on your system.  You should only need it if
          you modified \`acinclude.m4' or \`$configure_ac'.  You might want
@@ -103,7 +103,7 @@
     touch $touch_files
     ;;
 
-  automake)
+  automake*)
     echo 1>&2 "\
 WARNING: \`$1' is missing on your system.  You should only need it if
          you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'.
Index: stamp-vti
===================================================================
RCS file: /cvs/automake/automake/stamp-vti,v
retrieving revision 1.68.4.10
diff -u -r1.68.4.10 stamp-vti
--- stamp-vti 15 Jul 2001 17:17:51 -0000 1.68.4.10
+++ stamp-vti 14 Jul 2002 17:35:18 -0000
@@ -1,3 +1,3 @@
 @set UPDATED 6 January 1999
address@hidden EDITION 1.4-p5
address@hidden VERSION 1.4-p5
address@hidden EDITION 1.4-p5a
address@hidden VERSION 1.4-p5a
Index: version.texi
===================================================================
RCS file: /cvs/automake/automake/version.texi,v
retrieving revision 1.141.4.10
diff -u -r1.141.4.10 version.texi
--- version.texi 15 Jul 2001 17:17:52 -0000 1.141.4.10
+++ version.texi 14 Jul 2002 17:35:18 -0000
@@ -1,3 +1,3 @@
 @set UPDATED 6 January 1999
address@hidden EDITION 1.4-p5
address@hidden VERSION 1.4-p5
address@hidden EDITION 1.4-p5a
address@hidden VERSION 1.4-p5a
Index: m4/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/m4/Makefile.am,v
retrieving revision 1.23.6.1
diff -u -r1.23.6.1 Makefile.am
--- m4/Makefile.am 9 Jun 2001 13:04:24 -0000 1.23.6.1
+++ m4/Makefile.am 14 Jul 2002 17:35:18 -0000
@@ -2,10 +2,12 @@
 
 MAINT_CHARSET = latin1
 
-m4datadir = $(datadir)/aclocal
-m4data_DATA = ccstdc.m4 cond.m4 dmalloc.m4 error.m4 header.m4 init.m4 \
-lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 multi.m4 \
-obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 \
+m4datadir = $(datadir)/aclocal-$(APIVERSION)
+m4data_DATA = amversion.m4 ccstdc.m4 cond.m4 dmalloc.m4 error.m4 \
+header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 \
+multi.m4 obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 \
 termios.m4 winsz.m4
+
+DISTCLEANFILES = amversion.m4
 
 EXTRA_DIST = $(m4data_DATA)
Index: m4/amversion.in
===================================================================
RCS file: m4/amversion.in
diff -N m4/amversion.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ m4/amversion.in 14 Jul 2002 17:35:18 -0000
@@ -0,0 +1,28 @@
+# Copyright 2002  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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="@APIVERSION@"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+        [AM_AUTOMAKE_VERSION(address@hidden@])])
Index: m4/init.m4
===================================================================
RCS file: /cvs/automake/automake/m4/init.m4,v
retrieving revision 1.9.4.1
diff -u -r1.9.4.1 init.m4
--- m4/init.m4 23 Jun 2001 12:15:34 -0000 1.9.4.1
+++ m4/init.m4 14 Jul 2002 17:35:18 -0000
@@ -8,7 +8,8 @@
 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
 
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_REQUIRE([AC_PROG_INSTALL])
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])
 PACKAGE=[$1]
 AC_SUBST(PACKAGE)
 VERSION=[$2]
@@ -24,9 +25,9 @@
 AC_REQUIRE([AC_ARG_PROGRAM])
 dnl FIXME This is truly gross.
 missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
 AC_REQUIRE([AC_PROG_MAKE_SET])])
Index: tests/ChangeLog
from  Tom Tromey  <address@hidden>

        * defs (ACLOCAL): Also search build directory for m4 files.

Index: tests/defs
===================================================================
RCS file: /cvs/automake/automake/tests/defs,v
retrieving revision 1.12
diff -u -r1.12 defs
--- tests/defs 26 Sep 1998 19:06:07 -0000 1.12
+++ tests/defs 14 Jul 2002 17:35:19 -0000
@@ -56,4 +56,7 @@
 AUTOMAKE="$PERL ../../automake --amdir=$srcdir/.. --foreign"
 
 # See how aclocal should be run.
-ACLOCAL="$PERL ../../aclocal --acdir=$srcdir/../m4"
+# Most of the files are in $srcdir/../m4.  However amversion.m4 is
+# generated in ../m4, so we include that directory in the search
+# path too.
+ACLOCAL="$PERL `pwd`/../../aclocal -I `pwd`/../../m4 --acdir=$srcdir/../m4"



reply via email to

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