Add FULL_LIB_PATH option for OS X to link in the full path to libmapnik.dylib in the library itself

This commit is contained in:
Dane Springmeyer 2009-04-26 03:33:29 +00:00
parent 57f995b0cc
commit 3dd616007d
2 changed files with 11 additions and 4 deletions

View file

@ -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']),

View file

@ -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(
"""