2008-09-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Fix -rpath arguments for nobase_*_LTLIBRARIES.
+ * automake.in (handle_ltlibraries): New hash %instsubdirs to
+ track the dirname of nobase ltlibraries, and tack it onto the
+ end of the -rpath argument. Also, fix the warning about ltlibs
+ installed in multiple locations to fit a bit better.
+ * tests/pr300-ltlib.test: Expose this bug here.
+ * tests/ltinstloc.test: New test.
+ * tests/Makefile.am: Update.
+ * NEWS: Update.
+
Man pages for automake and aclocal.
* configure.ac (HELP2MAN): New substitution.
* doc/Makefile.am (dist_man1_MANS, MAINTAINERCLEANFILES)
- Fix aix dependency tracking for libtool objects.
+ - For nobase_*_LTLIBRARIES with nonempty directory components, the
+ correct `-rpath' argument is used now.
+
* Bugs introduced by 1.10:
- Fix output of dummy dependency files in presence of post-processed
}
my %instdirs = ();
+ my %instsubdirs = ();
my %instconds = ();
my %liblocations = (); # Location (in Makefile.am) of each library.
foreach my $key (@prefix)
{
# Get the installation directory of each library.
- (my $dir = $key) =~ s/^nobase_//;
+ my $dir = $key;
+ my $strip_subdir = 1;
+ if ($dir =~ /^nobase_/)
+ {
+ $dir =~ s/^nobase_//;
+ $strip_subdir = 0;
+ }
my $var = rvar ($key . '_LTLIBRARIES');
# We reject libraries which are installed in several places
my ($var, $val, $cond, $full_cond) = @_;
my $hcond = $full_cond->human;
my $where = $var->rdef ($cond)->location;
+ my $ldir = '';
+ $ldir = '/' . dirname ($val)
+ if (!$strip_subdir);
# A library cannot be installed in different directory
# in overlapping conditions.
if (exists $instconds{$val})
if ($msg)
{
error ($where, $msg, partial => 1);
-
- my $dirtxt = "installed in `$dir'";
+ my $dirtxt = "installed " . ($strip_subdir ? "in" : "below") . " `$dir'";
$dirtxt = "built for `$dir'"
if $dir eq 'EXTRA' || $dir eq 'noinst' || $dir eq 'check';
my $dircond =
$instconds{$val} = new Automake::DisjConditions;
}
$instdirs{$val}{$full_cond} = $dir;
+ $instsubdirs{$val}{$full_cond} = $ldir;
$liblocations{$val}{$full_cond} = $where;
$instconds{$val} = $instconds{$val}->merge ($full_cond);
},
else
{
$val = ('-rpath $(' . $instdirs{$onelib}{$rcond} . 'dir)');
+ $val .= $instsubdirs{$onelib}{$rcond}
+ if defined $instsubdirs{$onelib}{$rcond};
}
if ($rcond->true)
{
ltcond2.test \
ltconv.test \
ltdeps.test \
+ltinstloc.test \
ltlibobjs.test \
ltlibsrc.test \
lzma.test \
ltcond2.test \
ltconv.test \
ltdeps.test \
+ltinstloc.test \
ltlibobjs.test \
ltlibsrc.test \
lzma.test \
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2008 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 3, 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, see <http://www.gnu.org/licenses/>.
+
+# Test for libtool errors for multiple install locations, esp. with nobase.
+
+
+required='libtoolize'
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AM_CONDITIONAL([COND], [:])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+if COND
+lib_LTLIBRARIES = liba1.la sub/liba2.la
+#else
+pkglib_LTLIBRARIES = liba1.la
+nobase_lib_LTLIBRARIES = sub/liba2.la
+endif
+END
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+AUTOMAKE_fails --add-missing
+
+cat >expected <<'END'
+configure.in:5: installing `./config.guess'
+configure.in:5: installing `./config.sub'
+Makefile.am:5: sub/liba2.la multiply defined in condition COND
+Makefile.am:5: `sub/liba2.la' should be installed below `lib' in condition COND ...
+Makefile.am:2: ... and should also be installed in `lib' in condition COND.
+Makefile.am:4: liba1.la multiply defined in condition COND
+Makefile.am:4: `liba1.la' should be installed in `pkglib' in condition COND ...
+Makefile.am:2: ... and should also be installed in `lib' in condition COND.
+Makefile.am:2: Libtool libraries can be built for only one destination.
+END
+
+diff stderr expected
+
+sed 's/#//' < Makefile.am > t
+mv -f t Makefile.am
+
+$AUTOMAKE
+grep ' -rpath \$(libdir)/sub' Makefile.in
+:
#! /bin/sh
-# Copyright (C) 2002, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2007, 2008 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
$AUTOCONF
$AUTOMAKE --copy --add-missing
./configure --prefix "`pwd`/inst"
-$MAKE
+$MAKE >stdout
+cat stdout
+
+grep 'liba.la .*-rpath .*lib' stdout
+grep 'liba.la .*-rpath .*lib/subdir' stdout && Exit 1
+grep 'libb.la .*-rpath .*lib/subdir' stdout
test -f subdir/liba.la
test -f subdir/libb.la
-$MAKE install
+$MAKE install 2>stderr
+cat stderr >&2
+grep 'remember.*--finish' stderr && Exit 1
test -f inst/lib/liba.la
test -f inst/lib/subdir/libb.la