summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/GenFds
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2015-11-16 05:29:49 +0000
committervanjeff <vanjeff@Edk2>2015-11-16 05:29:49 +0000
commitaf7fca3649779f0e55220a7acda9bd11bc660fc3 (patch)
tree02585c606e356ce06fefa9ff80bc4529fcde256e /BaseTools/Source/Python/GenFds
parent59fd15c5a2174a6a6fc4133964e6d5b520b58663 (diff)
downloadedk2-platforms-af7fca3649779f0e55220a7acda9bd11bc660fc3.tar.xz
Update BaseTools from main trunk r18767.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18784 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/GenFds')
-rw-r--r--BaseTools/Source/Python/GenFds/FfsInfStatement.py7
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py13
-rw-r--r--BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py4
-rw-r--r--BaseTools/Source/Python/GenFds/Region.py3
4 files changed, 18 insertions, 9 deletions
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
index 29dc75f433..ed767d3fa6 100644
--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
@@ -28,6 +28,7 @@ import Section
import RuleSimpleFile
import RuleComplexFile
from CommonDataClass.FdfClass import FfsInfStatementClassObject
+from Common.MultipleWorkspace import MultipleWorkspace as mws
from Common.String import *
from Common.Misc import PathClass
from Common.Misc import GuidStructureByteArrayToGuidString
@@ -365,7 +366,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
#
self.__InfParse__(Dict)
- SrcFile = os.path.join( GenFdsGlobalVariable.WorkSpaceDir , self.InfFileName);
+ SrcFile = mws.join( GenFdsGlobalVariable.WorkSpaceDir , self.InfFileName);
DestFile = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs')
SrcFileDir = "."
@@ -511,7 +512,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
#
def __GetPlatformArchList__(self):
- InfFileKey = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName))
+ InfFileKey = os.path.normpath(mws.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName))
DscArchList = []
PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'IA32', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
if PlatformDataBase != None:
@@ -878,7 +879,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
if not HasGneratedFlag:
UniVfrOffsetFileSection = ""
- ModuleFileName = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName)
+ ModuleFileName = mws.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName)
InfData = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(ModuleFileName), self.CurrentArch]
#
# Search the source list in InfData to find if there are .vfr file exist.
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index c2ad4e0e2a..a0beff0391 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -39,6 +39,7 @@ from Common.Misc import SaveFileOnChange
from Common.Misc import ClearDuplicatedInf
from Common.Misc import GuidStructureStringToGuidString
from Common.BuildVersion import gBUILD_VERSION
+from Common.MultipleWorkspace import MultipleWorkspace as mws
## Version and Copyright
versionNumber = "1.0" + ' ' + gBUILD_VERSION
@@ -94,6 +95,10 @@ def main():
if (Options.debug):
GenFdsGlobalVariable.VerboseLogger( "Using Workspace:" + Workspace)
os.chdir(GenFdsGlobalVariable.WorkSpaceDir)
+
+ # set multiple workspace
+ PackagesPath = os.getenv("PACKAGES_PATH")
+ mws.setWs(GenFdsGlobalVariable.WorkSpaceDir, PackagesPath)
if (Options.filename):
FdfFilename = Options.filename
@@ -102,7 +107,7 @@ def main():
if FdfFilename[0:2] == '..':
FdfFilename = os.path.realpath(FdfFilename)
if not os.path.isabs (FdfFilename):
- FdfFilename = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
+ FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
if not os.path.exists(FdfFilename):
EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=FdfFilename)
@@ -129,13 +134,13 @@ def main():
ActivePlatform = os.path.realpath(ActivePlatform)
if not os.path.isabs (ActivePlatform):
- ActivePlatform = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
+ ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
if not os.path.exists(ActivePlatform) :
EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist!")
if os.path.normcase (ActivePlatform).find(Workspace) == 0:
- ActivePlatform = ActivePlatform[len(Workspace):]
+ ActivePlatform = mws.relpath(ActivePlatform, Workspace)
if len(ActivePlatform) > 0 :
if ActivePlatform[0] == '\\' or ActivePlatform[0] == '/':
ActivePlatform = ActivePlatform[1:]
@@ -159,7 +164,7 @@ def main():
ConfDirectoryPath = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ConfDirectoryPath)
else:
# Get standard WORKSPACE/Conf, use the absolute path to the WORKSPACE/Conf
- ConfDirectoryPath = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, 'Conf')
+ ConfDirectoryPath = mws.join(GenFdsGlobalVariable.WorkSpaceDir, 'Conf')
GenFdsGlobalVariable.ConfDir = ConfDirectoryPath
BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))
if os.path.isfile(BuildConfigurationFile) == True:
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
index 04bbc300ce..5bdc1b8288 100644
--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
+++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
@@ -31,6 +31,7 @@ from AutoGen.BuildEngine import BuildRule
import Common.DataType as DataType
from Common.Misc import PathClass
from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
## Global variables
#
@@ -322,12 +323,13 @@ class GenFdsGlobalVariable:
# @param String String that may contain macro
#
def ReplaceWorkspaceMacro(String):
+ String = mws.handleWsMacro(String)
Str = String.replace('$(WORKSPACE)', GenFdsGlobalVariable.WorkSpaceDir)
if os.path.exists(Str):
if not os.path.isabs(Str):
Str = os.path.abspath(Str)
else:
- Str = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, String)
+ Str = mws.join(GenFdsGlobalVariable.WorkSpaceDir, String)
return os.path.normpath(Str)
## Check if the input files are newer than output files
diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Python/GenFds/Region.py
index 15b2ecba90..feb56cb60f 100644
--- a/BaseTools/Source/Python/GenFds/Region.py
+++ b/BaseTools/Source/Python/GenFds/Region.py
@@ -24,6 +24,7 @@ from stat import *
from Common import EdkLogger
from Common.BuildToolError import *
from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.MultipleWorkspace import MultipleWorkspace as mws
## generate Region
#
@@ -205,7 +206,7 @@ class Region(RegionClassObject):
for RegionData in self.RegionDataList:
RegionData = GenFdsGlobalVariable.MacroExtend(RegionData, MacroDict)
if RegionData[1] != ':' :
- RegionData = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, RegionData)
+ RegionData = mws.join (GenFdsGlobalVariable.WorkSpaceDir, RegionData)
if not os.path.exists(RegionData):
EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=RegionData)
#