sbsv2/raptor/python/raptor_meta.py
branchwip
changeset 457 9bebdb95e0de
parent 422 f73eee123484
child 429 d13352a0173e
child 458 79718b9711e8
equal deleted inserted replaced
455:6cc6d1d59188 457:9bebdb95e0de
  1302 			self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1"))
  1302 			self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1"))
  1303 
  1303 
  1304 		elif varname == 'PAGED':
  1304 		elif varname == 'PAGED':
  1305 			self.BuildVariant.AddOperation(raptor_data.Set(varname, "1"))
  1305 			self.BuildVariant.AddOperation(raptor_data.Set(varname, "1"))
  1306 			self.__debug( "Set switch PAGE ON")
  1306 			self.__debug( "Set switch PAGE ON")
       
  1307 			# PAGED is equivalent to PAGEDCODE
  1307 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "paged"))
  1308 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "paged"))
  1308 			self.__debug( "Set switch PAGEDCODE ON")
  1309 			self.__debug( "Set switch PAGEDCODE ON")
  1309 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "paged"))
       
  1310 			self.__debug( "Set data PAGEDDATA ON")
       
  1311 			self.__pageConflict.append("PAGEDCODE")
  1310 			self.__pageConflict.append("PAGEDCODE")
  1312 			self.__pageConflict.append("PAGEDDATA")
       
  1313 
  1311 
  1314 		elif varname == 'UNPAGED':
  1312 		elif varname == 'UNPAGED':
  1315 			self.BuildVariant.AddOperation(raptor_data.Set("PAGED", "0"))
  1313 			self.BuildVariant.AddOperation(raptor_data.Set("PAGED", "0"))
  1316 			self.__debug( "Set switch PAGED OFF")
  1314 			self.__debug( "Set switch PAGED OFF")
       
  1315 			# UNPAGED is equivalent to UNPAGEDCODE *and* UNPAGEDDATA
  1317 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "unpaged"))
  1316 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "unpaged"))
  1318 			self.__debug( "Set switch PAGEDCODE OFF")
  1317 			self.__debug( "Set switch PAGEDCODE OFF")
  1319 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "unpaged"))
  1318 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "unpaged"))
  1320 			self.__debug( "Set data PAGEDDATA OFF")
  1319 			self.__debug( "Set data PAGEDDATA OFF")
  1321 			self.__pageConflict.append("UNPAGEDCODE")
  1320 			self.__pageConflict.append("UNPAGEDCODE")
  1333 
  1332 
  1334 		elif varname == 'UNPAGEDCODE':
  1333 		elif varname == 'UNPAGEDCODE':
  1335 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "unpaged"))
  1334 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDCODE_OPTION", "unpaged"))
  1336 			self.__debug( "Set switch " + varname + " ON")
  1335 			self.__debug( "Set switch " + varname + " ON")
  1337 			self.__pageConflict.append(varname)
  1336 			self.__pageConflict.append(varname)
       
  1337 			
  1338 		elif varname == 'UNPAGEDDATA':
  1338 		elif varname == 'UNPAGEDDATA':
  1339 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "unpaged"))
  1339 			self.BuildVariant.AddOperation(raptor_data.Set("PAGEDDATA_OPTION", "unpaged"))
  1340 			self.__debug( "Set switch " + varname + " ON")
  1340 			self.__debug( "Set switch " + varname + " ON")
  1341 			self.__pageConflict.append(varname)
  1341 			self.__pageConflict.append(varname)
  1342 
  1342 
  1343 		elif varname == 'NOLINKTIMECODEGENERATION':
  1343 		elif varname == 'NOLINKTIMECODEGENERATION':
  1344 			self.BuildVariant.AddOperation(raptor_data.Set("LTCG",""))
  1344 			self.BuildVariant.AddOperation(raptor_data.Set("LTCG",""))
  1345 			self.__debug( "Set switch " + varname + " OFF")
  1345 			self.__debug( "Set switch " + varname + " OFF")
       
  1346 			
  1346 		elif varname == 'NOMULTIFILECOMPILATION':
  1347 		elif varname == 'NOMULTIFILECOMPILATION':
  1347 			self.BuildVariant.AddOperation(raptor_data.Set("MULTIFILE_ENABLED",""))
  1348 			self.BuildVariant.AddOperation(raptor_data.Set("MULTIFILE_ENABLED",""))
  1348 			self.__debug( "Set switch " + varname + " OFF")
  1349 			self.__debug( "Set switch " + varname + " OFF")
  1349 
  1350 
  1350 		elif varname == 'DEBUGGABLE':
  1351 		elif varname == 'DEBUGGABLE':
  1351 			if self.__debuggable != "udeb":
  1352 			if self.__debuggable != "udeb":
  1352 				self.__debuggable = "udeb urel"
  1353 				self.__debuggable = "udeb urel"
  1353 			else:
  1354 			else:
  1354 				self.__Raptor.Warn("DEBUGGABLE keyword ignored as DEBUGGABLE_UDEBONLY is already specified")
  1355 				self.__Raptor.Warn("DEBUGGABLE keyword ignored as DEBUGGABLE_UDEBONLY is already specified")
       
  1356 		
  1355 		elif varname == 'DEBUGGABLE_UDEBONLY':
  1357 		elif varname == 'DEBUGGABLE_UDEBONLY':
  1356 			if self.__debuggable != "":
  1358 			if self.__debuggable != "":
  1357 				self.__Raptor.Warn("DEBUGGABLE keyword has no effect as DEBUGGABLE or DEBUGGABLE_UDEBONLY is already set")
  1359 				self.__Raptor.Warn("DEBUGGABLE keyword has no effect as DEBUGGABLE or DEBUGGABLE_UDEBONLY is already set")
  1358 			self.__debuggable = "udeb"
  1360 			self.__debuggable = "udeb"
       
  1361 		
  1359 		elif varname == 'FEATUREVARIANT':
  1362 		elif varname == 'FEATUREVARIANT':
  1360 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"1"))
  1363 			self.BuildVariant.AddOperation(raptor_data.Set(varname,"1"))
  1361 			self.featureVariant = True
  1364 			self.featureVariant = True
       
  1365 		
  1362 		elif varname in ['COMPRESSTARGET', 'NOCOMPRESSTARGET', 'INFLATECOMPRESSTARGET', 'BYTEPAIRCOMPRESSTARGET']:
  1366 		elif varname in ['COMPRESSTARGET', 'NOCOMPRESSTARGET', 'INFLATECOMPRESSTARGET', 'BYTEPAIRCOMPRESSTARGET']:
  1363 			if self.__compressionKeyword:
  1367 			self.resolveCompressionKeyword(varname)
  1364 				self.__Raptor.Warn("%s keyword in %s overrides earlier use of %s" % (varname, self.__currentMmpFile, self.__compressionKeyword))
  1368 		
  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:
  1369 		else:
  1371 			self.__debug( "Set switch "+toks[0]+" ON")
  1370 			self.__debug( "Set switch "+toks[0]+" ON")
  1372 			self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1"))
  1371 			self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1"))
  1373 
  1372 
  1374 		return "OK"
  1373 		return "OK"
  1720 
  1719 
  1721 
  1720 
  1722 	def getDefaultResourceTargetPath(self, targettype):
  1721 	def getDefaultResourceTargetPath(self, targettype):
  1723 		# the different default TARGETPATH values should come from the
  1722 		# the different default TARGETPATH values should come from the
  1724 		# configuration rather than being hard-coded here.
  1723 		# configuration rather than being hard-coded here.
  1725 		if targettype == "plugin":
  1724 		if targettype in ["plugin", "plugin3"]:
  1726 			return "resource/plugins"
  1725 			return "resource/plugins"
  1727 		if targettype == "pdl":
  1726 		if targettype == "pdl":
  1728 			return "resource/printers"
  1727 			return "resource/printers"
  1729 		return ""
  1728 		return ""
  1730 
  1729 
  2245 		self.__pageConflict.reverse()
  2244 		self.__pageConflict.reverse()
  2246 		if "PAGEDCODE" in self.__pageConflict and "UNPAGEDCODE" in self.__pageConflict:
  2245 		if "PAGEDCODE" in self.__pageConflict and "UNPAGEDCODE" in self.__pageConflict:
  2247 			for x in self.__pageConflict:
  2246 			for x in self.__pageConflict:
  2248 				if x == "PAGEDCODE" or x == "UNPAGEDCODE":
  2247 				if x == "PAGEDCODE" or x == "UNPAGEDCODE":
  2249 					self.__Raptor.Warn("Both PAGEDCODE and UNPAGEDCODE are specified. The last one %s will take effect" % x)
  2248 					self.__Raptor.Warn("Both PAGEDCODE and UNPAGEDCODE are specified. The last one %s will take effect" % x)
       
  2249 					if x == "PAGEDCODE":
       
  2250 						self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET")
  2250 					break
  2251 					break
       
  2252 		elif "PAGEDCODE" in self.__pageConflict:
       
  2253 			self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET")
       
  2254 				
  2251 		if "PAGEDDATA" in self.__pageConflict and "UNPAGEDDATA" in self.__pageConflict:
  2255 		if "PAGEDDATA" in self.__pageConflict and "UNPAGEDDATA" in self.__pageConflict:
  2252 			for x in self.__pageConflict:
  2256 			for x in self.__pageConflict:
  2253 				if x == "PAGEDDATA" or x == "UNPAGEDDATA":
  2257 				if x == "PAGEDDATA" or x == "UNPAGEDDATA":
  2254 					self.__Raptor.Warn("Both PAGEDDATA and UNPAGEDDATA are specified. The last one %s will take effect" % x)
  2258 					self.__Raptor.Warn("Both PAGEDDATA and UNPAGEDDATA are specified. The last one %s will take effect" % x)
       
  2259 					if x == "PAGEDDATA":
       
  2260 						self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET")
  2255 					break
  2261 					break
       
  2262 		elif "PAGEDDATA" in self.__pageConflict:
       
  2263 			self.resolveCompressionKeyword("BYTEPAIRCOMPRESSTARGET")
  2256 
  2264 
  2257 		# Set Debuggable
  2265 		# Set Debuggable
  2258 		self.BuildVariant.AddOperation(raptor_data.Set("DEBUGGABLE", self.__debuggable))
  2266 		self.BuildVariant.AddOperation(raptor_data.Set("DEBUGGABLE", self.__debuggable))
  2259 
  2267 
  2260 		if self.__explicitversion:
  2268 		if self.__explicitversion:
  2268 						   " ".join(self.sources)))
  2276 						   " ".join(self.sources)))
  2269 
  2277 
  2270 	def getTargetType(self):
  2278 	def getTargetType(self):
  2271 		"""Target type in lower case - the standard format"""
  2279 		"""Target type in lower case - the standard format"""
  2272 		return self.__targettype.lower()
  2280 		return self.__targettype.lower()
       
  2281 
       
  2282 	def resolveCompressionKeyword(self, aCompressionKeyword):
       
  2283 		"""If a compression keyword is set more than once either explicitly
       
  2284 		or implicitly a warning is given and the last one takes effect 
       
  2285 		"""
       
  2286 		if self.__compressionKeyword and self.__compressionKeyword != aCompressionKeyword:
       
  2287 			self.__Raptor.Warn("%s keyword in %s overrides earlier use of %s" % \
       
  2288 						(aCompressionKeyword, self.__currentMmpFile, self.__compressionKeyword))
       
  2289 			self.BuildVariant.AddOperation(raptor_data.Set(self.__compressionKeyword, ""))
       
  2290 			self.__debug( "Set switch " + self.__compressionKeyword + " OFF")
       
  2291 		self.BuildVariant.AddOperation(raptor_data.Set(aCompressionKeyword,"1"))
       
  2292 		self.__debug( "Set switch " + aCompressionKeyword + " ON")
       
  2293 		self.__compressionKeyword = aCompressionKeyword
  2273 
  2294 
  2274 	def checkImplibDefFile(self, defFile):
  2295 	def checkImplibDefFile(self, defFile):
  2275 		"""Project with target type implib must have DEFFILE defined 
  2296 		"""Project with target type implib must have DEFFILE defined 
  2276 		explicitly or implicitly, otherwise it is an error
  2297 		explicitly or implicitly, otherwise it is an error
  2277 		""" 
  2298 		"""