automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12-3


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12-319-gfa1b4e1
Date: Fri, 25 May 2012 09:11:02 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=fa1b4e1c89d950830b12b5995d0e0e3160e8c87e

The branch, ng/master has been updated
       via  fa1b4e1c89d950830b12b5995d0e0e3160e8c87e (commit)
       via  0dd3513c0226497c0d8628b18530ef50274cbe70 (commit)
       via  1908e701fa761a03786a19269ce501819073c364 (commit)
       via  51caa48a7474f64882cbcebd476980b5559aa908 (commit)
       via  a4c439444a29f62ef21d24d3cbf676919ad1e426 (commit)
       via  15534af1cf51ab8d9bfcd1effddb84f04094b8ff (commit)
       via  09a19a1a9cc0f0f65a4463ed3aefcdcf3875002e (commit)
      from  fa806737f8739a248a7ab032e9682d5b738dae90 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fa1b4e1c89d950830b12b5995d0e0e3160e8c87e
Author: Stefano Lattarini <address@hidden>
Date:   Fri May 25 10:29:02 2012 +0200

    [ng] tests: fix spurious failure under "make distcheck"
    
    * t/verbatim.sh: This test copied in files from the directory of Automake
    internal '.am' fragments, and then overwrote one of them with 'cat >'.
    But that is bound to fail under a "make distcheck", because in that case
    all of the source directory (in particular the '.am' files in it) are made
    read only.  This can be fixed by unlinking the file we want to overwrite
    before actually writing to it.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 0dd3513c0226497c0d8628b18530ef50274cbe70
Merge: fa80673 1908e70
Author: Stefano Lattarini <address@hidden>
Date:   Fri May 25 10:20:32 2012 +0200

    Merge branch 'ng/suffix-simplify' into ng/master
    
    * ng/suffix-simplify:
      [ng] rule, lang: get rid of 'suffix_rules_count', simplify logic
      [ng] coverage: mixing Fortran and C++
      [ng] coverage: pure languages doesn't bring in C support
      [ng] rule: get rid of $KNOWN_EXTENSIONS_PATTERN
      [ng] coverage: custom pre-processes headers in prog_SOURCES

-----------------------------------------------------------------------

Summary of changes:
 automake.in                       |   16 +++------
 lib/Automake/Rule.pm              |   47 +------------------------
 t/{check5.sh => cxx-fortran.sh}   |   69 ++++++++++++++++++-------------------
 t/cxxnoc.sh                       |   37 --------------------
 t/fnoc.sh                         |   39 ---------------------
 t/no-c.tap                        |   57 ++++++++++++++++++++++++++++++
 t/{objc-deps.sh => suffix-hdr.sh} |   69 +++++++++++++++++++++----------------
 t/suffix3.sh                      |    7 ++++
 t/verbatim.sh                     |    4 ++
 9 files changed, 148 insertions(+), 197 deletions(-)
 copy t/{check5.sh => cxx-fortran.sh} (53%)
 delete mode 100755 t/cxxnoc.sh
 delete mode 100755 t/fnoc.sh
 create mode 100755 t/no-c.tap
 copy t/{objc-deps.sh => suffix-hdr.sh} (54%)

diff --git a/automake.in b/automake.in
index f236736..0c3fe22 100644
--- a/automake.in
+++ b/automake.in
@@ -1525,13 +1525,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'}};
@@ -1650,7 +1645,9 @@ sub handle_single_transform ($$$$$%)
        # is in effect.
 
        # Split file name into base and extension.
-       next if ! /^(?:(.*)\/)?([^\/]*)($KNOWN_EXTENSIONS_PATTERN)$/;
+       next if ! /^(?:(.*)\/)?([^\/]*?)(\.[^.]+)$/;
+        prog_error ("source file '$_' missing dotted extension")
+          unless defined $2 and defined $3;
        my $full = $_;
        my $directory = $1 || '';
        my $base = $2;
@@ -5724,9 +5721,6 @@ sub register_language (%)
        }
     }
 
-  # Update the pattern of known extensions.
-  accept_extensions (@{$lang->extensions});
-
   # Upate the $suffix_rule map.
   foreach my $suffix (@{$lang->extensions})
     {
diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm
index c8b8111..2406623 100644
--- a/lib/Automake/Rule.pm
+++ b/lib/Automake/Rule.pm
@@ -29,10 +29,9 @@ use Automake::DisjConditions;
 require Exporter;
 use vars '@ISA', '@EXPORT', '@EXPORT_OK';
 @ISA = qw/Automake::Item Exporter/;
address@hidden = qw (reset register_suffix_rule suffix_rules_count
-             rules $suffix_rules $KNOWN_EXTENSIONS_PATTERN
address@hidden = qw (reset register_suffix_rule
+             rules $suffix_rules
              depend %dependencies %actions register_action
-             accept_extensions
              reject_rule msg_rule msg_cond_rule err_rule err_cond_rule
              rule rrule ruledef rruledef);
 
@@ -150,21 +149,6 @@ C<register_suffix_rule> function.
 
 use vars '$suffix_rules';
 
-=item C<$KNOWN_EXTENSIONS_PATTERN>
-
-Pattern that matches all know input extensions (i.e. extensions used
-by the languages supported by Automake).  Using this pattern (instead
-of '\..*$') to match extensions allows Automake to support dot-less
-extensions.
-
-New extensions should be registered with C<accept_extensions>.
-
-=cut
-
-use vars qw ($KNOWN_EXTENSIONS_PATTERN @_known_extensions_list);
-$KNOWN_EXTENSIONS_PATTERN = "";
address@hidden = ();
-
 =back
 
 =head2 Error reporting functions
@@ -251,20 +235,6 @@ sub reject_rule ($$)
 
 =over 4
 
-=item C<accept_extensions (@exts)>
-
-Update C<$KNOWN_EXTENSIONS_PATTERN> to recognize the extensions
-listed in C<@exts>.  Extensions should contain a dot if needed.
-
-=cut
-
-sub accept_extensions (@)
-{
-    push @_known_extensions_list, @_;
-    $KNOWN_EXTENSIONS_PATTERN =
-       '(?:' . join ('|', map (quotemeta, @_known_extensions_list)) . ')';
-}
-
 =item C<rules>
 
 Return the list of all L<Automake::Rule> instances.  (I.e., all
@@ -454,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<Makefile> (excluding predefined suffix rules).
-
-=cut
-
-sub suffix_rules_count ()
-{
-  return (scalar keys %$suffix_rules) - (scalar keys %$_suffix_rules_default);
-}
-
 =item C<rule ($rulename)>
 
 Return the C<Automake::Rule> object for the rule
@@ -802,7 +760,6 @@ sub define ($$$$$;$)
       if ($deps =~ /^\s*%(\.$chars_rx)(\s|$)/o)
         {
           my $srcsuf = $1;
-          accept_extensions ($srcsuf);
           register_suffix_rule ($where, $srcsuf, $objsuf);
         }
     }
diff --git a/t/check5.sh b/t/cxx-fortran.sh
similarity index 53%
copy from t/check5.sh
copy to t/cxx-fortran.sh
index 2e5e792..b2138db 100755
--- a/t/check5.sh
+++ b/t/cxx-fortran.sh
@@ -14,57 +14,56 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test TESTS = $(check_PROGRAMS)
+# Test mixing Fortran 77 and C++.
 
-# For gen-testsuite-part: ==> try-with-serial-tests <==
-required='cc native'
+# For now, require the GNU compilers, to avoid possible spurious failure.
+required='gfortran g++'
 . ./defs || Exit 1
 
 cat >> configure.ac << 'END'
-AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_F77
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-check_PROGRAMS = one two
-TESTS = $(check_PROGRAMS)
-check-local:
-       test -f one$(EXEEXT)
-       test -f two$(EXEEXT)
-       touch ok
-prepare-for-fake-exeext:
-       rm -f ok
-       mv -f one$(EXEEXT) one.bin
-       mv -f two$(EXEEXT) two.bin
-post-check-for-fake-exeext:
-       test -f ok
-       test ! -f one$(EXEEXT)
-       test ! -f two$(EXEEXT)
-.PHONY: prepare-for-fake-exeext post-check-for-fake-exeext
+noinst_PROGRAMS = foo
+foo_SOURCES = new.cc old.f
 END
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-cat > one.c << 'END'
+cat > new.cc << 'END'
+#include <iostream>
+using namespace std;
+extern "C" { int cube_ (int *); }
 int main (void)
 {
-  return 0;
+   int n = 3;
+   cout << "The Cube of " << n << " is " << cube_ (&n) << endl;
+   return 0;
 }
 END
-cp one.c two.c
 
-./configure
+cat > old.f << 'END'
+      INTEGER FUNCTION CUBE(N)
+C     COMPUTES AND RETURN THE CUBE OF THE INTEGER N
+      CUBE=N*N*N
+      RETURN
+      END
+END
 
-$MAKE check
-test -f ok
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+# The C++ linker should be preferred.
+grep '\$(FCLINK)' Makefile.in && Exit 1
+grep '.\$(CXXLINK)' Makefile.in
 
-$MAKE prepare-for-fake-exeext
-$MAKE check EXEEXT=.bin
-$MAKE post-check-for-fake-exeext
+./configure
+$MAKE
 
-# No TESTS rewriting has taken place.
-grep '^TESTS = \$(check_PROGRAMS)$' Makefile.in
+if cross_compiling; then :; else
+  ./foo
+  test "$(./foo)" = "The Cube of 3 is 27"
+fi
 
-:
+$MAKE distcheck
diff --git a/t/cxxnoc.sh b/t/cxxnoc.sh
deleted file mode 100755
index 66d0b0d..0000000
--- a/t/cxxnoc.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996-2012 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/>.
-
-# Test to make sure pure C++ sources don't include C-specific code.
-
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CXX
-END
-
-cat > Makefile.am << 'END'
-sbin_PROGRAMS = anonymous
-anonymous_SOURCES = doe.C jane.C
-END
-
-: > doe.C
-: > jane.C
-
-$ACLOCAL
-$AUTOMAKE
-
-$FGREP '(CC)' Makefile.in && Exit 1
-Exit 0
diff --git a/t/fnoc.sh b/t/fnoc.sh
deleted file mode 100755
index fbd2135..0000000
--- a/t/fnoc.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998-2012 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/>.
-
-# Test to make sure that pure Fortran 77 sources don't include
-# C-specific code.
-# Matthew D. Langston <address@hidden>
-
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_F77
-END
-
-cat > Makefile.am << 'END'
-sbin_PROGRAMS = anonymous
-anonymous_SOURCES = doe.f jane.f
-END
-
-: > doe.f
-: > jane.f
-
-$ACLOCAL
-$AUTOMAKE
-
-grep '[^F]CC' Makefile.in | grep -v MKDEP && Exit 1
-Exit 0
diff --git a/t/no-c.tap b/t/no-c.tap
new file mode 100755
index 0000000..5adb056
--- /dev/null
+++ b/t/no-c.tap
@@ -0,0 +1,57 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# Projects using only Fortran or C++ shouldn't need C-related stuff.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+plan_ 6
+
+only_ ()
+{
+  test $# -eq 3 || fatal_ "only_: bad usage"
+  lang=$1; shift
+  macro=$1; shift
+  sources=$*
+  : ================  $lang  ================ :
+  mkdir "$macro"
+  cd "$macro"
+  unindent > configure.ac <<END
+    AC_INIT([Only $2], [1.0])
+    AM_INIT_AUTOMAKE
+    AC_CONFIG_FILES([Makefile])
+    $macro
+END
+  echo bin_PROGRAMS = foo > Makefile.am
+  echo foo_SOURCES = $sources >> Makefile.am
+  r=ok
+  $ACLOCAL \
+    && $AUTOMAKE -a \
+    && not $EGREP '\(CC\)|\(CFLAGS\)|AM_CFLAGS' Makefile.in \
+    || r='not ok'
+  result_ "$r" "$lang only"
+  cd ..
+}
+
+only_ "C++"           AC_PROG_CXX    '1.cxx 2.cpp 3.c++ 4.cc 5.C'
+only_ "Fortran"       AC_PROG_FC     'a.f90 b.f95 c.f03 d.f08'
+only_ "Fortran 77"    AC_PROG_F77    'x.f y.for'
+only_ "Java"          AM_PROG_GCJ    'foo.java bar.class'
+only_ "Objective C"   AC_PROG_OBJC   'zardoz.m fu.m'
+only_ "Objective C++" AC_PROG_OBJCXX 'foo.mm bar.mm'
+
+:
diff --git a/t/objc-deps.sh b/t/suffix-hdr.sh
similarity index 54%
copy from t/objc-deps.sh
copy to t/suffix-hdr.sh
index a2e4212..178d84d 100755
--- a/t/objc-deps.sh
+++ b/t/suffix-hdr.sh
@@ -14,58 +14,67 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Automatic dependency tracking for Objective C.
-# See also sister test 'objcxx-deps.sh'.
+# Use of "custom" headers (with custom suffix) in a _PROGRAMS variable.
 
+required='cc native'
 . ./defs || Exit 1
 
 cat >> configure.ac << 'END'
-AC_PROG_OBJC
+AC_PROG_CC
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-bin_PROGRAMS = foo
-foo_SOURCES = bar.m baz.h baz2.h
+noinst_PROGRAMS = zardoz
+zardoz_SOURCES = foo.my-c bar.my-h
+BUILT_SOURCES = bar.h
+%.c: %.my-c
+       sed 's/INTEGER/int/' $< >$@
+%.h: %.my-h
+       sed 's/SUBSTITUTE/#define/' $< >$@
+CLEANFILES = foo.c $(BUILT_SOURCES)
 END
 
-cat > baz.h << 'END'
-#include <stdio.h>
-#include <stdlib.h>
-#include "baz2.h"
-END
-
-cat > baz2.h << 'END'
-#define MSG "Hello, World"
-END
-
-cat > bar.m << 'END'
-/* The use of #import makes this valid Object C but invalid C. */
-#import "baz.h"
-int main (void)
+cat > foo.my-c << 'END'
+#include "bar.h"
+INTEGER main (void)
 {
-    fprintf (stdout, "%s\n", MSG);
-    return EXIT_SUCCESS;
+  printf ("Hello, %s!\n", PLANET);
+  return 0;
 }
 END
 
+cat > bar.my-h << 'END'
+#include <stdio.h>
+SUBSTITUTE PLANET "Mars"
+END
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
 ./configure --enable-dependency-tracking
+
 $MAKE
-cross_compiling || (./foo | $FGREP 'Hello, World') || Exit 1
+./zardoz
+test "$(./zardoz)" = 'Hello, Mars!'
+
 $sleep
-: > old
-echo '#define MSG "Howdy, Earth"' > baz2.h
+$PERL -npi -e 's/\bMars\b/Jupiter/' bar.my-h
+
 $MAKE
-if test -f foo; then
-  is_newest foo old
-else
-  is_newest foo.exe old
-fi
-cross_compiling || (./foo | $FGREP 'Howdy, Earth') || Exit 1
+./zardoz
+test "$(./zardoz)" = 'Hello, Jupiter!'
+
+$MAKE distdir
+test -f $distdir/foo.my-c
+test -f $distdir/bar.my-h
+test ! -f $distdir/foo.c
+test ! -f $distdir/bar.h
+
+$MAKE clean
+test ! -f foo.c
+test ! -f bar.h
 
 $MAKE distcheck
 
diff --git a/t/suffix3.sh b/t/suffix3.sh
index 1ef8a2b..66be6cc 100755
--- a/t/suffix3.sh
+++ b/t/suffix3.sh
@@ -45,6 +45,13 @@ $FGREP foo.c Makefile.in && Exit 1
 # However Automake must figure that foo.zoo is eventually
 # transformed into foo.o, and use this latter file (to link foo).
 $FGREP 'foo.$(OBJEXT)' Makefile.in
+# Finally, our dummy package doesn't use C in any way, so it the
+# Makefile shouldn't contain stuff related to the C compiler.
+$FGREP '$(LINK)'   Makefile.in && Exit 1
+$FGREP 'AM_CFLAGS' Makefile.in && Exit 1
+$FGREP '$(CFLAGS)' Makefile.in && Exit 1
+$FGREP '$(CC)'     Makefile.in && Exit 1
+
 
 $AUTOCONF
 ./configure
diff --git a/t/verbatim.sh b/t/verbatim.sh
index da21c8c..f0f6b74 100755
--- a/t/verbatim.sh
+++ b/t/verbatim.sh
@@ -45,6 +45,10 @@ cp "$am_amdir"/*.am ./am
 
 echo pkgdata_DATA = configure.ac > Makefile.am
 
+# The '.am' file are read-only when this test is run under
+# "make distcheck", so we need to unlink any of them we want
+# to overwrite.
+rm -f am/data.am
 cat > am/data.am << 'END'
 include 0.am
 include 1.am


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]