~ubuntu-branches/ubuntu/precise/libglade2/precise-proposed

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2002-03-30 22:55:37 UTC
  • Revision ID: james.westby@ubuntu.com-20020330225537-jx47zcil1ybgy9qx
Tags: upstream-1.99.10
ImportĀ upstreamĀ versionĀ 1.99.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
])