Be explicit about threading model
Added THREADING enum options (defaults to 'multi')
This commit is contained in:
parent
67c09a815b
commit
8b74a301fb
2 changed files with 19 additions and 9 deletions
15
SConstruct
15
SConstruct
|
@ -51,8 +51,10 @@ opts.Add(ListOption('BINDINGS','Language bindings to build','all',['python']))
|
||||||
opts.Add('DEBUG', 'Compile a debug version of mapnik', '')
|
opts.Add('DEBUG', 'Compile a debug version of mapnik', '')
|
||||||
opts.Add('DESTDIR', 'The root directory to install into. Useful mainly for binary package building', '/')
|
opts.Add('DESTDIR', 'The root directory to install into. Useful mainly for binary package building', '/')
|
||||||
opts.Add('BIDI', 'BIDI support', '')
|
opts.Add('BIDI', 'BIDI support', '')
|
||||||
|
opts.Add(EnumOption('THREADING','Set threading support','multi', ['multi','single']))
|
||||||
|
|
||||||
env = Environment(ENV=os.environ, options=opts)
|
env = Environment(ENV=os.environ, options=opts)
|
||||||
|
|
||||||
env['LIBDIR_SCHEMA'] = LIBDIR_SCHEMA
|
env['LIBDIR_SCHEMA'] = LIBDIR_SCHEMA
|
||||||
env['PLATFORM'] = platform.uname()[0]
|
env['PLATFORM'] = platform.uname()[0]
|
||||||
print "Building on %s ..." % env['PLATFORM']
|
print "Building on %s ..." % env['PLATFORM']
|
||||||
|
@ -107,7 +109,7 @@ if env['BIDI'] : C_LIBSHEADERS.append(['fribidi','fribidi/fribidi.h',True])
|
||||||
|
|
||||||
BOOST_LIBSHEADERS = [
|
BOOST_LIBSHEADERS = [
|
||||||
['thread', 'boost/thread/mutex.hpp', True],
|
['thread', 'boost/thread/mutex.hpp', True],
|
||||||
# ['system', 'boost/system/system_error.hpp', True], # comment this out if building on Darwin + boost_1_35
|
# ['system', 'boost/system/system_error.hpp', True], # uncomment this on Darwin + boost_1_35
|
||||||
['filesystem', 'boost/filesystem/operations.hpp', True],
|
['filesystem', 'boost/filesystem/operations.hpp', True],
|
||||||
['regex', 'boost/regex.hpp', True],
|
['regex', 'boost/regex.hpp', True],
|
||||||
['program_options', 'boost/program_options.hpp', False]
|
['program_options', 'boost/program_options.hpp', False]
|
||||||
|
@ -120,16 +122,19 @@ for libinfo in C_LIBSHEADERS:
|
||||||
|
|
||||||
|
|
||||||
if len(env['BOOST_TOOLKIT']):
|
if len(env['BOOST_TOOLKIT']):
|
||||||
env['BOOST_APPEND'] = '-%s-mt' % env['BOOST_TOOLKIT']
|
env['BOOST_APPEND'] = '-%s' % env['BOOST_TOOLKIT']
|
||||||
else:
|
else:
|
||||||
env['BOOST_APPEND']=''
|
env['BOOST_APPEND']=''
|
||||||
|
|
||||||
for count, libinfo in enumerate(BOOST_LIBSHEADERS):
|
for count, libinfo in enumerate(BOOST_LIBSHEADERS):
|
||||||
if not conf.CheckLibWithHeader('boost_%s%s' % (libinfo[0], env['BOOST_APPEND']), libinfo[1], 'C++'):
|
if env['THREADING'] == 'multi' :
|
||||||
if not conf.CheckLibWithHeader('boost_%s%s-mt' % (libinfo[0],env['BOOST_APPEND']), libinfo[1], 'C++') and libinfo[2] and count == 0:
|
if not conf.CheckLibWithHeader('boost_%s%s-mt' % (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]
|
print 'Could not find header or shared library for boost %s, exiting!' % libinfo[0]
|
||||||
Exit(1)
|
Exit(1)
|
||||||
|
elif not conf.CheckLibWithHeader('boost_%s%s' % (libinfo[0], env['BOOST_APPEND']), libinfo[1], 'C++') :
|
||||||
|
print 'Could not find header or shared library for boost %s, exiting!' % libinfo[0]
|
||||||
|
Exit(1)
|
||||||
|
|
||||||
Export('env')
|
Export('env')
|
||||||
|
|
||||||
inputplugins = [ driver.strip() for driver in Split(env['INPUT_PLUGINS'])]
|
inputplugins = [ driver.strip() for driver in Split(env['INPUT_PLUGINS'])]
|
||||||
|
|
|
@ -26,13 +26,18 @@ Import('env')
|
||||||
prefix = env['PYTHON_PREFIX'] + '/'+ 'lib' + '/python' + env['PYTHON_VERSION'] + '/site-packages/'
|
prefix = env['PYTHON_PREFIX'] + '/'+ 'lib' + '/python' + env['PYTHON_VERSION'] + '/site-packages/'
|
||||||
install_prefix = env['DESTDIR'] + '/' + prefix
|
install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
|
|
||||||
libraries = ['mapnik', 'boost_python%s' % env['BOOST_APPEND']]
|
linkflags = ''
|
||||||
|
if env['THREADING'] == 'multi':
|
||||||
|
libraries = ['mapnik', 'boost_python%s-mt' % env['BOOST_APPEND']]
|
||||||
|
else :
|
||||||
|
libraries = ['mapnik', 'boost_python%s' % env['BOOST_APPEND']]
|
||||||
|
|
||||||
if env['PLATFORM'] == 'Darwin':
|
if env['PLATFORM'] == 'Darwin':
|
||||||
libraries.append('boost_regex%s' % env['BOOST_APPEND'])
|
if env['THREADING'] == 'multi':
|
||||||
|
libraries.append('boost_regex%s-mt' % env['BOOST_APPEND'])
|
||||||
|
else :
|
||||||
|
libraries.append('boost_regex%s' % env['BOOST_APPEND'])
|
||||||
linkflags = '-F/ -framework Python'
|
linkflags = '-F/ -framework Python'
|
||||||
else :
|
|
||||||
linkflags = ''
|
|
||||||
|
|
||||||
headers = [env['PYTHON_PREFIX'] + '/include/python' + env['PYTHON_VERSION']] + env['CPPPATH']
|
headers = [env['PYTHON_PREFIX'] + '/include/python' + env['PYTHON_VERSION']] + env['CPPPATH']
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue