1#! /bin/sh 2# Copyright (C) 2002-2021 Free Software Foundation, Inc. 3# 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. 8# 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. 13# 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/>. 16 17# Make sure that Automake suggests using AM_PATH_PYTHON. 18 19. test-init.sh 20 21$ACLOCAL 22 23echo 1. pythondir not defined 24 25cat > Makefile.am <<'END' 26PYTHON = x 27python_PYTHON = foo.py 28END 29 30AUTOMAKE_fails -a 31grep 'pythondir.*undefined' stderr 32grep AM_PATH_PYTHON stderr 33 34 35echo 2. pkgpythondir not defined 36 37cat > Makefile.am <<'END' 38PYTHON = x 39pkgpython_PYTHON = foo.py 40END 41 42AUTOMAKE_fails -a 43grep 'pkgpythondir.*undefined' stderr 44grep AM_PATH_PYTHON stderr 45 46 47echo 3. pyexecdir not defined 48 49cat > Makefile.am <<'END' 50PYTHON = x 51pyexec_PYTHON = foo.py 52END 53 54AUTOMAKE_fails -a 55grep 'pyexecdir.*undefined' stderr 56grep AM_PATH_PYTHON stderr 57 58 59echo 4. pkgpyexecdir not defined 60 61cat > Makefile.am <<'END' 62PYTHON = x 63pkgpyexec_PYTHON = foo.py 64END 65 66AUTOMAKE_fails -a 67grep 'pkgpyexecdir.*undefined' stderr 68grep AM_PATH_PYTHON stderr 69 70 71echo 5. PYTHON not defined. 72 73cat > Makefile.am <<'END' 74pkgpyexecdir = /here/we/go 75pkgpyexec_PYTHON = foo.py 76END 77 78AUTOMAKE_fails -a 79grep 'PYTHON.*undefined' stderr 80grep AM_PATH_PYTHON stderr 81 82 83echo 6. Ok. 84 85cat > Makefile.am <<'END' 86PYTHON = x 87pkgpyexecdir = /here/we/go 88pkgpyexec_PYTHON = foo.py 89END 90 91rm -f py-compile 92$AUTOMAKE -a 93test -f py-compile 94 95 96echo 7. Ok again. 97 98cat > Makefile.am <<'END' 99PYTHON = x 100fubardir = /here/we/go 101fubar_PYTHON = foo.py 102END 103 104$AUTOMAKE -a 105 106: 107