[PATCH] Add post-init hook.

Christian Mauderer christian.mauderer at embedded-brains.de
Thu Apr 5 13:29:58 UTC 2018


---
 rtems.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rtems.py b/rtems.py
index b2e3285..0882c74 100644
--- a/rtems.py
+++ b/rtems.py
@@ -67,7 +67,7 @@ def options(opt):
                    dest = 'show_commands',
                    help = 'Print the commands as strings.')
 
-def init(ctx, filters = None, version = None, long_commands = False):
+def init(ctx, filters = None, version = None, long_commands = False, post_init = None):
     global rtems_filters
     global rtems_default_version
     global rtems_long_commands
@@ -114,12 +114,14 @@ def init(ctx, filters = None, version = None, long_commands = False):
         #
         from waflib.Build import BuildContext, CleanContext, \
             InstallContext, UninstallContext
+        context_classes = []
         for x in arch_bsps:
             for y in (BuildContext, CleanContext, InstallContext, UninstallContext):
                 name = y.__name__.replace('Context','').lower()
                 class context(y):
                     cmd = name + '-' + x
                     variant = x
+                context_classes += [context]
 
         #
         # Transform the command to per BSP commands.
@@ -135,6 +137,9 @@ def init(ctx, filters = None, version = None, long_commands = False):
     except:
         pass
 
+    if post_init:
+        post_init(ctx, env, context_classes)
+
 def configure(conf, bsp_configure = None):
     #
     # Check the environment for any flags.
-- 
2.13.6




More information about the devel mailing list