Revert Automake license to GPLv2+.
[platform/upstream/automake.git] / tests / fort2.test
1 #! /bin/sh
2 # Copyright (C) 2006, 2008  Free Software Foundation, Inc.
3 #
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 2, or (at your option)
7 # any later version.
8 #
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.
13 #
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/>.
16
17 # Test that AC_FC_SRCEXT(f9x) works as intended:
18 # - $(FCFLAGS_f) will be used
19
20 # Cf. fort1.test and link_f90_only.test.
21
22 . ./defs || Exit 1
23
24 set -e
25
26 mkdir sub
27
28 cat >>configure.in <<'END'
29 AC_PROG_FC
30 AC_FC_SRCEXT([f90])
31 AC_FC_SRCEXT([f95])
32 AC_FC_SRCEXT([f03])
33 AC_FC_SRCEXT([f08])
34 AC_FC_SRCEXT([blabla])
35 END
36
37 cat >Makefile.am <<'END'
38 bin_PROGRAMS = hello goodbye
39 hello_SOURCES = hello.f90 foo.f95 sub/bar.f95 hi.f03 sub/howdy.f03 greets.f08 sub/bonjour.f08
40 goodbye_SOURCES = bye.f95 sub/baz.f90
41 goodbye_FCFLAGS =
42 END
43
44 $ACLOCAL
45 $AUTOMAKE
46 # The following tests aren't fool-proof, but they don't
47 # need a Fortran compiler.
48 grep '.\$(LINK)'       Makefile.in && Exit 1
49 grep '.\$(FCLINK)'     Makefile.in
50 grep '.\$(FCCOMPILE)'  Makefile.in > stdout
51 grep -v '\$(FCFLAGS_f' stdout && Exit 1
52 grep '.\$(FC.*\$(FCFLAGS_blabla' Makefile.in && Exit 1
53 # Notice the TAB:
54 grep '^[        ].*\$(FC.*\$(FCFLAGS_f90).*\.f90' Makefile.in
55 grep '^[        ].*\$(FC.*\$(FCFLAGS_f95).*\.f95' Makefile.in
56 grep '^[        ].*\$(FC.*\$(FCFLAGS_f03).*\.f03' Makefile.in
57 grep '^[        ].*\$(FC.*\$(FCFLAGS_f08).*\.f08' Makefile.in
58 grep '^[        ].*\$(FC.*\$(FCFLAGS_f90).*\.f95' Makefile.in && Exit 1
59 grep '^[        ].*\$(FC.*\$(FCFLAGS_f95).*\.f90' Makefile.in && Exit 1
60 grep '^[        ].*\$(FC.*\$(FCFLAGS_f90).*\.f03' Makefile.in && Exit 1
61 grep '^[        ].*\$(FC.*\$(FCFLAGS_f08).*\.f90' Makefile.in && Exit 1
62 :