| 1 | #! /bin/sh
|
|---|
| 2 | # Copyright (C) 2001, 2002, 2004 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., 51 Franklin Street, Fifth Floor,
|
|---|
| 19 | # Boston, MA 02110-1301, USA.
|
|---|
| 20 |
|
|---|
| 21 | # Make sure nobase_* works.
|
|---|
| 22 |
|
|---|
| 23 | required='libtoolize gcc'
|
|---|
| 24 | . ./defs || exit 1
|
|---|
| 25 |
|
|---|
| 26 | set -e
|
|---|
| 27 |
|
|---|
| 28 | cat >> configure.in <<'EOF'
|
|---|
| 29 | AC_PROG_CC
|
|---|
| 30 | AC_PROG_LIBTOOL
|
|---|
| 31 | AC_OUTPUT
|
|---|
| 32 | EOF
|
|---|
| 33 |
|
|---|
| 34 | cat > Makefile.am << 'EOF'
|
|---|
| 35 | foodir = $(prefix)/foo
|
|---|
| 36 | fooexecdir = $(prefix)/foo
|
|---|
| 37 |
|
|---|
| 38 | foo_HEADERS = sub/base.h
|
|---|
| 39 | nobase_foo_HEADERS = sub/nobase.h
|
|---|
| 40 |
|
|---|
| 41 | dist_foo_DATA = sub/base.dat
|
|---|
| 42 | nobase_dist_foo_DATA = sub/nobase.dat
|
|---|
| 43 |
|
|---|
| 44 | dist_fooexec_SCRIPTS = sub/base.sh
|
|---|
| 45 | nobase_dist_fooexec_SCRIPTS = sub/nobase.sh
|
|---|
| 46 |
|
|---|
| 47 | fooexec_PROGRAMS = sub/base
|
|---|
| 48 | nobase_fooexec_PROGRAMS = sub/nobase
|
|---|
| 49 | sub_base_SOURCES = source.c
|
|---|
| 50 | sub_nobase_SOURCES = source.c
|
|---|
| 51 |
|
|---|
| 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
|
|---|
| 56 |
|
|---|
| 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
|
|---|
| 61 |
|
|---|
| 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
|
|---|
| 77 |
|
|---|
| 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
|
|---|
| 92 |
|
|---|
| 93 | mkdir sub
|
|---|
| 94 |
|
|---|
| 95 | : > sub/base.h
|
|---|
| 96 | : > sub/nobase.h
|
|---|
| 97 | : > sub/base.dat
|
|---|
| 98 | : > sub/nobase.dat
|
|---|
| 99 | : > sub/base.sh
|
|---|
| 100 | : > sub/nobase.sh
|
|---|
| 101 |
|
|---|
| 102 | cat >source.c <<'EOF'
|
|---|
| 103 | int
|
|---|
| 104 | main (int argc, char *argv[])
|
|---|
| 105 | {
|
|---|
| 106 | return 0;
|
|---|
| 107 | }
|
|---|
| 108 | EOF
|
|---|
| 109 | cp source.c source2.c
|
|---|
| 110 |
|
|---|
| 111 | libtoolize
|
|---|
| 112 | $ACLOCAL
|
|---|
| 113 | $AUTOCONF
|
|---|
| 114 | $AUTOMAKE -a
|
|---|
| 115 | ./configure --prefix `pwd`/inst --program-prefix=p
|
|---|
| 116 |
|
|---|
| 117 | $MAKE
|
|---|
| 118 | $MAKE test-install-data
|
|---|
| 119 | $MAKE test-install-exec
|
|---|
| 120 | $MAKE uninstall
|
|---|
| 121 |
|
|---|
| 122 | test `find inst/foo -type f -print | wc -l` = 0
|
|---|
| 123 |
|
|---|
| 124 | $MAKE install-strip
|
|---|
| 125 |
|
|---|
| 126 | # Likewise, in a VPATH build.
|
|---|
| 127 |
|
|---|
| 128 | $MAKE uninstall
|
|---|
| 129 | $MAKE distclean
|
|---|
| 130 | mkdir build
|
|---|
| 131 | cd build
|
|---|
| 132 | ../configure --prefix `pwd`/inst --program-prefix=p
|
|---|
| 133 | $MAKE
|
|---|
| 134 | $MAKE test-install-data
|
|---|
| 135 | $MAKE test-install-exec
|
|---|
| 136 | $MAKE uninstall
|
|---|
| 137 | test `find inst/foo -type f -print | wc -l` = 0
|
|---|