From: rebecca@bsdio.com
To: devel@edk2.groups.io, Liming Gao <liming.gao@intel.com>,
Bob Feng <bob.c.feng@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Subject: [PATCH] Update edksetup.bat etc. to support building BaseTools with VS2008 and VS2010
Date: Wed, 21 Aug 2019 18:17:13 -0600 [thread overview]
Message-ID: <20190822001713.65061-1-rebecca@bsdio.com> (raw)
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 <rebecca@bsdio.com>
---
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"=="VS2017" goto VS2017Vars
if /I "%1"=="VS2015" goto VS2015Vars
if /I "%1"=="VS2013" goto VS2013Vars
if /I "%1"=="VS2012" goto VS2012Vars
+if /I "%1"=="VS2010" goto VS2010Vars
+if /I "%1"=="VS2008" goto VS2008Vars
:set_vsvars
for /f "usebackq tokens=1* delims=: " %%i in (`%*`) do (
@@ -68,8 +70,12 @@ if defined VCINSTALLDIR goto :done
:VS2012Vars
if defined VS110COMNTOOLS (call :read_vsvars "%VS110COMNTOOLS%") else (if /I "%1"=="VS2012" goto ToolNotInstall)
- if defined VS100COMNTOOLS call :read_vsvars "%VS100COMNTOOLS%"
- if defined VS90COMNTOOLS call :read_vsvars "%VS90COMNTOOLS%"
+ :VS2010Vars
+ if defined VS100COMNTOOLS (call :read_vsvars "%VS100COMNTOOLS%") else (if /I "%1"=="VS2010" goto ToolNotInstall)
+
+ :VS2008Vars
+ if defined VS90COMNTOOLS (call :read_vsvars "%VS90COMNTOOLS%") else (if /I "%1"=="VS2008" goto ToolNotInstall)
+
if defined VS80COMNTOOLS call :read_vsvars "%VS80COMNTOOLS%"
if defined VS71COMNTOOLS call :read_vsvars "%VS71COMNTOOLS%"
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=c:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\bin\"
)
)
+if /I "%1"=="VS2008" goto SetWinDDK
if defined VS100COMNTOOLS (
if not defined VS2010_PREFIX (
@@ -58,6 +59,7 @@ if defined VS100COMNTOOLS (
set "WINSDK7x86_PREFIX=c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\"
)
)
+if /I "%1"=="VS2010" goto SetWinDDK
:SetVS2012
if defined VS110COMNTOOLS (
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"=="/?" goto Usage
set VSTool=VS2012
goto loop
)
+ if /I "%1"=="VS2010" (
+ shift
+ set VS2010=TRUE
+ set VSTool=VS2010
+ goto loop
+ )
+ if /I "%1"=="VS2008" (
+ shift
+ set VS2008=TRUE
+ set VSTool=VS2008
+ goto loop
+ )
if "%1"=="" goto setup_workspace
if exist %1 (
if not defined BASE_TOOLS_PATH (
@@ -187,6 +199,12 @@ if defined VS2017 (
) else if defined VS2012 (
call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2012
call %EDK_TOOLS_PATH%\get_vsvars.bat VS2012
+) else if defined VS2010 (
+ call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2010
+ call %EDK_TOOLS_PATH%\get_vsvars.bat VS2010
+) else if defined VS2008 (
+ call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2008
+ call %EDK_TOOLS_PATH%\get_vsvars.bat VS2008
) else (
call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat
call %EDK_TOOLS_PATH%\get_vsvars.bat
@@ -444,7 +462,7 @@ goto end
:Usage
@echo.
- echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2017] [VS2015] [VS2013] [VS2012]"
+ echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2017] [VS2015] [VS2013] [VS2012] [VS2010] [VS2008]"
@echo.
@echo base_tools_path BaseTools project path, BASE_TOOLS_PATH will be set to this path.
@echo edk_tools_path EDK_TOOLS_PATH will be set to this path.
@@ -453,6 +471,8 @@ goto end
@echo ForceRebuild If sources are available, rebuild all tools regardless of
@echo whether they have been updated or not.
@echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.
+ @echo VS2008 Set the env for VS2008 build.
+ @echo VS2010 Set the env for VS2010 build.
@echo VS2012 Set the env for VS2012 build.
@echo VS2013 Set the env for VS2013 build.
@echo VS2015 Set the env for VS2015 build.
@@ -467,6 +487,8 @@ set VS2017=
set VS2015=
set VS2013=
set VS2012=
+set VS2010=
+set VS2008=
set VSTool=
popd
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"=="VS2017" shift
if /I "%1"=="VS2015" shift
if /I "%1"=="VS2013" shift
if /I "%1"=="VS2012" shift
+if /I "%1"=="VS2010" shift
+if /I "%1"=="VS2008" shift
if "%1"=="" goto end
:Usage
@echo.
- @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Rebuild] [ForceRebuild] [VS2017] [VS2015] [VS2013] [VS2012]"
+ @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Rebuild] [ForceRebuild] [VS2017] [VS2015] [VS2013] [VS2012] [VS2010] [VS2008]"
@echo.
@echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.
@echo Rebuild Perform incremental rebuild of BaseTools binaries.
@echo ForceRebuild Force a full rebuild of BaseTools binaries.
+ @echo VS2008 Set the env for VS2008 build.
+ @echo VS2010 Set the env for VS2010 build.
@echo VS2012 Set the env for VS2012 build.
@echo VS2013 Set the env for VS2013 build.
@echo VS2015 Set the env for VS2015 build.
--
2.22.1
next reply other threads:[~2019-08-22 0:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 0:17 rebecca [this message]
2019-08-22 2:07 ` [edk2-devel] [PATCH] Update edksetup.bat etc. to support building BaseTools with VS2008 and VS2010 Liming Gao
2023-03-14 16:46 ` Rebecca Cran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190822001713.65061-1-rebecca@bsdio.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox