]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
subdir-objects: complain if it isn't enabled
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 13 Jan 2013 16:50:30 +0000 (17:50 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 13 Jan 2013 19:48:10 +0000 (20:48 +0100)
Since the next major automake version will make the behaviour so far
only activated with the 'subdir-object' option mandatory, it's better
if we start warning users not using that option.

As suggested by Peter Johansson, we strive to avoid the warning when
it would be irrelevant, i.e., if all source files sit in "current"
directory.

See automake bug#13378.

* automake.in (handle_single_transform): Print the warning when
necessary.
* t/subobj.sh: Enhance.
* t/ax/depcomp.sh: Adjust.
* t/cscope.tap: Likewise.
* t/depcomp8a.sh: Likewise.
* t/depcomp8b.sh: Likewise.
* t/ext2.sh: Likewise.
* t/extra-portability.sh: Likewise.
* t/fort2.sh: Likewise.
* t/fort4.sh: Likewise.
* t/fort5.sh: Likewise.
* t/lex-line.sh: Likewise.
* t/libtool3.sh: Likewise.
* t/ltinstloc.sh: Likewise.
* t/ltlibsrc.sh: Likewise.
* t/ltorder.sh: Likewise.
* t/parallel-tests-suffix-prog.sh: Likewise.
* t/sourcefile-in-subdir.sh: Likewise.
* t/specflg9.sh: Likewise.
* t/subobj4.sh: Likewise.
* t/subobj7.sh: Likewise.
* t/subpkg-yacc.sh: Likewise.
* t/subpkg.sh: Likewise.
* t/suffix-custom-subobj-and-specflg.sh: Likewise.
* t/vala-libs.sh: Likewise.
* t/vala-non-recursive-setup.sh: Likewise.
* t/yacc-grepping2.sh: Likewise.
* t/yacc-line.sh: Likewise.

28 files changed:
automake.in
t/ax/depcomp.sh
t/cscope.tap
t/depcomp8a.sh
t/depcomp8b.sh
t/ext2.sh
t/extra-portability.sh
t/fort2.sh
t/fort4.sh
t/fort5.sh
t/lex-line.sh
t/libtool3.sh
t/ltinstloc.sh
t/ltlibsrc.sh
t/ltorder.sh
t/parallel-tests-suffix-prog.sh
t/sourcefile-in-subdir.sh
t/specflg9.sh
t/subobj.sh
t/subobj4.sh
t/subobj7.sh
t/subpkg-yacc.sh
t/subpkg.sh
t/suffix-custom-subobj-and-specflg.sh
t/vala-libs.sh
t/vala-non-recursive-setup.sh
t/yacc-grepping2.sh
t/yacc-line.sh

index 990b60d6007dbfae066d4fe63e15360d28a2f4b2..0e3b882b8fe46730d3ae9adf002232ee20dca5a4 100644 (file)
@@ -1793,9 +1793,36 @@ sub handle_single_transform ($$$$$%)
 
            # If rewrite said it was ok, put the object into a
            # subdir.
-           if ($r == LANG_SUBDIR && $directory ne '')
+           if ($directory ne '')
            {
-               $object = $directory . '/' . $object;
+              if ($r == LANG_SUBDIR)
+                {
+                  $object = $directory . '/' . $object;
+                }
+              else
+                {
+                  # Since the next major version of automake (1.14) will
+                  # make the behaviour so far only activated with the
+                  # 'subdir-object' option mandatory, it's better if we
+                  # start warning users not using that option.
+                  # As suggested by Peter Johansson, we strive to avoid
+                  # the warning when it would be irrelevant, i.e., if
+                  # all source files sit in "current" directory.
+                  msg_var 'unsupported', $var,
+                          "source file '$full' is in a subdirectory,"
+                          . "\nbut option 'subdir-objects' is disabled";
+                  msg 'unsupported', INTERNAL, <<'EOF', uniq_scope => US_GLOBAL;
+possible forward-incompatibility.
+At least a source file is in a subdirectory, but the 'subdir-objects'
+automake option hasn't been enabled.  For now, the corresponding output
+object file(s) will be placed in the top-level directory.  However,
+this behaviour will change in future Automake versions: they will
+unconditionally cause object files to be placed in the same subdirectory
+of the corresponding sources.
+You are advised to start using 'subdir-objects' option throughout your
+project, to avoid future incompatibilities.
+EOF
+                }
            }
 
            # If the object file has been renamed (because per-target
index 0e5b6a521411acbbf3b8ac6442dd04caa026e45c..1534d5f8e065a51d412236d6ea9b28d6ac816771 100644 (file)
@@ -130,7 +130,7 @@ check_distclean ()
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([subdir-objects])
 AC_PROG_CC
 AM_PROG_AR
 $(if test $depcomp_with_libtool = yes; then
@@ -199,18 +199,17 @@ ${normalized_target}_${LINKADD} = src/libbaz.$a
 grep-test:
 ## For debugging.
        cat \$(DEPDIR)/foo.$po || :
-       cat \$(DEPDIR)/subfoo.$po || :
+       cat sub/\$(DEPDIR)/subfoo.$po || :
        cat src/\$(DEPDIR)/baz.$po || :
        cat src/sub2/\$(DEPDIR)/sub2foo.$po || :
-## Checks done here.
+## Checks are done here.
        grep '^foo.$objext.*:' \$(DEPDIR)/foo.$po
-       grep '^subfoo\.$objext.*:' \$(DEPDIR)/subfoo.$po
+       grep '^sub/subfoo\.$objext.*:' sub/\$(DEPDIR)/subfoo.$po
        grep '^baz\.$objext.*:' src/\$(DEPDIR)/baz.$po
        grep '^sub2/sub2foo\.$objext.*:' src/sub2/\$(DEPDIR)/sub2foo.$po
 END
 
 cat > src/Makefile.am <<END
-AUTOMAKE_OPTIONS = subdir-objects
 noinst_${LIBPRIMARY} = libbaz.$a
 # We include sub2foo only to be sure that the munging in depcomp
 # doesn't remove too much from the object file name.
index 29feec2284d8c34e0c0ffcc62d45899e62bb6a58..9dbe01b2ff0b84af25fe5d724dd0f5490c3e9d3c 100755 (executable)
@@ -22,8 +22,10 @@ plan_ 18
 
 ocwd=$(pwd) || fatal_ "getting top-level directory"
 
-cat >> configure.ac << 'END'
-AC_CONFIG_FILES([sub/Makefile])
+cat > configure.ac << 'END'
+AC_INIT([cscope-test], [1.0])
+AM_INIT_AUTOMAKE([subdir-objects])
+AC_CONFIG_FILES([Makefile sub/Makefile])
 AC_SUBST([CC],  [who-cares])
 AC_SUBST([CXX], [who-cares])
 AC_SUBST([FC],  [who-cares])
index 76aa3769416e4aff2bb5bf159d5d93891141dfac..d6c73edb7335f3e40239b71dea7f4dce84668e74 100755 (executable)
@@ -48,7 +48,9 @@ int bar (void)
 END
 
 $ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
 grep include Makefile.in # For debugging.
 grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
 grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
index 52382f14a0b29199b986a838d0e952d5b3923d62..879ee1c0d4e5f5848b2e23701de2ed73adadc258 100755 (executable)
@@ -31,6 +31,9 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+## FIXME: stop disabling the warnings in the 'unsupported' category
+## FIXME: once the 'subdir-objects' option has been mandatory.
+AUTOMAKE_OPTIONS = -Wno-unsupported
 lib_LTLIBRARIES = libzardoz.la
 libzardoz_la_SOURCES = foo.c sub/bar.c
 END
@@ -42,7 +45,9 @@ echo 'int bar (void) { return 0; }' > sub/bar.c
 libtoolize
 
 $ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
 grep include Makefile.in # For debugging.
 grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
 grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
@@ -56,7 +61,7 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
 
 # Try again with subdir-objects option.
 
-echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
+echo AUTOMAKE_OPTIONS += subdir-objects >> Makefile.am
 
 $AUTOMAKE
 grep include Makefile.in # For debugging.
index 108908058f0978c6f775234a6ded8c13f6dc4f91..4858aec6664571362747cff0472853f62fb864d5 100755 (executable)
--- a/t/ext2.sh
+++ b/t/ext2.sh
@@ -25,6 +25,7 @@ AC_PROG_CXX
 EOF
 
 cat >Makefile.am <<EOF
+AUTOMAKE_OPTIONS = subdir-objects
 bin_PROGRAMS = p q r
 p_SOURCES = a.cc b.cpp c.cxx
 q_SOURCES = sub/d.cc sub/e.cpp sub/f.cxx
index 1ea23ad7562864b4b694151daeb4b4f6b1bca72d..63849c7685c68825c2b34edcb33997b1a702e9ad 100755 (executable)
@@ -40,7 +40,7 @@ $ACLOCAL
 
 cat >Makefile.am <<END
 EXTRA_LIBRARIES = libfoo.a
-libfoo_a_SOURCES = sub/foo.c
+libfoo_a_SOURCES = foo.c
 END
 
 # Sanity check: extra-portability warnings causes the expected error.
index c99e8b70957f196e89b5e5d12204de5355af2d11..d6144529624898154746ccb074340a2c90e8a0e7 100755 (executable)
@@ -19,6 +19,7 @@
 
 # Cf. 'fort1.sh' and 'link_f90_only.sh'.
 
+required=gfortran # Required only in order to run ./configure.
 . test-init.sh
 
 mkdir sub
@@ -30,33 +31,64 @@ AC_FC_SRCEXT([f95])
 AC_FC_SRCEXT([f03])
 AC_FC_SRCEXT([f08])
 AC_FC_SRCEXT([blabla])
+AC_OUTPUT
 END
 
 cat >Makefile.am <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
+FC = fake-fc
 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.ac >t
+mv -f t configure.ac
+
+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 \
+  FCFLAGS_f90=--@90 FCFLAGS_f95=--@95 FCFLAGS_f03=--@03 FCFLAGS_f08=--@08 \
+  > 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 .* --@90 .* hello\.f90 ' out
+grep ' fake-fc .* --@95 .* foo\.f95 ' out
+grep ' fake-fc .* --@95 .* sub/bar\.f95 ' out
+grep ' fake-fc .* --@03 .* hi\.f03 ' out
+grep ' fake-fc .* --@03 .* sub/howdy\.f03 ' out
+grep ' fake-fc .* --@08 .* greets\.f08 ' out
+grep ' fake-fc .* --@08 .* sub/bonjour\.f08 ' out
+grep ' fake-fc .* --gby .* --@95 .*[` ]bye\.f95 ' out
+grep ' fake-fc .* --gby .* --@90 .*[` ]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
 
 :
index 822edb8c821d5e44ea284c528e800791c2bb92bd..2ef27abebbb3d0941d39ec860efd5dc64bf79166 100755 (executable)
@@ -65,7 +65,7 @@ LDADD = $(FCLIBS)
 END
 
 $ACLOCAL
-$AUTOMAKE -a
+$AUTOMAKE -a -Wno-unsupported
 # The Fortran 77 linker should be preferred:
 grep '.\$(FCLINK)' Makefile.in && exit 1
 
index 02727061d5aa7ea31182552ebb811f50e6655ef0..7b9991b969211c89e9f796ed18310580b001d6f3 100755 (executable)
@@ -75,7 +75,9 @@ END
 
 libtoolize --force
 $ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
 $AUTOCONF
 
 # This test requires Libtool >= 2.0.  Earlier Libtool does not
index 9b27c0b391f681f2e4cb24b818b7445091876473..258f6af56dea8845681059e93b9f79b12a8bb36e 100755 (executable)
@@ -86,7 +86,9 @@ c_outputs='zardoz.c bar-quux.c sub/foo-zardoz.c sub/dir/quux.c'
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
 
 for vpath in : false; do
 
index fb8c194ed84546cd6e898ae79b0620fa11122666..5653280e6ada117a629091ef9cb9b6a0cc1a6230 100755 (executable)
@@ -28,6 +28,10 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+AUTOMAKE_OPTIONS = -Wno-unsupported
+
 lib_LTLIBRARIES = lib0.la liba/liba.la
 lib0_la_SOURCES = 0.c
 liba_liba_la_SOURCES = liba/a.c
index b9670cbacb78457740f861739bbdd6aba5c8b119..bae3d49df3e9c38b500a882a8f48a4e237c25a65 100755 (executable)
@@ -35,6 +35,7 @@ lib_LTLIBRARIES = liba1.la sub/liba2.la
 pkglib_LTLIBRARIES = liba1.la
 nobase_lib_LTLIBRARIES = sub/liba2.la
 endif
+AUTOMAKE_OPTIONS = subdir-objects
 END
 
 libtoolize
index e58bba7162ae368cbf672ef591de5ce259f74e62..8c8098bdb7c9a688577c36e686b38137559329a3 100755 (executable)
@@ -35,6 +35,8 @@ noinst_LTLIBRARIES = foo.la zoo.d/old2.la
 
 $(srcdir)/zoo_d_old2_la.c: $(srcdir)/old_la.c
        cp $(srcdir)/old_la.c $@
+
+AUTOMAKE_OPTIONS = -Wno-unsupported
 END
 
 cat > foo.c << 'END'
index fe9d7bda2fc5035fc11e67f6bad7b3dc201e41b4..c243ac78b9dc682ecaccecccd1a0a0b89e54e225 100755 (executable)
@@ -27,6 +27,7 @@ AC_OUTPUT
 END
 
 cat >Makefile.am <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
 nobase_lib_LTLIBRARIES = liba1.la sub/liba2.la sub/liba3.la liba4.la liba5.la
 sub_liba2_la_LIBADD = liba1.la
 sub_liba3_la_LIBADD = sub/liba2.la
index 64f103c70ddd7a2a58715505eaf6eb43e74c0854..7b924a33be5778e5378d1b695104b62cfa89e969 100755 (executable)
@@ -27,6 +27,7 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
 ## Note that automake should not match the '/test' part of 'sub/test' as
 ## '.test' suffix, nor the '/chk' part of 'sub/chk' as '.chk' suffix.
 TESTS = $(dist_TESTS) $(check_PROGRAMS)
index a01077617d9b647c319d216068f3e55f950e09c3..1054f18aa4fd82733314543475ab4871bf97bb52 100755 (executable)
@@ -29,7 +29,7 @@ AC_PROG_CC
 END
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-unsupported
 
 grep '^z\.o: x/z\.c$' Makefile.in
 
index 3e0c69484ba64154809dff2bafc812efd89153eb..4f3d3b0c2b79ea5e9657221fc04039944a659a53 100755 (executable)
@@ -24,6 +24,7 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
 bin_PROGRAMS = zzfoo zzbar
 zzfoo_SOURCES = sub/foo.c
 zzbar_SOURCES = bar.c
index d16512abc7f20e61be785c2c215cb543d2265f29..22ab2d30d12b264df3b71723df0b0a3d0ad5ced3 100755 (executable)
 # 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 of subdir objects with C.
+# Test of subdir objects with C and C++.
 
 . test-init.sh
 
-echo AC_PROG_CC >> configure.ac
+cat >> configure.ac <<'END'
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_YACC
+AC_CONFIG_FILES([sub/Makefile])
+END
+
+$ACLOCAL
+: > ylwrap
 
 cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects
+SUBDIRS = sub
 bin_PROGRAMS = wish
-wish_SOURCES = generic/a.c generic/b.c
+wish_SOURCES = generic/a.c
+wish_SOURCES += another/z.cxx
 END
 
-$ACLOCAL
+mkdir sub
+cat > sub/Makefile.am << 'END'
+dream_SOURCES = generic/b.c more/r.y
+bin_PROGRAMS = dream
+END
+
+AUTOMAKE_fails
+grep "^Makefile\.am:3:.*'generic/a\.c'.* in a subdirectory" stderr
+grep "^Makefile\.am:[34]:.*'another/z\.cxx'.* in a subdirectory" stderr
+grep "^sub/Makefile\.am:1:.*'generic/b\.c'.* in a subdirectory" stderr
+grep "option 'subdir-objects' is disabled" stderr
+# Verbose tips should be given, but not too many times.
+for msg in \
+  "possible forward-incompatibility" \
+  "advi[sc]e.* 'subdir-objects' option throughout" \
+  "unconditionally.* object file.* same subdirectory" \
+; do
+  test $(grep -c "$msg" stderr) -eq 1
+done
+
+# Guard against stupid typos.
+grep 'subdir-object([^s]|$)' stderr && exit 1
+
+$AUTOMAKE -Wno-unsupported
+
+echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
+AUTOMAKE_fails
+grep "^Makefile\.am" stderr && exit 1
+grep "^sub/Makefile\.am:.*'generic/b\.c'.* in a subdirectory" stderr
+grep "option 'subdir-objects' is disabled" stderr
+
+sed 's/^AM_INIT_AUTOMAKE/&([subdir-objects])/' configure.ac > configure.tmp
+mv -f configure.tmp configure.ac
+$ACLOCAL --force
+$AUTOMAKE
+
 rm -f compile
 $AUTOMAKE --add-missing 2>stderr || { cat stderr >&2; exit 1; }
 cat stderr >&2
@@ -35,9 +79,12 @@ grep '^configure\.ac:4:.*install.*compile' stderr
 test -f compile
 
 grep '^generic/a\.\$(OBJEXT):' Makefile.in
-grep '[^/]a\.\$(OBJEXT)' Makefile.in && exit 1
+grep '^generic/b\.\$(OBJEXT):' sub/Makefile.in
+grep '^another/z\.\$(OBJEXT):' Makefile.in
+$EGREP '(^|[^/])[abz]\.\$(OBJEXT)' Makefile.in sub/Makefile.in && exit 1
 
 # Opportunistically test for a different bug.
-grep '^generic/b\.\$(OBJEXT):.*dirstamp' Makefile.in
+grep '^another/z\.\$(OBJEXT):.*dirstamp' Makefile.in
+grep '^generic/b\.\$(OBJEXT):.*dirstamp' sub/Makefile.in
 
 :
index 816f50668acd849a664c6c63bb6d1568c2214f96..dbbed30bec5ce6766f33f80e92a448c98a70e3a7 100755 (executable)
@@ -43,7 +43,7 @@ END
 : > d2/z.c
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-unsupported
 
 grep '\$(CC) .*\.\./d2/z\.c' d1/Makefile.in
 
index 5dc9ea861c9ca3d77d69a9e735eb7bdcb5fea878..de73cc2dce6d52645762dd80d6728afa96dd1aa9 100755 (executable)
@@ -25,6 +25,7 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
 bin_PROGRAMS = wish
 wish_SOURCES = foo.c generic/a.c
 END
index 639e4156c1cadb88fe01143219f4c8e4b120b791..9fc6761907570264143279633212ff407f30b60f 100755 (executable)
@@ -49,7 +49,7 @@ mkdir lib/src
 
 cat >lib/configure.ac <<'EOF'
 AC_INIT([lib], [2.3])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([subdir-objects])
 AC_PROG_RANLIB
 AC_PROG_YACC
 dnl This comes after YACC and RANLIB checks, deliberately.
index 6f59ac58d018a79005f708184d9589fe2f3afb8f..f9cdc74e2bb58bf0de2522d9188be29f3bbc2dea 100755 (executable)
@@ -62,7 +62,7 @@ mkdir lib/src
 
 cat >lib/configure.ac <<'EOF'
 AC_INIT([lib], [2.3])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([subdir-objects])
 AC_CONFIG_MACRO_DIR([../m4])
 AM_PROG_AR
 AC_PROG_RANLIB
index 32356d7b3a908f7c5b29abcbca8b5ecc1ad53c09..b862d88256ec3edb3af9261be26cf840561a6801 100755 (executable)
@@ -53,18 +53,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
 
index 66fd2436aef7defb6b02b328a6afdbced4863f18..f1ed99ab2852a19b47ba2bccdbd84842b961dc6d 100755 (executable)
@@ -31,6 +31,7 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
 lib_LIBRARIES = libmu.a
 lib_LTLIBRARIES = src/libzardoz.la
 libmu_a_SOURCES = mu.vala mu2.c mu.vapi mu2.h
@@ -75,7 +76,7 @@ int main ()
 }
 END
 
-mkdir src
+mkdir -p src
 cat > src/zardoz-foo.vala << 'END'
 using GLib;
 public class Foo {
index 88d9d332adb93ebd6c9dddaafdca625a75c7c97d..88f67a8795b87016bd58d3da1adebf0bf08346af 100755 (executable)
@@ -39,6 +39,7 @@ public class Zardoz {
 END
 
 cat > 'Makefile.am' <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
 bin_PROGRAMS = src/zardoz
 src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
 src_zardoz_LDADD = $(GOBJECT_LIBS)
index 58a963c8c86327b2f40fcdfb35a2d8c1787d08b2..3c5da22557194dabd7959fe22210c136b5f8f8cc 100755 (executable)
@@ -34,7 +34,9 @@ mkdir sub
 : > sub/maude.y
 
 $ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
 
 grep '^maude\.c:.*maude\.y' Makefile.in
 
@@ -47,7 +49,6 @@ bin_PROGRAMS = maude
 maude_SOURCES = sub/maude.y
 END
 
-$ACLOCAL
 $AUTOMAKE -a
 
 # No rule needed, the default .y.c: inference rule is enough
@@ -64,8 +65,9 @@ maude_SOURCES = sub/maude.y
 maude_YFLAGS = -d
 END
 
-$ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
 
 # Rule should use maude_YFLAGS.
 grep 'AM_YFLAGS.*maude' Makefile.in && exit 1
index 9067a2d639e969b73a7e6ed84edef564bab10046..b034af36ef67af9b3efd0e9bffd986a75f5810b0 100755 (executable)
@@ -76,7 +76,9 @@ c_outputs='zardoz.c bar-quux.c sub/foo-zardoz.c sub/dir/quux.c'
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
 
 for vpath in : false; do