applied freebsd patch from Beau Gunderson

This commit is contained in:
Artem Pavlenko 2008-01-28 14:51:10 +00:00
parent 7fec4b71fe
commit 3c5b7f02f3
4 changed files with 24 additions and 8 deletions

View file

@ -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']:

View file

@ -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'

View file

@ -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<char*>(input.data());

View file

@ -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)