From a7a8810bb074ec9bc40849dc919837fb11dad8c9 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 29 Sep 2002 13:08:16 +0000 Subject: [PATCH] * automake.in (handle_ltlibraries): Record library locations in %liblocations, and print the previous declaration on error. * tests/libtool6.test: Check that the locations of the two definitions are shown. --- ChangeLog | 5 +++++ automake.in | 16 +++++++++++----- tests/libtool6.test | 2 ++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7f79b21..3ec77b79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2002-09-29 Alexandre Duret-Lutz + * automake.in (handle_ltlibraries): Record library locations in + %liblocations, and print the previous declaration on error. + * tests/libtool6.test: Check that the locations of the two + definitions are shown. + For PR automake/360: Propagate more locations. * automake.in (handle_programs): Adjust usage of am_install_var's return value. Pass on locations as context to file_contents. diff --git a/automake.in b/automake.in index a311c303..64a2899e 100755 --- a/automake.in +++ b/automake.in @@ -3341,12 +3341,16 @@ sub handle_ltlibraries 'Libtool library used', 'LIBTOOL') if (@prefix); + 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_//; - for (variable_value_as_list_recursive ($key . '_LTLIBRARIES', 'all')) + for my $pair (variable_loc_and_value_as_list_recursive + ($key . '_LTLIBRARIES', 'all')) { + my ($where, $lib) = @$pair; # We reject libraries which are installed in several places, # because we don't handle this in the rules (think `-rpath'). # @@ -3365,14 +3369,16 @@ sub handle_ltlibraries # Diagnosing this case doesn't seem worth the plain (we'd # have to fill $instdirs on a per-condition basis, check # implied conditions, etc.) - if (defined $instdirs{$_} && $instdirs{$_} ne $dir) + if (defined $instdirs{$lib} && $instdirs{$lib} ne $dir) { - err_am ("`$_' is already going to be installed in " - . "`$instdirs{$_}'"); + err ($where, "`$lib' is already going to be installed in " + . "`$instdirs{$lib}'"); + err ($liblocations{$lib}, "`$lib' previously declared here"); } else { - $instdirs{$_} = $dir; + $instdirs{$lib} = $dir; + $liblocations{$lib} = $where->clone; } } } diff --git a/tests/libtool6.test b/tests/libtool6.test index 8424aee6..f88ac8d4 100755 --- a/tests/libtool6.test +++ b/tests/libtool6.test @@ -48,3 +48,5 @@ $ACLOCAL $AUTOMAKE 2>stderr && exit 1 cat stderr grep 'liba\.la.* installed .*lib' stderr +grep 'Makefile.am:5:' stderr +grep 'Makefile.am:2:' stderr -- 2.43.5