[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] m4/python: fix checks for Python library support



commit 3b54cd773d2d04b351ef92f7a994509c99c63a58
Author:     Doug Goldstein <cardoe@xxxxxxxxxx>
AuthorDate: Thu Feb 18 20:57:04 2016 -0600
Commit:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CommitDate: Tue Mar 1 18:05:19 2016 +0000

    m4/python: fix checks for Python library support
    
    AC_CHECK_LIB() was running gcc -Llib -lm -lutils conftest.c which on
    platforms that do as needed operations by default will result in
    underlinking. Instead AC_CHECK_LIB() suggests supplying the extra
    libraries necessary in a 5th argument.
    
    Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 m4/python_devel.m4 | 8 +++++---
 tools/configure    | 7 ++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/m4/python_devel.m4 b/m4/python_devel.m4
index deff19e..05ea4ef 100644
--- a/m4/python_devel.m4
+++ b/m4/python_devel.m4
@@ -10,9 +10,9 @@ AS_IF([test x"$pyconfig" = x"no"], [
         print "-I" + distutils.sysconfig.get_config_var("INCLUDEPY")'`"
     CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print distutils.sysconfig.get_config_var("CFLAGS")'`"
-    LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
+    PYTHON_LIBS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print distutils.sysconfig.get_config_var("LIBS")'`"
-    LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
+    PYTHON_LIBS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print distutils.sysconfig.get_config_var("SYSLIBS")'`"
     LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print "-L" + distutils.sysconfig.get_python_lib(plat_specific=1,\
@@ -25,12 +25,14 @@ AS_IF([test x"$pyconfig" = x"no"], [
     dnl If python-config is found use it
     CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`"
     LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags`"
+    PYTHON_LIBS="$LIBS `$PYTHON-config --libs`"
 ])
 
 AC_CHECK_HEADER([Python.h], [],
     [AC_MSG_ERROR([Unable to find Python development headers])],)
 AC_CHECK_LIB(python$ac_python_version, PyArg_ParseTuple, [],
-    [AC_MSG_ERROR([Unable to find a suitable python development library])])
+    [AC_MSG_ERROR([Unable to find a suitable python development library])],
+    [$PYTHON_LIBS])
 CPPFLAGS=$ac_previous_cppflags
 LDFLAGS=$ac_previous_ldflags
 ])
diff --git a/tools/configure b/tools/configure
index a3cf063..ee6c33f 100755
--- a/tools/configure
+++ b/tools/configure
@@ -7285,9 +7285,9 @@ if test x"$pyconfig" = x"no"; then :
         print "-I" + distutils.sysconfig.get_config_var("INCLUDEPY")'`"
     CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print distutils.sysconfig.get_config_var("CFLAGS")'`"
-    LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
+    PYTHON_LIBS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print distutils.sysconfig.get_config_var("LIBS")'`"
-    LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
+    PYTHON_LIBS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print distutils.sysconfig.get_config_var("SYSLIBS")'`"
     LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print "-L" + distutils.sysconfig.get_python_lib(plat_specific=1,\
@@ -7301,6 +7301,7 @@ else
 
         CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`"
     LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags`"
+    PYTHON_LIBS="$LIBS `$PYTHON-config --libs`"
 
 fi
 
@@ -7319,7 +7320,7 @@ if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpython$ac_python_version  $LIBS"
+LIBS="-lpython$ac_python_version $PYTHON_LIBS $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.