sbsv2/raptor/python/raptor_meta.py
changeset 429 d13352a0173e
parent 422 f73eee123484
child 460 1f5ab557c1d0
--- a/sbsv2/raptor/python/raptor_meta.py	Wed Apr 07 14:03:32 2010 +0100
+++ b/sbsv2/raptor/python/raptor_meta.py	Fri Apr 09 09:21:38 2010 +0100
@@ -2417,9 +2417,19 @@
 		# "export platform" but several "build platforms" can be associated
 		# with the same "export platform".
 		exports = {}
-
-		self.__Raptor.Debug("MetaReader: configsToBuild:  %s", [b.name for b in configsToBuild])
-		for buildConfig in configsToBuild:
+		
+		# We sort configurations by name here.  This is solely to deal with situations
+		# where macros linked to builds end up being used in preprocessor conditionals
+		# within bld.inf files that then wrap exports under PRJ_EXPORTS statements.
+		# Having exports that are conditional on these macros isn't supported, but
+		# as there are areas of the source base that make this assumption, and
+		# fail if emulator macros are used instead of arm ones, we ensure that arm
+		# configurations come first when multiple configurations are active, and so are
+		# used first for determining exports.
+		sortedConfigsToBuild = sorted(configsToBuild,key=lambda config: config.name)
+
+		self.__Raptor.Debug("MetaReader: sortedConfigsToBuild:  %s", [b.name for b in sortedConfigsToBuild])
+		for buildConfig in sortedConfigsToBuild:
 			# get everything we need to know about the configuration
 			evaluator = self.__Raptor.GetEvaluator(None, buildConfig)