|
|
@ -16,6 +16,7 @@ from waflib import Errors, Context, Utils |
|
|
|
from waflib.Configure import conf |
|
|
|
from waflib.Configure import conf |
|
|
|
from waflib.Tools import compiler_c, compiler_cxx |
|
|
|
from waflib.Tools import compiler_c, compiler_cxx |
|
|
|
from waflib.Tools import clang, clangxx, gcc, gxx |
|
|
|
from waflib.Tools import clang, clangxx, gcc, gxx |
|
|
|
|
|
|
|
from waflib.Tools import c_config |
|
|
|
from waflib import Logs |
|
|
|
from waflib import Logs |
|
|
|
|
|
|
|
|
|
|
|
import os |
|
|
|
import os |
|
|
@ -112,19 +113,19 @@ def _filter_supported_cxx_compilers(*compilers): |
|
|
|
l = compiler_cxx.cxx_compiler[k] |
|
|
|
l = compiler_cxx.cxx_compiler[k] |
|
|
|
compiler_cxx.cxx_compiler[k] = [c for c in compilers if c in l] |
|
|
|
compiler_cxx.cxx_compiler[k] = [c for c in compilers if c in l] |
|
|
|
|
|
|
|
|
|
|
|
@conf |
|
|
|
def _set_pkgconfig_crosscompilation_wrapper(cfg): |
|
|
|
def find_toolchain_program(cfg, filename, **kw): |
|
|
|
original_validatecfg = cfg.validate_cfg |
|
|
|
filename = Utils.to_list(filename) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not kw.get('var', ''): |
|
|
|
@conf |
|
|
|
# just copy from the original implementation |
|
|
|
def new_validate_cfg(kw): |
|
|
|
kw['var'] = re.sub(r'[-.]', '_', filename[0].upper()) |
|
|
|
if not 'path' in kw: |
|
|
|
|
|
|
|
if not cfg.env.PKGCONFIG: |
|
|
|
|
|
|
|
cfg.find_program('%s-pkg-config' % cfg.env.TOOLCHAIN, var='PKGCONFIG') |
|
|
|
|
|
|
|
kw['path'] = cfg.env.PKGCONFIG |
|
|
|
|
|
|
|
|
|
|
|
if cfg.env.TOOLCHAIN != 'native': |
|
|
|
original_validatecfg(kw) |
|
|
|
for i, name in enumerate(filename): |
|
|
|
|
|
|
|
filename[i] = '%s-%s' % (cfg.env.TOOLCHAIN, name) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return cfg.find_program(filename, **kw) |
|
|
|
cfg.validate_cfg = new_validate_cfg |
|
|
|
|
|
|
|
|
|
|
|
def configure(cfg): |
|
|
|
def configure(cfg): |
|
|
|
_filter_supported_c_compilers('gcc', 'clang') |
|
|
|
_filter_supported_c_compilers('gcc', 'clang') |
|
|
@ -138,9 +139,10 @@ def configure(cfg): |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
cfg.find_toolchain_program('ar') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg.msg('Using toolchain', cfg.env.TOOLCHAIN) |
|
|
|
cfg.msg('Using toolchain', cfg.env.TOOLCHAIN) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_set_pkgconfig_crosscompilation_wrapper(cfg) |
|
|
|
|
|
|
|
cfg.find_program('%s-ar' % cfg.env.TOOLCHAIN, var='AR', quiet=True) |
|
|
|
cfg.load('compiler_cxx compiler_c') |
|
|
|
cfg.load('compiler_cxx compiler_c') |
|
|
|
|
|
|
|
|
|
|
|
if not cfg.options.disable_gccdeps: |
|
|
|
if not cfg.options.disable_gccdeps: |
|
|
|