Re: [PATCH v1 2/6] waf: Add path-mappings feature

2020-09-16 Thread Chris Johns
On 16/9/20 8:06 pm, jan.som...@dlr.de wrote:
> Hi Chris,
> 
>> -Original Message-
>> From: Chris Johns 
>> Sent: Thursday, September 10, 2020 6:44 AM
>> To: Sommer, Jan ; devel@rtems.org
>> Subject: Re: [PATCH v1 2/6] waf: Add path-mappings feature
>>
>> On 15/8/20 5:57 am, Jan Sommer wrote:
>>> - 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
>>
>> I will need to take in this patch into my development libbsd branchs and
>> merge.
>> I will try and get this done ASAP.
>>
> 
> I am not sure I understand everything completely.
> Do you need me to update anything in the patch?
> 

Thanks but there is no need to do anything. The patches have been merged. I will
not bother about the 5 branch as I think the release branches will change around
once I get to that task.

My review of the build system found that part of this patch set on 6-freebsd-12
and so I picked it up and integrated it with my changes I had for master.

Chrus
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


RE: [PATCH v1 2/6] waf: Add path-mappings feature

2020-09-16 Thread Jan.Sommer
Hi Chris,

> -Original Message-
> From: Chris Johns 
> Sent: Thursday, September 10, 2020 6:44 AM
> To: Sommer, Jan ; devel@rtems.org
> Subject: Re: [PATCH v1 2/6] waf: Add path-mappings feature
> 
> On 15/8/20 5:57 am, Jan Sommer wrote:
> > - 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
> 
> I will need to take in this patch into my development libbsd branchs and
> merge.
> I will try and get this done ASAP.
> 

I am not sure I understand everything completely.
Do you need me to update anything in the patch?

Best regards,

   Jan

> I am refactoring parts of the libbsd builder.py and related files to separate
> the user and kernel space headers. There are conflicts in these files that
> become apparent with some of the FreeBSD source. It looks like I based my
> work on this patch and these changes so I hope it will be easy to sort out. I
> would prefer to bring this into my branch, sort out what is happening and
> push them.
> Sorry this will not happen today but it will get done as it is top of my list.
> 
> Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH v1 2/6] waf: Add path-mappings feature

2020-09-09 Thread Chris Johns
On 15/8/20 5:57 am, Jan Sommer wrote:
> - 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

I will need to take in this patch into my development libbsd branchs and merge.
I will try and get this done ASAP.

I am refactoring parts of the libbsd builder.py and related files to separate
the user and kernel space headers. There are conflicts in these files that
become apparent with some of the FreeBSD source. It looks like I based my work
on this patch and these changes so I hope it will be easy to sort out. I would
prefer to bring this into my branch, sort out what is happening and push them.
Sorry this will not happen today but it will get done as it is top of my list.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v1 2/6] waf: Add path-mappings feature

2020-08-14 Thread Jan Sommer
- 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
---
 libbsd.py |  8 
 waf_libbsd.py | 13 +++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/libbsd.py b/libbsd.py
index 511de7af..e02226f3 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -90,6 +90,14 @@ _defaults = {
 'cpu-include-paths': ['rtemsbsd/@CPU@/include',
   'freebsd/sys/@CPU@/include'],
 
+#
+# Map paths based on RTEMS naming to FreeBSD naming.
+#
+'path-mappings': [ # (source, targets)
+# i386
+('freebsd/sys/i386/include', ['freebsd/sys/x86/include', 
'freebsd/sys/i386/include']),
+],
+
 # The path where headers will be copied during build.
 'build-include-path': ['build-include'],
 
diff --git a/waf_libbsd.py b/waf_libbsd.py
index 9ac5bf35..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":
-includes += ['freebsd/sys/x86/include']
 for i in config['cpu-include-paths']:
 includes += [i.replace('@CPU@', cpu)]
 if 'include-paths' in config:
@@ -222,6 +220,17 @@ class Builder(builder.ModuleManager):
 buildinclude = buildinclude[0]
 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
 #
-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel