- "::" instead of "REM" inside a if () in batch is evil and can cause a really nice...
authorDaniel Reimer <reimer.daniel@freenet.de>
Sat, 12 Sep 2015 09:51:25 +0000 (09:51 +0000)
committerDaniel Reimer <reimer.daniel@freenet.de>
Sat, 12 Sep 2015 09:51:25 +0000 (09:51 +0000)
- Changing one "exit" to "exit /b" was not nice from me in the past.
ARM build now prepares host tools nicely again and you can build em. ARM build itself dies very early due to ..\..\boot\freeldr\freeldr\arch\arm\boot.S(9) : fatal error C1083: Cannot open include file: 'ksarm.h': No such file or directory

svn path=/trunk/; revision=69191

reactos/configure.cmd

index efcbffc..e3c7873 100755 (executable)
@@ -1,13 +1,13 @@
 @echo off\r
 \r
 @echo off\r
 \r
-:: This is needed so as to avoid static expansion of environment variables\r
-:: inside if (...) conditionals.\r
-:: See http://stackoverflow.com/questions/305605/weird-scope-issue-in-bat-file\r
-:: for more explanation.\r
-:: Precisely needed for configuring Visual Studio Environment.\r
+REM This is needed so as to avoid static expansion of environment variables\r
+REM inside if (...) conditionals.\r
+REM See http://stackoverflow.com/questions/305605/weird-scope-issue-in-bat-file\r
+REM for more explanation.\r
+REM Precisely needed for configuring Visual Studio Environment.\r
 setlocal enabledelayedexpansion\r
 \r
 setlocal enabledelayedexpansion\r
 \r
-:: Does the user need help?\r
+REM Does the user need help?\r
 if /I "%1" == "help" goto help\r
 if /I "%1" == "/?" (\r
 :help\r
 if /I "%1" == "help" goto help\r
 if /I "%1" == "/?" (\r
 :help\r
@@ -19,30 +19,29 @@ if /I "%1" == "/?" (
     exit /b\r
 )\r
 \r
     exit /b\r
 )\r
 \r
-:: Special case %1 = arm_hosttools %2 = vcvarsall.bat %3 = %CMAKE_GENERATOR%\r
+REM Special case %1 = arm_hosttools %2 = vcvarsall.bat %3 = %CMAKE_GENERATOR%\r
 if /I "%1" == "arm_hosttools" (\r
     echo Configuring x86 host tools for ARM cross build\r
 \r
 if /I "%1" == "arm_hosttools" (\r
     echo Configuring x86 host tools for ARM cross build\r
 \r
-    :: This launches %VSINSTALLDIR%VS\vcvarsall.bat\r
+    REM This launches %VSINSTALLDIR%VS\vcvarsall.bat\r
     call %2 x86\r
 \r
     call %2 x86\r
 \r
-    :: Configure host tools for x86\r
+    REM Configure host tools for x86\r
     cmake -G %3 -DARCH:STRING=i386 %~dp0\r
     cmake -G %3 -DARCH:STRING=i386 %~dp0\r
-    endlocal\r
-    exit /b\r
+    exit\r
 )\r
 \r
 )\r
 \r
-:: Get the source root directory\r
+REM Get the source root directory\r
 set REACTOS_SOURCE_DIR=%~dp0\r
 \r
 set REACTOS_SOURCE_DIR=%~dp0\r
 \r
-:: Set default generator\r
+REM Set default generator\r
 set CMAKE_GENERATOR="Ninja"\r
 set CMAKE_GENERATOR_HOST=!CMAKE_GENERATOR!\r
 \r
 set CMAKE_GENERATOR="Ninja"\r
 set CMAKE_GENERATOR_HOST=!CMAKE_GENERATOR!\r
 \r
-:: Detect presence of cmake\r
+REM Detect presence of cmake\r
 cmd /c cmake --version 2>&1 | find "cmake version" > NUL || goto cmake_notfound\r
 \r
 cmd /c cmake --version 2>&1 | find "cmake version" > NUL || goto cmake_notfound\r
 \r
-:: Detect build environment (MinGW, VS, WDK, ...)\r
+REM Detect build environment (MinGW, VS, WDK, ...)\r
 if defined ROS_ARCH (\r
     echo Detected RosBE for %ROS_ARCH%\r
     set BUILD_ENVIRONMENT=MinGW\r
 if defined ROS_ARCH (\r
     echo Detected RosBE for %ROS_ARCH%\r
     set BUILD_ENVIRONMENT=MinGW\r
@@ -50,7 +49,7 @@ if defined ROS_ARCH (
     set MINGW_TOOCHAIN_FILE=toolchain-gcc.cmake\r
 \r
 ) else if defined VCINSTALLDIR (\r
     set MINGW_TOOCHAIN_FILE=toolchain-gcc.cmake\r
 \r
 ) else if defined VCINSTALLDIR (\r
-    :: VS command prompt does not put this in environment vars\r
+    REM VS command prompt does not put this in environment vars\r
     cl 2>&1 | find "x86" > NUL && set ARCH=i386\r
     cl 2>&1 | find "x64" > NUL && set ARCH=amd64\r
     cl 2>&1 | find "ARM" > NUL && set ARCH=arm\r
     cl 2>&1 | find "x86" > NUL && set ARCH=i386\r
     cl 2>&1 | find "x64" > NUL && set ARCH=amd64\r
     cl 2>&1 | find "ARM" > NUL && set ARCH=arm\r
@@ -74,7 +73,7 @@ if defined ROS_ARCH (
     exit /b\r
 )\r
 \r
     exit /b\r
 )\r
 \r
-:: Checkpoint\r
+REM Checkpoint\r
 if not defined ARCH (\r
     echo Unknown build architecture\r
     endlocal\r
 if not defined ARCH (\r
     echo Unknown build architecture\r
     endlocal\r
@@ -83,7 +82,7 @@ if not defined ARCH (
 \r
 set NEW_STYLE_BUILD=0\r
 \r
 \r
 set NEW_STYLE_BUILD=0\r
 \r
-:: Parse command line parameters\r
+REM Parse command line parameters\r
 :repeat\r
     if /I "%1%" == "-DNEW_STYLE_BUILD" (\r
         set NEW_STYLE_BUILD=%2\r
 :repeat\r
     if /I "%1%" == "-DNEW_STYLE_BUILD" (\r
         set NEW_STYLE_BUILD=%2\r
@@ -156,17 +155,17 @@ set NEW_STYLE_BUILD=0
         )\r
     )\r
 \r
         )\r
     )\r
 \r
-    :: Go to next parameter\r
+    REM Go to next parameter\r
     SHIFT\r
     goto repeat\r
 :continue\r
 \r
     SHIFT\r
     goto repeat\r
 :continue\r
 \r
-:: Inform the user about the default build\r
+REM Inform the user about the default build\r
 if "!CMAKE_GENERATOR!" == "Ninja" (\r
     echo This script defaults to Ninja. Type "configure help" for alternative options.\r
 )\r
 \r
 if "!CMAKE_GENERATOR!" == "Ninja" (\r
     echo This script defaults to Ninja. Type "configure help" for alternative options.\r
 )\r
 \r
-:: Create directories\r
+REM Create directories\r
 set REACTOS_OUTPUT_PATH=output-%BUILD_ENVIRONMENT%-%ARCH%\r
 if "%REACTOS_SOURCE_DIR%" == "%CD%\" (\r
     echo Creating directories in %REACTOS_OUTPUT_PATH%\r
 set REACTOS_OUTPUT_PATH=output-%BUILD_ENVIRONMENT%-%ARCH%\r
 if "%REACTOS_SOURCE_DIR%" == "%CD%\" (\r
     echo Creating directories in %REACTOS_OUTPUT_PATH%\r
@@ -195,9 +194,9 @@ if "%NEW_STYLE_BUILD%"=="0" (
 \r
     set REACTOS_BUILD_TOOLS_DIR=!CD!\r
 \r
 \r
     set REACTOS_BUILD_TOOLS_DIR=!CD!\r
 \r
-    :: Use x86 for ARM host tools\r
+    REM Use x86 for ARM host tools\r
     if "%ARCH%" == "arm" (\r
     if "%ARCH%" == "arm" (\r
-        :: Launch new script instance for x86 host tools configuration\r
+        REM Launch new script instance for x86 host tools configuration\r
         start "Preparing host tools for ARM cross build..." /I /B /WAIT %~dp0configure.cmd arm_hosttools "%VSINSTALLDIR%VC\vcvarsall.bat" %CMAKE_GENERATOR_HOST%\r
     ) else (\r
         cmake -G %CMAKE_GENERATOR% -DARCH:STRING=%ARCH% "%REACTOS_SOURCE_DIR%"\r
         start "Preparing host tools for ARM cross build..." /I /B /WAIT %~dp0configure.cmd arm_hosttools "%VSINSTALLDIR%VC\vcvarsall.bat" %CMAKE_GENERATOR_HOST%\r
     ) else (\r
         cmake -G %CMAKE_GENERATOR% -DARCH:STRING=%ARCH% "%REACTOS_SOURCE_DIR%"\r