From 3dd616007d848476680f21bad679ebb81df7f61a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 26 Apr 2009 03:33:29 +0000 Subject: [PATCH] Add FULL_LIB_PATH option for OS X to link in the full path to libmapnik.dylib in the library itself --- SConstruct | 5 +++-- src/SConscript | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index 0d9bd9d2a..bf587659c 100644 --- a/SConstruct +++ b/SConstruct @@ -156,9 +156,10 @@ opts.AddVariables( # Other variables ('SYSTEM_FONTS','Provide location for python bindings to register fonts (if given aborts installation of bundled DejaVu fonts)',''), - ('LIB_DIR_NAME','Name to use for lib folder where fonts and plugins are installed','/mapnik/'), + ('LIB_DIR_NAME','Name to use for the "lib" folder where fonts and plugins are installed','/mapnik/'), PathVariable('PYTHON','Full path to Python executable used to build bindings', sys.executable), - BoolVariable('FRAMEWORK_PYTHON', 'Link against Framework Python on Mac OSX', 'True'), + BoolVariable('FRAMEWORK_PYTHON', 'Link against Framework Python on Mac OS X', 'True'), + BoolVariable('FULL_LIB_PATH', 'Use the full path for the libmapnik.dylib "install_name" when linking on Mac OS X', 'False'), ListVariable('BINDINGS','Language bindings to build','all',['python']), EnumVariable('THREADING','Set threading support','multi', ['multi','single']), EnumVariable('XMLPARSER','Set xml parser ','libxml2', ['tinyxml','spirit','libxml2']), diff --git a/src/SConscript b/src/SConscript index 3baebfcaf..da86532b8 100644 --- a/src/SConscript +++ b/src/SConscript @@ -29,6 +29,8 @@ ABI_VERSION = env['ABI_VERSION'] prefix = env['PREFIX'] +lib_dir = os.path.normpath(prefix + '/' + env['LIBDIR_SCHEMA']) + install_prefix = env['DESTDIR'] + '/' + prefix libraries = env['LIBS'] @@ -37,11 +39,15 @@ if env['INTERNAL_LIBAGG']: libraries.insert(0, 'agg') if env['PLATFORM'] == 'Darwin': - linkflags = '-Wl,-install_name,libmapnik.dylib' + if env['FULL_LIB_PATH']: + lib_path = '%s/libmapnik.dylib' % lib_dir + else: + lib_path = 'libmapnik.dylib' + linkflags = '-Wl,-install_name,%s' % lib_path elif env['PLATFORM'] == 'SunOS' and env['CXX'].startswith('CC'): linkflags = '-R. -h libmapnik.so' else: # Linux and others - linkflags = '-Wl,-rpath-link,. -Wl,-soname,libmapnik.so.' + ("%d.%d" % (ABI_VERSION[0],ABI_VERSION[1])) + linkflags = '-Wl,-rpath-link,. -Wl,-soname,libmapnik.so.' + ("%d.%d" % (ABI_VERSION[0],ABI_VERSION[1])) source = Split( """