diff options
author | Matt Wilson <msw@src.gnome.org> | 2002-06-12 21:44:04 +0000 |
---|---|---|
committer | Matt Wilson <msw@src.gnome.org> | 2002-06-12 21:44:04 +0000 |
commit | 973481e77693aeb7c093425b53a7389781c61908 (patch) | |
tree | 193c8086c8b86f016c6d277e494087da58d51b4b /acinclude.m4 | |
parent | 5aa864cd26b40b845e6aa699421bffd360a33690 (diff) |
2002-06-12 msw added AM_CHECK_PYTHON_HEADERS from pygtk rewrote python
2002-06-12 msw
* acinclude.m4: added AM_CHECK_PYTHON_HEADERS from pygtk
* configure.in: rewrote python checks to be more robust
* python/Makefile.am (CFLAGS): include @PYTHON_INCLUDES@
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..66d11b6 --- /dev/null +++ b/acinclude.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 <Python.h>],dnl +[AC_MSG_RESULT(found) +$1],dnl +[AC_MSG_RESULT(not found) +$2]) +CPPFLAGS="$save_CPPFLAGS" +])
\ No newline at end of file |