From: Stefano Lattarini Date: Tue, 11 Jun 2013 19:20:18 +0000 (+0200) Subject: lang, suffix rules: don't require C stuff needlessly X-Git-Tag: v1.13.4~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f7cc4fe88b5f802c9dc2ba78326819d2d62f2dc;p=platform%2Fupstream%2Fautomake.git lang, suffix rules: don't require C stuff needlessly This change fixes automake bug#14560: when two or more user-defined suffix rules were present in a single Makefile.am, automake would needlessly include definition of some make variables related to C compilation in the generated Makefile.in. * automake.in (handle_languages): Fix logic to decide whether or not to include definitions of C compilation related variables in the generated Makefile.in: instead of doing so when two or more user-defined suffix rules are seen (which is a completely bogus criterion), do so when two or more compiled languages are used. * lib/Automake/Rule.pm (suffix_rules_count): Remove as no longer used. (@EXPORT): Adjust. * t/list-of-tests.mk (XFAIL_TESTS): No longer list the test script 'suffix-extra-c-stuff-pr14560.sh', which now passes. * NEWS: Update. Signed-off-by: Stefano Lattarini --- diff --git a/NEWS b/NEWS index d540aabce..a6f095336 100644 --- a/NEWS +++ b/NEWS @@ -91,6 +91,17 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +New in 1.13.4: + +* Bugs fixed: + + - Fix a minor regression introduced in Automake 1.13.3: when two or more + user-defined suffix rules were present in a single Makefile.am, + automake would needlessly include definition of some make variables + related to C compilation in the generated Makefile.in (bug#14560). + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + New in 1.13.3: * Documentation fixes: diff --git a/automake.in b/automake.in index 63d5bdfdd..835d3bd18 100644 --- a/automake.in +++ b/automake.in @@ -1572,10 +1572,11 @@ sub handle_languages # If the project is entirely C++ or entirely Fortran 77 (i.e., 1 # suffix rule was learned), don't bother with the C stuff. But if # anything else creeps in, then use it. - $needs_c = 1 - if $need_link || suffix_rules_count > 1; - - if ($needs_c) + my @languages_seen = map { $languages{$extension_map{$_}}->name } + (keys %extension_seen); + @languages_seen = uniq (@languages_seen); + $needs_c = 1 if @languages_seen > 1; + if ($need_link || $needs_c) { &define_compiler_variable ($languages{'c'}) unless defined $done{$languages{'c'}}; diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm index 7fe647492..a28a78d36 100644 --- a/lib/Automake/Rule.pm +++ b/lib/Automake/Rule.pm @@ -29,8 +29,7 @@ use Automake::DisjConditions; require Exporter; use vars '@ISA', '@EXPORT', '@EXPORT_OK'; @ISA = qw/Automake::Item Exporter/; -@EXPORT = qw (reset register_suffix_rule suffix_rules_count - next_in_suffix_chain +@EXPORT = qw (reset register_suffix_rule next_in_suffix_chain suffixes rules $KNOWN_EXTENSIONS_PATTERN depend %dependencies %actions register_action accept_extensions @@ -465,18 +464,6 @@ sub register_suffix_rule ($$$) } } -=item C<$count = suffix_rules_count> - -Return the number of suffix rules added while processing the current -F (excluding predefined suffix rules). - -=cut - -sub suffix_rules_count () -{ - return (scalar keys %_suffix_rules) - (scalar keys %_suffix_rules_builtin); -} - =item C<@list = suffixes> Return the list of known suffixes. diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index f2eb648c4..007094f86 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -42,7 +42,6 @@ t/remake-timing-bug-pr8365.sh \ t/lex-subobj-nodep.sh \ t/subobj-indir-pr13928.sh \ t/subobj-vpath-pr13928.sh \ -t/suffix-extra-c-stuff-pr14560.sh \ t/remake-am-pr10111.sh \ t/remake-m4-pr10111.sh \ $(perl_fake_XFAIL_TESTS)