From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: bsdio.com, ip: 65.103.231.193, mailfrom: rebecca@bsdio.com) Received: from muon.bsdio.com (muon.bsdio.com [65.103.231.193]) by groups.io with SMTP; Wed, 21 Aug 2019 17:17:26 -0700 Received: from muon.bsdio.com (localhost [127.0.0.1]) by muon.bsdio.com (Postfix) with ESMTP id 327A8EDFC4; Wed, 21 Aug 2019 18:17:28 -0600 (MDT) Received: from muon.bsdio.com ([127.0.0.1]) by muon.bsdio.com (muon.bsdio.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yYpZImwe9pE7; Wed, 21 Aug 2019 18:17:27 -0600 (MDT) Received: from photon.int.bluestop.org (unknown [10.0.10.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by muon.bsdio.com (Postfix) with ESMTPSA; Wed, 21 Aug 2019 18:17:27 -0600 (MDT) From: rebecca@bsdio.com To: devel@edk2.groups.io, Liming Gao , Bob Feng Cc: Rebecca Cran Subject: [PATCH] Update edksetup.bat etc. to support building BaseTools with VS2008 and VS2010 Date: Wed, 21 Aug 2019 18:17:13 -0600 Message-Id: <20190822001713.65061-1-rebecca@bsdio.com> X-Mailer: git-send-email 2.22.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The parameter to select which version of Visual Studio to use when building BaseTools only goes back to VS2012. Add support for VS2008 and VS2010 and fix the code to avoid selecting a newer version if the user has requested a specific version. Signed-off-by: Rebecca Cran --- BaseTools/get_vsvars.bat | 10 ++++++++-- BaseTools/set_vsprefix_envs.bat | 2 ++ BaseTools/toolsetup.bat | 24 +++++++++++++++++++++++- edksetup.bat | 6 +++++- 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/BaseTools/get_vsvars.bat b/BaseTools/get_vsvars.bat index 9f3759b2a9..de8ba79c8b 100644 --- a/BaseTools/get_vsvars.bat +++ b/BaseTools/get_vsvars.bat @@ -14,6 +14,8 @@ if /I "%1"=3D=3D"VS2017" goto VS2017Vars if /I "%1"=3D=3D"VS2015" goto VS2015Vars=0D if /I "%1"=3D=3D"VS2013" goto VS2013Vars=0D if /I "%1"=3D=3D"VS2012" goto VS2012Vars=0D +if /I "%1"=3D=3D"VS2010" goto VS2010Vars=0D +if /I "%1"=3D=3D"VS2008" goto VS2008Vars=0D =0D :set_vsvars=0D for /f "usebackq tokens=3D1* delims=3D: " %%i in (`%*`) do (=0D @@ -68,8 +70,12 @@ if defined VCINSTALLDIR goto :done :VS2012Vars=0D if defined VS110COMNTOOLS (call :read_vsvars "%VS110COMNTOOLS%") else (= if /I "%1"=3D=3D"VS2012" goto ToolNotInstall)=0D =0D - if defined VS100COMNTOOLS call :read_vsvars "%VS100COMNTOOLS%"=0D - if defined VS90COMNTOOLS call :read_vsvars "%VS90COMNTOOLS%"=0D + :VS2010Vars=0D + if defined VS100COMNTOOLS (call :read_vsvars "%VS100COMNTOOLS%") else (= if /I "%1"=3D=3D"VS2010" goto ToolNotInstall)=0D +=0D + :VS2008Vars=0D + if defined VS90COMNTOOLS (call :read_vsvars "%VS90COMNTOOLS%") else (i= f /I "%1"=3D=3D"VS2008" goto ToolNotInstall)=0D +=0D if defined VS80COMNTOOLS call :read_vsvars "%VS80COMNTOOLS%"=0D if defined VS71COMNTOOLS call :read_vsvars "%VS71COMNTOOLS%"=0D =0D diff --git a/BaseTools/set_vsprefix_envs.bat b/BaseTools/set_vsprefix_envs.= bat index 81686f5b63..9165883d95 100644 --- a/BaseTools/set_vsprefix_envs.bat +++ b/BaseTools/set_vsprefix_envs.bat @@ -46,6 +46,7 @@ if defined VS90COMNTOOLS ( set "WINSDKx86_PREFIX=3Dc:\Program Files (x86)\Microsoft SDKs\Windows\= v6.0A\bin\"=0D )=0D )=0D +if /I "%1"=3D=3D"VS2008" goto SetWinDDK=0D =0D if defined VS100COMNTOOLS (=0D if not defined VS2010_PREFIX (=0D @@ -58,6 +59,7 @@ if defined VS100COMNTOOLS ( set "WINSDK7x86_PREFIX=3Dc:\Program Files (x86)\Microsoft SDKs\Windows= \v7.0A\Bin\"=0D )=0D )=0D +if /I "%1"=3D=3D"VS2010" goto SetWinDDK=0D =0D :SetVS2012=0D if defined VS110COMNTOOLS (=0D diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 395694fa09..26060c947d 100755 --- a/BaseTools/toolsetup.bat +++ b/BaseTools/toolsetup.bat @@ -66,6 +66,18 @@ if /I "%1"=3D=3D"/?" goto Usage set VSTool=3DVS2012=0D goto loop=0D )=0D + if /I "%1"=3D=3D"VS2010" (=0D + shift=0D + set VS2010=3DTRUE=0D + set VSTool=3DVS2010=0D + goto loop=0D + )=0D + if /I "%1"=3D=3D"VS2008" (=0D + shift=0D + set VS2008=3DTRUE=0D + set VSTool=3DVS2008=0D + goto loop=0D + )=0D if "%1"=3D=3D"" goto setup_workspace=0D if exist %1 (=0D if not defined BASE_TOOLS_PATH (=0D @@ -187,6 +199,12 @@ if defined VS2017 ( ) else if defined VS2012 (=0D call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2012=0D call %EDK_TOOLS_PATH%\get_vsvars.bat VS2012=0D +) else if defined VS2010 (=0D + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2010=0D + call %EDK_TOOLS_PATH%\get_vsvars.bat VS2010=0D +) else if defined VS2008 (=0D + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2008=0D + call %EDK_TOOLS_PATH%\get_vsvars.bat VS2008=0D ) else (=0D call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat=0D call %EDK_TOOLS_PATH%\get_vsvars.bat=0D @@ -444,7 +462,7 @@ goto end =0D :Usage=0D @echo.=0D - echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | For= ceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2017] [VS2015]= [VS2013] [VS2012]"=0D + echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | For= ceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2017] [VS2015]= [VS2013] [VS2012] [VS2010] [VS2008]"=0D @echo.=0D @echo base_tools_path BaseTools project path, BASE_TOOLS_PATH = will be set to this path.=0D @echo edk_tools_path EDK_TOOLS_PATH will be set to this path.= =0D @@ -453,6 +471,8 @@ goto end @echo ForceRebuild If sources are available, rebuild all to= ols regardless of=0D @echo whether they have been updated or not.=0D @echo Reconfig Reinstall target.txt, tools_def.txt and = build_rule.txt.=0D + @echo VS2008 Set the env for VS2008 build.=0D + @echo VS2010 Set the env for VS2010 build.=0D @echo VS2012 Set the env for VS2012 build.=0D @echo VS2013 Set the env for VS2013 build.=0D @echo VS2015 Set the env for VS2015 build.=0D @@ -467,6 +487,8 @@ set VS2017=3D set VS2015=3D=0D set VS2013=3D=0D set VS2012=3D=0D +set VS2010=3D=0D +set VS2008=3D=0D set VSTool=3D=0D popd=0D =0D diff --git a/edksetup.bat b/edksetup.bat index 5f6028deff..fba19485bf 100755 --- a/edksetup.bat +++ b/edksetup.bat @@ -137,15 +137,19 @@ if /I "%1"=3D=3D"VS2017" shift if /I "%1"=3D=3D"VS2015" shift=0D if /I "%1"=3D=3D"VS2013" shift=0D if /I "%1"=3D=3D"VS2012" shift=0D +if /I "%1"=3D=3D"VS2010" shift=0D +if /I "%1"=3D=3D"VS2008" shift=0D if "%1"=3D=3D"" goto end=0D =0D :Usage=0D @echo.=0D - @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Re= build] [ForceRebuild] [VS2017] [VS2015] [VS2013] [VS2012]"=0D + @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Re= build] [ForceRebuild] [VS2017] [VS2015] [VS2013] [VS2012] [VS2010] [VS2008]= "=0D @echo.=0D @echo Reconfig Reinstall target.txt, tools_def.txt and bui= ld_rule.txt.=0D @echo Rebuild Perform incremental rebuild of BaseTools bi= naries.=0D @echo ForceRebuild Force a full rebuild of BaseTools binaries.= =0D + @echo VS2008 Set the env for VS2008 build.=0D + @echo VS2010 Set the env for VS2010 build.=0D @echo VS2012 Set the env for VS2012 build.=0D @echo VS2013 Set the env for VS2013 build.=0D @echo VS2015 Set the env for VS2015 build.=0D --=20 2.22.1