## allows us to avoid extra forks.
am__vpath_rewrite = $(firstword $(wildcard $(strip $(1))) $(srcdir)/$(strip $(1)))
+## Used for suffix rules.
+am__cooked_source_0 = $(call am__vpath_rewrite, $<)
+## Used for explicit rules.
+am__cooked_source_1 = $<
+
endif %?FIRST%
if %?NONLIBTOOL%
%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%$(call am__vpath_rewrite, %SOURCE%)
+ %SOURCEFLAG%$(am__cooked_source_%GENERIC%)
%SILENT%$(am__mv) $(am__depbase).Tpo $(am__depbase).Po
else !%FASTDEP%
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%$(call am__vpath_rewrite, %SOURCE%)
-?!-o? %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%$(call am__vpath_rewrite, %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:
%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%`$(CYGPATH_W) $(call am__vpath_rewrite,%SOURCE%)`
+ %SOURCEFLAG%`$(CYGPATH_W) $(am__cooked_source_%GENERIC%)`
%SILENT%$(am__mv) $(am__depbase).Tpo $(am__depbase).Po
else !%FASTDEP%
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%`$(CYGPATH_W) $(call am__vpath_rewrite, %SOURCE%)`
-?!-o? %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`$(CYGPATH_W) $(call am__vpath_rewrite, %SOURCE%)`
-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%
%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%$(call am__vpath_rewrite, %SOURCE%)
+ %SOURCEFLAG%$(am__cooked_source_%GENERIC%)
%SILENT%$(am__mv) $(am__depbase).Tpo $(am__depbase).Plo
else !%FASTDEP%
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%$(call am__vpath_rewrite, %SOURCE%)
+ %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%$(am__cooked_source_%GENERIC%)
endif !%FASTDEP%
endif %?LIBTOOL%
# Cf. fort1.test and link_f90_only.test.
+required=gfortran # Required only in order to run ./configure.
. ./defs || Exit 1
mkdir sub
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 \
+ 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
+
: