* lib/Makefile.am (dist_script_DATA): Move config-ml.in ...
[automake.git] / tests / nobase.test
blobd8bf8c04a7f63ffcbc4ab13eb8440b50f6c756a2
1 #! /bin/sh
2 # Copyright (C) 2001, 2002 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 2, 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 autoconf; 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.
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 foo_DATA = sub/base.dat
42 nobase_foo_DATA = sub/nobase.dat
44 fooexec_SCRIPTS = sub/base.sh
45 nobase_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 libtoolize
112 $ACLOCAL
113 $AUTOCONF
114 $AUTOMAKE -a
115 ./configure --prefix `pwd`/inst --program-prefix=p
117 $MAKE
118 $MAKE test-install-data
119 $MAKE test-install-exec
120 $MAKE uninstall
122 test `find inst/foo -type f -print | wc -l` = 0
124 $MAKE install-strip