public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] Update edksetup.bat etc. to support building BaseTools with VS2008 and VS2010
@ 2019-08-22  0:17 rebecca
  2019-08-22  2:07 ` [edk2-devel] " Liming Gao
  0 siblings, 1 reply; 3+ messages in thread
From: rebecca @ 2019-08-22  0:17 UTC (permalink / raw)
  To: devel, Liming Gao, Bob Feng; +Cc: Rebecca Cran

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-14 16:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-22  0:17 [PATCH] Update edksetup.bat etc. to support building BaseTools with VS2008 and VS2010 rebecca
2019-08-22  2:07 ` [edk2-devel] " Liming Gao
2023-03-14 16:46   ` Rebecca Cran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox