compile: implement library search to support MSVC static linking
[automake.git] / tests / silentf90.test
blob9330bddd0699d08aeeac122a47c953cf0440014d
1 #!/bin/sh
2 # Copyright (C) 2010 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 2, or (at your option)
7 # any later version.
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 # Check silent-rules mode for Fortran 90.
18 # Keep this ins sync with the sister test silentf77.test.
20 required='gfortran' # FIXME: any working Fortran compiler should be OK!
21 . ./defs
23 set -e
25 mkdir sub
27 cat >>configure.in <<'EOF'
28 AM_SILENT_RULES
29 AC_PROG_FC
30 AC_CONFIG_FILES([sub/Makefile])
31 AC_OUTPUT
32 EOF
34 cat > Makefile.am <<'EOF'
35 # Need generic and non-generic rules.
36 bin_PROGRAMS = foo1 foo2
37 foo1_SOURCES = foo.f90
38 foo2_SOURCES = $(foo1_SOURCES)
39 foo2_FCFLAGS = $(AM_FCLAGS)
40 SUBDIRS = sub
41 EOF
43 cat > sub/Makefile.am <<'EOF'
44 AUTOMAKE_OPTIONS = subdir-objects
45 # Need generic and non-generic rules.
46 bin_PROGRAMS = bar1 bar2
47 bar1_SOURCES = bar.f90
48 bar2_SOURCES = $(bar1_SOURCES)
49 bar2_FCFLAGS = $(AM_FCLAGS)
50 EOF
52 cat > foo.f90 <<'EOF'
53 program foo
54 stop
55 end
56 EOF
57 cp foo.f90 sub/bar.f90
59 $ACLOCAL
60 $AUTOMAKE --add-missing
61 $AUTOCONF
63 ./configure --enable-silent-rules
64 $MAKE >stdout || { cat stdout; Exit 1; }
65 cat stdout
67 $EGREP ' (-c|-o)' stdout && Exit 1
68 grep 'mv ' stdout && Exit 1
70 grep 'FC .*foo\.' stdout
71 grep 'FC .*bar\.' stdout
72 grep 'FCLD .*foo1' stdout
73 grep 'FCLD .*bar1' stdout
74 grep 'FCLD .*foo2' stdout
75 grep 'FCLD .*bar2' stdout
77 $EGREP '(F77|F77LD) ' stdout && Exit 1
79 # Ensure a clean rebuild.
80 $MAKE clean
82 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
83 cat stdout
85 grep ' -c ' stdout
86 grep ' -o ' stdout
88 $EGREP '(F77|FC|LD) ' stdout && Exit 1
90 $MAKE clean
91 $MAKE maintainer-clean