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 2005.
5::  This is enforced but if testing is desired for other releases
6::  it's possible to cut/paste.
7::
8
9:: Try to find different versions of Visual Studio
10
11call :TryBat "%VS80COMNTOOLS%\vsvars32.bat" && goto VS80
12call :TryBat "%VS90COMNTOOLS%\vsvars32.bat" && goto VS90
13
14:: no luck
15goto batnotfound
16
17:VS80
18echo Using Visual Studio format 8.0 (Visual Studio 2005)
19@echo "" > winbld.out
20@echo devenv /build Release ..\build_windows\Berkeley_DB.sln
21@devenv /build Release ..\build_windows\Berkeley_DB.sln >> winbld.out
22@echo devenv /build Release ..\build_windows\Berkeley_DB.sln /project VS8\db_java.vcproj
23@devenv /build Release ..\build_windows\Berkeley_DB.sln /project VS8\db_java.vcproj
24@echo devenv /build Release ..\build_windows\BDB_dotNet.sln
25@devenv /build Release ..\build_windows\BDB_dotNet.sln >> winbld.out
26@echo devenv /build Release ..\build_windows\VS8\db_sql_jdbc.vcproj
27@devenv /build Release ..\build_windows\VS8\db_sql_jdbc.vcproj >> winbld.out
28@echo devenv /build Release ..\build_windows\VS8\db_sql_odbc.vcproj
29@devenv /build Release ..\build_windows\VS8\db_sql_odbc.vcproj >> winbld.out
30goto :eof
31
32:VS90
33@echo Windows binaries must be built using Visual Studio 2005
34@echo If you want to test VS2008, uncomment the goto line below.
35@echo Note these build lines will not work with the express editions
36@echo of VS which do not appear to include "devenv."
37@echo Express editions can be built with lines like:
38@echo "VCExpress Berkeley_DB.sln /build" or
39@echo "VCSExpress BDB_dotNet.sln /build"
40goto :batnotfound
41@echo Using Visual Studio format 9.0 (Visual Studio 2008)
42@echo "" > winbld.out
43@echo devenv /build Release ..\build_windows\Berkeley_DB.sln
44@devenv /build Release ..\build_windows\Berkeley_DB.sln >> winbld.out
45@echo devenv /build Release ..\build_windows\Berkeley_DB.sln /project VS8\db_java.vcproj
46@devenv /build Release ..\build_windows\Berkeley_DB.sln /project VS8\db_java.vcproj
47@echo devenv /build Release ..\build_windows\BDB_dotNet.sln
48@devenv /build Release ..\build_windows\BDB_dotNet.sln >> winbld.out
49@echo devenv /build Release ..\build_windows\VS8\db_sql_jdbc.vcproj
50@devenv /build Release ..\build_windows\VS8\db_sql_jdbc.vcproj >> winbld.out
51@echo devenv /build Release ..\build_windows\VS8\db_sql_odbc.vcproj
52@devenv /build Release ..\build_windows\VS8\db_sql_odbc.vcproj >> winbld.out
53goto :eof
54
55:batnotfound
56echo *********** ERROR: Visual Studio Config batch file not found *************
57exit 3
58goto end
59
60:: TryBat(BATPATH)
61:: If the BATPATH exists, use it and return 0,
62:: otherwise, return 1.
63
64:TryBat
65:: Filename = "%1"
66if not exist %1 exit /b 1
67call %1
68exit /b 0
69goto :eof
70
71:end
72