From 7b9099df6bf85ead3575c8c4b98247d8fea4f6af Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 4 Jun 2003 03:03:17 +0000 Subject: [PATCH] stolen from gst-python --- m4/am-check-python-headers.m4 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 m4/am-check-python-headers.m4 diff --git a/m4/am-check-python-headers.m4 b/m4/am-check-python-headers.m4 new file mode 100644 index 0000000..1e0f2b6 --- /dev/null +++ b/m4/am-check-python-headers.m4 @@ -0,0 +1,24 @@ +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_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"` +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_SUBST(PYTHON_INCLUDES) +dnl check if the headers exist: +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +AC_TRY_CPP([#include ],dnl +[AC_MSG_RESULT(found) +$1],dnl +[AC_MSG_RESULT(not found) +$2]) +CPPFLAGS="$save_CPPFLAGS" +]) -- 2.26.2