]> sourceware.org Git - automake.git/commitdiff
* automake.in (handle_ltlibraries): Record library locations in
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 29 Sep 2002 13:08:16 +0000 (13:08 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 29 Sep 2002 13:08:16 +0000 (13:08 +0000)
%liblocations, and print the previous declaration on error.
* tests/libtool6.test: Check that the locations of the two
definitions are shown.

ChangeLog
automake.in
tests/libtool6.test

index b7f79b21bdf5136b0ff6087d0b0b221cfd352d6b..3ec77b799d1435db3545880a29b3f555622f3593 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2002-09-29  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
+       * 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.
index a311c30329890a66662fc7d672e1bbd65810f49b..64a2899e8f13fe9f4104749b479d53fe5fd946b7 100755 (executable)
@@ -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;
            }
        }
     }
index 8424aee6e9a82c7f2638fdde53fb8f87a1995c9b..f88ac8d4b1722ab6587f0d4ef1beb5d8491e50f5 100755 (executable)
@@ -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
This page took 0.039608 seconds and 5 git commands to generate.