Author: astitcher
Date: Wed Apr 11 22:23:16 2012
New Revision: 1325043

URL: http://svn.apache.org/viewvc?rev=1325043&view=rev
Log:
QPID-3944: Autotools build system doesn't correctly detect python developer 
libraries

Modified:
    qpid/trunk/qpid/cpp/configure.ac

Modified: qpid/trunk/qpid/cpp/configure.ac
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/configure.ac?rev=1325043&r1=1325042&r2=1325043&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/configure.ac (original)
+++ qpid/trunk/qpid/cpp/configure.ac Wed Apr 11 22:23:16 2012
@@ -203,13 +203,26 @@ AM_CONDITIONAL([HAVE_RUBY_DEVEL], [test 
 # 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],[NS
 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])



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to