diff options
author | Alastair Houghton <[email protected]> | 2016-04-07 09:25:48 +0100 |
---|---|---|
committer | Alastair Houghton <[email protected]> | 2016-04-07 09:25:48 +0100 |
commit | b850420855a56d862ca9c05ca1c0acbddae8475e (patch) | |
tree | 49178e809e653198867e74ff90683c1eab606542 /src/scripts/install.py | |
parent | 6a902a886c5b71ac16f2d957b5bdd319ab6eae0b (diff) |
Fixed shared library behaviour on Darwin/OS X.
Diffstat (limited to 'src/scripts/install.py')
-rwxr-xr-x | src/scripts/install.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/scripts/install.py b/src/scripts/install.py index d1d62b6c5..1d4d27b76 100755 --- a/src/scripts/install.py +++ b/src/scripts/install.py @@ -15,6 +15,7 @@ import os import shutil import string import sys +import subprocess def parse_command_line(args): @@ -174,6 +175,20 @@ def main(args = None): copy_executable(os.path.join(out_dir, app_exe), os.path.join(bin_dir, app_exe)) + # On Darwin, if we are using shared libraries and we install, we should fix + # up the library name, otherwise the botan command won't work; ironically + # we only need to do this because we previously changed it from a setting + # that would be correct for installation to one that lets us run it from + # the build directory + if str(cfg['os']) == 'darwin' and bool(cfg['build_shared_lib']): + soname_abi = process_template('%{soname_abi}') + + subprocess.check_call(['install_name_tool', + '-change', + os.path.join('@executable_path', soname_abi), + os.path.join(lib_dir, soname_abi), + os.path.join(bin_dir, app_exe)]) + if 'botan_pkgconfig' in cfg: pkgconfig_dir = os.path.join(options.destdir, options.libdir, options.pkgconfigdir) makedirs(pkgconfig_dir) |