2
dnl local autoconf/automake macros needed for heartbeat
3
dnl Started by David Lee <t.d.lee@durham.ac.uk> February 2006
5
dnl License: GNU General Public License (GPL)
8
dnl AM_CHECK_PYTHON_HEADERS: Find location of python include files.
10
dnl http://source.macgimp.org/
11
dnl which is GPL and is attributed to James Henstridge.
13
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
19
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
20
[AC_REQUIRE([AM_PATH_PYTHON])
21
AC_MSG_CHECKING(for headers required to compile python extensions)
22
dnl deduce PYTHON_INCLUDES
23
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
24
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
25
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
26
if test "$py_prefix" != "$py_exec_prefix"; then
27
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
29
AC_SUBST(PYTHON_INCLUDES)
30
dnl check if the headers exist:
31
save_CPPFLAGS="$CPPFLAGS"
32
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
33
AC_TRY_CPP([#include <Python.h>],dnl
36
[AC_MSG_RESULT(not found)
38
CPPFLAGS="$save_CPPFLAGS"