tests: work around strangeness in MSYS
[automake.git] / tests / silent3.test
blob7f4322b19d68c10d5445c2bf494d2974129141df
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, standard depmode case.
19 # Please keep this file in sync with silent4.test and silent9.test.
21 required='cc libtoolize'
22 . ./defs || Exit 1
24 mkdir sub
26 cat >>configure.in <<'EOF'
27 AM_SILENT_RULES
28 AC_CONFIG_FILES([sub/Makefile])
29 AC_PROG_CC
30 AM_PROG_AR
31 AM_PROG_CC_C_O
32 AC_PROG_LIBTOOL
33 AC_OUTPUT
34 EOF
36 cat > Makefile.am <<'EOF'
37 # Need generic and non-generic rules.
38 lib_LTLIBRARIES = libfoo.la libbar.la
39 libbar_la_CFLAGS = $(AM_CFLAGS)
40 SUBDIRS = sub
41 EOF
43 cat > sub/Makefile.am <<'EOF'
44 AUTOMAKE_OPTIONS = subdir-objects
45 # Need generic and non-generic rules.
46 lib_LTLIBRARIES = libbaz.la libbla.la
47 libbla_la_CFLAGS = $(AM_CFLAGS)
48 EOF
50 cat > libfoo.c <<'EOF'
51 int main ()
53 return 0;
55 EOF
56 cp libfoo.c libbar.c
57 cp libfoo.c sub/libbaz.c
58 cp libfoo.c sub/libbla.c
60 libtoolize
61 $ACLOCAL
62 $AUTOMAKE --add-missing
63 $AUTOCONF
65 ./configure --enable-silent-rules
66 $MAKE >stdout || { cat stdout; Exit 1; }
67 cat stdout
68 $EGREP ' (-c|-o)' stdout && Exit 1
69 grep 'mv ' stdout && Exit 1
70 grep ' CC .*foo\.' stdout
71 grep ' CC .*bar\.' stdout
72 grep ' CC .*baz\.' stdout
73 grep ' CC .*bla\.' stdout
74 grep ' CCLD .*foo' stdout
75 grep ' CCLD .*bar' stdout
76 grep ' CCLD .*baz' stdout
77 grep ' CCLD .*bla' stdout
79 $MAKE clean
80 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
81 cat stdout
82 grep ' -c' stdout
83 grep ' -o libfoo' stdout
84 # The libtool command line can contain e.g. a `--tag=CC' option.
85 sed 's/--tag=[^ ]*/--tag=x/g' stdout | $EGREP '(CC|LD) ' && Exit 1