sbsv2/raptor/python/raptor_meta.py
branchfix
changeset 388 3f46b91ff7d1
parent 288 80540207516e
child 392 8f0708af8451
equal deleted inserted replaced
364:f4ccb4c573da 388:3f46b91ff7d1
  1333 
  1333 
  1334 		elif varname == 'UNPAGEDCODE':
  1334 		elif varname == 'UNPAGEDCODE':
  1335 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "unpaged"))
  1335 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "unpaged"))
  1336 			self.__debug( "Set switch " + varname + " ON")
  1336 			self.__debug( "Set switch " + varname + " ON")
  1337 			self.__pageConflict.append(varname)
  1337 			self.__pageConflict.append(varname)
       
  1338 			
  1338 		elif varname == 'UNPAGEDDATA':
  1339 		elif varname == 'UNPAGEDDATA':
  1339 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "unpaged"))
  1340 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "unpaged"))
  1340 			self.__debug( "Set switch " + varname + " ON")
  1341 			self.__debug( "Set switch " + varname + " ON")
  1341 			self.__pageConflict.append(varname)
  1342 			self.__pageConflict.append(varname)
  1342 
  1343 
  1343 		elif varname == 'NOLINKTIMECODEGENERATION':
  1344 		elif varname == 'NOLINKTIMECODEGENERATION':
  1344 			self.BuildVariant.AddOperation(raptor_data.Set("LTCG",""))
  1345 			self.BuildVariant.AddOperation(raptor_data.Set("LTCG",""))
  1345 			self.__debug( "Set switch " + varname + " OFF")
  1346 			self.__debug( "Set switch " + varname + " OFF")
       
  1347 			
  1346 		elif varname == 'NOMULTIFILECOMPILATION':
  1348 		elif varname == 'NOMULTIFILECOMPILATION':
  1347 			self.BuildVariant.AddOperation(raptor_data.Set("MULTIFILE_ENABLED",""))
  1349 			self.BuildVariant.AddOperation(raptor_data.Set("MULTIFILE_ENABLED",""))
  1348 			self.__debug( "Set switch " + varname + " OFF")
  1350 			self.__debug( "Set switch " + varname + " OFF")
  1349 
  1351 
  1350 		elif varname == 'DEBUGGABLE':
  1352 		elif varname == 'DEBUGGABLE':
  1351 			if self.__debuggable != "udeb":
  1353 			if self.__debuggable != "udeb":
  1352 				self.__debuggable = "udeb urel"
  1354 				self.__debuggable = "udeb urel"
  1353 			else:
  1355 			else:
  1354 				self.__Raptor.Warn("DEBUGGABLE keyword ignored as DEBUGGABLE_UDEBONLY is already specified")
  1356 				self.__Raptor.Warn("DEBUGGABLE keyword ignored as DEBUGGABLE_UDEBONLY is already specified")
       
  1357 		
  1355 		elif varname == 'DEBUGGABLE_UDEBONLY':
  1358 		elif varname == 'DEBUGGABLE_UDEBONLY':
  1356 			if self.__debuggable != "":
  1359 			if self.__debuggable != "":
  1357 				self.__Raptor.Warn("DEBUGGABLE keyword has no effect as DEBUGGABLE or DEBUGGABLE_UDEBONLY is already set")
  1360 				self.__Raptor.Warn("DEBUGGABLE keyword has no effect as DEBUGGABLE or DEBUGGABLE_UDEBONLY is already set")
  1358 			self.__debuggable = "udeb"
  1361 			self.__debuggable = "udeb"
       
  1362 		
  1359 		elif varname == 'FEATUREVARIANT':
  1363 		elif varname == 'FEATUREVARIANT':
  1360 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"1"))
  1364 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"1"))
  1361 			self.featureVariant = True
  1365 			self.featureVariant = True
       
  1366 		
  1362 		elif varname in ['COMPRESSTARGET', 'NOCOMPRESSTARGET', 'INFLATECOMPRESSTARGET', 'BYTEPAIRCOMPRESSTARGET']:
  1367 		elif varname in ['COMPRESSTARGET', 'NOCOMPRESSTARGET', 'INFLATECOMPRESSTARGET', 'BYTEPAIRCOMPRESSTARGET']:
  1363 			if self.__compressionKeyword:
  1368 			self.resolveCompressionKeyword(varname)
  1364 				self.__Raptor.Warn("%s keyword in %s overrides earlier use of %s" % (varname, self.__currentMmpFile, self.__compressionKeyword))
  1369 		
  1365 				self.BuildVariant.AddOperation(raptor_data.Set(self.__compressionKeyword,""))
       
  1366 				self.__debug( "Set switch " + varname + " OFF")
       
  1367 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"1"))
       
  1368 			self.__debug( "Set switch " + varname + " ON")
       
  1369 			self.__compressionKeyword = varname
       
  1370 		else:
  1370 		else:
  1371 			self.__debug( "Set switch "+toks[0]+" ON")
  1371 			self.__debug( "Set switch "+toks[0]+" ON")
  1372 			self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1"))
  1372 			self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1"))
  1373 
  1373 
  1374 		return "OK"
  1374 		return "OK"
  2245 		self.__pageConflict.reverse()
  2245 		self.__pageConflict.reverse()
  2246 		if "PAGEDCODE" in self.__pageConflict and "UNPAGEDCODE" in self.__pageConflict:
  2246 		if "PAGEDCODE" in self.__pageConflict and "UNPAGEDCODE" in self.__pageConflict:
  2247 			for x in self.__pageConflict:
  2247 			for x in self.__pageConflict:
  2248 				if x == "PAGEDCODE" or x == "UNPAGEDCODE":
  2248 				if x == "PAGEDCODE" or x == "UNPAGEDCODE":
  2249 					self.__Raptor.Warn("Both PAGEDCODE and UNPAGEDCODE are specified. The last one %s will take effect" % x)
  2249 					self.__Raptor.Warn("Both PAGEDCODE and UNPAGEDCODE are specified. The last one %s will take effect" % x)
       
  2250 					if x == "PAGEDCODE":
       
  2251 						self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET")
  2250 					break
  2252 					break
       
  2253 		elif "PAGEDCODE" in self.__pageConflict:
       
  2254 			self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET")
       
  2255 				
  2251 		if "PAGEDDATA" in self.__pageConflict and "UNPAGEDDATA" in self.__pageConflict:
  2256 		if "PAGEDDATA" in self.__pageConflict and "UNPAGEDDATA" in self.__pageConflict:
  2252 			for x in self.__pageConflict:
  2257 			for x in self.__pageConflict:
  2253 				if x == "PAGEDDATA" or x == "UNPAGEDDATA":
  2258 				if x == "PAGEDDATA" or x == "UNPAGEDDATA":
  2254 					self.__Raptor.Warn("Both PAGEDDATA and UNPAGEDDATA are specified. The last one %s will take effect" % x)
  2259 					self.__Raptor.Warn("Both PAGEDDATA and UNPAGEDDATA are specified. The last one %s will take effect" % x)
       
  2260 					if x == "PAGEDDATA":
       
  2261 						self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET")
  2255 					break
  2262 					break
       
  2263 		elif "PAGEDDATA" in self.__pageConflict:
       
  2264 			self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET")
  2256 
  2265 
  2257 		# Set Debuggable
  2266 		# Set Debuggable
  2258 		self.BuildVariant.AddOperation(raptor_data.Set("DEBUGGABLE", self.__debuggable))
  2267 		self.BuildVariant.AddOperation(raptor_data.Set("DEBUGGABLE", self.__debuggable))
  2259 
  2268 
  2260 		if self.__explicitversion:
  2269 		if self.__explicitversion:
  2268 						   " ".join(self.sources)))
  2277 						   " ".join(self.sources)))
  2269 
  2278 
  2270 	def getTargetType(self):
  2279 	def getTargetType(self):
  2271 		"""Target type in lower case - the standard format"""
  2280 		"""Target type in lower case - the standard format"""
  2272 		return self.__targettype.lower()
  2281 		return self.__targettype.lower()
       
  2282 
       
  2283 	def resolveCompressionKeyword(self, aCompressionKeyword):
       
  2284 		"""If a compression keyword is set more than once either explicitly
       
  2285 		or implicitly a warning is given and the last one takes effect 
       
  2286 		"""
       
  2287 		if self.__compressionKeyword and self.__compressionKeyword != aCompressionKeyword:
       
  2288 			self.__Raptor.Warn("%s keyword in %s overrides earlier use of %s" % \
       
  2289 						(aCompressionKeyword, self.__currentMmpFile, self.__compressionKeyword))
       
  2290 			self.BuildVariant.AddOperation(raptor_data.Set(self.__compressionKeyword, ""))
       
  2291 			self.__debug( "Set switch " + self.__compressionKeyword + " OFF")
       
  2292 		self.BuildVariant.AddOperation(raptor_data.Set(aCompressionKeyword,"1"))
       
  2293 		self.__debug( "Set switch " + aCompressionKeyword + " ON")
       
  2294 		self.__compressionKeyword = aCompressionKeyword
  2273 
  2295 
  2274 	def checkImplibDefFile(self, defFile):
  2296 	def checkImplibDefFile(self, defFile):
  2275 		"""Project with target type implib must have DEFFILE defined 
  2297 		"""Project with target type implib must have DEFFILE defined 
  2276 		explicitly or implicitly, otherwise it is an error
  2298 		explicitly or implicitly, otherwise it is an error
  2277 		""" 
  2299 		"""