Bug#709186: mapserver: fails to build with ld that defaults to --as-needed

Colin Watson cjwatson at ubuntu.com
Tue May 21 12:23:37 UTC 2013


Package: mapserver
Version: 6.0.1-3.2
Severity: important
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch saucy

mapserver fails to build with a linker that defaults to --as-needed, as
shown in this Ubuntu build log:

  https://launchpadlibrarian.net/140379929/buildlog_ubuntu-saucy-i386.mapserver_6.0.1-3.2build1_FAILEDTOBUILD.txt.gz

This is quite cumbersome to fix in any autotools-normal way, because
dlopen isn't detected directly by configure, but instead HAVE_DLFCN_H is
picked up from <gdal/cpl_config.h>.  The most straightforward workaround
I found was to make debian/rules pass XTRALIBS=-ldl to configure.  You
may have a better answer ...

  * Link executables with -ldl.

diff -Nru mapserver-6.0.1/debian/rules mapserver-6.0.1/debian/rules
--- mapserver-6.0.1/debian/rules	2012-08-28 19:29:25.000000000 +0100
+++ mapserver-6.0.1/debian/rules	2013-05-21 13:08:41.000000000 +0100
@@ -59,7 +59,7 @@
 
 configure-stamp:
 	dh_testdir
-	./configure $(COMMON_CONFIG) CFLAGS="$(MS_CFLAGS)" CXXFLAGS="$(MS_CXXFLAGS)"
+	./configure $(COMMON_CONFIG) CFLAGS="$(MS_CFLAGS)" CXXFLAGS="$(MS_CXXFLAGS)" XTRALIBS=-ldl
 
 
 	touch configure-stamp
@@ -67,7 +67,7 @@
 configure-php5-stamp: clean-first-build
 	dh_testdir
 	./configure $(COMMON_CONFIG) \
-		--with-php=/usr/include/php5  CFLAGS="$(MS_CFLAGS)" CXXFLAGS="$(MS_CXXFLAGS)"
+		--with-php=/usr/include/php5  CFLAGS="$(MS_CFLAGS)" CXXFLAGS="$(MS_CXXFLAGS)" XTRALIBS=-ldl
 
 	touch configure-php5-stamp
 

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]



More information about the Pkg-grass-devel mailing list