BaseTools: Remove unused logic for EDKI
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350 Remove EDK module type support from BaseTools python code. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -332,10 +332,6 @@ class LibraryReport(object):
|
||||
#
|
||||
def __init__(self, M):
|
||||
self.LibraryList = []
|
||||
if int(str(M.AutoGenVersion), 0) >= 0x00010005:
|
||||
self._EdkIIModule = True
|
||||
else:
|
||||
self._EdkIIModule = False
|
||||
|
||||
for Lib in M.DependentLibraryList:
|
||||
LibInfPath = str(Lib)
|
||||
@ -368,28 +364,23 @@ class LibraryReport(object):
|
||||
LibInfPath = LibraryItem[0]
|
||||
FileWrite(File, LibInfPath)
|
||||
|
||||
#
|
||||
# Report library class, library constructor and destructor for
|
||||
# EDKII style module.
|
||||
#
|
||||
if self._EdkIIModule:
|
||||
LibClass = LibraryItem[1]
|
||||
EdkIILibInfo = ""
|
||||
LibConstructor = " ".join(LibraryItem[2])
|
||||
if LibConstructor:
|
||||
EdkIILibInfo += " C = " + LibConstructor
|
||||
LibDestructor = " ".join(LibraryItem[3])
|
||||
if LibDestructor:
|
||||
EdkIILibInfo += " D = " + LibDestructor
|
||||
LibDepex = " ".join(LibraryItem[4])
|
||||
if LibDepex:
|
||||
EdkIILibInfo += " Depex = " + LibDepex
|
||||
if LibraryItem[5]:
|
||||
EdkIILibInfo += " Time = " + LibraryItem[5]
|
||||
if EdkIILibInfo:
|
||||
FileWrite(File, "{%s: %s}" % (LibClass, EdkIILibInfo))
|
||||
else:
|
||||
FileWrite(File, "{%s}" % LibClass)
|
||||
LibClass = LibraryItem[1]
|
||||
EdkIILibInfo = ""
|
||||
LibConstructor = " ".join(LibraryItem[2])
|
||||
if LibConstructor:
|
||||
EdkIILibInfo += " C = " + LibConstructor
|
||||
LibDestructor = " ".join(LibraryItem[3])
|
||||
if LibDestructor:
|
||||
EdkIILibInfo += " D = " + LibDestructor
|
||||
LibDepex = " ".join(LibraryItem[4])
|
||||
if LibDepex:
|
||||
EdkIILibInfo += " Depex = " + LibDepex
|
||||
if LibraryItem[5]:
|
||||
EdkIILibInfo += " Time = " + LibraryItem[5]
|
||||
if EdkIILibInfo:
|
||||
FileWrite(File, "{%s: %s}" % (LibClass, EdkIILibInfo))
|
||||
else:
|
||||
FileWrite(File, "{%s}" % LibClass)
|
||||
|
||||
FileWrite(File, gSubSectionEnd)
|
||||
|
||||
@ -1546,15 +1537,8 @@ class PredictionReport(object):
|
||||
|
||||
if Module.Guid and not Module.IsLibrary:
|
||||
EntryPoint = " ".join(Module.Module.ModuleEntryPointList)
|
||||
if int(str(Module.AutoGenVersion), 0) >= 0x00010005:
|
||||
RealEntryPoint = "_ModuleEntryPoint"
|
||||
else:
|
||||
RealEntryPoint = EntryPoint
|
||||
if EntryPoint == "_ModuleEntryPoint":
|
||||
CCFlags = Module.BuildOption.get("CC", {}).get("FLAGS", "")
|
||||
Match = gGlueLibEntryPoint.search(CCFlags)
|
||||
if Match:
|
||||
EntryPoint = Match.group(1)
|
||||
|
||||
RealEntryPoint = "_ModuleEntryPoint"
|
||||
|
||||
self._FfsEntryPoint[Module.Guid.upper()] = (EntryPoint, RealEntryPoint)
|
||||
|
||||
|
@ -122,65 +122,9 @@ def CheckEnvVariable():
|
||||
elif ' ' in Path:
|
||||
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in PACKAGES_PATH", ExtraData=Path)
|
||||
|
||||
#
|
||||
# Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always point to ECP
|
||||
#
|
||||
if "ECP_SOURCE" not in os.environ:
|
||||
os.environ["ECP_SOURCE"] = mws.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)
|
||||
if "EFI_SOURCE" not in os.environ:
|
||||
os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"]
|
||||
if "EDK_SOURCE" not in os.environ:
|
||||
os.environ["EDK_SOURCE"] = os.environ["ECP_SOURCE"]
|
||||
|
||||
#
|
||||
# Unify case of characters on case-insensitive systems
|
||||
#
|
||||
EfiSourceDir = os.path.normcase(os.path.normpath(os.environ["EFI_SOURCE"]))
|
||||
EdkSourceDir = os.path.normcase(os.path.normpath(os.environ["EDK_SOURCE"]))
|
||||
EcpSourceDir = os.path.normcase(os.path.normpath(os.environ["ECP_SOURCE"]))
|
||||
|
||||
os.environ["EFI_SOURCE"] = EfiSourceDir
|
||||
os.environ["EDK_SOURCE"] = EdkSourceDir
|
||||
os.environ["ECP_SOURCE"] = EcpSourceDir
|
||||
os.environ["EDK_TOOLS_PATH"] = os.path.normcase(os.environ["EDK_TOOLS_PATH"])
|
||||
|
||||
if not os.path.exists(EcpSourceDir):
|
||||
EdkLogger.verbose("ECP_SOURCE = %s doesn't exist. Edk modules could not be built." % EcpSourceDir)
|
||||
elif ' ' in EcpSourceDir:
|
||||
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in ECP_SOURCE path",
|
||||
ExtraData=EcpSourceDir)
|
||||
if not os.path.exists(EdkSourceDir):
|
||||
if EdkSourceDir == EcpSourceDir:
|
||||
EdkLogger.verbose("EDK_SOURCE = %s doesn't exist. Edk modules could not be built." % EdkSourceDir)
|
||||
else:
|
||||
EdkLogger.error("build", PARAMETER_INVALID, "EDK_SOURCE does not exist",
|
||||
ExtraData=EdkSourceDir)
|
||||
elif ' ' in EdkSourceDir:
|
||||
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in EDK_SOURCE path",
|
||||
ExtraData=EdkSourceDir)
|
||||
if not os.path.exists(EfiSourceDir):
|
||||
if EfiSourceDir == EcpSourceDir:
|
||||
EdkLogger.verbose("EFI_SOURCE = %s doesn't exist. Edk modules could not be built." % EfiSourceDir)
|
||||
else:
|
||||
EdkLogger.error("build", PARAMETER_INVALID, "EFI_SOURCE does not exist",
|
||||
ExtraData=EfiSourceDir)
|
||||
elif ' ' in EfiSourceDir:
|
||||
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in EFI_SOURCE path",
|
||||
ExtraData=EfiSourceDir)
|
||||
|
||||
# check those variables on single workspace case
|
||||
if not PackagesPath:
|
||||
# change absolute path to relative path to WORKSPACE
|
||||
if EfiSourceDir.upper().find(WorkspaceDir.upper()) != 0:
|
||||
EdkLogger.error("build", PARAMETER_INVALID, "EFI_SOURCE is not under WORKSPACE",
|
||||
ExtraData="WORKSPACE = %s\n EFI_SOURCE = %s" % (WorkspaceDir, EfiSourceDir))
|
||||
if EdkSourceDir.upper().find(WorkspaceDir.upper()) != 0:
|
||||
EdkLogger.error("build", PARAMETER_INVALID, "EDK_SOURCE is not under WORKSPACE",
|
||||
ExtraData="WORKSPACE = %s\n EDK_SOURCE = %s" % (WorkspaceDir, EdkSourceDir))
|
||||
if EcpSourceDir.upper().find(WorkspaceDir.upper()) != 0:
|
||||
EdkLogger.error("build", PARAMETER_INVALID, "ECP_SOURCE is not under WORKSPACE",
|
||||
ExtraData="WORKSPACE = %s\n ECP_SOURCE = %s" % (WorkspaceDir, EcpSourceDir))
|
||||
|
||||
# check EDK_TOOLS_PATH
|
||||
if "EDK_TOOLS_PATH" not in os.environ:
|
||||
EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
|
||||
@ -192,14 +136,8 @@ def CheckEnvVariable():
|
||||
ExtraData="PATH")
|
||||
|
||||
GlobalData.gWorkspace = WorkspaceDir
|
||||
GlobalData.gEfiSource = EfiSourceDir
|
||||
GlobalData.gEdkSource = EdkSourceDir
|
||||
GlobalData.gEcpSource = EcpSourceDir
|
||||
|
||||
GlobalData.gGlobalDefines["WORKSPACE"] = WorkspaceDir
|
||||
GlobalData.gGlobalDefines["EFI_SOURCE"] = EfiSourceDir
|
||||
GlobalData.gGlobalDefines["EDK_SOURCE"] = EdkSourceDir
|
||||
GlobalData.gGlobalDefines["ECP_SOURCE"] = EcpSourceDir
|
||||
GlobalData.gGlobalDefines["EDK_TOOLS_PATH"] = os.environ["EDK_TOOLS_PATH"]
|
||||
|
||||
## Get normalized file path
|
||||
@ -848,9 +786,6 @@ class Build():
|
||||
if "PACKAGES_PATH" in os.environ:
|
||||
# WORKSPACE env has been converted before. Print the same path style with WORKSPACE env.
|
||||
EdkLogger.quiet("%-16s = %s" % ("PACKAGES_PATH", os.path.normcase(os.path.normpath(os.environ["PACKAGES_PATH"]))))
|
||||
EdkLogger.quiet("%-16s = %s" % ("ECP_SOURCE", os.environ["ECP_SOURCE"]))
|
||||
EdkLogger.quiet("%-16s = %s" % ("EDK_SOURCE", os.environ["EDK_SOURCE"]))
|
||||
EdkLogger.quiet("%-16s = %s" % ("EFI_SOURCE", os.environ["EFI_SOURCE"]))
|
||||
EdkLogger.quiet("%-16s = %s" % ("EDK_TOOLS_PATH", os.environ["EDK_TOOLS_PATH"]))
|
||||
if "EDK_TOOLS_BIN" in os.environ:
|
||||
# Print the same path style with WORKSPACE env.
|
||||
|
Reference in New Issue
Block a user