], [with_python="yes"])
SAVE_PATH="$PATH"
+SAVE_CPPFLAGS="$CPPFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+SAVE_LIBS="$LIBS"
+
PATH="$with_python_path"
if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
fi
fi
-PATH="$SAVE_PATH"
-
if test "x$with_python" = "xyes"
then
AC_MSG_CHECKING([for Python CPPFLAGS])
if test "x$with_python" = "xyes"
then
+ CPPFLAGS="-I$python_include_path $CPPFLAGS"
+ AC_CHECK_HEADERS(Python.h,
+ [with_python="yes"],
+ [with_python="no ('Python.h' not found)"])
+fi
+
+if test "x$with_python" = "xyes"
+then
AC_MSG_CHECKING([for Python LDFLAGS])
python_library_path=`echo "import distutils.sysconfig;print distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0)" | "$with_python_prog" 2>&1`
python_config_status=$?
if test "x$with_python" = "xyes"
then
+ LDFLAGS="-L$python_library_path $LDFLAGS"
+ LIBS="$python_library_flags $LIBS"
+
+ AC_CHECK_FUNC(PyObject_CallFunction,
+ [with_python="yes"],
+ [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
+fi
+
+PATH="$SAVE_PATH"
+CPPFLAGS="$SAVE_CPPFLAGS"
+LDFLAGS="$SAVE_LDFLAGS"
+LIBS="$SAVE_LIBS"
+
+if test "x$with_python" = "xyes"
+then
BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
BUILD_WITH_PYTHON_LIBS="$python_library_flags"