Here's one I did for a project where I want to use 2.0. Since
"python" is still 1.5.2 on Debian, it had to be smart enough to see
that "python"'s not 2.0...
It's not perfect... but it Works For Me(tm) ;-)
AC_DEFUN(jae_PYTHON,
[
# Try to find Python in the path
AC_PATH_PROG(PATH_TO_PYTHON, python)
if test "$1" != "" ; then
# There's a min version specified. Run a python prog that checks the version
if test -n "$PATH_TO_PYTHON" && $PATH_TO_PYTHON -c '
import sys, string
if map(int, string.split(string.split(sys.version)[[0]], ".")) < map(int,
string.split(sys.argv[[1]], ".")):
sys.exit(1)' $1; then
PYTHON=$PATH_TO_PYTHON
else
if test -z "$PATH_TO_PYTHON"; then
AC_MSG_WARN([No "python" executable found])
else
AC_MSG_WARN([$PATH_TO_PYTHON is a version older than $1, trying to find
python$1])
fi
# Try to find PYTHON+version
AC_PATH_PROG([PATH_TO_PYTHON]translit([$1], .), python$1)
if test -z "$[PATH_TO_PYTHON]translit([$1], .)"; then
AC_MSG_ERROR([no python $1 interpreter found])
else
PYTHON=$[PATH_TO_PYTHON]translit([$1], .)
fi
fi
else
if test -z "$PATH_TO_PYTHON"; then
AC_MSG_ERROR([no python interpreter found])
else
PYTHON=$PATH_TO_PYTHON
fi
PYTHON=$PATH_TO_PYTHON
fi
AC_SUBST(PYTHON)
]
)
--
Jürgen A. Erhard [EMAIL PROTECTED] phone: (GERMANY) 0721 27326
My WebHome: http://members.tripod.com/Juergen_Erhard
George Herrimann's Krazy Kat (http://www.krazy.com)
Shah, shah! Ayatollah you so!
PGP signature