From: Akim Demaille Date: Fri, 27 Apr 2001 13:31:26 +0000 (+0000) Subject: * automake.in (&read_am_file, &file_contents_internal): Don't X-Git-Tag: handle-languages~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6dd4b3bac81698c4adbf7d2812bdd23953224ff;p=thirdparty%2Fautomake.git * 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%'. --- diff --git a/ChangeLog b/ChangeLog index b0042af72..ad4e4685d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-04-27 Akim Demaille + + * 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 * automake.in (handle_compile): Let ansi2knr.am define $(ANSI2KNR). diff --git a/automake.in b/automake.in index e54a71b02..210c36fba 100755 --- a/automake.in +++ b/automake.in @@ -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 = ''; } } diff --git a/lib/am/libs.am b/lib/am/libs.am index 8dd856e3c..100b8dd7e 100644 --- a/lib/am/libs.am +++ b/lib/am/libs.am @@ -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. ## ## ------------ ## diff --git a/libs.am b/libs.am index 8dd856e3c..100b8dd7e 100644 --- a/libs.am +++ b/libs.am @@ -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. ## ## ------------ ##