[PATCH 3/6] waf: Fix freebsd-to-rtems.py.

Chris Johns chrisj at rtems.org
Mon Apr 9 01:36:49 UTC 2018


On 06/04/2018 22:26, Christian Mauderer wrote:
> Update #3351
> ---
>  builder.py          | 3 +++
>  freebsd-to-rtems.py | 3 ++-
>  waf_libbsd.py       | 7 +++++--
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/builder.py b/builder.py
> index 2faf98d0..ac199a9b 100755
> --- a/builder.py
> +++ b/builder.py
> @@ -677,3 +677,6 @@ class ModuleManager(object):
>      def generateBuild(self):
>          for m in self.getEnabledModules():
>              self.modules[m].generate()
> +
> +    def setGenerators(self):
> +        pass
> diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py
> index c2f00f86..ec0fcc9a 100755
> --- a/freebsd-to-rtems.py
> +++ b/freebsd-to-rtems.py
> @@ -43,6 +43,7 @@ import getopt
>  
>  import builder
>  import libbsd
> +import waf_libbsd

I am not comfortable with this happening.

What functionality in waf_libbsd do you need here?

Can it be moved to the builder class?

>  
>  isForward = True
>  isEarlyExit = False
> @@ -142,7 +143,7 @@ if isEarlyExit == True:
>      sys.exit(0)
>  
>  try:
> -    build = builder.ModuleManager()
> +    build = waf_libbsd.Builder()
>      libbsd.load(build)
>      build.generateBuild()
>      build.processSource(isForward)
> diff --git a/waf_libbsd.py b/waf_libbsd.py
> index eddfaf99..ae8a1ea0 100644
> --- a/waf_libbsd.py
> +++ b/waf_libbsd.py
> @@ -40,8 +40,6 @@ import tempfile
>  
>  import builder
>  
> -import rtems_waf.rtems as rtems

I like this being here because it is loud and clear this is an RTEMS waf app.

> -
>  windows = os.name == 'nt'
>  
>  if windows:
> @@ -316,6 +314,11 @@ class Builder(builder.ModuleManager):
>          pass
>  
>      def build(self, bld):
> +        # This is only necessary for build. But it depends on the waflib which
> +        # is only available in a waf context. But we need the module manager for
> +        # freebsd_to_rtems.py too.

If functionality is to be shared it should be moved to the base module.

Chris

> +        import rtems_waf.rtems as rtems
> +
>          #
>          # Localize the config.
>          #
> 



More information about the devel mailing list