1 dnl a macro to check for ability to create python extensions
2 dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
3 dnl function also defines PYTHON_INCLUDES
4 AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
5 [AC_REQUIRE([AM_PATH_PYTHON])
6 AC_MSG_CHECKING(for headers required to compile python extensions)
7 dnl deduce PYTHON_INCLUDES
8 py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
9 py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
10 PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
11 AC_SUBST(PYTHON_INCLUDES)
12 dnl check if the headers exist:
13 save_CPPFLAGS="$CPPFLAGS"
14 CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
15 AC_TRY_CPP([#include <Python.h>],dnl
18 [AC_MSG_RESULT(not found)
20 CPPFLAGS="$save_CPPFLAGS"