Sync EDKII BaseTools to BaseTools project r2065.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10915 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2010-10-11 06:26:52 +00:00
parent d69bf66dc1
commit 08dd311f5d
52 changed files with 381 additions and 207 deletions

View File

@ -162,6 +162,10 @@ class WorkspaceAutoGen(AutoGen):
# parse FDF file to get PCDs in it, if any
if self.FdfFile != None and self.FdfFile != '':
#
# Make global macros available when parsing FDF file
#
InputMacroDict.update(self.BuildDatabase.WorkspaceDb._GlobalMacros)
Fdf = FdfParser(self.FdfFile.Path)
Fdf.ParseFile()
PcdSet = Fdf.Profile.PcdDict
@ -544,9 +548,18 @@ class PlatformAutoGen(AutoGen):
DecPcdEntry = eachDec.Pcds[DecPcd]
if (DecPcdEntry.TokenSpaceGuidCName == DscPcdEntry.TokenSpaceGuidCName) and \
(DecPcdEntry.TokenCName == DscPcdEntry.TokenCName):
# Print warning message to let the developer make a determine.
EdkLogger.warn("build", "Unreferenced vpd pcd used!",
File=self.MetaFile, \
ExtraData = "PCD: %s.%s used in the DSC file %s is unreferenced." \
%(DscPcdEntry.TokenSpaceGuidCName, DscPcdEntry.TokenCName, self.Platform.MetaFile.Path))
DscPcdEntry.DatumType = DecPcdEntry.DatumType
DscPcdEntry.DefaultValue = DecPcdEntry.DefaultValue
Sku.DefaultValue = DecPcdEntry.DefaultValue
# Only fix the value while no value provided in DSC file.
if (Sku.DefaultValue == "" or Sku.DefaultValue==None):
DscPcdEntry.SkuInfoList[DscPcdEntry.SkuInfoList.keys()[0]].DefaultValue = DecPcdEntry.DefaultValue
VpdFile.Add(DscPcdEntry, Sku.VpdOffset)
# if the offset of a VPD is *, then it need to be fixed up by third party tool.
@ -569,11 +582,9 @@ class PlatformAutoGen(AutoGen):
except:
EdkLogger.error("build", FILE_WRITE_FAILURE, "Fail to create FV folder under %s" % self.BuildDir)
VpdFileName = self.Platform.VpdFileName
if VpdFileName == None or VpdFileName == "" :
VpdFilePath = os.path.join(FvPath, "%s.txt" % self.Platform.VpdToolGuid)
else :
VpdFilePath = os.path.join(FvPath, "%s.txt" % VpdFileName)
VpdFilePath = os.path.join(FvPath, "%s.txt" % self.Platform.VpdToolGuid)
if not os.path.exists(VpdFilePath) or os.path.getmtime(VpdFilePath) < DscTimeStamp:
VpdFile.Write(VpdFilePath)
@ -588,16 +599,13 @@ class PlatformAutoGen(AutoGen):
break
# Call third party GUID BPDG tool.
if BPDGToolName != None:
VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath, VpdFileName)
VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath)
else:
EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")
# Process VPD map file generated by third party BPDG tool
if NeedProcessVpdMapFile:
if VpdFileName == None or VpdFileName == "" :
VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid)
else :
VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % VpdFileName)
VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid)
if os.path.exists(VpdMapFilePath):
VpdFile.Read(VpdMapFilePath)
@ -1709,12 +1717,12 @@ class ModuleAutoGen(AutoGen):
self._SourceFileList = []
for F in self.Module.Sources:
# match tool chain
if F.TagName != "" and F.TagName != self.ToolChain:
if F.TagName not in ("", "*", self.ToolChain):
EdkLogger.debug(EdkLogger.DEBUG_9, "The toolchain [%s] for processing file [%s] is found, "
"but [%s] is needed" % (F.TagName, str(F), self.ToolChain))
continue
# match tool chain family
if F.ToolChainFamily != "" and F.ToolChainFamily != self.ToolChainFamily:
if F.ToolChainFamily not in ("", "*", self.ToolChainFamily):
EdkLogger.debug(
EdkLogger.DEBUG_0,
"The file [%s] must be built by tools of [%s], " \
@ -2128,14 +2136,6 @@ class ModuleAutoGen(AutoGen):
self._ApplyBuildRule(Lib.Target, TAB_UNKNOWN_FILE)
return self._LibraryAutoGenList
## Return build command string
#
# @retval string Build command string
#
def _GetBuildCommand(self):
return self.PlatformInfo.BuildCommand
Module = property(_GetModule)
Name = property(_GetBaseName)
Guid = property(_GetGuid)