summaryrefslogtreecommitdiff
path: root/m4/python.m4
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:35:42 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:35:43 +0900
commitee96b8b4ed303ec374e37237f86555754cf2ae60 (patch)
tree6ad8344f0cf7f15b105be722ca87f77f16ee4c31 /m4/python.m4
parentf29005349e245e146d416b2dc7a8f8a89a2e8a61 (diff)
downloadpygobject2-ee96b8b4ed303ec374e37237f86555754cf2ae60.tar.gz
pygobject2-ee96b8b4ed303ec374e37237f86555754cf2ae60.tar.bz2
pygobject2-ee96b8b4ed303ec374e37237f86555754cf2ae60.zip
Imported Upstream version 2.27.90
Change-Id: I23ecc791685b18ea66500f2af94287da6bec1436 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'm4/python.m4')
-rw-r--r--m4/python.m443
1 files changed, 9 insertions, 34 deletions
diff --git a/m4/python.m4 b/m4/python.m4
index 372627b..4f98ad7 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -38,22 +38,26 @@ fi
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
-dnl function also defines PYTHON_INCLUDES
+dnl function also defines PYTHON_INCLUDES and PYTHON_LIBS
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
-dnl deduce PYTHON_INCLUDES
+dnl deduce PYTHON_INCLUDES and PYTHON_LIBS
py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`
-if test -x "$PYTHON-config"; then
-PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
+PYTHON_CONFIG=`which $PYTHON`-config
+if test -x "$PYTHON_CONFIG"; then
+PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null`
+PYTHON_LIBS=`$PYTHON_CONFIG --libs 2>/dev/null`
else
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+PYTHON_LIBS="-lpython${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
->fi
+fi
fi
AC_SUBST(PYTHON_INCLUDES)
+AC_SUBST(PYTHON_LIBS)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
@@ -226,32 +230,3 @@ python2.1 python2.0])
fi
])
-
-dnl a macro to check for ability to create python extensions
-dnl JD_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
-dnl function also defines PYTHON_INCLUDES
-AC_DEFUN([JD_CHECK_PYTHON_HEADERS],
-[AC_REQUIRE([AM_PATH_PYTHON])
-AC_MSG_CHECKING(for headers required to compile python extensions)
-dnl deduce PYTHON_INCLUDES
-py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
-py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`
-if test -x "$PYTHON-config"; then
-PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
-else
-PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
-if test "$py_prefix" != "$py_exec_prefix"; then
- PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
-fi
-fi
-AC_SUBST(PYTHON_INCLUDES)
-dnl check if the headers exist:
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
-AC_TRY_CPP([#include <Python.h>],dnl
-[AC_MSG_RESULT(found)
-$1],dnl
-[AC_MSG_RESULT(not found)
-$2])
-CPPFLAGS="$save_CPPFLAGS"
-])