Merge branch 'micro' into maint
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 12 Jun 2013 19:22:58 +0000 (21:22 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 12 Jun 2013 19:22:58 +0000 (21:22 +0200)
* micro:
  THANKS: update e-mall address for Ralf Corsepius
  lang, suffix rules: don't require C stuff needlessly
  tests: expose automake bug#14560

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
NEWS
THANKS
bin/automake.in
lib/Automake/Rule.pm
t/list-of-tests.mk
t/no-extra-c-stuff.sh [new file with mode: 0644]
t/no-extra-makefile-code.sh
t/suffix-extra-c-stuff-pr14560.sh [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 46d6b2e..1cc00a4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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:
diff --git a/THANKS b/THANKS
index 763c285..cc5e238 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -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
index 40b3181..283d1bb 100644 (file)
@@ -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'}};
index 7fe6474..a28a78d 100644 (file)
@@ -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.
index d0c1b60..d4e1589 100644 (file)
@@ -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 (file)
index 0000000..de0dd12
--- /dev/null
@@ -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
+
+:
index 086b6c6..64ef502 100644 (file)
@@ -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 (file)
index 0000000..45fdd17
--- /dev/null
@@ -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
+
+: