diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2012-04-11 22:23:16 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2012-04-11 22:23:16 +0000 |
| commit | c052ece2e23a226bfc713e5137f1e71ec4f2f90d (patch) | |
| tree | 0eae4cce226a9798cd46e2604a07b4d9f6aef6c1 /qpid/cpp | |
| parent | 69cb4e61feda8e194cf7f1f65811e45d9e0ecbf3 (diff) | |
| download | qpid-python-c052ece2e23a226bfc713e5137f1e71ec4f2f90d.tar.gz | |
QPID-3944: Autotools build system doesn't correctly detect python developer libraries
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1325043 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/configure.ac | 17 |
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]) |
