Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

2017-08-19 Thread Chris Johns
On 17/8/17 11:46 am, Sichen Zhao wrote:
>>> On 17 Aug 2017, at 1:37 am, Sichen Zhao  wrote:
>>>
>>> Hi Chris,
>>> Just for remind: can the openssl patch get merged?
>> Yes they can. I am sorry I had some pressing issues locally and a few 
>> patches queued. I am on the road today and will see if I can get to them 
>> remotely. It is top of my list.
> Np, and thank you.

Pushed.

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


Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

2017-08-16 Thread Sichen Zhao
>> On 17 Aug 2017, at 1:37 am, Sichen Zhao  wrote:
>>
>> Hi Chris,
>> Just for remind: can the openssl patch get merged?
> Yes they can. I am sorry I had some pressing issues locally and a few patches 
> queued. I am on the road today and will see if I can get to them remotely. It 
> is top of my list.
Np, and thank you.

Sichen
>
> Chris
>
>
>

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


Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

2017-08-16 Thread Chris Johns

> On 17 Aug 2017, at 1:37 am, Sichen Zhao  wrote:
> 
> Hi Chris, 
> Just for remind: can the openssl patch get merged?

Yes they can. I am sorry I had some pressing issues locally and a few patches 
queued. I am on the road today and will see if I can get to them remotely. It 
is top of my list. 

Chris



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


Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

2017-08-16 Thread Sichen Zhao
Hi Chris, 
Just for remind: can the openssl patch get merged?

Best Regards
Sichen Zhao


From: devel <devel-boun...@rtems.org> on behalf of Sichen Zhao 
<zsc19940...@outlook.com>
Sent: Saturday, August 12, 2017 17:24
To: Christian Mauderer; Chris Johns; Sichen Zhao; devel@rtems.org
Cc: Christian Mauderer
Subject: Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

Ok, the branch  with only these four patches is here:

https://github.com/hahchenchen/rtems-libbsd/tree/usb_wpa_openssl

Best Regards
Sichen Zhao


From: Christian Mauderer <l...@c-mauderer.de>
Sent: Saturday, August 12, 2017 17:05
To: Chris Johns; Sichen Zhao; Sichen Zhao; devel@rtems.org
Cc: Christian Mauderer
Subject: Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

Am 12.08.2017 um 05:57 schrieb Chris Johns:
> On 12/08/2017 13:30, Sichen Zhao wrote:
>>>> +for headers in header_build_copy_paths:
>>>> +target = os.path.join("build-include", headers[2])
>>>> +start_dir = bld.path.find_dir(headers[0])
>>>> +for header in start_dir.ant_glob(os.path.join("**/", headers[1])):
>>> Remove the '/':
>>>
>>> for header in start_dir.ant_glob(os.path.join("**", headers[1])):
>>>
>>> OK to push once fixed.
>>>
>>> Chris
>> This already done in the PATCH v2 2/4.
>> -self.add('for header in
>> start_dir.ant_glob(os.path.join("**/", headers[1])):')
>> +self.add('for header in start_dir.ant_glob(headers[1]):')
>
> Excellent. These patches look good. Christian let me know if you want me to 
> do this?
>
> Thanks for your hard work.
>
> Chris

Hello Chris,

yes, I think the patches are ready for merge. The little nitpick in the
os.path.join is something that is replaced in the second patch anyway
(like Sichen already mentioned) so I don't think it's worth the effort
to change it.

@Sichen: The patch 2/4 has been posted two times and the patch
containing the raw import is missing (most likely due to the size).
Could you post a link to a branch on your github repo with only these
four patches applied to the current master so Chris can make the merge?

Kind regards

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


Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

2017-08-12 Thread Sichen Zhao
Ok, the branch  with only these four patches is here:

https://github.com/hahchenchen/rtems-libbsd/tree/usb_wpa_openssl

Best Regards
Sichen Zhao


From: Christian Mauderer <l...@c-mauderer.de>
Sent: Saturday, August 12, 2017 17:05
To: Chris Johns; Sichen Zhao; Sichen Zhao; devel@rtems.org
Cc: Christian Mauderer
Subject: Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

Am 12.08.2017 um 05:57 schrieb Chris Johns:
> On 12/08/2017 13:30, Sichen Zhao wrote:
>>>> +for headers in header_build_copy_paths:
>>>> +target = os.path.join("build-include", headers[2])
>>>> +start_dir = bld.path.find_dir(headers[0])
>>>> +for header in start_dir.ant_glob(os.path.join("**/", headers[1])):
>>> Remove the '/':
>>>
>>> for header in start_dir.ant_glob(os.path.join("**", headers[1])):
>>>
>>> OK to push once fixed.
>>>
>>> Chris
>> This already done in the PATCH v2 2/4.
>> -self.add('for header in
>> start_dir.ant_glob(os.path.join("**/", headers[1])):')
>> +self.add('for header in start_dir.ant_glob(headers[1]):')
>
> Excellent. These patches look good. Christian let me know if you want me to 
> do this?
>
> Thanks for your hard work.
>
> Chris

Hello Chris,

yes, I think the patches are ready for merge. The little nitpick in the
os.path.join is something that is replaced in the second patch anyway
(like Sichen already mentioned) so I don't think it's worth the effort
to change it.

@Sichen: The patch 2/4 has been posted two times and the patch
containing the raw import is missing (most likely due to the size).
Could you post a link to a branch on your github repo with only these
four patches applied to the current master so Chris can make the merge?

Kind regards

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


Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

2017-08-12 Thread Christian Mauderer
Am 12.08.2017 um 05:57 schrieb Chris Johns:
> On 12/08/2017 13:30, Sichen Zhao wrote:
 +for headers in header_build_copy_paths:
 +target = os.path.join("build-include", headers[2])
 +start_dir = bld.path.find_dir(headers[0])
 +for header in start_dir.ant_glob(os.path.join("**/", headers[1])):
>>> Remove the '/':
>>>
>>> for header in start_dir.ant_glob(os.path.join("**", headers[1])):
>>>
>>> OK to push once fixed.
>>>
>>> Chris
>> This already done in the PATCH v2 2/4.
>> -self.add('for header in 
>> start_dir.ant_glob(os.path.join("**/", headers[1])):')
>> +self.add('for header in start_dir.ant_glob(headers[1]):')
> 
> Excellent. These patches look good. Christian let me know if you want me to 
> do this?
> 
> Thanks for your hard work.
> 
> Chris

Hello Chris,

yes, I think the patches are ready for merge. The little nitpick in the
os.path.join is something that is replaced in the second patch anyway
(like Sichen already mentioned) so I don't think it's worth the effort
to change it.

@Sichen: The patch 2/4 has been posted two times and the patch
containing the raw import is missing (most likely due to the size).
Could you post a link to a branch on your github repo with only these
four patches applied to the current master so Chris can make the merge?

Kind regards

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


Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

2017-08-11 Thread Chris Johns
On 12/08/2017 13:30, Sichen Zhao wrote:
>>> +for headers in header_build_copy_paths:
>>> +target = os.path.join("build-include", headers[2])
>>> +start_dir = bld.path.find_dir(headers[0])
>>> +for header in start_dir.ant_glob(os.path.join("**/", headers[1])):
>> Remove the '/':
>>
>> for header in start_dir.ant_glob(os.path.join("**", headers[1])):
>>
>> OK to push once fixed.
>>
>> Chris
> This already done in the PATCH v2 2/4.
> -self.add('for header in 
> start_dir.ant_glob(os.path.join("**/", headers[1])):')
> +self.add('for header in start_dir.ant_glob(headers[1]):')

Excellent. These patches look good. Christian let me know if you want me to do 
this?

Thanks for your hard work.

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


Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

2017-08-11 Thread Sichen Zhao
> On 11/8/17 8:39 pm, Sichen Zhao wrote:
>> From: Christian Mauderer 
>>
>> There are some cases, where a header is installed into a directory with
>> a different name then it's source directory. In that case, the build
>> might fail because the header is not found. One example would be the
>> . The source for this file is in
>> freebsd/crypto/openssl/crypto/opensslv.h.
>>
>> To allow the build to work in such cases too, copy such files into a
>> temporary location in the build tree.
>> ---
>>   builder.py   | 14 ++
>>   libbsd_waf.py| 15 +++
>>   waf_generator.py | 24 +++-
>>   3 files changed, 52 insertions(+), 1 deletion(-)
>>
>> diff --git a/builder.py b/builder.py
>> index bb633cb..1be1ced 100755
>> --- a/builder.py
>> +++ b/builder.py
>> @@ -194,6 +194,10 @@ def includes():
>>   '-ImDNSResponder/mDNSPosix',
>>   '-Itestsuite/include']
>>   
>> +def buildInclude():
>> +""" Returns the path where headers will be copied during build. """
>> +return 'build-include'
>> +
>>   def cpuIncludes():
>>   return ['-Irtemsbsd/@CPU@/include',
>>   '-Ifreebsd/sys/@CPU@/include']
>> @@ -205,6 +209,16 @@ def cxxflags():
>>   return []
>>   
>>   def headerPaths():
>> +""" Returns a list of information about what header files should be
>> +installed.
>> +
>> +The list is also used to find headers with a local path that doesn't 
>> match
>> +it's dest path. Due to the difference in the path name such files are
>> +problematic during the build if they are included using their later
>> +installation path (dest path) name. Therefore they are copied into a
>> +sub-directory of the build path so that they can be included with their
>> +normal installation path. """
>> +
>>   # local path  wildcard dest 
>> path
>>   return [('rtemsbsd/include',  '*.h',   ''),
>>   ('rtemsbsd/mghttpd',  'mongoose.h',
>> 'mghttpd'),
>> diff --git a/libbsd_waf.py b/libbsd_waf.py
>> index aee2e7a..8bc2b34 100644
>> --- a/libbsd_waf.py
>> +++ b/libbsd_waf.py
>> @@ -83,6 +83,7 @@ def build(bld):
>>   includes += ["mDNSResponder/mDNSShared"]
>>   includes += ["mDNSResponder/mDNSPosix"]
>>   includes += ["testsuite/include"]
>> +includes += ["build-include"]
>>   
>>   # Collect the libbsd uses
>>   libbsd_use = []
>> @@ -123,6 +124,20 @@ def build(bld):
>>   rule = "sed -e 's/@NET_CFG_SELF_IP@/%s/' -e 
>> 's/@NET_CFG_NETMASK@/%s/' -e 's/@NET_CFG_PEER_IP@/%s/' -e 
>> 's/@NET_CFG_GATEWAY_IP@/%s/' < ${SRC} > ${TGT}" % (net_cfg_self_ip, 
>> net_cfg_netmask, net_cfg_peer_ip, net_cfg_gateway_ip),
>>   update_outputs = True)
>>   
>> +# copy headers if necessary
>> +header_build_copy_paths = [
>> +  ]
>> +for headers in header_build_copy_paths:
>> +target = os.path.join("build-include", headers[2])
>> +start_dir = bld.path.find_dir(headers[0])
>> +for header in start_dir.ant_glob(os.path.join("**/", headers[1])):
> Remove the '/':
>
> for header in start_dir.ant_glob(os.path.join("**", headers[1])):
>
> OK to push once fixed.
>
> Chris
This already done in the PATCH v2 2/4.
-self.add('for header in 
start_dir.ant_glob(os.path.join("**/", headers[1])):')
+self.add('for header in start_dir.ant_glob(headers[1]):')
>
>> +relsourcepath = header.path_from(start_dir)
>> +targetheader = os.path.join(target, relsourcepath)
>> +bld(features = 'subst',
>> +target = targetheader,
>> +source = header,
>> +is_copy = True)
>> +
>>   # KVM Symbols
>>   bld(target = "rtemsbsd/rtems/rtems-kernel-kvm-symbols.c",
>>   source = "rtemsbsd/rtems/generate_kvm_symbols",
>> diff --git a/waf_generator.py b/waf_generator.py
>> index 35fe35f..fdc2210 100755
>> --- a/waf_generator.py
>> +++ b/waf_generator.py
>> @@ -392,7 +392,7 @@ class ModuleManager(builder.ModuleManager):
>>   self.add('if bld.get_env()["RTEMS_ARCH"] == "i386":')
>>   self.add('for i in %r:' % (builder.cpuIncludes()))
>>   self.add('includes += ["%s" % (i[2:].replace("@CPU@", 
>> "x86"))]')
>> -for i in builder.includes():
>> +for i in builder.includes() + ['-I' + builder.buildInclude()]:
>>   self.add('includes += ["%s"]' % (i[2:]))
>>   self.add('')
>>   self.add('# Collect the libbsd uses')
>> @@ -445,6 +445,28 @@ class ModuleManager(builder.ModuleManager):
>>   self.add('')
>>   
>>   #
>> +# Add a copy rule for all headers where the install path and the 
>> source
>> +# path are not the same.
>> +#
>> +self.add('# copy headers if necessary')
>> 

Re: [PATCH v2 1/4] waf_generator: Copy headers if necessary.

2017-08-11 Thread Chris Johns
On 11/8/17 8:39 pm, Sichen Zhao wrote:
> From: Christian Mauderer 
> 
> There are some cases, where a header is installed into a directory with
> a different name then it's source directory. In that case, the build
> might fail because the header is not found. One example would be the
> . The source for this file is in
> freebsd/crypto/openssl/crypto/opensslv.h.
> 
> To allow the build to work in such cases too, copy such files into a
> temporary location in the build tree.
> ---
>  builder.py   | 14 ++
>  libbsd_waf.py| 15 +++
>  waf_generator.py | 24 +++-
>  3 files changed, 52 insertions(+), 1 deletion(-)
> 
> diff --git a/builder.py b/builder.py
> index bb633cb..1be1ced 100755
> --- a/builder.py
> +++ b/builder.py
> @@ -194,6 +194,10 @@ def includes():
>  '-ImDNSResponder/mDNSPosix',
>  '-Itestsuite/include']
>  
> +def buildInclude():
> +""" Returns the path where headers will be copied during build. """
> +return 'build-include'
> +
>  def cpuIncludes():
>  return ['-Irtemsbsd/@CPU@/include',
>  '-Ifreebsd/sys/@CPU@/include']
> @@ -205,6 +209,16 @@ def cxxflags():
>  return []
>  
>  def headerPaths():
> +""" Returns a list of information about what header files should be
> +installed.
> +
> +The list is also used to find headers with a local path that doesn't 
> match
> +it's dest path. Due to the difference in the path name such files are
> +problematic during the build if they are included using their later
> +installation path (dest path) name. Therefore they are copied into a
> +sub-directory of the build path so that they can be included with their
> +normal installation path. """
> +
>  # local path  wildcard dest path
>  return [('rtemsbsd/include',  '*.h',   ''),
>  ('rtemsbsd/mghttpd',  'mongoose.h',
> 'mghttpd'),
> diff --git a/libbsd_waf.py b/libbsd_waf.py
> index aee2e7a..8bc2b34 100644
> --- a/libbsd_waf.py
> +++ b/libbsd_waf.py
> @@ -83,6 +83,7 @@ def build(bld):
>  includes += ["mDNSResponder/mDNSShared"]
>  includes += ["mDNSResponder/mDNSPosix"]
>  includes += ["testsuite/include"]
> +includes += ["build-include"]
>  
>  # Collect the libbsd uses
>  libbsd_use = []
> @@ -123,6 +124,20 @@ def build(bld):
>  rule = "sed -e 's/@NET_CFG_SELF_IP@/%s/' -e 
> 's/@NET_CFG_NETMASK@/%s/' -e 's/@NET_CFG_PEER_IP@/%s/' -e 
> 's/@NET_CFG_GATEWAY_IP@/%s/' < ${SRC} > ${TGT}" % (net_cfg_self_ip, 
> net_cfg_netmask, net_cfg_peer_ip, net_cfg_gateway_ip),
>  update_outputs = True)
>  
> +# copy headers if necessary
> +header_build_copy_paths = [
> +  ]
> +for headers in header_build_copy_paths:
> +target = os.path.join("build-include", headers[2])
> +start_dir = bld.path.find_dir(headers[0])
> +for header in start_dir.ant_glob(os.path.join("**/", headers[1])):

Remove the '/':

   for header in start_dir.ant_glob(os.path.join("**", headers[1])):

OK to push once fixed.

Chris

> +relsourcepath = header.path_from(start_dir)
> +targetheader = os.path.join(target, relsourcepath)
> +bld(features = 'subst',
> +target = targetheader,
> +source = header,
> +is_copy = True)
> +
>  # KVM Symbols
>  bld(target = "rtemsbsd/rtems/rtems-kernel-kvm-symbols.c",
>  source = "rtemsbsd/rtems/generate_kvm_symbols",
> diff --git a/waf_generator.py b/waf_generator.py
> index 35fe35f..fdc2210 100755
> --- a/waf_generator.py
> +++ b/waf_generator.py
> @@ -392,7 +392,7 @@ class ModuleManager(builder.ModuleManager):
>  self.add('if bld.get_env()["RTEMS_ARCH"] == "i386":')
>  self.add('for i in %r:' % (builder.cpuIncludes()))
>  self.add('includes += ["%s" % (i[2:].replace("@CPU@", 
> "x86"))]')
> -for i in builder.includes():
> +for i in builder.includes() + ['-I' + builder.buildInclude()]:
>  self.add('includes += ["%s"]' % (i[2:]))
>  self.add('')
>  self.add('# Collect the libbsd uses')
> @@ -445,6 +445,28 @@ class ModuleManager(builder.ModuleManager):
>  self.add('')
>  
>  #
> +# Add a copy rule for all headers where the install path and the 
> source
> +# path are not the same.
> +#
> +self.add('# copy headers if necessary')
> +self.add('header_build_copy_paths = [')
> +for hp in builder.headerPaths():
> +if hp[2] != '' and not hp[0].endswith(hp[2]):
> +self.add('   %s,' % (str(hp)))
> +self.add('  ]')
> +self.add('for headers in header_build_copy_paths:')
> +