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-336-g9a603b0
Date: Tue, 29 May 2012 11:16:59 +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=9a603b0b2cc87bab6bfa0e749269a8635b106699

The branch, ng/master has been updated
       via  9a603b0b2cc87bab6bfa0e749269a8635b106699 (commit)
       via  9018af7199307ff5fc9992d1107a05016ec31513 (commit)
       via  269236a4212bfeb491ced6c6f0ae5d8fa42b734c (commit)
       via  8b740587e3f076c6338523b2bbb130e72f5dfef0 (commit)
       via  e10cbf0a2af598d44229525ccd58869b24b62ed5 (commit)
       via  645bb2101df2040ebedb65341cc786704c56f194 (commit)
      from  04ea4fed10ada232fcd75a16b46e67f214396bf4 (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 9a603b0b2cc87bab6bfa0e749269a8635b106699
Merge: 04ea4fe 9018af7 645bb21
Author: Stefano Lattarini <address@hidden>
Date:   Tue May 29 12:49:05 2012 +0200

    Merge branches 'ng/stdinc' and 'ng/suffix-rules-mutilation' into ng/master
    
    * ng/stdinc:
      [ng] compile: rename make variable DEFAULT_INCLUDES -> AM_DEFAULT_INCLUDES
      [ng] compile: add extra -I opts from config headers at make runtime
      [ng] compile: rename make variable CONFIG_HEADER -> AM_CONFIG_HEADERS
      [ng] maintcheck: refactor checks on obsolete variable names
    
    * ng/suffix-rules-mutilation:
      [ng] suffix: drop Automake-time chaining of suffix rules

commit 9018af7199307ff5fc9992d1107a05016ec31513
Author: Stefano Lattarini <address@hidden>
Date:   Mon May 28 10:08:39 2012 +0200

    [ng] compile: rename make variable DEFAULT_INCLUDES -> AM_DEFAULT_INCLUDES
    
    The automake-generated variable 'DEFAULT_INCLUDES' has never been
    documented, and it violates user namespace.  So rename it to
    'AM_DEFAULT_INCLUDES', to make it clear that it is owned by Automake.
    We prefer that name to something that would sound more "private",
    like 'am__default_includes', because there are possibly legitimate
    usages of that variable on the user's part.
    
    * automake.in, lib/am/compile.am: Do the rename.
    * NG-NEWS, doc/automake-ng.texi: Update.
    * t/confh4.sh, t/no-extra-makefile-code.sh: Adjust.
    * syntax-checks.mk (old_vars_checks): Add new check
    'sc_no_DEFAULT_INCLUDES'.
    (modern_DEFAULT_INCLUDES): Define to 'DEFAULT_INCLUDES'.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 269236a4212bfeb491ced6c6f0ae5d8fa42b734c
Author: Stefano Lattarini <address@hidden>
Date:   Sun May 27 20:27:24 2012 +0200

    [ng] compile: add extra -I opts from config headers at make runtime
    
    Unless the 'no-stdinc' option is in use, automake automatically adds
    to the compiler's include path (through the use of '-I' options placed
    in the $(DEFAULT_INCLUDES) variable) the $(srcdir), the current
    directory, and all the directories where header files specified with
    AC_CONFIG_HEADERS macro are placed.  It also tries to remove unseemly
    duplicated '-I' entries, for  example simplifying "-I. -I$(srcdir)" to
    "-I." when in a non-VPATH build (in which case '$(srcdir)' is simply
    '.').
    
    Before this change, that preprocessing was done both at automake runtime
    and configure runtime; with GNU make features, we can simplify it a bit
    and move almost all of it at make runtime instead.
    
    * automake.in (handle_compile): Remove automake-time preprocessing, and
    support for further configure-time preprocessing, of the intended contents
    of $(DEFAULT_INCLUDES); instead, move all of them ...
    * lib/am/compile.am (DEFAULT_INCLUDES) [%?STDINC%]: ... here.
    * m4/init.m4: Remove AC_SUBST of @address@hidden
    * t/no-extra-makefile-code.sh: Trivially adjust.
    * t/nostdinc.sh: Adjust by preferring more "semantic" checks to grepping
    checks.
    * t/confh4.sh: Adjust and extend.
    * t/stdinc-no-repeated.sh: New test.
    * Makefile.am (do_subst): Remove a now-unneeded hack.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 8b740587e3f076c6338523b2bbb130e72f5dfef0
Author: Stefano Lattarini <address@hidden>
Date:   Sun May 27 15:48:30 2012 +0200

    [ng] compile: rename make variable CONFIG_HEADER -> AM_CONFIG_HEADERS
    
    The automake-generated variable 'CONFIG_HEADER' has never been
    documented, and it violates user namespace.  So rename it to
    'AM_CONFIG_HEADERS', to make it clear that it is owned by Automake.
    We prefer that name to something that would sound more "private",
    like 'am__config_headers', because there are possibly legitimate
    usages of that variable on the user's part.
    
    * automake.in: Do the rename.  Also, don't bother explicitly
    rejecting the setting of 'CONFIG_HEADER' as an anachronism:
    that warning has been active so long that any still maintained
    Makefile.am file should have stopped doing that long ago.
    * NG-NEWS: Update.
    * lib/am/remake-hdr.am: Update a comment.
    * syntax-checks.mk (modern.CONFIG_HEADER): New, define to
    'AM_CONFIG_HEADERS'.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit e10cbf0a2af598d44229525ccd58869b24b62ed5
Author: Stefano Lattarini <address@hidden>
Date:   Mon May 28 10:26:56 2012 +0200

    [ng] maintcheck: refactor checks on obsolete variable names
    
    This is just a preparatory refactoring, to make future additions
    easier.
    
    * syntax-checks.mk (sc_renamed_variables_rules): New autocomputed
    variable.
    ($(sc_renamed_variables_rules)): New static pattern rule, subsuming
    most of the existing checks against the use of old names for some
    automake provided make variables.
    (syntax_check_rules): Add the contents of the new variable, and do
    not explicitly list the checks subsumed by it.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 645bb2101df2040ebedb65341cc786704c56f194
Author: Stefano Lattarini <address@hidden>
Date:   Sat May 26 11:39:29 2012 +0200

    [ng] suffix: drop Automake-time chaining of suffix rules
    
    This change simplifies the Automake::Rule module a little, moves yet
    more logic from Automake runtime to GNU make runtime (in the spirit of
    Automake-NG), and gets us rid of some never-documented nor completely
    specified Automake magics.  OTOH, it also breaks some idioms that, while
    only relevant for uncommon cases, have been working since the first
    Automake releases.  Still, it is easy to slightly modify those idioms to
    have the use cases they were catering to correctly handled with the new
    semantics (examples of this are given below); the only downside being the
    need of a little more verbosity and explicitness on the user's part.
    
    So, with the present change, automake starts using a much simpler and
    dumber algorithm to determine how to build an object associated to a
    source whose extension in not one of those it handles internally.
    
    The new algorithm goes like this.  For any file listed in a '_SOURCES'
    variable whose suffix is not recognized internally by automake (in
    contrast to known suffixes like '.c' or '.f90'), automake will obtain
    the expected target object file by stripping the suffix from the source
    file, and appending either '.$(OBJEXT)' or '.lo' to it (which one depends
    on whether the object is built as part of a program, a static library, or
    a libtool library).  It will then be assumed (but not checked!) that the
    user has defined a rule (either explicit or defined from a pattern rule)
    which can turn that source file into this corresponding object file.  For
    example, on an input like:
    
          bin_PROGRAMS = foo
          foo_SOURCES = mu.ext1 fu.ext1 zu.ext1
    
    automake will expect that the three objects 'mu.$(OBJEXT)', 'fu.$(OBJEXT)'
    and 'zu.$(OBJEXT)' are to be used in the linking of the 'foo' program, and
    that the user has provided proper recipes for all those objects to be
    built at make time, as well as a link command for linking 'foo'.  Here is
    an example of how those declarations could look like:
    
        %.$(OBJEXT): %.ext1
                my-compiler -c -o $@ $<
        # We need to compile mu with debugging enabled.
        mu.$(OBJEXT): mu.ext1
                my-compiler -DDEBUG=1 -c -o $@ $<
        foo_LINK = $(CC) -o $@
    
    In this particular case, the idiom above is basically the same one that
    would be required in mainline automake (apart for the fact that, there,
    old-fashioned suffix rules should be used instead of pattern rules).  To
    see what is truly changed with the new algorithm, we have to look at a
    more indirect usage.
    
    Mainline Automake follows the chain of user-defined pattern rules to
    determine how to build the object file deriving from a source file with
    a custom user extension; for example, upon reading:
    
         %.cc: %.zoo:
                 $(preprocess) $< > $@
         bin_PROGRAMS = foo
         foo_SOURCES = bar.zoo
    
    automake knew that it has to bring in the C++ support (compilation rules,
    requirement for AC_PROG_CXX in configure.ac, etc), and use the C++ linker
    to link the 'foo' executable.
    
    But after the present change, automake *won't follow those implicit
    chains of pattern rules* anymore; so that the idiom above will have to
    be re-worked like follows to preserve its intent and behaviour:
    
         %.cc: %.zoo:
                 $(preprocess) $< > $@
         bin_PROGRAMS = foo
         # The use of '.cc' is required to let Automake know to bring in
         # stuff for the handling of C++ compilation, and to use the C++
         # linker to build 'foo'.
         nodist_foo_SOURCES = bar.cc
         EXTRA_DIST = foo.zoo
    
    Finally, we must note another, slightly annoying first consequence of
    this change of semantics: one can't use anymore "header files" with
    extensions unrecognized to Automake anymore; for example, an usage like
    this:
    
        # Won't work anymore: will cause errors at make runtime.
        %.h: %.my-hdr
              $(preprocess-header) $< >$@
        foo_SOURCES = foo.c bar.my-hdr
        BUILT_SOURCES = bar.h
    
    will cause the generated Makefile to die on "make all", with an error
    like:
    
        make[1]: *** No rule to make target 'bar.o', needed by 'zardoz'.  Stop.
    
    while an usage like this:
    
        # Won't work anymore: will cause errors at automake runtime.
        %.h: %.my-hdr
              $(preprocess-header) $< >$@
        foo_SOURCES = foo.c foo.my-hdr
        BUILT_SOURCES = foo.h
    
    will cause automake itself to die, reporting an error like:
    
        object 'foo.$(OBJEXT)' created by 'foo.my-hdr' and 'foo.c'
    
    We don't believe the above breakage is a real issue though, because
    the use case can still be served by placing the "non standard" headers
    in EXTRA_DIST rather than in a _SOURCES variable:
    
        # This will work.
        %.h: %.my-hdr
              $(preprocess-header) $< >$@
        foo_SOURCES = foo.c
        EXTRA_DIST = foo.my-hdr
        BUILT_SOURCES = foo.h
    
    A more detailed list of changes follow ...
    
    * automake.in (register_language): Don't call 'register_suffix_rule'
    on the source and object extensions of the registered languages.
    (handle_single_transform): Implement the new simple algorithm described
    in details above (plus an hack to continue supporting Vala-related
    '.vapi' files in _SOURCES variables).  Remove the only call ever to ...
    (derive_suffix): ... this function, which has thus been removed.
    * lib/Automake/Rule.pm
    ($_suffix_rules_default, $suffix_rules, register_suffix_rule): Remove.
    (@EXPORT, reset): Adjust.
    (define): Don't call 'register_suffix_rule' on the suffixes of target
    and dependency when a pattern rule is seen.
    * t/specflg10.sh: Move ...
    * t/am-default-source-ext.sh: ... to this more proper name, and
    adjusted.
    * t/suffix12.sh: Renamed ...
    * t/suffix-custom-subobj.sh: ... to this, and remove a botched heading
    comment.
    * t/suffix3.sh: Adjust.
    * t/suffix5.sh: Likewise.
    * t/suffix8.sh: Likewise.
    * t/suffix10.sh: Likewise.
    * t/suffix13.sh: Likewise.
    * t/suffix-chain.sh: Likewise.
    * t/suffix-hdr.sh: Likewise.
    * t/suffix-custom.sh: New test.
    * t/suffix-custom-link.sh: Likewise.
    * t/suffix-custom-default-ext.sh: Likewise.
    * t/yacc-lex-cxx-alone.sh: Likewise.
    * NG-NEWS: Update.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

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

Summary of changes:
 Makefile.am                                     |    9 +-
 NG-NEWS                                         |  120 ++++++++++++++++----
 automake.in                                     |  102 ++++-------------
 doc/automake-ng.texi                            |    2 +-
 lib/Automake/Rule.pm                            |  139 +----------------------
 lib/am/compile.am                               |   13 ++-
 lib/am/remake-hdr.am                            |    2 +-
 m4/init.m4                                      |    4 -
 syntax-checks.mk                                |   41 +++----
 t/{specflg10.sh => am-default-source-ext.sh}    |   30 ++++--
 t/confh4.sh                                     |   49 +++++++--
 t/no-extra-makefile-code.sh                     |    3 +-
 t/nostdinc.sh                                   |   45 +++++---
 t/{parallel-tests8.sh => stdinc-no-repeated.sh} |   46 ++++----
 t/suffix-chain.sh                               |    3 +-
 t/suffix-custom-default-ext.sh                  |   70 ++++++++++++
 t/{suffix-chain.sh => suffix-custom-link.sh}    |   57 ++++++----
 t/{suffix12.sh => suffix-custom-subobj.sh}      |    2 -
 t/suffix-custom.sh                              |  106 +++++++++++++++++
 t/suffix-hdr.sh                                 |    7 +-
 t/suffix10.sh                                   |    6 +-
 t/suffix13.sh                                   |    6 +-
 t/suffix3.sh                                    |   22 +---
 t/suffix5.sh                                    |    2 +-
 t/suffix8.sh                                    |    4 +-
 t/yacc-lex-cxx-alone.sh                         |  116 +++++++++++++++++++
 26 files changed, 623 insertions(+), 383 deletions(-)
 rename t/{specflg10.sh => am-default-source-ext.sh} (78%)
 copy t/{parallel-tests8.sh => stdinc-no-repeated.sh} (59%)
 create mode 100755 t/suffix-custom-default-ext.sh
 copy t/{suffix-chain.sh => suffix-custom-link.sh} (54%)
 rename t/{suffix12.sh => suffix-custom-subobj.sh} (93%)
 create mode 100755 t/suffix-custom.sh
 create mode 100755 t/yacc-lex-cxx-alone.sh

diff --git a/Makefile.am b/Makefile.am
index 7b4a8a6..533faef 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,16 +31,11 @@ EXTRA_DIST =
 # then use config.status to substitute the remainder where a single
 # expansion is sufficient.  We use a funny notation here to avoid
 # configure substitutions in our text.
-do_subst = ( sed $(strip \
+do_subst = sed $(strip \
   $(foreach x, data am bin doc pkgvdata script automake_ac system_ac, \
               -e 's,@$(x)dir@,$($(x)dir),g')) \
   -e "s,address@hidden@,Generated from $(<F) do not edit by hand.,g" \
-## Hack to avoid a spurious substitution in the Automake script (part 1).
-  -e 's,address@hidden@],address@hidden@!!,g' \
-  | $(SHELL) ./config.status --file=- \
-## Hack to avoid a spurious substitution in the Automake script (part 2).
-  | sed -e 's,address@hidden@!!,@''am__isrc@,g' \
-) <$< >address@hidden
+  <"$<" | $(SHELL) ./config.status --file=- >"address@hidden"
 
 # Generated  files shouldn't contain unexpanded '@substitutions@', and
 # should be made read-only, to prevent them from being edited by mistake
diff --git a/NG-NEWS b/NG-NEWS
index 216c95b..209d779 100644
--- a/NG-NEWS
+++ b/NG-NEWS
@@ -177,26 +177,6 @@ Pattern rules and suffix rules
   not supported anymore either; Automake-NG will error out if you try
   to define them.
 
-* To retain support for user-defined file extensions in the '_SOURCES'
-  variables (see "Handling new file extensions" in the Automake manual),
-  Automake-NG still tries to parse and understand suffix-based pattern
-  rules.  So, an usage like:
-   
-      SUFFIXES = .baz .c
-      .baz.c:
-              cp $< $@
-      foo_SOURCES = foo.c bar.baz
-      DISTCLEANFILES = bar.c
-
-  which was valid with mainline Automake, should be translated for
-  Automake-NG as:
-
-      %.c: %.baz
-              cp $< $@
-      bin_PROGRAMS = foo
-      foo_SOURCES = foo.c sub/bar.baz
-      DISTCLEANFILES = bar.c
-
 
 Distribution
 ============
@@ -257,6 +237,95 @@ Obsolete Features Removed
   a long time.
 
 
+Source Files with Unknown Extensions
+====================================
+
+* Automake-NG used a much simpler and dumber algorithm that mainline
+  Automake to determine how to build an object associated to a source
+  whose extension in not one of those handled internally by automake.
+
+  The new algorithm goes like this.  For any file listed in a '_SOURCES'
+  variable whose suffix is not recognized internally by automake (in
+  contrast to known suffixes like '.c' or '.f90'), automake will obtain
+  the expected target object file by stripping the suffix from the source
+  file, and appending either '.$(OBJEXT)' or '.lo' to it (which one depends
+  on whether the object is built as part of a program, a static library, or
+  a libtool library).  It will then be assumed that the user has defined a
+  rule (either explicit or defined from a pattern rule) which can turn that 
+  source file into this corresponding object file.  For example, on an
+  input like:
+
+      bin_PROGRAMS = foo
+      foo_SOURCES = mu.ext1 fu.ext1 zu.ext1
+
+  automake will expect that the three objects mu.$(OBJEXT), fu.$(OBJEXT)
+  and zu.$(OBJEXT) are to be used in the linking of the 'foo' program, and
+  that the user has provided proper recipes for all those objects to be
+  built at make time, as well as a link command for linking 'foo'.  Here
+  is an example of how those declarations could look like:
+
+      %.$(OBJEXT): %.ext1
+              my-compiler -c -o $@ $<
+      foo_LINK = $(CC) -o $@
+
+  In this particular case, the idiom above is basically the same one that
+  would be required in mainline automake (apart for the fact that, there,
+  old-fashioned suffix rules should be used instead of pattern rules).  To
+  see what is truly changed with the new algorithm, we have to look at a
+  more indirect usage.
+
+  Mainline Automake follows the chain of user-defined pattern rules to
+  determine how to build the object file deriving from a source file with
+  a custom user extension; for example, upon reading:
+
+       .zoo.cc:
+               $(preprocess) $< > $@
+       bin_PROGRAMS = foo
+       foo_SOURCES = bar.zoo
+
+  *mainline* Automake knows that it has to bring in the C++ support
+  (compilation rules, requirement for AC_PROG_CXX in configure.ac, etc),
+  and use the C++ linker to link the 'foo' executable.
+
+  But Autommake-NG *won't follow those implicit chains of pattern rules*
+  anymore; so that the idiom above will have to be re-worked like follows
+  to preserve its intent and behaviour:
+
+       %.cc: %.zoo:
+               $(preprocess) $< > $@
+       bin_PROGRAMS = foo
+       # The use of '.cc' is required to let Automake know to bring in
+       # stuff for the handling of C++ compilation, and to use the C++
+       # linker to build 'foo'.
+       nodist_foo_SOURCES = bar.cc
+       EXTRA_DIST = foo.zoo
+
+  And there is another major consequence of this change of semantics: one
+  can't use anymore "header files" with extensions unrecognized to Automake
+  anymore; for example, an usage like this will cause errors at make
+  runtime:
+
+      # Won't work anymore.
+      %.h: %.my-hdr
+            $(preprocess-header) $< >$@
+      foo_SOURCES = foo.c bar.my-hdr
+      BUILT_SOURCES = bar.h
+
+  errors that might look like:
+
+      make[1]: *** No rule to make target 'bar.o', needed by 'zardoz'.  Stop.
+
+  The simple workaround is to place the "non-standard" headers in EXTRA_DIST
+  rather than in a _SOURCES variable:
+
+      # This will work.
+      %.h: %.my-hdr
+            $(preprocess-header) $< >$@
+      foo_SOURCES = foo.c
+      EXTRA_DIST = foo.my-hdr
+      BUILT_SOURCES = foo.h
+
+
 Miscellaneous
 =============
 
@@ -265,6 +334,17 @@ Miscellaneous
   variable $(AM_MAKEFLAGS) has been removed, and its content is no more
   passed to recursive make invocations.
 
+* The make variable 'CONFIG_HEADER' had never been documented in mainline
+  Automake, and since when the support for user setting of it has been
+  removed (in favour of the use of the 'AC_CONFIG_HEADERS' autoconf macro
+  in configure.ac), it has been intended as an internal variable only.
+  So we've renamed it to 'AM_CONFIG_HEADERS'.  Do not override its value
+  in your Makefiles!
+
+* The Automake-generated make variable 'DEFAULT_INCLUDES', used internally
+  in compilation rules and basically never documented in mainline Automake,
+  has been renamed to AM_DEFAULT_INCLUDES, to avoid impinging on the user's
+  namespace.  Do not override this variable in your Makefiles!
 
 -----
 
diff --git a/automake.in b/automake.in
index eeafd29..60ebc66 100644
--- a/automake.in
+++ b/automake.in
@@ -719,7 +719,7 @@ register_language ('name' => 'c',
                   'flags' => ['CFLAGS', 'CPPFLAGS'],
                   'ccer' => 'CC',
                   'compiler' => 'COMPILE',
-                  'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
+                  'compile' => '$(CC) $(DEFS) $(AM_DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
                   'lder' => 'CCLD',
                   'ld' => '$(CC)',
                   'linker' => 'LINK',
@@ -736,7 +736,7 @@ register_language ('name' => 'cxx',
                   'link' => '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o $@',
                   'autodep' => 'CXX',
                   'flags' => ['CXXFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
+                  'compile' => '$(CXX) $(DEFS) $(AM_DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
                   'ccer' => 'CXX',
                   'compiler' => 'CXXCOMPILE',
                   'compile_flag' => '-c',
@@ -755,7 +755,7 @@ register_language ('name' => 'objc',
                   'link' => '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) 
$(AM_LDFLAGS) $(LDFLAGS) -o $@',
                   'autodep' => 'OBJC',
                   'flags' => ['OBJCFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
+                  'compile' => '$(OBJC) $(DEFS) $(AM_DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
                   'ccer' => 'OBJC',
                   'compiler' => 'OBJCCOMPILE',
                   'compile_flag' => '-c',
@@ -773,7 +773,7 @@ register_language ('name' => 'objcxx',
                   'link' => '$(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) 
$(AM_LDFLAGS) $(LDFLAGS) -o $@',
                   'autodep' => 'OBJCXX',
                   'flags' => ['OBJCXXFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)',
+                  'compile' => '$(OBJCXX) $(DEFS) $(AM_DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)',
                   'ccer' => 'OBJCXX',
                   'compiler' => 'OBJCXXCOMPILE',
                   'compile_flag' => '-c',
@@ -791,7 +791,7 @@ register_language ('name' => 'upc',
                   'link' => '$(UPCLD) $(AM_UPCFLAGS) $(UPCFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o $@',
                   'autodep' => 'UPC',
                   'flags' => ['UPCFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(UPC) $(DEFS) $(DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)',
+                  'compile' => '$(UPC) $(DEFS) $(AM_DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)',
                   'ccer' => 'UPC',
                   'compiler' => 'UPCCOMPILE',
                   'compile_flag' => '-c',
@@ -910,7 +910,7 @@ register_language ('name' => 'cppasm',
 
                   'autodep' => 'CCAS',
                   'flags' => ['CCASFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)',
+                  'compile' => '$(CCAS) $(DEFS) $(AM_DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)',
                   'ccer' => 'CPPAS',
                   'compiler' => 'CPPASCOMPILE',
                   'compile_flag' => '-c',
@@ -964,7 +964,7 @@ register_language ('name' => 'ppfc',
                   'flags' => ['FCFLAGS', 'CPPFLAGS'],
                   'ccer' => 'PPFC',
                   'compiler' => 'PPFCCOMPILE',
-                  'compile' => '$(FC) $(DEFS) $(DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)',
+                  'compile' => '$(FC) $(DEFS) $(AM_DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)',
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'libtool_tag' => 'FC',
@@ -974,7 +974,7 @@ register_language ('name' => 'ppfc',
 # Preprocessed Fortran 77
 #
 # The current support for preprocessing Fortran 77 just involves
-# passing "$(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)"
+# passing "$(DEFS) $(AM_DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)"
 # as additional flags to the Fortran 77 compiler, since this is how
 # GNU Make does it; see the "GNU Make Manual, Edition 0.51 for 'make'
 # Version 3.76 Beta" (specifically, from info file '(make)Catalogue
@@ -996,7 +996,7 @@ register_language ('name' => 'ppf77',
                   'flags' => ['FFLAGS', 'CPPFLAGS'],
                   'ccer' => 'PPF77',
                   'compiler' => 'PPF77COMPILE',
-                  'compile' => '$(F77) $(DEFS) $(DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)',
+                  'compile' => '$(F77) $(DEFS) $(AM_DEFAULT_INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)',
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'libtool_tag' => 'F77',
@@ -1667,7 +1667,6 @@ sub handle_single_transform ($$$$$%)
        # language function.
        my $aggregate = 'AM';
 
-       $extension = &derive_suffix ($extension, $obj);
        my $lang;
        if ($extension_map{$extension} &&
            ($lang = $languages{$extension_map{$extension}}))
@@ -1815,24 +1814,26 @@ sub handle_single_transform ($$$$$%)
                      address@hidden, %transform]);
            }
        }
-       elsif ($extension eq $obj)
+        elsif ($extension eq '.vapi')
+        {
+            # Explicitly pass vala headers through.  This is a bit of an
+            # hack, but good enough FTM.
+            next;
+        }
+       else
        {
+            # Assume the user has defined a proper explicit or pattern
+            # rule to turn a source file with this extension in an object
+            # file with the same basename and a '.$(OBJEXT)' extension (if
+            # build as part of a program or static library) or a '.lo'
+            # extension (if built as part of a libtool library).
+           $extension = $obj;
            # This is probably the result of a direct suffix rule.
            # In this case we just accept the rewrite.
            $object = "$base$extension";
            $object = "$directory/$object" if $directory ne '';
            $linker = '';
        }
-       else
-       {
-           # No error message here.  Used to have one, but it was
-           # very unpopular.
-           # FIXME: we could potentially do more processing here,
-           # perhaps treating the new extension as though it were a
-           # new source extension (as above).  This would require
-           # more restructuring than is appropriate right now.
-           next;
-       }
 
        err_am "object '$object' created by '$full' and '$object_map{$object}'"
          if (defined $object_map{$object}
@@ -2275,28 +2276,6 @@ sub handle_compile ()
 {
    return if ! $must_handle_compiled_objects;
 
-    # Boilerplate.
-    my $default_includes = '';
-    if (! option 'nostdinc')
-      {
-       my @incs = ('-I.', subst ('am__isrc'));
-
-       my $var = var 'CONFIG_HEADER';
-       if ($var)
-         {
-           foreach my $hdr (split (' ', $var->variable_value))
-             {
-               push @incs, '-I' . dirname ($hdr);
-             }
-         }
-       # We want '-I. -I$(srcdir)', but the latter -I is redundant
-       # and unaesthetic in non-VPATH builds.  We use address@hidden@`
-       # instead.  It will be replaced by '-I.' or '-I. -I$(srcdir)'.
-       # Items in CONFIG_HEADER are never in $(srcdir) so it is safe
-       # to just put @am__isrc@ right after '-I.', without a space.
-       ($default_includes = ' ' . uniq (@incs)) =~ s/ @/@/;
-      }
-
     my (@mostly_rms, @dist_rms);
     foreach my $item (sort keys %compile_clean_files)
     {
@@ -2317,7 +2296,7 @@ sub handle_compile ()
     my ($coms, $vars, $rules) =
       &file_contents_internal (1, "$libdir/am/compile.am",
                               new Automake::Location,
-                              ('DEFAULT_INCLUDES' => $default_includes,
+                              ('STDINC' => ! option 'nostdinc',
                                'MOSTLYRMS' => join ("\n", @mostly_rms),
                                'DISTRMS' => join ("\n", @dist_rms)));
     $output_vars .= $vars;
@@ -3992,15 +3971,10 @@ sub handle_configure ($$$@)
                                  FILES => "@distclean_config")
     if @distclean_config;
 
-  reject_var ('CONFIG_HEADER',
-             "'CONFIG_HEADER' is an anachronism; now determined "
-             . "automatically\nfrom '$configure_ac'");
-
   my @config_h;
   foreach my $spec (@config_headers)
     {
       my ($out, @ins) = split_config_file_spec ($spec);
-      # Generate CONFIG_HEADER define.
       if ($relative_dir eq dirname ($out))
        {
          push @config_h, basename ($out);
@@ -4010,7 +3984,7 @@ sub handle_configure ($$$@)
          push @config_h, "\$(top_builddir)/$out";
        }
     }
-  define_variable ("CONFIG_HEADER", "@config_h", INTERNAL)
+  define_variable ("AM_CONFIG_HEADERS", "@config_h", INTERNAL)
     if @config_h;
 
   # Now look for other files in this directory which must be remade
@@ -5718,34 +5692,6 @@ sub register_language (%)
          $link_languages{$link} = $lang;
        }
     }
-
-  # Upate the $suffix_rule map.
-  foreach my $suffix (@{$lang->extensions})
-    {
-      foreach my $dest (&{$lang->output_extensions} ($suffix))
-       {
-         register_suffix_rule (INTERNAL, $suffix, $dest);
-       }
-    }
-}
-
-# derive_suffix ($EXT, $OBJ)
-# --------------------------
-# This function is used to find a path from a user-specified suffix $EXT
-# to $OBJ or to some other suffix we recognize internally, e.g. 'cc'.
-sub derive_suffix ($$)
-{
-  my ($source_ext, $obj) = @_;
-
-  while (! $extension_map{$source_ext}
-        && $source_ext ne $obj
-        && exists $suffix_rules->{$source_ext}
-        && exists $suffix_rules->{$source_ext}{$obj})
-    {
-      $source_ext = $suffix_rules->{$source_ext}{$obj}[0];
-    }
-
-  return $source_ext;
 }
 
 
diff --git a/doc/automake-ng.texi b/doc/automake-ng.texi
index 80db240..86b3b3d 100644
--- a/doc/automake-ng.texi
+++ b/doc/automake-ng.texi
@@ -6383,7 +6383,7 @@ assembly code.  This compiler must work a bit like a C 
compiler; in
 particular it must accept @option{-c} and @option{-o}.  The values of
 @code{CCASFLAGS} and @code{AM_CCASFLAGS} (or its per-target
 definition) is passed to the compilation.  For preprocessed files,
address@hidden, @code{DEFAULT_INCLUDES}, @code{CPPFLAGS} and
address@hidden, @code{AM_DEFAULT_INCLUDES}, @code{CPPFLAGS} and
 @code{AM_CPPFLAGS} are also used.
 
 The autoconf macro @code{AM_PROG_AS} will define @code{CCAS} and
diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm
index 2406623..d6c73e7 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/;
address@hidden = qw (reset register_suffix_rule
-             rules $suffix_rules
address@hidden = qw (reset rules
              depend %dependencies %actions register_action
              reject_rule msg_rule msg_cond_rule err_rule err_cond_rule
              rule rrule ruledef rruledef);
@@ -94,10 +93,6 @@ non-object).
 
 =cut
 
-# Same as $suffix_rules (declared below), but records only the
-# default rules supplied by the languages Automake supports.
-use vars '$_suffix_rules_default';
-
 =item C<%dependencies>
 
 Holds the dependencies of targets which dependencies are factored.
@@ -119,36 +114,6 @@ only when keys exists in C<%dependencies>.
 
 use vars '%actions';
 
-=item <$suffix_rules>
-
-This maps the source extension for all suffix rules seen to
-a C<hash> whose keys are the possible output extensions.
-
-Note that this is transitively closed by construction:
-if we have
-      exists $suffix_rules{$ext1}{$ext2}
-   && exists $suffix_rules{$ext2}{$ext3}
-then we also have
-      exists $suffix_rules{$ext1}{$ext3}
-
-So it's easy to check whether C<.foo> can be transformed to
-C<.$(OBJEXT)> by checking whether
-C<$suffix_rules{'.foo'}{'.$(OBJEXT)'}> exists.  This will work even if
-transforming C<.foo> to C<.$(OBJEXT)> involves a chain of several
-suffix rules.
-
-The value of C<$suffix_rules{$ext1}{$ext2}> is a pair
-C<[ $next_sfx, $dist ]> where C<$next_sfx> is target suffix
-for the next rule to use to reach C<$ext2>, and C<$dist> the
-distance to C<$ext2'>.
-
-The content of this variable should be updated via the
-C<register_suffix_rule> function.
-
-=cut
-
-use vars '$suffix_rules';
-
 =back
 
 =head2 Error reporting functions
@@ -280,16 +245,6 @@ other internal data.
 sub reset()
 {
   %_rule_dict = ();
-  # The first time we initialize the variables,
-  # we save the value of $suffix_rules.
-  if (defined $_suffix_rules_default)
-    {
-      $suffix_rules = $_suffix_rules_default;
-    }
-  else
-    {
-      $_suffix_rules_default = $suffix_rules;
-    }
 
   %dependencies =
     (
@@ -345,85 +300,6 @@ sub reset()
   %actions = ();
 }
 
-=item C<register_suffix_rule ($where, $src, $dest)>
-
-Register a suffix-based pattern rule defined on C<$where> that
-transforms files ending in C<$src> into files ending in C<$dest>.
-
-This upgrades the C<$suffix_rules> variables.
-
-=cut
-
-sub register_suffix_rule ($$$)
-{
-  my ($where, $src, $dest) = @_;
-
-  verb "Sources ending in $src become $dest";
-
-  # When transforming sources to objects, Automake uses the
-  # %suffix_rules to move from each source extension to
-  # '.$(OBJEXT)', not to '.o' or '.obj'.  However some people
-  # define suffix rules for '.o' or '.obj', so internally we will
-  # consider these extensions equivalent to '.$(OBJEXT)'.  We
-  # CANNOT rewrite the target (i.e., automagically replace '.o'
-  # and '.obj' by '.$(OBJEXT)' in the output), or warn the user
-  # that (s)he'd better use '.$(OBJEXT)', because Automake itself
-  # output suffix rules for '.o' or '.obj' ...
-  $dest = '.$(OBJEXT)' if ($dest eq '.o' || $dest eq '.obj');
-
-  # Reading the comments near the declaration of $suffix_rules might
-  # help to understand the update of $suffix_rules that follows ...
-
-  # Register $dest as a possible destination from $src.
-  # We might have the create the \hash.
-  if (exists $suffix_rules->{$src})
-    {
-      $suffix_rules->{$src}{$dest} = [ $dest, 1 ];
-    }
-  else
-    {
-      $suffix_rules->{$src} = { $dest => [ $dest, 1 ] };
-    }
-
-  # If we know how to transform $dest in something else, then
-  # we know how to transform $src in that "something else".
-  if (exists $suffix_rules->{$dest})
-    {
-      for my $dest2 (keys %{$suffix_rules->{$dest}})
-       {
-         my $dist = $suffix_rules->{$dest}{$dest2}[1] + 1;
-         # Overwrite an existing $src->$dest2 path only if
-         # the path via $dest which is shorter.
-         if (! exists $suffix_rules->{$src}{$dest2}
-             || $suffix_rules->{$src}{$dest2}[1] > $dist)
-           {
-             $suffix_rules->{$src}{$dest2} = [ $dest, $dist ];
-           }
-       }
-    }
-
-  # Similarly, any extension that can be derived into $src
-  # can be derived into the same extensions as $src can.
-  my @dest2 = keys %{$suffix_rules->{$src}};
-  for my $src2 (keys %$suffix_rules)
-    {
-      if (exists $suffix_rules->{$src2}{$src})
-       {
-         for my $dest2 (@dest2)
-           {
-             my $dist = $suffix_rules->{$src}{$dest2} + 1;
-             # Overwrite an existing $src2->$dest2 path only if
-             # the path via $src is shorter.
-             if (! exists $suffix_rules->{$src2}{$dest2}
-                 || $suffix_rules->{$src2}{$dest2}[1] > $dist)
-               {
-                 $suffix_rules->{$src2}{$dest2} = [ $src, $dist ];
-               }
-           }
-       }
-    }
-}
-
 =item C<rule ($rulename)>
 
 Return the C<Automake::Rule> object for the rule
@@ -751,21 +627,10 @@ sub define ($$$$$;$)
 
   my $chars_rx = '[a-zA-Z0-9_()address@hidden';
   my $suffix_rule_rx = "^(\\.$chars_rx+)(\\.$chars_rx+)(?:\\s|\$)";
-  my $pattern_rx ="^%(\\.$chars_rx+)";
 
-  # Let's see if the rule is a suffix-based pattern rule we can handle.
-  if ($target =~ /^%(\.$chars_rx)$/o)
-    {
-      my $objsuf = $1;
-      if ($deps =~ /^\s*%(\.$chars_rx)(\s|$)/o)
-        {
-          my $srcsuf = $1;
-          register_suffix_rule ($where, $srcsuf, $objsuf);
-        }
-    }
   # We don't support old-fashioned  suffix rules anymore, but want to
   # report them as errors.
-  elsif ($target =~ /$suffix_rule_rx/o)
+  if ($target =~ /$suffix_rule_rx/o)
     {
       error $where, "use pattern rules, not old-fashioned suffix rules";
     }
diff --git a/lib/am/compile.am b/lib/am/compile.am
index 7b37da2..3be6f7d 100644
--- a/lib/am/compile.am
+++ b/lib/am/compile.am
@@ -14,7 +14,18 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-DEFAULT_INCLUDES = %DEFAULT_INCLUDES%
+if %?STDINC%
+AM_DEFAULT_INCLUDES = \
+  $(call am__memoize,AM_DEFAULT_INCLUDES,$(strip \
+## We want '-I. -I$(srcdir)', but the latter -I is redundant and
+## unaesthetic in non-VPATH builds, so get rid of it if it is not
+## actually needed.
+    $(call am__uniq, -I. -I$(srcdir) \
+      $(foreach am__h, $(AM_CONFIG_HEADERS), \
+        $(patsubst %/,%,-I$(dir $(am__h)))))))
+else !%?STDINC%
+AM_DEFAULT_INCLUDES =
+endif !%?STDINC%
 
 mostlyclean-am: mostlyclean-compile
 mostlyclean-compile:
diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am
index 61e32be..e4928e8 100644
--- a/lib/am/remake-hdr.am
+++ b/lib/am/remake-hdr.am
@@ -15,7 +15,7 @@
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 %CONFIG_H%: %STAMP%
-## Recover from removal of CONFIG_HEADER.  Break up in two invocations
+## Recover from removal of config headers.  Break up in two invocations
 ## so that "make -n" is properly honored.
        @test -f $@ || rm -f %STAMP%
        @test -f $@ || $(MAKE) %STAMP%
diff --git a/m4/init.m4 b/m4/init.m4
index a0f04db..0abf787 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -21,10 +21,6 @@ m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
 AC_REQUIRE([AC_PROG_INSTALL])dnl
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
-  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
-  # is not polluted with repeated "-I."
-  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
-  # test to see if srcdir already configured
   if test -f $srcdir/config.status; then
     AC_MSG_ERROR([source directory already configured; run "make distclean" 
there first])
   fi
diff --git a/syntax-checks.mk b/syntax-checks.mk
index e567c96..2f5be71 100644
--- a/syntax-checks.mk
+++ b/syntax-checks.mk
@@ -62,12 +62,7 @@ sc_tests_make_can_chain_suffix_rules \
 sc_tests_make_dont_do_useless_vpath_rebuilds \
 sc_no_dotmake_target \
 sc_no_am_makeflags \
-sc_no_DISTFILES \
-sc_no_DIST_COMMON \
-sc_no_DIST_SOURCES \
-sc_no_am_TEST_BASES \
-sc_no_am_TEST_RESULTS \
-sc_no_am_TEST_LOGS \
+$(sc_renamed_variables_rules) \
 sc_no_RECHECK_LOGS \
 sc_tests_no_make_e \
 sc_docs_no_make_e \
@@ -323,11 +318,19 @@ sc_no_am_makeflags:
        fi
 
 # Modern names for internal variables that had a bad name once.
-modern_DISTFILES = am__dist_files
-modern_DIST_COMMON = am__dist_common
-modern_DIST_SOURCES = am__dist_sources
-
-sc_no_DISTFILES sc_no_DIST_COMMON sc_no_DIST_SOURCES: sc_no_% :
+modern.DISTFILES = am__dist_files
+modern.DIST_COMMON = am__dist_common
+modern.DIST_SOURCES = am__dist_sources
+modern.am__TEST_BASES = am__test_bases
+modern.am__TEST_LOGS = am__test_logs
+modern.am__TEST_RESULTS = am__test_results
+modern.CONFIG_HEADER = AM_CONFIG_HEADERS
+modern.DEFAULT_INCLUDES = AM_DEFAULT_INCLUDES
+
+Sc_renamed_variables_rules = \
+  $(patsubst modern.%,sc_no_%,$(filter modern.%,$(.VARIABLES)))
+
+$(sc_renamed_variables_rules): sc_no_% :
        @files="\
          $(xtests) \
          $(pms) \
@@ -337,21 +340,7 @@ sc_no_DISTFILES sc_no_DIST_COMMON sc_no_DIST_SOURCES: 
sc_no_% :
        "; \
        if grep -F '$*' $$files; then \
          echo "'\$$($*)' is obsolete and no more used." >&2; \
-         echo "You should use '$(modern_$*)' instead." >&2; \
-         exit 1; \
-       fi
-
-sc_no_am_TEST_BASES sc_no_am_TEST_RESULTS sc_no_am_TEST_LOGS: sc_no_am_% :
-       @files="\
-         $(xtests) \
-         $(pms) \
-         $(ams) \
-         $(srcdir)/automake.in \
-       "; \
-       tolower () { LC_ALL=C tr '[A-Z]' '[a-z]'; }; \
-       if grep -F 'am__$*' $$files; then \
-         echo "'\$$(am__$*)' is obsolete and no more used." >&2; \
-         echo "You should use 'am__`echo $* | tolower`' instead." >&2; \
+         echo "You should use '$(modern.$*)' instead." >&2; \
          exit 1; \
        fi
 
diff --git a/t/specflg10.sh b/t/am-default-source-ext.sh
similarity index 78%
rename from t/specflg10.sh
rename to t/am-default-source-ext.sh
index 6af4d28..d3ab899 100755
--- a/t/specflg10.sh
+++ b/t/am-default-source-ext.sh
@@ -42,29 +42,41 @@ END
 cat > sub2/Makefile.am << 'END'
 bin_PROGRAMS = bla
 if COND
-AM_DEFAULT_SOURCE_EXT = .foo .quux
+AM_DEFAULT_SOURCE_EXT = .c .quux
 endif
 %.c: %.foo
        cat $< >$@
-BUILT_SOURCES = bla.c
-CLEANFILES = bla.c
+EXTRA_DIST = $(addsuffix .foo,$(bin_PROGRAMS))
+CLEANFILES = $(addsuffix .c,$(bin_PROGRAMS))
 END
 
 cat > foo.c << 'END'
-int main (void) { return 0; }
+/* Valid C, invalid C++. */
+int main (void)
+{
+  int new = 0;
+  return new;
+}
 END
-
-cp foo.c sub/bar.cpp
-cp foo.c sub/baz.cpp
 cp foo.c sub2/bla.foo
 
+cat > sub/bar.cpp << 'END'
+/* Valid C++, invalid C. */
+using namespace std;
+int main (void)
+{
+  return 0;
+}
+END
+cp sub/bar.cpp sub/baz.cpp
+
 $ACLOCAL
 $AUTOCONF
 
 # Conditional AM_DEFAULT_SOURCE_EXT does not work yet  :-(
 # (this limitation could be lifted).
 AUTOMAKE_fails --add-missing
-grep 'defined conditionally' stderr
+grep 'AM_DEFAULT_SOURCE_EXT.*defined conditionally' stderr
 
 sed '/^if/d; /^endif/d' sub2/Makefile.am > t
 mv -f t sub2/Makefile.am
@@ -72,7 +84,7 @@ mv -f t sub2/Makefile.am
 # AM_DEFAULT_SOURCE_EXT can only assume one value
 # (lifting this limitation is not such a good idea).
 AUTOMAKE_fails --add-missing
-grep 'at most one value' stderr
+grep 'AM_DEFAULT_SOURCE_EXT.*at most one value' stderr
 
 sed 's/ \.quux//' sub2/Makefile.am > t
 mv -f t sub2/Makefile.am
diff --git a/t/confh4.sh b/t/confh4.sh
index 665e04a..ddcbeba 100755
--- a/t/confh4.sh
+++ b/t/confh4.sh
@@ -21,27 +21,60 @@
 # > How-To-Repeat:
 #  Use AM_CONFIG_HEADER(subdir/config.h) to place configuration
 #  header in subdirectory and observe that it is not included.
+# Also check that our preprocessing code is smart enough not to pass
+# repeated '-I<DIR>' options on the compiler command line.
 
 . ./defs || Exit 1
 
 cat >> configure.ac << 'END'
-AC_CONFIG_FILES([include/Makefile])
+AC_CONFIG_FILES([include/Makefile sub/Makefile])
 AC_CONFIG_HEADERS([include/config.h])
-AC_PROG_CC
+AC_PROG_FGREP
+AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
+mkdir include sub
+: > include/config.h.in
+
+cat > c-defs.am << 'END'
+## To bring in the definition of AM_DEFAULT_INCLUDES
+CC = who-cares
+AUTOMAKE_OPTIONS = no-dependencies
 bin_PROGRAMS = foo
-foo_SOURCES = foo.c
 END
 
-mkdir include
-: > include/Makefile.am
-: > include/config.h.in
+cat > Makefile.am << 'END'
+include $(top_srcdir)/c-defs.am
+.PHONY: test-default-includes
+test-default-includes:
+       echo ' ' $(AM_DEFAULT_INCLUDES) ' ' \
+         | $(FGREP) ' -I$(top_builddir)/include '
+END
+
+cp Makefile.am sub
+
+cat > include/Makefile.am << 'END'
+include $(top_srcdir)/c-defs.am
+.PHONY: test-default-includes
+test-default-includes:
+       echo ' ' $(AM_DEFAULT_INCLUDES) ' ' | $(FGREP) ' -I. '
+       case ' $(AM_DEFAULT_INCLUDES) ' in \
+         *'$(top_builddir)'*) exit 1;; \
+         *include*) exit 1;; \
+         *-I.*-I.*) exit 1;; \
+         *' -I. ') exit 0;; \
+         *) exit 1;; \
+       esac
+END
 
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE
 
-grep '^ *DEFAULT_INCLUDES *=.* -I\$(top_builddir)/include' Makefile.in
+./configure
+
+$MAKE test-default-includes
+$MAKE -C sub test-default-includes
+$MAKE -C include test-default-includes
 
 :
diff --git a/t/no-extra-makefile-code.sh b/t/no-extra-makefile-code.sh
index 1742dc4..1c91452 100755
--- a/t/no-extra-makefile-code.sh
+++ b/t/no-extra-makefile-code.sh
@@ -30,7 +30,6 @@ rm -f depcomp compile
 $ACLOCAL
 $AUTOMAKE
 
-$EGREP 'DEFAULT_INCLUDES|@am__isrc@|-compile|\$\(OBJEXT\)|tab\.[ch]' \
-  Makefile.in && Exit 1
+$EGREP 'INCLUDE|-compile|\$\(OBJEXT\)|tab\.[ch]' Makefile.in && Exit 1
 
 :
diff --git a/t/nostdinc.sh b/t/nostdinc.sh
index 8b780a6..62e752e 100755
--- a/t/nostdinc.sh
+++ b/t/nostdinc.sh
@@ -16,11 +16,7 @@
 
 # Test to make sure nostdinc option works correctly.
 
-# We don't require a C compiler explicitly, because the first part of the
-# test (where 'Makefile.in' is grepped) does not require one.  Insted, we
-# just skip the rest of the test if configure fails to find a working C
-# compiler.
-
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.ac << 'END'
@@ -31,26 +27,43 @@ END
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = nostdinc
 bin_PROGRAMS = foo
-foo_SOURCES = foo.c
 END
 
-$ACLOCAL
-$AUTOMAKE
+cat > foo.c << 'END'
+#include <stdlib.h>
+int main (void)
+{
+  exit (0);
+}
+END
 
-$EGREP '(-I *\.|-I.*srcdir|am__isrc)' Makefile.in && Exit 1
+# This shouldn't be picked up.
+cat > stdlib.h << 'END'
+#error "stdlib.h from source dir included"
+choke me
+END
 
-# We'll test the fully-processed Makefile too.
+$ACLOCAL
 $AUTOCONF
+$AUTOMAKE --add-missing
 
 # Test with $builddir != $srcdir
 mkdir build
 cd build
-../configure || Exit $?
-$EGREP '.*-I *(\.|\$.srcdir.)' Makefile && Exit 1
+../configure
+$MAKE V=1 > output || { cat output; Exit 1; }
+cat output
+grep '.*-I *\.' stdout && Exit 1
+$MAKE clean
+# Shouldn't be picked up from builddir either.
+cp ../stdlib.h .
+$MAKE
+cd ..
 
 # Test with $builddir = $srcdir
-cd ..
-./configure || Exit $?
-$EGREP '.*-I *(\.|\$.srcdir.)' Makefile && Exit 1
+./configure
+$MAKE V=1 > output || { cat output; Exit 1; }
+cat output
+grep '.*-I *\.' output && Exit 1
 
-Exit 0
+:
diff --git a/t/parallel-tests8.sh b/t/stdinc-no-repeated.sh
similarity index 59%
copy from t/parallel-tests8.sh
copy to t/stdinc-no-repeated.sh
index 4f32231..159cda5 100755
--- a/t/parallel-tests8.sh
+++ b/t/stdinc-no-repeated.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -14,43 +14,39 @@
 # 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 parallel-tests features: generated distributed tests.
+# Check that automake rules do not use repeated "-I $(srcdir)" in the
+# compiler invocation.
 
+required=cc
 . ./defs || Exit 1
 
 cat >> configure.ac << 'END'
+AC_PROG_CC
 AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
-TESTS = foo.test
-%.test: %.in
-       cp $< $@ && chmod +x $@
-check_SCRIPTS = $(TESTS)
-EXTRA_DIST = foo.in foo.test
-DISTCLEANFILES = foo.test
-END
-
-cat > foo.in <<'END'
-#! /bin/sh
-echo "this is $0"
-exit 0
-END
+echo 'bin_PROGRAMS = foo' > Makefile.am
+echo 'int main (void) { return 0; }' > foo.c
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
-
-./configure
-$MAKE check
-$MAKE distcheck
-$MAKE distclean
+$AUTOMAKE --add-missing
 
+# Test with $builddir != $srcdir
 mkdir build
 cd build
 ../configure
-$MAKE check
-test ! -f ../foo.log
-$MAKE distcheck
+$MAKE V=1 > stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '.*-I *\. .*-I *\.\. ' stdout
+grep '.*-I *\. .*-I *\. ' stdout && Exit 1
+cd ..
+
+# Test with $builddir = $srcdir
+./configure
+$MAKE V=1 > stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '.*-I *\.  ' stdout
+grep '.*-I *\..*-I *\.' stdout && Exit 1
 
 :
diff --git a/t/suffix-chain.sh b/t/suffix-chain.sh
index 2ff72f9..e1f96b2 100755
--- a/t/suffix-chain.sh
+++ b/t/suffix-chain.sh
@@ -28,7 +28,8 @@ END
 
 cat > Makefile.am <<'END'
 bin_PROGRAMS = foo
-foo_SOURCES = foo.c1
+nodist_foo_SOURCES = foo.c
+EXTRA_DIST = foo.c0
 %.c0: %.c1
        (echo 'int main (void)' && echo '{' && cat $<) > $@
 %.c: %.c0
diff --git a/t/suffix-custom-default-ext.sh b/t/suffix-custom-default-ext.sh
new file mode 100755
index 0000000..0bc7295
--- /dev/null
+++ b/t/suffix-custom-default-ext.sh
@@ -0,0 +1,70 @@
+#! /bin/sh
+# Copyright (C) 2002-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/>.
+
+# Interaction between user-defined extensions for files in _SOURCES
+# and the use of AM_DEFAULT_SOURCE_EXT.
+
+required=c++
+. ./defs || Exit 1
+
+cat >> configure.ac <<'END'
+AC_PROG_CXX
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+AM_DEFAULT_SOURCE_EXT = .cc
+bin_PROGRAMS = foo bar baz qux
+%.cc: %.zoo
+       sed 's/INTEGER/int/g' $< >$@
+EXTRA_DIST = $(addsuffix .zoo,$(bin_PROGRAMS))
+generated_cc_sources = $(addsuffix .cc,$(bin_PROGRAMS))
+CLEANFILES = $(generated_cc_sources)
+# We don't want the generated C++ files to be distributed, and this
+# is the best workaround we've found so far.  Not very clean, but it
+# works.
+dist-hook:
+       rm -f $(addprefix $(distdir)/,$(generated_cc_sources))
+END
+
+# This is deliberately valid C++, but invalid C.
+cat > foo.zoo <<'END'
+using namespace std;
+INTEGER main (void)
+{
+  return 0;
+}
+END
+cp foo.zoo bar.zoo
+cp foo.zoo baz.zoo
+cp foo.zoo qux.zoo
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+$MAKE all
+$MAKE distdir
+ls -l $distdir
+test ! -f $distdir/foo.cc
+test ! -f $distdir/bar.cc
+test ! -f $distdir/baz.cc
+test ! -f $distdir/qux.cc
+$MAKE distcheck
+
+:
diff --git a/t/suffix-chain.sh b/t/suffix-custom-link.sh
similarity index 54%
copy from t/suffix-chain.sh
copy to t/suffix-custom-link.sh
index 2ff72f9..0b7814f 100755
--- a/t/suffix-chain.sh
+++ b/t/suffix-custom-link.sh
@@ -14,43 +14,60 @@
 # 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 can take advantage of GNU make ability to
-# automatically chain suffix-based pattern rules.
-# See automake bug#7824 and bug#7670.
+# Check that Automake support entries with user-defined extensions of
+# files in _SOURCES, and we can override the choice of a link in case
+# the Automake default (C linker) would be inappropriate.
 
-required=cc
+required=c++
 . ./defs || Exit 1
 
 cat >> configure.ac <<'END'
-AC_PROG_CC
+AC_PROG_CXX
 AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
+%.$(OBJEXT): %.xt
+       sed -e 's/@/o/g' -e 's/!/;/g' $< >$*-t.cc \
+         && $(CXX) -c $*-t.cc \
+         && rm -f $*-t.cc \
+         && mv -f $*-t.$(OBJEXT) $@
 bin_PROGRAMS = foo
-foo_SOURCES = foo.c1
-%.c0: %.c1
-       (echo 'int main (void)' && echo '{' && cat $<) > $@
-%.c: %.c0
-       (cat $< && echo '}') > $@
-CLEANFILES = foo.c0 foo.c
+foo_SOURCES = 1.xt 2.xt
+foo_LINK = $(CXX) -o $@
 END
 
-echo 'return 0;' > foo.c1
+cat > 1.xt <<'END'
+#include <cstdlib>
+void say_hell@ (address@hidden)!
+int main (address@hidden)
+{
+   say_hell@ ()!
+   std::exit(0)!
+}
+END
+
+cat > 2.xt <<'END'
+#include <address@hidden>
+void say_hell@ (address@hidden)
+{
+  using namespace std!
+  address@hidden << "Hell@, address@hidden" << endl!
+}
+END
 
 $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
+
 ./configure
-$MAKE all
-$MAKE distcheck
 
-# Try with explicit dependencies as well.
-$MAKE clean
-cat >> Makefile <<'END'
-foo.c: foo.c0
-foo.c0: foo.c1
-END
 $MAKE all
+if cross_compiling; then :; else
+  ./foo
+  ./foo | grep 'Hello, World'
+fi
+
+$MAKE distcheck
 
 :
diff --git a/t/suffix12.sh b/t/suffix-custom-subobj.sh
similarity index 93%
rename from t/suffix12.sh
rename to t/suffix-custom-subobj.sh
index ecdba67..daaa5c7 100755
--- a/t/suffix12.sh
+++ b/t/suffix-custom-subobj.sh
@@ -16,8 +16,6 @@
 
 # Tests that pattern rules with subdir objects are understood.
 # Originally reported by John Ratliff against suffix rules.
-# This test currently fails, because Automake-NG don't scan nor
-# process pattern rules.
 
 required=cc
 . ./defs || Exit 1
diff --git a/t/suffix-custom.sh b/t/suffix-custom.sh
new file mode 100755
index 0000000..158be9c
--- /dev/null
+++ b/t/suffix-custom.sh
@@ -0,0 +1,106 @@
+#! /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/>.
+
+# Check that Automake support entries with user-defined extensions of
+# files in _SOURCES, if there is a rule to turn files with that
+# extension in object files.
+# See also related test 'suffix-custom-go.sh' for a check using a
+# real-world third party compiler (Go from Google).
+
+required=cc
+. ./defs || Exit 1
+
+cat >> configure.ac <<'END'
+AC_CONFIG_HEADERS([config.h])
+AC_DEFINE([EXIT_OK], [0], [Exit status for success])
+AC_DEFINE([EXIT_KO], [1], [Exit status for failure])
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+AM_DEFAULT_SOURCE_EXT = .my-c
+MY_CFLAGS = $(if $(filter .,$(srcdir)),,-I $(srcdir)) $(CPPFLAGS)
+%.$(OBJEXT): %.my-c
+       sed -e 's/@/o/g' -e 's/~/0/g' $< >$*-t.c \
+         && $(CC) $(MY_CFLAGS) -c $*-t.c \
+         && rm -f $*-t.c \
+         && mv -f $*-t.$(OBJEXT) $@
+bin_PROGRAMS = foo
+bin_PROGRAMS += zardoz
+zardoz_SOURCES = main.c protos.h greet.my-c cleanup.my-c
+END
+
+cat > foo.my-c <<'END'
+#include <address@hidden>
+#include <stdlib.h>
+int main (address@hidden)
+{
+   printf ("Dummy\n");
+   exit (~);
+}
+END
+
+cat > protos.h << 'END'
+void greet (void);
+int cleanup (void);
+#include <stdio.h>
+END
+
+cat > greet.my-c << 'END'
+#include "address@hidden@s.h"
+void greet (address@hidden)
+{
+    printf ("Hell@, ");
+}
+END
+
+cat > cleanup.my-c << 'END'
+#include "address@hidden@s.h"
+int cleanup (address@hidden)
+{
+  return (address@hidden (address@hidden) == ~);
+}
+END
+
+cat > main.c <<'END'
+#include <config.h>
+#include "protos.h"
+int main (void)
+{
+  greet ();
+  puts ("address@hidden");
+  return (cleanup () ? EXIT_OK : EXIT_KO);
+}
+END
+
+$ACLOCAL
+$AUTOHEADER
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+$MAKE all
+if cross_compiling; then :; else
+  ./foo
+  ./zardoz
+  ./zardoz | grep 'Hello, address@hidden'
+fi
+
+$MAKE distcheck
+
+:
diff --git a/t/suffix-hdr.sh b/t/suffix-hdr.sh
index 178d84d..67c7034 100755
--- a/t/suffix-hdr.sh
+++ b/t/suffix-hdr.sh
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Use of "custom" headers (with custom suffix) in a _PROGRAMS variable.
+# Use of "custom" headers (with custom suffix).
 
 required='cc native'
 . ./defs || Exit 1
@@ -26,13 +26,14 @@ END
 
 cat > Makefile.am << 'END'
 noinst_PROGRAMS = zardoz
-zardoz_SOURCES = foo.my-c bar.my-h
+nodist_zardoz_SOURCES = foo.c
+EXTRA_DIST = bar.my-h foo.my-c
 BUILT_SOURCES = bar.h
 %.c: %.my-c
        sed 's/INTEGER/int/' $< >$@
 %.h: %.my-h
        sed 's/SUBSTITUTE/#define/' $< >$@
-CLEANFILES = foo.c $(BUILT_SOURCES)
+CLEANFILES = $(nodist_zardoz_SOURCES) $(BUILT_SOURCES)
 END
 
 cat > foo.my-c << 'END'
diff --git a/t/suffix10.sh b/t/suffix10.sh
index cd34fc7..243ed23 100755
--- a/t/suffix10.sh
+++ b/t/suffix10.sh
@@ -31,7 +31,9 @@ EOF
 
 cat >Makefile.am << 'END'
 lib_LTLIBRARIES = libfoo.la
-libfoo_la_SOURCES = foo.x-x
+nodist_libfoo_la_SOURCES = foo.y
+CLEANFILES = $(nodist_libfoo_la_SOURCES)
+EXTRA_DIST = $(nodist_libfoo_la_SOURCES:.y=.x-x)
 %.y: %.x-x
        rm -f $@ address@hidden
 ## The leading ':;' works around a bug in bash <= 3.2.
@@ -64,5 +66,7 @@ $AUTOMAKE --add-missing
 
 $MAKE test
 $MAKE all
+test -f libfoo.la
+$MAKE distcheck
 
 :
diff --git a/t/suffix13.sh b/t/suffix13.sh
index 86c5975..f1d3b41 100755
--- a/t/suffix13.sh
+++ b/t/suffix13.sh
@@ -29,13 +29,15 @@ EOF
 cat >Makefile.am << 'END'
 AUTOMAKE_OPTIONS = subdir-objects
 %.c: %.baz
-       case $@ in sub/*) $(MKDIR_P) sub;; *) :;; esac
+       test -d $(@D) || $(MKDIR_P) $(@D)
        cp $< $@
 
 DISTCLEANFILES = sub/bar.c
 
 bin_PROGRAMS = foo
-foo_SOURCES = foo.c sub/bar.baz
+foo_SOURCES = foo.c
+nodist_foo_SOURCES = sub/bar.c
+EXTRA_DIST = sub/bar.baz
 foo_CFLAGS = -DRETVAL=0
 END
 
diff --git a/t/suffix3.sh b/t/suffix3.sh
index 66be6cc..bdf22cd 100755
--- a/t/suffix3.sh
+++ b/t/suffix3.sh
@@ -27,23 +27,17 @@ END
 cat > Makefile.am << 'END'
 %.cc: %.zoo
        sed 's/INTEGER/int/g' $< >$@
-bin_PROGRAMS = foo
-foo_SOURCES = foo.zoo
-# This is required by "make distcheck".  The useless indirection is
-# reequired to avoid false positives by the grepping checks below.
-FOO = foo
-CLEANFILES = $(FOO).cc
+bin_PROGRAMS = zardoz
+nodist_zardoz_SOURCES = foo.cc
+EXTRA_DIST = foo.zoo
+CLEANFILES = foo.cc
 END
 
 $ACLOCAL
 $AUTOMAKE
 
-# The foo.cc intermediate step is implicit, it's a mistake if
-# Automake requires this file somewhere.  Also, Automake should
-# not require the file 'foo.c' anywhere.
-$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).
+# Automake has been clearly told that foo.zoo is eventually transformed
+# into foo.o, and to 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.
@@ -68,10 +62,6 @@ END
 $MAKE all
 $MAKE distcheck
 
-# TODO: should we check that intermediate file 'foo.cc' has
-# been removed?  Or is this requiring too much from the make
-# implementation?
-
 # Intermediate files should not be distributed.
 $MAKE distdir
 test ! -r $me-1.0/foo.cc
diff --git a/t/suffix5.sh b/t/suffix5.sh
index 4963a58..fb32ae1 100755
--- a/t/suffix5.sh
+++ b/t/suffix5.sh
@@ -52,7 +52,7 @@ done
 
 $ACLOCAL
 $AUTOMAKE
-grep '_OBJECTS.*foo\.lo' Makefile.in
+#grep '_OBJECTS.*foo\.lo' Makefile.in
 
 $AUTOCONF
 ./configure
diff --git a/t/suffix8.sh b/t/suffix8.sh
index c1f254e..f4920ea 100755
--- a/t/suffix8.sh
+++ b/t/suffix8.sh
@@ -41,9 +41,9 @@ libfoo_la_SOURCES = bar.x_
 
 %.y_: %.x_
        cp $< $@
-%.o: %.y_
+%.o: %.x_
        cp $< $@
-%.obj: %.y_
+%.obj: %.x_
        cp $< $@
 %.z_: %.y_
        cp $< $@
diff --git a/t/yacc-lex-cxx-alone.sh b/t/yacc-lex-cxx-alone.sh
new file mode 100755
index 0000000..e9548a5
--- /dev/null
+++ b/t/yacc-lex-cxx-alone.sh
@@ -0,0 +1,116 @@
+#! /bin/sh
+# Copyright (C) 2011-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/>.
+
+# Yacc + C++ support for a program built only from yacc sources.
+# Lex + C++ support for a program built only from lex sources.
+
+required='c++ yacc'
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+AC_PROG_CXX
+AC_PROG_LEX
+AC_PROG_YACC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = foo.yy
+bar_SOURCES = bar.lxx
+
+.PHONY: check-dist
+check-dist: distdir
+       echo ' ' $(am__dist_common) ' ' | grep '[ /]foo\.cc'
+       echo ' ' $(am__dist_common) ' ' | grep '[ /]bar\.cxx'
+       ls -l $(distdir)
+       test -f $(distdir)/foo.cc
+       test -f $(distdir)/bar.cxx
+END
+
+cat > foo.yy << 'END'
+%{
+// Valid C++, but deliberately invalid C.
+#include <cstdio>
+#include <cstdlib>
+// "std::" qualification required by Sun C++ 5.9.
+int yylex (void) { return std::getchar (); }
+void yyerror (const char *s) { return; }
+%}
+%%
+a : 'a' { exit(0); };
+%%
+int main (void)
+{
+  yyparse ();
+  return 1;
+}
+END
+
+cat > bar.lxx << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+int isatty (int fd) { return 0; }
+%}
+%%
+"x" return EOF;
+.
+%%
+// Valid C++, but deliberately invalid C.
+#include <cstdlib>
+int main (void)
+{
+  /* We don't use a 'while' loop here (like a real lexer would do)
+     to avoid possible hangs. */
+  if (yylex () == EOF)
+    std::exit (0);
+  else
+    std::exit (1);
+}
+
+/* Avoid possible link errors. */
+int yywrap (void) { return 1; }
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE
+
+# The Yacc-derived and Lex-derived C++ sources must be created, and not
+# removed once compiled (i.e., not treated like "intermediate files" in
+# the GNU make sense).
+test -f foo.cc
+test -f bar.cxx
+
+if cross_compiling; then :; else
+  echo a | ./foo
+  echo b | ./foo && Exit 1
+  echo x | ./bar
+  echo y | ./bar && Exit 1
+  : # Don't trip on 'set -e'.
+fi
+
+# The Yacc-derived and Lex-derived C++ sources must be shipped.
+$MAKE check-dist
+
+# Sanity check on distribution.
+$MAKE distcheck
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

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