import Common.VpdInfoFile as VpdInfoFile\r
from GenPcdDb import CreatePcdDatabaseCode\r
from Workspace.MetaFileCommentParser import UsageList\r
-\r
+from Common.MultipleWorkspace import MultipleWorkspace as mws\r
import InfSectionParser\r
\r
## Regular expression for splitting Dependency Expression string into tokens\r
for Pa in self.AutoGenObjectList:\r
for Package in Pa.PackageList:\r
PcdList = Package.Pcds.values()\r
- PcdList.sort(lambda x, y: cmp(x.TokenValue, y.TokenValue)) \r
+ PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.TokenValue, 0))) \r
Count = 0\r
while (Count < len(PcdList) - 1) :\r
Item = PcdList[Count]\r
#\r
# Make sure in the same token space the TokenValue should be unique\r
#\r
- if (Item.TokenValue == ItemNext.TokenValue):\r
+ if (int(Item.TokenValue, 0) == int(ItemNext.TokenValue, 0)):\r
SameTokenValuePcdList = []\r
SameTokenValuePcdList.append(Item)\r
SameTokenValuePcdList.append(ItemNext)\r
RemainPcdListLength = len(PcdList) - Count - 2\r
for ValueSameCount in range(RemainPcdListLength):\r
- if PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount].TokenValue == Item.TokenValue:\r
+ if int(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount].TokenValue, 0) == int(Item.TokenValue, 0):\r
SameTokenValuePcdList.append(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount])\r
else:\r
break;\r
#\r
# Check PCDs with same TokenSpaceGuidCName.TokenCName have same token value as well.\r
#\r
- if (Item.TokenSpaceGuidCName == ItemNext.TokenSpaceGuidCName) and (Item.TokenCName == ItemNext.TokenCName) and (Item.TokenValue != ItemNext.TokenValue):\r
+ if (Item.TokenSpaceGuidCName == ItemNext.TokenSpaceGuidCName) and (Item.TokenCName == ItemNext.TokenCName) and (int(Item.TokenValue, 0) != int(ItemNext.TokenValue, 0)):\r
EdkLogger.error(\r
'build',\r
FORMAT_INVALID,\r
self._GuidValue = {}\r
FdfModuleList = []\r
for InfName in self._AsBuildInfList:\r
- InfName = os.path.join(self.WorkspaceDir, InfName)\r
+ InfName = mws.join(self.WorkspaceDir, InfName)\r
FdfModuleList.append(os.path.normpath(InfName))\r
for F in self.Platform.Modules.keys():\r
M = ModuleAutoGen(self.Workspace, F, self.BuildTarget, self.ToolChain, self.Arch, self.MetaFile)\r
def _GetFdfFile(self):\r
if self._FdfFile == None:\r
if self.Workspace.FdfFile != "":\r
- self._FdfFile= path.join(self.WorkspaceDir, self.Workspace.FdfFile)\r
+ self._FdfFile= mws.join(self.WorkspaceDir, self.Workspace.FdfFile)\r
else:\r
self._FdfFile = ''\r
return self._FdfFile\r
# Key[0] -- tool family\r
# Key[1] -- TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE\r
#\r
- if Key[0] == self.BuildRuleFamily :\r
+ if (Key[0] == self.BuildRuleFamily and\r
+ (ModuleStyle == None or len(Key) < 3 or (len(Key) > 2 and Key[2] == ModuleStyle))):\r
Target, ToolChain, Arch, CommandType, Attr = Key[1].split('_')\r
if Target == self.BuildTarget or Target == "*":\r
if ToolChain == self.ToolChain or ToolChain == "*":\r
if Options.get((self.BuildRuleFamily, NowKey)) != None: \r
Options.pop((self.BuildRuleFamily, NowKey))\r
\r
- \r
for Key in Options:\r
if ModuleStyle != None and len (Key) > 2:\r
# Check Module style is EDK or EDKII.\r
if Arch == "*" or Arch == self.Arch:\r
if Tool not in BuildOptions:\r
BuildOptions[Tool] = {}\r
- if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:\r
+ if Attr != "FLAGS" or Attr not in BuildOptions[Tool] or Options[Key].startswith('='):\r
BuildOptions[Tool][Attr] = Options[Key]\r
else:\r
# append options for the same tool\r
# Build Option Family has been checked, which need't to be checked again for family.\r
if FamilyMatch or FamilyIsNull:\r
return BuildOptions\r
- \r
+\r
for Key in Options:\r
if ModuleStyle != None and len (Key) > 2:\r
# Check Module style is EDK or EDKII.\r
if Arch == "*" or Arch == self.Arch:\r
if Tool not in BuildOptions:\r
BuildOptions[Tool] = {}\r
- if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:\r
+ if Attr != "FLAGS" or Attr not in BuildOptions[Tool] or Options[Key].startswith('='):\r
BuildOptions[Tool][Attr] = Options[Key]\r
else:\r
# append options for the same tool\r
BuildOptions[Tool][Attr] = ""\r
# check if override is indicated\r
if Value.startswith('='):\r
- BuildOptions[Tool][Attr] = Value[1:]\r
+ ToolPath = Value[1:]\r
+ ToolPath = mws.handleWsMacro(ToolPath)\r
+ BuildOptions[Tool][Attr] = ToolPath\r
else:\r
+ Value = mws.handleWsMacro(Value)\r
BuildOptions[Tool][Attr] += " " + Value\r
if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag != None:\r
#\r
return False\r
\r
self.SourceDir = self.MetaFile.SubDir\r
- if self.SourceDir.upper().find(self.WorkspaceDir.upper()) == 0:\r
- self.SourceDir = self.SourceDir[len(self.WorkspaceDir) + 1:]\r
+ self.SourceDir = mws.relpath(self.SourceDir, self.WorkspaceDir)\r
\r
self.SourceOverrideDir = None\r
# use overrided path defined in DSC file\r
self._IncludePathList.append(self.DebugDir)\r
\r
for Package in self.Module.Packages:\r
- PackageDir = path.join(self.WorkspaceDir, Package.MetaFile.Dir)\r
+ PackageDir = mws.join(self.WorkspaceDir, Package.MetaFile.Dir)\r
if PackageDir not in self._IncludePathList:\r
self._IncludePathList.append(PackageDir)\r
for Inc in Package.Includes:\r