1 | #! /bin/sh
|
---|
2 | # Copyright (C) 2002 Free Software Foundation, Inc.
|
---|
3 | #
|
---|
4 | # This file is part of GNU Automake.
|
---|
5 | #
|
---|
6 | # GNU Automake is free software; you can redistribute it and/or modify
|
---|
7 | # it under the terms of the GNU General Public License as published by
|
---|
8 | # the Free Software Foundation; either version 2, or (at your option)
|
---|
9 | # any later version.
|
---|
10 | #
|
---|
11 | # GNU Automake is distributed in the hope that it will be useful,
|
---|
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | # GNU General Public License for more details.
|
---|
15 | #
|
---|
16 | # You should have received a copy of the GNU General Public License
|
---|
17 | # along with Automake; see the file COPYING. If not, write to
|
---|
18 | # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
---|
19 | # Boston, MA 02111-1307, USA.
|
---|
20 |
|
---|
21 | # Check that AM_INSTALLCHECK_STD_OPTIONS_EXEMPT works.
|
---|
22 |
|
---|
23 | required=gcc
|
---|
24 | . ./defs || exit 1
|
---|
25 |
|
---|
26 | cat >> configure.in << 'END'
|
---|
27 | AC_PROG_CC
|
---|
28 | AC_OUTPUT
|
---|
29 | END
|
---|
30 |
|
---|
31 | # We use the same basename for all targets on purpose. This way
|
---|
32 | # we make sure that `AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok'
|
---|
33 | # will not match anything containing `nok'.
|
---|
34 | cat > Makefile.am << 'END'
|
---|
35 | AUTOMAKE_OPTIONS = gnits
|
---|
36 |
|
---|
37 | nobase_bin_PROGRAMS = nok sub/nok
|
---|
38 | nok_SOURCES = nok.c
|
---|
39 | sub_nok_SOURCES = nok.c
|
---|
40 |
|
---|
41 | nobase_bin_SCRIPTS = nok.sh sub/nok.sh
|
---|
42 |
|
---|
43 | AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok$(EXEEXT) nok.sh
|
---|
44 |
|
---|
45 | grep-stderr:
|
---|
46 | grep 'sub/pnok$(EXEEXT) does not support' stderr
|
---|
47 | grep 'sub/pnok.sh does not support' stderr
|
---|
48 | ## Only two failures please.
|
---|
49 | test `grep 'does not support --help' stderr | wc -l` = 2
|
---|
50 | test `grep 'does not support --version' stderr | wc -l` = 2
|
---|
51 | END
|
---|
52 |
|
---|
53 | echo 'int main () { return 0; }' > nok.c
|
---|
54 |
|
---|
55 | mkdir sub
|
---|
56 |
|
---|
57 | cat >nok.sh <<EOF
|
---|
58 | #!/bin/sh
|
---|
59 | echo "Which version? Which usage?"
|
---|
60 | exit 1
|
---|
61 | EOF
|
---|
62 |
|
---|
63 | cp nok.sh sub/nok.sh
|
---|
64 |
|
---|
65 | chmod +x nok.sh
|
---|
66 | chmod +x sub/nok.sh
|
---|
67 |
|
---|
68 | # Files required by Gnits.
|
---|
69 | : > INSTALL
|
---|
70 | : > NEWS
|
---|
71 | : > README
|
---|
72 | : > COPYING
|
---|
73 | : > AUTHORS
|
---|
74 | : > ChangeLog
|
---|
75 | : > THANKS
|
---|
76 |
|
---|
77 | set -e
|
---|
78 |
|
---|
79 | $ACLOCAL
|
---|
80 | $AUTOCONF
|
---|
81 | $AUTOMAKE -a
|
---|
82 |
|
---|
83 | mkdir build
|
---|
84 | cd build
|
---|
85 |
|
---|
86 | # Use --program-prefix to make sure the std-options check honors it.
|
---|
87 | ../configure --prefix=`pwd`/../inst-dir --program-prefix=p
|
---|
88 | $MAKE
|
---|
89 | $MAKE install
|
---|
90 | $MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
|
---|
91 | cat stderr
|
---|
92 | $MAKE grep-stderr
|
---|
93 |
|
---|
94 | # Make sure there is no more error when all targets are exempted.
|
---|
95 | cd ..
|
---|
96 | echo 'AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += sub/nok$(EXEEXT) sub/nok.sh' >> Makefile.am
|
---|
97 | $AUTOMAKE
|
---|
98 | cd build
|
---|
99 | ./config.status # Don't rely on the rebuild rules (they need GNU make).
|
---|
100 | $MAKE installcheck
|
---|