Package: spatialite
Version: 2.4.0~rc2-5
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric

getstream fails to build with a linker that defaults to --as-needed, as
shown in this Ubuntu bug report:

  https://bugs.launchpad.net/ubuntu/+source/spatialite/+bug/831229

This is because its link line order is wrong, putting libraries before
the objects that use them rather than after.  See:

  http://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries

The following patch fixes this.

  * Put -lsqlite after references to libspatialite on link lines.

diff -u spatialite-2.4.0~rc2/debian/patches/series 
spatialite-2.4.0~rc2/debian/patches/series
--- spatialite-2.4.0~rc2/debian/patches/series
+++ spatialite-2.4.0~rc2/debian/patches/series
@@ -1,0 +2 @@
+link-order.diff
only in patch2:
unchanged:
--- spatialite-2.4.0~rc2.orig/debian/patches/link-order.diff
+++ spatialite-2.4.0~rc2/debian/patches/link-order.diff
@@ -0,0 +1,48 @@
+Description: libspatialite uses libsqlite; fix link order
+Author: Colin Watson <cjwat...@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/831229
+Forwarded: no
+Last-Update: 2011-08-23
+
+Index: b/spatialite-tools/Makefile.am
+===================================================================
+--- a/spatialite-tools/Makefile.am
++++ b/spatialite-tools/Makefile.am
+@@ -45,13 +45,13 @@
+       @PROJ_LIB@ \
+       -lm -liconv -lstdc++ -lpthread -ldl
+ else
+-spatialite_LDADD = -lsqlite3 @SPATIALITE_LIB@ \
++spatialite_LDADD = @SPATIALITE_LIB@ -lsqlite3 \
+       @GEOS_LIB_C@ \
+       @GEOS_LIB@ \
+       @PROJ_LIB@ \
+       -lm -lstdc++ -lpthread -ldl \
+       @READLINE_LIBS@
+-LDADD = -lsqlite3 @SPATIALITE_LIB@ \
++LDADD = @SPATIALITE_LIB@ -lsqlite3 \
+       @GEOS_LIB_C@ \
+       @GEOS_LIB@ \
+       @PROJ_LIB@ \
+Index: b/spatialite-tools/Makefile.in
+===================================================================
+--- a/spatialite-tools/Makefile.in
++++ b/spatialite-tools/Makefile.in
+@@ -244,7 +244,7 @@
+ shp_doctor_SOURCES = shp_doctor.c
+ exif_loader_SOURCES = exif_loader.c
+ spatialite_osm_SOURCES = spatialite_osm.c
+-@MACOSX_FALSE@@MINGW_FALSE@spatialite_LDADD = -lsqlite3 @SPATIALITE_LIB@ \
++@MACOSX_FALSE@@MINGW_FALSE@spatialite_LDADD = @SPATIALITE_LIB@ -lsqlite3 \
+ @MACOSX_FALSE@@MINGW_FALSE@   @GEOS_LIB_C@ \
+ @MACOSX_FALSE@@MINGW_FALSE@   @GEOS_LIB@ \
+ @MACOSX_FALSE@@MINGW_FALSE@   @PROJ_LIB@ \
+@@ -265,7 +265,7 @@
+ @MINGW_TRUE@  /usr/local/lib/libiconv.a \
+ @MINGW_TRUE@  -lm -lstdc++
+ 
+-@MACOSX_FALSE@@MINGW_FALSE@LDADD = -lsqlite3 @SPATIALITE_LIB@ \
++@MACOSX_FALSE@@MINGW_FALSE@LDADD = @SPATIALITE_LIB@ -lsqlite3 \
+ @MACOSX_FALSE@@MINGW_FALSE@   @GEOS_LIB_C@ \
+ @MACOSX_FALSE@@MINGW_FALSE@   @GEOS_LIB@ \
+ @MACOSX_FALSE@@MINGW_FALSE@   @PROJ_LIB@ \

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]



_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to