2 # Copyright (C) 2006 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Test mixing Fortran 77 and Fortran (FC).
19 # For now, require the GNU compilers (to avoid some Libtool/Autoconf
21 required
='g77 gfortran'
49 sed s
,foo
,bar
, foo.f90
> sub
/bar.f90
50 sed s
,foo
,baz
, foo.f90
> sub
/baz.f
52 cat >>configure.
in <<'END'
55 AC_FC_SRCEXT([f90], [],
56 [AC_MSG_FAILURE([$FC compiler cannot create executables], 77)])
61 cat >Makefile.am
<<'END'
62 bin_PROGRAMS = hello goodbye
63 hello_SOURCES = hello.f foo.f90 sub/bar.f90
64 goodbye_SOURCES = bye.f90 sub/baz.f
71 # The Fortran 77 linker should be preferred:
72 grep '.\$(FCLINK)' Makefile.
in && exit 1
75 # configure may exit 77 if no compiler is found,
76 # or if the compiler cannot compile Fortran 90 files).
79 subobjs
=`echo sub/*.o sub/*.obj`
80 test "$subobjs" = 'sub/*.o sub/*.obj'
84 echo 'AUTOMAKE_OPTIONS = subdir-objects' >> Makefile.am
92 test ! -f goodbye-baz.o
93 test ! -f goodbye-baz.obj