X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFsp2Pkg%2FTools%2FGenCfgOpt.py;h=450c4e3eb9ecb6528fa8f9ae0640a138b18d069d;hp=059cfcb7e4179ba7b91b939f4f11f5539962b07e;hb=9672cd30563b22331bb2491377b77b57b71c52e4;hpb=d75c07bc689d33564fb481c275f6fa4e0c62d9ef diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py index 059cfcb7e4..450c4e3eb9 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -1,13 +1,7 @@ ## @ GenCfgOpt.py # # Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials are licensed and made available under -# the terms and conditions of the BSD License that accompanies this distribution. -# The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -88,6 +82,8 @@ are permitted provided that the following conditions are met: **/ """ +BuildOptionPcd = [] + class CLogicalExpression: def __init__(self): self.index = 0 @@ -561,6 +557,12 @@ EndList self._PcdsDict[Match.group(1)] = Match.group(2) if self.Debug: print "INFO : PCD %s = [ %s ]" % (Match.group(1), Match.group(2)) + i = 0 + while i < len(BuildOptionPcd): + Match = re.match("\s*([\w\.]+)\s*\=\s*(\w+)", BuildOptionPcd[i]) + if Match: + self._PcdsDict[Match.group(1)] = Match.group(2) + i += 1 else: Match = re.match("^\s*#\s+(!BSF|@Bsf|!HDR)\s+(.+)", DscLine) if Match: @@ -1462,7 +1464,7 @@ EndList def Usage(): - print "GenCfgOpt Version 0.52" + print "GenCfgOpt Version 0.53" print "Usage:" print " GenCfgOpt UPDTXT PlatformDscFile BuildFvDir [-D Macros]" print " GenCfgOpt HEADER PlatformDscFile BuildFvDir InputHFile [-D Macros]" @@ -1472,7 +1474,14 @@ def Main(): # # Parse the options and args # + i = 1 + GenCfgOpt = CGenCfgOpt() + while i < len(sys.argv): + if sys.argv[i].strip().lower() == "--pcd": + BuildOptionPcd.append(sys.argv[i+1]) + i += 1 + i += 1 argc = len(sys.argv) if argc < 4: Usage()