1@echo off
2::  Helper script to build BDB products for binary release
3::  Assumes current directory is <product>/dist
4::  Current version of Visual Studio for binaries is 2010.
5::  This is enforced but if testing is desired for other releases
6::  it's possible to edit.
7::
8
9:: Try to find different versions of Visual Studio
10call :TryBat "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" && goto VS100
11
12:: no luck
13goto batnotfound
14
15:VS100
16@echo Note these build commands will not work with the express
17@echo editions of VS2010 which do not appear to include "devenv."
18@echo Express editions can be built with lines like:
19@echo "VCExpress Berkeley_DB_vs2010.sln /build" or
20@echo "VCSExpress BDB_dotNet_vs2010.sln /build"
21::goto :batnotfound
22@echo Using Visual Studio format 10.0 (Visual Studio 2010)
23@echo "" > winbld.out
24@echo devenv /build "Release|x64" ..\build_windows\Berkeley_DB_vs2010.sln
25@devenv /build "Release|x64" ..\build_windows\Berkeley_DB_vs2010.sln >> winbld.out
26@echo devenv ..\build_windows\Berkeley_DB_vs2010.sln /build "Release|x64" /project VS10\db_java.vcxproj
27@devenv ..\build_windows\Berkeley_DB_vs2010.sln /build "Release|x64" /project VS10\db_java.vcxproj >> winbld.out
28@echo devenv /build "Release|x64" ..\build_windows\BDB_dotNet_vs2010.sln
29@devenv /build "Release|x64" ..\build_windows\BDB_dotNet_vs2010.sln >> winbld.out
30goto :eof
31
32:batnotfound
33echo *********** ERROR: Visual Studio Config batch file not found *************
34exit 3
35goto end
36
37:: TryBat(BATPATH)
38:: If the BATPATH exists, use it and return 0,
39:: otherwise, return 1.
40
41:TryBat
42:: Filename = "%1"
43if not exist %1 exit /b 1
44call %1 x64
45exit /b 0
46goto :eof
47
48:end
49