On 4/2/19 6:48 pm, Sebastian Huber wrote:
> Hello,
> 
> we have configuration checks (config_cc) in rtems-tools in three different
> directories:
> 
> rtemstoolkit/wscript
> misc/wscript
> tester/covoar/wscript
> 
> Why can't we do the checks in the top-level wscript and use a single top-level
> config.h header? We need custom code to check for function declarations.

I am not in favor of this happening. As stated before we can add support via
python. At the moment the builds are separate and waf brings them together, ie
the build stage is not recursive. I see other better way to achieve the same 
result.

> Currently these tests are broken.

Yes they are. I attach checks.py, place in top dir, then in the rtemstoolkit 
add:

 import checks

and change the kill test to:

 checks.check_cc_func_name(conf, function_name = 'kill', mandatory = False)

What I provide needs more work but it shows what can be done. Sorry I do not
have time to concentrate on this. A cache could be added to speed up repeated
the tests but you would need to make sure all the arguments are the same.

Note, the test is similar to the method autconf uses.

Chris
import os

def check_cc_func_name(conf, *k, **kw):
    fragment  = ['#ifdef __cplusplus']
    fragment += ['extern "C"']
    fragment += ['#endif']
    fragment += ['int %s ();']
    fragment += ['int main ()']
    fragment += ['{']
    fragment += [' return %s ();']
    fragment += ['}']
    func = kw['function_name']
    del kw['function_name']
    kw['fragment'] = os.linesep.join(fragment) % (func, func)
    kw['msg'] = 'Checking for function %s' % (func)
    conf.check_cc(**kw)
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to