automake
[Top][All Lists]
Advanced

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

95-libs-var-am.patch


From: Akim Demaille
Subject: 95-libs-var-am.patch
Date: Sun, 01 Apr 2001 21:56:09 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * automake.in (&read_am_file, &file_contents_internal): Don't
        define macros when `FALSE', to avoid errors on doubly defined
        variables but under condition `FALSE'.  In order to allow...
        (&am_install_var): When reading the associated file for the first
        time, enable `%?FIRST%'.
        (&handle_libraries): Let libs.am define $(AR) and $(RANLIB).
        * libs.am: Do it when `%?FIRST%'.
        
        
Index: automake.in
--- automake.in Wed, 28 Mar 2001 22:32:32 +0200 akim (am/f/39_automake.i 1.225 
755)
+++ automake.in Wed, 28 Mar 2001 22:39:50 +0200 akim (am/f/39_automake.i 1.225 
755)
@@ -2253,9 +2253,6 @@ sub handle_libraries
            }
        }
     }
-
-    &define_variable ('AR', 'ar');
-    &define_configure_variable ('RANLIB');
 }
 
 
@@ -6277,8 +6274,9 @@ sub read_am_file
                  $var_comment{$last_var_name} .= "$comment";
                  $comment = $spacing = '';
                  macro_define ($last_var_name, 0,
-                                  $last_var_type, $cond,
-                                  $last_var_value, $.);
+                               $last_var_type, $cond,
+                               $last_var_value, $.)
+                   if $cond ne 'FALSE';
                  push (@var_list, $last_var_name);
                }
            }
@@ -6368,8 +6366,9 @@ sub read_am_file
                $comment = $spacing = '';
 
                macro_define ($last_var_name, 0,
-                                $last_var_type, $cond,
-                                $last_var_value, $.);
+                             $last_var_type, $cond,
+                             $last_var_value, $.)
+                 if $cond ne 'FALSE';
                push (@var_list, $last_var_name);
              }
        }
@@ -6776,7 +6775,8 @@ sub file_contents_internal ($%)
            $var_comment{$var} .= "$comment";
            # Strip the continuation backslashes.
            $val =~ s/\\$//mg;
-           macro_define ($var, 1, $type, $cond, $val, $.);
+           macro_define ($var, 1, $type, $cond, $val, $.)
+             if $cond ne 'FALSE';
            push (@var_list, $var);
 
            # If the user has set some variables we were in charge
@@ -6985,6 +6985,9 @@ sub am_install_var
     my @used = ();
     my @result = ();
 
+    # True if the iteration is the first one.  Used for instance to
+    # output parts of the associated file only once.
+    my $first = 0;
     foreach my $X (sort keys %valid)
     {
        my $one_name = $X . '_' . $primary;
@@ -7105,7 +7108,9 @@ sub am_install_var
            # Singular form of $PRIMARY.
            (my $one_primary = $primary) =~ s/S$//;
            $output_rules .= &file_contents ($file,
-                                            ('PRIMARY'     => $primary,
+                                            ('FIRST' => $first,
+
+                                             'PRIMARY'     => $primary,
                                              'ONE_PRIMARY' => $one_primary,
                                              'DIR'         => $X,
                                              'NDIR'        => $nodir_name,
@@ -7114,6 +7119,8 @@ sub am_install_var
                                              'EXEC'    => $exec_p,
                                              'INSTALL' => $install_p,
                                              'DIST'    => $dist_p));
+
+           $first = '';
        }
     }
 
Index: libs.am
--- libs.am Wed, 28 Mar 2001 22:32:32 +0200 akim (am/g/32_libs.am 1.9 644)
+++ libs.am Wed, 28 Mar 2001 22:37:41 +0200 akim (am/g/32_libs.am 1.9 644)
@@ -16,6 +16,16 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
+
+## ----------- ##
+## Variables.  ##
+## ----------- ##
+
+if %?FIRST%
+AR = ar
+RANLIB = @RANLIB@
+endif %?FIRST%
+
 ## ------------ ##
 ## Installing.  ##
 ## ------------ ##



reply via email to

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