[farsight2/master] Add python headers check from gst-python

Olivier Crête olivier.crete at collabora.co.uk
Fri Feb 13 14:11:42 PST 2009


---
 acinclude.m4                  |   30 ------------------------------
 autogen.sh                    |    2 +-
 m4/as-check-python-headers.m4 |   30 ++++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 31 deletions(-)
 delete mode 100644 acinclude.m4
 create mode 100644 m4/as-check-python-headers.m4

diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644
index 585455f..0000000
--- a/acinclude.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-dnl Copy pasted from gst-python's acinclude.m4 file
-
-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"`
-if $PYTHON-config --help 2>/dev/null; then
-  PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
-else
-  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
-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"
-])
diff --git a/autogen.sh b/autogen.sh
index 54e9ba0..5cef8fe 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -58,7 +58,7 @@ toplevel_check $srcfile
 
 # aclocal
 if test -f acinclude.m4; then rm acinclude.m4; fi
-tool_run "$aclocal" "-I common/m4 $ACLOCAL_FLAGS"
+tool_run "$aclocal" "-I common/m4 -I m4 $ACLOCAL_FLAGS"
 
 tool_run "$libtoolize" "--copy --force"
 tool_run "$autoheader"
diff --git a/m4/as-check-python-headers.m4 b/m4/as-check-python-headers.m4
new file mode 100644
index 0000000..585455f
--- /dev/null
+++ b/m4/as-check-python-headers.m4
@@ -0,0 +1,30 @@
+dnl Copy pasted from gst-python's acinclude.m4 file
+
+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"`
+if $PYTHON-config --help 2>/dev/null; then
+  PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
+else
+  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
+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"
+])
-- 
1.5.6.5




More information about the farsight-commits mailing list