2023-03-06 13:14:24 +01:00
|
|
|
import subprocess
|
2015-11-21 00:43:50 +01:00
|
|
|
|
2023-03-06 13:14:24 +01:00
|
|
|
from build.makeproject import MakeProject
|
2015-11-21 00:43:50 +01:00
|
|
|
|
2023-03-06 13:14:24 +01:00
|
|
|
class ZlibProject(MakeProject):
|
2015-11-21 00:43:50 +01:00
|
|
|
def __init__(self, url, md5, installed,
|
|
|
|
**kwargs):
|
2023-03-06 13:14:24 +01:00
|
|
|
MakeProject.__init__(self, url, md5, installed, **kwargs)
|
|
|
|
|
|
|
|
def get_make_args(self, toolchain):
|
|
|
|
return MakeProject.get_make_args(self, toolchain) + [
|
|
|
|
'CC=' + toolchain.cc + ' ' + toolchain.cppflags + ' ' + toolchain.cflags,
|
|
|
|
'CPP=' + toolchain.cc + ' -E ' + toolchain.cppflags,
|
|
|
|
'AR=' + toolchain.ar,
|
|
|
|
'ARFLAGS=' + toolchain.arflags,
|
|
|
|
'RANLIB=' + toolchain.ranlib,
|
|
|
|
'LDSHARED=' + toolchain.cc + ' -shared',
|
|
|
|
'libz.a'
|
|
|
|
]
|
|
|
|
|
|
|
|
def get_make_install_args(self, toolchain):
|
|
|
|
return [
|
|
|
|
'RANLIB=' + toolchain.ranlib,
|
|
|
|
self.install_target
|
|
|
|
]
|
2015-11-21 00:43:50 +01:00
|
|
|
|
2021-08-28 22:41:31 +02:00
|
|
|
def _build(self, toolchain):
|
2015-11-21 00:43:50 +01:00
|
|
|
src = self.unpack(toolchain, out_of_tree=False)
|
|
|
|
|
2023-03-06 13:14:24 +01:00
|
|
|
subprocess.check_call(['./configure', '--prefix=' + toolchain.install_prefix, '--static'],
|
|
|
|
cwd=src, env=toolchain.env)
|
|
|
|
self.build_make(toolchain, src)
|