From: Stefano Lattarini Date: Thu, 7 Jun 2012 08:38:29 +0000 (+0200) Subject: [ng] tests: remove explicit usages of the 'subdir-objects' option X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df3b0944630a84a79c11654664ac666f1750302e;p=thirdparty%2Fautomake.git [ng] tests: remove explicit usages of the 'subdir-objects' option It is enabled unconditionally since the previous change. * Several tests: Adjust, extend, rework and simplify, as needed. * t/ax/depcomp-shuffle.sh, t/ax/depcomp.sh: Likewise. * t/subobj2.sh: Rename ... * t/subobj-cxx-grep.sh: ... to this, and adjust. * t/subobj.sh: Rename ... * t/subobj-c.sh: ... to this, and adjust. * t/subobj-cxx.sh: New test. Signed-off-by: Stefano Lattarini --- diff --git a/t/amopts-variable-expansion.sh b/t/amopts-variable-expansion.sh index 2c39df883..1c085b224 100755 --- a/t/amopts-variable-expansion.sh +++ b/t/amopts-variable-expansion.sh @@ -16,6 +16,7 @@ # Check that AUTOMAKE_OPTIONS support variable expansion. +am_create_testdir=empty . ./defs || Exit 1 # We want complete control over automake options. @@ -30,12 +31,12 @@ END cat > Makefile.am <<'END' # The following should expand to: -# subdir-objects -Wnone -Wno-error foreign -Wportability +# no-dist -Wnone -Wno-error foreign -Wextra-portability AUTOMAKE_OPTIONS = $(foo) foreign AUTOMAKE_OPTIONS += ${bar} foo = $(foo1) foo1 = ${foo2} -foo2 = subdir-objects -Wnone +foo2 = no-dist -Wnone foo2 += $(foo3) foo3 = -Wno-error bar = -Wportability @@ -46,10 +47,16 @@ foo_SOURCES = sub/foo.c install: END +: > compile +: > missing +: > depcomp +: > install-sh + $ACLOCAL AUTOMAKE_run grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr grep README stderr && Exit 1 $EGREP '(install|override)' stderr && Exit 1 +$EGREP 'distdir|\.tar' Makefile.in && Exit 1 : diff --git a/t/ax/depcomp-shuffle.sh b/t/ax/depcomp-shuffle.sh index 56eb7a399..3e9f61b2d 100644 --- a/t/ax/depcomp-shuffle.sh +++ b/t/ax/depcomp-shuffle.sh @@ -74,10 +74,7 @@ echo AC_PROG_RANLIB >> configure.ac test -z "$xdir" || echo AM_PROG_CC_C_O >> configure.ac echo AC_OUTPUT >> configure.ac -if test -n "$xdir"; then - echo AUTOMAKE_OPTIONS = subdir-objects > Makefile.am -fi -cat >> Makefile.am < Makefile.am < src/Makefile.am <. # Make sure Automake requires AM_PROG_CC_C_O when either per-targets -# flags or subdir-objects are used. +# flags or subdir objects are used. . ./defs || Exit 1 diff --git a/t/ccnoco3.sh b/t/ccnoco3.sh index eb291ecd5..5069a7c5f 100755 --- a/t/ccnoco3.sh +++ b/t/ccnoco3.sh @@ -27,7 +27,6 @@ AC_OUTPUT END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = wish wish_SOURCES = a.c END diff --git a/t/check8.sh b/t/check8.sh index 9e0c0ffda..b50a5124b 100755 --- a/t/check8.sh +++ b/t/check8.sh @@ -27,7 +27,6 @@ AC_OUTPUT END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects TESTS = foo sub/foo $(check_PROGRAMS) XFAIL_TESTS = foo sub/baz check_PROGRAMS = bar sub/bar baz sub/baz diff --git a/t/depcomp-recover.sh b/t/depcomp-recover.sh index c8747cddc..a93319cb8 100755 --- a/t/depcomp-recover.sh +++ b/t/depcomp-recover.sh @@ -55,7 +55,6 @@ echo 'int foo (void);' > foo.h mkdir sub sub/src cat > sub/Makefile.am <<'END' -AUTOMAKE_OPTIONS = subdir-objects noinst_PROGRAMS = foo foo_SOURCES = src/main.c src/foo.c src/foo.h END diff --git a/t/depcomp-shuffle-sub-vpath.sh b/t/depcomp-shuffle-sub-vpath.sh index 67f7c1928..223008f04 100755 --- a/t/depcomp-shuffle-sub-vpath.sh +++ b/t/depcomp-shuffle-sub-vpath.sh @@ -16,7 +16,7 @@ # Dependency tracking in the face of added/removed/renamed files. # - VPATH build -# - use of subdir-objects +# - use of subdir objects . ./defs-static || exit '99' xdir='sub' vpath='yes' diff --git a/t/depcomp-shuffle-sub.sh b/t/depcomp-shuffle-sub.sh index a2bbf2f82..57abf0ce7 100755 --- a/t/depcomp-shuffle-sub.sh +++ b/t/depcomp-shuffle-sub.sh @@ -16,7 +16,7 @@ # Dependency tracking in the face of added/removed/renamed files. # - in-tree build -# - use of subdir-objects +# - use of subdir objects . ./defs-static || exit '99' xdir='sub' vpath='no' diff --git a/t/depcomp-shuffle-vpath.sh b/t/depcomp-shuffle-vpath.sh index 2686a5431..ea8cbda5a 100755 --- a/t/depcomp-shuffle-vpath.sh +++ b/t/depcomp-shuffle-vpath.sh @@ -16,7 +16,7 @@ # Dependency tracking in the face of added/removed/renamed files. # - VPATH build -# - no use of subdir-objects +# - no use of subdir objects . ./defs-static || exit '99' xdir='' vpath='yes' diff --git a/t/depcomp-shuffle.sh b/t/depcomp-shuffle.sh index e8126081b..3a284db92 100755 --- a/t/depcomp-shuffle.sh +++ b/t/depcomp-shuffle.sh @@ -16,7 +16,7 @@ # Dependency tracking in the face of added/removed/renamed files. # - in-tree build -# - no use of subdir-objects +# - no use of subdir objects . ./defs-static || exit '99' xdir='' vpath='no' diff --git a/t/instdir-ltlib.sh b/t/instdir-ltlib.sh index 5e1a31f37..1234f4922 100755 --- a/t/instdir-ltlib.sh +++ b/t/instdir-ltlib.sh @@ -33,7 +33,6 @@ END mkdir sub cat >Makefile.am <<'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = p nobase_bin_PROGRAMS = np sub/np lib_LTIBRARIES = libfoo.la diff --git a/t/instdir-prog.sh b/t/instdir-prog.sh index 179041a3f..bef6374fc 100755 --- a/t/instdir-prog.sh +++ b/t/instdir-prog.sh @@ -33,7 +33,6 @@ END mkdir sub cat >Makefile.am <<'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = p nobase_bin_PROGRAMS = np sub/np lib_LIBRARIES = libfoo.a diff --git a/t/lex-subobj-nodep.sh b/t/lex-subobj-nodep.sh index 44c977635..f2c9626f0 100755 --- a/t/lex-subobj-nodep.sh +++ b/t/lex-subobj-nodep.sh @@ -14,8 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Ensure subdirs for subdir scanners are generated when subdir-objects -# are used, even when dependency tracking is disabled. +# Ensure subdirs for subdir scanners are generated, even when dependency +# tracking is disabled. required='cc lex' . ./defs || Exit 1 @@ -28,7 +28,6 @@ AC_OUTPUT END cat >Makefile.am <<\END -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = p1 p2 p1_SOURCES = sub1/s1.l p2_SOURCES = sub2/s2.l diff --git a/t/lex5.sh b/t/lex5.sh index 624ad2a99..350ac3b52 100755 --- a/t/lex5.sh +++ b/t/lex5.sh @@ -27,10 +27,8 @@ AC_OUTPUT END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects -LDADD = @LEXLIB@ - -bin_PROGRAMS = foo/foo +LDADD = @LEXLIB@ +bin_PROGRAMS = foo/foo foo_foo_SOURCES = foo/foo.l END @@ -44,8 +42,7 @@ cat > foo/foo.l << 'END' "END" return EOF; . %% -int -main () +int main (void) { while (yylex () != EOF) ; diff --git a/t/libobj19.sh b/t/libobj19.sh index 810572710..5301e37a4 100755 --- a/t/libobj19.sh +++ b/t/libobj19.sh @@ -30,7 +30,6 @@ AC_OUTPUT END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects noinst_LIBRARIES = libtu.a libtu_a_SOURCES = libtu_a_LIBADD = $(LIBOBJS) diff --git a/t/libobj20b.sh b/t/libobj20b.sh index 97807fee8..395bd7b19 100755 --- a/t/libobj20b.sh +++ b/t/libobj20b.sh @@ -31,7 +31,6 @@ AC_OUTPUT END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects noinst_LIBRARIES = libtu.a libtu_a_SOURCES = libtu_a_LIBADD = $(LIBOBJS) diff --git a/t/libobj20c.sh b/t/libobj20c.sh index 64b703044..e764e975d 100755 --- a/t/libobj20c.sh +++ b/t/libobj20c.sh @@ -27,7 +27,6 @@ AC_LIBOBJ([foobar]) END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects noinst_LIBRARIES = libtu.a libtu_a_SOURCES = libtu_a_LIBADD = $(LIBOBJS) diff --git a/t/libtool7.sh b/t/libtool7.sh index bc8eacae3..d18d2d359 100755 --- a/t/libtool7.sh +++ b/t/libtool7.sh @@ -29,7 +29,6 @@ AC_OUTPUT END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects AM_LIBTOOLFLAGS = --silent lib_LTLIBRARIES = libmod1.la mod2.la libmod1_la_SOURCES = sub/mod1.c diff --git a/t/parallel-am2.sh b/t/parallel-am2.sh index a8ee1b955..2636756b4 100755 --- a/t/parallel-am2.sh +++ b/t/parallel-am2.sh @@ -26,7 +26,6 @@ required=perl-threads mkdir sub cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = main main_SOURCES = sub/main.c SUBDIRS = @@ -38,7 +37,6 @@ for i in $list; do echo "SUBDIRS += sub$i" >> Makefile.am mkdir sub$i sub$i/sub unindent > sub$i/Makefile.am << END - AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = sub$i sub${i}_SOURCES = sub/main$i.c END diff --git a/t/pr224.sh b/t/pr224.sh index 51e3c1723..ef44cdde4 100755 --- a/t/pr224.sh +++ b/t/pr224.sh @@ -36,7 +36,6 @@ int main (void) EOF cat >Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = bar bar_SOURCES = foo/main.c EOF diff --git a/t/pr401.sh b/t/pr401.sh index 7e8c491b1..0a0cbcd91 100755 --- a/t/pr401.sh +++ b/t/pr401.sh @@ -115,8 +115,6 @@ SUBDIRS = src EOF cat > src/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects - noinst_LIBRARIES = libfeep.a libfeep_a_SOURCES = libfeep_a_LIBADD = $(LIBOBJS) @@ -148,8 +146,6 @@ sed 's/^.*src\/Makefile.*$//' configure.ac >configure.int mv -f configure.int configure.ac cat >Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects - noinst_LIBRARIES = lib/libfeep.a lib_libfeep_a_SOURCES = lib_libfeep_a_LIBADD = $(LIBOBJS) diff --git a/t/pr401b.sh b/t/pr401b.sh index 6f49b1f0d..f41dde9a3 100755 --- a/t/pr401b.sh +++ b/t/pr401b.sh @@ -117,8 +117,6 @@ SUBDIRS = src EOF cat > src/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects - noinst_LTLIBRARIES = libfeep.la libfeep_la_SOURCES = libfeep_la_LIBADD = $(LTLIBOBJS) @@ -150,8 +148,6 @@ sed 's/^.*src\/Makefile.*$//' configure.ac >configure.int mv -f configure.int configure.ac cat >Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects - noinst_LTLIBRARIES = lib/libfeep.la lib_libfeep_la_SOURCES = lib_libfeep_la_LIBADD = $(LTLIBOBJS) diff --git a/t/pr401c.sh b/t/pr401c.sh index ea2f03d0e..c2fc06e55 100755 --- a/t/pr401c.sh +++ b/t/pr401c.sh @@ -118,8 +118,6 @@ SUBDIRS = src EOF cat > src/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects - noinst_LIBRARIES = libfeep.a libfeep_a_SOURCES = libfeep_a_LIBADD = $(ALLOCA) $(LIBOBJS) # Add LIBOBJS for fun. @@ -151,8 +149,6 @@ sed 's/^.*src\/Makefile.*$//' configure.ac >configure.int mv -f configure.int configure.ac cat >Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects - noinst_LIBRARIES = lib/libfeep.a lib_libfeep_a_SOURCES = lib_libfeep_a_LIBADD = $(ALLOCA) diff --git a/t/repeated-options.sh b/t/repeated-options.sh index 8ad576500..e48a60faa 100755 --- a/t/repeated-options.sh +++ b/t/repeated-options.sh @@ -17,65 +17,31 @@ # Check that automake does not complain on repeated options, nor # generate broken or incorrect makefiles. -required='cc bzip2' +required=bzip2 . ./defs || Exit 1 cat >configure.ac < Makefile.am <<'END' -AUTOMAKE_OPTIONS = parallel-tests subdir-objects subdir-objects -AUTOMAKE_OPTIONS += dist-bzip2 parallel-tests -TESTS = foo.test -EXTRA_DIST = $(TESTS) -TESTS_ENVIRONMENT = EXEEXT='$(EXEEXT)' -bin_PROGRAMS = sub/foo -.PHONY: test-build -test-build: - ls -l . sub - test -f sub/foo.$(OBJEXT) - test -f sub/foo$(EXEEXT) +AUTOMAKE_OPTIONS = no-dist-gzip no-dist-gzip dist-bzip2 +AUTOMAKE_OPTIONS += dist-bzip2 foreign END -mkdir sub - -cat > foo.test <<'END' -#!/bin/sh -test -f sub/foo$EXEEXT && test -x sub/foo$EXEEXT -END -chmod a+x foo.test - -cat > sub/foo.c <<'END' -int main (void) -{ - return 0; -} -END - -cp "$am_scriptdir"/compile "$am_scriptdir"/test-driver . - $ACLOCAL -$AUTOMAKE --foreign --foreign -Wall 2>stderr || { cat stderr >&2; Exit 1; } -test -s stderr && { cat stderr >&2; Exit 1; } -rm -f stderr $AUTOCONF +$AUTOMAKE --foreign --foreign -Wall 2>stderr && test ! -s stderr \ + || { cat stderr >&2; Exit 1; } ./configure + $MAKE -$MAKE test-build -$MAKE check -ls -l -test -f foo.log -test -f test-suite.log -$MAKE clean $MAKE distcheck -ls -l test -f $me-1.0.tar.bz2 test ! -r $me-1.0.tar.gz diff --git a/t/silent-lex.sh b/t/silent-lex.sh index fa9623ce0..a663961f0 100755 --- a/t/silent-lex.sh +++ b/t/silent-lex.sh @@ -19,12 +19,9 @@ required='cc lex' . ./defs || Exit 1 -mkdir sub - cat >>configure.ac <<'EOF' AM_PROG_CC_C_O AC_PROG_LEX -AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT EOF @@ -35,18 +32,6 @@ foo1_SOURCES = foo.l foo2_SOURCES = $(foo1_SOURCES) foo2_LFLAGS = -n foo2_CFLAGS = $(AM_CFLAGS) -SUBDIRS = sub -LDADD = $(LEXLIB) -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = bar1 bar2 -bar1_SOURCES = bar.l -bar2_SOURCES = $(bar1_SOURCES) -bar2_LFLAGS = -n -bar2_CFLAGS = $(AM_CFLAGS) LDADD = $(LEXLIB) EOF @@ -62,7 +47,6 @@ cat > foo.l <<'EOF' int yywrap (void) { return 1; } int main (void) { return 0; } EOF -cp foo.l sub/bar.l $ACLOCAL $AUTOMAKE --add-missing @@ -70,7 +54,6 @@ $AUTOCONF # Ensure per-target rules are used, to ensure their coverage below. $FGREP 'foo2-foo.c' Makefile.in || Exit 99 -$FGREP 'bar2-bar.c' sub/Makefile.in || Exit 99 ./configure --enable-silent-rules @@ -81,13 +64,9 @@ $EGREP ' (-c|-o)' stdout && Exit 1 $EGREP '(mv|ylwrap) ' stdout && Exit 1 grep 'LEX .*foo\.' stdout -grep 'LEX .*bar\.' stdout grep ' CC .*foo\.' stdout -grep ' CC .*bar\.' stdout grep 'CCLD .*foo1' stdout -grep 'CCLD .*bar1' stdout grep 'CCLD .*foo2' stdout -grep 'CCLD .*bar2' stdout # Cleaning and then rebuilding with the same V flag (and without # removing the generated sources in between) shouldn't trigger a @@ -102,15 +81,12 @@ $EGREP '(mv|ylwrap) ' stdout && Exit 1 # Don't look for LEX, as probably lex hasn't been re-run. grep ' CC .*foo\.' stdout -grep ' CC .*bar\.' stdout grep 'CCLD .*foo1' stdout -grep 'CCLD .*bar1' stdout grep 'CCLD .*foo2' stdout -grep 'CCLD .*bar2' stdout # Ensure a truly clean rebuild. $MAKE clean -rm -f *foo.c sub/*bar.c +rm -f *foo.c $MAKE V=1 >stdout || { cat stdout; Exit 1; } cat stdout diff --git a/t/silent-many-gcc.sh b/t/silent-many-gcc.sh index 8ad07205a..f6eabbed0 100755 --- a/t/silent-many-gcc.sh +++ b/t/silent-many-gcc.sh @@ -42,27 +42,20 @@ do_and_check_silent_build () $EGREP ' (-c|-o)' stdout && Exit 1 $EGREP '(mv|ylwrap) ' stdout && Exit 1 + grep ' CC .*bar\.' stdout grep 'CXX .*foo1\.' stdout - grep 'CXX .*baz1\.' stdout - grep 'FC .*foo2\.' stdout - grep 'FC .*baz2\.' stdout + grep ' FC .*foo2\.' stdout grep 'F77 .*foo3\.' stdout - grep 'F77 .*baz3\.' stdout grep ' CC .*foo5\.' stdout - grep ' CC .*baz5\.' stdout grep ' CC .*foo6\.' stdout - grep ' CC .*baz6\.' stdout grep 'CXXLD .*foo' stdout - grep 'CCLD .*bar' stdout + grep ' CCLD .*bar' stdout grep 'CXXLD .*baz' stdout - grep 'CCLD .*bla' stdout if $rebuild; then :; else grep 'YACC .*foo6\.' stdout - grep 'YACC .*baz6\.' stdout grep 'LEX .*foo5\.' stdout - grep 'LEX .*baz5\.' stdout fi unset rebuild @@ -92,8 +85,6 @@ do_and_check_verbose_build () unset rebuild } -mkdir sub - cat >>configure.ac <<'EOF' AM_PROG_CC_C_O AC_PROG_CXX @@ -101,46 +92,37 @@ AC_PROG_F77 AC_PROG_FC AC_PROG_LEX AC_PROG_YACC -AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -bin_PROGRAMS = foo bar fo2 +bin_PROGRAMS = foo bar baz bar_CFLAGS = $(AM_CFLAGS) foo_SOURCES = foo1.cpp foo2.f90 foo3.f foo5.l foo6.y -fo2_SOURCES = $(foo_SOURCES) -fo2_CPPFLAGS = $(AM_CPPFLAGS) -fo2_FFLAGS = $(AM_FFLAGS) -fo2_FCFLAGS = $(AM_FCFLAGS) -fo2_YFLAGS = -v -fo2_LFLAGS = -n -SUBDIRS = sub +baz_SOURCES = $(foo_SOURCES) +baz_CPPFLAGS = $(AM_CPPFLAGS) +baz_FFLAGS = $(AM_FFLAGS) +baz_FCFLAGS = $(AM_FCFLAGS) +baz_YFLAGS = -v +baz_LFLAGS = -n AM_YFLAGS = -d LDADD = $(LEXLIB) BUILT_SOURCES = foo6.h EOF -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = baz bla ba2 -bla_CFLAGS = $(AM_CFLAGS) -baz_SOURCES = baz1.cpp baz2.f90 baz3.f baz5.l baz6.y -ba2_SOURCES = $(baz_SOURCES) -ba2_CPPFLAGS = $(AM_CPPFLAGS) -ba2_FFLAGS = $(AM_FFLAGS) -ba2_FCFLAGS = $(AM_FCFLAGS) -ba2_YFLAGS = -v -ba2_LFLAGS = -n -AM_YFLAGS = -d -LDADD = $(LEXLIB) -BUILT_SOURCES = baz6.h +cat > bar.c <<'EOF' +/* Valid C, invalid C++. */ +int main (void) +{ + int new = 0; + return new; +} EOF - cat > foo1.cpp <<'EOF' -int main () +/* Valid C++, invalid C. */ +using namespace std; +int main (void) { return 0; } @@ -177,14 +159,6 @@ void yyerror (char *s) {} %% fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {}; EOF -cp foo1.cpp bar.c -cp foo1.cpp sub/baz.c -cp foo1.cpp sub/bla.c -cp foo1.cpp sub/baz1.cpp -cp foo2.f90 sub/baz2.f90 -cp foo3.f sub/baz3.f -cp foo5.l sub/baz5.l -cp foo6.y sub/baz6.y $ACLOCAL $AUTOMAKE --add-missing @@ -196,9 +170,9 @@ $FGREP am_cv_CC_dependencies_compiler_type configure $FGREP am_cv_CXX_dependencies_compiler_type configure # Ensure per-target rules are used, to ensure their coverage below. # (We do not do an exhaustive check, that wouldn't be practical). -$FGREP 'bar-bar.o' Makefile.in -$FGREP 'fo2-foo5.c' Makefile.in -$FGREP 'fo2-foo6.c' Makefile.in +$FGREP 'bar-bar.o' Makefile.in || Exit 99 +$FGREP 'baz-foo5.c' Makefile.in || Exit 99 +$FGREP 'baz-foo6.c' Makefile.in || Exit 99 # Force gcc ("fast") depmode. depmodes="am_cv_CC_dependencies_compiler_type=gcc \ @@ -222,7 +196,7 @@ do $MAKE clean # This is required, since these files are not removed by 'make clean' # (as dictated by the GNU Coding Standards). - rm -f *foo5.c *foo6.[ch] sub/*baz5.c sub/*baz6.[ch] + rm -f *foo5.c *foo6.[ch] do_and_check_verbose_build # Cleaning and then rebuilding with the same V flag (and without diff --git a/t/silent-many-generic.sh b/t/silent-many-generic.sh index cd376721a..a6b4a1e46 100755 --- a/t/silent-many-generic.sh +++ b/t/silent-many-generic.sh @@ -43,27 +43,20 @@ do_and_check_silent_build () $EGREP ' (-c|-o)' stdout && Exit 1 $EGREP '(mv|ylwrap) ' stdout && Exit 1 + grep ' CC .*bar\.' stdout grep 'CXX .*foo1\.' stdout - grep 'CXX .*baz1\.' stdout - grep 'FC .*foo2\.' stdout - grep 'FC .*baz2\.' stdout + grep ' FC .*foo2\.' stdout grep 'F77 .*foo3\.' stdout - grep 'F77 .*baz3\.' stdout grep ' CC .*foo5\.' stdout - grep ' CC .*baz5\.' stdout grep ' CC .*foo6\.' stdout - grep ' CC .*baz6\.' stdout grep 'CXXLD .*foo' stdout - grep 'CCLD .*bar' stdout + grep ' CCLD .*bar' stdout grep 'CXXLD .*baz' stdout - grep 'CCLD .*bla' stdout if $rebuild; then :; else grep 'YACC .*foo6\.' stdout - grep 'YACC .*baz6\.' stdout grep 'LEX .*foo5\.' stdout - grep 'LEX .*baz5\.' stdout fi unset rebuild @@ -93,8 +86,6 @@ do_and_check_verbose_build () unset rebuild } -mkdir sub - cat >>configure.ac <<'EOF' AM_PROG_CC_C_O AC_PROG_F77 @@ -128,46 +119,37 @@ case " $CXX " in CXX=am--cxx esac -AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -bin_PROGRAMS = foo bar fo2 +bin_PROGRAMS = foo bar baz bar_CFLAGS = $(AM_CFLAGS) foo_SOURCES = foo1.cpp foo2.f90 foo3.f foo5.l foo6.y -fo2_SOURCES = $(foo_SOURCES) -fo2_CPPFLAGS = $(AM_CPPFLAGS) -fo2_FFLAGS = $(AM_FFLAGS) -fo2_FCFLAGS = $(AM_FCFLAGS) -fo2_YFLAGS = -v -fo2_LFLAGS = -n -SUBDIRS = sub +baz_SOURCES = $(foo_SOURCES) +baz_CPPFLAGS = $(AM_CPPFLAGS) +baz_FFLAGS = $(AM_FFLAGS) +baz_FCFLAGS = $(AM_FCFLAGS) +baz_YFLAGS = -v +baz_LFLAGS = -n AM_YFLAGS = -d LDADD = $(LEXLIB) BUILT_SOURCES = foo6.h EOF -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = baz bla ba2 -bla_CFLAGS = $(AM_CFLAGS) -baz_SOURCES = baz1.cpp baz2.f90 baz3.f baz5.l baz6.y -ba2_SOURCES = $(baz_SOURCES) -ba2_CPPFLAGS = $(AM_CPPFLAGS) -ba2_FFLAGS = $(AM_FFLAGS) -ba2_FCFLAGS = $(AM_FCFLAGS) -ba2_YFLAGS = -v -ba2_LFLAGS = -n -AM_YFLAGS = -d -LDADD = $(LEXLIB) -BUILT_SOURCES = baz6.h +cat > bar.c <<'EOF' +/* Valid C, invalid C++. */ +int main (void) +{ + int new = 0; + return new; +} EOF - cat > foo1.cpp <<'EOF' -int main () +/* Valid C++, invalid C. */ +using namespace std; +int main (void) { return 0; } @@ -204,14 +186,6 @@ void yyerror (char *s) {} %% fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {}; EOF -cp foo1.cpp bar.c -cp foo1.cpp sub/baz.c -cp foo1.cpp sub/bla.c -cp foo1.cpp sub/baz1.cpp -cp foo2.f90 sub/baz2.f90 -cp foo3.f sub/baz3.f -cp foo5.l sub/baz5.l -cp foo6.y sub/baz6.y mkdir bin saved_PATH=$PATH; export saved_PATH @@ -223,9 +197,9 @@ $AUTOCONF # Ensure per-target rules are used, to ensure their coverage below. # (We do not do an exhaustive check, that wouldn't be practical). -$FGREP 'bar-bar.o' Makefile.in -$FGREP 'fo2-foo5.c' Makefile.in -$FGREP 'fo2-foo6.c' Makefile.in +$FGREP 'bar-bar.o' Makefile.in || Exit 99 +$FGREP 'baz-foo5.c' Makefile.in || Exit 99 +$FGREP 'baz-foo6.c' Makefile.in || Exit 99 # Force dependency tracking explicitly, so that slow dependency # extractors are not rejected. Try also with dependency tracking @@ -247,7 +221,7 @@ do $MAKE clean # This is required, since these files are not removed by 'make clean' # (as dictated by the GNU Coding Standards). - rm -f *foo5.c *foo6.[ch] sub/*baz5.c sub/*baz6.[ch] + rm -f *foo5.c *foo6.[ch] do_and_check_verbose_build # Cleaning and then rebuilding with the same V flag (and without diff --git a/t/silent-yacc.sh b/t/silent-yacc.sh index 4b493b5af..9a075fccd 100755 --- a/t/silent-yacc.sh +++ b/t/silent-yacc.sh @@ -20,12 +20,9 @@ required='cc yacc' . ./defs || Exit 1 -mkdir sub - cat >>configure.ac <<'EOF' AM_PROG_CC_C_O AC_PROG_YACC -AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT EOF @@ -36,17 +33,6 @@ foo1_SOURCES = foo.y foo2_SOURCES = $(foo1_SOURCES) foo2_YFLAGS = -v foo2_CFLAGS = $(AM_CPPFLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = bar1 bar2 -bar1_SOURCES = bar.y -bar2_SOURCES = $(bar1_SOURCES) -bar2_YFLAGS = -v -bar2_CFLAGS = $(AM_CPPFLAGS) EOF cat > foo.y <<'EOF' @@ -59,7 +45,6 @@ int main (void) { return 0; } %% fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {}; EOF -cp foo.y sub/bar.y $ACLOCAL $AUTOMAKE --add-missing @@ -67,7 +52,6 @@ $AUTOCONF # Ensure per-target rules are used, to ensure their coverage below. $FGREP 'foo2-foo.c' Makefile.in || Exit 99 -$FGREP 'bar2-bar.c' sub/Makefile.in || Exit 99 ./configure --enable-silent-rules @@ -78,13 +62,9 @@ $EGREP ' (-c|-o)' stdout && Exit 1 $EGREP '(mv|ylwrap) ' stdout && Exit 1 grep 'YACC .*foo\.' stdout -grep 'YACC .*bar\.' stdout -grep ' CC .*foo\.' stdout -grep ' CC .*bar\.' stdout -grep 'CCLD .*foo1' stdout -grep 'CCLD .*bar1' stdout -grep 'CCLD .*foo2' stdout -grep 'CCLD .*bar2' stdout +grep ' CC .*foo\.' stdout +grep 'CCLD .*foo1' stdout +grep 'CCLD .*foo2' stdout # Cleaning and then rebuilding with the same V flag (and without # removing the generated sources in between) shouldn't trigger a @@ -98,16 +78,13 @@ $EGREP ' (-c|-o)' stdout && Exit 1 $EGREP '(mv|ylwrap) ' stdout && Exit 1 # Don't look for YACC, as probably yacc hasn't been re-run. -grep ' CC .*foo\.' stdout -grep ' CC .*bar\.' stdout -grep 'CCLD .*foo1' stdout -grep 'CCLD .*bar1' stdout -grep 'CCLD .*foo2' stdout -grep 'CCLD .*bar2' stdout +grep ' CC .*foo\.' stdout +grep 'CCLD .*foo1' stdout +grep 'CCLD .*foo2' stdout # Ensure a truly clean rebuild. $MAKE clean -rm -f *foo.[ch] sub/*bar.[ch] +rm -f *foo.[ch] $MAKE V=1 >stdout || { cat stdout; Exit 1; } cat stdout diff --git a/t/silent.sh b/t/silent.sh index 3cdbaff3f..f736c3ba7 100755 --- a/t/silent.sh +++ b/t/silent.sh @@ -24,7 +24,6 @@ required=cc mkdir sub cat >>configure.ac <<'EOF' -AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_CC_C_O AC_OUTPUT @@ -32,24 +31,12 @@ EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -bin_PROGRAMS = foo bar +bin_PROGRAMS = foo bar sub/baz sub/bla bar_CFLAGS = $(AM_CFLAGS) -SUBDIRS = sub +sub_bla_CFLAGS = $(AM_CFLAGS) EOF -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = baz bla -bla_CFLAGS = $(AM_CFLAGS) -EOF - -cat > foo.c <<'EOF' -int main () -{ - return 0; -} -EOF +echo 'int main (void) { return 0; }' > foo.c cp foo.c bar.c cp foo.c sub/baz.c cp foo.c sub/bla.c @@ -61,22 +48,22 @@ $AUTOCONF ./configure --enable-silent-rules $MAKE >stdout || { cat stdout; Exit 1; } cat stdout -$EGREP ' (-c|-o)' stdout && Exit 1 -grep 'mv ' stdout && Exit 1 -grep 'CC .*foo\.' stdout -grep 'CC .*bar\.' stdout -grep 'CC .*baz\.' stdout -grep 'CC .*bla\.' stdout -grep 'CCLD .*foo' stdout -grep 'CCLD .*bar' stdout -grep 'CCLD .*baz' stdout -grep 'CCLD .*bla' stdout +$EGREP ' (-c|-o)|(mv|mkdir) ' stdout && Exit 1 +grep ' CC *foo\.o' stdout +grep ' CC *bar-bar\.o' stdout +grep ' CC *sub/baz\.o' stdout +grep ' CC *sub/sub_bla-bla\.o' stdout +grep ' CCLD *foo' stdout +grep ' CCLD *bar' stdout +grep ' CCLD *sub/baz' stdout +grep ' CCLD *sub/bla' stdout $MAKE clean $MAKE V=1 >stdout || { cat stdout; Exit 1; } cat stdout grep ' -c' stdout grep ' -o foo' stdout +grep ' -o sub/baz' stdout $EGREP '(CC|LD) ' stdout && Exit 1 : diff --git a/t/silent2.sh b/t/silent2.sh index 627010475..ee5fc0135 100755 --- a/t/silent2.sh +++ b/t/silent2.sh @@ -16,7 +16,7 @@ # Check silent-rules mode, without libtool, non-fastdep case # (so that, with GCC, we also cover the other code paths in depend2). - + # Please keep this file in sync with silent.test. required=gcc @@ -25,7 +25,6 @@ required=gcc mkdir sub cat >>configure.ac <<'EOF' -AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_CC_C_O AC_OUTPUT @@ -33,24 +32,12 @@ EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -bin_PROGRAMS = foo bar +bin_PROGRAMS = foo bar sub/baz sub/bla bar_CFLAGS = $(AM_CFLAGS) -SUBDIRS = sub +sub_bla_CFLAGS = $(AM_CFLAGS) EOF -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = baz bla -bla_CFLAGS = $(AM_CFLAGS) -EOF - -cat > foo.c <<'EOF' -int main () -{ - return 0; -} -EOF +echo 'int main (void) { return 0; }' > foo.c cp foo.c bar.c cp foo.c sub/baz.c cp foo.c sub/bla.c @@ -62,22 +49,22 @@ $AUTOCONF ./configure am_cv_CC_dependencies_compiler_type=gcc --enable-silent-rules $MAKE >stdout || { cat stdout; Exit 1; } cat stdout -$EGREP ' (-c|-o)' stdout && Exit 1 -grep 'mv ' stdout && Exit 1 -grep 'CC .*foo\.' stdout -grep 'CC .*bar\.' stdout -grep 'CC .*baz\.' stdout -grep 'CC .*bla\.' stdout -grep 'CCLD .*foo' stdout -grep 'CCLD .*bar' stdout -grep 'CCLD .*baz' stdout -grep 'CCLD .*bla' stdout +$EGREP ' (-c|-o)|(mv|mkdir) ' stdout && Exit 1 +grep ' CC *foo\.o' stdout +grep ' CC *bar-bar\.o' stdout +grep ' CC *sub/baz\.o' stdout +grep ' CC *sub/sub_bla-bla\.o' stdout +grep ' CCLD *foo' stdout +grep ' CCLD *bar' stdout +grep ' CCLD *sub/baz' stdout +grep ' CCLD *sub/bla' stdout $MAKE clean $MAKE V=1 >stdout || { cat stdout; Exit 1; } cat stdout grep ' -c' stdout grep ' -o foo' stdout +grep ' -o sub/baz' stdout $EGREP '(CC|LD) ' stdout && Exit 1 : diff --git a/t/silent3.sh b/t/silent3.sh index cb3c6297f..325c7e7db 100755 --- a/t/silent3.sh +++ b/t/silent3.sh @@ -24,7 +24,6 @@ required='cc libtoolize' mkdir sub cat >>configure.ac <<'EOF' -AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_AR AM_PROG_CC_C_O @@ -34,24 +33,13 @@ EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -lib_LTLIBRARIES = libfoo.la libbar.la +lib_LTLIBRARIES = libfoo.la libbar.la sub/libbaz.la sub/libbla.la libbar_la_CFLAGS = $(AM_CFLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects # Need generic and non-generic rules. -lib_LTLIBRARIES = libbaz.la libbla.la -libbla_la_CFLAGS = $(AM_CFLAGS) +sub_libbla_la_CFLAGS = $(AM_CFLAGS) EOF -cat > libfoo.c <<'EOF' -int main () -{ - return 0; -} -EOF +echo 'int main (void) { return 0; }' > libfoo.c cp libfoo.c libbar.c cp libfoo.c sub/libbaz.c cp libfoo.c sub/libbla.c @@ -64,22 +52,22 @@ $AUTOCONF ./configure --enable-silent-rules $MAKE >stdout || { cat stdout; Exit 1; } cat stdout -$EGREP ' (-c|-o)' stdout && Exit 1 -grep 'mv ' stdout && Exit 1 -grep ' CC .*foo\.' stdout -grep ' CC .*bar\.' stdout -grep ' CC .*baz\.' stdout -grep ' CC .*bla\.' stdout -grep ' CCLD .*foo' stdout -grep ' CCLD .*bar' stdout -grep ' CCLD .*baz' stdout -grep ' CCLD .*bla' stdout +$EGREP ' (-c|-o)|(mv|mkdir) ' stdout && Exit 1 +grep ' CC *libfoo\.lo' stdout +grep ' CC *libbar_la-libbar\.lo' stdout +grep ' CC *sub/libbaz\.lo' stdout +grep ' CC *sub/sub_libbla_la-libbla\.lo' stdout +grep ' CCLD *libfoo\.la' stdout +grep ' CCLD *libbar\.la' stdout +grep ' CCLD *sub/libbaz\.la' stdout +grep ' CCLD *sub/libbla\.la' stdout $MAKE clean $MAKE V=1 >stdout || { cat stdout; Exit 1; } cat stdout grep ' -c' stdout grep ' -o libfoo' stdout +grep ' -o sub/libbaz' stdout # The libtool command line can contain e.g. a '--tag=CC' option. sed 's/--tag=[^ ]*/--tag=x/g' stdout | $EGREP '(CC|LD) ' && Exit 1 diff --git a/t/silent4.sh b/t/silent4.sh index a44c71885..eccb341b8 100755 --- a/t/silent4.sh +++ b/t/silent4.sh @@ -25,7 +25,6 @@ required="libtoolize gcc" mkdir sub cat >>configure.ac <<'EOF' -AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AM_PROG_AR AM_PROG_CC_C_O @@ -35,24 +34,13 @@ EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -lib_LTLIBRARIES = libfoo.la libbar.la +lib_LTLIBRARIES = libfoo.la libbar.la sub/libbaz.la sub/libbla.la libbar_la_CFLAGS = $(AM_CFLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects # Need generic and non-generic rules. -lib_LTLIBRARIES = libbaz.la libbla.la -libbla_la_CFLAGS = $(AM_CFLAGS) +sub_libbla_la_CFLAGS = $(AM_CFLAGS) EOF -cat > libfoo.c <<'EOF' -int main () -{ - return 0; -} -EOF +echo 'int main (void) { return 0; }' > libfoo.c cp libfoo.c libbar.c cp libfoo.c sub/libbaz.c cp libfoo.c sub/libbla.c @@ -65,22 +53,22 @@ $AUTOCONF ./configure am_cv_CC_dependencies_compiler_type=gcc --enable-silent-rules $MAKE >stdout || { cat stdout; Exit 1; } cat stdout -$EGREP ' (-c|-o)' stdout && Exit 1 -grep 'mv ' stdout && Exit 1 -grep ' CC .*foo\.' stdout -grep ' CC .*bar\.' stdout -grep ' CC .*baz\.' stdout -grep ' CC .*bla\.' stdout -grep ' CCLD .*foo' stdout -grep ' CCLD .*bar' stdout -grep ' CCLD .*baz' stdout -grep ' CCLD .*bla' stdout +$EGREP ' (-c|-o)|(mv|mkdir) ' stdout && Exit 1 +grep ' CC *libfoo\.lo' stdout +grep ' CC *libbar_la-libbar\.lo' stdout +grep ' CC *sub/libbaz\.lo' stdout +grep ' CC *sub/sub_libbla_la-libbla\.lo' stdout +grep ' CCLD *libfoo\.la' stdout +grep ' CCLD *libbar\.la' stdout +grep ' CCLD *sub/libbaz\.la' stdout +grep ' CCLD *sub/libbla\.la' stdout $MAKE clean $MAKE V=1 >stdout || { cat stdout; Exit 1; } cat stdout grep ' -c' stdout grep ' -o libfoo' stdout +grep ' -o sub/libbaz' stdout # The libtool command line can contain e.g. a '--tag=CC' option. sed 's/--tag=[^ ]*/--tag=x/g' stdout | $EGREP '(CC|LD) ' && Exit 1 diff --git a/t/silent9.sh b/t/silent9.sh index 9b311c66f..6c23c9f8e 100755 --- a/t/silent9.sh +++ b/t/silent9.sh @@ -24,34 +24,22 @@ required='cc libtoolize' mkdir sub cat >>configure.ac <<'EOF' -AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC -AM_PROG_CC_C_O AM_PROG_AR +AM_PROG_CC_C_O AC_PROG_LIBTOOL AC_OUTPUT EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -lib_LTLIBRARIES = libfoo.la libbar.la +lib_LTLIBRARIES = libfoo.la libbar.la sub/libbaz.la sub/libbla.la libbar_la_CFLAGS = $(AM_CFLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects # Need generic and non-generic rules. -lib_LTLIBRARIES = libbaz.la libbla.la -libbla_la_CFLAGS = $(AM_CFLAGS) +sub_libbla_la_CFLAGS = $(AM_CFLAGS) EOF -cat > libfoo.c <<'EOF' -int main () -{ - return 0; -} -EOF +echo 'int main (void) { return 0; }' > libfoo.c cp libfoo.c libbar.c cp libfoo.c sub/libbaz.c cp libfoo.c sub/libbla.c @@ -64,22 +52,22 @@ $AUTOCONF ./configure --disable-dependency-tracking --enable-silent-rules $MAKE >stdout || { cat stdout; Exit 1; } cat stdout -$EGREP ' (-c|-o)' stdout && Exit 1 -grep 'mv ' stdout && Exit 1 -grep ' CC .*foo\.' stdout -grep ' CC .*bar\.' stdout -grep ' CC .*baz\.' stdout -grep ' CC .*bla\.' stdout -grep ' CCLD .*foo' stdout -grep ' CCLD .*bar' stdout -grep ' CCLD .*baz' stdout -grep ' CCLD .*bla' stdout +$EGREP ' (-c|-o)|(mv|mkdir) ' stdout && Exit 1 +grep ' CC *libfoo\.lo' stdout +grep ' CC *libbar_la-libbar\.lo' stdout +grep ' CC *sub/libbaz\.lo' stdout +grep ' CC *sub/sub_libbla_la-libbla\.lo' stdout +grep ' CCLD *libfoo\.la' stdout +grep ' CCLD *libbar\.la' stdout +grep ' CCLD *sub/libbaz\.la' stdout +grep ' CCLD *sub/libbla\.la' stdout $MAKE clean $MAKE V=1 >stdout || { cat stdout; Exit 1; } cat stdout grep ' -c' stdout grep ' -o libfoo' stdout +grep ' -o sub/libbaz' stdout # The libtool command line can contain e.g. a '--tag=CC' option. sed 's/--tag=[^ ]*/--tag=x/g' stdout | $EGREP '(CC|LD) ' && Exit 1 diff --git a/t/silentcxx-gcc.sh b/t/silentcxx-gcc.sh index fff3f9112..35f01be50 100755 --- a/t/silentcxx-gcc.sh +++ b/t/silentcxx-gcc.sh @@ -25,31 +25,23 @@ mkdir sub cat >>configure.ac <<'EOF' AC_PROG_CXX -AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -bin_PROGRAMS = foo1 foo2 +bin_PROGRAMS = foo1 foo2 bar1 bar2 foo1_SOURCES = foo.cpp baz.cxx quux.cc foo2_SOURCES = $(foo1_SOURCES) foo2_CXXFLAGS = $(AM_CXXFLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = bar1 bar2 -bar1_SOURCES = bar.cpp +bar1_SOURCES = sub/bar.cpp bar2_SOURCES = $(bar1_SOURCES) bar2_CXXFLAGS = $(AM_CXXFLAGS) EOF cat > foo.cpp <<'EOF' using namespace std; /* C compilers fail on this. */ -int main() { return 0; } +int main (void) { return 0; } EOF # Let's try out other extensions too. @@ -79,14 +71,18 @@ do $EGREP ' (-c|-o)' stdout && Exit 1 grep 'mv ' stdout && Exit 1 - grep 'CXX .*foo\.' stdout - grep 'CXX .*baz\.' stdout - grep 'CXX .*quux\.' stdout - grep 'CXX .*bar\.' stdout - grep 'CXXLD .*foo1' stdout - grep 'CXXLD .*bar1' stdout - grep 'CXXLD .*foo2' stdout - grep 'CXXLD .*bar2' stdout + grep ' CXX *foo\.o' stdout + grep ' CXX *baz\.o' stdout + grep ' CXX *quux\.o' stdout + grep ' CXX *foo2-foo\.o' stdout + grep ' CXX *foo2-baz\.o' stdout + grep ' CXX *foo2-quux\.o' stdout + grep ' CXX *sub/bar\.o' stdout + grep ' CXX *sub/bar2-bar\.o' stdout + grep ' CXXLD *foo1' stdout + grep ' CXXLD *bar1' stdout + grep ' CXXLD *foo2' stdout + grep ' CXXLD *bar2' stdout # Ensure a clean rebuild. $MAKE clean @@ -95,7 +91,8 @@ do cat stdout grep ' -c ' stdout - grep ' -o ' stdout + grep ' -o quux' stdout + grep ' -o bar2' stdout $EGREP '(CC|CXX|LD) ' stdout && Exit 1 diff --git a/t/silentcxx.sh b/t/silentcxx.sh index cc111d3ad..509048303 100755 --- a/t/silentcxx.sh +++ b/t/silentcxx.sh @@ -14,11 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check silent-rules mode for C++. # This test should work with generic C++ compilers; keep it in sync with # sister test 'silentcxx-gcc.test', which requires the GNU C++ compiler # and forces the use of gcc depmode. - + required=c++ . ./defs || Exit 1 @@ -26,24 +25,16 @@ mkdir sub cat >>configure.ac <<'EOF' AC_PROG_CXX -AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -bin_PROGRAMS = foo1 foo2 +bin_PROGRAMS = foo1 foo2 bar1 bar2 foo1_SOURCES = foo.cpp baz.cxx quux.cc foo2_SOURCES = $(foo1_SOURCES) foo2_CXXFLAGS = $(AM_CXXFLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = bar1 bar2 -bar1_SOURCES = bar.cpp +bar1_SOURCES = sub/bar.cpp bar2_SOURCES = $(bar1_SOURCES) bar2_CXXFLAGS = $(AM_CXXFLAGS) EOF @@ -80,14 +71,18 @@ do $EGREP ' (-c|-o)' stdout && Exit 1 grep 'mv ' stdout && Exit 1 - grep 'CXX .*foo\.' stdout - grep 'CXX .*baz\.' stdout - grep 'CXX .*quux\.' stdout - grep 'CXX .*bar\.' stdout - grep 'CXXLD .*foo1' stdout - grep 'CXXLD .*bar1' stdout - grep 'CXXLD .*foo2' stdout - grep 'CXXLD .*bar2' stdout + grep ' CXX *foo\.o' stdout + grep ' CXX *baz\.o' stdout + grep ' CXX *quux\.o' stdout + grep ' CXX *foo2-foo\.o' stdout + grep ' CXX *foo2-baz\.o' stdout + grep ' CXX *foo2-quux\.o' stdout + grep ' CXX *sub/bar\.o' stdout + grep ' CXX *sub/bar2-bar\.o' stdout + grep ' CXXLD *foo1' stdout + grep ' CXXLD *bar1' stdout + grep ' CXXLD *foo2' stdout + grep ' CXXLD *bar2' stdout # Ensure a clean rebuild. $MAKE clean @@ -96,7 +91,8 @@ do cat stdout grep ' -c ' stdout - grep ' -o ' stdout + grep ' -o quux' stdout + grep ' -o bar2' stdout $EGREP '(CXX|LD) ' stdout && Exit 1 diff --git a/t/silentf77.sh b/t/silentf77.sh index 87fbc236f..0b8846e8c 100755 --- a/t/silentf77.sh +++ b/t/silentf77.sh @@ -24,25 +24,17 @@ mkdir sub cat >>configure.ac <<'EOF' AC_PROG_F77 -AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -bin_PROGRAMS = foo1 foo2 +bin_PROGRAMS = foo1 foo2 sub/bar1 bar2 foo1_SOURCES = foo.f foo2_SOURCES = $(foo1_SOURCES) foo2_FFLAGS = $(AM_FFLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = bar1 bar2 -bar1_SOURCES = bar.f -bar2_SOURCES = $(bar1_SOURCES) +sub_bar1_SOURCES = sub/bar.f +bar2_SOURCES = $(sub_bar1_SOURCES) bar2_FFLAGS = $(AM_FFLAGS) EOF @@ -68,12 +60,14 @@ cat stdout $EGREP ' (-c|-o)' stdout && Exit 1 grep 'mv ' stdout && Exit 1 -grep 'F77 .*foo\.' stdout -grep 'F77 .*bar\.' stdout -grep 'F77LD .*foo1' stdout -grep 'F77LD .*bar1' stdout -grep 'F77LD .*foo2' stdout -grep 'F77LD .*bar2' stdout +grep ' F77 *foo\.' stdout +grep ' F77 *foo2-foo\.' stdout +grep ' F77 *sub/bar\.' stdout +grep ' F77 *sub/bar2-bar\.' stdout +grep ' F77LD *foo1' stdout +grep ' F77LD *foo2' stdout +grep ' F77LD *sub/bar1' stdout +grep ' F77LD *bar2' stdout $EGREP '(FC|FCLD) ' stdout && Exit 1 diff --git a/t/silentf90.sh b/t/silentf90.sh index 65a35ed94..3466b8af1 100755 --- a/t/silentf90.sh +++ b/t/silentf90.sh @@ -24,25 +24,17 @@ mkdir sub cat >>configure.ac <<'EOF' AC_PROG_FC -AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT EOF cat > Makefile.am <<'EOF' # Need generic and non-generic rules. -bin_PROGRAMS = foo1 foo2 +bin_PROGRAMS = foo1 foo2 sub/bar1 bar2 foo1_SOURCES = foo.f90 foo2_SOURCES = $(foo1_SOURCES) foo2_FCFLAGS = $(AM_FCLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = bar1 bar2 -bar1_SOURCES = bar.f90 -bar2_SOURCES = $(bar1_SOURCES) +sub_bar1_SOURCES = sub/bar.f90 +bar2_SOURCES = $(sub_bar1_SOURCES) bar2_FCFLAGS = $(AM_FCLAGS) EOF @@ -68,12 +60,14 @@ cat stdout $EGREP ' (-c|-o)' stdout && Exit 1 grep 'mv ' stdout && Exit 1 -grep 'FC .*foo\.' stdout -grep 'FC .*bar\.' stdout -grep 'FCLD .*foo1' stdout -grep 'FCLD .*bar1' stdout -grep 'FCLD .*foo2' stdout -grep 'FCLD .*bar2' stdout +grep ' FC *foo\.' stdout +grep ' FC *foo2-foo\.' stdout +grep ' FC *sub/bar\.' stdout +grep ' FC *sub/bar2-bar\.' stdout +grep ' FCLD *foo1' stdout +grep ' FCLD *foo2' stdout +grep ' FCLD *sub/bar1' stdout +grep ' FCLD *bar2' stdout $EGREP '(F77|F77LD) ' stdout && Exit 1 diff --git a/t/specflg-dummy.sh b/t/specflg-dummy.sh index 1486f4c9c..47a1c21c8 100755 --- a/t/specflg-dummy.sh +++ b/t/specflg-dummy.sh @@ -226,17 +226,13 @@ $AUTOMAKE -a do_check sed ' + s|^\(.*\)_SOURCES *= *|sub_\1_SOURCES = srcsub/| s|^\(.*\)PROGRAMS *+= *|\1PROGRAMS += sub/| s|^\(.*\)LIBRARIES *+= *|\1LIBRARIES += sub/| s|^\(.*\)FLAGS *=|sub_\1FLAGS =| -' Makefile.am > t - -cat - t > Makefile.am <<'END' -AUTOMAKE_OPTIONS = subdir-objects -END -rm -f t +' Makefile.am > t && mv -f t Makefile.am # For debugging. cat Makefile.am diff --git a/t/subobj.sh b/t/subobj-c.sh similarity index 95% rename from t/subobj.sh rename to t/subobj-c.sh index 1265a43d0..0bbeb2bb0 100755 --- a/t/subobj.sh +++ b/t/subobj-c.sh @@ -14,7 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test of subdir objects with C. +# Test subdir objects with C, building both a library and an executable. +# Keep in sync with sister test 'subobj-cxx.sh'. required=cc . ./defs || Exit 1 @@ -28,7 +29,6 @@ AC_OUTPUT END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = progs/wish lib_LIBRARIES = libs/libhope.a progs_wish_SOURCES = generic/a.c generic/b.c @@ -51,6 +51,7 @@ remake-single-object: END mkdir generic sub sub/sub2 + cat > generic/a.c <. -# Test of subdir objects with C++. +# Grepping checks on the use of subdir objects with C++. +# See relate test 't/subobj-cxx-grep.sh' for semantic checks. . ./defs || Exit 1 -cat >> configure.ac << 'END' -AC_PROG_CXX -END +echo AC_PROG_CXX >> configure.ac cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = wish wish_SOURCES = generic/a.cc generic/b.cxx END @@ -32,7 +30,8 @@ $ACLOCAL $AUTOMAKE $FGREP 'generic/a.$(OBJEXT)' Makefile.in -grep '[^/]a\.\$(OBJEXT)' Makefile.in && Exit 1 +$FGREP 'generic/b.$(OBJEXT)' Makefile.in +grep '[^/][ab]\.\$(OBJEXT)' Makefile.in && Exit 1 grep '.*-c -o' Makefile.in : diff --git a/t/subobj-cxx.sh b/t/subobj-cxx.sh new file mode 100755 index 000000000..ccb9e7716 --- /dev/null +++ b/t/subobj-cxx.sh @@ -0,0 +1,121 @@ +#! /bin/sh +# Copyright (C) 1999-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 . + +# Test subdir objects with C++, building both a library and an executable. +# Keep in sync with sister test 'subobj-c.sh'. + +required=c++ +. ./defs || Exit 1 + +cat >> configure.ac << 'END' +AC_PROG_CXX +AM_PROG_AR +AC_PROG_RANLIB +AC_OUTPUT +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = progs/wish +lib_LIBRARIES = libs/libhope.a +progs_wish_SOURCES = generic/a.cc generic/b.c++ +libs_libhope_a_SOURCES = sub/sub2/foo.cxx + +.PHONY: remake-single-object +remake-single-object: + rm -rf generic + $(MAKE) generic/a.$(OBJEXT) + test -f generic/a.$(OBJEXT) + test ! -f generic/b.$(OBJEXT) + rm -rf generic + $(MAKE) generic/b.$(OBJEXT) + test ! -f generic/a.$(OBJEXT) + test -f generic/b.$(OBJEXT) + rm -rf sub generic + $(MAKE) sub/sub2/foo.$(OBJEXT) + test -f sub/sub2/foo.$(OBJEXT) + test ! -d generic +END + +mkdir generic sub sub/sub2 + +cat > generic/a.cc < generic/b.c++ < sub/sub2/foo.cxx <<'END' +using namespace std; // Make this valid C++ but invalid C. +int answer (void) +{ + return 42; +} +END + +$ACLOCAL +$AUTOMAKE -a +test ! -f compile # This is not needed by C++ support. +$EGREP '[^/](a|b|foo)\.\$(OBJEXT)' Makefile.in && Exit 1 + +$AUTOCONF + +mkdir build +cd build +../configure +$MAKE + +test -d progs +test -d libs +test -d generic +test -d sub/sub2 + +if test -f progs/wish; then + EXEEXT= +elif test -f progs/wish.exe; then + EXEEXT=.exe +else + fatal_ "couldn't determine extension of executables" +fi + +# The libraries and executables are not uselessly remade. +: > xstamp +$sleep +echo dummy > progs/change-dir-timestamp +echo dummy > libs/change-dir-timestamp +echo dummy > generic/change-dir-timestamp +echo dummy > sub/change-dir-timestamp +echo dummy > sub/sub2/change-dir-timestamp +$MAKE +is_newest xstamp progs/wish$EXEEXT libs/libhope.a + +$MAKE remake-single-object + +# Must work also with dependency tracking disabled. +# Also sanity check the distribution. +$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS=--disable-dependency-tracking + +: diff --git a/t/subobj-libtool.sh b/t/subobj-libtool.sh index 366e99981..fc9f8c7e1 100755 --- a/t/subobj-libtool.sh +++ b/t/subobj-libtool.sh @@ -28,7 +28,6 @@ AC_OUTPUT END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects noinst_LTLIBRARIES = libs/libfoo.la libs_libfoo_la_SOURCES = generic/1.c generic/2.c sub/subsub/3.c diff --git a/t/subobj10.sh b/t/subobj10.sh index db6bf7267..ead6b6f76 100755 --- a/t/subobj10.sh +++ b/t/subobj10.sh @@ -14,28 +14,35 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# PR 492: Test asm subdir-objects. +# PR 492: Test asm subdir objects. required=gcc . ./defs || Exit 1 -cat > configure.ac << END -AC_INIT([$me], [1.0]) -AM_INIT_AUTOMAKE([subdir-objects]) - +cat >> configure.ac << 'END' AM_PROG_AS AM_PROG_AR AC_PROG_RANLIB - -AC_CONFIG_FILES([Makefile]) AC_OUTPUT END cat > Makefile.am << 'END' noinst_LIBRARIES = libfoo.a libbar.a + libfoo_a_SOURCES = src/a.s b.s libbar_a_SOURCES = src/c.s d.s libbar_a_CCASFLAGS = + +.PHONY: test-objs +check-local: test-objs +test-objs: + find -name '*.$(OBJEXT)' > o.lst && cat o.lst + test -f src/a.$(OBJEXT) + test -f b.$(OBJEXT) + test -f src/libbar_a-c.$(OBJEXT) + test -f libbar_a-d.$(OBJEXT) + test $$(wc -l Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = foo ## The './/' below is meant. foo_SOURCES = .//src/foo.c diff --git a/t/subobj5.sh b/t/subobj5.sh index 32b40494e..c6e2e51e3 100755 --- a/t/subobj5.sh +++ b/t/subobj5.sh @@ -28,7 +28,6 @@ AC_OUTPUT END cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = wish wish_SOURCES = generic/a.c diff --git a/t/subobj8.sh b/t/subobj8.sh index 35b566f50..6ab39d346 100755 --- a/t/subobj8.sh +++ b/t/subobj8.sh @@ -14,7 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Make sure 'compile' is included when subdir-objects is used in a subdir. +# Make sure 'compile' is included when subdir objects are used in a +# subdir. . ./defs || Exit 1 @@ -35,7 +36,6 @@ SUBDIRS = foo END cat > foo/Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = mumble mumble_SOURCES = bar/a.c END diff --git a/t/subobj9.sh b/t/subobj9.sh index f706edf4d..12d83b53c 100755 --- a/t/subobj9.sh +++ b/t/subobj9.sh @@ -25,13 +25,10 @@ required='c++ libtoolize' . ./defs || Exit 1 -cat > configure.ac << END -AC_INIT([$me], [1.0]) -AM_INIT_AUTOMAKE([subdir-objects]) +cat >> configure.ac << END AC_PROG_CXX AM_PROG_AR AM_PROG_LIBTOOL -AC_CONFIG_FILES([Makefile]) AC_OUTPUT END @@ -60,7 +57,6 @@ int doit2 (void) } END - libtoolize --force $ACLOCAL $AUTOCONF diff --git a/t/suffix-custom-subobj.sh b/t/suffix-custom-subobj.sh index daaa5c757..54b6eff3c 100755 --- a/t/suffix-custom-subobj.sh +++ b/t/suffix-custom-subobj.sh @@ -26,7 +26,6 @@ AC_OUTPUT EOF cat >Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects # We fake here: %.o: %.baz cp $< $@ diff --git a/t/suffix13.sh b/t/suffix13.sh index f1d3b4174..7917838ef 100755 --- a/t/suffix13.sh +++ b/t/suffix13.sh @@ -27,7 +27,6 @@ AC_OUTPUT EOF cat >Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects %.c: %.baz test -d $(@D) || $(MKDIR_P) $(@D) cp $< $@ @@ -53,18 +52,9 @@ END $ACLOCAL $AUTOCONF $AUTOMAKE -a -./configure -$MAKE - -$MAKE distcheck -$MAKE distclean - -# Should also work without subdir-objects. -sed '/subdir-objects/d' < Makefile.am > t -mv -f t Makefile.am -$AUTOMAKE ./configure + $MAKE $MAKE distcheck diff --git a/t/vala3.sh b/t/vala3.sh index 030629097..6de68f8da 100755 --- a/t/vala3.sh +++ b/t/vala3.sh @@ -55,44 +55,25 @@ grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found" ./configure $MAKE test -f src/zardoz.c +# FIXME: having 'src/zardoz_vala.stamp' should be more appropriate here. test -f src_zardoz_vala.stamp $MAKE distcheck $MAKE maintainer-clean test ! -f src/zardoz.c +# FIXME: having 'src/zardoz_vala.stamp' should be more appropriate here. test ! -f src_zardoz_vala.stamp mkdir build cd build ../configure $MAKE +test -f ../src/zardoz.c +# FIXME: having 'src/zardoz_vala.stamp' should be more appropriate here. +test -f ../src_zardoz_vala.stamp $MAKE distcheck +$MAKE maintainer-clean +test ! -f src/zardoz.c +# FIXME: having 'src/zardoz_vala.stamp' should be more appropriate here. +test ! -f src_zardoz_vala.stamp -cd .. -rm -rf build - -# Try again with subdir-objects. - -cat > 'Makefile.am' <<'END' -AUTOMAKE_OPTIONS = subdir-objects - -bin_PROGRAMS = src/zardoz -src_zardoz_CFLAGS = $(GOBJECT_CFLAGS) -src_zardoz_LDADD = $(GOBJECT_LIBS) -src_zardoz_SOURCES = src/zardoz.vala -END - -$ACLOCAL -$AUTOCONF -$AUTOMAKE -a - -./configure || skip_ "configure failure" -$MAKE -$MAKE distcheck -$MAKE distclean -mkdir build -cd build -../configure -$MAKE -$MAKE distcheck - - +: diff --git a/t/warning-groups-win-over-strictness.sh b/t/warning-groups-win-over-strictness.sh index 70b8b7a7d..e27513198 100755 --- a/t/warning-groups-win-over-strictness.sh +++ b/t/warning-groups-win-over-strictness.sh @@ -38,7 +38,6 @@ AC_OUTPUT END cat > Makefile.am < am-init-automake.m4 $ACLOCAL AUTOMAKE_fails -Werror -Wall --foreign -grep '^Makefile\.am:4:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr +grep '^Makefile\.am:3:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr rm -rf autom4te*.cache : > automake-options.am @@ -58,7 +57,7 @@ $ACLOCAL $AUTOMAKE rm -rf autom4te*.cache -echo 'AUTOMAKE_OPTIONS += -Werror -Wnone gnits' > automake-options.am +echo 'AUTOMAKE_OPTIONS = -Werror -Wnone gnits' > automake-options.am echo 'AM_INIT_AUTOMAKE' > am-init-automake.m4 $ACLOCAL $AUTOMAKE diff --git a/t/warnings-override.sh b/t/warnings-override.sh index 956bf811d..a487ffac7 100755 --- a/t/warnings-override.sh +++ b/t/warnings-override.sh @@ -29,7 +29,7 @@ AUTOMAKE="$am_original_AUTOMAKE -Werror" set_warnings () { set +x - sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *+=.*|\\1 += $1|" \ + sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \ -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|" mv -f $2-t $2 set -x @@ -44,15 +44,13 @@ ok () ko () { AUTOMAKE_fails $* - grep '^Makefile\.am:5:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr + grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr } echo AC_PROG_CC >> configure.ac cat > Makefile.am <$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *+=.*|\\1 += $1|" \ + sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \ -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|" mv -f $2-t $2 set -x @@ -41,7 +41,7 @@ ok () ko () { AUTOMAKE_fails $* - grep '^Makefile\.am:5:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr + grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr } # Files required in gnu strictness. @@ -50,9 +50,7 @@ touch README INSTALL NEWS AUTHORS ChangeLog COPYING echo AC_PROG_CC >> configure.ac cat > Makefile.am <> configure.ac +$ACLOCAL cat > Makefile.am <$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *+=.*|\\1 += $1|" \ + sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \ -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|" mv -f $2-t $2 set -x @@ -46,7 +45,6 @@ set_am_opts () set_am_opts '-Wportability' configure.ac set_am_opts 'foreign' Makefile.am -$ACLOCAL $AUTOMAKE rm -rf autom4te*.cache @@ -58,6 +56,6 @@ set_am_opts '-Wno-portability' configure.ac set_am_opts 'gnu' Makefile.am AUTOMAKE_fails -grep '^Makefile\.am:5:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr +grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr : diff --git a/t/warnings-win-over-strictness.sh b/t/warnings-win-over-strictness.sh index 4deb27d88..e9534f52a 100755 --- a/t/warnings-win-over-strictness.sh +++ b/t/warnings-win-over-strictness.sh @@ -38,7 +38,7 @@ ko () set_am_opts () { set +x - sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *+=.*|\\1 += $1|" \ + sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \ -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|" mv -f $2-t $2 set -x @@ -49,17 +49,14 @@ set_am_opts () touch README INSTALL NEWS AUTHORS ChangeLog COPYING echo AC_PROG_CC >> configure.ac +$ACLOCAL cat > Makefile.am < bar/main.cpp # Try with -d in $(AM_YFLAGS), and a subdir parser. cat >> baz/Makefile.am <. # Check that VPATH builds and "make distcheck" works with packages -# using yacc and the automake 'subdir-objects' option. -# Exposes automake bug#8485. +# using yacc sources in a subdir option. Exposes automake bug#8485. required='cc yacc' . ./defs || Exit 1 @@ -45,7 +44,6 @@ int main (void) END cat > Makefile.am <<'END' -AUTOMAKE_OPTIONS = subdir-objects noinst_PROGRAMS = foo bar foo_SOURCES = sub/parse.y bar_SOURCES = $(foo_SOURCES) diff --git a/t/yacc-subobj-nodep.sh b/t/yacc-subobj-nodep.sh index 80783a151..e0c415fda 100755 --- a/t/yacc-subobj-nodep.sh +++ b/t/yacc-subobj-nodep.sh @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Ensure subdirs for subdir parsers 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 yacc' @@ -22,7 +22,7 @@ required='cc yacc' cat >configure.ac < Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = foo/foo foo_foo_SOURCES = foo/parse.y AM_YFLAGS = -d