Merge branch 'minor'
[automake.git] / t / python2.sh
blobd97fe291048e4182824e3922d81b305c06c73ee5
1 #! /bin/sh
2 # Copyright (C) 2002-2017 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 that Automake suggests using AM_PATH_PYTHON.
19 . test-init.sh
21 $ACLOCAL
23 echo 1. pythondir not defined
25 cat > Makefile.am <<'END'
26 PYTHON = x
27 python_PYTHON = foo.py
28 END
30 AUTOMAKE_fails -a
31 grep 'pythondir.*undefined' stderr
32 grep AM_PATH_PYTHON stderr
35 echo 2. pkgpythondir not defined
37 cat > Makefile.am <<'END'
38 PYTHON = x
39 pkgpython_PYTHON = foo.py
40 END
42 AUTOMAKE_fails -a
43 grep 'pkgpythondir.*undefined' stderr
44 grep AM_PATH_PYTHON stderr
47 echo 3. pyexecdir not defined
49 cat > Makefile.am <<'END'
50 PYTHON = x
51 pyexec_PYTHON = foo.py
52 END
54 AUTOMAKE_fails -a
55 grep 'pyexecdir.*undefined' stderr
56 grep AM_PATH_PYTHON stderr
59 echo 4. pkgpyexecdir not defined
61 cat > Makefile.am <<'END'
62 PYTHON = x
63 pkgpyexec_PYTHON = foo.py
64 END
66 AUTOMAKE_fails -a
67 grep 'pkgpyexecdir.*undefined' stderr
68 grep AM_PATH_PYTHON stderr
71 echo 5. PYTHON not defined.
73 cat > Makefile.am <<'END'
74 pkgpyexecdir = /here/we/go
75 pkgpyexec_PYTHON = foo.py
76 END
78 AUTOMAKE_fails -a
79 grep 'PYTHON.*undefined' stderr
80 grep AM_PATH_PYTHON stderr
83 echo 6. Ok.
85 cat > Makefile.am <<'END'
86 PYTHON = x
87 pkgpyexecdir = /here/we/go
88 pkgpyexec_PYTHON = foo.py
89 END
91 rm -f py-compile
92 $AUTOMAKE -a
93 test -f py-compile
96 echo 7. Ok again.
98 cat > Makefile.am <<'END'
99 PYTHON = x
100 fubardir = /here/we/go
101 fubar_PYTHON = foo.py
104 $AUTOMAKE -a