747dd31390597b6298ccb1c961ce64e08367e02b
[platform/upstream/automake.git] / tests / instdir-texi.test
1 #! /bin/sh
2 # Copyright (C) 2009  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 3, 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 # If $(infodir) is the empty string, then nothing should be installed there.
18 # Likewise for the other install-* targets used for texinfo files.
19
20 required='makeinfo-html tex texi2dvi'
21 . ./defs || Exit 1
22
23 (dvips --help 2>/dev/null >/dev/null) || Exit 77
24 (pdfetex --help 2>/dev/null >/dev/null) ||
25   (pdftex --help 2>/dev/null >/dev/null) || Exit 77
26
27 set -e
28
29 cat >>configure.in <<'END'
30 AC_OUTPUT
31 END
32
33 cat >Makefile.am <<'END'
34 info_TEXINFOS = foo.texi
35 END
36
37 cat >foo.texi << 'END'
38 \input texinfo
39 @setfilename foo.info
40 @settitle foo
41 @node Top
42 Hello walls.
43 @include version.texi
44 @bye
45 END
46
47 $ACLOCAL
48 $AUTOCONF
49 $AUTOMAKE --add-missing
50
51 instdir=`pwd`/inst
52 destdir=`pwd`/dest
53 mkdir build
54 cd build
55 ../configure --prefix="$instdir"
56 $MAKE all dvi ps pdf html
57
58 infodir= htmldir= dvidir= psdir= pdfdir=
59 export infodir htmldir dvidir psdir pdfdir
60
61 $MAKE -e install install-html install-dvi install-ps install-pdf
62 test ! -d "$instdir"
63 $MAKE -e install install-html install-dvi install-ps install-pdf DESTDIR="$destdir"
64 test ! -d "$instdir"
65 test ! -d "$destdir"
66 $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
67 cat stdout
68 grep 'rm -f' stdout && Exit 1
69 $MAKE -e uninstall DESTDIR="$destdir"
70 :