Author: jfrederic.clere(a)jboss.com
Date: 2009-01-22 05:45:50 -0500 (Thu, 22 Jan 2009)
New Revision: 2198
Modified:
trunk/build/windows/build.bat
Log:
Write the environment in bat file so it can be reused for tests.
Modified: trunk/build/windows/build.bat
===================================================================
--- trunk/build/windows/build.bat 2009-01-22 07:46:40 UTC (rev 2197)
+++ trunk/build/windows/build.bat 2009-01-22 10:45:50 UTC (rev 2198)
@@ -46,14 +46,23 @@
echo Params : %*
echo.
+set ENV_BAT=%BUILD_HOME%\env.%1.%2.bat
+echo Writting conf in %ENV_BAT%
+echo REM Generated by %PROGNAME% %DATE% %TIME% > %ENV_BAT%
+echo REM Params : %* >> %ENV_BAT%
+
REM Check for cygwin in the PATH
-@if "%CYGWIN_INSTALL_DIR%" == "" set CYGWIN_INSTALL_DIR=C:\cygwin
+@if "%CYGWIN_INSTALL_DIR%" == "" (
+ set CYGWIN_INSTALL_DIR=C:\cygwin
+ echo set CYGWIN_INSTALL_DIR=C:\cygwin >> %ENV_BAT%
+)
@if exist "%CYGWIN_INSTALL_DIR%\" goto cmdFoundCygwin
echo CYGWIN_INSTALL_DIR points to invalid directory %CYGWIN_INSTALL_DIR%
goto cmdEnd
:cmdFoundCygwin
set PATH=%CYGWIN_INSTALL_DIR%\bin;%PATH%
+echo set PATH=%CYGWIN_INSTALL_DIR%\bin;%PATH% >> %ENV_BAT%
REM Then for an acceptable location.
bash check_path.sh
@@ -66,9 +75,13 @@
@if exist "%LOCAL_DIR%\conf.%COMPUTERNAME%.bat" (
echo "Using %COMPUTERNAME% specific configuration"
call "%LOCAL_DIR%\conf.%COMPUTERNAME%"
+ echo call "%LOCAL_DIR%\conf.%COMPUTERNAME%" >> %ENV_BAT%
) else (
echo "Using default configuration"
- @if "%TOOLS_ROOT%" == "" set TOOLS_ROOT=C:\opt
+ @if "%TOOLS_ROOT%" == "" (
+ set TOOLS_ROOT=C:\opt
+ echo set TOOLS_ROOT=C:\opt >> %ENV_BAT%
+ )
@if exist "%TOOLS_ROOT%\" goto cmdSetTools
echo TOOLS_ROOT points to invalid directory %TOOLS_ROOT%
goto cmdEnd
@@ -76,8 +89,11 @@
:cmdSetTools
@echo Using Tools from %TOOLS_ROOT%
set MSVS8VC=%TOOLS_ROOT%\MSVS8\VC
+ echo set MSVS8VC=%TOOLS_ROOT%\MSVS8\VC >> %ENV_BAT%
set MSVS6VC=%TOOLS_ROOT%\MSVS6
+ echo set MSVS6VC=%TOOLS_ROOT%\MSVS6 >> %ENV_BAT%
set MSWPSDK=%TOOLS_ROOT%\PSDK6
+ echo set MSWPSDK=%TOOLS_ROOT%\PSDK6 >> %ENV_BAT%
)
set BUILD_OS=windows
@@ -87,9 +103,17 @@
set INCLUDE_PRE64PRA=
set INCLUDE_BUFFEROVERFLOWU=
+echo set BUILD_OS=windows >> %ENV_BAT%
+echo set CRT_REDIST= >> %ENV_BAT%
+echo set USE_PLATFORM_SDK= >> %ENV_BAT%
+echo set APR_DECLARE_STATIC= >> %ENV_BAT%
+echo set INCLUDE_PRE64PRA= >> %ENV_BAT%
+echo set INCLUDE_BUFFEROVERFLOWU= >> %ENV_BAT%
+
@if not "%1" == "sdk" goto checkSTATIC
shift
set USE_PLATFORM_SDK=1
+echo set USE_PLATFORM_SDK=1 >> %ENV_BAT%
:checkSTATIC
@if /i "%1" == "static" goto makeSTATIC
@@ -98,9 +122,11 @@
:makeSTATIC
shift
set APR_DECLARE_STATIC=1
+echo set APR_DECLARE_STATIC=1 >> %ENV_BAT%
:checkCPU
set BUILD_CPU=%1
+echo set BUILD_CPU=%1 >> %ENV_BAT%
shift
@if /i "%BUILD_CPU%" == "i686" goto cpuX86
@if /i "%BUILD_CPU%" == "x86" goto cpuX86
@@ -116,46 +142,66 @@
:cpuX86
set BUILD_CPU=x86
+echo set BUILD_CPU=x86 >> %ENV_BAT%
@if "%USE_PLATFORM_SDK%" == "1" (
call "%MSVS6VC%\vs6vars"
+ echo call "%MSVS6VC%\vs6vars" >> %ENV_BAT%
) else (
call "%MSVS8VC%\bin\vcvars32"
+ echo call "%MSVS8VC%\bin\vcvars32" >> %ENV_BAT%
set CRT_REDIST=%MSVS8VC%\redist\x86\Microsoft.VC80.CRT
+ echo set CRT_REDIST=%MSVS8VC%\redist\x86\Microsoft.VC80.CRT >> %ENV_BAT%
)
goto cmdBuild
:cpuX64
set BUILD_CPU=x64
+echo set BUILD_CPU=x64 >> %ENV_BAT%
@if "%USE_PLATFORM_SDK%" == "1" (
call "%MSWPSDK%\SetEnv" /XP64 /RETAIL
+ echo call "%MSWPSDK%\SetEnv" /XP64 /RETAIL >> %ENV_BAT%
) else (
call "%MSVS8VC%\bin\amd64\vcvarsamd64"
+ echo call "%MSVS8VC%\bin\amd64\vcvarsamd64" >> %ENV_BAT%
set CRT_REDIST=%MSVS8VC%\redist\amd64\Microsoft.VC80.CRT
+ echo set CRT_REDIST=%MSVS8VC%\redist\amd64\Microsoft.VC80.CRT >> %ENV_BAT%
)
goto cmdBuild
:cpuI64
set BUILD_CPU=i64
+echo set BUILD_CPU=i64 >> %ENV_BAT%
@if "%USE_PLATFORM_SDK%" == "1" (
call "%MSWPSDK%\SetEnv" /SRV64 /RETAIL
+ echo call "%MSWPSDK%\SetEnv" /SRV64 /RETAIL >> %ENV_BAT%
) else (
REM Update to correct IA64 paths
call "%MSVS8VC%\bin\amd64\vcvarsamd64"
+ echo call "%MSVS8VC%\bin\amd64\vcvarsamd64" >> %ENV_BAT%
set CRT_REDIST=%MSVS8VC%\redist\amd64\Microsoft.VC80.CRT
+ echo set CRT_REDIST=%MSVS8VC%\redist\amd64\Microsoft.VC80.CRT >> %ENV_BAT%
)
goto cmdBuild
:cmdBuild
@for /D %%i IN (%INCLUDE%) DO (
- @if exist "%%i\PRE64PRA.H" set INCLUDE_PRE64PRA=1
+ @if exist "%%i\PRE64PRA.H" (
+ set INCLUDE_PRE64PRA=1
+ echo set INCLUDE_PRE64PRA=1 >> %ENV_BAT%
+ )
)
@for /D %%i IN (%LIB%) DO (
- @if exist "%%i\bufferoverflowu.lib" set INCLUDE_BUFFEROVERFLOWU=1
+ @if exist "%%i\bufferoverflowu.lib" (
+ set INCLUDE_BUFFEROVERFLOWU=1
+ echo set INCLUDE_BUFFEROVERFLOWU=1 >> %ENV_BAT%
+ )
)
set INIT=%LOCAL_DIR%
+echo set INIT=%LOCAL_DIR% >> %ENV_BAT%
pushd %BUILD_HOME%\unix
+PAUSE
bash build.sh %1 %2 %3 %4 %5
@if ERRORLEVEL 1 (
echo build.sh failed