Split libtool part off of nobase.test.
[automake/plouj.git] / tests / nobase.test
blob9f14fabfca8ca57b797c92a509d8a41e7e7e4eb1
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software
3 # Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3, or (at your option)
8 # any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Make sure nobase_* works.
20 required='gcc'
21 . ./defs || exit 1
23 set -e
25 cat >> configure.in <<'EOF'
26 AC_PROG_CC
27 AC_PROG_RANLIB
28 AC_OUTPUT
29 EOF
31 cat > Makefile.am << 'EOF'
32 foodir = $(prefix)/foo
33 fooexecdir = $(prefix)/foo
35 foo_HEADERS = sub/base.h
36 nobase_foo_HEADERS = sub/nobase.h
38 dist_foo_DATA = sub/base.dat
39 nobase_dist_foo_DATA = sub/nobase.dat
41 dist_fooexec_SCRIPTS = sub/base.sh
42 nobase_dist_fooexec_SCRIPTS = sub/nobase.sh
44 fooexec_PROGRAMS = sub/base
45 nobase_fooexec_PROGRAMS = sub/nobase
46 sub_base_SOURCES = source.c
47 sub_nobase_SOURCES = source.c
49 fooexec_LIBRARIES = sub/libbase.a
50 nobase_fooexec_LIBRARIES = sub/libnobase.a
51 sub_libbase_a_SOURCES = source.c
52 sub_libnobase_a_SOURCES = source.c
54 test-install-data: install-data
55 test -f inst/foo/sub/nobase.h
56 test ! -f inst/foo/nobase.h
57 test -f inst/foo/base.h
58 test -f inst/foo/sub/nobase.dat
59 test ! -f inst/foo/nobase.dat
60 test -f inst/foo/base.dat
61 test ! -f inst/foo/sub/pnobase.sh
62 test ! -f inst/foo/pbase.sh
63 test ! -f inst/foo/sub/pnobase$(EXEEXT)
64 test ! -f inst/foo/pbase$(EXEEXT)
65 test ! -f inst/foo/sub/libnobase.a
66 test ! -f inst/foo/libbase.a
68 test-install-exec: install-exec
69 test -f inst/foo/sub/pnobase.sh
70 test ! -f inst/foo/pnobase.sh
71 test -f inst/foo/pbase.sh
72 test -f inst/foo/sub/pnobase$(EXEEXT)
73 test ! -f inst/foo/pnobase$(EXEEXT)
74 test -f inst/foo/pbase$(EXEEXT)
75 test -f inst/foo/sub/libnobase.a
76 test ! -f inst/foo/libnobase.a
77 test -f inst/foo/libbase.a
78 EOF
80 mkdir sub
82 : > sub/base.h
83 : > sub/nobase.h
84 : > sub/base.dat
85 : > sub/nobase.dat
86 : > sub/base.sh
87 : > sub/nobase.sh
89 cat >source.c <<'EOF'
90 int
91 main (int argc, char *argv[])
93 return 0;
95 EOF
96 cp source.c source2.c
98 rm -f install-sh
100 $ACLOCAL
101 $AUTOCONF
102 $AUTOMAKE -a --copy
103 ./configure --prefix "`pwd`/inst" --program-prefix=p
105 $MAKE
106 $MAKE test-install-data
107 $MAKE test-install-exec
108 $MAKE uninstall
110 test `find inst/foo -type f -print | wc -l` = 0
112 $MAKE install-strip
114 # Likewise, in a VPATH build.
116 $MAKE uninstall
117 $MAKE distclean
118 mkdir build
119 cd build
120 ../configure --prefix "`pwd`/inst" --program-prefix=p
121 $MAKE
122 $MAKE test-install-data
123 $MAKE test-install-exec
124 $MAKE uninstall
125 test `find inst/foo -type f -print | wc -l` = 0