build/python/autotools: add properties "ldflags", "libs", "install_target"

This commit is contained in:
Max Kellermann 2018-01-05 07:56:49 +01:00
parent 4303aaa9b8
commit 1ca70d9759
1 changed files with 9 additions and 3 deletions

View File

@ -6,11 +6,17 @@ class AutotoolsProject(Project):
def __init__(self, url, md5, installed, configure_args=[], def __init__(self, url, md5, installed, configure_args=[],
autogen=False, autogen=False,
cppflags='', cppflags='',
ldflags='',
libs='',
install_target='install',
**kwargs): **kwargs):
Project.__init__(self, url, md5, installed, **kwargs) Project.__init__(self, url, md5, installed, **kwargs)
self.configure_args = configure_args self.configure_args = configure_args
self.autogen = autogen self.autogen = autogen
self.cppflags = cppflags self.cppflags = cppflags
self.ldflags = ldflags
self.libs = libs
self.install_target = install_target
def build(self, toolchain): def build(self, toolchain):
src = self.unpack(toolchain) src = self.unpack(toolchain)
@ -32,8 +38,8 @@ class AutotoolsProject(Project):
'CFLAGS=' + toolchain.cflags, 'CFLAGS=' + toolchain.cflags,
'CXXFLAGS=' + toolchain.cxxflags, 'CXXFLAGS=' + toolchain.cxxflags,
'CPPFLAGS=' + toolchain.cppflags + ' ' + self.cppflags, 'CPPFLAGS=' + toolchain.cppflags + ' ' + self.cppflags,
'LDFLAGS=' + toolchain.ldflags, 'LDFLAGS=' + toolchain.ldflags + ' ' + self.ldflags,
'LIBS=' + toolchain.libs, 'LIBS=' + toolchain.libs + ' ' + self.libs,
'AR=' + toolchain.ar, 'AR=' + toolchain.ar,
'RANLIB=' + toolchain.ranlib, 'RANLIB=' + toolchain.ranlib,
'STRIP=' + toolchain.strip, 'STRIP=' + toolchain.strip,
@ -45,5 +51,5 @@ class AutotoolsProject(Project):
subprocess.check_call(configure, cwd=build, env=toolchain.env) subprocess.check_call(configure, cwd=build, env=toolchain.env)
subprocess.check_call(['/usr/bin/make', '--quiet', '-j12'], subprocess.check_call(['/usr/bin/make', '--quiet', '-j12'],
cwd=build, env=toolchain.env) cwd=build, env=toolchain.env)
subprocess.check_call(['/usr/bin/make', '--quiet', 'install'], subprocess.check_call(['/usr/bin/make', '--quiet', self.install_target],
cwd=build, env=toolchain.env) cwd=build, env=toolchain.env)