Sync BaseTools Trunk (version r2518) to EDKII main trunk.
Signed-off-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13178 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -46,6 +46,9 @@ gMakeTypeMap = {"MSFT":"nmake", "GCC":"gmake"}
|
||||
## Build rule configuration file
|
||||
gBuildRuleFile = 'Conf/build_rule.txt'
|
||||
|
||||
## Build rule default version
|
||||
AutoGenReqBuildRuleVerNum = "0.1"
|
||||
|
||||
## default file name for AutoGen
|
||||
gAutoGenCodeFileName = "AutoGen.c"
|
||||
gAutoGenHeaderFileName = "AutoGen.h"
|
||||
@@ -288,8 +291,25 @@ class WorkspaceAutoGen(AutoGen):
|
||||
# apply SKU and inject PCDs from Flash Definition file
|
||||
for Arch in self.ArchList:
|
||||
Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
|
||||
|
||||
DecPcds = set()
|
||||
PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
|
||||
Pkgs = PGen.PackageList
|
||||
for Pkg in Pkgs:
|
||||
for Pcd in Pkg.Pcds.keys():
|
||||
DecPcds.add((Pcd[0], Pcd[1]))
|
||||
Platform.IsPlatformPcdDeclared(DecPcds)
|
||||
|
||||
Platform.SkuName = self.SkuId
|
||||
for Name, Guid in PcdSet:
|
||||
if (Name, Guid) not in DecPcds:
|
||||
EdkLogger.error(
|
||||
'build',
|
||||
PARSER_ERROR,
|
||||
"PCD (%s.%s) used in FDF is not declared in DEC files." % (Guid, Name),
|
||||
File = self.FdfProfile.PcdFileLineDict[Name, Guid][0],
|
||||
Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]
|
||||
)
|
||||
Platform.AddPcd(Name, Guid, PcdSet[Name, Guid])
|
||||
|
||||
Pa = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
|
||||
@@ -334,11 +354,14 @@ class WorkspaceAutoGen(AutoGen):
|
||||
#
|
||||
InfFoundFlag = False
|
||||
for Pa in self.AutoGenObjectList:
|
||||
if InfFoundFlag:
|
||||
break
|
||||
for Module in Pa.ModuleAutoGenList:
|
||||
if path.normpath(Module.MetaFile.File) == path.normpath(FfsFile.InfFileName):
|
||||
InfFoundFlag = True
|
||||
if not Module.Guid.upper() in _GuidDict.keys():
|
||||
_GuidDict[Module.Guid.upper()] = FfsFile
|
||||
break
|
||||
else:
|
||||
EdkLogger.error("build",
|
||||
FORMAT_INVALID,
|
||||
@@ -1230,6 +1253,15 @@ class PlatformAutoGen(AutoGen):
|
||||
if BuildRuleFile in [None, '']:
|
||||
BuildRuleFile = gBuildRuleFile
|
||||
self._BuildRule = BuildRule(BuildRuleFile)
|
||||
if self._BuildRule._FileVersion == "":
|
||||
self._BuildRule._FileVersion = AutoGenReqBuildRuleVerNum
|
||||
else:
|
||||
if self._BuildRule._FileVersion < AutoGenReqBuildRuleVerNum :
|
||||
# If Build Rule's version is less than the version number required by the tools, halting the build.
|
||||
EdkLogger.error("build", AUTOGEN_ERROR,
|
||||
ExtraData="The version number [%s] of build_rule.txt is less than the version number required by the AutoGen.(the minimum required version number is [%s])"\
|
||||
% (self._BuildRule._FileVersion, AutoGenReqBuildRuleVerNum))
|
||||
|
||||
return self._BuildRule
|
||||
|
||||
## Summarize the packages used by modules in this platform
|
||||
|
@@ -354,6 +354,7 @@ class BuildRule:
|
||||
self._FamilyList = []
|
||||
self._TotalToolChainFamilySet = set()
|
||||
self._RuleObjectList = [] # FileBuildRule object list
|
||||
self._FileVersion = ""
|
||||
|
||||
self.Parse()
|
||||
|
||||
@@ -368,7 +369,11 @@ class BuildRule:
|
||||
# Clean up the line and replace path separator with native one
|
||||
Line = self.RuleContent[Index].strip().replace(self._PATH_SEP, os.path.sep)
|
||||
self.RuleContent[Index] = Line
|
||||
|
||||
|
||||
# find the build_rule_version
|
||||
if Line and Line[0] == "#" and Line.find(TAB_BUILD_RULE_VERSION) <> -1:
|
||||
if Line.find("=") <> -1 and Line.find("=") < (len(Line)-1) and (Line[(Line.find("=") + 1):]).split():
|
||||
self._FileVersion = (Line[(Line.find("=") + 1):]).split()[0]
|
||||
# skip empty or comment line
|
||||
if Line == "" or Line[0] == "#":
|
||||
continue
|
||||
|
@@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# Routines for generating AutoGen.h and AutoGen.c
|
||||
#
|
||||
# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
@@ -103,17 +103,17 @@ typedef struct {
|
||||
} SKU_HEAD;
|
||||
|
||||
typedef struct {
|
||||
UINT32 StringIndex; // Offset in String Table in units of UINT32.
|
||||
UINT32 DefaultValueOffset; // Offset of the Default Value
|
||||
UINT16 GuidTableIndex; // Offset in Guid Table in units of GUID.
|
||||
UINT16 StringIndex; // Offset in String Table in units of UINT16.
|
||||
UINT16 Offset; // Offset in Variable
|
||||
UINT16 DefaultValueOffset; // Offset of the Default Value
|
||||
} VARIABLE_HEAD;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Offset;
|
||||
} VPD_HEAD;
|
||||
|
||||
typedef UINT16 STRING_HEAD;
|
||||
typedef UINT32 STRING_HEAD;
|
||||
|
||||
typedef UINT16 SIZE_INFO;
|
||||
|
||||
@@ -1346,13 +1346,13 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
|
||||
VariableHeadGuidIndex = GuidList.index(VariableGuid)
|
||||
|
||||
if "PCD_TYPE_STRING" in Pcd.TokenTypeList:
|
||||
VariableHeadValueList.append('%dU, %dU, %sU, offsetof(%s_PCD_DATABASE, Init.%s_%s)' %
|
||||
(VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset,
|
||||
Phase, CName, TokenSpaceGuid))
|
||||
VariableHeadValueList.append('%dU, offsetof(%s_PCD_DATABASE, Init.%s_%s), %dU, %sU' %
|
||||
(VariableHeadStringIndex, Phase, CName, TokenSpaceGuid,
|
||||
VariableHeadGuidIndex, Sku.VariableOffset))
|
||||
else:
|
||||
VariableHeadValueList.append('%dU, %dU, %sU, offsetof(%s_PCD_DATABASE, Init.%s_%s_VariableDefault_%s)' %
|
||||
(VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset,
|
||||
Phase, CName, TokenSpaceGuid, SkuIdIndex))
|
||||
VariableHeadValueList.append('%dU, offsetof(%s_PCD_DATABASE, Init.%s_%s_VariableDefault_%s), %dU, %sU' %
|
||||
(VariableHeadStringIndex, Phase, CName, TokenSpaceGuid, SkuIdIndex,
|
||||
VariableHeadGuidIndex, Sku.VariableOffset))
|
||||
Dict['VARDEF_CNAME_'+Pcd.DatumType].append(CName)
|
||||
Dict['VARDEF_GUID_'+Pcd.DatumType].append(TokenSpaceGuid)
|
||||
Dict['VARDEF_SKUID_'+Pcd.DatumType].append(SkuIdIndex)
|
||||
|
Reference in New Issue
Block a user