1 Instructions to build Bacula with Microsoft Visual C++ 2005
2 ===========================================================
4 Using the Express Edition (free version)
5 ----------------------------------------
7 - Visual C++ 2005 Express Edition (2MB + 66MB)
8 http://msdn.microsoft.com/vstudio/express/visualc/download/
9 NOTE: You may want to download the whole CD for offline usage
10 instead of the web installer, as Microsoft will
11 start to charge for VC++ one year after the product launch
12 (launch was in November 2005, see VC++ FAQ).
14 - Windows® Server 2003 SP1 Platform SDK Full Download (385MB)
15 http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en
16 NOTE: choose "Full Download" version on the bottom of that page.
18 Installation instructions:
19 - Visual C++ Express Edition Beta 2:
21 + When asked for Installation Options, only check "Graphical IDE"
22 (MSDN Library is NOT needed).
23 + Remember where you install it (e.g. E:\Microsoft Visual Studio 8\)
25 - Windows® Server 2003 SP1 Platform SDK Full Download
26 + Run psdk-full.exe, type the directory where you downloaded the cab
28 + In a command prompt, run "PSDK-full.bat <temp directory>"
29 (e.g. "PSDK-full.bat E:\temp")
30 + Run <temp directory>\setup.exe
31 + When asked for the installation directory, choose
32 <vc++ install dir>\VC\PlatformSDK (e.g.
33 E:\Microsoft Visual Studio 8\VC\PlatformSDK\)
34 + When asked for components, you can safely remove documentation,
35 samples, and all 64-bit tools and libs if you want to save disk
41 If you're reading this file you've probably already enlisted in the CVS
42 tree or extracted the contents of the source tar. If not you need to do
45 You also need to download one of the doc tar balls and extract to your
46 top level Bacula directory. It is referred to as bacula-top in the
47 diagram located in README.win32. It will be signified in this file as ...
49 The extracted doc directory name will be bacula-docs-version where
50 version is the version number. The directory must be renamed to docs
51 (ie remove the leading bacula- and the trailing -version portion of the
54 The script build-depkgs-msvc.cmd is used to download and build all the
55 third party dependencies required by Bacula. In order to build the
56 dependencies you need the following utilities. Only the binaries listed
57 in parenthesis are required. Perl must be listed in the PATH, the other
58 utilities can either be on the PATH or copied to ...\depkgs-msvc\tools.
60 Perl (Normal Install, with binaries in the PATH)
61 http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.819-MSWin32-x86-267479.msi
64 http://prdownloads.sourceforge.net/sevenzip/7za443.zip?download
67 http://prdownloads.sourceforge.net/nasm/nasm-0.98.39-win32.zip?download
70 http://prdownloads.sourceforge.net/gnuwin32/patch-2.5.9-6-bin.zip?download
72 sed (sed.exe) Depends on libintl, libiconv
73 http://prdownloads.sourceforge.net/gnuwin32/sed-4.1.4-bin.zip?download
75 tee (tee.exe) Depends on libintl, libiconv
76 http://prdownloads.sourceforge.net/gnuwin32/coreutils-5.3.0-bin.zip?download
78 wget (wget.exe) Depends on libintl, libiconv, openssl
79 http://prdownloads.sourceforge.net/gnuwin32/wget-1.10.1-bin.zip?download
81 libintl (libintl3.dll) Dependency of sed, tee, wget
82 http://prdownloads.sourceforge.net/gnuwin32/libintl-0.14.4-bin.zip?download
84 libiconv (libiconv2.dll) Dependency of sed, tee, wget
85 http://prdownloads.sourceforge.net/gnuwin32/libiconv-1.9.2-1-bin.zip?download
87 openssl (libeay32.dll, ssleay32.dll) Dependency of wget
88 http://prdownloads.sourceforge.net/gnuwin32/openssl-0.9.7c-bin.zip?download
90 Once the utilities are installed continue with the next steps.
92 Start VC++ 2005 command prompt (in the start menu)
94 cd ...\bacula\src\win32 directory.
96 Only if you are using Microsoft Visual C++ Express
98 "%VCINSTALLDIR%\PlatformSDK\SetEnv"
100 The following step should only need to be done the first time and
101 whenever the dependencies change.
105 At this point all of the dependencies should have been downloaded and
106 built. You need the header files from the Microsoft VSS SDK. You can
107 find it on Microsoft's web-site at:
109 http://www.microsoft.com/downloads/details.aspx?FamilyID=0b4f56e4-0ccc-4626-826a-ed2c4c95c871&DisplayLang=en
111 If that link doesn't work then go to http://www.microsoft.com and search
114 "download volume shadow copy service sdk"
116 Normally the files will be installed in:
118 C:\Program Files\Microsoft\VSSSDK72
120 You only need to copy everything under the C:\Program Files\Microsoft\VSSSDK72\inc
121 directory into .../depkgs-msvc/vss/inc.
123 The above only needs to be done once unless we change the cross-tools or
124 the dependencies versions. In general, you can run the script multiple
125 times with no problem.
130 Start VC++ 2005 command prompt (in the start menu)
132 cd ...\bacula\src\win32
134 If you are using Microsoft Visual C++ Express
136 "%VCINSTALLDIR%\PlatformSDK\SetEnv"
138 To build the debug version
140 build-msvc "Debug|Win32"
142 To build the release version
144 build-msvc "Release|Win32"
146 To cleanup all the built files
150 To cleanup only the debug built files
152 build-msvc /c "Debug|Win32"
154 To rebuild the debug version
156 build-msvc /r "Debug|Win32"
159 Updating the 3rd party package patches
160 ======================================
162 If one of the patches changes in ...\bacula\src\win32\patches, you will
163 need to update the corresponding dependency. You can install new patches
164 by doing the following (we assume the patch in question is for openssl).
166 cd ...\bacula\src\win32
167 set CLOBBER_SOURCE=true
168 build-depkgs-msvc openssl
171 NOTE: Setting CLOBBER_SOURCE=true means that any local changes to the
172 source code in the .../depkgs-msvc/src directory will be lost.
173 The source will be reextracted from the archive and the current
174 patches will be applied.
177 Adding a new global function or global data
178 ===========================================
183 The code from the following directories is built into bacula.dll:
186 .../bacula/src/libfind
187 .../bacula/src/win32/compat
189 A new function or data variable which must be accessed from outside
190 of bacula.dll requires special treatment. It must be specifically
193 New data variables are exported by adding the macro DLL_IMP_EXP to
194 the variable declaration in the header file. All exported variables
195 must be declared in a header file and MUST NOT be declared in a
196 source file referencing the variable.
198 Exporting a function requires a bit more work. You must determine the
199 C++ mangled name of the new function. Fortunately it is displayed in
200 parentheses in the linker error message. Place it in the
201 .../bacula/src/win32/libbac/bacula.def file.
206 The code from the src/cats directory is built into database provider
207 specific libraries of the form cats_<db>.dll.
209 The database specific portion <db> is mysql for MySQL, pgsql for
210 PostgreSQL, sqlite for SQLite, and bdb for the built-in Bacula database.
212 During installation of the Director, one of the database libraries is
213 copied to the system and renamed bacula_cats.dll.
215 A new function or data variable which must be accessed from outside
216 of bacula_cats.dll requires special treatment. It must be specifically
219 New data variables and functions are exported by placing their mangled
220 name in the file .../bacula/src/win32/cats/bacula_cats/bacula_cats.def.
222 The mangled name is printed, surrounded by parentheses, in the Linker