automake-patches
[Top][All Lists]
Advanced

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

FYI: better location for `lib already installed in dir' messages


From: Alexandre Duret-Lutz
Subject: FYI: better location for `lib already installed in dir' messages
Date: 29 Sep 2002 15:07:31 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

I'm checking this in.

2002-09-29  Alexandre Duret-Lutz  <address@hidden>

        * 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.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1368
diff -u -r1.1368 automake.in
--- automake.in 29 Sep 2002 12:49:06 -0000      1.1368
+++ automake.in 29 Sep 2002 13:04:15 -0000
@@ -3341,12 +3341,16 @@
                               '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 @@
          # 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: tests/libtool6.test
===================================================================
RCS file: /cvs/automake/automake/tests/libtool6.test,v
retrieving revision 1.1
diff -u -r1.1 libtool6.test
--- tests/libtool6.test 23 Sep 2002 22:08:31 -0000      1.1
+++ tests/libtool6.test 29 Sep 2002 13:04:15 -0000
@@ -48,3 +48,5 @@
 $AUTOMAKE 2>stderr && exit 1
 cat stderr
 grep 'liba\.la.* installed .*lib' stderr
+grep 'Makefile.am:5:' stderr
+grep 'Makefile.am:2:' stderr

-- 
Alexandre Duret-Lutz





reply via email to

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