From 189017a0c404212b572cc321bf2c09b4d478927f Mon Sep 17 00:00:00 2001 From: vasilios Date: Fri, 24 Feb 2017 22:39:37 +0000 Subject: [PATCH] Added branching for ldd command in OSX --- setup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 37a936584..5e6813518 100644 --- a/setup.py +++ b/setup.py @@ -162,16 +162,15 @@ def build_extension(self, ext): defines.extend(["DEBUG", "TRACE"]) if sys.platform != "win32" and DEVTOOLS == "Mono": - if sys.platform == "darwin": - defines.append("MONO_OSX") - else: - defines.append("MONO_LINUX") + on_darwin = sys.platform == "darwin" + defines.append("MONO_OSX" if on_darwin else "MONO_LINUX") # Check if --enable-shared was set when Python was built enable_shared = sysconfig.get_config_var("Py_ENABLE_SHARED") if enable_shared: # Double-check if libpython is linked dynamically with python - lddout = _check_output(["ldd", sys.executable]) + ldd_cmd = ["otool", "-L"] if on_darwin else ["ldd"] + lddout = _check_output(ldd_cmd + [sys.executable]) if 'libpython' not in lddout: enable_shared = False