diff --git a/SConstruct b/SConstruct index 4dadea292..ae41afe57 100644 --- a/SConstruct +++ b/SConstruct @@ -181,6 +181,7 @@ opts.Add(PathVariable('SQLITE_LIBS', 'Search path for SQLITE library files', '/u opts.Add('SYSTEM_FONTS','Provide location for python bindings to register fonts (if given aborts installation of bundled DejaVu fonts)','') opts.Add('LIB_DIR_NAME','Name to use for lib folder where fonts and plugins are installed', '/mapnik/', PathVariable.PathAccept) opts.Add(PathVariable('PYTHON','Full path to Python executable used to build bindings', sys.executable)) +opts.Add(BoolVariable('FRAMEWORK_PYTHON', 'Link against Framework Python on Mac OSX', 'True')) opts.Add(ListVariable('BINDINGS','Language bindings to build','all',['python'])) opts.Add(EnumVariable('THREADING','Set threading support','multi', ['multi','single'])) opts.Add(EnumVariable('XMLPARSER','Set xml parser ','libxml2', ['tinyxml','spirit','libxml2'])) diff --git a/bindings/python/SConscript b/bindings/python/SConscript index a6fab1e9d..dcedc82bd 100644 --- a/bindings/python/SConscript +++ b/bindings/python/SConscript @@ -45,7 +45,10 @@ if env['PLATFORM'] == 'Darwin': libraries.append('boost_thread%s' % env['BOOST_APPEND']) if '-DHAVE_PYCAIRO' in env['CXXFLAGS']: libraries.append([lib for lib in env['LIBS'] if lib.startswith('cairo')]) - linkflags = '-F/ -framework Python' + if env['FRAMEWORK_PYTHON']: + linkflags = '-F/ -framework Python' + else: + linkflags = '-lpython%s' % env['PYTHON_VERSION'] headers = [env['PYTHON_INCLUDES']] + env['CPPPATH']