From da92f27632d2c89fa8726948ac9b02461ca8b61e Mon Sep 17 00:00:00 2001 From: lgao4 Date: Wed, 11 May 2011 10:26:49 +0000 Subject: Sync BaseTools Branch (version r2149) to EDKII main trunk. BaseTool Branch: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/branches/Releases/BaseTools_r2100 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11640 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/build/BuildReport.py | 4 +-- BaseTools/Source/Python/build/build.py | 41 ++++++++++++++++------------ 2 files changed, 25 insertions(+), 20 deletions(-) (limited to 'BaseTools/Source/Python/build') diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index c5793ad057..13d28ff3ba 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -4,7 +4,7 @@ # This module contains the functionality to generate build report after # build all target completes successfully. # -# Copyright (c) 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -486,7 +486,7 @@ class ModuleReport(object): # if ModuleType == "DXE_SMM_DRIVER": PiSpec = M.Module.Specification.get("PI_SPECIFICATION_VERSION", "0x00010000") - if int(PiSpec, 0) >= 0x0001000A: + if int(PiSpec, 16) >= 0x0001000A: ModuleType = "SMM_DRIVER" self.DriverType = gDriverTypeMap.get(ModuleType, "0x2 (FREE_FORM)") self.UefiSpecVersion = M.Module.Specification.get("UEFI_SPECIFICATION_VERSION", "") diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 84f5636414..b794c0a361 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1,7 +1,7 @@ ## @file # build a platform or a module # -# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -102,7 +102,8 @@ def CheckEnvVariable(): # # Check EFI_SOURCE (R8 build convention). EDK_SOURCE will always point to ECP # - os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg) + if "ECP_SOURCE" not in os.environ: + os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg) if "EFI_SOURCE" not in os.environ: os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"] if "EDK_SOURCE" not in os.environ: @@ -888,7 +889,7 @@ class Build(): self.LoadFixAddress = int (LoadFixAddressString, 16) else: self.LoadFixAddress = int (LoadFixAddressString) - except: + except: EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS %s is not valid dec or hex string" % (LoadFixAddressString)) if self.LoadFixAddress < 0: EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS is set to the invalid negative value %s" % (LoadFixAddressString)) @@ -908,6 +909,8 @@ class Build(): self.FvList = [] else: FdfParserObj = FdfParser(str(self.Fdf)) + for key in self.Db._GlobalMacros: + InputMacroDict[key] = self.Db._GlobalMacros[key] FdfParserObj.ParseFile() for fvname in self.FvList: if fvname.upper() not in FdfParserObj.Profile.FvDict.keys(): @@ -974,6 +977,7 @@ class Build(): if not self.SkipAutoGen or Target == 'genmake': self.Progress.Start("Generating makefile") AutoGenObject.CreateMakeFile(CreateDepsMakeFile) + AutoGenObject.CreateAsBuiltInf() self.Progress.Stop("done!") if Target == "genmake": return True @@ -1007,8 +1011,8 @@ class Build(): InfFileNameList = ModuleList.keys() #InfFileNameList.sort() for InfFile in InfFileNameList: - sys.stdout.write (".") - sys.stdout.flush() + sys.stdout.write (".") + sys.stdout.flush() ModuleInfo = ModuleList[InfFile] ModuleName = ModuleInfo.BaseName ModuleOutputImage = ModuleInfo.Image.FileName @@ -1141,8 +1145,8 @@ class Build(): ## Collect MAP information of all modules # def _CollectModuleMapBuffer (self, MapBuffer, ModuleList): - sys.stdout.write ("Generate Load Module At Fix Address Map") - sys.stdout.flush() + sys.stdout.write ("Generate Load Module At Fix Address Map") + sys.stdout.flush() PatchEfiImageList = [] PeiModuleList = {} BtModuleList = {} @@ -1187,11 +1191,11 @@ class Build(): SmmModuleList[Module.MetaFile] = ImageInfo SmmSize += ImageInfo.Image.Size if Module.ModuleType == 'DXE_SMM_DRIVER': - PiSpecVersion = 0 - if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification: - PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION'] + PiSpecVersion = '0x00000000' + if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification: + PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION'] # for PI specification < PI1.1, DXE_SMM_DRIVER also runs as BOOT time driver. - if PiSpecVersion < 0x0001000A: + if int(PiSpecVersion, 16) < 0x0001000A: BtModuleList[Module.MetaFile] = ImageInfo BtSize += ImageInfo.Image.Size break @@ -1245,7 +1249,7 @@ class Build(): # # Get PCD offset in EFI image by GenPatchPcdTable function # - PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage) + PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage) # # Patch real PCD value by PatchPcdValue tool # @@ -1277,8 +1281,8 @@ class Build(): self._RebaseModule (MapBuffer, RtBaseAddr, RtModuleList, TopMemoryAddress == 0) self._RebaseModule (MapBuffer, 0x1000, SmmModuleList, AddrIsOffset = False, ModeIsSmm = True) MapBuffer.write('\n\n') - sys.stdout.write ("\n") - sys.stdout.flush() + sys.stdout.write ("\n") + sys.stdout.flush() ## Save platform Map file # @@ -1291,10 +1295,10 @@ class Build(): # Save address map into MAP file. # SaveFileOnChange(MapFilePath, MapBuffer.getvalue(), False) - MapBuffer.close() - if self.LoadFixAddress != 0: - sys.stdout.write ("\nLoad Module At Fix Address Map file can be found at %s\n" %(MapFilePath)) - sys.stdout.flush() + MapBuffer.close() + if self.LoadFixAddress != 0: + sys.stdout.write ("\nLoad Module At Fix Address Map file can be found at %s\n" %(MapFilePath)) + sys.stdout.flush() ## Build active platform for different build targets and different tool chains # @@ -1487,6 +1491,7 @@ class Build(): if not self.SkipAutoGen or self.Target == 'genmake': Ma.CreateMakeFile(True) + Ma.CreateAsBuiltInf() if self.Target == "genmake": continue self.Progress.Stop("done!") -- cgit v1.2.3