]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/README.win32
Update win32 README
[bacula/bacula] / bacula / src / win32 / README.win32
1
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
5 program.
6
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
12                            by VC++
13     console             Build of console program and bconsole.conf
14       Release           Release objects  and bconsole.exe
15       Debug             Debug objects 
16     wx-console          Buld of wx-console program and wx-console-conf
17       Release           Release objects and wx-console.exe
18       Debug             Debug objects.
19     filed               Links to core filed code
20     findlib             Links to core findlib code
21     lib                 Links to core lib code
22
23   docs                  Bacula documentation directory with pre-build
24                         doc files
25
26   depkgs-win32
27     pthreads            The POSIX pthreads library (third party)
28     zlib                The zlib library (third party)
29     wx                  The wxWidgets library (third party)
30
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).             
36
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
42 below:
43
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
58   below.
59
60 To build it:
61 - We are using Microsoft Visual Studio .NET 2003 as the compiler,
62   but the build is done via scripting using the latest Cygwin
63   environment.
64 - For this version of Bacula, you must have msvcr71.dll
65   installed in c:/windows/system32 (i.e. Windows VC++ 2003)
66   The winbacula.nsi.in
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
76   of cygwin.
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)
81     cd depkgs-win32
82     make
83     (after building zlib and pthreads, it fails in wx)
84     cd wx
85     ./configure
86     make
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.
92 - cd bacula
93   ./configure --enable-client-only
94   cd src/win32
95 - ensure that the docs are copied into docs at the bacula
96   directory level.
97   make
98
99 Here is the script that I use under cygwin to build it:
100 ==== build script =========
101 #!/bin/sh
102 cd bacula
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
106 ./configure \
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
115 rm -rf docs
116 cp -a ../docs .
117 cd src/win32
118 make
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"
123 else
124   echo "Build failed ..."
125 fi
126 ======== end build script ==============
127
128
129 See License.txt for the License.
130
131 The native Win32 interface code was written by:
132
133    Christopher S. Hull, February 2004
134
135
136 For more details of building wx, see depkgs-win32/wx/docs/msw/install.txt
137
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
140 of additional work.
141
142 Here are additional pointers on building wx-console supplied by Nicolas
143 Boichat:
144
145
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).
154
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)
163
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
168     
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.
172
173 - Compile wx-console with nmake -f wx-console.mak in
174   src/win32/wx-console  I could not get this to work
175   kes.
176
177 - Additional information on using the free Micrsosoft C++ see
178   http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit
179
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.
188
189 Note, the paths given below have changed now that we switched
190 to Microsoft Visual Studio .NET 2003 (VC++ 7.1).
191
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:
196 !::='::\'
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'
201 BASH=/usr/bin/bash
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\.'
205 CLIENTNAME=Console
206 COLORFGBG='0;default;15'
207 COLORTERM=rxvt-xpm
208 COLUMNS=70
209 COMMONPROGRAMFILES='C:\Program Files\Common Files'
210 COMPUTERNAME=TIBS
211 COMSPEC='C:\WINDOWS\system32\cmd.exe'
212 CYGWIN=notty
213 DIRSTACK=()
214 DISPLAY=:0
215 EDHELP=/home/kern/bin/ed.hlp
216 EDTRM=/home/kern/bin/ed.trm
217 EUID=1007
218 GROUPS=()
219 HISTFILE=/cygdrive/c/home/kern/.bash_history
220 HISTFILESIZE=500
221 HISTSIZE=500
222 HOME=/cygdrive/c/home/kern
223 HOMEDRIVE=C:
224 HOMEPATH='\Documents and Settings\kern'
225 HOSTNAME=Tibs
226 HOSTTYPE=i686
227 IFS=$' \t\n'
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'
231 LINES=65
232 LOGONSERVER='\\TIBS'
233 MACHTYPE=i686-pc-cygwin
234 MAILCHECK=60
235 MAKE_MODE=UNIX
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
242 OPTERR=1
243 OPTIND=1
244 OS=Windows_NT
245 OSTYPE=cygwin
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'
248 PIPESTATUS=([0]="0")
249 PPID=3864
250 PROCESSOR_ARCHITECTURE=x86
251 PROCESSOR_IDENTIFIER='x86 Family 15 Model 2 Stepping 7, GenuineIntel'
252 PROCESSOR_LEVEL=15
253 PROCESSOR_REVISION=0207
254 PROGRAMFILES='C:\Program Files'
255 PROMPT='$P$G'
256 PS1='\e[34m\]\w\[\e[0m\]$\040'
257 PS2='> '
258 PS4='+ '
259 PWD=/home/kern
260 SESSIONNAME=Console
261 SHELL=/bin/bash
262 SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
263 SHLVL=1
264 SYSTEMDRIVE=C:
265 SYSTEMROOT='C:\WINDOWS'
266 TEMP=/cygdrive/c/DOCUME~1/kern/LOCALS~1/Temp
267 TERM=xterm
268 TMP=/cygdrive/c/DOCUME~1/kern/LOCALS~1/Temp
269 UID=1007
270 USERDOMAIN=TIBS
271 USERNAME=kern
272 USERPROFILE='C:\Documents and Settings\kern'
273 WINDIR='C:\WINDOWS'
274 WINDOWID=168050736
275 WXWIN='c:\home\kern\bacula\depkgs-win32\wx'
276 _=set