From 64dba418f425a57b7cc36f22739c34e3970b1baa Mon Sep 17 00:00:00 2001 From: denfromufa Date: Sun, 4 Dec 2016 01:45:39 -0600 Subject: [PATCH 1/6] Update setup.py https://github.com/pythonnet/pythonnet/issues/119 --- setup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index c743f0260..8520c2fbe 100644 --- a/setup.py +++ b/setup.py @@ -150,11 +150,12 @@ def build_extension(self, ext): defines.append("MONO_OSX") else: defines.append("MONO_LINUX") - + + # Disable this check due to issues on Ubuntu # Check if --enable-shared was set when Python was built - enable_shared = get_config_var("Py_ENABLE_SHARED") - if enable_shared == 0: - defines.append("PYTHON_WITHOUT_ENABLE_SHARED") + # enable_shared = get_config_var("Py_ENABLE_SHARED") + # if enable_shared == 0: + defines.append("PYTHON_WITHOUT_ENABLE_SHARED") if hasattr(sys, "abiflags"): if "d" in sys.abiflags: From c17f38f389a02e597acc3c852d6a2076e0f58d7b Mon Sep 17 00:00:00 2001 From: denfromufa Date: Wed, 7 Dec 2016 00:38:25 -0600 Subject: [PATCH 2/6] Update setup.py --- setup.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 8520c2fbe..330dec289 100644 --- a/setup.py +++ b/setup.py @@ -151,11 +151,15 @@ def build_extension(self, ext): else: defines.append("MONO_LINUX") - # Disable this check due to issues on Ubuntu # Check if --enable-shared was set when Python was built - # enable_shared = get_config_var("Py_ENABLE_SHARED") - # if enable_shared == 0: - defines.append("PYTHON_WITHOUT_ENABLE_SHARED") + enable_shared = get_config_var("Py_ENABLE_SHARED") + if enable_shared == 1: + # Double-check if libpython is linked dynamically with python + lddout = check_output(["ldd", sys.executable]) + if 'libpython' not in lddout: + enable_shared = 0 + if enable_shared == 0: + defines.append("PYTHON_WITHOUT_ENABLE_SHARED") if hasattr(sys, "abiflags"): if "d" in sys.abiflags: From c86ba2fffd5682a7c11b2a9b6aeea989d020c621 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Wed, 7 Dec 2016 00:44:28 -0600 Subject: [PATCH 3/6] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 330dec289..dc59c9fcc 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 From a1d5849c20df152d25d047e312d669bd6776ca23 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Wed, 7 Dec 2016 01:03:51 -0600 Subject: [PATCH 4/6] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index dc59c9fcc..aded8e735 100644 --- a/setup.py +++ b/setup.py @@ -156,7 +156,7 @@ def build_extension(self, ext): if enable_shared == 1: # Double-check if libpython is linked dynamically with python lddout = check_output(["ldd", sys.executable]) - if 'libpython' not in lddout: + if b'libpython' not in lddout: enable_shared = 0 if enable_shared == 0: defines.append("PYTHON_WITHOUT_ENABLE_SHARED") From bd07eb0e100090be046c9d496675458ebe768e99 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Wed, 7 Dec 2016 01:10:17 -0600 Subject: [PATCH 5/6] Update .travis.yml no more python 2.6 - missing subprocess.check_output() --- .travis.yml | 1 - 1 file changed, 1 deletion(-) 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 From a5f7b5ab1303c88790dbf87f3f9e09e346f632d3 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Wed, 7 Dec 2016 11:50:54 +0100 Subject: [PATCH 6/6] Small cleanup. --- setup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index aded8e735..05ae35906 100644 --- a/setup.py +++ b/setup.py @@ -150,15 +150,16 @@ def build_extension(self, ext): defines.append("MONO_OSX") else: defines.append("MONO_LINUX") - + # Check if --enable-shared was set when Python was built enable_shared = get_config_var("Py_ENABLE_SHARED") - if enable_shared == 1: + 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 = 0 - if enable_shared == 0: + enable_shared = False + + if not enable_shared: defines.append("PYTHON_WITHOUT_ENABLE_SHARED") if hasattr(sys, "abiflags"):