[pygobject] Use python-config for libs when available



commit 5737a9ec4bf4d9d07a7e3994d91abf9077b342cc
Author: Alexey Pavlov <alexpux gmail com>
Date:   Tue Aug 5 18:40:53 2014 -0700

    Use python-config for libs when available
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734289

 m4/python.m4 |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/m4/python.m4 b/m4/python.m4
index 47847ab..cf9d5b1 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -73,7 +73,12 @@ AC_MSG_CHECKING(for libraries required to embed python)
 dnl deduce PYTHON_LIBS
 py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
 if test "x$PYTHON_LIBS" = x; then
-       PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}"
+  PYTHON_CONFIG=`which $PYTHON`-config
+  if test -x "$PYTHON_CONFIG"; then
+    PYTHON_LIBS=`$PYTHON_CONFIG --ldflags 2>/dev/null`
+  else
+    PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}"
+  fi
 fi
 if test "x$PYTHON_LIB_LOC" = x; then
        PYTHON_LIB_LOC="${py_prefix}/lib"


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