From: Stefano Lattarini Date: Wed, 23 May 2012 22:10:53 +0000 (+0200) Subject: [ng] rule, lang: get rid of 'suffix_rules_count', simplify logic X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1908e701fa761a03786a19269ce501819073c364;p=thirdparty%2Fautomake.git [ng] rule, lang: get rid of 'suffix_rules_count', simplify logic Apparently, some of our pre-existing logic used to determine when we need to bring C-related stuff into the generated Makefile was too strict; we can simplify it a bit, still keeping the testsuite clean. * automake.in (handle_languages): Bring in C stuff only if we've seen a non-pure language (like yacc or vala) or if '$need_link' is true, without bothering to check whether we've seen more than one suffix rules. This change removes the only caller in the automake code base of ... * lib/Automake/Rule.pm (suffix_rules_count): ... this subroutine, which has thus been removed. (@EXPORT): Adjust. Signed-off-by: Stefano Lattarini --- diff --git a/automake.in b/automake.in index 72c6d3646..86e00190f 100644 --- a/automake.in +++ b/automake.in @@ -1537,13 +1537,8 @@ sub handle_languages check_user_variables @dont_override; } - # 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) + # Non-pure languages, or languages lacking a linker of their own. + if ($needs_c || $need_link) { &define_compiler_variable ($languages{'c'}) unless defined $done{$languages{'c'}}; diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm index e3fd69aee..24066235c 100644 --- a/lib/Automake/Rule.pm +++ b/lib/Automake/Rule.pm @@ -29,7 +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 +@EXPORT = qw (reset register_suffix_rule rules $suffix_rules depend %dependencies %actions register_action reject_rule msg_rule msg_cond_rule err_rule err_cond_rule @@ -424,18 +424,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_default); -} - =item C Return the C object for the rule