[PATCH v2] Add post-init hook.

Christian Mauderer christian.mauderer at embedded-brains.de
Fri Apr 6 06:52:51 UTC 2018


---
 rtems.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/rtems.py b/rtems.py
index be44edc..713066d 100644
--- a/rtems.py
+++ b/rtems.py
@@ -69,7 +69,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, bsp_init = None):
     global rtems_filters
     global rtems_default_version
     global rtems_long_commands
@@ -112,16 +112,18 @@ def init(ctx, filters = None, version = None, long_commands = False):
                           env.options['rtems_bsps'])
 
         #
-        # Update the contextes for all the bsps.
+        # Update the contexts for all the bsps.
         #
         from waflib.Build import BuildContext, CleanContext, \
             InstallContext, UninstallContext
+        contexts = []
         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
+                contexts += [context]
 
         #
         # Transform the command to per BSP commands.
@@ -137,6 +139,9 @@ def init(ctx, filters = None, version = None, long_commands = False):
     except:
         pass
 
+    if bsp_init:
+        bsp_init(ctx, env, contexts)
+
 def configure(conf, bsp_configure = None):
     #
     # Check the environment for any flags.
-- 
2.13.6



More information about the devel mailing list