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