2 This directory <bacula-src>/src/win32 contains the build
3 environment for building the native Win32 Bacula File daemon,
4 the native Win32 bconsole program and the wx-console GUI console
7 The directory structure that you need to have is:
8 bacula/src/win32 Makefiles and scripts
9 baculafd Visual Studio Files
10 Release Release objects, and bacula-fd.exe
11 Debug Debug object, and bacula-fd.exe produced
13 console Build of console program and bconsole.conf
14 Release Release objects and bconsole.exe
16 wx-console Buld of wx-console program and wx-console-conf
17 Release Release objects and wx-console.exe
19 filed Links to core filed code
20 findlib Links to core findlib code
21 lib Links to core lib code
23 docs Bacula documentation directory with pre-build
27 pthreads The POSIX pthreads library (third party)
28 zlib The zlib library (third party)
29 wx The wxWidgets library (third party)
31 depkgs-win32 is released in a separate .tar.gz file that contains the
32 source for the above mentioned libraries needed to build the
33 Win32 Bacula. It can be found in the Source Forge Bacula project
34 release section. Docs is released as a separate tar file, which is
35 created from the bacula CVS docs project (module).
37 Instructions if you want to build bacula-fd with VSS
38 (Volume Shadow Copy Service) support. Note, the non-VSS build is
39 no longer supported though you may be able to get it to work by
40 copy the file src/win32/baculafd/baculanovssfd.mak into
41 src/win32/baculafd/baculafd.mak before running the "make" command
44 - VSS support works for both WinXP machines and Win 2003 machines.
45 - you need to get the VSS SDK:
46 http://www.microsoft.com/downloads/details.aspx?FamilyID=0B4F56E4-0CCC-4626-826A-ED2C4C95C871&displaylang=en
47 - copy the 'inc' and 'lib' directories from this SDK to
48 'bacula/src/win32/compat/vss'. Note, generally these files
49 are installed in c:/Program\ Files/Microsoft/VSSSDK71
50 - you should then have 'bacula/src/win32/compat/vss/inc' and
51 'bacula/src/win32/compat/vss/lib'
52 both with 'Win2003' and 'WinXP' subdirectories
53 - add 'WIN32_VSS' as preprocessor directive
54 - you should get a single bacula-fd.exe that runs on all platforms and has
55 VSS support for WinXP and 2003 enabled
56 - Once you have added the VSS SDK files as a subdirectory to the build
57 tree, follow the original instructions for building Bacula given
61 - We are using Microsoft Visual Studio .NET 2003 as the compiler,
62 but the build is done via scripting using the latest Cygwin
64 - For this version of Bacula, you must have msvcr71.dll
65 installed in c:/windows/system32 (i.e. Windows VC++ 2003)
67 and pebuilder Makefile.in files have this hard coded in.
68 - Make sure nmake is on your PATH.
69 - Make sure your COMSPEC is properly setup (see full dump of
70 my cygwin environment below).
71 - Running the following command may help setup the environment
72 variables used by VC++ (I don't use this command, but it might
73 just solve your problems).
74 run "<vc++ install dir>\VC\PlatformSDK\SetEnv.Cmd"
75 - The build is done in an rxvt window under the latest version
77 - You need the Platform SDK installed.
78 - You need Visual Studio installed.
79 - You need to load depkgs-win32, then
80 (make the two patches described below to in Nicolas' notes to wx)
83 (after building zlib and pthreads, it fails in wx)
87 (if it succeeds skip the next item, otherwise do it)
88 - You may have to build wx with VC++.
89 After starting VC++, use File->Open Workspace then
90 open wx/src/wxWindows.dsw then use
91 Build->Build All or Build->build wxmsw.lib should work too.
93 ./configure --enable-client-only
95 - ensure that the docs are copied into docs at the bacula
99 Here is the script that I use under cygwin to build it:
100 ==== build script =========
103 mkdir -p src/win32/compat/vss
104 cp -a c:/Program\ Files/Microsoft/VSSSDK71/inc src/win32/compat/vss
105 cp -a c:/Program\ Files/Microsoft/VSSSDK71/lib src/win32/compat/vss
107 --enable-client-only \
108 --sbindir=/bacula/bin \
109 --sysconfdir=/bacula/bin \
110 --enable-smartalloc \
111 --enable-static-tools \
112 --with-working-dir=/bacula/working \
113 --with-pid-dir=/bacula/working \
114 --with-subsys-dir=/bacula/working
119 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ../version.h`
120 cp -pf winbacula-$VERSION.exe k:/home/kern/bacula/winbacula-vss-$VERSION.exe
121 if test $? = 0 ; then
122 echo "winbacula-$VERSION.exe copied to k:/home/kern/bacula/winbacula-vss-$VERSION.exe"
124 echo "Build failed ..."
126 ======== end build script ==============
129 See License.txt for the License.
131 The native Win32 interface code was written by:
133 Christopher S. Hull, February 2004
136 For more details of building wx, see depkgs-win32/wx/docs/msw/install.txt
138 The easiest way to build this is to have a Visual Studio .NET 2003
139 However, you can use the free Microsoft C++ compiler with a bit
142 Here are additional pointers on building wx-console supplied by Nicolas
146 Tools I used (I think the 3 first one are included in VStudio) :
147 - VC++ toolkit : http://msdn.microsoft.com/visualc/vctoolkit2003/
148 - Windows Platform SDK :
149 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
150 (Core SDK and Internet Development SDK)
151 - nmake (it got it with .Net Framework SDK)
152 - lib.exe found in the SDK-base/Bin/win64 directory (works fine
153 on a 32 bit Windows).
155 Instructions if you want to build wx-console :
156 - wxWidgets 2.4.2 compilation
157 + In include/wx/string.h, replace line 195 by
158 #if defined(__VISUALC__) // && defined(_MT) && !defined(_DLL)
159 + In src/common/string.cpp, replace line 167 by
160 #if defined(__VISUALC__) // && defined(_MT) && !defined(_DLL)
161 + Follow the instructions in docs/msw/install.txt
162 (Visual C++ 6.0 compilation - Using makefiles)
164 - Make sure that the environment variables are set as:
165 - PATH includes the directories bin of both the C++ Toolkit and the SDK
166 - INCLUDE includes the directories include of both the C++ Toolkit and the SDK
167 - LIB includes the directories Lib of both the C++ Toolkit and the SDK
169 - Compile bacula depkg-win32 with Visual Studio or try the
170 supplied makefiles as described in the doc. I could not
171 get this to work -- kes.
173 - Compile wx-console with nmake -f wx-console.mak in
174 src/win32/wx-console I could not get this to work
177 - Additional information on using the free Micrsosoft C++ see
178 http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit
180 NOTE! I (Kern) cannot build wxWindows with the Makefile until after
181 I do a ./configure. I can use VC Studio directly to do so
182 following their instructions. Open VC Studio on the project
183 file depkgs-win32/wx/src/WxWindows.vcproj. Then build it.
184 Make sure you have selected the Release Unicode version under
185 menu->Build->Configuration Manager. It will create the file:
186 depkgs-win32/wx/lib/wxmswu.lib. At that point, you have
187 what you need to build wx-console.
189 Note, the paths given below have changed now that we switched
190 to Microsoft Visual Studio .NET 2003 (VC++ 7.1).
192 Getting all the environment variables setup properly is not always so obvious.
193 Here is what I have when I do a "set" in a rxvt window, in which I build
194 Bacula. Probably what is important are INCLUDE, LIB, PATH, and WXWIN, but note
195 there are a zillion other things set:
197 !C:='C:\cygwin\home\kern'
198 ALLUSERSPROFILE='C:\Documents and Settings\All Users'
199 APPDATA='C:\Documents and Settings\kern\Application Data'
200 BASEMAKE='C:\Program Files\Microsoft SDK\Include\BKOffice.Mak'
202 BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i686-pc-cygwin")
203 BASH_VERSION='2.05b.0(1)-release'
204 BKOFFICE='C:\Program Files\Microsoft SDK\.'
206 COLORFGBG='0;default;15'
209 COMMONPROGRAMFILES='C:\Program Files\Common Files'
211 COMSPEC='C:\WINDOWS\system32\cmd.exe'
215 EDHELP=/home/kern/bin/ed.hlp
216 EDTRM=/home/kern/bin/ed.trm
219 HISTFILE=/cygdrive/c/home/kern/.bash_history
222 HOME=/cygdrive/c/home/kern
224 HOMEPATH='\Documents and Settings\kern'
228 INCLUDE='C:\Program Files\Microsoft SDK\Include\.;C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include'
229 INETSDK='C:\Program Files\Microsoft SDK\.'
230 LIB='C:\Program Files\Microsoft SDK\Lib\.;C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib'
233 MACHTYPE=i686-pc-cygwin
236 MOZILLA_HOME=/home/netscape
237 MSDEVDIR='C:\Program Files\Microsoft Visual Studio\Common\MSDev98'
238 MSSDK='C:\Program Files\Microsoft SDK\.'
239 MSTOOLS='C:\Program Files\Microsoft SDK\.'
240 NUMBER_OF_PROCESSORS=1
241 OLDPWD=/home/kern/bacula
246 PATH='/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/Bin:/cygdrive/c/Program Files/Microsoft Visual Studio/VC98:/cygdrive/c/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin:/cygdrive/c/Program Files/Microsoft Visual Studio/Common/Tools/WinNT:/cygdrive/c/Program Files/Microsoft Visual Studio/Common/Tools:c:/cygwin/bin:/usr/bin:/home/kern/bin:/sbin:/usr/sbin:'
247 PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
250 PROCESSOR_ARCHITECTURE=x86
251 PROCESSOR_IDENTIFIER='x86 Family 15 Model 2 Stepping 7, GenuineIntel'
253 PROCESSOR_REVISION=0207
254 PROGRAMFILES='C:\Program Files'
256 PS1='\e[34m\]\w\[\e[0m\]$\040'
262 SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
265 SYSTEMROOT='C:\WINDOWS'
266 TEMP=/cygdrive/c/DOCUME~1/kern/LOCALS~1/Temp
268 TMP=/cygdrive/c/DOCUME~1/kern/LOCALS~1/Temp
272 USERPROFILE='C:\Documents and Settings\kern'
275 WXWIN='c:\home\kern\bacula\depkgs-win32\wx'