X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FEdkIIWorkspaceBuild.py;h=c4f45b7c59c223b1ea354e29b1dcea0573551b84;hb=7da06eeede10fc8b908327b375bcdf36707ff7b5;hp=69a67eda391ee68f5dad61b7b6a4a7abf56519f4;hpb=40d841f6a8f84e75409178e19e69b95e01bada0f;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py b/BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py index 69a67eda39..c4f45b7c59 100644 --- a/BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py +++ b/BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py @@ -1,7 +1,7 @@ ## @file # This file is used to define each component of the build database # -# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2014, 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 @@ -14,7 +14,7 @@ ## # Import Modules # -import os, string, copy, pdb, copy +import Common.LongFilePathOs as os, string, copy, pdb, copy import EdkLogger import DataType from InfClassObject import * @@ -22,7 +22,7 @@ from DecClassObject import * from DscClassObject import * from String import * from BuildToolError import * -from Misc import sdict +from collections import OrderedDict import Database as Database import time as time @@ -93,7 +93,7 @@ class PcdClassObject(object): # @retval True The two pcds are the same # def __eq__(self, Other): - return Other != None and self.TokenCName == Other.TokenCName and self.TokenSpaceGuidCName == Other.TokenSpaceGuidCName + return Other is not None and self.TokenCName == Other.TokenCName and self.TokenSpaceGuidCName == Other.TokenSpaceGuidCName ## Override __hash__ function # @@ -121,7 +121,7 @@ class LibraryClassObject(object): def __init__(self, Name = None, SupModList = [], Type = None): self.LibraryClass = Name self.SupModList = SupModList - if Type != None: + if Type is not None: self.SupModList = CleanString(Type).split(DataType.TAB_SPACE_SPLIT) ## ModuleBuildClassObject @@ -189,7 +189,7 @@ class ModuleBuildClassObject(object): self.Binaries = [] self.Sources = [] - self.LibraryClasses = sdict() + self.LibraryClasses = OrderedDict() self.Libraries = [] self.Protocols = [] self.Ppis = [] @@ -405,7 +405,7 @@ class ItemBuild(object): # # @var WorkspaceDir: To store value for WorkspaceDir # @var SupArchList: To store value for SupArchList, selection scope is in below list -# EBC | IA32 | X64 | IPF | ARM | PPC +# EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64 # @var BuildTarget: To store value for WorkspaceDir, selection scope is in below list # RELEASE | DEBUG # @var SkuId: To store value for SkuId @@ -864,7 +864,7 @@ class WorkspaceBuild(object): for Libs in Pb.LibraryClass: for Type in Libs.SupModList: Instance = self.FindLibraryClassInstanceOfLibrary(Lib, Arch, Type) - if Instance == None: + if Instance is None: Instance = RecommendedInstance Pb.LibraryClasses[(Lib, Type)] = Instance else: @@ -872,7 +872,7 @@ class WorkspaceBuild(object): # For Module # Instance = self.FindLibraryClassInstanceOfModule(Lib, Arch, Pb.ModuleType, Inf) - if Instance == None: + if Instance is None: Instance = RecommendedInstance Pb.LibraryClasses[(Lib, Pb.ModuleType)] = Instance @@ -912,7 +912,7 @@ class WorkspaceBuild(object): if not self.IsModuleDefinedInPlatform(Inf, Arch, InfList): continue Module = self.Build[Arch].ModuleDatabase[Inf] - if Module.LibraryClass == None or Module.LibraryClass == []: + if Module.LibraryClass is None or Module.LibraryClass == []: self.UpdateLibrariesOfModule(Platform, Module, Arch) for Key in Module.LibraryClasses: Lib = Module.LibraryClasses[Key] @@ -929,13 +929,13 @@ class WorkspaceBuild(object): ModuleDatabase = self.Build[Arch].ModuleDatabase ModuleType = Module.ModuleType - # check R8 module + # check Edk module if Module.AutoGenVersion < 0x00010005: EdkLogger.verbose("") EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), Arch)) LibraryConsumerList = [Module] - # "CompilerStub" is a must for R8 modules + # "CompilerStub" is a must for Edk modules Module.Libraries.append("CompilerStub") while len(LibraryConsumerList) > 0: M = LibraryConsumerList.pop() @@ -952,11 +952,11 @@ class WorkspaceBuild(object): EdkLogger.verbose("\t" + LibraryName + " : " + LibraryFile) return - # R9 module + # EdkII module LibraryConsumerList = [Module] Constructor = [] - ConsumedByList = sdict() - LibraryInstance = sdict() + ConsumedByList = OrderedDict() + LibraryInstance = OrderedDict() EdkLogger.verbose("") EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), Arch)) @@ -969,15 +969,15 @@ class WorkspaceBuild(object): continue LibraryClassName = Key[0] - if LibraryClassName not in LibraryInstance or LibraryInstance[LibraryClassName] == None: - if LibraryPath == None or LibraryPath == "": + if LibraryClassName not in LibraryInstance or LibraryInstance[LibraryClassName] is None: + if LibraryPath is None or LibraryPath == "": LibraryInstance[LibraryClassName] = None continue LibraryModule = ModuleDatabase[LibraryPath] LibraryInstance[LibraryClassName] = LibraryModule LibraryConsumerList.append(LibraryModule) EdkLogger.verbose("\t" + LibraryClassName + " : " + str(LibraryModule)) - elif LibraryPath == None or LibraryPath == "": + elif LibraryPath is None or LibraryPath == "": continue else: LibraryModule = LibraryInstance[LibraryClassName] @@ -1002,7 +1002,7 @@ class WorkspaceBuild(object): Q = [] for LibraryClassName in LibraryInstance: M = LibraryInstance[LibraryClassName] - if M == None: + if M is None: EdkLogger.error("AutoGen", AUTOGEN_ERROR, "Library instance for library class [%s] is not found" % LibraryClassName, ExtraData="\t%s [%s]" % (str(Module), Arch)) @@ -1011,7 +1011,7 @@ class WorkspaceBuild(object): # check if there're duplicate library classes # for Lc in M.LibraryClass: - if Lc.SupModList != None and ModuleType not in Lc.SupModList: + if Lc.SupModList is not None and ModuleType not in Lc.SupModList: EdkLogger.error("AutoGen", AUTOGEN_ERROR, "Module type [%s] is not supported by library instance [%s]" % (ModuleType, str(M)), ExtraData="\t%s" % str(Module)) @@ -1097,7 +1097,7 @@ class WorkspaceBuild(object): # The DAG Topo sort produces the destructor order, so the list of constructors must generated in the reverse order # SortedLibraryList.reverse() - Module.LibraryClasses = sdict() + Module.LibraryClasses = OrderedDict() for L in SortedLibraryList: for Lc in L.LibraryClass: Module.LibraryClasses[Lc.LibraryClass, ModuleType] = str(L) @@ -1380,7 +1380,7 @@ class WorkspaceBuild(object): if (Name, Guid) in Pcds: OwnerPlatform = Dsc Pcd = Pcds[(Name, Guid)] - if Pcd.Type != '' and Pcd.Type != None: + if Pcd.Type != '' and Pcd.Type is not None: NewType = Pcd.Type if NewType in DataType.PCD_DYNAMIC_TYPE_LIST: NewType = DataType.TAB_PCDS_DYNAMIC @@ -1396,13 +1396,13 @@ class WorkspaceBuild(object): EdkLogger.error("AutoGen", PARSER_ERROR, ErrorMsg) - if Pcd.DatumType != '' and Pcd.DatumType != None: + if Pcd.DatumType != '' and Pcd.DatumType is not None: DatumType = Pcd.DatumType - if Pcd.TokenValue != '' and Pcd.TokenValue != None: + if Pcd.TokenValue != '' and Pcd.TokenValue is not None: Token = Pcd.TokenValue - if Pcd.DefaultValue != '' and Pcd.DefaultValue != None: + if Pcd.DefaultValue != '' and Pcd.DefaultValue is not None: Value = Pcd.DefaultValue - if Pcd.MaxDatumSize != '' and Pcd.MaxDatumSize != None: + if Pcd.MaxDatumSize != '' and Pcd.MaxDatumSize is not None: MaxDatumSize = Pcd.MaxDatumSize SkuInfoList = Pcd.SkuInfoList