Skip to content

Commit

Permalink
GenFds output message clarification for build ARCH.
Browse files Browse the repository at this point in the history
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1299 7335b38e-4728-0410-8992-fb3ffe349368
  • Loading branch information
jlin16 committed Aug 12, 2008
1 parent 3c97718 commit 392b60d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
28 changes: 14 additions & 14 deletions Source/Python/GenFds/FfsInfStatement.py
Expand Up @@ -227,12 +227,7 @@ def __GetRule__ (self) :
# @retval list Arch list
#
def __GetPlatformArchList__(self):
TargetArchList = GenFdsGlobalVariable.ArchList
if len(TargetArchList) == 0:
TargetArchList = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList
else:
TargetArchList = set(GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList) & set(TargetArchList)


InfFileKey = os.path.normpath(self.InfFileName)
DscArchList = []
PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'IA32']
Expand All @@ -250,11 +245,7 @@ def __GetPlatformArchList__(self):
if InfFileKey in (PlatformDataBase.Modules):
DscArchList.append ('IPF')

CurArchList = TargetArchList
if DscArchList != []:
CurArchList = set (TargetArchList) & set (DscArchList)
GenFdsGlobalVariable.VerboseLogger ("Valid target architecture(s) is : " + " ".join(CurArchList))
return list(CurArchList)
return DscArchList

## GetCurrentArch() method
#
Expand All @@ -264,7 +255,16 @@ def __GetPlatformArchList__(self):
# @retval list Arch list
#
def GetCurrentArch(self) :
CurArchList = self.__GetPlatformArchList__()

TargetArchList = GenFdsGlobalVariable.ArchList

PlatformArchList = self.__GetPlatformArchList__()

CurArchList = TargetArchList
if PlatformArchList != []:
CurArchList = list(set (TargetArchList) & set (PlatformArchList))
GenFdsGlobalVariable.VerboseLogger ("Valid target architecture(s) is : " + " ".join(CurArchList))

ArchList = []
if self.KeyStringList != []:
for Key in self.KeyStringList:
Expand All @@ -281,9 +281,9 @@ def GetCurrentArch(self) :
Arch = ArchList[0]
return Arch
elif len(ArchList) > 1:
EdkLogger.error("GenFds", GENFDS_ERROR, "Not able to determine ARCH for Module %s !" % self.InfFileName)
EdkLogger.error("GenFds", GENFDS_ERROR, "Module built under multiple ARCHs %s. Not able to determine which output to put into flash for Module %s !" % (str(ArchList), self.InfFileName))
else:
EdkLogger.error("GenFds", GENFDS_ERROR, "Don't find legal ARCH in Module %s !" % self.InfFileName)
EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s appears under ARCH %s in platform %s, but current target ARCH is %s, so NO build output could be put into flash." % (self.InfFileName, str(PlatformArchList), GenFdsGlobalVariable.ActivePlatform, str(TargetArchList)))

## __GetEFIOutPutPath__() method
#
Expand Down
15 changes: 10 additions & 5 deletions Source/Python/GenFds/GenFds.py
Expand Up @@ -132,11 +132,6 @@ def main():

GenFdsGlobalVariable.ActivePlatform = NormPath(ActivePlatform)

if (Options.archList) :
ArchList = Options.archList.split(',')
else:
EdkLogger.error("GenFds", BuildToolError.OPTION_MISSING, "Missing build ARCH")

BuildConfigurationFile = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, "Conf/target.txt"))
if os.path.isfile(BuildConfigurationFile) == True:
TargetTxtClassObject.TargetTxtClassObject(BuildConfigurationFile)
Expand All @@ -158,6 +153,16 @@ def main():
BuildWorkSpace = WorkspaceDatabase(':memory:', GlobalData.gGlobalDefines)
BuildWorkSpace.InitDatabase()

if (Options.archList) :
ArchList = Options.archList.split(',')
else:
# EdkLogger.error("GenFds", BuildToolError.OPTION_MISSING, "Missing build ARCH")
ArchList = BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList

TargetArchList = set(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList) & set(ArchList)
if len(TargetArchList) == 0:
EdkLogger.error("GenFds", GENFDS_ERROR, "Target ARCH %s not in platform supported ARCH %s" % (str(ArchList), str(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList)))

for Arch in ArchList:
GenFdsGlobalVariable.OutputDirFromDscDict[Arch] = NormPath(BuildWorkSpace.BuildObject[ActivePlatform, Arch].OutputDirectory)

Expand Down

0 comments on commit 392b60d

Please sign in to comment.