Implement conditional AC_CONFIG_FILES: AM_COND_IF.
[automake/ericb.git] / tests / nobase-python.test
blobf6f284d9b0a33a2fc89acf0ceaf5982cdb9ea72e
1 #! /bin/sh
2 # Copyright (C) 2008 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 3, 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 <http://www.gnu.org/licenses/>.
17 # Make sure nobase_* works for python files.
19 required=python
20 . ./defs || exit 1
22 set -e
24 cat >>configure.in <<EOF
25 AM_PATH_PYTHON
26 AC_OUTPUT
27 EOF
29 cat > Makefile.am <<'END'
30 mydir=$(prefix)/my
31 my_PYTHON = one.py sub/base.py
32 nobase_my_PYTHON = two.py sub/nobase.py
34 one.py sub/base.py two.py sub/nobase.py:
35 echo 'def one(): return 1' >$@
37 test-install-data: install-data
38 test -f inst/my/one.py
39 test -f inst/my/one.pyc
40 test -f inst/my/two.py
41 test -f inst/my/two.pyc
42 test -f inst/my/base.py
43 test -f inst/my/base.pyc
44 test -f inst/my/sub/nobase.py
45 test -f inst/my/sub/nobase.pyc
46 test ! -f inst/my/nobase.py
47 test ! -f inst/my/nobase.pyc
48 END
50 mkdir sub
52 $ACLOCAL
53 $AUTOCONF
54 $AUTOMAKE --add-missing
56 mkdir inst
57 inst=`pwd`/inst
59 ./configure --prefix "`pwd`/inst" --program-prefix=p
61 $MAKE
62 $MAKE test-install-data
63 $MAKE uninstall
65 test `find inst/my -type f -print | wc -l` = 0
67 $MAKE install-strip
69 # Likewise, in a VPATH build.
71 $MAKE uninstall
72 $MAKE distclean
73 mkdir build
74 cd build
75 ../configure --prefix "`pwd`/inst" --program-prefix=p
76 $MAKE
77 $MAKE test-install-data
78 $MAKE uninstall
79 test `find inst/my -type f -print | wc -l` = 0