summaryrefslogtreecommitdiffstats
path: root/BaseTools/toolsetup.bat
diff options
context:
space:
mode:
authorYunhua Feng <yunhuax.feng@intel.com>2018-09-05 17:27:05 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-10-13 09:57:14 +0800
commit04c47cd40111f85614ec51f6ba8d4e9a2f0fafde (patch)
treeb2a02b864df611726df279872f9ca4db51827f3c /BaseTools/toolsetup.bat
parent8be15c61e88709c55970c5d5272d19bd9bba67fb (diff)
downloadedk2-04c47cd40111f85614ec51f6ba8d4e9a2f0fafde.tar.gz
edk2-04c47cd40111f85614ec51f6ba8d4e9a2f0fafde.tar.bz2
edk2-04c47cd40111f85614ec51f6ba8d4e9a2f0fafde.zip
BaseTools: Update windows and linux run scripts file to use Python3
Modify windows script, PosixLike script, edksetup.sh, edksetup.bat to use Python3 Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/toolsetup.bat')
-rwxr-xr-xBaseTools/toolsetup.bat32
1 files changed, 23 insertions, 9 deletions
diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
index 33d50f58ad..0d4028db78 100755
--- a/BaseTools/toolsetup.bat
+++ b/BaseTools/toolsetup.bat
@@ -299,18 +299,32 @@ goto end
)
)
- if not defined PYTHON_HOME (
- if defined PYTHONHOME (
- set PYTHON_HOME=%PYTHONHOME%
- ) else (
- echo.
- echo !!! ERROR !!! Binary python tools are missing. PYTHON_HOME environment variable is not set.
- echo PYTHON_HOME is required to build or execute the python tools.
- echo.
- goto end
+set PYTHON3=py -3
+:check_python_version
+ %PYTHON3% --version >NUL 2>&1
+ if %ERRORLEVEL% NEQ 0 (
+ if defined PYTHON_HOME (
+ if EXIST "%PYTHON_HOME%" (
+ set PYTHON3=%PYTHON_HOME%\python.exe
+ )
)
)
+ %PYTHON3% --version >NUL 2>&1
+ if %ERRORLEVEL% NEQ 0 (
+ echo.
+ echo !!! ERROR !!! %PYTHON3% not install.
+ echo.
+ goto end
+ )
+ FOR /F "TOKENS=1,2" %%i IN ('%PYTHON3% --version') DO set VERSION=%%j
+ if /I "%VERSION%" LSS "3.6" (
+ echo.
+ echo !!! ERROR !!! python version should greater than or equal to version 3.6.
+ echo.
+ goto end
+ )
+:check_freezer_path
@REM We have Python, now test for FreezePython application
if not defined PYTHON_FREEZER_PATH (
echo.