diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-11-25 06:21:03 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-11-25 06:21:03 +0000 |
commit | 2bcc713e74b944bb5aefb433ef33fb4002a62d76 (patch) | |
tree | 7aa002279415c1fafbedbf287d256177746e0a4a /BaseTools/Source/Python/Workspace | |
parent | c32dcd284c19bbb0b1db3606a243d9d69d37d6ab (diff) | |
download | edk2-platforms-2bcc713e74b944bb5aefb433ef33fb4002a62d76.tar.xz |
Sync BaseTool trunk (version r2423) into EDKII BaseTools. The change mainly includes:
1. Fix !include issues
2. Fix Trim to skip the postfix 'U' for hexadecimal and decimal numbers
3. Fix building error C2733 when building C++ code.
4. Add GCC46 tool chain definition
5. Add new RVCT and RVCTLINUX tool chains
Signed-off-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12782 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Workspace')
-rw-r--r-- | BaseTools/Source/Python/Workspace/MetaFileParser.py | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index bfa7054396..d907b11ba1 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -769,7 +769,7 @@ class DscParser(MetaFileParser): self._InSubsection = False self._SubsectionType = MODEL_UNKNOWN self._SubsectionName = '' - self._Owner.pop() + self._Owner[-1] = -1 continue # subsection header elif Line[0] == TAB_OPTION_START and Line[-1] == TAB_OPTION_END: @@ -1247,19 +1247,48 @@ class DscParser(MetaFileParser): MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF]: break elif self._ItemType == MODEL_META_DATA_INCLUDE: - # The included file must be relative to workspace - IncludedFile = NormPath(ReplaceMacro(self._ValueList[1], self._Macros, RaiseError=True)) - IncludedFile = PathClass(IncludedFile, GlobalData.gWorkspace) - ErrorCode, ErrorInfo = IncludedFile.Validate() + # The included file must be relative to workspace or same directory as DSC file + __IncludeMacros = {} + # + # Allow using system environment variables in path after !include + # + __IncludeMacros['WORKSPACE'] = GlobalData.gGlobalDefines['WORKSPACE'] + if "ECP_SOURCE" in GlobalData.gGlobalDefines.keys(): + __IncludeMacros['ECP_SOURCE'] = GlobalData.gGlobalDefines['ECP_SOURCE'] + # + # During GenFds phase call DSC parser, will go into this branch. + # + elif "ECP_SOURCE" in GlobalData.gCommandLineDefines.keys(): + __IncludeMacros['ECP_SOURCE'] = GlobalData.gCommandLineDefines['ECP_SOURCE'] + + __IncludeMacros['EFI_SOURCE'] = GlobalData.gGlobalDefines['EFI_SOURCE'] + __IncludeMacros['EDK_SOURCE'] = GlobalData.gGlobalDefines['EDK_SOURCE'] + # + # Allow using MACROs comes from [Defines] section to keep compatible. + # + __IncludeMacros.update(self._Macros) + + IncludedFile = NormPath(ReplaceMacro(self._ValueList[1], __IncludeMacros, RaiseError=True)) + # + # First search the include file under the same directory as DSC file + # + IncludedFile1 = PathClass(IncludedFile, self.MetaFile.Dir) + ErrorCode, ErrorInfo1 = IncludedFile1.Validate() if ErrorCode != 0: - EdkLogger.error('parser', ErrorCode, File=self._FileWithError, - Line=self._LineIndex+1, ExtraData=ErrorInfo) + # + # Also search file under the WORKSPACE directory + # + IncludedFile1 = PathClass(IncludedFile, GlobalData.gWorkspace) + ErrorCode, ErrorInfo2 = IncludedFile1.Validate() + if ErrorCode != 0: + EdkLogger.error('parser', ErrorCode, File=self._FileWithError, + Line=self._LineIndex+1, ExtraData=ErrorInfo1 + "\n"+ ErrorInfo2) - self._FileWithError = IncludedFile + self._FileWithError = IncludedFile1 - IncludedFileTable = MetaFileStorage(self._Table.Cur, IncludedFile, MODEL_FILE_DSC, False) + IncludedFileTable = MetaFileStorage(self._Table.Cur, IncludedFile1, MODEL_FILE_DSC, False) Owner = self._Content[self._ContentIndex-1][0] - Parser = DscParser(IncludedFile, self._FileType, IncludedFileTable, + Parser = DscParser(IncludedFile1, self._FileType, IncludedFileTable, Owner=Owner, From=Owner) # set the parser status with current status @@ -1280,7 +1309,10 @@ class DscParser(MetaFileParser): Records = IncludedFileTable.GetAll() if Records: self._Content[self._ContentIndex:self._ContentIndex] = Records - + self._Content.pop(self._ContentIndex-1) + self._ValueList = None + self._ContentIndex -= 1 + def __ProcessSkuId(self): self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=True) for Value in self._ValueList] |