Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added branching for ldd command in OSX
  • Loading branch information
fractus committed Feb 24, 2017
commit 189017a0c404212b572cc321bf2c09b4d478927f
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down