From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 468401A1E2A for ; Thu, 20 Oct 2016 02:09:05 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP; 20 Oct 2016 02:09:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,518,1473145200"; d="scan'208";a="22007327" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 20 Oct 2016 02:09:04 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 20 Oct 2016 02:09:04 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 20 Oct 2016 02:09:04 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.209]) with mapi id 14.03.0248.002; Thu, 20 Oct 2016 17:09:02 +0800 From: "Gao, Liming" To: Cinnamon Shia , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] Edk2Setup.bat: Support building platforms with Python source Thread-Index: AQHSKcUKFHpbR1gWdke1EkPIrOkoTaCxD0bQ Date: Thu, 20 Oct 2016 09:09:01 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B4972B4@shsmsx102.ccr.corp.intel.com> References: <20161019045453.25416-1-cinnamon.shia@hpe.com> In-Reply-To: <20161019045453.25416-1-cinnamon.shia@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] Edk2Setup.bat: Support building platforms with Python source X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 09:09:05 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cinnamon: I have two comments.=20 1) SvnPull: should be :SvnPull 2) Add echo message says " Setup environment to run Python scripts directly= ." When python source is sued.=20 Thanks Liming > -----Original Message----- > From: Cinnamon Shia [mailto:cinnamon.shia@hpe.com] > Sent: Wednesday, October 19, 2016 12:55 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming ; Cinnamon Shia > > Subject: [PATCH] Edk2Setup.bat: Support building platforms with Python > source >=20 > Following the same approach as toolsetup.bat: > If build.exe, TargetTool.exe, Trim.exe or GenFds.exe is missing, run its > Python source instead. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Cinnamon Shia > --- > Edk2Setup.bat | 33 +++++++++++++++++++++++++++------ > 1 file changed, 27 insertions(+), 6 deletions(-) >=20 > diff --git a/Edk2Setup.bat b/Edk2Setup.bat > index 2d13234..953a870 100755 > --- a/Edk2Setup.bat > +++ b/Edk2Setup.bat > @@ -27,6 +27,7 @@ > @REM build.exe Version 0.51 Developer Build based on Revision: 15668 > @REM > @REM Copyright (c) 2014, Intel Corporation. All rights reserved.
> +@REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> @REM This program and the accompanying materials > @REM are licensed and made available under the terms and conditions of > the BSD License > @REM which accompanies this distribution. The full text of the license = may > be found at > @@ -59,6 +60,7 @@ > @set SRC_CONF=3D > @set ARGUMENT=3D > @set SCRIPT=3DEDKSETUP_BAT > +@set PYTHON_BUILD=3D >=20 > @if not defined ORIGINAL_PATH set "ORIGINAL_PATH=3D%PATH%" > @REM Always set the WORKSPACE environment variable to the current > directory > @@ -352,12 +354,7 @@ >=20 > @if defined REBUILD_TOOLS goto SetConf > @if defined SVN_PULL goto SetConf > -@if not exist "%EDK_TOOLS_PATH%\Bin\Win32\build.exe" ( > - @echo ERROR : %EDK_TOOLS_PATH%\Bin\Win32\build.exe does not exist > - @echo Re-run this script using --reset, --pull or --rebuild > - @echo. > - @goto ExitFailure > -) > + > @echo. > @echo Rebuilding of the tools is not required. Binaries of the latest, > @echo tested versions of the tools have been tested and included in the > @@ -416,6 +413,29 @@ > ) > @set "PATH=3D%EDK_TOOLS_BIN%;%PATH%" >=20 > +@if NOT EXIST "%EDK_TOOLS_BIN%\build.exe" @set > PYTHON_BUILD=3DTRUE > +@if NOT EXIST "%EDK_TOOLS_BIN%\GenFds.exe" @set > PYTHON_BUILD=3DTRUE > +@if NOT EXIST "%EDK_TOOLS_BIN%\TargetTool.exe" @set > PYTHON_BUILD=3DTRUE > +@if NOT EXIST "%EDK_TOOLS_BIN%\Trim.exe" @set PYTHON_BUILD=3DTRUE > + > +@if not defined PYTHON_BUILD goto SvnPull > + > +@if not defined PYTHON_HOME ( > + @if defined PYTHONHOME ( > + @set PYTHON_HOME=3D%PYTHONHOME% > + ) else ( > + @echo. > + @echo !!! ERROR !!! PYTHON_HOME is required to build or execute the > tools, please set it. !!! > + @echo. > + @goto end > + ) > +) > + > +@set PATH=3D%PATH%;%BASE_TOOLS_PATH%\BinWrappers\WindowsLike > +@set > BASETOOLS_PYTHON_SOURCE=3D%BASE_TOOLS_PATH%\Source\Python > +@set PYTHONPATH=3D%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH% > + > +SvnPull: > @if "%REBUILD_TOOLS%"=3D=3D"TRUE" @goto Rebuild > @if "%SVN_PULL%"=3D=3D "TRUE" ( > if defined PYTHONHOME ( > @@ -504,5 +524,6 @@ > @set SCRIPT=3D > @set LIST_VS_VERSIONS=3D > @set PYTHON_FREEZER_PATH=3D > +@set PYTHON_BUILD=3D > @echo on > @exit /B 1 > -- > 2.10.0.windows.1