From ea218da2c427087419628b8807b1a1c77a093476 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Tue, 22 Dec 2015 00:37:27 +0100 Subject: [PATCH 1/2] Bugfix in build scripts. Additional fix for #357, relates to #361. --- scripts/mk_util.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 2d1715655..e3f7d7107 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -715,6 +715,9 @@ def parse_options(): if IS_WINDOWS: # Installing under Windows doesn't make sense as the install prefix is used # but that doesn't make sense under Windows + # CMW: It makes perfectly good sense; the prefix is Python's sys.prefix, + # i.e., something along the lines of C:\Python\... At the moment we are not + # sure whether we would want to install libz3.dll into that directory though. PYTHON_INSTALL_ENABLED = False else: if not PYTHON_PACKAGE_DIR.startswith(PREFIX): @@ -1352,21 +1355,19 @@ class PythonInstallComponent(Component): if not PYTHON_INSTALL_ENABLED: return - if self.is_osx_hack(): - # Use full path that is outside of install prefix + if IS_WINDOWS or IS_OSX: + # Use full path that is possibly outside of install prefix self.pythonPkgDir = PYTHON_PACKAGE_DIR - self.in_prefix_install = False + self.in_prefix_install = PYTHON_PACKAGE_DIR.startswith(PREFIX) assert os.path.isabs(self.pythonPkgDir) else: - # Use path inside the prefix (should be the normal case) + # Use path inside the prefix (should be the normal case on Linux) + # CMW: Also normal on *BSD? assert PYTHON_PACKAGE_DIR.startswith(PREFIX) self.pythonPkgDir = strip_path_prefix(PYTHON_PACKAGE_DIR, PREFIX) assert not os.path.isabs(self.pythonPkgDir) assert self.in_prefix_install - def is_osx_hack(self): - return IS_OSX and not PYTHON_PACKAGE_DIR.startswith(PREFIX) - def main_component(self): return False From a30fe1e2ec28d503abbda5d448f1c6e0278ecbb8 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Tue, 22 Dec 2015 00:52:37 +0100 Subject: [PATCH 2/2] Followup to previous build fix. Relates to #357 and #361 --- scripts/mk_util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index e3f7d7107..e76eaf0bb 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -1348,6 +1348,7 @@ class DLLComponent(Component): class PythonInstallComponent(Component): def __init__(self, name, libz3Component): assert isinstance(libz3Component, DLLComponent) + global PYTHON_INSTALL_ENABLED Component.__init__(self, name, None, []) self.pythonPkgDir = None self.in_prefix_install = True