3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 22:23:22 +00:00
This commit is contained in:
Nikolaj Bjorner 2015-12-22 10:46:50 -08:00
commit ea876715e3

View file

@ -715,6 +715,9 @@ def parse_options():
if IS_WINDOWS: if IS_WINDOWS:
# Installing under Windows doesn't make sense as the install prefix is used # Installing under Windows doesn't make sense as the install prefix is used
# but that doesn't make sense under Windows # 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 PYTHON_INSTALL_ENABLED = False
else: else:
if not PYTHON_PACKAGE_DIR.startswith(PREFIX): if not PYTHON_PACKAGE_DIR.startswith(PREFIX):
@ -1345,6 +1348,7 @@ class DLLComponent(Component):
class PythonInstallComponent(Component): class PythonInstallComponent(Component):
def __init__(self, name, libz3Component): def __init__(self, name, libz3Component):
assert isinstance(libz3Component, DLLComponent) assert isinstance(libz3Component, DLLComponent)
global PYTHON_INSTALL_ENABLED
Component.__init__(self, name, None, []) Component.__init__(self, name, None, [])
self.pythonPkgDir = None self.pythonPkgDir = None
self.in_prefix_install = True self.in_prefix_install = True
@ -1352,21 +1356,19 @@ class PythonInstallComponent(Component):
if not PYTHON_INSTALL_ENABLED: if not PYTHON_INSTALL_ENABLED:
return return
if self.is_osx_hack(): if IS_WINDOWS or IS_OSX:
# Use full path that is outside of install prefix # Use full path that is possibly outside of install prefix
self.pythonPkgDir = PYTHON_PACKAGE_DIR 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) assert os.path.isabs(self.pythonPkgDir)
else: 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) assert PYTHON_PACKAGE_DIR.startswith(PREFIX)
self.pythonPkgDir = strip_path_prefix(PYTHON_PACKAGE_DIR, PREFIX) self.pythonPkgDir = strip_path_prefix(PYTHON_PACKAGE_DIR, PREFIX)
assert not os.path.isabs(self.pythonPkgDir) assert not os.path.isabs(self.pythonPkgDir)
assert self.in_prefix_install assert self.in_prefix_install
def is_osx_hack(self):
return IS_OSX and not PYTHON_PACKAGE_DIR.startswith(PREFIX)
def main_component(self): def main_component(self):
return False return False