summaryrefslogtreecommitdiffstats
path: root/waf_libbsd.py
diff options
context:
space:
mode:
authorJan Sommer <jan.sommer@dlr.de>2020-04-17 10:24:03 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-04-17 13:15:50 +0200
commitdbf72c205db0ee6a078d04c33f84531f084300e2 (patch)
tree54911076f6c409037b7672f4b464feb17b441d2a /waf_libbsd.py
parenti386: Add missing files from FreeBSD (diff)
downloadrtems-libbsd-dbf72c205db0ee6a078d04c33f84531f084300e2.tar.bz2
waf: Add path-mappings feature
- path-mappings allow to fix autogenerated include paths for some corner cases of target platforms without the need to change the build system - Currently used for i386 based bsps
Diffstat (limited to 'waf_libbsd.py')
-rw-r--r--waf_libbsd.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/waf_libbsd.py b/waf_libbsd.py
index 02816bb7..14f2ae78 100644
--- a/waf_libbsd.py
+++ b/waf_libbsd.py
@@ -210,8 +210,6 @@ class Builder(builder.ModuleManager):
buildinclude = 'build-include'
if 'cpu-include-paths' in config:
cpu = bld.get_env()['RTEMS_ARCH']
- if cpu == "i386":
- cpu = 'x86'
for i in config['cpu-include-paths']:
includes += [i.replace('@CPU@', cpu)]
if 'include-paths' in config:
@@ -223,6 +221,17 @@ class Builder(builder.ModuleManager):
includes += [buildinclude]
#
+ # Path mappings
+ #
+ if 'path-mappings' in config:
+ for source, target in config['path-mappings']:
+ if source in includes:
+ target = [target] if isinstance(target, str) else target
+ i = includes.index(source)
+ includes.remove(source)
+ includes[i:i] = target
+
+ #
# Collect the libbsd uses
#
libbsd_use = []