doc: update Vala documentation
[automake.git] / t / nobase-libtool.sh
blobf644fc06157e7207685923c1a5934451dffe7088
1 #! /bin/sh
2 # Copyright (C) 2001-2024 Free Software Foundation, Inc.
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.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Make sure nobase_* works for libtool libraries and programs as well.
18 # This is just the libtool equivalent of 'nobase.sh', split up to allow
19 # greater exposure of that test.
21 required='cc libtoolize'
22 . test-init.sh
24 cat >> configure.ac <<'EOF'
25 AC_PROG_CC
26 AM_PROG_AR
27 AC_PROG_LIBTOOL
28 AC_OUTPUT
29 EOF
31 cat > Makefile.am << 'EOF'
32 fooexecdir = $(prefix)/foo
33 fooexec_LTLIBRARIES = sub/libbase.la
34 nobase_fooexec_LTLIBRARIES = sub/libnobase.la
35 fooexec_PROGRAMS = sub/base
36 nobase_fooexec_PROGRAMS = sub/nobase
37 sub_libbase_la_SOURCES = source2.c
38 sub_libnobase_la_SOURCES = source2.c
39 sub_base_SOURCES = source.c
40 sub_nobase_SOURCES = source.c
42 test-install-data: install-data
43 test ! -f inst/foo/sub/libnobase.la
44 test ! -f inst/foo/libbase.la
46 test-install-exec: install-exec
47 test -f inst/foo/sub/libnobase.la
48 test ! -f inst/foo/libnobase.la
49 test -f inst/foo/libbase.la
51 .PHONY: test-install-exec test-install-data
52 EOF
54 mkdir sub
56 cat >source.c <<'EOF'
57 int main (int argc, char *argv[])
59 return 0;
61 EOF
62 cp source.c source2.c
64 rm -f install-sh
66 libtoolize
67 $ACLOCAL
68 $AUTOCONF
69 $AUTOMAKE -a --copy
70 ./configure --prefix "$(pwd)/inst" --program-prefix=p
72 $MAKE
73 $MAKE test-install-data
74 $MAKE test-install-exec
75 $MAKE uninstall
77 test $(find inst/foo -type f -print | wc -l) -eq 0
79 $MAKE install-strip
81 # Likewise, in a VPATH build.
83 $MAKE uninstall
84 $MAKE distclean
85 mkdir build
86 cd build
87 ../configure --prefix "$(pwd)/inst" --program-prefix=p
88 $MAKE
89 $MAKE test-install-data
90 $MAKE test-install-exec
91 $MAKE uninstall
92 test $(find inst/foo -type f -print | wc -l) -eq 0