version 1.2 | | version 1.3 |
---|
| | |
PYTHON_LIB="" | | PYTHON_LIB="" |
PY_LIBS="" | | PY_LIBS="" |
PY_INCLUDES="" | | PY_INCLUDES="" |
| | dir="" |
AC_CHECK_HEADERS([Python.h],[cf_have_python_h=yes]) | | AC_CHECK_HEADERS([Python.h],[cf_have_python_h=yes]) |
if test "x$cf_have_python_h" = "x" ; then | | if test "x$cf_have_python_h" = "x" ; then |
for dir in /usr{,local}/include/python{,2.2,2.1,2.0} ; do | | for dir in /usr{,local}/include/python{,2.2,2.1,2.0} ; do |
| | |
else | | else |
PY_INCLUDES="" | | PY_INCLUDES="" |
fi | | fi |
| | |
if test "x$cf_have_python_h" = "xyes" ; then | | if test "x$cf_have_python_h" = "xyes" ; then |
PYTHON_LIB="" | | PYTHON_LIB="" |
for lib in python{,2.2,2.1,2.0} ; do | | python=`echo $dir | awk -F/ '{print $NF}'`; |
AC_CHECK_LIB($lib, PyArg_ParseTuple,[PYTHON_LIB="-l$lib"]) | | AC_CHECK_LIB($python, PyArg_ParseTuple,[PYTHON_LIB="-l$python"]) |
if test "x$PYTHON_LIB" != "x" ; then | | |
break | | # These checks are a bit bogus - would be better to use AC_CHECK_LIB, |
| | # but it caches the result of the first check, even if we run AC_CHECK_LIB |
| | # with other options. |
| | AC_MSG_CHECKING([For python lib in various places]) |
| | if test -f /usr/lib/$python/lib$python.a ; then |
| | PYTHON_LIB="/usr/lib/$python/lib$python.a" |
| | AC_MSG_RESULT([found in /usr/lib/$python]) |
| | elif test -f /usr/lib/$python/config/lib$python.a ; then |
| | PYTHON_LIB="/usr/lib/$python/config/lib$python.a" |
| | AC_MSG_RESULT([found in /usr/lib/$python/config]) |
fi | | fi |
done | | |
if test "x$PYTHON_LIB" = "x" ; then | | if test "x$PYTHON_LIB" = "x" ; then |
AC_MSG_CHECKING([For python lib in nonstandard place]) | | |
PYTHON_LIB=`echo /usr/lib/python*/config/libpython*.a` | | PYTHON_LIB=`echo /usr/lib/python*/config/libpython*.a` |
if test ! -f $PYTHON_LIB ; then | | if test ! -f $PYTHON_LIB ; then |
AC_MSG_RESULT([no]) | | AC_MSG_RESULT([no]) |
| | |
$1 | | $1 |
fi | | fi |
fi | | fi |
| | |
AC_SUBST(PYTHON_LIB) | | AC_SUBST(PYTHON_LIB) |
AC_SUBST(PY_LIBS) | | AC_SUBST(PY_LIBS) |
AC_SUBST(PY_INCLUDES) | | AC_SUBST(PY_INCLUDES) |