Line 0
Link Here
|
|
|
1 |
--- scripts/mk_util.py.orig 2015-04-29 14:40:46 UTC |
2 |
+++ scripts/mk_util.py |
3 |
@@ -948,7 +948,7 @@ class LibComponent(Component): |
4 |
|
5 |
def mk_install(self, out): |
6 |
for include in self.includes2install: |
7 |
- out.write('\t@cp %s %s\n' % (os.path.join(self.to_src_dir, include), os.path.join('$(PREFIX)', 'include', include))) |
8 |
+ out.write('\t@cp %s %s\n' % (os.path.join(self.to_src_dir, include), os.path.join('$(DESTDIR)/$(PREFIX)', 'include', include))) |
9 |
|
10 |
def mk_uninstall(self, out): |
11 |
for include in self.includes2install: |
12 |
@@ -1034,7 +1034,7 @@ class ExeComponent(Component): |
13 |
def mk_install(self, out): |
14 |
if self.install: |
15 |
exefile = '%s$(EXE_EXT)' % self.exe_name |
16 |
- out.write('\t@cp %s %s\n' % (exefile, os.path.join('$(PREFIX)', 'bin', exefile))) |
17 |
+ out.write('\t@cp %s %s\n' % (exefile, os.path.join('$(DESTDIR)/$(PREFIX)', 'bin', exefile))) |
18 |
|
19 |
def mk_uninstall(self, out): |
20 |
exefile = '%s$(EXE_EXT)' % self.exe_name |
21 |
@@ -1180,11 +1180,11 @@ class DLLComponent(Component): |
22 |
def mk_install(self, out): |
23 |
if self.install: |
24 |
dllfile = '%s$(SO_EXT)' % self.dll_name |
25 |
- out.write('\t@cp %s %s\n' % (dllfile, os.path.join('$(PREFIX)', 'lib', dllfile))) |
26 |
- out.write('\t@cp %s %s\n' % (dllfile, os.path.join(PYTHON_PACKAGE_DIR, dllfile))) |
27 |
+ out.write('\t@cp %s %s\n' % (dllfile, os.path.join('$(DESTDIR)/$(PREFIX)', 'lib', dllfile))) |
28 |
+ out.write('\t@cp %s %s\n' % (dllfile, os.path.join('$(DESTDIR)' + PYTHON_PACKAGE_DIR, dllfile))) |
29 |
if self.static: |
30 |
libfile = '%s$(LIB_EXT)' % self.dll_name |
31 |
- out.write('\t@cp %s %s\n' % (libfile, os.path.join('$(PREFIX)', 'lib', libfile))) |
32 |
+ out.write('\t@cp %s %s\n' % (libfile, os.path.join('$(DESTDIR)/$(PREFIX)', 'lib', libfile))) |
33 |
|
34 |
|
35 |
def mk_uninstall(self, out): |
36 |
@@ -1359,8 +1359,8 @@ class JavaDLLComponent(Component): |
37 |
def mk_install(self, out): |
38 |
if is_java_enabled() and self.install: |
39 |
dllfile = '%s$(SO_EXT)' % self.dll_name |
40 |
- out.write('\t@cp %s %s\n' % (dllfile, os.path.join('$(PREFIX)', 'lib', dllfile))) |
41 |
- out.write('\t@cp %s.jar %s.jar\n' % (self.package_name, os.path.join('$(PREFIX)', 'lib', self.package_name))) |
42 |
+ out.write('\t@cp %s %s\n' % (dllfile, os.path.join('$(DESTDIR)/$(PREFIX)', 'lib', dllfile))) |
43 |
+ out.write('\t@cp %s.jar %s.jar\n' % (self.package_name, os.path.join('$(DESTDIR)/$(PREFIX)', 'lib', self.package_name))) |
44 |
|
45 |
def mk_uninstall(self, out): |
46 |
if is_java_enabled() and self.install: |
47 |
@@ -1873,6 +1873,7 @@ def mk_config(): |
48 |
CPPFLAGS = '%s -D_TRACE' % CPPFLAGS |
49 |
CXXFLAGS = '%s -msse -msse2' % CXXFLAGS |
50 |
config.write('PREFIX=%s\n' % PREFIX) |
51 |
+ config.write('DESTDIR?=\n') |
52 |
config.write('CC=%s\n' % CC) |
53 |
config.write('CXX=%s\n' % CXX) |
54 |
config.write('CXXFLAGS=%s %s\n' % (CPPFLAGS, CXXFLAGS)) |
55 |
@@ -1926,12 +1927,12 @@ def mk_install(out): |
56 |
out.write('\t@mkdir -p %s\n' % os.path.join('$(PREFIX)', 'lib')) |
57 |
for c in get_components(): |
58 |
c.mk_install(out) |
59 |
- out.write('\t@cp z3*.py %s\n' % PYTHON_PACKAGE_DIR) |
60 |
+ out.write('\t@cp z3*.py %s\n' % ('$(DESTDIR)/' + PYTHON_PACKAGE_DIR)) |
61 |
if sys.version >= "3": |
62 |
out.write('\t@cp %s*.pyc %s\n' % (os.path.join('__pycache__', 'z3'), |
63 |
- os.path.join(PYTHON_PACKAGE_DIR, '__pycache__'))) |
64 |
+ os.path.join('$(DESTDIR)/' + PYTHON_PACKAGE_DIR, '__pycache__'))) |
65 |
else: |
66 |
- out.write('\t@cp z3*.pyc %s\n' % PYTHON_PACKAGE_DIR) |
67 |
+ out.write('\t@cp z3*.pyc %s\n' % ('$(DESTDIR)/' + PYTHON_PACKAGE_DIR)) |
68 |
out.write('\t@echo Z3 was successfully installed.\n') |
69 |
if PYTHON_PACKAGE_DIR != distutils.sysconfig.get_python_lib(): |
70 |
if os.uname()[0] == 'Darwin': |