diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-12-29 06:16:53 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-12-29 06:16:53 +0000 |
commit | a709adfaf0bebbaf3d989f56b500e3985687d0e3 (patch) | |
tree | 47d6f44e4afffe70535e492f8585f433efcbf24d /BaseTools/Source/Python | |
parent | 4661d5df04ce804e454509922fd54f45332553da (diff) | |
download | edk2-platforms-a709adfaf0bebbaf3d989f56b500e3985687d0e3.tar.xz |
Sync tool code to BuildTools project r1783.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9623 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 17 | ||||
-rw-r--r-- | BaseTools/Source/Python/Common/Misc.py | 10 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/Fv.py | 6 | ||||
-rw-r--r-- | BaseTools/Source/Python/Workspace/WorkspaceDatabase.py | 5 | ||||
-rw-r--r-- | BaseTools/Source/Python/build/build.py | 4 | ||||
-rw-r--r-- | BaseTools/Source/Python/sitecustomize.py | 9 |
6 files changed, 42 insertions, 9 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 9594ef0cae..ba026a9b26 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1094,7 +1094,12 @@ class PlatformAutoGen(AutoGen): # for overridding library instances with module specific setting PlatformModule = self.Platform.Modules[str(Module)] - # add forced library instance + # add forced library instances (specified under LibraryClasses sections) + for LibraryClass in self.Platform.LibraryClasses.GetKeys(): + if LibraryClass.startswith("NULL"): + Module.LibraryClasses[LibraryClass] = self.Platform.LibraryClasses[LibraryClass] + + # add forced library instances (specified in module overrides) for LibraryClass in PlatformModule.LibraryClasses: if LibraryClass.startswith("NULL"): Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass] @@ -1170,7 +1175,7 @@ class PlatformAutoGen(AutoGen): M = LibraryInstance[LibraryClassName] LibraryList.append(M) if ConsumedByList[M] == []: - Q.insert(0, M) + Q.append(M) # # start the DAG algorithm @@ -1939,7 +1944,7 @@ class ModuleAutoGen(AutoGen): if Source != File: CreateDirectory(Source.Dir) - if File.IsBinary and File == Source: + if File.IsBinary and File == Source and self._BinaryFileList != None and File in self._BinaryFileList: RuleObject = self.BuildRules[TAB_DEFAULT_BINARY_FILE] elif FileType in self.BuildRules: RuleObject = self.BuildRules[FileType] @@ -2053,11 +2058,11 @@ class ModuleAutoGen(AutoGen): self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE) if UniStringBinBuffer != None and UniStringBinBuffer.getvalue() != "": AutoFile = PathClass(gAutoGenStringFormFileName % {"module_name":self.Name}, self.OutputDir) - self._AutoGenFileList[AutoFile] = UniStringBinBuffer.getvalue()
+ self._AutoGenFileList[AutoFile] = UniStringBinBuffer.getvalue() AutoFile.IsBinary = True self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE) - if UniStringBinBuffer != None:
- UniStringBinBuffer.close()
+ if UniStringBinBuffer != None: + UniStringBinBuffer.close() return self._AutoGenFileList ## Return the list of library modules explicitly or implicityly used by this module diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index 76dfbb665e..2883169f3c 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -1125,6 +1125,16 @@ class tdict: for Key in self.data: self.data[Key].SetSingleMode() + def GetKeys(self, KeyIndex=0): + assert KeyIndex >= 0 + if KeyIndex == 0: + return set(self.data.keys()) + else: + keys = set() + for Key in self.data: + keys |= self.data[Key].GetKeys(KeyIndex - 1) + return keys + ## Boolean chain list # class Blist(UserList): diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py index a9ff26e597..6190bceba8 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -278,9 +278,13 @@ class FV (FvClassObject): #
if TotalSize > 0:
FvExtHeaderFileName = os.path.join(GenFdsGlobalVariable.FvDir, self.UiFvName + '.ext')
- FvExtHeaderFile = open (FvExtHeaderFileName,'wb')
+ FvExtHeaderFile = StringIO.StringIO()
FvExtHeaderFile.write(Buffer)
+ Changed = SaveFileOnChange(FvExtHeaderFileName, FvExtHeaderFile.getvalue(), True)
FvExtHeaderFile.close()
+ if Changed:
+ if os.path.exists (self.InfFileName):
+ os.remove (self.InfFileName)
self.FvInfFile.writelines("EFI_FV_EXT_HEADER_FILE_NAME = " + \
FvExtHeaderFileName + \
T_CHAR_LF)
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py index 2f2e8126c8..11b649658e 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py @@ -444,6 +444,10 @@ class DscBuildData(PlatformBuildClassObject): Macros.update(self._Macros) for Record in RecordList: LibraryClass, LibraryInstance, Dummy, Arch, ModuleType, Dummy, LineNo = Record + if LibraryClass == '' or LibraryClass == 'NULL': + self._NullLibraryNumber += 1 + LibraryClass = 'NULL%d' % self._NullLibraryNumber + EdkLogger.verbose("Found forced library for arch=%s\n\t%s [%s]" % (Arch, LibraryInstance, LibraryClass)) LibraryClassSet.add(LibraryClass) LibraryInstance = PathClass(NormPath(LibraryInstance, Macros), GlobalData.gWorkspace, Arch=self._Arch) # check the file validation @@ -1111,6 +1115,7 @@ class InfBuildData(ModuleBuildClassObject): "BS_DRIVER" : "DXE_DRIVER", "RT_DRIVER" : "DXE_RUNTIME_DRIVER", "SAL_RT_DRIVER" : "DXE_SAL_DRIVER", + "DXE_SMM_DRIVER" : "DXE_SMM_DRIVER", # "SMM_DRIVER" : "DXE_SMM_DRIVER", # "BS_DRIVER" : "DXE_SMM_DRIVER", # "BS_DRIVER" : "UEFI_DRIVER", diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 5f470de926..624d941b0f 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1265,9 +1265,9 @@ def MyOptionParser(): Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.") Parser.add_option("-D", "--define", action="append", type="string", dest="Macros", help="Macro: \"Name [= Value]\".") - Parser.add_option("-y", "--report-file", action="store", dest="ReportFile", help="Put build report in specified file.") + Parser.add_option("-y", "--report-file", action="store", dest="ReportFile", help="Create/overwrite the report to the specified filename.") Parser.add_option("-Y", "--report-type", action="append", type="choice", choices=['ALL','PCD',], dest="ReportType", - help="Flags that control the type of build report to generate. Must be one of [ALL, PCD]. To specify more flags, please repeat this option.") + help="Flags that control the type of build report to generate. Must be one of: [ALL, PCD]. To specify more than one flag, repeat this option on the command line.") (Opt, Args)=Parser.parse_args() return (Opt, Args) diff --git a/BaseTools/Source/Python/sitecustomize.py b/BaseTools/Source/Python/sitecustomize.py new file mode 100644 index 0000000000..fa5cd40705 --- /dev/null +++ b/BaseTools/Source/Python/sitecustomize.py @@ -0,0 +1,9 @@ +import sys +import locale + +if sys.platform == "darwin": + DefaultLocal = locale.getdefaultlocale()[1] + if DefaultLocal is None: + DefaultLocal = 'UTF8' + sys.setdefaultencoding(DefaultLocal) + |