/pidgin/main: a591c0486b04: Use python-config to find Python hea...

Elliott Sales de Andrade qulogic at pidgin.im
Thu Feb 13 20:33:57 EST 2014


Changeset: a591c0486b041e029075e12b446430cf32b27d24
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2014-02-13 20:22 -0500
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/a591c0486b04

Description:

Use python-config to find Python headers and libraries.

The current method does not work with Python 3 in Fedora, as the
binary, headers, and libraries are suffixed with '3.3m'. The current
test checks the internal version of Python and see '3.3.2' -> '3.3'.

diffstat:

 configure.ac |  22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

diffs (36 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1515,27 +1515,15 @@ dnl Check for Python headers (currently 
 dnl (Thanks to XChat)
 if test "x$enable_consoleui" = "xyes" -a ! -z "$PYTHON" -a x"$PYTHON" != x"no" ; then
 	AC_MSG_CHECKING(for Python compile flags)
-	PY_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.prefix)'`
-	PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.exec_prefix)'`
-	changequote(<<, >>)dnl
-	PY_VERSION=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:3])'`
-	PY_MAJOR=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:2])'`
-	changequote([, ])dnl
-	if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
-		AC_MSG_RESULT()
-		AC_CHECK_LIB(pthread, pthread_create, )
-		AC_CHECK_LIB(util, openpty, )
-		AC_CHECK_LIB(db, dbopen, )
-		PY_LIBS="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config -lpython$PY_VERSION"
-		PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
+	if test -f ${PYTHON}-config; then
+		PY_CFLAGS=`${PYTHON}-config --includes`
+		PY_LIBS=`${PYTHON}-config --libs`
 		AC_DEFINE(USE_PYTHON, [1], [Define if python headers are available.])
-		dnl Because the above AC_CHECK_LIB get in the way...
-		AC_MSG_CHECKING(for Python compile flags)
 		AC_MSG_RESULT(ok)
 	else
-		AC_MSG_RESULT([Can't find Python.h])
+		AC_MSG_RESULT([Cannot find ${PYTHON}-config])
+		PY_CFLAGS=""
 		PY_LIBS=""
-		PY_CFLAGS=""
 	fi
 fi
 AC_SUBST(PY_CFLAGS)



More information about the Commits mailing list