summaryrefslogtreecommitdiff
blob: e3b6d221fa6e9445cc4aabfa8fc1515080075c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff -Nu gdl-0.9.orig/configure.in gdl-0.9/configure.in
--- gdl-0.9.orig/configure.in	2010-10-05 17:45:00.000000000 +0100
+++ gdl-0.9/configure.in	2010-12-21 18:17:14.000000000 +0000
@@ -693,7 +693,7 @@
 	[with_python="$withval" ])
 
 if test "x$with_python" != "xno"; then
-
+   AM_PATH_PYTHON
   dnl  PYTHON_VERSION="2.3"
   AC_ARG_ENABLE(python_version,	
  	[  --enable-python_version set explicit python version to use (eg. 2.4)],
@@ -724,7 +724,6 @@
 dnl    LIBS="$LIBS -lpython2.3"
     PYTHON_INCLUDES="/usr/include/python$PYTHON_VERSION"
   fi
-  INCLUDES="$INCLUDES -I$PYTHON_INCLUDES"
 
   AC_CHECK_LIB(python$PYTHON_VERSION, Py_Initialize, 
   [AC_DEFINE([USE_PYTHON],[1],[Define if you want to use python])], 
@@ -752,17 +751,21 @@
     exit -1
   ])
 
-  OLDCXXFLAGS=$CXXFLAGS
-  CXXFLAGS="$CXXFLAGS -I$PYTHON_INCLUDES"
-  AC_CHECK_HEADER($PYTHON_INCLUDES/numarray/libnumarray.h, [], [
+  OLDCPPFLAGS=$CPPFLAGS
+  AC_MSG_CHECKING([for Numpy include directory])
+  pinc=`echo "import numpy; print numpy.get_include()" | $PYTHON - 2>/dev/null`
+  AC_MSG_RESULT([${pinc:-unknown}])
+  test -n "$pinc" && PYTHON_INCLUDES="-I$PYTHON_INCLUDES -I$pinc"
+  CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+  AC_CHECK_HEADER([numpy/arrayobject.h], [], [
     echo ""
-    echo "Error! Python numarray package was not found"
+    echo "Error! Python numpy package was not found"
     echo "  Use --with-python=no to disable Python support"
     exit -1
   ], [#include <Python.h>])
-  CXXFLAGS=$OLDCXXFLAGS
-  unset OLDCXXFLAGS
-
+  CPPFLAGS=$OLDCPPFLAGS
+  unset OLDCPPFLAGS
+  INCLUDES="$INCLUDES $PYTHON_INCLUDES"
 fi
 
 dnl == UDUNITS-2 ===========================================