From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 58E40211A6D56 for ; Sun, 27 Jan 2019 19:48:10 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jan 2019 19:48:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,532,1539673200"; d="scan'208";a="110267778" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga007.jf.intel.com with ESMTP; 27 Jan 2019 19:48:09 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 27 Jan 2019 19:48:09 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 27 Jan 2019 19:48:09 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.36]) with mapi id 14.03.0415.000; Mon, 28 Jan 2019 11:48:07 +0800 From: "Feng, Bob C" To: "Fan, ZhijuX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [edk2][PATCH] BaseTools:Define Macro in Inf file, the pcdvalue Can't convert Thread-Index: AdS0i054rztMziRtRTWSGBMZqaEbIgCMPUVw Date: Mon, 28 Jan 2019 03:48:07 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D1600761AA@SHSMSX101.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools:Define Macro in Inf file, the pcdvalue Can't convert X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 03:48:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Fan, ZhijuX=20 Sent: Friday, January 25, 2019 4:53 PM To: edk2-devel@lists.01.org Cc: Gao, Liming ; Feng, Bob C Subject: [edk2][PATCH] BaseTools:Define Macro in Inf file, the pcdvalue Can= 't convert Define Macro in Inf file, the pcdvalue Can't convert in dec: gUefiOvmfPkgGuid.test1|"ddd"|VOID*|0x3c in inf: DEFINE ABC=3DPATH gUefiOvmfPkgTokenSpaceGuid.test1|$(ABC) Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/Workspace/MetaFileParser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTool= s/Source/Python/Workspace/MetaFileParser.py index 6df0d3cdf8..f31dbc2649 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -757,9 +757,13 @@ class InfParser(MetaFileParser): if self._ValueList[2] !=3D '': InfPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE_= SPLIT, 1) if InfPcdValueList[0] in ['True', 'true', 'TRUE']: - self._ValueList[2] =3D TokenList[1].replace(InfPcdValueLis= t[0], '1', 1); + self._ValueList[2] =3D TokenList[1].replace(InfPcdValueLis= t[0], '1', 1) elif InfPcdValueList[0] in ['False', 'false', 'FALSE']: - self._ValueList[2] =3D TokenList[1].replace(InfPcdValueLis= t[0], '0', 1); + self._ValueList[2] =3D TokenList[1].replace(InfPcdValueLis= t[0], '0', 1) + elif isinstance(InfPcdValueList[0], str) and InfPcdValueList[0= ].find('$(') >=3D 0: + Value =3D ReplaceExprMacro(InfPcdValueList[0],self._Macros= ) + if Value !=3D '0': + self._ValueList[2] =3D Value if (self._ValueList[0], self._ValueList[1]) not in self.PcdsDict: self.PcdsDict[self._ValueList[0], self._ValueList[1]] =3D self= ._SectionType elif self.PcdsDict[self._ValueList[0], self._ValueList[1]] !=3D se= lf._SectionType: --=20 2.14.1.windows.1