diff options
author | Jan Sommer <jan.sommer@dlr.de> | 2021-06-03 10:35:09 +0200 |
---|---|---|
committer | Jan Sommer <jan.sommer@dlr.de> | 2021-06-07 10:37:52 +0200 |
commit | d5d7e545797ff6a36ae209d0ff999f3fc4be784d (patch) | |
tree | 046bd50c4fc7060c50f019c3d08077d42c4384aa /waf_libbsd.py | |
parent | libbsd nfs.c: Change filesystem utime_h handler to utimens_h (diff) | |
download | rtems-libbsd-d5d7e545797ff6a36ae209d0ff999f3fc4be784d.tar.bz2 |
waf_libbsd.py: Apply path-mappings to header-paths
Diffstat (limited to 'waf_libbsd.py')
-rw-r--r-- | waf_libbsd.py | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/waf_libbsd.py b/waf_libbsd.py index 070d3eac..0bd4fd3d 100644 --- a/waf_libbsd.py +++ b/waf_libbsd.py @@ -538,17 +538,24 @@ class Builder(builder.ModuleManager): if 'header-paths' in config: headerPaths = config['header-paths'] cpu = bld.get_env()['RTEMS_ARCH'] - if cpu == "i386": - cpu = 'x86' for headers in headerPaths: - # Get the dest path - ipath = os.path.join(arch_inc_path, headers[2]) - start_dir = bld.path.find_dir(headers[0].replace('@CPU@', cpu)) - if start_dir != None: - bld.install_files("${PREFIX}/" + ipath, - start_dir.ant_glob(headers[1]), - cwd=start_dir, - relative_trick=True) + paths = [headers[0].replace('@CPU@', cpu)] + # Apply the path mappings + for source, targets in config['path-mappings']: + if source in paths: + i = paths.index(source) + paths.remove(source) + paths[i:i] = targets + + for hp in paths: + # Get the dest path + ipath = os.path.join(arch_inc_path, headers[2]) + start_dir = bld.path.find_dir(hp) + if start_dir != None: + bld.install_files("${PREFIX}/" + ipath, + start_dir.ant_glob(headers[1]), + cwd=start_dir, + relative_trick=True) bld.install_files(os.path.join("${PREFIX}", arch_inc_path, module_header_path), |