]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/toolsetup.bat
UefiCpuPkg/PiSmmCpuDxeSmm: patch "gSmbase" with PatchInstructionX86()
[mirror_edk2.git] / BaseTools / toolsetup.bat
index 21f5b76e4b1c641755ff1ea26b62297f79a85246..562f9932ff4d3d8c09a19d78e5938a3a7a00c1aa 100755 (executable)
@@ -3,7 +3,8 @@
 @REM   however it may be executed directly from the BaseTools project folder\r
 @REM   if the file is not executed within a WORKSPACE\BaseTools folder.\r
 @REM\r
-@REM Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+@REM Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+@REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 @REM\r
 @REM This program and the accompanying materials are licensed and made available\r
 @REM under the terms and conditions of the BSD License which accompanies this \r
@@ -33,6 +34,9 @@ if /I "%1"=="/?" goto Usage
 :loop\r
   if "%1"=="" goto setup_workspace\r
   if /I "%1"=="--nt32" (\r
+    if /I "%2" == "X64" (\r
+      shift\r
+    )\r
     @REM Ignore --nt32 flag\r
     shift\r
     goto loop\r
@@ -114,15 +118,13 @@ if /I "%1"=="/?" goto Usage
 :set_PATH\r
   if defined WORKSPACE_TOOLS_PATH goto check_PATH\r
   if not defined EDK_TOOLS_BIN (\r
-    if exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
-      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
-    ) else (\r
+    set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
+    if not exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
       echo.\r
       echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!\r
       echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32\r
       echo Or configure EDK_TOOLS_BIN env to point Win32 directory.\r
       echo. \r
-      goto end\r
     )\r
   )\r
   set PATH=%EDK_TOOLS_BIN%;%PATH%\r
@@ -132,15 +134,13 @@ if /I "%1"=="/?" goto Usage
 :check_PATH\r
   if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok\r
   if not defined EDK_TOOLS_BIN (\r
-    if exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
-      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
-    ) else (\r
+    set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
+    if not exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
       echo.\r
       echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!\r
       echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32\r
       echo Or configure EDK_TOOLS_BIN env to point Win32 directory.\r
       echo. \r
-      goto end\r
     )\r
   )\r
   set PATH=%EDK_TOOLS_BIN%;%PATH%\r
@@ -160,6 +160,14 @@ if not defined WORKSPACE (
    goto skip_reconfig\r
 )\r
 \r
+IF NOT exist "%EDK_TOOLS_PATH%\set_vsprefix_envs.bat" (\r
+  @echo.\r
+  @echo !!! ERROR !!! The set_vsprefix_envs.bat was not found !!!\r
+  @echo.\r
+  goto end\r
+)\r
+call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat\r
+\r
 if not defined CONF_PATH (\r
   set CONF_PATH=%WORKSPACE%\Conf\r
 )\r
@@ -246,6 +254,7 @@ echo.
 if defined FORCE_REBUILD goto check_build_environment\r
 if defined REBUILD goto check_build_environment\r
 if not exist "%EDK_TOOLS_PATH%" goto check_build_environment\r
+if not exist "%EDK_TOOLS_BIN%"  goto check_build_environment\r
 \r
 IF NOT EXIST "%EDK_TOOLS_BIN%\BootSectImage.exe" goto check_c_tools\r
 IF NOT EXIST "%EDK_TOOLS_BIN%\EfiLdrImage.exe" goto check_c_tools\r
@@ -268,7 +277,7 @@ goto check_python_tools
   echo.\r
   echo !!! ERROR !!! Binary C tools are missing. They are requried to be built from BaseTools Source.\r
   echo.\r
-  goto end\r
+  goto check_build_environment\r
 \r
 :check_python_tools\r
 IF NOT EXIST "%EDK_TOOLS_BIN%\build.exe" goto check_build_environment\r
@@ -295,7 +304,7 @@ goto end
       set PYTHON_HOME=%PYTHONHOME%\r
     ) else (\r
       echo.\r
-      echo  !!! ERROR !!! Binary python tools are missing. PYTHON_HOME environment variable is not set. \r
+      echo !!! ERROR !!! Binary python tools are missing. PYTHON_HOME environment variable is not set. \r
       echo PYTHON_HOME is required to build or execute the python tools.\r
       echo.\r
       goto end\r
@@ -308,7 +317,7 @@ goto end
     echo !!! WARNING !!! PYTHON_FREEZER_PATH environment variable is not set.\r
     echo Setup environment to run Python scripts directly.\r
     echo.\r
-    set "PATH=%PATH%;%BASE_TOOLS_PATH%\BinWrappers\WindowsLike"\r
+    set "PATH=%BASE_TOOLS_PATH%\BinWrappers\WindowsLike;%PATH%"\r
   )\r
 \r
   set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python\r