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.11-1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.11-1838-gdc04691
Date: Wed, 01 Feb 2012 20:57:52 +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=dc04691d13078ee7aebb12d161abfa7301a6332b

The branch, ng/master has been updated
       via  dc04691d13078ee7aebb12d161abfa7301a6332b (commit)
       via  a6a7de012b649535a9b88640b370bd4baa942742 (commit)
       via  823af0e1feadceb9bfc16f61486ab3c1bf6990cf (commit)
       via  cf93724d892011c1b5f6c10e7c693212190f4bae (commit)
      from  d8422c9488564396d19f7bda0318829e735f9a5a (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 dc04691d13078ee7aebb12d161abfa7301a6332b
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jan 31 22:53:44 2012 +0100

    [ng] yacc, lex: fix subdir VPATH builds
    
    Starting with recent changes, the automake-generated configure
    code does not create the '.Po' files for dependency tracking
    anymore.  This is good and proper, but unfortunately, when the
    'subdir-objects' option is in use *and* a VPATH build is being
    performed, it breaks some rules that *implicitly* relied on that
    shell code having already created the subdirectory where the
    generated files were to be placed.  This happened in particular
    with Yacc and Lex rules.  So fix them to instead explicitly
    create the required directories, if not already present.
    
    Bug revealed by failures of 'lex5.test' and 'yacc8.test' with
    GNU make 3.82 (on all of Debian, Fedora and Solaris).
    
    * lib/am/yacc.am, lib/am/lex.am: Update.
    * tests/Makefile.am (XFAIL_TESTS): Remove 'lex-subobj-nodep.test',
    as the test now passes.
    * tests/yacc-subobj-nodep.test: New test.
    * tests/list-of-tests.mk: Add it.

commit a6a7de012b649535a9b88640b370bd4baa942742
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jan 31 20:37:16 2012 +0100

    [ng] vpath: define generic make function for VPATH rewrites
    
    This change generalizes and makes available to all the Automake
    generated Makefiles a common idiom dealing with VPATH rewrites.
    This idiom was introduced in recent commits (see in particular
    'v1.11-1835-gcf93724').
    
    * lib/am/depend2.am (am__vpath_rewrite): Move ...
    * lib/am/header-vars.am: ... here.
    * tests/vpath-rewrite.test: New test.
    * tests/list-of-tests.mk: Add it.

commit 823af0e1feadceb9bfc16f61486ab3c1bf6990cf
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jan 31 16:57:28 2012 +0100

    [ng] compiling: remove some code duplication in depend2.am
    
    * lib/am/depend2.am (am__cooked_source_0, am__cooked_source_1): New
    helper variables.
    Use them in several compilation rules to avoid code duplication.
    * tests/subobj4.test: Adjust.
    * tests/fort2.test: Likewise.

commit cf93724d892011c1b5f6c10e7c693212190f4bae
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jan 31 15:04:06 2012 +0100

    [ng] compiling: implement VPATH rewrites using GNU make primitives
    
    This will shave off extra forks from compilation rules.  No semantic
    change is expected from this commit.  Suggestion from Eric Bake.
    
    * lib/am/depend2.am (am__vpath_rewrite): New internal macro,
    implements VPATH rewrites only using GNU make primitives.
    Use it in several compilation rules.

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

Summary of changes:
 lib/am/depend2.am                                  |   46 +++------
 lib/am/header-vars.am                              |    5 +
 lib/am/lex.am                                      |    3 +-
 lib/am/yacc.am                                     |    5 +-
 tests/Makefile.am                                  |    1 -
 tests/fort2.test                                   |   57 +++++++++---
 tests/list-of-tests.mk                             |    2 +
 tests/subobj4.test                                 |    3 +-
 tests/vpath-rewrite.test                           |  100 ++++++++++++++++++++
 ...ex-subobj-nodep.test => yacc-subobj-nodep.test} |   52 +++++-----
 10 files changed, 199 insertions(+), 75 deletions(-)
 create mode 100755 tests/vpath-rewrite.test
 copy tests/{lex-subobj-nodep.test => yacc-subobj-nodep.test} (56%)

diff --git a/lib/am/depend2.am b/lib/am/depend2.am
index cc2f85c..df5db1e 100644
--- a/lib/am/depend2.am
+++ b/lib/am/depend2.am
@@ -35,12 +35,19 @@
 ## and easily inline the dependency tracking.
 
 if %?FIRST%
+
 ?SUBDIROBJ?am__depdir = $(dir $@)/$(DEPDIR)
 ?!SUBDIROBJ?am__depdir = $(DEPDIR)
 ## FIXME: more precise in the removal of the suffix?
 am__depbase = $(am__depdir)/$(basename $(notdir $@))
 ## Avoid useless forks when possible.
 am__ensure_depdir = test -d $(am__depdir) || $(MKDIR_P) $(am__depdir)
+
+## Used for suffix rules.
+am__cooked_source_0 = $(call am__vpath_rewrite, $<)
+## Used for explicit rules.
+am__cooked_source_1 = $<
+
 endif %?FIRST%
 
 if %?NONLIBTOOL%
@@ -50,9 +57,7 @@ if %FASTDEP%
        %SILENT%$(am__ensure_depdir)
 ## In fast-dep mode, we can always use -o.
        %VERBOSE%%COMPILE% -MT $@ -MD -MP -MF $(am__depbase).Tpo %-c% -o $@ \
-?GENERIC?      %SOURCEFLAG%%SOURCE%
-## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?!GENERIC?     %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+                %SOURCEFLAG%$(am__cooked_source_%GENERIC%)
        %SILENT%$(am__mv) $(am__depbase).Tpo $(am__depbase).Po
 else !%FASTDEP%
 if %AMDEP%
@@ -60,14 +65,8 @@ if %AMDEP%
        %VERBOSE%source='%SOURCE%' object='%OBJ%' libtool=no @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif %AMDEP%
-if %?GENERIC%
-?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%%SOURCE%
-?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%%SOURCE%
-else !%?GENERIC%
-## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%`test -f 
'%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
-?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`test -f '%SOURCE%' || echo 
'$(srcdir)/'`%SOURCE%
-endif !%?GENERIC%
+?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% 
%SOURCEFLAG%$(am__cooked_source_%GENERIC%)
+?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%$(am__cooked_source_%GENERIC%)
 endif !%FASTDEP%
 
 ?GENERIC?%EXT%.obj:
@@ -76,12 +75,7 @@ if %FASTDEP%
        %SILENT%$(am__ensure_depdir)
 ## In fast-dep mode, we can always use -o.
        %VERBOSE%%COMPILE% -MT $@ -MD -MP -MF $(am__depbase).Tpo %-c% -o $@ \
-?GENERIC?      %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
-## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?!GENERIC?     %SOURCEFLAG%`if test -f '%SOURCE%';  \
-?!GENERIC?       then $(CYGPATH_W) '%SOURCE%'; \
-?!GENERIC?       else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; \
-?!GENERIC?     fi`
+                %SOURCEFLAG%`$(CYGPATH_W) $(am__cooked_source_%GENERIC%)`
        %SILENT%$(am__mv) $(am__depbase).Tpo $(am__depbase).Po
 else !%FASTDEP%
 if %AMDEP%
@@ -89,14 +83,8 @@ if %AMDEP%
        %VERBOSE%source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif %AMDEP%
-if %?GENERIC%
-?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) 
'%SOURCE%'`
-?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% `$(CYGPATH_W) %SOURCEFLAG%'%SOURCE%'`
-else !%?GENERIC%
-## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`if test -f 
'%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) 
'$(srcdir)/%SOURCE%'; fi`
-?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`if test -f '%SOURCE%'; then 
$(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
-endif !%?GENERIC%
+?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) 
$(am__cooked_source_%GENERIC%)`
+?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`$(CYGPATH_W) 
$(am__cooked_source_%GENERIC%)`
 endif !%FASTDEP%
 endif %?NONLIBTOOL%
 
@@ -107,9 +95,7 @@ if %FASTDEP%
        %SILENT%$(am__ensure_depdir)
 ## In fast-dep mode, we can always use -o.
        %VERBOSE%%LTCOMPILE% -MT $@ -MD -MP -MF $(am__depbase).Tpo %-c% -o $@ \
-?GENERIC?      %SOURCEFLAG%%SOURCE%
-## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?!GENERIC?     %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+                %SOURCEFLAG%$(am__cooked_source_%GENERIC%)
        %SILENT%$(am__mv) $(am__depbase).Tpo $(am__depbase).Plo
 else !%FASTDEP%
 if %AMDEP%
@@ -118,8 +104,6 @@ if %AMDEP%
        DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif %AMDEP%
 ## We can always use `-o' with Libtool.
-?GENERIC?      %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
-## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?!GENERIC?     %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%`test -f 
'%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+       %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% 
%SOURCEFLAG%$(am__cooked_source_%GENERIC%)
 endif !%FASTDEP%
 endif %?LIBTOOL%
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index f412470..425a6b2 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -17,6 +17,11 @@
 
 VPATH = @srcdir@
 
+## Emulate VPATH rewrites.  This uses only GNU make primitives, which
+## allows us to avoid extra forks.
+am__vpath_rewrite = \
+  $(firstword $(wildcard $(strip $(1))) $(srcdir)/$(strip $(1)))
+
 ## We used to define this.  However, we don't because vendor makes
 ## (e.g., Solaris, Irix) won't correctly propagate variables that are
 ## defined in Makefile.  This particular variable can't be correctly
diff --git a/lib/am/lex.am b/lib/am/lex.am
index fb4077d..7926d74 100644
--- a/lib/am/lex.am
+++ b/lib/am/lex.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2002, 2003, 2004, 2006, 2009  Free Software
+## Copyright (C) 2001, 2002, 2003, 2004, 2006, 2009, 2012 Free Software
 ## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -24,6 +24,7 @@ endif %?MAINTAINER-MODE%
 
 ?GENERIC?%EXT%%DERIVED-EXT%:
 ?!GENERIC?%OBJ%: %SOURCE%
+?SUBDIROBJ?    %SILENT%test -d $(dir $@) || $(MKDIR_P) $(dir $@)
 ?GENERIC?      %VERBOSE%$(am__skiplex) $(SHELL) $(YLWRAP) %SOURCE% 
$(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
 ?!GENERIC?     %VERBOSE% \
 ?!GENERIC??DIST_SOURCE?        $(am__skiplex) \
diff --git a/lib/am/yacc.am b/lib/am/yacc.am
index 6d35cd4..4f608b0 100644
--- a/lib/am/yacc.am
+++ b/lib/am/yacc.am
@@ -1,6 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2006, 2009
-##   Free Software Foundation, Inc.
+## Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2006, 2009, 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
@@ -41,6 +41,7 @@ endif %?MAINTAINER-MODE%
 
 ?GENERIC?%EXT%%DERIVED-EXT%:
 ?!GENERIC?%OBJ%: %SOURCE%
+?SUBDIROBJ?    %SILENT%test -d $(dir $@) || $(MKDIR_P) $(dir $@)
 ?GENERIC?      %VERBOSE%$(am__skipyacc) $(SHELL) $(YLWRAP) %SOURCE% y.tab.c 
%OBJ% y.tab.h %BASE%.h y.output %BASE%.output -- %COMPILE%
 ?!GENERIC?     %VERBOSE% \
 ?!GENERIC??DIST_SOURCE?        $(am__skipyacc) \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f635d12..65c1089 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -43,7 +43,6 @@ override-conditional-2.test \
 java-nobase.test \
 objext-pr10128.test \
 pr8365-remake-timing.test \
-lex-subobj-nodep.test \
 remake-am-pr10111.test \
 remake-m4-pr10111.test \
 txinfo5.test \
diff --git a/tests/fort2.test b/tests/fort2.test
index b3c994c..10b00f3 100755
--- a/tests/fort2.test
+++ b/tests/fort2.test
@@ -19,6 +19,7 @@
 
 # Cf. fort1.test and link_f90_only.test.
 
+required=gfortran # Required only in order to run ./configure.
 . ./defs || Exit 1
 
 mkdir sub
@@ -30,32 +31,62 @@ AC_FC_SRCEXT([f95])
 AC_FC_SRCEXT([f03])
 AC_FC_SRCEXT([f08])
 AC_FC_SRCEXT([blabla])
+AC_OUTPUT
 END
 
 cat >Makefile.am <<'END'
 bin_PROGRAMS = hello goodbye
-hello_SOURCES = hello.f90 foo.f95 sub/bar.f95 hi.f03 sub/howdy.f03 greets.f08 
sub/bonjour.f08
+hello_SOURCES = hello.f90 foo.f95 sub/bar.f95 hi.f03 sub/howdy.f03 \
+                greets.f08 sub/bonjour.f08
 goodbye_SOURCES = bye.f95 sub/baz.f90
-goodbye_FCFLAGS =
+goodbye_FCFLAGS = --gby
 END
 
 $ACLOCAL
 $AUTOMAKE
-# The following tests aren't fool-proof, but they don't
-# need a Fortran compiler.
 grep '.\$(LINK)'       Makefile.in && Exit 1
 grep '.\$(FCLINK)'     Makefile.in
 grep '.\$(FCCOMPILE)'  Makefile.in > stdout
 cat stdout
 grep -v '\$(FCFLAGS_f' stdout && Exit 1
 grep '.\$(FC.*\$(FCFLAGS_blabla' Makefile.in && Exit 1
-# Notice the TAB:
-grep '^[       ].*\$(FC.*\$(FCFLAGS_f90).*\.f90' Makefile.in
-grep '^[       ].*\$(FC.*\$(FCFLAGS_f95).*\.f95' Makefile.in
-grep '^[       ].*\$(FC.*\$(FCFLAGS_f03).*\.f03' Makefile.in
-grep '^[       ].*\$(FC.*\$(FCFLAGS_f08).*\.f08' Makefile.in
-grep '^[       ].*\$(FC.*\$(FCFLAGS_f90).*\.f95' Makefile.in && Exit 1
-grep '^[       ].*\$(FC.*\$(FCFLAGS_f95).*\.f90' Makefile.in && Exit 1
-grep '^[       ].*\$(FC.*\$(FCFLAGS_f90).*\.f03' Makefile.in && Exit 1
-grep '^[       ].*\$(FC.*\$(FCFLAGS_f08).*\.f90' Makefile.in && Exit 1
+
+sed '/^AC_FC_SRCEXT.*blabla/d' configure.in >t
+mv -f t configure.in
+
+rm -rf autom4te*.cache
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+touch hello.f90 foo.f95 sub/bar.f95 hi.f03 sub/howdy.f03 greets.f08 \
+      sub/bonjour.f08 bye.f95 sub/baz.f90
+
+$MAKE -n FC=fake-fc \
+  address@hidden address@hidden address@hidden address@hidden \
+  > stdout || { cat stdout; Exit 1; }
+cat stdout
+# To make it easier to have  stricter grepping below.
+sed -e 's/[    ][      ]*/  /g' -e 's/^/ /' -e 's/$/ /' stdout > out
+cat out
+
+grep ' fake-fc .* address@hidden .* hello\.f90 ' out
+grep ' fake-fc .* address@hidden .* foo\.f95 ' out
+grep ' fake-fc .* address@hidden .* sub/bar\.f95 ' out
+grep ' fake-fc .* address@hidden .* hi\.f03 ' out
+grep ' fake-fc .* address@hidden .* sub/howdy\.f03 ' out
+grep ' fake-fc .* address@hidden .* greets\.f08 ' out
+grep ' fake-fc .* address@hidden .* sub/bonjour\.f08 ' out
+grep ' fake-fc .* --gby .* address@hidden .* bye\.f95 ' out
+grep ' fake-fc .* --gby .* address@hidden .* sub/baz\.f90 ' out
+
+test `grep -c '.*--gby.*\.f' out` -eq 2
+
+$EGREP 'fake-fc.*--@(95|03|08).*\.f90' out && Exit 1
+$EGREP 'fake-fc.*--@(90|03|08).*\.f95' out && Exit 1
+$EGREP 'fake-fc.*--@(90|95|08).*\.f03' out && Exit 1
+$EGREP 'fake-fc.*--@(95|95|03).*\.f08' out && Exit 1
+
 :
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index d590868..ee0edf2 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -1154,6 +1154,7 @@ version6.test \
 version7.test \
 version8.test \
 vpath.test \
+vpath-rewrite.test \
 vtexi.test \
 vtexi2.test \
 vtexi3.test \
@@ -1182,6 +1183,7 @@ yacc6.test \
 yacc7.test \
 yacc8.test \
 yaccdry.test \
+yacc-subobj-nodep.test \
 yacc-dist-nobuild.test \
 yacc-nodist.test \
 yaccpp.test \
diff --git a/tests/subobj4.test b/tests/subobj4.test
index 0a29ad0..b3c5696 100755
--- a/tests/subobj4.test
+++ b/tests/subobj4.test
@@ -48,6 +48,7 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep '\$(CC) .*\.\./d2/z\.c' d1/Makefile.in
+grep '^z\.o:.* \.\./d2/z\.c *$' d1/Makefile.in
+grep "@address@hidden'\"]../d2/z.c['\"] " d1/Makefile.in
 
 :
diff --git a/tests/vpath-rewrite.test b/tests/vpath-rewrite.test
new file mode 100755
index 0000000..0b43236
--- /dev/null
+++ b/tests/vpath-rewrite.test
@@ -0,0 +1,100 @@
+#! /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/>.
+
+# Test Automake-provided internal make macros to deal with VPATH rewrites.
+
+. ./defs || Exit 1
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << END
+bsub:
+       mkdir \$@
+bsub/foo: bsub
+       mkdir \$@
+bsub/foo/bar: bsub/foo
+       mkdir \$@
+bsub/mu.c++: bsub/foo
+       touch \$@
+bsub/foo/pu.cxx: bsub/foo
+       touch \$@
+
+clean-local:
+       rm -rf bsub
+
+## Yes, I'm a lazy typist.
+vr = \$(am__vpath_rewrite)
+
+test-common: bsub/foo/bar bsub/mu.c++ bsub/foo/pu.cxx
+       test '\$(call vr,Makefile)'             = Makefile
+       test '\$(call vr,$tab config.status  )' = config.status
+       test '\$(call vr,.)'                    = .
+## FIXME: These two do not work apparently :-(  Such use cases are not
+## FIXME: required presently though, so this is not a big deal.
+       : test '\$(call vr, bsub$tab  )'        = bsub
+       : test '\$(call vr,bsub)'               = bsub
+       test '\$(call vr,bsub/.)'               = bsub/.
+       test '\$(call vr,bsub/mu.c++)'          = bsub/mu.c++
+       test '\$(call vr,bsub/foo/pu.cxx)'      = bsub/foo/pu.cxx
+       test '\$(call vr,bsub/foo )'            = bsub/foo
+       test '\$(call vr,bsub/foo/bar)'         = bsub/foo/bar
+       test '\$(call vr,nonesuch)'             = \$(srcdir)/nonesuch
+       test '\$(call vr, $tab  nonesuch2  )'   = \$(srcdir)/nonesuch2
+       test '\$(call vr, sub/none)'            = \$(srcdir)/sub/none
+
+test-vpath: test-common
+       test '\$(call vr,ssub)'                   = \$(srcdir)/ssub
+       test '\$(call vr,ssub/foo )'              = \$(srcdir)/ssub/foo
+       test '\$(call vr, ssub/foo/bar)'          = \$(srcdir)/ssub/foo/bar
+       test '\$(call vr,Makefile.in )'           = \$(srcdir)/Makefile.in
+       test '\$(call vr,zap/paz.c)'              = \$(srcdir)/zap/paz.c
+       test '\$(call vr,configure $tab)'         = \$(srcdir)/configure
+       test '\$(call vr,    configure.in$tab  )' = \$(srcdir)/configure.in
+
+test-intree: test-common
+       test '\$(call vr,ssub)'                   = ssub
+       test '\$(call vr,ssub/foo )'              = ssub/foo
+       test '\$(call vr, ssub/foo/bar)'          = ssub/foo/bar
+       test '\$(call vr,Makefile.in )'           = Makefile.in
+       test '\$(call vr,zap/paz.c)'              = zap/paz.c
+       test '\$(call vr,configure $tab)'         = configure
+       test '\$(call vr,    configure.in$tab  )' = configure.in
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+mkdir zap ssub ssub/foo ssub/foo/bar
+: > zap/paz.c
+
+./configure
+$MAKE test-intree
+$MAKE distclean
+
+mkdir build
+cd build
+../configure
+$MAKE test-vpath
+cd ..
+
+ocwd=`pwd` || fatal_ "couldn't get current working directory"
+mkdir build2 build2/subbuild
+cd build2/subbuild
+"$ocwd"/configure
+$MAKE test-vpath
+
+:
diff --git a/tests/lex-subobj-nodep.test b/tests/yacc-subobj-nodep.test
similarity index 56%
copy from tests/lex-subobj-nodep.test
copy to tests/yacc-subobj-nodep.test
index 5db7168..81f9c6e 100755
--- a/tests/lex-subobj-nodep.test
+++ b/tests/yacc-subobj-nodep.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# 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
@@ -14,55 +14,55 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Ensure subdirs for subdir scanners are generated when subdir-objects
+# Ensure subdirs for subdir parsers are generated when subdir-objects
 # are used, even when dependency tracking is disabled.
 
-required='cc flex'
+required='cc yacc'
 . ./defs || Exit 1
 
-cat >>configure.in <<\END
+cat >configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([no-dependencies subdir-objects])
+AC_CONFIG_FILES([Makefile])
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_PROG_LEX
+AC_PROG_YACC
 AC_OUTPUT
 END
 
-cat >Makefile.am <<\END
-AUTOMAKE_OPTIONS = subdir-objects
+cat >Makefile.am <<END
 bin_PROGRAMS = p1 p2
-p1_SOURCES = sub1/s1.l
-p2_SOURCES = sub2/s2.l
+p1_SOURCES = sub1/s1.y
+p2_SOURCES = sub2/s2.y
 p2_CPPFLAGS = -DWHATEVER
 END
 
 mkdir sub1 sub2
 
-cat >sub1/s1.l <<\END
+cat >sub1/s1.y <<END
+%{
+int yylex () { return 0; }
+void yyerror (char *s) { return; }
+int main (void) { yyparse (); return 1; }
+%}
 %%
-"END"   return EOF;
-.
-%%
-int main (void)
-{
-  while (yylex () != EOF)
-    ;
-  return 0;
-}
-
-int yywrap(void)
-{
-  return 1;
-}
+foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
 END
 
-cp sub1/s1.l sub2/s2.l
+cp sub1/s1.y sub2/s2.y
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 mkdir build
 cd build
-../configure --disable-dependency-tracking
+
+# Sanity check.
+../configure --help # For debugging.
+../configure --help | $EGREP '(dis|en)able-depend' \
+  && fatal_ "couldn't disable dependency tracking support globally"
+
+../configure
 $MAKE sub1/s1.c
 $MAKE sub2/s2.c
 rm -rf sub1 sub2


hooks/post-receive
-- 
GNU Automake



reply via email to

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