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
This commit is contained in:
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -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",
|
||||
|
@ -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)
|
||||
|
9
BaseTools/Source/Python/sitecustomize.py
Normal file
9
BaseTools/Source/Python/sitecustomize.py
Normal file
@ -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)
|
||||
|
Reference in New Issue
Block a user