diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-01-13 17:50:30 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-01-13 20:48:10 +0100 |
commit | 4864af66bfd189a501061d775bb9743a1285d88e (patch) | |
tree | bacf0833de74d2d179408b7f0b7aa7e85c513ea1 /t/fort2.sh | |
parent | 593032130119da79aba14dc26c3cc985bf3a5610 (diff) | |
download | automake-4864af66bfd189a501061d775bb9743a1285d88e.tar.gz |
subdir-objects: complain if it isn't enabled
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.
Diffstat (limited to 't/fort2.sh')
-rwxr-xr-x | t/fort2.sh | 58 |
1 files changed, 45 insertions, 13 deletions
diff --git a/t/fort2.sh b/t/fort2.sh index c99e8b709..d61445296 100755 --- a/t/fort2.sh +++ b/t/fort2.sh @@ -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 : |