"Fossies" - the Fresh Open Source Software Archive

Member "ponyc-0.33.0/make.bat" (1 Nov 2019, 2170 Bytes) of package /linux/misc/ponyc-0.33.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) MS DOS Batch source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 @echo off
    2 
    3 rem This is waf.bat from https://github.com/waf-project/waf/blob/master/utils/waf.bat
    4 
    5 rem from issue #964
    6 
    7 Setlocal EnableDelayedExpansion
    8 
    9 rem Check Windows Version
   10 set TOKEN=tokens=3*
   11 ver | findstr /i "5\.0\." > nul
   12 if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
   13 ver | findstr /i "5\.1\." > nul
   14 if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
   15 ver | findstr /i "5\.2\." > nul
   16 if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
   17 ver | findstr /i "6\.0\." > nul
   18 if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=2*
   19 ver | findstr /i "6\.1\." > nul
   20 if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=2*
   21 
   22 rem Start calculating PYTHON and PYTHON_DIR
   23 set PYTHON=
   24 set PYTHON_DIR=
   25 
   26 Setlocal EnableDelayedExpansion
   27 
   28 set PYTHON_DIR_OK=FALSE
   29 set REGPATH=
   30 
   31 for %%i in (3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5) do (
   32 for %%j in (HKCU HKLM) do (
   33 for %%k in (SOFTWARE\Wow6432Node SOFTWARE) do (
   34 for %%l in (Python\PythonCore IronPython) do (
   35 set REG_PYTHON_EXE=python.exe
   36 if "%%l"=="IronPython" (
   37 set REG_PYTHON_EXE=ipy.exe
   38 )
   39 
   40 @echo on
   41 
   42 set REGPATH=%%j\%%k\%%l\%%i\InstallPath
   43 rem @echo Regpath !REGPATH!
   44 REG QUERY "!REGPATH!" /ve 1>nul 2>nul
   45 if !ERRORLEVEL! equ 0 (
   46   for /F "%TOKEN% delims=    " %%A IN ('REG QUERY "!REGPATH!" /ve') do @set REG_PYTHON_DIR=%%B
   47   if exist !REG_PYTHON_DIR!  (
   48     IF NOT "!REG_PYTHON_DIR:~-1!"=="\" SET REG_PYTHON_DIR=!REG_PYTHON_DIR!\
   49     set REG_PYTHON=!REG_PYTHON_DIR!!REG_PYTHON_EXE!
   50     rem set PYTHON_DIR_OK=TRUE
   51     if "!PYTHON_DIR_OK!"=="FALSE" (
   52       set PYTHON_DIR=!REG_PYTHON_DIR!
   53       set PYTHON=!REG_PYTHON!
   54       set PYTHON_DIR_OK=TRUE
   55     )
   56 
   57     rem set PYTHON_DIR_OK=FALSE
   58     rem @echo Find !REG_PYTHON!
   59     rem goto finished
   60   )
   61 )
   62 
   63 echo off
   64 
   65 )
   66 rem for l
   67 )
   68 rem for k
   69 )
   70 rem for j
   71 )
   72 rem for i
   73 
   74 
   75 
   76 :finished
   77 
   78 Endlocal & SET PYTHON_DIR=%PYTHON_DIR% & SET PYTHON=%PYTHON%
   79 
   80 if "%PYTHON_DIR%" == "" (
   81 rem @echo No Python dir
   82 set PYTHON=python
   83 goto running
   84 )
   85 
   86 rem @echo %PYTHON_DIR%
   87 
   88 if "%PYTHON%" == "" (
   89 rem @echo No Python
   90 set PYTHON=python
   91 goto running
   92 )
   93 
   94 :running
   95 
   96 rem @echo Using %PYTHON%
   97 
   98 "%PYTHON%" -x "%~dp0waf" %*
   99 Endlocal
  100 %COMSPEC% /c exit /b %ERRORLEVEL%