summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/GenMake.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-06-03 10:01:53 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-06-04 21:22:00 +0800
commit9ccb26bc99465e16c00fa5cf5e5f43b12dc73f46 (patch)
tree765729234604ad1e9d7e045b287e980b6b65db10 /BaseTools/Source/Python/AutoGen/GenMake.py
parent570ae1ebc857d27e73210e034fef0082df17dc29 (diff)
downloadedk2-9ccb26bc99465e16c00fa5cf5e5f43b12dc73f46.tar.gz
edk2-9ccb26bc99465e16c00fa5cf5e5f43b12dc73f46.tar.bz2
edk2-9ccb26bc99465e16c00fa5cf5e5f43b12dc73f46.zip
BaseTools: fix the bug to build a compressed ROM image via .INF file
Fix the bug that always use the '-e' as OPTROM_FLAGS even the .INF file has statement 'PCI_COMPRESS = TRUE'. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/GenMake.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenMake.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 4b2902f473..be07e46684 100644
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -488,6 +488,11 @@ cleanlib:
if 'IMAGE_ENTRY_POINT' not in self._AutoGenObject.Macros.keys():
self._AutoGenObject.Macros['IMAGE_ENTRY_POINT'] = ImageEntryPoint
+ PCI_COMPRESS_Flag = False
+ for k, v in self._AutoGenObject.Module.Defines.iteritems():
+ if 'PCI_COMPRESS' == k and 'TRUE' == v:
+ PCI_COMPRESS_Flag = True
+
# tools definitions
ToolsDef = []
IncPrefix = self._INC_FLAG_[self._AutoGenObject.ToolChainFamily]
@@ -505,6 +510,14 @@ cleanlib:
# Remove duplicated include path, if any
if Attr == "FLAGS":
Value = RemoveDupOption(Value, IncPrefix, self._AutoGenObject.IncludePathList)
+ if Tool == "OPTROM" and PCI_COMPRESS_Flag:
+ ValueList = Value.split()
+ if ValueList:
+ for i, v in enumerate(ValueList):
+ if '-e' == v:
+ ValueList[i] = '-ec'
+ Value = ' '.join(ValueList)
+
ToolsDef.append("%s_%s = %s" % (Tool, Attr, Value))
ToolsDef.append("")