2 # Copyright (C) 2003-2012 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)
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 # Test detection of missing Python.
18 # See also related test t/python-am-path-missing-2.sh (which requires
19 # an actual python program).
21 am_create_testdir
=empty
22 # An actual python is *not* required in this test.
27 cat > configure.ac
<<END
33 echo AM_PATH_PYTHON
> mypy.
m4
39 .
/configure PYTHON
=: 2>stderr
&& { cat stderr
>&2; exit 1; }
41 grep 'no suitable Python interpreter found' stderr
43 # Again, but from the environment this time.
44 env PYTHON
=: .
/configure
2>stderr
&& { cat stderr
>&2; exit 1; }
46 grep 'no suitable Python interpreter found' stderr
48 # Now try using a custom ACTION-IF-NOT-FOUND.
50 echo 'AM_PATH_PYTHON(,, [echo "$PYTHON" > py])' > mypy.
m4
53 test x
"$(cat py)" = x
:
55 # Now try requiring a version.
57 rm -rf autom4te
*.cache
# Will have to re-run aclocal.
59 # Hopefully the Python team will never release such a version :-)
60 echo 'AM_PATH_PYTHON([9999.9], [])' > mypy.
m4
61 # The "--force" options (here and below) are truly needed to avoid
62 # potential timestamp races. See automake bug#12210.
65 .
/configure
>stdout
2>stderr
&& {
72 $EGREP 'checking for a Python interpreter with version >= 9999\.9\.\.\. no(ne)? *$' stdout
73 grep 'no suitable Python interpreter found' stderr
75 # Now try requiring a version and using a custom ACTION-IF-NOT-FOUND.
77 echo 'AM_PATH_PYTHON([9999.9], [], [echo "$PYTHON" > py])' > mypy.
m4
80 test x
"$(cat py)" = x
: