diff options
-rw-r--r-- | NEWS | 11 | ||||
-rw-r--r-- | THANKS | 2 | ||||
-rw-r--r-- | bin/automake.in | 9 | ||||
-rw-r--r-- | lib/Automake/Rule.pm | 15 | ||||
-rw-r--r-- | t/list-of-tests.mk | 2 | ||||
-rw-r--r-- | t/no-extra-c-stuff.sh | 74 | ||||
-rw-r--r-- | t/no-extra-makefile-code.sh | 9 | ||||
-rw-r--r-- | t/suffix-extra-c-stuff-pr14560.sh | 37 |
8 files changed, 138 insertions, 21 deletions
@@ -213,6 +213,17 @@ New in 1.14: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +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: @@ -332,7 +332,7 @@ Rainer Orth ro@techfak.uni-bielefeld.de Rafael Laboissiere laboissiere@psy.mpg.de Rainer Tammer tammer@tammer.net Raja R Harinath harinath@cs.umn.edu -Ralf Corsepius corsepiu@faw.uni-ulm.de +Ralf Corsepius ralf.corsepius@gmail.com Ralf Menzel menzel@ls6.cs.uni-dortmund.de Ralf Wildenhues Ralf.Wildenhues@gmx.de Ralph Schleicher rs@purple.UL.BaWue.DE diff --git a/bin/automake.in b/bin/automake.in index 40b31814b..283d1bbfe 100644 --- a/bin/automake.in +++ b/bin/automake.in @@ -1481,10 +1481,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<Makefile> (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 d0c1b6083..d4e15892d 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -702,6 +702,7 @@ t/mkinst2.sh \ t/mkinst3.sh \ t/mmode.sh \ t/mmodely.sh \ +t/no-extra-c-stuff.sh \ t/no-extra-makefile-code.sh \ t/no-spurious-install-recursive.sh \ t/nobase.sh \ @@ -1082,6 +1083,7 @@ t/suffix-chain.tap \ t/suffix-custom-pr14441.sh \ t/suffix-custom-subobj.sh \ t/suffix-custom-subobj-and-specflg.sh \ +t/suffix-extra-c-stuff-pr14560.sh \ t/symlink.sh \ t/symlink2.sh \ t/syntax.sh \ diff --git a/t/no-extra-c-stuff.sh b/t/no-extra-c-stuff.sh new file mode 100644 index 000000000..de0dd12e9 --- /dev/null +++ b/t/no-extra-c-stuff.sh @@ -0,0 +1,74 @@ +#! /bin/sh +# Copyright (C) 2013 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check that Automake doesn't generated rules or definitions related +# to compilation of C sources for a project that doesn't use nor need +# a C Compiler. Inspired by the issues reported in automake bug#14560. + +am_create_testdir=empty +. test-init.sh + +cat > configure.ac <<END +AC_INIT([$me], [1.0]) +AC_CONFIG_AUX_DIR([.]) +AM_INIT_AUTOMAKE +AC_CONFIG_FILES([ + Makefile + sub/Makefile + sub2/Makefile +]) +AC_PROG_CXX +AC_PROG_F77 +AC_OUTPUT +END + +cat > Makefile.am <<END +SUBDIRS = sub sub2 +bin_PROGRAMS = bar +bar_SOURCES = bar.cc +END + +mkdir sub sub2 + +cat > sub/Makefile.am <<END +bin_PROGRAMS = foo +foo_SOURCES = foo.f +END + +cat > sub2/Makefile.am <<END +bin_PROGRAMS = baz +baz_SOURCES = baz.cxx +END + + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing + +test -f install-sh +test ! -e compile + +# Sanity checks. +$FGREP '$(CXX)' Makefile.in +$FGREP '$(CXX)' sub2/Makefile.in +$FGREP '$(F77)' Makefile.in sub2/Makefile.in && exit 1 +$FGREP '$(F77)' sub/Makefile.in +$FGREP '$(CXX)' sub/Makefile.in && exit 1 + +$EGREP '(^COMPILE|$\(CC\)|AM_V_CC)' \ + Makefile.in sub/Makefile.in sub2/Makefile.in && exit 1 + +: diff --git a/t/no-extra-makefile-code.sh b/t/no-extra-makefile-code.sh index 086b6c6ec..64ef502a8 100644 --- a/t/no-extra-makefile-code.sh +++ b/t/no-extra-makefile-code.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,12 +25,17 @@ echo AC_OUTPUT >> configure.ac : > Makefile.am +# Automake shouldn't need nor require these. rm -f depcomp compile $ACLOCAL + +# Don't use '--add-missing' here, so that we can implicitly +# check that the auxiliary scripts 'compile' and 'depcomp' +# are not spuriously required by Automake. $AUTOMAKE -$EGREP 'DEFAULT_INCLUDES|@am__isrc@|-compile|\$\(OBJEXT\)|tab\.[ch]' \ +$EGREP 'INCLUDES|@am__isrc@|-compile|\$\(OBJEXT\)|tab\.[ch]' \ Makefile.in && exit 1 : diff --git a/t/suffix-extra-c-stuff-pr14560.sh b/t/suffix-extra-c-stuff-pr14560.sh new file mode 100644 index 000000000..45fdd1774 --- /dev/null +++ b/t/suffix-extra-c-stuff-pr14560.sh @@ -0,0 +1,37 @@ +#! /bin/sh +# Copyright (C) 2013 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Automake bug#14560: if multiple user-specified suffix rules were +# present, Automake could generate useless definitions and rules +# related to C compilation. + +. test-init.sh + +cat > Makefile.am <<'END' +.foo.bar: + foo2bar -o $@ $< +.baz.qux: + baz2qux -o $@ $< +bin_SCRIPTS = a.bar b.qux +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE + +$EGREP '\$\(CC\)|COMPILE|AM_V_CC|-compile|INCLUDES' Makefile.in && exit 1 + +: |