Revision 18268,
1.1 KB
checked in by ghudson, 22 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r18267,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | dnl JH_PYTHON_CHECK(VERSIONTUPLE, EXTRA-CHECKS, |
---|
2 | dnl ACTION-IF-FOUND,ACTION-IF-NOT-FOUND) |
---|
3 | |
---|
4 | AC_DEFUN([JH_PYTHON_CHECK], |
---|
5 | [AC_CACHE_VAL([jh_cv_path_python], |
---|
6 | [if test "x$PYTHON" != x; then |
---|
7 | jh_cv_path_python="$PYTHON" |
---|
8 | else |
---|
9 | dnl python code to check for required python |
---|
10 | jh_python_check=' |
---|
11 | import sys, string |
---|
12 | if sys.version_info < $1: |
---|
13 | sys.exit(1) |
---|
14 | $2 |
---|
15 | sys.exit(0)' |
---|
16 | dnl |
---|
17 | for jh_python in python python2 python2.3 python2.2 python2.1 python2.0; do |
---|
18 | jh_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
---|
19 | jh_dummy="$PATH" |
---|
20 | for jh_dir in $jh_dummy; do |
---|
21 | IFS=$jh_save_IFS |
---|
22 | test -z "$jh_dir" && jh_dir=. |
---|
23 | if test -x "$jh_dir/$jh_python"; then |
---|
24 | echo "checking $jh_dir/$jh_python" >&AS_MESSAGE_LOG_FD |
---|
25 | if "$jh_dir/$jh_python" -c "$jh_python_check" 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD |
---|
26 | then |
---|
27 | echo "$jh_dir/$jh_python looks okay" >&AS_MESSAGE_LOG_FD |
---|
28 | jh_cv_path_python="$jh_dir/$jh_python" |
---|
29 | break |
---|
30 | fi |
---|
31 | fi |
---|
32 | done |
---|
33 | test -n "$jh_cv_path_python" && break |
---|
34 | done |
---|
35 | fi]) |
---|
36 | if test -n "$jh_cv_path_python"; then |
---|
37 | PYTHON="$jh_cv_path_python" |
---|
38 | $3 |
---|
39 | else |
---|
40 | PYTHON="/usr/bin/env python" |
---|
41 | $4 |
---|
42 | fi |
---|
43 | ]) |
---|
Note: See
TracBrowser
for help on using the repository browser.