diff --git a/SConstruct b/SConstruct index a76ef24a3..b2ff67d63 100644 --- a/SConstruct +++ b/SConstruct @@ -76,6 +76,12 @@ env['PLATFORM'] = platform.uname()[0] color_print (4,"Building on %s ..." % env['PLATFORM']) Help(opts.GenerateHelpText(env)) +thread_suffix = '-mt' + +if env['PLATFORM'] == 'FreeBSD': + thread_suffix = '' + env.Append(LIBS = 'pthread') + conf = Configure(env) #### Libraries and headers dependency checks #### @@ -176,7 +182,7 @@ else: 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%s' % (libinfo[0],env['BOOST_APPEND'],thread_suffix), libinfo[1], 'C++') and libinfo[2] : color_print(1,'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++') : @@ -198,9 +204,9 @@ SConscript('agg/SConscript') SConscript('src/SConscript') # 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%s' % (env['BOOST_APPEND'],thread_suffix) 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%s' % (env['BOOST_APPEND'],thread_suffix)) # Build the input plug-ins if 'postgis' in inputplugins and 'pq' in env['LIBS']: diff --git a/bindings/python/SConscript b/bindings/python/SConscript index f694ae04c..9d9aea726 100644 --- a/bindings/python/SConscript +++ b/bindings/python/SConscript @@ -28,21 +28,26 @@ Import('env') prefix = env['PYTHON_PREFIX'] + '/' + env['LIBDIR_SCHEMA'] + '/python' + env['PYTHON_VERSION'] + '/site-packages/' install_prefix = env['DESTDIR'] + '/' + prefix +thread_suffix = '-mt' + +if env['PLATFORM'] == 'FreeBSD': + thread_suffix = '' + linkflags = '' libraries = ['mapnik','png','jpeg'] if env['THREADING'] == 'multi': - libraries.append('boost_python%s-mt' % env['BOOST_APPEND']) + libraries.append('boost_python%s%s' % (env['BOOST_APPEND'],thread_suffix)) else : libraries.append('mapnik', 'boost_python%s' % env['BOOST_APPEND']) if env['PLATFORM'] == 'Darwin': if env['THREADING'] == 'multi': - libraries.append('boost_regex%s-mt' % env['BOOST_APPEND']) + libraries.append('boost_regex%s%s' % (env['BOOST_APPEND'],thread_suffix)) else : libraries.append('boost_regex%s' % env['BOOST_APPEND']) if env['THREADING'] == 'multi': - libraries.append('boost_thread%s-mt' % env['BOOST_APPEND']) + libraries.append('boost_thread%s%s' % (env['BOOST_APPEND'],thread_suffix)) linkflags = '-F/ -framework Python' diff --git a/src/unicode.cpp b/src/unicode.cpp index f955bcc92..592203d62 100644 --- a/src/unicode.cpp +++ b/src/unicode.cpp @@ -179,7 +179,7 @@ namespace mapnik { size_t inleft = input.size(); std::wstring output(inleft,0); size_t outleft = inleft * sizeof(wchar_t); -#if (!defined(OSX_LEOPARD) && defined(DARWIN)) || defined(SUNOS) +#if (!defined(OSX_LEOPARD) && defined(DARWIN)) || defined(SUNOS) || defined(FREEBSD) const char * in = input.c_str(); #else char * in = const_cast(input.data()); diff --git a/utils/shapeindex/SConscript b/utils/shapeindex/SConscript index 37c8900ef..30d6844fe 100644 --- a/utils/shapeindex/SConscript +++ b/utils/shapeindex/SConscript @@ -26,6 +26,11 @@ Import ('env') prefix = env['PREFIX'] install_prefix = env['DESTDIR'] + '/' + prefix +thread_suffix = '-mt' + +if env['PLATFORM'] == 'FreeBSD': + thread_suffix = '' + source = Split( """ shapeindex.cpp @@ -38,7 +43,7 @@ headers = ['#plugins/input/shape'] + env['CPPPATH'] boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND'] if env['THREADING'] == 'multi': - boost_program_options = '%s-mt' % boost_program_options + boost_program_options = '%s%s' % (boost_program_options,thread_suffix) shapeindex = env.Program('shapeindex', source, CPPPATH=headers, LIBS=boost_program_options) env.Install(install_prefix + '/bin', shapeindex)