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
This commit is contained in:
3
BaseTools/Source/Python/UPT/BuildVersion.py
Normal file
3
BaseTools/Source/Python/UPT/BuildVersion.py
Normal file
@ -0,0 +1,3 @@
|
||||
#This file is for build version number auto generation
|
||||
#
|
||||
gBUILD_VERSION = "Build 2423"
|
@ -834,6 +834,59 @@ def ProcessLineExtender(LineList):
|
||||
|
||||
return NewList
|
||||
|
||||
## ProcessEdkComment
|
||||
#
|
||||
# Process EDK style comment in LineList: c style /* */ comment or cpp style // comment
|
||||
#
|
||||
#
|
||||
# @param LineList The LineList need to be processed.
|
||||
#
|
||||
# @return LineList The LineList been processed.
|
||||
# @return FirstPos Where Edk comment is first found, -1 if not found
|
||||
#
|
||||
def ProcessEdkComment(LineList):
|
||||
FindEdkBlockComment = False
|
||||
Count = 0
|
||||
StartPos = -1
|
||||
EndPos = -1
|
||||
FirstPos = -1
|
||||
|
||||
while(Count < len(LineList)):
|
||||
Line = LineList[Count].strip()
|
||||
if Line.startswith("/*"):
|
||||
#
|
||||
# handling c style comment
|
||||
#
|
||||
StartPos = Count
|
||||
while Count < len(LineList):
|
||||
Line = LineList[Count].strip()
|
||||
if Line.endswith("*/"):
|
||||
if (Count == StartPos) and Line.strip() == '/*/':
|
||||
Count = Count + 1
|
||||
continue
|
||||
EndPos = Count
|
||||
FindEdkBlockComment = True
|
||||
break
|
||||
Count = Count + 1
|
||||
|
||||
if FindEdkBlockComment:
|
||||
if FirstPos == -1:
|
||||
FirstPos = StartPos
|
||||
for Index in xrange(StartPos, EndPos+1):
|
||||
LineList[Index] = ''
|
||||
FindEdkBlockComment = False
|
||||
elif Line.find("//") != -1:
|
||||
#
|
||||
# handling cpp style comment
|
||||
#
|
||||
LineList[Count] = Line.replace("//", '#')
|
||||
if FirstPos == -1:
|
||||
FirstPos = Count
|
||||
|
||||
Count = Count + 1
|
||||
|
||||
return LineList, FirstPos
|
||||
|
||||
## GetLibInstanceInfo
|
||||
#
|
||||
# Get the information from Library Instance INF file.
|
||||
|
@ -196,6 +196,7 @@ ERR_INF_PARSER_VER_EXIST_BOTH_NUM_STR = \
|
||||
_("The INF file %s defines both VERSION_NUMBER and VERSION_STRING, "
|
||||
"using VERSION_STRING")
|
||||
ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF = _("EDKI INF is not supported")
|
||||
ERR_INF_PARSER_EDKI_COMMENT_IN_EDKII = _("The EDKI style comment is not supported in EDKII modules")
|
||||
|
||||
ERR_INF_PARSER_FEATUREPCD_USAGE_INVALID = _("The usage for FeaturePcd can only"
|
||||
" be type of \"CONSUMES\".")
|
||||
|
@ -24,14 +24,14 @@ SOURCES_PATH = .
|
||||
|
||||
APPLICATIONS=$(BIN_DIR)\UPT.exe
|
||||
|
||||
COMMON_PYTHON=$(SOURCES_PATH)\UPT.py
|
||||
UPT_BUILDVERSION_PYTHON=$(SOURCES_PATH)\BuildVersion.py
|
||||
|
||||
all: SetPythonPath $(APPLICATIONS)
|
||||
|
||||
SetPythonPath:
|
||||
set PYTHONPATH= $(SOURCES_PATH)
|
||||
|
||||
$(BIN_DIR)\UPT.exe: $(SOURCES_PATH)\UPT.py $(COMMON_PYTHON)
|
||||
$(BIN_DIR)\UPT.exe: $(SOURCES_PATH)\UPT.py $(UPT_BUILDVERSION_PYTHON)
|
||||
@pushd . & @cd build & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) UPT.py & @popd
|
||||
@pushd . & @copy .\Dll\sqlite3.dll .\Bin\Sqlite3.dll & @popd
|
||||
clean:
|
||||
|
@ -26,6 +26,7 @@ from copy import deepcopy
|
||||
from Library.String import GetSplitValueList
|
||||
from Library.String import ConvertSpecialChar
|
||||
from Library.Misc import ProcessLineExtender
|
||||
from Library.Misc import ProcessEdkComment
|
||||
from Library.Parsing import NormPath
|
||||
from Library.ParserValidate import IsValidInfMoudleTypeList
|
||||
from Library.ParserValidate import IsValidArch
|
||||
@ -164,6 +165,12 @@ class InfParser(InfSectionParser):
|
||||
#
|
||||
FileLinesList = ProcessLineExtender(FileLinesList)
|
||||
|
||||
#
|
||||
# Process EdkI INF style comment if found
|
||||
#
|
||||
OrigLines = [Line for Line in FileLinesList]
|
||||
FileLinesList, EdkCommentStartPos = ProcessEdkComment(FileLinesList)
|
||||
|
||||
#
|
||||
# Judge whether the INF file is Binary INF or not
|
||||
#
|
||||
@ -338,6 +345,17 @@ class InfParser(InfSectionParser):
|
||||
ST.ERR_INF_PARSER_HEADER_MISSGING,
|
||||
File=self.FullPath)
|
||||
|
||||
#
|
||||
# EDKII INF should not have EDKI style comment
|
||||
#
|
||||
if EdkCommentStartPos != -1:
|
||||
Logger.Error("InfParser",
|
||||
FORMAT_INVALID,
|
||||
ST.ERR_INF_PARSER_EDKI_COMMENT_IN_EDKII,
|
||||
File=self.FullPath,
|
||||
Line=EdkCommentStartPos + 1,
|
||||
ExtraData=OrigLines[EdkCommentStartPos])
|
||||
|
||||
#
|
||||
# extract [Event] [Hob] [BootMode] sections
|
||||
#
|
||||
|
@ -43,7 +43,7 @@ import RmPkg
|
||||
from Library.Misc import CheckEnvVariable
|
||||
from Library import GlobalData
|
||||
from Core.IpiDb import IpiDatabase
|
||||
from Common.BuildVersion import gBUILD_VERSION
|
||||
from BuildVersion import gBUILD_VERSION
|
||||
|
||||
##
|
||||
# Version and Copyright
|
||||
|
Reference in New Issue
Block a user