From 58b0a3e5ff4be55a0c543e3f7022c23b206439a0 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 28 Apr 2010 05:39:27 +0000 Subject: [PATCH] scons: add 'PYTHON_DYNAMIC_LOOKUP' boolean to allow for dynamically loading python symbols rather than direct linking on OSX (default behavior still the same) - addresses #453 --- SConstruct | 1 + bindings/python/SConscript | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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