automake-patches
[Top][All Lists]
Advanced

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

Patch: FYI: versioned installs


From: Tom Tromey
Subject: Patch: FYI: versioned installs
Date: 15 Jan 2002 17:08:32 -0700

I'm checking this in.

This adds versioned installs to automake.

We add the version to the install directories, and we also make
versioned hard links of the installed executables.  aclocal searches
the versioned directory before the unversioned one ($datadir/aclocal).
The unversioned directory is not created by default.

This patch also fixes a minor bug in configure.in.  aclocal needs to
find the built m4 files as well.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * lib/missing: Match against `automake*' to pick up versioned
        automake.
        * m4/init.m4 (AM_INIT_AUTOMAKE): Use versioned automake name.
        * m4/amversion.in (AM_AUTOMAKE_VERSION): Set am__version
        variable.
        * lib/am/Makefile.am (amdir): Use pkgvdatadir.
        * lib/Makefile.am (dist_pkgvdata_DATA): Renamed to use
        pkgvdatadir.
        (scriptdir): Use pkgvdatadir.
        (installcheck-local): Likewise.
        * lib/Automake/Makefile.am (perllibdir): Use pkgvdatadir.
        * automake.in (perllibdir): Added VERSION.
        (libdir): Likewise.
        * aclocal.in (parse_arguments): Search versioned directory.  Don't
        push unversioned directory unless it exists.
        (perllibdir): Added VERSION.
        (default_acdir): New global.
        * m4/Makefile.am (m4datadir): Added $(VERSION).
        * Makefile.am (install-exec-hook): New target.
        * configure.in (ACLOCAL): Search build directory.
        (pkgvdatadir): New subst.

Index: Makefile.am
===================================================================
RCS file: /cvs/automake/automake/Makefile.am,v
retrieving revision 1.179
diff -u -r1.179 Makefile.am
--- Makefile.am 2001/12/31 00:16:36 1.179
+++ Makefile.am 2002/01/15 23:49:08
@@ -36,6 +36,19 @@
 
 EXTRA_DIST = ChangeLog.1996 ChangeLog.1998 ChangeLog.2000
 
+## 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-$(VERSION)"; \
+         rm -f $(DESTDIR)$(bindir)/$$fv; \
+         echo " ln $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv"; \
+         ln $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv; \
+       done
+
 ################################################################
 ##
 ## Everything past here is useful to the maintainer, but probably not
Index: TODO
===================================================================
RCS file: /cvs/automake/automake/TODO,v
retrieving revision 1.414
diff -u -r1.414 TODO
--- TODO 2001/09/22 16:05:36 1.414
+++ TODO 2002/01/15 23:49:10
@@ -1,3 +1,7 @@
+we can't seem to AC_SUBST(pkgdatadir)
+the version from header-vars overrides
+why is that?
+
 check should depend on all
   from ben elliston
 
Index: aclocal.in
===================================================================
RCS file: /cvs/automake/automake/aclocal.in,v
retrieving revision 1.62
diff -u -r1.62 aclocal.in
--- aclocal.in 2001/10/20 11:14:36 1.62
+++ aclocal.in 2002/01/15 23:49:10
@@ -28,7 +28,7 @@
 BEGIN
 {
   my $prefix = "@prefix@";
-  my $perllibdir = $ENV{'perllibdir'} || "@datadir@/@PACKAGE@";
+  my $perllibdir = $ENV{'perllibdir'} || "@datadir@/@address@hidden@VERSION@";
   unshift @INC, "$perllibdir";
 }
 
@@ -40,7 +40,9 @@
 $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.
 
@@ -210,8 +212,17 @@
        exit 0;
     }
 
-    # Search our install directory last.
-    push (@dirlist, $acdir);
+    # 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-$VERSION")
+       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.1264
diff -u -r1.1264 automake.in
--- automake.in 2002/01/14 00:29:16 1.1264
+++ automake.in 2002/01/15 23:49:17
@@ -32,7 +32,7 @@
 BEGIN
 {
   my $prefix = "@prefix@";
-  my $perllibdir = $ENV{'perllibdir'} || "@datadir@/@PACKAGE@";
+  my $perllibdir = $ENV{'perllibdir'} || "@datadir@/@address@hidden@VERSION@";
   unshift @INC, "$perllibdir";
 }
 
@@ -125,7 +125,7 @@
 my $VERSION = "@VERSION@";
 my $PACKAGE = "@PACKAGE@";
 my $prefix = "@prefix@";
-my $libdir = "@datadir@/@PACKAGE@";
+my $libdir = "@datadir@/@address@hidden@VERSION@";
 
 # String constants.
 my $IGNORE_PATTERN = '^\s*##([^#\n].*)?\n';
@@ -7130,8 +7130,8 @@
     # Read user file, which might override some of our values.
     &read_am_file ($amfile);
 
-    # Ouput all the Automake variables.  If the user changed one, then
-    # it is now marked as owned by the user.
+    # Output all the Automake variables.  If the user changed one,
+    # then it is now marked as owned by the user.
     foreach my $var (uniq @var_list)
     {
        # Don't process user variables.
Index: configure.in
===================================================================
RCS file: /cvs/automake/automake/configure.in,v
retrieving revision 1.98
diff -u -r1.98 configure.in
--- configure.in 2002/01/09 08:52:05 1.98
+++ configure.in 2002/01/15 23:49:19
@@ -26,9 +26,13 @@
 
 AM_INIT_AUTOMAKE([1.5 dist-bzip2])
 
+# A versioned directory, defined here for convenience.
+pkgvdatadir="\${datadir}/automake-${VERSION}"
+AC_SUBST(pkgvdatadir)
+
 # $AUTOMAKE and $ACLOCAL are always run after a `cd $top_srcdir',
 # hence `.' is really what we want for perllibdir and libdir.
-ACLOCAL="perllibdir=./lib `pwd`/aclocal --acdir=m4"
+ACLOCAL="perllibdir=./lib `pwd`/aclocal --acdir=m4 -I `pwd`/m4"
 AUTOMAKE="perllibdir=./lib `pwd`/automake --libdir=lib"
 
 AC_PATH_PROG(PERL, perl)
Index: lib/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/lib/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- lib/Makefile.am 2001/09/22 16:05:36 1.3
+++ lib/Makefile.am 2002/01/15 23:49:19
@@ -21,12 +21,12 @@
 
 SUBDIRS = Automake am
 
-dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1
+dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1
 
 ## 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)
 dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
 mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile
 
@@ -41,5 +41,5 @@
 ## doesn't exist, then this test is meaningless anyway.
 installcheck-local:
        for file in $(dist_script_DATA); do \
-         $(PERL) -e "exit ! -x '$(pkgdatadir)/$$file';" || exit 1; \
+         $(PERL) -e "exit ! -x '$(pkgvdatadir)/$$file';" || exit 1; \
        done
Index: lib/missing
===================================================================
RCS file: /cvs/automake/automake/lib/missing,v
retrieving revision 1.18
diff -u -r1.18 missing
--- lib/missing 2001/09/17 14:32:08 1.18
+++ lib/missing 2002/01/15 23:49:20
@@ -139,7 +139,7 @@
     touch $touch_files
     ;;
 
-  automake)
+  automake*)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
        exit 1
Index: lib/Automake/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- lib/Automake/Makefile.am 2001/10/02 17:17:45 1.2
+++ lib/Automake/Makefile.am 2002/01/15 23:49:20
@@ -1,4 +1,4 @@
 ## Process this file with automake to create Makefile.in
 
-perllibdir = $(pkgdatadir)/Automake
+perllibdir = $(pkgvdatadir)/Automake
 dist_perllib_DATA = Struct.pm General.pm XFile.pm
Index: lib/am/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/Makefile.am,v
retrieving revision 1.169
diff -u -r1.169 Makefile.am
--- lib/am/Makefile.am 2001/09/22 16:05:36 1.169
+++ lib/am/Makefile.am 2002/01/15 23:49:20
@@ -19,7 +19,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-amdir = $(pkgdatadir)/am
+amdir = $(pkgvdatadir)/am
 
 dist_am_DATA = ansi2knr.am check.am clean-hdr.am clean.am compile.am \
 configure.am data.am dejagnu.am depend.am depend2.am distdir.am \
Index: m4/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/m4/Makefile.am,v
retrieving revision 1.40
diff -u -r1.40 Makefile.am
--- m4/Makefile.am 2002/01/07 20:25:24 1.40
+++ m4/Makefile.am 2002/01/15 23:49:20
@@ -19,7 +19,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-m4datadir = $(datadir)/aclocal
+m4datadir = $(datadir)/aclocal-$(VERSION)
 
 dist_m4data_DATA = as.m4 auxdir.m4 ccstdc.m4 cond.m4 depend.m4 depout.m4 \
 dmalloc.m4 gcj.m4 header.m4 init.m4 install-sh.m4 lex.m4 lispdir.m4 \
Index: m4/amversion.in
===================================================================
RCS file: /cvs/automake/automake/m4/amversion.in,v
retrieving revision 1.1
diff -u -r1.1 amversion.in
--- m4/amversion.in 2002/01/07 20:25:24 1.1
+++ m4/amversion.in 2002/01/15 23:49:20
@@ -18,7 +18,7 @@
 # ----------------------------
 # 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],[])
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__version="$1"])
 
 # AM_SET_CURRENT_AUTOMAKE_VERSION
 # -------------------------------
Index: m4/init.m4
===================================================================
RCS file: /cvs/automake/automake/m4/init.m4,v
retrieving revision 1.39
diff -u -r1.39 init.m4
--- m4/init.m4 2002/01/12 18:48:53 1.39
+++ m4/init.m4 2002/01/15 23:49:20
@@ -75,7 +75,7 @@
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
 AM_MISSING_PROG(ACLOCAL, aclocal)
 AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake)
+AM_MISSING_PROG(AUTOMAKE, "automake-${am__version}")
 AM_MISSING_PROG(AUTOHEADER, autoheader)
 AM_MISSING_PROG(MAKEINFO, makeinfo)
 AM_MISSING_PROG(AMTAR, tar)



reply via email to

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