automake-ng
[Top][All Lists]
Advanced

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

[Automake-NG] [PATCH 2/7] [ng] automake: new global variable '%known_ltl


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 2/7] [ng] automake: new global variable '%known_ltlibraries'
Date: Wed, 6 Jun 2012 00:21:02 +0200

This is just a preparatory refactoring in view of future changes.

* automake.in (%known_ltlibraries): New global variable.
(initialize_per_input): Reset it.
(handle_ltlibraries): Register processed libtool libraries in
'%known_ltlibraries' rather than in '%known_libraries'.
(lang_vala_finish): Also take into account the contents of
'%known_ltlibraries'; since we are at it, refactor a little
to remove some inconsistency and code duplication.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 automake.in |   21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/automake.in b/automake.in
index 0428cf9..7145ded 100644
--- a/automake.in
+++ b/automake.in
@@ -570,10 +570,11 @@ my %dep_files;
 # This is a list of all targets to run during "make dist".
 my @dist_targets;
 
-# Keep track of all programs declared in this Makefile, without
-# $(EXEEXT).  @substitutions@ are not listed.
+# Keep track of all programs and libraries declared in this Makefile,
+# without $(EXEEXT).  @substitutions@ are not listed.
 my %known_programs;
 my %known_libraries;
+my %known_ltlibraries;
 
 # This keeps track of which extensions we've seen (that we care
 # about).
@@ -681,6 +682,7 @@ sub initialize_per_input ()
 
     %known_programs = ();
     %known_libraries= ();
+    %known_ltlibraries= ();
 
     %extension_seen = ();
 
@@ -2651,7 +2653,7 @@ sub handle_ltlibraries
               . "did you mean '$suggestion'?")
        }
 
-      ($known_libraries{$onelib} = $bn) =~ s/\.la$//;
+      ($known_ltlibraries{$onelib} = $bn) =~ s/\.la$//;
 
       $where->push_context ("while processing Libtool library '$onelib'");
       $where->set (INTERNAL->get);
@@ -5401,13 +5403,14 @@ sub lang_vala_finish_target ($$)
 sub lang_vala_finish
 {
   my ($self) = @_;
+  my @names =
+    (
+      keys %known_programs,
+      keys %known_libraries,
+      keys %known_ltlibraries,
+    );
 
-  foreach my $prog (keys %known_programs)
-    {
-      lang_vala_finish_target ($self, $prog);
-    }
-
-  while (my ($name) = each %known_libraries)
+  foreach my $name (@names)
     {
       lang_vala_finish_target ($self, $name);
     }
-- 
1.7.9.5




reply via email to

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