compile: implement library search to support MSVC static linking
[automake.git] / tests / silentf77.test
blob39495d4ada042841d83cb9dff5aa0eccf759dacf
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 77.
18 # Keep this ins sync with the sister test silentf90.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_F77
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.f
38 foo2_SOURCES = $(foo1_SOURCES)
39 foo2_FFLAGS = $(AM_FFLAGS)
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.f
48 bar2_SOURCES = $(bar1_SOURCES)
49 bar2_FFLAGS = $(AM_FFLAGS)
50 EOF
52 cat > foo.f <<'EOF'
53 program foo
54 stop
55 end
56 EOF
57 cp foo.f sub/bar.f
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 'F77 .*foo\.' stdout
71 grep 'F77 .*bar\.' stdout
72 grep 'F77LD .*foo1' stdout
73 grep 'F77LD .*bar1' stdout
74 grep 'F77LD .*foo2' stdout
75 grep 'F77LD .*bar2' stdout
77 $EGREP '(FC|FCLD) ' 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