Use system shapelib
authorJochen Sprickerhof <git@jochen.sprickerhof.de>
Thu, 30 May 2019 10:10:23 +0000 (12:10 +0200)
committerJochen Sprickerhof <jspricke@debian.org>
Sat, 17 Oct 2020 10:37:40 +0000 (11:37 +0100)
Gbp-Pq: Name 0007-Use-system-shapelib.patch

Makefile.in
configure.ac
shape.cc
shape.h

index be6f7d0c7b1831fc449cc35706142d283a8fc775..d27764408a6ce1727d5928eee2b215ba8a91b25a 100644 (file)
@@ -104,8 +104,6 @@ JEEPS=jeeps/gpsapp.o jeeps/gpscom.o \
 # Extra modules in Jeeps that we don't use
 #      jeeps/gpsfmt.o jeeps/gpsinput.o jeeps/gpsproj.o
 
-SHAPE=shapelib/shpopen.o shapelib/dbfopen.o shapelib/safileio.o
-
 LIBOBJS = route.o waypt.o filter_vecs.o util.o vecs.o mkshort.o \
           csv_util.o strptime.o grtcirc.o util_crc.o xmlgeneric.o \
           formspec.o xmltag.o cet.o cet_util.o fatal.o rgbcolors.o \
@@ -507,7 +505,7 @@ filter_vecs.o: filter_vecs.cc defs.h config.h \
   ggv_bin.h globalsat_sport.h gpx.h src/core/xmlstreamwriter.h \
   src/core/xmltag.h kml.h xmlgeneric.h legacyformat.h lowranceusr.h \
   mynav.h nmea.h osm.h qstarz_bl_1000.h random.h shape.h \
-  shapelib/shapefil.h subrip.h unicsv.h src/core/textstream.h xcsv.h \
+  subrip.h unicsv.h src/core/textstream.h xcsv.h \
   garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \
   jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \
   jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \
@@ -532,7 +530,7 @@ garmin.o: garmin.cc defs.h config.h formspec.h \
   dg-100.h energympro.h garmin_fit.h geojson.h src/core/file.h ggv_bin.h \
   globalsat_sport.h gpx.h src/core/xmlstreamwriter.h src/core/xmltag.h \
   kml.h xmlgeneric.h legacyformat.h lowranceusr.h mynav.h nmea.h osm.h \
-  qstarz_bl_1000.h random.h shape.h shapelib/shapefil.h subrip.h \
+  qstarz_bl_1000.h random.h shape.h subrip.h \
   unicsv.h src/core/textstream.h xcsv.h yahoo.h
 garmin_device_xml.o: garmin_device_xml.cc defs.h config.h \
   formspec.h inifile.h gbfile.h session.h \
@@ -819,7 +817,7 @@ magproto.o: magproto.cc defs.h config.h \
   dg-100.h energympro.h garmin_fit.h geojson.h src/core/file.h ggv_bin.h \
   globalsat_sport.h gpx.h src/core/xmlstreamwriter.h src/core/xmltag.h \
   kml.h xmlgeneric.h legacyformat.h lowranceusr.h mynav.h nmea.h osm.h \
-  qstarz_bl_1000.h random.h shape.h shapelib/shapefil.h subrip.h \
+  qstarz_bl_1000.h random.h shape.h subrip.h \
   unicsv.h src/core/textstream.h xcsv.h garmin_fs.h jeeps/gps.h \
   jeeps/../defs.h jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h \
   jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h \
@@ -835,7 +833,7 @@ main.o: main.cc defs.h config.h formspec.h \
   garmin_fit.h geojson.h ggv_bin.h globalsat_sport.h gpx.h \
   src/core/xmlstreamwriter.h src/core/xmltag.h kml.h xmlgeneric.h \
   legacyformat.h lowranceusr.h mynav.h nmea.h osm.h qstarz_bl_1000.h \
-  random.h shape.h shapelib/shapefil.h subrip.h unicsv.h \
+  random.h shape.h subrip.h unicsv.h \
   src/core/textstream.h xcsv.h garmin_fs.h jeeps/gps.h jeeps/../defs.h \
   jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h \
   jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
@@ -955,10 +953,7 @@ session.o: session.cc defs.h config.h formspec.h \
   inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h
 shape.o: shape.cc defs.h config.h formspec.h \
   inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \
-  shape.h format.h shapelib/shapefil.h
-shapelib/dbfopen.o: shapelib/dbfopen.c shapelib/shapefil.h
-shapelib/safileio.o: shapelib/safileio.c shapelib/shapefil.h
-shapelib/shpopen.o: shapelib/shpopen.c shapelib/shapefil.h
+  shape.h format.h
 skyforce.o: skyforce.cc defs.h config.h \
   formspec.h inifile.h gbfile.h session.h src/core/datetime.h \
   src/core/optional.h
@@ -1053,7 +1048,7 @@ vecs.o: vecs.cc defs.h config.h formspec.h \
   src/core/file.h ggv_bin.h globalsat_sport.h gpx.h \
   src/core/xmlstreamwriter.h src/core/xmltag.h kml.h xmlgeneric.h \
   legacyformat.h lowranceusr.h mynav.h nmea.h osm.h qstarz_bl_1000.h \
-  random.h shape.h shapelib/shapefil.h subrip.h unicsv.h \
+  random.h shape.h subrip.h unicsv.h \
   src/core/textstream.h xcsv.h garmin_fs.h jeeps/gps.h jeeps/../defs.h \
   jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h \
   jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
index cdfe3f978f300bad2a33a9f231ac693d52c815b7..96316d49bc15e054a0fad713546d35b9f6c96b82 100644 (file)
@@ -67,6 +67,9 @@ AC_ARG_ENABLE([shapefile],
        [AS_VAR_SET([enable_shapefile], [yes])])
 AS_IF([test "$enable_shapefile" = "yes"], [
        AC_DEFINE(SHAPELIB_ENABLED, 1, [1 to enable shapefile support])
+       PKG_CHECK_MODULES(SHAPELIB, shapelib)
+       CPPFLAGS="$CPPFLAGS $SHAPELIB_CFLAGS"
+       LIBS="$LIBS $SHAPELIB_LIBS"
 ])
 AC_MSG_RESULT([$enable_shapefile])
 
index 933eb95a4d0af282998331c3db1c41d856c29b97..6295599224f140957a592d0bd22ed7eb8f2094e9 100644 (file)
--- a/shape.cc
+++ b/shape.cc
@@ -32,7 +32,7 @@
 
 #include "defs.h"
 #include "shape.h"
-#include "shapelib/shapefil.h"
+#include <shapefil.h>
 
 
 #if SHAPELIB_ENABLED
diff --git a/shape.h b/shape.h
index 0ce05af7cdef6c3c7033e46a4fc61d7b0c43dfe0..aa3a0bff5a853440258bcac766801c00ec5bf3f4 100644 (file)
--- a/shape.h
+++ b/shape.h
@@ -27,7 +27,7 @@
 
 #include "defs.h"               // for arglist_t, ARGTYPE_STRING, Waypoint, route_head, CET_CHARSET_ASCII, FF_CAP_RW_ALL, ff_cap, ff_type, ff_type_file
 #include "format.h"             // for Format
-#include "shapelib/shapefil.h"  // for DBFHandle, SHPAPI_CALL, SHPHandle
+#include <shapefil.h>           // for DBFHandle, SHPAPI_CALL, SHPHandle
 
 
 #if SHAPELIB_ENABLED