]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/README.vc8
Set keyword replacement on files
[bacula/bacula] / bacula / src / win32 / README.vc8
1 Instructions to build Bacula with Microsoft Visual C++ 2005
2 ===========================================================
3
4 Using the Express Edition (free version)
5 ----------------------------------------
6   Download instructions:
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).
13
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.
17
18   Installation instructions:
19     - Visual C++ Express Edition Beta 2:
20       + Run vcsetup.exe.
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\)
24
25     - Windows® Server 2003 SP1 Platform SDK Full Download
26       + Run psdk-full.exe, type the directory where you downloaded the cab
27         files.
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
36         space.
37
38 One-time Setup
39 ==============
40
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
43 that first.
44
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 ...
48
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
52 name).
53
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.
59
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
62
63   7-Zip (7z.exe)
64     http://prdownloads.sourceforge.net/sevenzip/7za443.zip?download
65
66   NASM (nasmw.exe)
67     http://prdownloads.sourceforge.net/nasm/nasm-0.98.39-win32.zip?download
68
69   patch (patch.exe)
70     http://prdownloads.sourceforge.net/gnuwin32/patch-2.5.9-6-bin.zip?download
71
72   sed (sed.exe) Depends on libintl, libiconv
73     http://prdownloads.sourceforge.net/gnuwin32/sed-4.1.4-bin.zip?download
74
75   tee (tee.exe) Depends on libintl, libiconv
76     http://prdownloads.sourceforge.net/gnuwin32/coreutils-5.3.0-bin.zip?download
77
78   wget (wget.exe) Depends on libintl, libiconv, openssl
79     http://prdownloads.sourceforge.net/gnuwin32/wget-1.10.1-bin.zip?download
80
81   libintl (libintl3.dll) Dependency of sed, tee, wget
82     http://prdownloads.sourceforge.net/gnuwin32/libintl-0.14.4-bin.zip?download
83
84   libiconv (libiconv2.dll) Dependency of sed, tee, wget
85     http://prdownloads.sourceforge.net/gnuwin32/libiconv-1.9.2-1-bin.zip?download
86
87   openssl (libeay32.dll, ssleay32.dll) Dependency of wget
88     http://prdownloads.sourceforge.net/gnuwin32/openssl-0.9.7c-bin.zip?download
89
90 Once the utilities are installed continue with the next steps.
91
92 Start VC++ 2005 command prompt (in the start menu)
93
94    cd ...\bacula\src\win32 directory.
95
96 Only if you are using Microsoft Visual C++ Express
97
98    "%VCINSTALLDIR%\PlatformSDK\SetEnv"
99
100 The following step should only need to be done the first time and
101 whenever the dependencies change.
102
103    build-depkgs-msvc
104
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:
108
109 http://www.microsoft.com/downloads/details.aspx?FamilyID=0b4f56e4-0ccc-4626-826a-ed2c4c95c871&DisplayLang=en
110
111 If that link doesn't work then go to http://www.microsoft.com and search
112 for
113
114    "download volume shadow copy service sdk"
115
116 Normally the files will be installed in:
117
118    C:\Program Files\Microsoft\VSSSDK72
119
120 You only need to copy everything under the C:\Program Files\Microsoft\VSSSDK72\inc
121 directory into .../depkgs-msvc/vss/inc.
122
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.
126
127 Building
128 ========
129
130 Start VC++ 2005 command prompt (in the start menu)
131
132    cd ...\bacula\src\win32
133
134 If you are using Microsoft Visual C++ Express
135
136    "%VCINSTALLDIR%\PlatformSDK\SetEnv"
137
138 To build the debug version
139
140    build-msvc "Debug|Win32"
141
142 To build the release version
143
144    build-msvc "Release|Win32"
145
146 To cleanup all the built files
147
148    build-msvc /c
149
150 To cleanup only the debug built files
151
152    build-msvc /c "Debug|Win32"
153
154 To rebuild the debug version
155
156    build-msvc /r "Debug|Win32"
157
158
159 Updating the 3rd party package patches
160 ======================================
161
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).
165
166    cd ...\bacula\src\win32
167    set CLOBBER_SOURCE=true
168    build-depkgs-msvc openssl
169    set CLOBBER_SOURCE=
170
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.
175
176
177 Adding a new global function or global data
178 ===========================================
179
180 bacula.dll
181 ----------
182
183 The code from the following directories is built into bacula.dll:
184
185    .../bacula/src/lib
186    .../bacula/src/libfind
187    .../bacula/src/win32/compat
188
189 A new function or data variable which must be accessed from outside
190 of bacula.dll requires special treatment.  It must be specifically
191 exported.
192
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.
197
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.
202
203 bacula_cats.dll
204 ---------------
205
206 The code from the src/cats directory is built into database provider
207 specific libraries of the form cats_<db>.dll.
208
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.
211
212 During installation of the Director, one of the database libraries is
213 copied to the system and renamed bacula_cats.dll.
214
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
217 exported.
218
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.
221
222 The mangled name is printed, surrounded by parentheses, in the Linker
223 error message.