This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch experimental
in repository gdal-grass.

commit 0a83d0c3b21079a9ad7277e75c7f930fffcf6302
Author: Bas Couwenberg <sebas...@xs4all.nl>
Date:   Sat Feb 21 21:10:55 2015 +0100

    Add patch by Martin Landa to improve GRASS version detection.
---
 debian/changelog                |  1 +
 debian/patches/grass7-configure | 56 +++++++++++++++++++++++++++++++++++++++++
 debian/patches/series           |  1 +
 3 files changed, 58 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6b44365..e6ae377 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ libgdal-grass (1.11.2-1~exp2) UNRELEASED; urgency=medium
 
   * Bump minimum GRASS version to 7.0.0.
   * Update patches for GRASS 7.0.0.
+  * Add patch by Martin Landa to improve GRASS version detection.
 
  -- Bas Couwenberg <sebas...@debian.org>  Fri, 20 Feb 2015 22:31:25 +0100
 
diff --git a/debian/patches/grass7-configure b/debian/patches/grass7-configure
new file mode 100644
index 0000000..9490139
--- /dev/null
+++ b/debian/patches/grass7-configure
@@ -0,0 +1,56 @@
+Description: Improve GRASS version detection.
+Origin: 
http://trac.osgeo.org/gdal/attachment/ticket/5852/gdal-grass-configure.patch
+Bug: http://trac.osgeo.org/gdal/ticket/5852
+Author: Marin Landa <landa.mar...@gmail.com>
+
+--- a/configure.in
++++ b/configure.in
+@@ -123,31 +123,26 @@ fi
+ 
+ if test "$with_grass" != "yes" ; then
+ 
+-  
AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib
 -lgrass_I -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime 
-lgrass_gproj -lgrass_vect -lgrass_dbmibase -lgrass_dbmiclient -lgrass_dgl 
-lgrass_dig2 -lgrass_rtree -lgrass_linkm)
+-   
+-  if test "$GRASS_SETTING" = "grass57+" ; then   
+-    LIBS="-L$with_grass/lib -lgrass_I -lgrass_vask -lgrass_gmath -lgrass_gis 
-lgrass_datetime -lgrass_gproj -lgrass_vect -lgrass_dbmibase -lgrass_dbmiclient 
-lgrass_dgl -lgrass_dig2 -lgrass_rtree -lgrass_linkm $LIBS"
+-    GRASS_INCLUDE="-I$with_grass/include"
+-    GRASS_GISBASE="$with_grass"
+-  else
++  
AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,-L$with_grass/lib
 -lgrass_datetime)
++  if test "$GRASS_SETTING" = "no" ; then
++    
AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib
 -lgrass_datetime)
++  fi
+ 
+-    # Check for GRASS >= 7.0 (SVN)
+-    
AC_CHECK_LIB(grass_gis.7.0.svn,G_putenv,GRASS_SETTING=grass7+,GRASS_SETTING=no,-L$with_grass/lib
 -lgrass_raster.7.0.svn -lgrass_gmath.7.0.svn -lgrass_gis.7.0.svn 
-lgrass_datetime.7.0.svn -lgrass_gproj.7.0.svn -lgrass_vector.7.0.svn 
-lgrass_dbmibase.7.0.svn -lgrass_dbmiclient.7.0.svn -lgrass_dgl.7.0.svn 
-lgrass_dig2.7.0.svn -lgrass_rtree.7.0.svn -lgrass_linkm.7.0.svn 
-lgrass_btree2.7.0.svn -lgrass_ccmath.7.0.svn)
+-    if test "$GRASS_SETTING" = "grass7+" ; then
+-        LIBS="-L$with_grass/lib -lgrass_raster.7.0.svn -lgrass_gmath.7.0.svn 
-lgrass_gis.7.0.svn -lgrass_datetime.7.0.svn -lgrass_gproj.7.0.svn 
-lgrass_vector.7.0.svn -lgrass_dbmibase.7.0.svn -lgrass_dbmiclient.7.0.svn 
-lgrass_dgl.7.0.svn -lgrass_dig2.7.0.svn -lgrass_rtree.7.0.svn 
-lgrass_linkm.7.0.svn -lgrass_btree2.7.0.svn -lgrass_ccmath.7.0.svn $LIBS"
+-        GRASS_INCLUDE="-I$with_grass/include"
+-        GRASS_GISBASE="$with_grass"
++  if test "$GRASS_SETTING" != "no" ; then
++    if test "$GRASS_SETTING" = "grass70+" ; then
++      G_RASTLIBS="-lgrass_raster -lgrass_imagery"
++      G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree 
-lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
++      LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj 
-lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
+     else
+-        # Check for GRASS 7.0.0
+-        
AC_CHECK_LIB(grass_gis.7.0.0,G_putenv,GRASS_SETTING=grass7+,GRASS_SETTING=no,-L$with_grass/lib
 -lgrass_raster.7.0.0 -lgrass_gmath.7.0.0 -lgrass_gis.7.0.0 
-lgrass_datetime.7.0.0 -lgrass_gproj.7.0.0 -lgrass_vector.7.0.0 
-lgrass_dbmibase.7.0.0 -lgrass_dbmiclient.7.0.0 -lgrass_dgl.7.0.0 
-lgrass_dig2.7.0.0 -lgrass_rtree.7.0.0 -lgrass_linkm.7.0.0 -lgrass_btree2.7.0.0 
-lgrass_ccmath.7.0.0)
+-        if test "$GRASS_SETTING" = "grass7+" ; then
+-            LIBS="-L$with_grass/lib -lgrass_raster.7.0.0 -lgrass_gmath.7.0.0 
-lgrass_gis.7.0.0 -lgrass_datetime.7.0.0 -lgrass_gproj.7.0.0 
-lgrass_vector.7.0.0 -lgrass_dbmibase.7.0.0 -lgrass_dbmiclient.7.0.0 
-lgrass_dgl.7.0.0 -lgrass_dig2.7.0.0 -lgrass_rtree.7.0.0 -lgrass_linkm.7.0.0 
-lgrass_btree2.7.0.0 -lgrass_ccmath.7.0.0 $LIBS"
+-            GRASS_INCLUDE="-I$with_grass/include"
+-            GRASS_GISBASE="$with_grass"
+-        else
+-            AC_MSG_ERROR([--with-grass=$with_grass requested, but libraries 
not found!  Perhaps you need to set LD_LIBRARY_PATH to include 
$with_grass/lib?])
+-        fi
++      G_RASTLIBS="-lgrass_I"
++      G_VECTLIBS="-lgrass_vect -lgrass_dig2 -lgrass_dgl -lgrass_rtree 
-lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
++      LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj 
-lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
+     fi
++    GRASS_INCLUDE="-I$with_grass/include"
++    GRASS_GISBASE="$with_grass"
++    HAVE_GRASS=yes
++  else
++    AC_MSG_ERROR([--with-grass=$with_grass requested, but libraries not 
found!])
+   fi
+ fi
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 2e4bf28..07c2d2f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ hardening
 environment-typo
 grass7
 libpq
+grass7-configure

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-grass/gdal-grass.git

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to