]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in (&read_am_file, &file_contents_internal): Don't
authorAkim Demaille <akim@epita.fr>
Fri, 27 Apr 2001 13:31:26 +0000 (13:31 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 27 Apr 2001 13:31:26 +0000 (13:31 +0000)
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%'.

ChangeLog
automake.in
lib/am/libs.am
libs.am

index b0042af720903a685efa9c7f110103d05e2fb9cc..ad4e4685d4244d1c1fa5e0f332abfa3088cf3f87 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-04-27  Akim Demaille  <akim@epita.fr>
+
+       * 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%'.
+
 2001-04-27  Akim Demaille  <akim@epita.fr>
 
        * automake.in (handle_compile): Let ansi2knr.am define $(ANSI2KNR).
index e54a71b02f37e221f5ab3bb609fe26bded6939d0..210c36fbaf585e94c20d7bcf660842955841b7f9 100755 (executable)
@@ -2296,9 +2296,6 @@ sub handle_libraries
            }
        }
     }
-
-    &define_variable ('AR', 'ar');
-    &define_configure_variable ('RANLIB');
 }
 
 
@@ -6425,8 +6422,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);
                }
            }
@@ -6516,8 +6514,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);
              }
        }
@@ -6923,7 +6922,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
@@ -7132,6 +7132,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;
@@ -7252,7 +7255,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,
@@ -7261,6 +7266,8 @@ sub am_install_var
                                              'EXEC'    => $exec_p,
                                              'INSTALL' => $install_p,
                                              'DIST'    => $dist_p));
+
+           $first = '';
        }
     }
 
index 8dd856e3c13993531eba8bfdfebf6174c7acad0f..100b8dd7e3cca0fc42ba7f4c2916988a202e94e6 100644 (file)
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
+
+## ----------- ##
+## Variables.  ##
+## ----------- ##
+
+if %?FIRST%
+AR = ar
+RANLIB = @RANLIB@
+endif %?FIRST%
+
 ## ------------ ##
 ## Installing.  ##
 ## ------------ ##
diff --git a/libs.am b/libs.am
index 8dd856e3c13993531eba8bfdfebf6174c7acad0f..100b8dd7e3cca0fc42ba7f4c2916988a202e94e6 100644 (file)
--- a/libs.am
+++ b/libs.am
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
+
+## ----------- ##
+## Variables.  ##
+## ----------- ##
+
+if %?FIRST%
+AR = ar
+RANLIB = @RANLIB@
+endif %?FIRST%
+
 ## ------------ ##
 ## Installing.  ##
 ## ------------ ##