From cbdeec00de5c40b168adf5395a9e2e7c55ceee7c Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Thu, 5 Mar 2020 21:18:05 +1100 Subject: waf: Change the test configure check for libdebugger to it's lib - Add support for a 'test-if-library' - Use rtems_waf's 'test_application()' fragment in the check_cc call Closes #3948 --- waf_libbsd.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'waf_libbsd.py') diff --git a/waf_libbsd.py b/waf_libbsd.py index 84f22b76..e6f3c21c 100644 --- a/waf_libbsd.py +++ b/waf_libbsd.py @@ -109,7 +109,10 @@ class Builder(builder.ModuleManager): if config != 'default': if 'configure' not in data: data['configure'] = { } - data['configure'][config] = frag[0][2][1] + configTest = frag[1]['configTest'] + if configTest not in data['configure']: + data['configure'][configTest] = { } + data['configure'][configTest][config] = frag[0][2][1] if type(frag[1]) is list: if config not in d[cpu]: d[cpu][config] = [] @@ -149,12 +152,23 @@ class Builder(builder.ModuleManager): def bsp_configure(self, conf, arch_bsp): if 'configure' in self.data: - for cfg in self.data['configure']: - for h in self.data['configure'][cfg]: - conf.check(header_name = h, - features = "c", - includes = conf.env.IFLAGS, - mandatory = False) + for configTest in self.data['configure']: + for cfg in self.data['configure'][configTest]: + if configTest == 'header': + for h in self.data['configure'][configTest][cfg]: + conf.check(header_name = h, + features = "c", + includes = conf.env.IFLAGS, + mandatory = False) + elif configTest == 'library': + for l in self.data['configure'][configTest][cfg]: + conf.check_cc(lib = l, + fragment = rtems.test_application(), + execute = False, + mandatory = False) + else: + bld.fatal('invalid config test: %s' % (configTest)) + def build(self, bld): # -- cgit v1.2.3