tests: work around strangeness in MSYS
[automake.git] / tests / silent4.test
blob96187918657335dde1429b01e6d1e1762000a89f
1 #!/bin/sh
2 # Copyright (C) 2009, 2010, 2011 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, with libtool, non-fastdep case
18 # (so that, with GCC, we also cover the other code paths in depend2).
20 # Please keep this file in sync with silent3.test and silent9.test.
22 required="libtoolize gcc"
23 . ./defs || Exit 1
25 mkdir sub
27 cat >>configure.in <<'EOF'
28 AM_SILENT_RULES
29 AC_CONFIG_FILES([sub/Makefile])
30 AC_PROG_CC
31 AM_PROG_AR
32 AM_PROG_CC_C_O
33 AC_PROG_LIBTOOL
34 AC_OUTPUT
35 EOF
37 cat > Makefile.am <<'EOF'
38 # Need generic and non-generic rules.
39 lib_LTLIBRARIES = libfoo.la libbar.la
40 libbar_la_CFLAGS = $(AM_CFLAGS)
41 SUBDIRS = sub
42 EOF
44 cat > sub/Makefile.am <<'EOF'
45 AUTOMAKE_OPTIONS = subdir-objects
46 # Need generic and non-generic rules.
47 lib_LTLIBRARIES = libbaz.la libbla.la
48 libbla_la_CFLAGS = $(AM_CFLAGS)
49 EOF
51 cat > libfoo.c <<'EOF'
52 int main ()
54 return 0;
56 EOF
57 cp libfoo.c libbar.c
58 cp libfoo.c sub/libbaz.c
59 cp libfoo.c sub/libbla.c
61 libtoolize
62 $ACLOCAL
63 $AUTOMAKE --add-missing
64 $AUTOCONF
66 ./configure am_cv_CC_dependencies_compiler_type=gcc --enable-silent-rules
67 $MAKE >stdout || { cat stdout; Exit 1; }
68 cat stdout
69 $EGREP ' (-c|-o)' stdout && Exit 1
70 grep 'mv ' stdout && Exit 1
71 grep ' CC .*foo\.' stdout
72 grep ' CC .*bar\.' stdout
73 grep ' CC .*baz\.' stdout
74 grep ' CC .*bla\.' stdout
75 grep ' CCLD .*foo' stdout
76 grep ' CCLD .*bar' stdout
77 grep ' CCLD .*baz' stdout
78 grep ' CCLD .*bla' stdout
80 $MAKE clean
81 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
82 cat stdout
83 grep ' -c' stdout
84 grep ' -o libfoo' stdout
85 # The libtool command line can contain e.g. a `--tag=CC' option.
86 sed 's/--tag=[^ ]*/--tag=x/g' stdout | $EGREP '(CC|LD) ' && Exit 1