diff --git a/SConstruct b/SConstruct index 149590ce4..e743add27 100644 --- a/SConstruct +++ b/SConstruct @@ -288,6 +288,7 @@ opts.AddVariables( ('LIB_DIR_NAME','Name to use for the "lib" folder where fonts and plugins are installed','/mapnik2/'), PathVariable('PYTHON','Full path to Python executable used to build bindings', sys.executable), BoolVariable('FRAMEWORK_PYTHON', 'Link against Framework Python on Mac OS X', 'True'), + BoolVariable('PYTHON_DYNAMIC_LOOKUP', 'On OSX, do not directly link python lib, but rather dynamically lookup symbols', 'False'), ('FRAMEWORK_SEARCH_PATH','Custom framework search path on Mac OS X', ''), BoolVariable('FULL_LIB_PATH', 'Use the full path for the libmapnik.dylib "install_name" when linking on Mac OS X', 'True'), ListVariable('BINDINGS','Language bindings to build','all',['python']), diff --git a/bindings/python/SConscript b/bindings/python/SConscript index 2963ae4fd..437ac4c61 100644 --- a/bindings/python/SConscript +++ b/bindings/python/SConscript @@ -67,7 +67,9 @@ if env['PLATFORM'] == 'Darwin': # http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man1/ld.1.html - if env['FRAMEWORK_PYTHON']: + if env['PYTHON_DYNAMIC_LOOKUP']: + linkflags = '-undefined dynamic_lookup' + elif env['FRAMEWORK_PYTHON']: if env['FRAMEWORK_SEARCH_PATH']: # if the user has supplied a custom root path to search for # a given Python framework, then use that to direct the linker