1
by Anibal Monsalve Salazar
Import upstream version 0.6.5 |
1 |
dnl
|
2 |
dnl local autoconf/automake macros needed for heartbeat |
|
3 |
dnl Started by David Lee <t.d.lee@durham.ac.uk> February 2006 |
|
4 |
dnl
|
|
5 |
dnl License: GNU General Public License (GPL) |
|
6 |
||
7 |
||
8 |
dnl AM_CHECK_PYTHON_HEADERS: Find location of python include files. |
|
9 |
dnl Taken from: |
|
10 |
dnl http://source.macgimp.org/ |
|
11 |
dnl which is GPL and is attributed to James Henstridge. |
|
12 |
dnl
|
|
13 |
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) |
|
14 |
dnl Imports: |
|
15 |
dnl $PYTHON |
|
16 |
dnl Exports: |
|
17 |
dnl PYTHON_INCLUDES |
|
18 |
||
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}" |
|
28 |
fi
|
|
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 |
|
34 |
[AC_MSG_RESULT(found) |
|
35 |
$1],dnl |
|
36 |
[AC_MSG_RESULT(not found) |
|
37 |
$2]) |
|
38 |
CPPFLAGS="$save_CPPFLAGS" |
|
39 |
])
|