Index: trunk/kBuild/envwin.cmd
===================================================================
--- trunk/kBuild/envwin.cmd	(revision 1253)
+++ trunk/kBuild/envwin.cmd	(revision 1254)
@@ -29,17 +29,17 @@
 REM # Deal with the arguments.
 REM #
-if ".%1" = ".-h"        goto help
-if ".%1" = "./h"        goto help
-if ".%1" = "./H"        goto help
-if ".%1" = ".-h"        goto help
-if ".%1" = ".-help"     goto help
-if ".%1" = ".--help"    goto help
-
-if ".%1" = ".-win"      goto want_win
-if ".%1" = ".-win32"    goto want_win32_bit
-if ".%1" = ".-win64"    goto want_win64_bit
-if ".%1" = ".-nt"       goto want_nt
-if ".%1" = ".-nt32"     goto want_nt32_bit
-if ".%1" = ".-nt64"     goto want_nt64_bit
+if ".%1" == ".-h"       goto help
+if ".%1" == "./h"       goto help
+if ".%1" == "./H"       goto help
+if ".%1" == ".-h"       goto help
+if ".%1" == ".-help"    goto help
+if ".%1" == ".--help"   goto help
+
+if ".%1" == ".-win"     goto want_win
+if ".%1" == ".-win32"   goto want_win32_bit
+if ".%1" == ".-win64"   goto want_win64_bit
+if ".%1" == ".-nt"      goto want_nt
+if ".%1" == ".-nt32"    goto want_nt32_bit
+if ".%1" == ".-nt64"    goto want_nt64_bit
 goto done_arguments
 
@@ -98,9 +98,9 @@
 REM # Check for illegal target/platforms.
 REM #
-if "%BUILD_TARGET" = "win32" goto illegal_target
-if "%BUILD_TARGET" = "win64" goto illegal_target
-
-if "%BUILD_PLATFORM" = "win32" goto illegal_platform
-if "%BUILD_PLATFORM" = "win64" goto illegal_platform
+if "%BUILD_TARGET" == "win32" goto illegal_target
+if "%BUILD_TARGET" == "win64" goto illegal_target
+
+if "%BUILD_PLATFORM" == "win32" goto illegal_platform
+if "%BUILD_PLATFORM" == "win64" goto illegal_platform
 goto target_and_platform_ok
 
@@ -121,22 +121,22 @@
 REM # figure the current directory.
 REM #
-for /f "tokens=*" %d in ('cd') do set CURDIR=%d
+for /f "tokens=*" %%d in ('cd') do set CURDIR=%%d
 
 REM #
 REM # find kBuild.
 REM #
-if exist %PATH_KBUILD%\footer.kmk goto found_kbuild
+if exist %PATH_KBUILD%\footer.kmk       goto found_kbuild
 set PATH_KBUILD=%CURDIR
-if exist %PATH_KBUILD%\footer.kmk goto found_kbuild
+if exist %PATH_KBUILD%\footer.kmk       goto found_kbuild
 set PATH_KBUILD=%CURDIR\kBuild
-if exist %PATH_KBUILD%\footer.kmk goto found_kbuild
+if exist %PATH_KBUILD%\footer.kmk       goto found_kbuild
 set PATH_KBUILD=%CURDIR\..\kBuild
-if exist %PATH_KBUILD%\footer.kmk goto found_kbuild
+if exist %PATH_KBUILD%\footer.kmk       goto found_kbuild
 set PATH_KBUILD=%CURDIR\..\..\kBuild
-if exist %PATH_KBUILD%\footer.kmk goto found_kbuild
+if exist %PATH_KBUILD%\footer.kmk       goto found_kbuild
 set PATH_KBUILD=%CURDIR\..\..\..\kBuild
-if exist %PATH_KBUILD%\footer.kmk goto found_kbuild
+if exist %PATH_KBUILD%\footer.kmk       goto found_kbuild
 set PATH_KBUILD=%CURDIR\..\..\..\..\kBuild
-if exist %PATH_KBUILD%\footer.kmk goto found_kbuild
+if exist %PATH_KBUILD%\footer.kmk       goto found_kbuild
 echo kBuild: Can't find the kBuild directory!
 set CURDIR=
@@ -150,5 +150,5 @@
 REM # Type.
 REM #
-IF NOT ".%BUILD_TYPE%" = "." goto have_BUILD_TYPE
+IF NOT ".%BUILD_TYPE%" == "."           goto have_BUILD_TYPE
 set BUILD_TYPE=release
 :have_BUILD_TYPE
@@ -159,17 +159,17 @@
 REM # Host platform.
 REM #
-IF NOT ".%BUILD_PLATFORM%" = "." goto have_2_BUILD_PLATFORM
+IF NOT ".%BUILD_PLATFORM%" == "."       goto have_2_BUILD_PLATFORM
 set BUILD_PLATFORM=win
 echo dbg: BUILD_PLATFORM=%BUILD_PLATFORM%
 
-IF NOT ".%BUILD_PLATFORM_ARCH%" = "."   goto have_BUILD_PLATFORM_ARCH
+IF NOT ".%BUILD_PLATFORM_ARCH%" == "."  goto have_BUILD_PLATFORM_ARCH
 set TEST_PROCESSOR_ARCH=%PROCESSOR_ARCHITECTURE%
-IF NOT ".%PROCESSOR_ARCHITEW6432%" = "." set TEST_PROCESSOR_ARCH=%PROCESSOR_ARCHITEW6432%
-IF "%TEST_PROCESSOR_ARCH%" = "x86"      set BUILD_PLATFORM_ARCH=x86
-IF "%TEST_PROCESSOR_ARCH%" = "X86"      set BUILD_PLATFORM_ARCH=x86
-IF "%TEST_PROCESSOR_ARCH%" = "AMD64"    set BUILD_PLATFORM_ARCH=amd64
-IF "%TEST_PROCESSOR_ARCH%" = "x64"      set BUILD_PLATFORM_ARCH=amd64
-IF "%TEST_PROCESSOR_ARCH%" = "X64"      set BUILD_PLATFORM_ARCH=amd64
-IF NOT ".%BUILD_PLATFORM_ARCH%" = "."   goto have_BUILD_PLATFORM_ARCH
+IF NOT ".%PROCESSOR_ARCHITEW6432%" == "." set TEST_PROCESSOR_ARCH=%PROCESSOR_ARCHITEW6432%
+IF "%TEST_PROCESSOR_ARCH%" == "x86"     set BUILD_PLATFORM_ARCH=x86
+IF "%TEST_PROCESSOR_ARCH%" == "X86"     set BUILD_PLATFORM_ARCH=x86
+IF "%TEST_PROCESSOR_ARCH%" == "AMD64"   set BUILD_PLATFORM_ARCH=amd64
+IF "%TEST_PROCESSOR_ARCH%" == "x64"     set BUILD_PLATFORM_ARCH=amd64
+IF "%TEST_PROCESSOR_ARCH%" == "X64"     set BUILD_PLATFORM_ARCH=amd64
+IF NOT ".%BUILD_PLATFORM_ARCH%" == "."  goto have_BUILD_PLATFORM_ARCH
 set TEST_PROCESSOR_ARCH=
 echo kBuild: Cannot figure BUILD_PLATFORM_ARCH!
@@ -179,8 +179,8 @@
 set TEST_PROCESSOR_ARCH=
 
-IF NOT ".%BUILD_PLATFORM_CPU%" = "."    goto have_BUILD_PLATFORM_CPU
-IF "%BUILD_PLATFORM_ARCH%" = "amd64"    set BUILD_PLATFORM_CPU=k8
-IF "%BUILD_PLATFORM_ARCH%" = "x86"      set BUILD_PLATFORM_CPU=i386
-IF NOT ".%BUILD_PLATFORM_CPU%" = "."    goto have_BUILD_PLATFORM_CPU
+IF NOT ".%BUILD_PLATFORM_CPU%" == "."   goto have_BUILD_PLATFORM_CPU
+IF "%BUILD_PLATFORM_ARCH%" == "amd64"   set BUILD_PLATFORM_CPU=k8
+IF "%BUILD_PLATFORM_ARCH%" == "x86"     set BUILD_PLATFORM_CPU=i386
+IF NOT ".%BUILD_PLATFORM_CPU%" == "."   goto have_BUILD_PLATFORM_CPU
 echo kBuild: Cannot figure BUILD_PLATFORM_CPU!
 goto failed
@@ -192,13 +192,13 @@
 :have_2_BUILD_PLATFORM
 echo dbg: BUILD_PLATFORM=%BUILD_PLATFORM%
-IF NOT ".%BUILD_PLATFORM_ARCH%" = "."   goto have_2_BUILD_PLATFORM_ARCH
+IF NOT ".%BUILD_PLATFORM_ARCH%" == "."  goto have_2_BUILD_PLATFORM_ARCH
 set TEST_PROCESSOR_ARCH=%PROCESSOR_ARCHITECTURE%
-IF NOT ".%PROCESSOR_ARCHITEW6432%" = "." set TEST_PROCESSOR_ARCH=%PROCESSOR_ARCHITEW6432%
-IF "%TEST_PROCESSOR_ARCH%" = "x86"      set BUILD_PLATFORM_ARCH=x86
-IF "%TEST_PROCESSOR_ARCH%" = "X86"      set BUILD_PLATFORM_ARCH=x86
-IF "%TEST_PROCESSOR_ARCH%" = "AMD64"    set BUILD_PLATFORM_ARCH=amd64
-IF "%TEST_PROCESSOR_ARCH%" = "x64"      set BUILD_PLATFORM_ARCH=amd64
-IF "%TEST_PROCESSOR_ARCH%" = "X64"      set BUILD_PLATFORM_ARCH=amd64
-IF NOT ".%BUILD_PLATFORM_ARCH%" = "."   goto have_2_BUILD_PLATFORM_ARCH
+IF NOT ".%PROCESSOR_ARCHITEW6432%" == "." set TEST_PROCESSOR_ARCH=%PROCESSOR_ARCHITEW6432%
+IF "%TEST_PROCESSOR_ARCH%" == "x86"     set BUILD_PLATFORM_ARCH=x86
+IF "%TEST_PROCESSOR_ARCH%" == "X86"     set BUILD_PLATFORM_ARCH=x86
+IF "%TEST_PROCESSOR_ARCH%" == "AMD64"   set BUILD_PLATFORM_ARCH=amd64
+IF "%TEST_PROCESSOR_ARCH%" == "x64"     set BUILD_PLATFORM_ARCH=amd64
+IF "%TEST_PROCESSOR_ARCH%" == "X64"     set BUILD_PLATFORM_ARCH=amd64
+IF NOT ".%BUILD_PLATFORM_ARCH%" == "."  goto have_2_BUILD_PLATFORM_ARCH
 set TEST_PROCESSOR_ARCH=
 echo kBuild: Cannot figure BUILD_PLATFORM_ARCH!
@@ -207,8 +207,8 @@
 echo dbg: BUILD_PLATFORM_ARCH=%BUILD_PLATFORM_ARCH%
 
-IF NOT ".%BUILD_PLATFORM_CPU%" = "."    goto have_2_BUILD_PLATFORM_CPU
-IF "%BUILD_PLATFORM_ARCH%" = "amd64"    set BUILD_PLATFORM_CPU=k8
-IF "%BUILD_PLATFORM_ARCH%" = "x86"      set BUILD_PLATFORM_CPU=i386
-IF NOT ".%BUILD_PLATFORM_CPU%" = "."    goto have_2_BUILD_PLATFORM_CPU
+IF NOT ".%BUILD_PLATFORM_CPU%" == "."   goto have_2_BUILD_PLATFORM_CPU
+IF "%BUILD_PLATFORM_ARCH%" == "amd64"   set BUILD_PLATFORM_CPU=k8
+IF "%BUILD_PLATFORM_ARCH%" == "x86"     set BUILD_PLATFORM_CPU=i386
+IF NOT ".%BUILD_PLATFORM_CPU%" == "."   goto have_2_BUILD_PLATFORM_CPU
 echo kBuild: Cannot figure BUILD_PLATFORM_CPU!
 goto failed
@@ -221,10 +221,10 @@
 REM #
 :process_BUILD_TARGET
-IF NOT ".%BUILD_TARGET%" = "." goto have_BUILD_TARGET
+IF NOT ".%BUILD_TARGET%" == "."         goto have_BUILD_TARGET
 set BUILD_TARGET=%BUILD_PLATFORM%
-IF NOT ".%BUILD_TARGET_ARCH%" = "." goto have_BUILD_TARGET_ARCH
+IF NOT ".%BUILD_TARGET_ARCH%" == "."    goto have_BUILD_TARGET_ARCH
 set BUILD_TARGET_ARCH=%BUILD_PLATFORM_ARCH%
 :have_BUILD_TARGET_ARCH
-IF NOT ".%BUILD_TARGET_CPU%" = "." goto have_BUILD_TARGET_CPU
+IF NOT ".%BUILD_TARGET_CPU%" == "."     goto have_BUILD_TARGET_CPU
 set BUILD_TARGET_CPU=%BUILD_PLATFORM_CPU%
 :have_BUILD_TARGET_CPU
@@ -236,13 +236,13 @@
 :have_BUILD_TARGET
 echo dbg: BUILD_TARGET=%BUILD_TARGET%
-IF NOT ".%BUILD_TARGET_ARCH%" = "." goto have_2_BUILD_TARGET_ARCH
-IF "%BUILD_TARGET%" = "os2"             set BUILD_TARGET_ARCH=x86
-IF ".%BUILD_TARGET_ARCH%" = "."         set BUILD_TARGET_ARCH=%BUILD_PLATFORM_ARCH%
+IF NOT ".%BUILD_TARGET_ARCH%" == "."    goto have_2_BUILD_TARGET_ARCH
+IF "%BUILD_TARGET%" == "os2"            set BUILD_TARGET_ARCH=x86
+IF ".%BUILD_TARGET_ARCH%" == "."        set BUILD_TARGET_ARCH=%BUILD_PLATFORM_ARCH%
 :have_2_BUILD_TARGET_ARCH
 echo dbg: BUILD_TARGET_ARCH=%BUILD_TARGET_ARCH%
-IF NOT ".%BUILD_TARGET_CPU%" = "." goto have_2_BUILD_TARGET_CPU
-IF "%BUILD_TARGET_ARCH%" = "amd64"      set BUILD_TARGET_CPU=k8
-IF "%BUILD_TARGET_ARCH%" = "x86"        set BUILD_TARGET_CPU=i386
-IF NOT ".%BUILD_TARGET_CPU%" = "." goto have_2_BUILD_TARGET_CPU
+IF NOT ".%BUILD_TARGET_CPU%" == "."     goto have_2_BUILD_TARGET_CPU
+IF "%BUILD_TARGET_ARCH%" == "amd64"     set BUILD_TARGET_CPU=k8
+IF "%BUILD_TARGET_ARCH%" == "x86"       set BUILD_TARGET_CPU=i386
+IF NOT ".%BUILD_TARGET_CPU%" == "."     goto have_2_BUILD_TARGET_CPU
 echo kBuild: Cannot figure BUILD_TARGET_CPU!
 goto failed
@@ -254,9 +254,9 @@
 REM # The PATH.
 set PATH=%PATH_KBUILD%\bin\win.x86;%PATH%
-IF "%BUILD_PLATFORM_ARCH%" = "win.amd64" set PATH=%PATH_KBUILD%\bin\win.amd64;%PATH%
+IF "%BUILD_PLATFORM_ARCH%" == "win.amd64" set PATH=%PATH_KBUILD%\bin\win.amd64;%PATH%
 echo dbg: PATH=%PATH%
 
 REM # Execute command
-IF ".%1" = "." goto end
+IF ".%1" == "." goto end
 %1 %2 %3 %4 %5 %6 %7 %8 %9
 goto end
