From 0f923410a4106fc8e2c67ef7515e7f23a344121a Mon Sep 17 00:00:00 2001 From: Joanmarie Diggs Date: Sun, 24 Jun 2012 14:09:23 -0400 Subject: Python3-friendly python.m4 https://bugzilla.gnome.org/show_bug.cgi?id=678728 --- m4/python.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm4/python.m4') diff --git a/m4/python.m4 b/m4/python.m4 index 74ac6ee9..69557b66 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -43,8 +43,8 @@ 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 -py_prefix=`$PYTHON -c "import sys; print sys.prefix"` -py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` +py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"` +py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` if test "x$PYTHON_INCLUDES" == x; then PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" if test "$py_prefix" != "$py_exec_prefix"; then -- cgit v1.2.1 From 46ccb9dfe51372b0fc51c93890088853d0f1617e Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 17 Dec 2012 15:03:48 +0100 Subject: Use python-config instead of assuming include and library paths Call $PYTHON-config to determine include and library paths and linker flags instead of making assumptions about them. Also drop the unused PYTHON_LIB_LOC macro. https://bugzilla.gnome.org/show_bug.cgi?id=690347 --- m4/python.m4 | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'm4/python.m4') diff --git a/m4/python.m4 b/m4/python.m4 index 69557b66..cdd586c4 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -43,14 +43,7 @@ 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 -py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"` -py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` -if test "x$PYTHON_INCLUDES" == x; then - 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 +PYTHON_INCLUDES=`$PYTHON-config --includes` AC_SUBST(PYTHON_INCLUDES) dnl check if the headers exist: save_CPPFLAGS="$CPPFLAGS" @@ -71,13 +64,9 @@ AC_DEFUN([AM_CHECK_PYTHON_LIBS], AC_MSG_CHECKING(for libraries required to link against libpython) dnl deduce PYTHON_LIBS if test "x$PYTHON_LIBS" == x; then - PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}" -fi -if test "x$PYTHON_LIB_LOC" == x; then - PYTHON_LIB_LOC="${py_prefix}/lib" + PYTHON_LIBS=`$PYTHON-config --ldflags --libs` fi AC_SUBST(PYTHON_LIBS) -AC_SUBST(PYTHON_LIB_LOC) dnl check if libpython exist: save_LIBS="$LIBS" LIBS="$LIBS $PYTHON_LIBS" -- cgit v1.2.1 From 82870258bb3e8a284d893ac46a6afc2dd426d49a Mon Sep 17 00:00:00 2001 From: Patrick Welche Date: Sat, 20 Apr 2013 10:29:44 +0100 Subject: test(1) uses '=' to test if strings are identical https://bugzilla.gnome.org/show_bug.cgi?id=698438 --- m4/python.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'm4/python.m4') diff --git a/m4/python.m4 b/m4/python.m4 index cdd586c4..ed5559da 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -63,7 +63,7 @@ AC_DEFUN([AM_CHECK_PYTHON_LIBS], [AC_REQUIRE([AM_CHECK_PYTHON_HEADERS]) AC_MSG_CHECKING(for libraries required to link against libpython) dnl deduce PYTHON_LIBS -if test "x$PYTHON_LIBS" == x; then +if test "x$PYTHON_LIBS" = x; then PYTHON_LIBS=`$PYTHON-config --ldflags --libs` fi AC_SUBST(PYTHON_LIBS) -- cgit v1.2.1