diff --git a/.travis.yml b/.travis.yml index 06b150a0e..357fc758f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ sudo: required language: python python: - - 2.6 - 2.7 - 3.2 - 3.4 diff --git a/setup.py b/setup.py index c743f0260..05ae35906 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from distutils.spawn import find_executable from distutils import log from platform import architecture -from subprocess import Popen, CalledProcessError, PIPE, check_call +from subprocess import Popen, CalledProcessError, PIPE, check_call, check_output from glob import glob import fnmatch import sys @@ -153,7 +153,13 @@ def build_extension(self, ext): # Check if --enable-shared was set when Python was built enable_shared = get_config_var("Py_ENABLE_SHARED") - if enable_shared == 0: + if enable_shared: + # Double-check if libpython is linked dynamically with python + lddout = check_output(["ldd", sys.executable]) + if b'libpython' not in lddout: + enable_shared = False + + if not enable_shared: defines.append("PYTHON_WITHOUT_ENABLE_SHARED") if hasattr(sys, "abiflags"):