From: Mateusz Loskot Date: Sat, 19 Feb 2011 00:42:52 +0000 (+0000) Subject: ./configure checks for GDAL Python bindings with built-in NumPy array support (Ticket... X-Git-Tag: 2.0.0alpha1~1953 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5126c12a59763644c21308f62df784e7d72914a8;p=postgis ./configure checks for GDAL Python bindings with built-in NumPy array support (Ticket #838) git-svn-id: http://svn.osgeo.org/postgis/trunk@6847 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/configure.ac b/configure.ac index 4e0152e72..94a7f4d1e 100644 --- a/configure.ac +++ b/configure.ac @@ -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])