[cig-commits] r9168 - cs/benchmark/cigma/trunk/build/m4
luis at geodynamics.org
luis at geodynamics.org
Mon Jan 28 23:37:09 PST 2008
Author: luis
Date: 2008-01-28 23:37:09 -0800 (Mon, 28 Jan 2008)
New Revision: 9168
Added:
cs/benchmark/cigma/trunk/build/m4/cigma_python.m4
Log:
Autoconf macros for setting Python and Numpy include directories
Added: cs/benchmark/cigma/trunk/build/m4/cigma_python.m4
===================================================================
--- cs/benchmark/cigma/trunk/build/m4/cigma_python.m4 (rev 0)
+++ cs/benchmark/cigma/trunk/build/m4/cigma_python.m4 2008-01-29 07:37:09 UTC (rev 9168)
@@ -0,0 +1,41 @@
+##############################################################################
+# -*- Autoconf -*-
+#
+#
+
+##############################################################################
+#
+# CIGMA_PYTHON_INCDIR
+#
+# Determine the directory containing <Python.h>
+#
+AC_DEFUN([CIGMA_PYTHON_INCDIR],[
+
+ AC_REQUIRE([AM_PATH_PYTHON])
+
+ AC_CACHE_CHECK([for $am_display_PYTHON include directory],
+ [PYTHON_INCDIR],
+ [PYTHON_INCDIR=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()" 2>/dev/null
+ || echo "$PYTHON_PREFIX/include/python$PYTHON_VERSION"`])
+
+ AC_MSG_CHECKING([for $am_display_PYTHON numpy include directory])
+
+ NUMPY_INCDIR=`$PYTHON -c "import numpy; print numpy.get_include()" 2>/dev/null`
+ if [[ -n "$PYTHON_NUMPY_INCDIR" ]]; then
+ AC_CHECK_FILE([$NUMPY_INCDIR/numpy/arrayobject.h], [numpyFound="OK"])
+ if [[ -z "$numpyFound" ]]; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ fi
+
+ AC_SUBST([PYTHON_INCDIR], [$PYTHON_INCDIR])
+ AC_SUBST([NUMPY_INCDIR], [$NUMPY_INCDIR])
+
+])
+
+
+# vim: syntax=config
More information about the cig-commits
mailing list