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 | bbda9004d532dc5f5f18553edf43456161a186db (patch) | |
tree | c066d6166502d93edf63af81304b9c6f9ba14b61 | |
parent | e6a2c4ab940a0b6b9b5d136beb7759340e1b325e (diff) | |
download | qpid-python-bbda9004d532dc5f5f18553edf43456161a186db.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/qpid@1325043 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/configure.ac | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/cpp/configure.ac b/cpp/configure.ac index 6ba5f62f0e..f3fa5097d0 100644 --- a/cpp/configure.ac +++ b/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]) |