diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-18 12:17:25 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-18 12:17:25 +0000 |
commit | b36d134faf4305247830522b8e2bb255e98c5699 (patch) | |
tree | ec37795cbc86b693528a062030cb516039bcb1c2 /BaseTools/Source/Python/AutoGen | |
parent | e7fe4028631b6a7d70e3c02c7c40ff1504321daa (diff) | |
download | edk2-platforms-b36d134faf4305247830522b8e2bb255e98c5699.tar.xz |
Sync BaseTools Branch (version r2321) to EDKII main trunk.
Signed-off-by: lgao4
Reviewed-by: gikidy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12372 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/AutoGen')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 29 | ||||
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenC.py | 28 | ||||
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenDepex.py | 4 | ||||
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenMake.py | 10 |
4 files changed, 40 insertions, 31 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index ff1c4fd82c..d51c59e204 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -357,8 +357,8 @@ class WorkspaceAutoGen(AutoGen): # @return None
#
def _CheckAllPcdsTokenValueConflict(self):
- if len(self.BuildDatabase.WorkspaceDb.PackageList) >= 1:
- for Package in self.BuildDatabase.WorkspaceDb.PackageList:
+ for Pa in self.AutoGenObjectList:
+ for Package in Pa.PackageList:
PcdList = Package.Pcds.values()
PcdList.sort(lambda x, y: cmp(x.TokenValue, y.TokenValue))
Count = 0
@@ -1152,7 +1152,7 @@ class PlatformAutoGen(AutoGen): if LibraryClass.startswith("NULL"):
Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]
- # R9 module
+ # EdkII module
LibraryConsumerList = [Module]
Constructor = []
ConsumedByList = sdict()
@@ -1401,7 +1401,7 @@ class PlatformAutoGen(AutoGen): ## Resolve library names to library modules
#
- # (for R8.x modules)
+ # (for Edk.x modules)
#
# @param Module The module from which the library names will be resolved
#
@@ -1412,7 +1412,7 @@ class PlatformAutoGen(AutoGen): EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), self.Arch))
LibraryConsumerList = [Module]
- # "CompilerStub" is a must for R8 modules
+ # "CompilerStub" is a must for Edk modules
if Module.Libraries:
Module.Libraries.append("CompilerStub")
LibraryList = []
@@ -1794,6 +1794,10 @@ class ModuleAutoGen(AutoGen): def _GetBaseName(self):
return self.Module.BaseName
+ ## Return the module DxsFile if exist
+ def _GetDxsFile(self):
+ return self.Module.DxsFile
+
## Return the module SourceOverridePath
def _GetSourceOverridePath(self):
return self.Module.SourceOverridePath
@@ -1810,7 +1814,7 @@ class ModuleAutoGen(AutoGen): def _GetModuleType(self):
return self.Module.ModuleType
- ## Return the component type (for R8.x style of module)
+ ## Return the component type (for Edk.x style of module)
def _GetComponentType(self):
return self.Module.ComponentType
@@ -1913,7 +1917,7 @@ class ModuleAutoGen(AutoGen): def _GetDepexTokenList(self):
if self._DepexList == None:
self._DepexList = {}
- if self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
+ if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
return self._DepexList
self._DepexList[self.ModuleType] = []
@@ -1949,7 +1953,7 @@ class ModuleAutoGen(AutoGen): def _GetDepexExpressionTokenList(self):
if self._DepexExpressionList == None:
self._DepexExpressionList = {}
- if self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
+ if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
return self._DepexExpressionList
self._DepexExpressionList[self.ModuleType] = ''
@@ -2153,7 +2157,7 @@ class ModuleAutoGen(AutoGen): self._BuildTargets = {}
self._FileTypes = {}
- #TRICK: call _GetSourceFileList to apply build rule for binary files
+ #TRICK: call _GetSourceFileList to apply build rule for source files
if self.SourceFileList:
pass
@@ -2306,11 +2310,11 @@ class ModuleAutoGen(AutoGen): for Inc in self.Module.Includes:
if Inc not in self._IncludePathList:
self._IncludePathList.append(Inc)
- # for r8 modules
+ # for Edk modules
Inc = path.join(Inc, self.Arch.capitalize())
if os.path.exists(Inc) and Inc not in self._IncludePathList:
self._IncludePathList.append(Inc)
- # r8 module needs to put DEBUG_DIR at the end of search path and not to use SOURCE_DIR all the time
+ # Edk module needs to put DEBUG_DIR at the end of search path and not to use SOURCE_DIR all the time
self._IncludePathList.append(self.DebugDir)
else:
self._IncludePathList.append(self.MetaFile.Dir)
@@ -2470,7 +2474,7 @@ class ModuleAutoGen(AutoGen): for File in self.AutoGenFileList:
if GenC.Generate(File.Path, self.AutoGenFileList[File], File.IsBinary):
- #Ignore R8 AutoGen.c
+ #Ignore Edk AutoGen.c
if self.AutoGenVersion < 0x00010005 and File.Name == 'AutoGen.c':
continue
@@ -2572,6 +2576,7 @@ class ModuleAutoGen(AutoGen): ProtocolList = property(_GetProtocolList)
PpiList = property(_GetPpiList)
DepexList = property(_GetDepexTokenList)
+ DxsFile = property(_GetDxsFile)
DepexExpressionList = property(_GetDepexExpressionTokenList)
BuildOption = property(_GetModuleBuildOption)
BuildCommand = property(_GetBuildCommand)
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py index 4430c94e0b..f733ac3e8d 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -67,21 +67,21 @@ typedef UINT8 SKU_ID; #define PCD_TYPE_SHIFT 28 -#define PCD_TYPE_DATA (0x0 << PCD_TYPE_SHIFT) -#define PCD_TYPE_HII (0x8 << PCD_TYPE_SHIFT) -#define PCD_TYPE_VPD (0x4 << PCD_TYPE_SHIFT) -#define PCD_TYPE_SKU_ENABLED (0x2 << PCD_TYPE_SHIFT) -#define PCD_TYPE_STRING (0x1 << PCD_TYPE_SHIFT) +#define PCD_TYPE_DATA (0x0U << PCD_TYPE_SHIFT) +#define PCD_TYPE_HII (0x8U << PCD_TYPE_SHIFT) +#define PCD_TYPE_VPD (0x4U << PCD_TYPE_SHIFT) +#define PCD_TYPE_SKU_ENABLED (0x2U << PCD_TYPE_SHIFT) +#define PCD_TYPE_STRING (0x1U << PCD_TYPE_SHIFT) #define PCD_TYPE_ALL_SET (PCD_TYPE_DATA | PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_SKU_ENABLED | PCD_TYPE_STRING) #define PCD_DATUM_TYPE_SHIFT 24 -#define PCD_DATUM_TYPE_POINTER (0x0 << PCD_DATUM_TYPE_SHIFT) -#define PCD_DATUM_TYPE_UINT8 (0x1 << PCD_DATUM_TYPE_SHIFT) -#define PCD_DATUM_TYPE_UINT16 (0x2 << PCD_DATUM_TYPE_SHIFT) -#define PCD_DATUM_TYPE_UINT32 (0x4 << PCD_DATUM_TYPE_SHIFT) -#define PCD_DATUM_TYPE_UINT64 (0x8 << PCD_DATUM_TYPE_SHIFT) +#define PCD_DATUM_TYPE_POINTER (0x0U << PCD_DATUM_TYPE_SHIFT) +#define PCD_DATUM_TYPE_UINT8 (0x1U << PCD_DATUM_TYPE_SHIFT) +#define PCD_DATUM_TYPE_UINT16 (0x2U << PCD_DATUM_TYPE_SHIFT) +#define PCD_DATUM_TYPE_UINT32 (0x4U << PCD_DATUM_TYPE_SHIFT) +#define PCD_DATUM_TYPE_UINT64 (0x8U << PCD_DATUM_TYPE_SHIFT) #define PCD_DATUM_TYPE_ALL_SET (PCD_DATUM_TYPE_POINTER | \\ PCD_DATUM_TYPE_UINT8 | \\ @@ -1951,7 +1951,11 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH): if Info.ModuleType in gModuleTypeHeaderFile \ and gModuleTypeHeaderFile[Info.ModuleType][0] != gBasicHeaderFile: AutoGenH.Append("#include <%s>\n" % gModuleTypeHeaderFile[Info.ModuleType][0]) - if 'PcdLib' in Info.Module.LibraryClasses: + # + # if either PcdLib in [LibraryClasses] sections or there exist Pcd section, add PcdLib.h + # As if modules only uses FixedPcd, then PcdLib is not needed in [LibraryClasses] section. + # + if 'PcdLib' in Info.Module.LibraryClasses or Info.Module.Pcds: AutoGenH.Append("#include <Library/PcdLib.h>\n") AutoGenH.Append('\nextern GUID gEfiCallerIdGuid;\n\n') @@ -2018,7 +2022,7 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH, UniGenCFlag, UniGenBinBuffer): CreateFooterCode(Info, AutoGenC, AutoGenH) - # no generation of AutoGen.c for R8 modules without unicode file + # no generation of AutoGen.c for Edk modules without unicode file if Info.AutoGenVersion < 0x00010005 and len(Info.UnicodeFileList) == 0: AutoGenC.String = '' diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source/Python/AutoGen/GenDepex.py index f80824b744..37ba7bc72c 100644 --- a/BaseTools/Source/Python/AutoGen/GenDepex.py +++ b/BaseTools/Source/Python/AutoGen/GenDepex.py @@ -23,7 +23,7 @@ from Common.BuildToolError import * from Common.Misc import SaveFileOnChange
from Common.Misc import GuidStructureStringToGuidString
from Common import EdkLogger as EdkLogger
-
+from Common.BuildVersion import gBUILD_VERSION
## Regular expression for matching "DEPENDENCY_START ... DEPENDENCY_END"
gStartClosePattern = re.compile(".*DEPENDENCY_START(.+)DEPENDENCY_END.*", re.S)
@@ -354,7 +354,7 @@ class DependencyExpression: Buffer.close()
return FileChangeFlag
-versionNumber = "0.04"
+versionNumber = ("0.04" + " " + gBUILD_VERSION)
__version__ = "%prog Version " + versionNumber
__copyright__ = "Copyright (c) 2007-2010, Intel Corporation All rights reserved."
__usage__ = "%prog [options] [dependency_expression_file]"
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 41a46fc69d..5bf693c50f 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -31,7 +31,7 @@ gIncludePattern = re.compile(r"^[ \t]*#?[ \t]*include(?:[ \t]*(?:\\(?:\r\n|\r|\n ## Regular expression for matching macro used in header file inclusion gMacroPattern = re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICODE) -## pattern for include style in R8.x code +## pattern for include style in Edk.x code gProtocolDefinition = "Protocol/%(HeaderKey)s/%(HeaderKey)s.h" gGuidDefinition = "Guid/%(HeaderKey)s/%(HeaderKey)s.h" gArchProtocolDefinition = "ArchProtocol/%(HeaderKey)s/%(HeaderKey)s.h" @@ -462,13 +462,13 @@ cleanlib: ArchEntryPoint = ModuleEntryPoint if self._AutoGenObject.Arch == "EBC": - # EBC compiler always use "EfiStart" as entry point. Only applies to R9 modules + # EBC compiler always use "EfiStart" as entry point. Only applies to EdkII modules ImageEntryPoint = "EfiStart" elif self._AutoGenObject.AutoGenVersion < 0x00010005: - # R8 modules use entry point specified in INF file + # Edk modules use entry point specified in INF file ImageEntryPoint = ModuleEntryPoint else: - # R9 modules always use "_ModuleEntryPoint" as entry point + # EdkII modules always use "_ModuleEntryPoint" as entry point ImageEntryPoint = "_ModuleEntryPoint" # tools definitions @@ -535,7 +535,7 @@ cleanlib: False ) - # R8 modules need <BaseName>StrDefs.h for string ID + # Edk modules need <BaseName>StrDefs.h for string ID #if self._AutoGenObject.AutoGenVersion < 0x00010005 and len(self._AutoGenObject.UnicodeFileList) > 0: # BcTargetList = ['strdefs'] #else: |