[GRASS-SVN] r38878 - in grass/trunk: . include lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 26 16:18:09 EDT 2009


Author: glynn
Date: 2009-08-26 16:18:08 -0400 (Wed, 26 Aug 2009)
New Revision: 38878

Modified:
   grass/trunk/configure
   grass/trunk/configure.in
   grass/trunk/include/vector.h
   grass/trunk/lib/vector/Vlib/geos.c
Log:
Revert r38872 (re-instate r38867)
Fixes to work with GEOS 2.x


Modified: grass/trunk/configure
===================================================================
--- grass/trunk/configure	2009-08-26 18:26:58 UTC (rev 38877)
+++ grass/trunk/configure	2009-08-26 20:18:08 UTC (rev 38878)
@@ -7740,22 +7740,22 @@
 LDFLAGS="$GEOS_LIBS $LDFLAGS"
 
 
-echo $ac_n "checking for GEOSGeom_createLinearRing in -lgeos""... $ac_c" 1>&6
-echo "configure:7745: checking for GEOSGeom_createLinearRing in -lgeos" >&5
-ac_lib_var=`echo geos'_'GEOSGeom_createLinearRing | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for initGEOS in -lgeos_c""... $ac_c" 1>&6
+echo "configure:7745: checking for initGEOS in -lgeos_c" >&5
+ac_lib_var=`echo geos_c'_'initGEOS | sed 'y%./+-%__p_%'`
 
 ac_save_LIBS="$LIBS"
-LIBS="-lgeos  $LIBS"
+LIBS="-lgeos_c  $LIBS"
 cat > conftest.$ac_ext <<EOF
 #line 7751 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char GEOSGeom_createLinearRing();
+char initGEOS();
 
 int main() {
-GEOSGeom_createLinearRing()
+initGEOS()
 ; return 0; }
 EOF
 if { (eval echo configure:7762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
@@ -7772,7 +7772,7 @@
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  GEOS_LIBS="$GEOS_LIBS -lgeos "
+  GEOS_LIBS="$GEOS_LIBS -lgeos_c "
 else
   echo "$ac_t""no" 1>&6
 

Modified: grass/trunk/configure.in
===================================================================
--- grass/trunk/configure.in	2009-08-26 18:26:58 UTC (rev 38877)
+++ grass/trunk/configure.in	2009-08-26 20:18:08 UTC (rev 38878)
@@ -761,7 +761,7 @@
   fi
   
   LOC_CHECK_INCLUDES(geos_c.h,GEOS,$GEOS_CFLAGS)
-  LOC_CHECK_LIBS(geos,GEOSGeom_createLinearRing,GEOS,$GEOS_LIBS,GEOS_LIBS)
+  LOC_CHECK_LIBS(geos_c,initGEOS,GEOS,$GEOS_LIBS,GEOS_LIBS)
   AC_DEFINE(HAVE_GEOS)
 fi
 

Modified: grass/trunk/include/vector.h
===================================================================
--- grass/trunk/include/vector.h	2009-08-26 18:26:58 UTC (rev 38877)
+++ grass/trunk/include/vector.h	2009-08-26 20:18:08 UTC (rev 38878)
@@ -5,7 +5,11 @@
 
 #ifdef HAVE_GEOS
 #include <geos_c.h>
+#if GEOS_VERSION_MAJOR < 3
+typedef struct GEOSGeom_t GEOSGeometry;
+typedef struct GEOSCoordSeq_t GEOSCoordSequence;
 #endif
+#endif
 
 /* --- ANSI prototypes for the lib/vector/Vlib functions --- */
 

Modified: grass/trunk/lib/vector/Vlib/geos.c
===================================================================
--- grass/trunk/lib/vector/Vlib/geos.c	2009-08-26 18:26:58 UTC (rev 38877)
+++ grass/trunk/lib/vector/Vlib/geos.c	2009-08-26 20:18:08 UTC (rev 38878)
@@ -19,7 +19,6 @@
 #include <grass/glocale.h>
 
 #ifdef HAVE_GEOS
-#include <geos_c.h>
 
 static GEOSGeometry *Vect__read_line_geos(struct Map_info *, long, int *);
 static GEOSCoordSequence *V1_read_line_geos(struct Map_info *, long, int *);



More information about the grass-commit mailing list