compile: avoid AC_PROG_CC messy rewrite
[platform/upstream/automake.git] / t / silent-texi.sh
1 #!/bin/sh
2 # Copyright (C) 2009-2013 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 texinfo rules in silent-rules mode.
18
19 required='makeinfo tex texi2dvi dvips'
20 . test-init.sh
21
22 echo AC_OUTPUT >> configure.ac
23
24 cat > Makefile.am <<'EOF'
25 info_TEXINFOS = foo.texi sub/zardoz.texi
26 EOF
27
28 cat > foo.texi <<'EOF'
29 \input texinfo
30 @setfilename foo.info
31 @settitle foo manual
32 @bye
33 EOF
34
35 mkdir sub
36 cat > sub/zardoz.texi <<'EOF'
37 \input texinfo
38 @setfilename zardoz.info
39 @settitle zardoz manual
40 @bye
41 EOF
42
43 $ACLOCAL
44 $AUTOMAKE --add-missing
45 $AUTOCONF
46
47 ./configure --disable-silent-rules
48
49 # Silent mode output.
50 st=0
51 $MAKE V=0 dvi html info ps pdf >stdout 2>stderr || st=$?
52 cat stdout
53 cat stderr >&2
54 test $st -eq 0
55 grep '^  DVIPS    foo\.ps$'         stdout
56 grep '^  MAKEINFO foo\.html$'       stdout
57 # NetBSD make will print './foo.info' instead of 'foo.info'.
58 $EGREP '^  MAKEINFO (\./)?foo\.info$' stdout
59 grep '^  TEXI2DVI foo\.dvi$'        stdout
60 grep '^  TEXI2PDF foo\.pdf$'        stdout
61 grep '^  DVIPS    sub/zardoz.ps$'   stdout
62 grep '^  MAKEINFO sub/zardoz.html$' stdout
63 # NetBSD make will print './sub/zardoz.info' instead of 'zardoz.info'.
64 $EGREP '^  MAKEINFO (\./)?sub/zardoz.info$' stdout
65 grep '^  TEXI2DVI sub/zardoz.dvi$'  stdout
66 grep '^  TEXI2PDF sub/zardoz.pdf$'  stdout
67 # No make recipe is displayed before being executed.
68 $EGREP 'texi2(dvi|pdf)|dvips|makeinfo|(rm|mv) ' \
69   stdout stderr && exit 1
70 # No verbose output from TeX nor dvips.
71 $EGREP '(zardoz|foo)\.log|3\.14|Copyright|This is|[Oo]utput ' \
72   stdout stderr && exit 1
73
74 # Verbose mode output.
75 $MAKE clean || exit 1
76 $MAKE V=1 dvi html info ps pdf >output 2>&1 || { cat output; exit 1; }
77 cat output
78 $EGREP '(DVIPS|MAKEINFO|TEXI2(PDF|DVI)) ' output && exit 1
79 # Verbose output from TeX.
80 grep '[Oo]utput .*foo\.pdf' output
81 grep '[Oo]utput .*zardoz\.pdf' output
82 $FGREP 'foo.log' output
83 $FGREP 'zardoz.log' output
84 # Verbose output from dvips.
85 $FGREP ' dvips' output
86
87 :