summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2012-04-12 20:13:46 +0000
committerAndrew Stitcher <astitcher@apache.org>2012-04-12 20:13:46 +0000
commitfc0ffad8d3a005ad3e85dc315e435479d9ae5e4a (patch)
tree227cb57374752001e31c6f30b731209ec0fdbd9c
parent4571ef7d9bdcdbdcbb09a0bae6558d0dd9600a43 (diff)
downloadqpid-python-fc0ffad8d3a005ad3e85dc315e435479d9ae5e4a.tar.gz
QPID-3944: Autotools build system doesn't correctly detect python developer libraries
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.16@1325486 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/configure.ac17
1 files changed, 14 insertions, 3 deletions
diff --git a/qpid/cpp/configure.ac b/qpid/cpp/configure.ac
index 6ba5f62f0e..f3fa5097d0 100644
--- a/qpid/cpp/configure.ac
+++ b/qpid/cpp/configure.ac
@@ -203,13 +203,26 @@ AM_CONDITIONAL([HAVE_RUBY_DEVEL], [test -f $RUBY_INC/ruby.h && test -n "$SWIG"])
# Python bindings: To build python wrappers, the python-devel files must be present.
AM_PATH_PYTHON()
AS_IF([test -n "$PYTHON"], [
- PKG_CHECK_MODULES([PYTHON], [python], [have_python_dev=yes],[
+ PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], [have_python_dev=yes],[
+ # We didn't find pkg-config information for python-2.7 this
+ # may mean we have an earlier python version:
+ # Try to find the include and library files directly in the default
+ # location
+ AC_MSG_WARN([Didn't find Python 2.7 developer libs - looking for older version])
+ PYTHON_INC=$($PYTHON -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()')
+ AC_CHECK_LIB([python$PYTHON_VERSION],[Py_Initialize])
+ AC_CHECK_FILE(["$PYTHON_INC/Python.h"],[
+ PYTHON_CFLAGS="-I$PYTHON_INC"
+ PYTHON_LIBS="-lpython$PYTHON_VERSION"
+ have_python_dev=yes
+ ],[
if test yes = "$with_python" ; then
AC_MSG_ERROR([Couldn't find Python developer libs - you probably need to install a python-dev or python-devel package])
else
AC_MSG_WARN([Couldn't find Python developer libs - you probably don't have a python-dev or python-devel package installed])
fi
])
+ ])
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LIBS)
])
@@ -524,8 +537,6 @@ AC_CHECK_LIB([nsl],[getipnodebyname],[NSL_LIB="-lnsl"],[NSL_LIB=""],[])
SOCKLIBS="$SOCKET_LIB $NSL_LIB"
AC_SUBST([SOCKLIBS])
-AM_PATH_PYTHON()
-
# Used by env scripts to find libraries in cmake or autoconf builds.
builddir_lib_suffix="/.libs"
AC_SUBST([builddir_lib_suffix])