From acb3076c533d95cc8ecdfa7819096b6bf47e98f9 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 9 Apr 2013 23:00:51 +0000 Subject: [PATCH] [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 --- configure.ac | 17 ++++++++--------- macros/ac_python_devel.m4 | 3 +++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 9793c5ce6b..546a903e19 100644 --- a/configure.ac +++ b/configure.ac @@ -1048,17 +1048,16 @@ AC_ARG_ENABLE(python, ) if test x${enable_python} = "xtrue" then - # Check for Python. We require python-2.4 because our implementation - # doesn't run with earlier version anymore. Building Python from - # source creates python.pc, Debian installs python2.pc, and Fedora - # 17 makes both. - 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!]) + # Check for Python. We require python-2.4 + + AM_PATH_PYTHON(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') + 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 _COMPONENTS="$_COMPONENTS python" fi diff --git a/macros/ac_python_devel.m4 b/macros/ac_python_devel.m4 index 8d966f94dd..fbba007dea 100644 --- a/macros/ac_python_devel.m4 +++ b/macros/ac_python_devel.m4 @@ -26,6 +26,9 @@ AC_DEFUN([AC_PYTHON_DEVEL],[ if test -z "$python_path" ; then AC_MSG_ERROR([cannot find Python include path]) 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]) # Check for Python library path