File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -151,11 +151,15 @@ def build_extension(self, ext):
151
151
else :
152
152
defines .append ("MONO_LINUX" )
153
153
154
- # Disable this check due to issues on Ubuntu
155
154
# Check if --enable-shared was set when Python was built
156
- # enable_shared = get_config_var("Py_ENABLE_SHARED")
157
- # if enable_shared == 0:
158
- defines .append ("PYTHON_WITHOUT_ENABLE_SHARED" )
155
+ enable_shared = get_config_var ("Py_ENABLE_SHARED" )
156
+ if enable_shared == 1 :
157
+ # Double-check if libpython is linked dynamically with python
158
+ lddout = check_output (["ldd" , sys .executable ])
159
+ if 'libpython' not in lddout :
160
+ enable_shared = 0
161
+ if enable_shared == 0 :
162
+ defines .append ("PYTHON_WITHOUT_ENABLE_SHARED" )
159
163
160
164
if hasattr (sys , "abiflags" ):
161
165
if "d" in sys .abiflags :
You can’t perform that action at this time.
0 commit comments