Commit 1bf29888 authored by Rom Walton's avatar Rom Walton

- WINBUILD: Introduce the beginning of an automated build system for

        Windows.  The goal is to completely automate the build process
        by creating a self contained environment for the scripts to
        execute under.  When completed it'll be able to do the following:
          * Increment version information
          * Build client software using installed version of VS.
          * Validate symbol files for specific components.
          * Add source file information to symbol files. (This will allow
              VS to automatically download the source file from SVN while
              single-stepping through the code on a clean machine)
          * Code sign executables
          * Build installer
          * Code sign installer
          * Upload updated symbol files and and setup packages
          
        When building interactively:
          * Automatically update the DLLs BOINC and BOINCMgr depend on
              when they have been updated in the source tree.
          * Fix-up BOINC project files when new branches are created
          * Fix-up project files for components BOINC depends on when
              new versions are released.
    
    /
        version.log (added)      
    win_build/
        buildenv.cmd (added)
        boinc_post_bld_rules.cmd
        boinc_cli.vcproj
        boincmgr.vcproj
    ../boinc_depends_win_vs2005
        <Various Files>

svn path=/trunk/boinc/; revision=19672
parent 22e44133
......@@ -9391,4 +9391,36 @@ Rom 19 Nov 2009
clientgui/
ProjectListCtrl.cpp
\ No newline at end of file
Rom 23 Nov 2009
- WINBUILD: Introduce the beginning of an automated build system for
Windows. The goal is to completely automate the build process
by creating a self contained environment for the scripts to
execute under. When completed it'll be able to do the following:
* Increment version information
* Build client software using installed version of VS.
* Validate symbol files for specific components.
* Add source file information to symbol files. (This will allow
VS to automatically download the source file from SVN while
single-stepping through the code on a clean machine)
* Code sign executables
* Build installer
* Code sign installer
* Upload updated symbol files and and setup packages
When building interactively:
* Automatically update the DLLs BOINC and BOINCMgr depend on
when they have been updated in the source tree.
* Fix-up BOINC project files when new branches are created
* Fix-up project files for components BOINC depends on when
new versions are released.
/
version.log (added)
win_build/
buildenv.cmd (added)
boinc_post_bld_rules.cmd
boinc_cli.vcproj
boincmgr.vcproj
../boinc_depends_win_vs2005
<Various Files>
......@@ -6,7 +6,7 @@ dnl not sure exactly what the minimum version is (but 2.13 wont work)
AC_PREREQ(2.58)
dnl Set the BOINC version here. You can also use the set-version script.
AC_INIT(BOINC, 6.11.0)
AC_INIT(BOINC, 6.11.1)
AC_CONFIG_MACRO_DIR([m4])
LIBBOINC_VERSION=`echo ${PACKAGE_VERSION} | sed 's/\./:/g'`
AC_SUBST([LIBBOINC_VERSION])
......
......@@ -10,10 +10,10 @@
#define BOINC_MINOR_VERSION 11
/* Release part of BOINC version number */
#define BOINC_RELEASE 0
#define BOINC_RELEASE 1
/* String representation of BOINC version number */
#define BOINC_VERSION_STRING "6.11.0"
#define BOINC_VERSION_STRING "6.11.1"
/* Package is a pre-release (Alpha/Beta) package */
#define BOINC_PRERELEASE 1
......@@ -23,19 +23,19 @@
#define PACKAGE "boinc"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
#define PACKAGE_BUGREPORT "boinc_dev@ssl.berkeley.edu"
/* Define to the full name of this package. */
#define PACKAGE_NAME "BOINC"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "BOINC 6.11.0"
#define PACKAGE_STRING "BOINC 6.11.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "boinc"
/* Define to the version of this package. */
#define PACKAGE_VERSION "6.11.0"
#define PACKAGE_VERSION "6.11.1"
#endif /* #if (defined(_WIN32) || defined(__APPLE__)) */
......
......@@ -123,7 +123,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boinc.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type &quot;$(ConfigurationName)&quot; platform &quot;$(PlatformName)&quot; exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -232,7 +232,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boinc.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type &quot;$(ConfigurationName)&quot; platform &quot;$(PlatformName)&quot; exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -342,7 +342,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boinc.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type &quot;$(ConfigurationName)&quot; platform &quot;$(PlatformName)&quot; exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -453,7 +453,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boinc.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type &quot;$(ConfigurationName)&quot; platform &quot;$(PlatformName)&quot; exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -562,7 +562,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boinc.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type &quot;$(ConfigurationName)&quot; platform &quot;$(PlatformName)&quot; exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -671,7 +671,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boinc.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type &quot;$(ConfigurationName)&quot; platform &quot;$(PlatformName)&quot; exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -781,7 +781,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boinc.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type &quot;$(ConfigurationName)&quot; platform &quot;$(PlatformName)&quot; exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -891,7 +891,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boinc.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type &quot;$(ConfigurationName)&quot; platform &quot;$(PlatformName)&quot; exec updatedepends.cmd"
/>
</Configuration>
</Configurations>
......
@echo off
rem Berkeley Open Infrastructure for Network Computing
rem http://boinc.berkeley.edu
rem Copyright (C) 2005 University of California
rem
rem This is free software; you can redistribute it and/or
rem modify it under the terms of the GNU Lesser General Public
rem License as published by the Free Software Foundation;
rem either version 2.1 of the License, or (at your option) any later version.
rem
rem This software is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rem See the GNU Lesser General Public License for more details.
rem
rem To view the GNU Lesser General Public License visit
rem http://www.gnu.org/copyleft/lesser.html
rem or write to the Free Software Foundation, Inc.,
rem 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
rem
FOR /F "usebackq delims==" %%I IN ('%1') DO set PROJECTROOTDIR=%%~I\..
FOR /F "usebackq delims==" %%I IN ('%1') DO set DEPENDSROOTDIR=%%~I\..\..\boinc_depends_win_vs2005
FOR /F "usebackq delims==" %%J IN ('%2') DO set OUTPUTDIR=%%~J
FOR /F "usebackq delims==" %%K IN ('%3') DO set PLATFORMNAME=%%~K
FOR /F "usebackq delims==" %%L IN ('%4') DO set CONFIGNAME=%%~L
if not exist %OUTPUTDIR%\dbghelp.dll (
echo Copying dbghelp to the output directory...
copy "%PROJECTROOTDIR%\win_build\installerv2\redist\Windows\%PLATFORMNAME%\dbghelp.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\dbghelp95.dll (
echo Copying dbghelp95 to the output directory...
copy "%PROJECTROOTDIR%\win_build\installerv2\redist\Windows\%PLATFORMNAME%\dbghelp95.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\symsrv.dll (
echo Copying symsrv to the output directory...
copy "%PROJECTROOTDIR%\win_build\installerv2\redist\Windows\%PLATFORMNAME%\symsrv.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\symsrv.yes (
echo Copying symsrv.yes to the output directory...
copy "%PROJECTROOTDIR%\win_build\installerv2\redist\Windows\%PLATFORMNAME%\symsrv.yes" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\srcsrv.dll (
echo Copying srcsrv.dll to the output directory...
copy "%PROJECTROOTDIR%\win_build\installerv2\redist\Windows\%PLATFORMNAME%\srcsrv.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\libcurld.dll (
echo Copying libcurld to the output directory...
copy "%DEPENDSROOTDIR%\curl\mswin\%PLATFORMNAME%\%CONFIGNAME%\bin\libcurld.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\libcurl.dll (
echo Copying libcurl to the output directory...
copy "%DEPENDSROOTDIR%\curl\mswin\%PLATFORMNAME%\%CONFIGNAME%\bin\libcurl.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\ca-bundle.crt (
echo Copying ca-bundle.crt to the output directory...
copy "%PROJECTROOTDIR%\curl\ca-bundle.crt" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\libeay32.dll (
echo Copying libeay32 to the output directory...
copy "%DEPENDSROOTDIR%\openssl\mswin\%PLATFORMNAME%\%CONFIGNAME%\bin\libeay32.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\ssleay32.dll (
echo Copying ssleay32 to the output directory...
copy "%DEPENDSROOTDIR%\openssl\mswin\%PLATFORMNAME%\%CONFIGNAME%\bin\ssleay32.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\zlib1d.dll (
echo Copying zlib1d to the output directory...
copy "%DEPENDSROOTDIR%\zlib\mswin\%PLATFORMNAME%\%CONFIGNAME%\bin\zlib1d.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\zlib1.dll (
echo Copying zlib1 to the output directory...
copy "%DEPENDSROOTDIR%\zlib\mswin\%PLATFORMNAME%\%CONFIGNAME%\bin\zlib1.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\cudart.dll (
echo Copying cudart to the output directory...
copy "%PROJECTROOTDIR%\coprocs\cuda\mswin\%PLATFORMNAME%\%CONFIGNAME%\bin\cudart.dll" "%OUTPUTDIR%"
)
if not exist %OUTPUTDIR%\sqlite3.dll (
echo Copying sqlite3 to the output directory...
copy "%DEPENDSROOTDIR%\sqlite3\mswin\%PLATFORMNAME%\%CONFIGNAME%\bin\sqlite3.dll" "%OUTPUTDIR%"
)
EXIT /B 0
......@@ -112,7 +112,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boincmgr.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type $(ConfigurationName) platform $(PlatformName) exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -211,7 +211,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boincmgr.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type $(ConfigurationName) platform $(PlatformName) exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -310,7 +310,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boincmgr.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type $(ConfigurationName) platform $(PlatformName) exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -410,7 +410,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boincmgr.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type $(ConfigurationName) platform $(PlatformName) exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -509,7 +509,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boincmgr.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type $(ConfigurationName) platform $(PlatformName) exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -609,7 +609,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boincmgr.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type $(ConfigurationName) platform $(PlatformName) exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -706,7 +706,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boincmgr.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type $(ConfigurationName) platform $(PlatformName) exec updatedepends.cmd"
/>
</Configuration>
<Configuration
......@@ -804,7 +804,7 @@
<Tool
Name="VCPostBuildEventTool"
Description="Checking boincmgr.exe dependencies"
CommandLine="boinc_post_bld_rules.cmd &quot;$(SolutionDir)&quot; &quot;$(OutDir)&quot; &quot;$(PlatformName)&quot; &quot;$(ConfigurationName)&quot;"
CommandLine="buildenv.cmd type $(ConfigurationName) platform $(PlatformName) exec updatedepends.cmd"
/>
</Configuration>
</Configurations>
......
@IF "%BUILDDBG%"=="TRUE" ( ECHO ON ) ELSE ( ECHO OFF )
rem Berkeley Open Infrastructure for Network Computing
rem http://boinc.berkeley.edu
rem Copyright (C) 2009 University of California
rem
rem This is free software; you can redistribute it and/or
rem modify it under the terms of the GNU Lesser General Public
rem License as published by the Free Software Foundation;
rem either version 3 of the License, or (at your option) any later version.
rem
rem This software is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rem See the GNU Lesser General Public License for more details.
rem
rem You should have received a copy of the GNU Lesser General Public License
rem along with BOINC. If not, see <http://www.gnu.org/licenses/>.
rem
rem Provide the groundwork for an automated build environment.
ECHO Initializing BOINC Build Environment for Windows
rem ***** Construct Build Environment Root Paths *****
rem
SET BUILDDRIVE=%~d0
SET BUILDROOT=%~dp0
SET BUILDROOT=%BUILDROOT:\win_build\=%
rem Detect Branch Name
PUSHD %BUILDROOT%\..
FOR /D %%I IN (*.*) DO (
IF /I "%CD%\%%I" == "%BUILDROOT%" SET BUILDBRANCHNAME=%%I
)
POPD
rem ***** Verify Parameters *****
rem
:VERIFYNEXTPARAM
IF /I "%1"=="/?" GOTO :USAGE
IF /I "%1"=="-?" GOTO :USAGE
IF /I "%1"=="/HELP" GOTO :USAGE
IF /I "%1"=="-HELP" GOTO :USAGE
IF /I "%1"=="TYPE" GOTO :PARSEPARAM
IF /I "%1"=="PLATFORM" GOTO :PARSEPARAM
IF /I "%1"=="EXEC" GOTO :PARSEPARAM
IF NOT "%1"=="" GOTO :USAGE
IF "%1"=="" GOTO :VALIDATEPARAMS
rem ***** Parse Parameters *****
rem
:PARSEPARAM
IF /I "%1"=="TYPE" SET _ArgBuildType=%2
IF /I "%1"=="PLATFORM" SET _ArgBuildPlatform=%2
IF /I "%1"=="EXEC" (
rem The exec command has to be the last of the build arguments
rem everything after it should be parameters for the command.
SET _ArgExec=%2
SET _ArgExecParam=%~3
GOTO :VALIDATEPARAMS
)
SHIFT
SHIFT
GOTO :VERIFYNEXTPARAM
rem ***** Validate Parameters *****
rem
:VALIDATEPARAMS
rem A little bit of batchfile magic to remove double quotes
rem which would be sent from the automated build tools.
FOR /F %%I IN ("%_ArgBuildType%") DO SET _ArgBuildType=%%~I
FOR /F %%I IN ("%_ArgBuildPlatform%") DO SET _ArgBuildPlatform=%%~I
IF /I "%_ArgBuildType%"=="" GOTO :USAGE
IF /I "%_ArgBuildPlatform%"=="" GOTO :USAGE
IF /I "%_ArgBuildPlatform%" == "x64" SET _ArgBuildPlatform=amd64
IF /I "%_ArgBuildPlatform%" == "Win32" SET _ArgBuildPlatform=x86
SET BUILDTYPE=%_ArgBuildType%
SET BUILDPLATFORM=%_ArgBuildPlatform%
rem ***** Software Detection *****
rem
IF EXIST "%VS80COMNTOOLS%\vsvars32.bat" (
CALL "%VS80COMNTOOLS%\vsvars32.bat" > NUL: 2> NUL:
SET BUILDCOMPILERDETECTED=vs2005
GOTO :SOFTDETECTIONCOMPLETE
)
IF EXIST "%VS90COMNTOOLS%\vsvars32.bat" (
CALL "%VS90COMNTOOLS%\vsvars32.bat" > NUL: 2> NUL:
SET BUILDCOMPILERDETECTED=vs2008
GOTO :SOFTDETECTIONCOMPLETE
)
IF EXIST "%VS100COMNTOOLS%\vsvars32.bat" (
CALL "%VS100COMNTOOLS%\vsvars32.bat" > NUL: 2> NUL:
SET BUILDCOMPILERDETECTED=vs2010
GOTO :SOFTDETECTIONCOMPLETE
)
:SOFTDETECTIONCOMPLETE
IF "%VCINSTALLDIR%"=="" (
ECHO Software NOT Detected: Microsoft Visual Studio 2005/2008/2010...
EXIT /B 1
)
rem ***** Build Tools Detection *****
rem
SET BUILDTOOLSNAME=boinc_depends_win_%BUILDCOMPILERDETECTED%
SET BUILDTOOLSROOT=%BUILDROOT%\..\%BUILDTOOLSNAME%
IF EXIST %BUILDTOOLSROOT%\win_build\subversion GOTO :BUILDTOOLSROOTVALIDATED
rem We must be in a branch and we can't currently use subversion commands
rem to determine where we are to find our build tools. Use some batch
rem file magic to parse the branch name from the name of the directory
rem hosting the build tree. This can be different than just the version
rem number, we have had to rev the branch name for certain releases due
rem to late changing features. 6.6 vs 6.6a
FOR /F "usebackq tokens=3,* delims=_" %%I IN ('%BUILDBRANCHNAME%') DO (
SET BUILDTOOLSNAME=boinc_depends_win_%BUILDCOMPILERDETECTED%_%%J
SET BUILDTOOLSROOT=%BUILDROOT%\..\%BUILDTOOLSNAME%
)
IF NOT EXIST %BUILDTOOLSROOT%\win_build\subversion (
ECHO Software NOT Detected: Build Tools...
EXIT /B 2
)
:BUILDTOOLSROOTVALIDATED
FOR /F %%I IN ("%BUILDTOOLSROOT%") DO SET BUILDTOOLSROOT=%%~fI
rem ***** Reset Variables to start out with a clean environment *****
rem
SET PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
SET INCLUDE=
SET LIB=
SET LIBPATH=
rem Which build environment should we use?
IF /I NOT "%PROCESSOR_ARCHITECTURE%"=="%BUILDPLATFORM%" GOTO :BUILDENVCROSS
rem Building a native binary for the current platform.
:BUILDENVNATIVE
IF /I NOT "%BUILDPLATFORM%"=="x86" (
CALL "%VCINSTALLDIR%\bin\%PROCESSOR_ARCHITECTURE%\vcvars%PROCESSOR_ARCHITECTURE%.bat" > NUL: 2> NUL:
IF ERRORLEVEL 1 GOTO :BUILDENVFAILURE
) ELSE (
CALL "%VCINSTALLDIR%\bin\vcvars32.bat" > NUL: 2> NUL:
IF ERRORLEVEL 1 GOTO :BUILDENVFAILURE
)
GOTO :BUILDENVDONE
rem Building a binary for another platform.
:BUILDENVCROSS
IF /I NOT "%BUILDPLATFORM%"=="x86" (
CALL "%VCINSTALLDIR%\bin\%PROCESSOR_ARCHITECTURE%_%BUILDPLATFORM%\vcvars%PROCESSOR_ARCHITECTURE%_%BUILDPLATFORM%.bat" > NUL: 2> NUL:
IF ERRORLEVEL 1 GOTO :BUILDENVFAILURE
) ELSE (
CALL "%VCINSTALLDIR%\bin\vcvars32.bat" > NUL: 2> NUL:
IF ERRORLEVEL 1 GOTO :BUILDENVFAILURE
)
:BUILDENVDONE
rem Convert the OS Platform into a Visual Studio compatible platform
IF /I "%BUILDPLATFORM%"=="x86" SET VSPLATFORM=Win32
IF /I "%BUILDPLATFORM%"=="amd64" SET VSPLATFORM=x64
IF /I "%BUILDPLATFORM%"=="ia64" SET VSPLATFORM=Itanium
rem ***** Standard Developer Environment *****
rem
rem Add standard shell scripts executables to the path
SET PATH=%BUILDROOT%\win_build;%BUILDROOT%\win_build\%PROCESSOR_ARCHITECTURE%;%PATH%
SET PATH=%BUILDTOOLSROOT%\win_build;%BUILDTOOLSROOT%\win_build\%PROCESSOR_ARCHITECTURE%;%PATH%
rem Add Perl to the path
SET PATH=%BUILDTOOLSROOT%\win_build\perl;%BUILDTOOLSROOT%\win_build\perl\%PROCESSOR_ARCHITECTURE%\bin;%PATH%
rem Add subversion source control to the path
SET SVN_EDITOR=notepad.exe
SET PATH=%BUILDTOOLSROOT%\win_build\subversion;%BUILDTOOLSROOT%\win_build\subversion\%PROCESSOR_ARCHITECTURE%\bin;%PATH%
rem Specify build output directory
SET BUILDOUTPUT=%BUILDROOT%\win_build\build\%VSPLATFORM%\%BUILDTYPE%
rem Add source server environment variables
SET SRCSRV_SYSTEM=svn
SET SRCSRV_INI=%BUILDTOOLSROOT%\win_build\srcsrv.ini
SET SRCSRV_SYMBOLS=%BUILDROOT%\win_build\build\%VSPLATFORM%\%BUILDTYPE%
SET SRCSRV_SOURCE=%BUILDROOT%
rem Add deployable symbol store environment variables
SET BUILDSYMBOLSTORE=%BUILDTOOLSROOT%\Developr\%USERNAME%\symstore
rem Add _NT_SYMBOL_PATH to the environment
SET _NT_SYMBOL_PATH=%BUILDSYMBOLSTORE%
SET _NT_SYMBOL_PATH=%_NT_SYMBOL_PATH%;srv*%BUILDTOOLSROOT%\Developr\%USERNAME%\symbols*http://msdl.microsoft.com/download/symbols
SET _NT_SYMBOL_PATH=%_NT_SYMBOL_PATH%;srv*%BUILDTOOLSROOT%\Developr\%USERNAME%\symbols*http://boinc.berkeley.edu/symstore/
rem Add standard macros to the environment
DOSKEY /MACROFILE="%BUILDTOOLSROOT%\developr\generic.mac"
rem Add directory traversal macros to the environment
DOSKEY /MACROFILE="%BUILDTOOLSROOT%\developr\tree.mac"
rem Populate environmental version information
FOR /F "usebackq tokens=1,2,3 delims=." %%I IN (`TYPE "%BUILDROOT%\version.log"`) DO (
SET BUILDVERSIONMAJOR=%%I
SET BUILDVERSIONMINOR=%%J
SET BUILDVERSIONREVISION=%%K
)
rem Adjust command processor window title
TITLE BOINC Build Environment for Windows %BUILDVERSIONMAJOR%.%BUILDVERSIONMINOR% (%BUILDTYPE%/%BUILDPLATFORM%)
rem ***** Customized Developer Environment *****
rem
SET BUILDHOMEDIR=%BUILDTOOLSROOT%\Developr\%USERNAME%
IF NOT EXIST %BUILDHOMEDIR% MKDIR %BUILDHOMEDIR%
rem Create a default directory layout
IF NOT EXIST %BUILDHOMEDIR%\bin mkdir %BUILDHOMEDIR%\bin
IF NOT EXIST %BUILDHOMEDIR%\bin\%PROCESSOR_ARCHITECTURE% mkdir %BUILDHOMEDIR%\bin\%PROCESSOR_ARCHITECTURE%
IF NOT EXIST %BUILDHOMEDIR%\temp mkdir %BUILDHOMEDIR%\temp
IF NOT EXIST %BUILDHOMEDIR%\symbols mkdir %BUILDHOMEDIR%\symbols
IF NOT EXIST %BUILDHOMEDIR%\symstore mkdir %BUILDHOMEDIR%\symstore
rem Add custom shell scripts to the path
SET PATH=%BUILDHOMEDIR%\bin;%BUILDHOMEDIR%\bin\%PROCESSOR_ARCHITECTURE%;%PATH%
rem Add custom macros to the environment
IF EXIST %BUILDHOMEDIR%\custom.mac (
DOSKEY /MACROFILE=%BUILDHOMEDIR%\custom.mac
)
rem Execute a custom shell script as defined by the developer
IF EXIST %BUILDHOMEDIR%\customenv.cmd (
CALL %BUILDHOMEDIR%\customenv.cmd
)
rem ***** Execute Command Line Script *****
rem
IF /I NOT "%_ArgExec%"=="" (
ECHO Executing: %_ArgExec% %_ArgExecParam%
ECHO.
CALL %_ArgExec% %_ArgExecParam%
IF ERRORLEVEL 1 EXIT /B 10
)
rem ***** Cleanup all the temporary variables *****
rem
FOR /F "delims==" %%I IN ('SET _Arg') DO SET %%I=
rem ***** All Done *****
rem
GOTO :EOF
:BUILDENVFAILURE
ECHO Failed to setup the requested build environment.
ECHO Commandline: %*
ECHO.
:USAGE
ECHO Usage: buildenv.cmd TYPE ^<type^> PLATFORM ^<platform^> [Optional Commands]
ECHO.
ECHO Commands:
ECHO TYPE: Which build environment are you building executables for.
ECHO Current Values: Release/Debug
ECHO PLATFORM: Which platform are you building for.
ECHO Current Values: x86/amd64/ia64
ECHO.
GOTO :EOF
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment