define WITH_PYTHON_VERSION

This commit is contained in:
Дмитрий Левин 2002-03-25 21:42:12 +00:00
parent 982bbb2734
commit 9663c1d7b8

View File

@ -832,32 +832,7 @@ if test -n "$withval" -a "$withval" != auto; then
WITH_PYTHON_VERSION=$withval
fi
if test $withval = auto ; then
AC_MSG_CHECKING(for python 2.2)
AC_TRY_RUN([
#include <python2.2/Python.h>
main() {
exit(strncmp("2.2", PY_VERSION, 3));
} ],
withval=yes, withval=no, withval=yes)
AC_MSG_RESULT($withval)
if test $withval = yes ; then
WITH_PYTHON_VERSION="2.2"
else
AC_MSG_CHECKING(for python 1.5.2)
AC_TRY_RUN([
#include <python1.5/Python.h>
main() {
exit(strcmp("1.5.2", PY_VERSION));
} ],
withval=yes, withval=no, withval=yes)
AC_MSG_RESULT($withval)
if test $withval = yes ; then
WITH_PYTHON_VERSION="1.5"
fi
fi
WITH_PYTHON_VERSION=$(python -c 'import sys; print sys.version' |head -1 |cut -d' ' -f1 |cut -d. -f1,2)
fi
if test -n "$WITH_PYTHON_VERSION" ; then