Core:Add:Use shapefile lib if it's found on the system
authorhorwitz <horwitz@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 15 Mar 2010 21:08:56 +0000 (21:08 +0000)
committerhorwitz <horwitz@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 15 Mar 2010 21:08:56 +0000 (21:08 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3015 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/configure.in
navit/navit/map/shapefile/Makefile.am

index 552e4d1..fb249aa 100644 (file)
@@ -478,6 +478,25 @@ fi
 AM_CONDITIONAL(GUI_SDL, [test "x$sdl" = "xyes" -a "x$opengl" = "xyes" -a "x$glc" = "xyes" -a "x$xmu" = "xyes" ])
 AM_CONDITIONAL(GRAPHICS_OPENGL, [test "x$glut" = "xyes" -a "x$opengl" = "xyes" -a "x$glc" = "xyes" ])
 
+system_shapefile=no
+AC_CHECK_HEADERS(
+               [shapefil.h libshp/shapefil.h],
+               AC_DEFINE(
+                         [HAVE_SYS_SHAPEFILELIB],
+                         [1],
+                         Define to 1 if you have the <libshp/shapefil.h> header file.
+                         )
+               SHAPEFILE_LIBS="-lshp"
+               system_shapefile=yes
+               )
+AC_SUBST(SHAPEFILE_CFLAGS)
+AC_SUBST(SHAPEFILE_LIBS)
+AM_CONDITIONAL(HAVE_SYSTEM_SHAPEFILELIB, [test "x$system_shapefile" = "xyes" ])
+if test x"${system_shapefile}" = xno
+then
+       AC_MSG_WARN([*** no libshp/shapefil.h -- using included copy])
+fi
+
 
 if test x"${USE_GARMIN}" = xyes
 then
index 5980bd3..35e420e 100644 (file)
@@ -5,5 +5,10 @@ if PLUGINS
 else
   noinst_LTLIBRARIES = libmap_shapefile.la
 endif
+if HAVE_SYSTEM_SHAPEFILELIB
+libmap_shapefile_la_SOURCES = shapefile.c
+libmap_shapefile_la_LDFLAGS = -module -avoid-version @NAVIT_MODULE_LDFLAGS@ @SHAPEFILE_LIBS@
+else
 libmap_shapefile_la_SOURCES = shapefile.c dbfopen.c shpopen.c shptree.c shapefil.h
 libmap_shapefile_la_LDFLAGS = -module -avoid-version @NAVIT_MODULE_LDFLAGS@
+endif