From fc61913731076ac7b7fd6defc8f77588166bce4d Mon Sep 17 00:00:00 2001 From: woglinde Date: Wed, 20 Jul 2011 21:44:43 +0000 Subject: [PATCH] Fix:map_shapefile:Rework the autotools support a bit, don't include shapefile in builtin.c fixes buildprocess with no plugin support git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4654 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/configure.in | 34 +++++++++++++++++++++------------- navit/navit/Makefile.am | 6 ++++-- navit/navit/map/shapefile/Makefile.am | 3 +-- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/navit/configure.in b/navit/configure.in index 12ac158..95ec21f 100644 --- a/navit/configure.in +++ b/navit/configure.in @@ -366,7 +366,7 @@ AM_CONDITIONAL(SUPPORT_ZLIB, [test "x$zlib" = "xno"]) AC_SUBST(ZLIB_CFLAGS) AC_SUBST(ZLIB_LIBS) -AC_CHECK_HEADER(sys/socket.h, AC_DEFINE([HAVE_SOCKET],[],Define to 1 if you have sockets)) +AC_CHECK_HEADER(sys/socket.h, AC_DEFINE([HAVE_SOCKET],[],Define to 2 if you have sockets)) AC_CHECK_HEADER(winsock2.h, AC_DEFINE([HAVE_WINSOCK],[],Define to 1 if you have Windows sockets)) # gtk @@ -558,30 +558,38 @@ fi AM_CONDITIONAL(GRAPHICS_OPENGL, [test "x$glut" = "xyes" -a "x$freeglut" = "xyes" -a "x$opengl" = "xyes" -a "x$freeimage" = "xyes" -a "x$glc" = "xyes" ]) + system_shapefile=no +if test x"${map_shapefile}" = xyes +then AC_CHECK_HEADERS( [shapefil.h libshp/shapefil.h], - AC_DEFINE( + [AC_DEFINE( [HAVE_SYS_SHAPEFILELIB], [1], - Define to 1 if you have the header file. - ) - system_shapefile_header=yes + Define to 1 if you have the header file. + )], + [SHAPEFILE_CFLAGS="-I\$(top_srcdir)/navit/support/shapefile"] ) -if test x"${system_shapefile_header}" = xyes + +AC_CHECK_LIB( + [shp], + [DBFDeleteField], + [SHAPEFILE_LIBS="-lshp" + system_shapefile=yes], + [SHAPEFILE_LIBS="-L\$(top_builddir)/navit/support/shapefile -lsupport_shapefile" + system_shapefile=no] + ) + +if test x"${system_shapefile}" = xno then - AC_CHECK_LIB([shp], [DBFDeleteField], [SHAPEFILE_LIBS="-lshp";HAVE_SYS_SHAPEFILELIB=0;system_shapefile=yes]) -else - AC_MSG_WARN([*** No libshp/shapefil.h -- using included copy]) + AC_MSG_WARN([*** The shapefile library(libshp) from the system is to old or not found! -- using included copy]) fi +fi 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([*** The shape library(libshp) from the system is to old! -- using included copy]) -fi if test x"${USE_GARMIN}" = xyes then diff --git a/navit/navit/Makefile.am b/navit/navit/Makefile.am index 7d3af80..f8ebb20 100644 --- a/navit/navit/Makefile.am +++ b/navit/navit/Makefile.am @@ -177,14 +177,16 @@ if EVENT_GLIB lib@LIBNAVIT@_la_SOURCES += event_glib.c endif +navit_LDFLAGS = -export-dynamic + if !PLUGINS lib@LIBNAVIT@_la_SOURCES += builtin.c lib@LIBNAVIT@_la_LIBADD += $(MODULES) endif -navit_LDFLAGS = -export-dynamic navit_LDADD += @NAVIT_LIBS@ @WORDEXP_LIBS@ @ZLIB_LIBS@ @CRYPTO_LIBS@ @INTLLIBS@ + if SUPPORT_WIN32 navit_LDADD += resource.rsc @@ -232,7 +234,7 @@ builtin.c: $(top_builddir)/config.h ls $(top_builddir)/navit/*/*/*.la | sed -e "s/\.la/_init(void);/" -e "s/.*lib/extern void module_/" >builtin.c echo "extern void builtin_init(void);" >>builtin.c echo "void builtin_init(void) {" >>builtin.c - ls $(top_builddir)/navit/*/*/*.la | sed -e "s/\.la/_init();/" -e "s/.*\\/lib/ module_/" >>builtin.c + ls $(top_builddir)/navit/*/*/*.la | grep -v shapefile | sed -e "s/\.la/_init();/" -e "s/.*\\/lib/ module_/" >>builtin.c echo "}" >>builtin.c support-builtin.c: $(top_builddir)/config.h ls $(top_builddir)/navit/support/*/*.la | sed -e "s/\.la/_init(void);/" -e "s/.*lib/extern void module_/" >support-builtin.c diff --git a/navit/navit/map/shapefile/Makefile.am b/navit/navit/map/shapefile/Makefile.am index 6b6c1fa..f23fb82 100644 --- a/navit/navit/map/shapefile/Makefile.am +++ b/navit/navit/map/shapefile/Makefile.am @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.inc -AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/navit -DMODULE=map_shapefile +AM_CPPFLAGS = @NAVIT_CFLAGS@ @SHAPEFILE_CFLAGS@ -I$(top_srcdir)/navit -DMODULE=map_shapefile if PLUGINS modulemap_LTLIBRARIES = libmap_shapefile.la else @@ -10,6 +10,5 @@ libmap_shapefile_la_LDFLAGS = -module -avoid-version @NAVIT_MODULE_LDFLAGS@ if HAVE_SYSTEM_SHAPEFILELIB libmap_shapefile_la_LIBADD = @SHAPEFILE_LIBS@ else -AM_CPPFLAGS += -I$(top_srcdir)/navit/support/shapefile libmap_shapefile_la_LIBADD = $(top_builddir)/navit/support/shapefile/libsupport_shapefile.la endif -- 2.7.4