Преглед изворни кода

Revert https://trac.osgeo.org/grass/changeset/38872 (re-instate https://trac.osgeo.org/grass/changeset/38867)
Fixes to work with GEOS 2.x


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38878 15284696-431f-4ddb-bdfa-cd5b030d7da7

Glynn Clements пре 15 година
родитељ
комит
bffe7d50e6
4 измењених фајлова са 12 додато и 9 уклоњено
  1. 7 7
      configure
  2. 1 1
      configure.in
  3. 4 0
      include/vector.h
  4. 0 1
      lib/vector/Vlib/geos.c

+ 7 - 7
configure

@@ -7740,22 +7740,22 @@ ac_save_ldflags="$LDFLAGS"
 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 @@ LIBS="$ac_save_LIBS"
 
 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
 

+ 1 - 1
configure.in

@@ -761,7 +761,7 @@ else
   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
 

+ 4 - 0
include/vector.h

@@ -5,6 +5,10 @@
 
 #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 --- */

+ 0 - 1
lib/vector/Vlib/geos.c

@@ -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 *);