[Bug #697402] configure doesn't find python on Debian

Lose the PKG_CHECK_MODULES for python and make sure that Python.h is
present and findable in AC_PYTHON_DEVEL instead.

BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22892 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls 2013-04-09 23:00:51 +00:00
parent 67ac544ffa
commit acb3076c53
2 changed files with 11 additions and 9 deletions

View File

@ -1048,17 +1048,16 @@ AC_ARG_ENABLE(python,
) )
if test x${enable_python} = "xtrue" if test x${enable_python} = "xtrue"
then then
# Check for Python. We require python-2.4 because our implementation # Check for Python. We require python-2.4
# doesn't run with earlier version anymore. Building Python from
# source creates python.pc, Debian installs python2.pc, and Fedora AM_PATH_PYTHON(2.4,,[
# 17 makes both. AC_MSG_ERROR([Could not find python >= 2.4. If you use --enable-python, you MUST have python installed!])
PKG_CHECK_MODULES(PYTHON, python >= 2.4 , , [
PKG_CHECK_MODULES(PYTHON, python2 >= 2.4 , , [
AC_MSG_ERROR([Could not find python >= 2.4. If you use --enable-python, you MUST have python installed!])
]) ])
])
AM_PATH_PYTHON(2.4)
AC_PYTHON_DEVEL(>= '2.4') AC_PYTHON_DEVEL(>= '2.4')
if [ "x${PYTHON}" = "x" ]
then
AC_MSG_ERROR([Could not find Python development files. Make sure that the correct python-devel package is installed.])
fi
SWIG_PYTHON SWIG_PYTHON
_COMPONENTS="$_COMPONENTS python" _COMPONENTS="$_COMPONENTS python"
fi fi

View File

@ -26,6 +26,9 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
if test -z "$python_path" ; then if test -z "$python_path" ; then
AC_MSG_ERROR([cannot find Python include path]) AC_MSG_ERROR([cannot find Python include path])
fi fi
if ! test -f "$python_path/Python.h" ; then
AC_MSG_ERROR([cannot find Python.h in $python_path])
fi
AC_SUBST([PYTHON_CPPFLAGS],[-I$python_path]) AC_SUBST([PYTHON_CPPFLAGS],[-I$python_path])
# Check for Python library path # Check for Python library path