1@echo off 2rem This is a Windows cmd.exe script used to find windows host name. 3rem %1 is the env. var to set to the windows host name. 4 5setlocal 6set NDK_ROOT=%~dp0 7 8rem Check if %NDK_ROOT% contains any spaces 9goto :L 10:FOO 11 if "%2"=="" goto:EOF 12 echo ERROR: NDK path cannot contain any spaces! 13 exit /b 1 14 15:L 16call :FOO %NDK_ROOT% 17if ERRORLEVEL 1 exit /b 1 18 19set TEMP=windows-x86_64 20 21rem Check if NDK_HOST_32BIT is not set to 1/true, Windows is 64-bit, and 64-bit make exists 22if "%NDK_HOST_32BIT%"=="1" set TEMP= 23if "%NDK_HOST_32BIT%"=="true" set TEMP= 24if not exist "%NDK_ROOT%prebuilt\%TEMP%" set TEMP= 25if "%ProgramW6432%"=="" if "%ProgramFiles(x86)%"=="" set TEMP= 26 27rem Otherwise fall back to 32-bit make 28if "%TEMP%"=="" set TEMP=windows 29 30rem Uses "endlocal &&" hack to allow env. vars to survive setlocal/endlocal 31endlocal && set "%1=%TEMP%" 32 33exit /b 0 34