* INSTALL, lib/INSTALL, lib/config-ml.in, lib/config.guess,
[automake/plouj.git] / tests / nobase.test
blob7d38710075bd469f17500bbec70801a6f18a3005
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
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 3, or (at your option)
9 # any later version.
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.
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., 51 Franklin Street, Fifth Floor,
19 # Boston, MA 02110-1301, USA.
21 # Make sure nobase_* works.
23 required='libtoolize gcc'
24 . ./defs || exit 1
26 set -e
28 cat >> configure.in <<'EOF'
29 AC_PROG_CC
30 AC_PROG_LIBTOOL
31 AC_OUTPUT
32 EOF
34 cat > Makefile.am << 'EOF'
35 foodir = $(prefix)/foo
36 fooexecdir = $(prefix)/foo
38 foo_HEADERS = sub/base.h
39 nobase_foo_HEADERS = sub/nobase.h
41 dist_foo_DATA = sub/base.dat
42 nobase_dist_foo_DATA = sub/nobase.dat
44 dist_fooexec_SCRIPTS = sub/base.sh
45 nobase_dist_fooexec_SCRIPTS = sub/nobase.sh
47 fooexec_PROGRAMS = sub/base
48 nobase_fooexec_PROGRAMS = sub/nobase
49 sub_base_SOURCES = source.c
50 sub_nobase_SOURCES = source.c
52 fooexec_LIBRARIES = sub/libbase.a
53 nobase_fooexec_LIBRARIES = sub/libnobase.a
54 sub_libbase_a_SOURCES = source.c
55 sub_libnobase_a_SOURCES = source.c
57 fooexec_LTLIBRARIES = sub/libbase.la
58 nobase_fooexec_LTLIBRARIES = sub/libnobase.la
59 sub_libbase_la_SOURCES = source2.c
60 sub_libnobase_la_SOURCES = source2.c
62 test-install-data: install-data
63 test -f inst/foo/sub/nobase.h
64 test ! -f inst/foo/nobase.h
65 test -f inst/foo/base.h
66 test -f inst/foo/sub/nobase.dat
67 test ! -f inst/foo/nobase.dat
68 test -f inst/foo/base.dat
69 test ! -f inst/foo/sub/pnobase.sh
70 test ! -f inst/foo/pbase.sh
71 test ! -f inst/foo/sub/pnobase$(EXEEXT)
72 test ! -f inst/foo/pbase$(EXEEXT)
73 test ! -f inst/foo/sub/libnobase.a
74 test ! -f inst/foo/libbase.a
75 test ! -f inst/foo/sub/libnobase.la
76 test ! -f inst/foo/libbase.la
78 test-install-exec: install-exec
79 test -f inst/foo/sub/pnobase.sh
80 test ! -f inst/foo/pnobase.sh
81 test -f inst/foo/pbase.sh
82 test -f inst/foo/sub/pnobase$(EXEEXT)
83 test ! -f inst/foo/pnobase$(EXEEXT)
84 test -f inst/foo/pbase$(EXEEXT)
85 test -f inst/foo/sub/libnobase.a
86 test ! -f inst/foo/libnobase.a
87 test -f inst/foo/libbase.a
88 test -f inst/foo/sub/libnobase.la
89 test ! -f inst/foo/libnobase.la
90 test -f inst/foo/libbase.la
91 EOF
93 mkdir sub
95 : > sub/base.h
96 : > sub/nobase.h
97 : > sub/base.dat
98 : > sub/nobase.dat
99 : > sub/base.sh
100 : > sub/nobase.sh
102 cat >source.c <<'EOF'
104 main (int argc, char *argv[])
106 return 0;
109 cp source.c source2.c
111 rm -f install-sh
113 libtoolize
114 $ACLOCAL
115 $AUTOCONF
116 $AUTOMAKE -a --copy
117 ./configure --prefix "`pwd`/inst" --program-prefix=p
119 $MAKE
120 $MAKE test-install-data
121 $MAKE test-install-exec
122 $MAKE uninstall
124 test `find inst/foo -type f -print | wc -l` = 0
126 $MAKE install-strip
128 # Likewise, in a VPATH build.
130 $MAKE uninstall
131 $MAKE distclean
132 mkdir build
133 cd build
134 ../configure --prefix "`pwd`/inst" --program-prefix=p
135 $MAKE
136 $MAKE test-install-data
137 $MAKE test-install-exec
138 $MAKE uninstall
139 test `find inst/foo -type f -print | wc -l` = 0