Boost logo

Boost-Commit :

From: steven_at_[hidden]
Date: 2008-07-31 13:26:16


Author: steven_watanabe
Date: 2008-07-31 13:26:15 EDT (Thu, 31 Jul 2008)
New Revision: 47911
URL: http://svn.boost.org/trac/boost/changeset/47911

Log:
Make Engine.register_action take a list of strings instead of an integer bitset for the flags arguments, update common.py and gcc.py to use this interface
Text files modified:
   branches/build/python_port/python/boost/build/engine/engine.py | 17 +++++++++++++++--
   branches/build/python_port/python/boost/build/tools/common.py | 8 ++++----
   branches/build/python_port/python/boost/build/tools/gcc.py | 6 ++----
   3 files changed, 21 insertions(+), 10 deletions(-)

Modified: branches/build/python_port/python/boost/build/engine/engine.py
==============================================================================
--- branches/build/python_port/python/boost/build/engine/engine.py (original)
+++ branches/build/python_port/python/boost/build/engine/engine.py 2008-07-31 13:26:15 EDT (Thu, 31 Jul 2008)
@@ -6,6 +6,8 @@
 
 bjam_interface = __import__('bjam')
 
+import operator
+
 class BjamAction:
     """Class representing bjam action defined from Python."""
     
@@ -36,6 +38,12 @@
             bjam_interface.call("set-update-action", self.action_name,
                                 targets, sources, [])
         
+action_modifiers = {"updated": 0x01,
+ "together": 0x02,
+ "ignore": 0x04,
+ "quietly": 0x08,
+ "piecemeal": 0x10,
+ "existing": 0x20}
 
 class Engine:
     """ The abstract interface to a build engine.
@@ -87,7 +95,7 @@
             targets = [targets]
         self.do_set_update_action (action_name, targets, sources, properties)
 
- def register_action (self, action_name, command, bound_list = [], flags = 0,
+ def register_action (self, action_name, command, bound_list = [], flags = [],
                          function = None):
         """Creates a new build engine action.
 
@@ -106,7 +114,12 @@
         if self.actions.has_key(action_name):
             raise "Bjam action %s is already defined" % action_name
 
- bjam_interface.define_action(action_name, command, bound_list, flags)
+ assert(isinstance(flags, list))
+
+ bjam_flags = reduce(operator.or_,
+ (action_modifiers[flag] for flag in flags), 0)
+
+ bjam_interface.define_action(action_name, command, bound_list, bjam_flags)
 
         self.actions[action_name] = BjamAction(action_name, function)
 

Modified: branches/build/python_port/python/boost/build/tools/common.py
==============================================================================
--- branches/build/python_port/python/boost/build/tools/common.py (original)
+++ branches/build/python_port/python/boost/build/tools/common.py 2008-07-31 13:26:15 EDT (Thu, 31 Jul 2008)
@@ -806,11 +806,11 @@
         __IGNORE = ''
         __LN = 'ln'
         
- # FIXME: piecemeal together existing
- engine.register_action("common.Clean", __RM + ' "$(>)"')
+ engine.register_action("common.Clean", __RM + ' "$(>)"',
+ flags=['piecemeal', 'together', 'existing'])
     engine.register_action("common.copy", __CP + ' "$(>)" "$(<)"')
- # FIXME: quietly updated piecemeal together
- engine.register_action("common.RmTemps", __RM + ' "$(>)" ' + __IGNORE)
+ engine.register_action("common.RmTemps", __RM + ' "$(>)" ' + __IGNORE,
+ flags=['quietly', 'updated', 'piecemeal', 'together'])
 
     engine.register_action("common.hard-link",
         __RM + ' "$(<)" 2$(NULL_OUT) $(NULL_OUT)' + os.linesep +

Modified: branches/build/python_port/python/boost/build/tools/gcc.py
==============================================================================
--- branches/build/python_port/python/boost/build/tools/gcc.py (original)
+++ branches/build/python_port/python/boost/build/tools/gcc.py 2008-07-31 13:26:15 EDT (Thu, 31 Jul 2008)
@@ -619,8 +619,6 @@
     # many files because it will no longer execute the action directly and blow
     # the line length limit. Instead we remove the file in a different action,
     # just before building the archive.
- #
- # FIXME:
     clean = targets[0] + '(clean)'
     bjam.call('TEMPORARY', clean)
     bjam.call('NOCARE', clean)
@@ -636,10 +634,10 @@
 # without replacement".
 # The letter 'c' suppresses the warning in case the archive does not exists yet.
 # That warning is produced only on some platforms, for whatever reasons.
-#FIXME: This was originally piecemeal
 engine.register_action('gcc.archive',
                        '"$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"',
- function=gcc_archive)
+ function=gcc_archive,
+ flags=['piecemeal'])
 
 def gcc_link_dll(targets, sources, properties):
     engine = get_manager().engine()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk