sync: update files from upstream with "make fetch"
[platform/upstream/automake.git] / t / txinfo30.sh
1 #! /bin/sh
2 # Copyright (C) 2005-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 # Make sure 'missing texinfo' does not create empty files.
18 # Report from Bob Proulx.
19
20 . ./defs || exit 1
21
22 echo info_TEXINFOS = bar.texi >Makefile.am
23 echo grepme >bar.info
24 $sleep
25 cat >bar.texi <<EOF
26 @setfilename bar.info
27 EOF
28
29 echo AC_OUTPUT >>configure.ac
30
31 cat >makeinfo <<\EOF
32 #!/bin/sh
33 # This script
34 # 1. fails so 'missing' can take over
35 # 2. does not understand '--version' so 'missing' thinks 'makeinfo' isn't
36 #    installed
37 exec false
38 EOF
39
40 chmod +x makeinfo
41
42 PATH=$(pwd)$PATH_SEPARATOR$PATH
43 export PATH
44
45 # Otherwise configure might pick up a working makeinfo from the
46 # environment.  Seen in automake bug#10866.
47 unset MAKEINFO || :
48
49 $ACLOCAL
50 $AUTOCONF
51 $AUTOMAKE --add-missing
52
53 ./configure
54 $MAKE
55 grep grepme bar.info
56 test -f bar.info
57
58 # We should not create a missing bar.info.
59 rm -f bar.info
60 $MAKE && exit 1
61 test ! -e bar.info
62
63 :