artemp/trac2github — Issue #29: FreeBSD build
Author: artemp
Created: 2011-10-09 20:08:56+00:00
State: open
Labels: Scons_Build_Scripts

FreeBSD builds and installs boost libraries with posix threads but without the -mt suffix.

The following changes were necessary for mapnik components to build on FreeBSD. I'm just signalling the breakage: a real check or some added logic that needs to be put into the SConstruct files (by someone more well-versed than I in scons). This is just a hackish change.

svn diff

{{{
Index: bindings/python/SConscript
===================================================================
--- bindings/python/SConscript (revision 479)
+++ bindings/python/SConscript (working copy)
@@ -28,7 +28,7 @@

linkflags = ''
if env['THREADING'] == 'multi':
- libraries = ['mapnik', 'boost_python%s-mt' % env['BOOST_APPEND']]
+ libraries = ['mapnik', 'boost_python%s' % env['BOOST_APPEND']]
else :
libraries = ['mapnik', 'boost_python%s' % env['BOOST_APPEND']]

Index: SConstruct
===================================================================
--- SConstruct (revision 479)
+++ SConstruct (working copy)
@@ -64,6 +64,9 @@
print "Building on %s ..." % env['PLATFORM']
Help(opts.GenerateHelpText(env))

+if env['PLATFORM'] == 'FreeBSD' :
+ env.Append(LIBS = 'pthread')
+
conf = Configure(env)

# Libraries and headers dependency checks
@@ -145,7 +148,7 @@

for count, libinfo in enumerate(BOOST_LIBSHEADERS):
if env['THREADING'] == 'multi' :
- if not conf.CheckLibWithHeader('boost_%s%s-mt' % (libinfo[0],env['BOOST_APPEND']), libinfo[1], 'C++') and libinfo[2] :
+ if not conf.CheckLibWithHeader('boost_%s%s' % (libinfo[0],env['BOOST_APPEND']), libinfo[1], 'C++') and libinfo[2] :
print 'Could not find header or shared library for boost %s, exiting!' % libinfo[0]
Exit(1)
elif not conf.CheckLibWithHeader('boost_%s%s' % (libinfo[0], env['BOOST_APPEND']), libinfo[1], 'C++') :
@@ -169,9 +172,9 @@

# Build shapeindex and remove its dependency from the LIBS

-if 'boost_program_options%s-mt' % env['BOOST_APPEND'] in env['LIBS']:
+if 'boost_program_options%s' % env['BOOST_APPEND'] in env['LIBS']:
SConscript('utils/shapeindex/SConscript')
- env['LIBS'].remove('boost_program_options%s-mt' % env['BOOST_APPEND'])
+ env['LIBS'].remove('boost_program_options%s' % env['BOOST_APPEND'])

# Build the input plug-ins
}}}