diff options
author | Simon McVittie <smcv@collabora.com> | 2017-11-01 16:46:56 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2017-11-01 16:46:56 +0000 |
commit | 41b48993e003a25a30b73bc8dd0be1a2f2493c4b (patch) | |
tree | 9b56bd5635908c125a1d366d532f9b28bb13acb9 /m4 | |
parent | ba61efead30ff0f6649060d67f0f193976bc97d4 (diff) |
build: Use AX_PYTHON_DEVEL to find Python
This avoids needing our own increasingly elaborate code to find the
python-config executable corresponding to our python executable.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'm4')
-rw-r--r-- | m4/am-check-python-headers.m4 | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/m4/am-check-python-headers.m4 b/m4/am-check-python-headers.m4 deleted file mode 100644 index c903920..0000000 --- a/m4/am-check-python-headers.m4 +++ /dev/null @@ -1,57 +0,0 @@ -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 -AC_DEFUN([AM_CHECK_PYTHON_HEADERS], -[AC_REQUIRE([AM_PATH_PYTHON]) - -AC_ARG_VAR([PYTHON_CONFIG], [python-config executable]) -AS_IF( - [test "${PYTHON_CONFIG+set}" = set], - [AC_MSG_NOTICE([PYTHON_CONFIG overridden to: $PYTHON_CONFIG])], - [test -x "${PYTHON}-config"], - [ - PYTHON_CONFIG="${PYTHON}-config" - AC_MSG_NOTICE([Using \$PYTHON-config: $PYTHON_CONFIG]) - ], - dnl else - [ - AC_PATH_PROGS([PYTHON_CONFIG], [python${PYTHON_VERSION}-config python-config], [no]) - AS_IF([test "${PYTHON_CONFIG}" = "no"], - [AC_MSG_ERROR([cannot find python${PYTHON_VERSION}-config or python-config in PATH])]) - ]) - -AC_ARG_VAR([PYTHON_INCLUDES], [CPPFLAGS for Python, overriding output of python2.x-config --includes, e.g. "-I/opt/misc/include/python2.7"]) - -if test "${PYTHON_INCLUDES+set}" = set; then - AC_MSG_NOTICE([PYTHON_INCLUDES overridden to: $PYTHON_INCLUDES]) -else - dnl deduce PYTHON_INCLUDES - AC_MSG_CHECKING(for Python headers using $PYTHON_CONFIG --includes) - PYTHON_INCLUDES=`$PYTHON_CONFIG --includes` - if test $? = 0; then - AC_MSG_RESULT($PYTHON_INCLUDES) - else - AC_MSG_RESULT([failed, will try another way]) - py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"` - py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` - AC_MSG_CHECKING(for Python headers in $py_prefix and $py_exec_prefix) - 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 - AC_MSG_RESULT($PYTHON_INCLUDES) - fi -fi - -AC_MSG_CHECKING(whether those headers are sufficient) -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(yes) -$1],dnl -[AC_MSG_RESULT(no) -$2]) -CPPFLAGS="$save_CPPFLAGS" -]) |