]> granicus.if.org Git - postgis/commitdiff
./configure checks for GDAL Python bindings with built-in NumPy array support (Ticket...
authorMateusz Loskot <mateusz@loskot.net>
Sat, 19 Feb 2011 00:42:52 +0000 (00:42 +0000)
committerMateusz Loskot <mateusz@loskot.net>
Sat, 19 Feb 2011 00:42:52 +0000 (00:42 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@6847 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac

index 4e0152e72d1cef31a0e45c5492428133ece61a8e..94a7f4d1e2ac486d516d60dfbd238dd6ad1b8b99 100644 (file)
@@ -827,9 +827,41 @@ if test "x$RASTER" = "xyes"; then
     dnl Ensure that we are using GDAL >= 1.6.0
     AC_MSG_RESULT([checking GDAL version... $GDAL_FULL_VERSION])
     if test ! "$GDAL_NUMERIC_VERSION" -ge 160; then
-           AC_MSG_ERROR([POSTGIS requires GDAL >= 1.6.0])
+           AC_MSG_ERROR([PostGIS requires GDAL >= 1.6.0])
     fi
 
+       dnl Determine if GDAL Python bindings are available
+       AC_MSG_CHECKING([for GDAL Python bindings])
+       GDAL_PYTHON_TEST='try:
+  from osgeo import gdal
+  print 1
+except ImportError:
+  pass'
+
+       GDAL_PYTHON_FOUND=`python -c "$GDAL_PYTHON_TEST"`
+       if test "$GDAL_PYTHON_FOUND" = "1"; then
+           AC_MSG_RESULT([found])
+       else    
+               AC_MSG_RESULT([not found])
+           AC_MSG_ERROR([GDAL Python bindings required by raster2pgsql.py loader])
+       fi
+
+       dnl Determine if GDAL Python bindings come with NumPy support
+       AC_MSG_CHECKING([for NumPy array support in GDAL Python bindings])
+       GDAL_NUMPY_TEST='try:
+  from osgeo import gdal_array
+  print 1
+except ImportError:
+  pass'
+
+       GDAL_NUMPY_FOUND=`python -c "$GDAL_NUMPY_TEST"`
+       if test "$GDAL_NUMPY_FOUND" = "1"; then
+           AC_MSG_RESULT([found])
+       else    
+               AC_MSG_RESULT([not found])
+           AC_MSG_ERROR([GDAL Python bindings with NumPy array support required by raster2pgsql.py loader])
+       fi
+
     dnl Extract the linker and include flags 
     LIBGDAL_LDFLAGS=`$GDAL_CONFIG --libs`
     LIBGDAL_CFLAGS=`$GDAL_CONFIG --cflags`
@@ -859,7 +891,6 @@ if test "x$RASTER" = "xyes"; then
                     raster/test/regress/Makefile \ 
                     raster/scripts/python/Makefile"
 
-
 else
     BUILD_RASTER=no
     AC_SUBST([BUILD_RASTER])