]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/README.win32
Add doc on setting up Win32 environment variable supplied
[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 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
38 Instructions if you want to build bacula-fd with VSS 
39 (Volume Shadow Copy Service) support. Note, the non-VSS build is
40 no longer supported though you may be able to get it to work by
41 copy the file src/win32/baculafd/baculanovssfd.mak into 
42 src/win32/baculafd/baculafd.mak before running the "make" command
43 below:
44
45 - VSS support works for both WinXP machines and Win 2003 machines.
46 - you need to get the VSS SDK: 
47   http://www.microsoft.com/downloads/details.aspx?FamilyID=0B4F56E4-0CCC-4626-826A-ED2C4C95C871&displaylang=en
48 - copy the 'inc' and 'lib' directories from this SDK to 
49   'bacula/src/win32/compat/vss'. Note, generally these files
50   are installed in c:/Program\ Files/Microsoft/VSSSDK71
51 - you should then have 'bacula/src/win32/compat/vss/inc' and 
52   'bacula/src/win32/compat/vss/lib'
53   both with 'Win2003' and 'WinXP' subdirectories
54 - add 'WIN32_VSS' as preprocessor directive
55 - you should get a single bacula-fd.exe that runs on all platforms and has 
56   VSS support for WinXP and 2003 enabled
57 - Once you have added the VSS SDK files as a subdirectory to the build
58   tree, follow the original instructions for building Bacula given
59   below.
60
61 To build it:
62 - For this version of Bacula, you must have msvcr71.dll
63   installed in c:/windows/system32.  The winbacula.nsi.in
64   and pebuilder Makefile.in files have this hard coded in.
65 - We are using Microsoft Visual Studio .NET 2003.
66 - Make sure nmake is on your PATH.
67 - Make sure your COMSPEC is properly setup (see full dump of
68   my cygwin environment below).
69 - Running the following command may help setup the environment
70   variables used by VC++ (I don't use this command, but it might
71   just solve your problems).
72     run "<vc++ install dir>\VC\PlatformSDK\SetEnv.Cmd"
73 - The build is done in an rxvt window under the latest version
74   of cygwin.
75 - You need the Platform SDK installed.
76 - You need Visual Studio installed.
77 - You need to load depkgs-win32, then
78     (make the two patches described below to in Nicolas' notes to wx)
79     cd depkgs-win32
80     make
81     (after building zlib and pthreads, it fails in wx)
82     cd wx
83     ./configure
84     make
85     (if it succeeds skip the next item, otherwise do it) 
86 - You may have to build wx with VC++.
87   After starting VC++, use File->Open Workspace then
88   open wx/src/wxWindows.dsw then use
89   Build->Build All or Build->build wxmsw.lib should work too.
90 - cd bacula
91   ./configure --enable-client-only
92   cd src/win32
93 - ensure that the docs are copied into docs at the bacula
94   directory level.
95   make
96
97 Here is the script that I use under cygwin to build it:
98 ==== build script =========
99 #!/bin/sh
100 cd bacula
101 mkdir -p src/win32/compat/vss
102 cp -a c:/Program\ Files/Microsoft/VSSSDK71/inc src/win32/compat/vss
103 cp -a c:/Program\ Files/Microsoft/VSSSDK71/lib src/win32/compat/vss
104 ./configure \
105   --enable-client-only \
106   --sbindir=/bacula/bin \
107   --sysconfdir=/bacula/bin \
108   --enable-smartalloc \
109   --enable-static-tools \
110   --with-working-dir=/bacula/working \
111   --with-pid-dir=/bacula/working \
112   --with-subsys-dir=/bacula/working
113 rm -rf docs
114 cp -a ../docs .
115 cd src/win32
116 make
117 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ../version.h`
118 cp -pf winbacula-$VERSION.exe k:/home/kern/bacula/winbacula-vss-$VERSION.exe
119 if test $? = 0 ; then
120   echo "winbacula-$VERSION.exe copied to k:/home/kern/bacula/winbacula-vss-$VERSION.exe"
121 else
122   echo "Build failed ..."
123 fi
124 ======== end build script ==============
125
126
127 See License.txt for the License.
128
129 The native Win32 interface code was written by:
130
131    Christopher S. Hull, February 2004
132
133
134 For more details of building wx, see depkgs-win32/wx/docs/msw/install.txt
135
136 The easiest way to build this is to have a Visual Studio .NET 2003
137 However, you can use the free Microsoft C++ compiler with a bit
138 of additional work.
139
140 Here are additional pointers on building wx-console supplied by Nicolas
141 Boichat:
142
143
144 Tools I used (I think the 3 first one are included in VStudio) :
145 - VC++ toolkit : http://msdn.microsoft.com/visualc/vctoolkit2003/
146 - Windows Platform SDK :
147    http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
148    (Core SDK and Internet Development SDK)
149 - nmake (it got it with .Net Framework SDK)
150 - lib.exe found in the SDK-base/Bin/win64 directory (works fine
151   on a 32 bit Windows).
152
153 Instructions if you want to build wx-console :
154 - wxWidgets 2.4.2 compilation
155   + In include/wx/string.h, replace line 195 by
156       #if defined(__VISUALC__) // && defined(_MT) && !defined(_DLL)
157   + In src/common/string.cpp, replace line 167 by
158       #if defined(__VISUALC__) // && defined(_MT) && !defined(_DLL)
159   + Follow the instructions in docs/msw/install.txt
160      (Visual C++ 6.0 compilation - Using makefiles)
161
162 - Make sure that the environment variables are set as:
163   - PATH includes the directories bin of both the C++ Toolkit and the SDK
164   - INCLUDE includes the directories include of both the C++ Toolkit and the SDK
165   - LIB includes the directories Lib of both the C++ Toolkit and the SDK
166     
167 - Compile bacula depkg-win32 with Visual Studio or try the
168   supplied makefiles as described in the doc. I could not
169   get this to work -- kes.
170
171 - Compile wx-console with nmake -f wx-console.mak in
172   src/win32/wx-console  I could not get this to work
173   kes.
174
175 - Additional information on using the free Micrsosoft C++ see
176   http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit
177
178 NOTE! I (Kern) cannot build wxWindows with the Makefile until after
179 I do a ./configure.  I can use VC Studio directly to do so
180 following their instructions. Open VC Studio on the project
181 file depkgs-win32/wx/src/WxWindows.vcproj.  Then build it.
182 Make sure you have selected the Release Unicode version under
183 menu->Build->Configuration Manager.  It will create the file:
184 depkgs-win32/wx/lib/wxmswu.lib. At that point, you have
185 what you need to build wx-console.
186
187 Note, the paths given below have changed now that we switched
188 to Microsoft Visual Studio .NET 2003 (VC++ 7.1).
189
190 Getting all the environment variables setup properly is not always so obvious.
191 Here is what I have when I do a "set" in a rxvt window, in which I build
192 Bacula. Probably what is important are INCLUDE, LIB, PATH, and WXWIN, but note
193 there are a zillion other things set:
194 !::='::\'
195 !C:='C:\cygwin\home\kern'
196 ALLUSERSPROFILE='C:\Documents and Settings\All Users'
197 APPDATA='C:\Documents and Settings\kern\Application Data'
198 BASEMAKE='C:\Program Files\Microsoft SDK\Include\BKOffice.Mak'
199 BASH=/usr/bin/bash
200 BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i686-pc-cygwin")
201 BASH_VERSION='2.05b.0(1)-release'
202 BKOFFICE='C:\Program Files\Microsoft SDK\.'
203 CLIENTNAME=Console
204 COLORFGBG='0;default;15'
205 COLORTERM=rxvt-xpm
206 COLUMNS=70
207 COMMONPROGRAMFILES='C:\Program Files\Common Files'
208 COMPUTERNAME=TIBS
209 COMSPEC='C:\WINDOWS\system32\cmd.exe'
210 CYGWIN=notty
211 DIRSTACK=()
212 DISPLAY=:0
213 EDHELP=/home/kern/bin/ed.hlp
214 EDTRM=/home/kern/bin/ed.trm
215 EUID=1007
216 GROUPS=()
217 HISTFILE=/cygdrive/c/home/kern/.bash_history
218 HISTFILESIZE=500
219 HISTSIZE=500
220 HOME=/cygdrive/c/home/kern
221 HOMEDRIVE=C:
222 HOMEPATH='\Documents and Settings\kern'
223 HOSTNAME=Tibs
224 HOSTTYPE=i686
225 IFS=$' \t\n'
226 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'
227 INETSDK='C:\Program Files\Microsoft SDK\.'
228 LIB='C:\Program Files\Microsoft SDK\Lib\.;C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib'
229 LINES=65
230 LOGONSERVER='\\TIBS'
231 MACHTYPE=i686-pc-cygwin
232 MAILCHECK=60
233 MAKE_MODE=UNIX
234 MOZILLA_HOME=/home/netscape
235 MSDEVDIR='C:\Program Files\Microsoft Visual Studio\Common\MSDev98'
236 MSSDK='C:\Program Files\Microsoft SDK\.'
237 MSTOOLS='C:\Program Files\Microsoft SDK\.'
238 NUMBER_OF_PROCESSORS=1
239 OLDPWD=/home/kern/bacula
240 OPTERR=1
241 OPTIND=1
242 OS=Windows_NT
243 OSTYPE=cygwin
244 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:'
245 PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
246 PIPESTATUS=([0]="0")
247 PPID=3864
248 PROCESSOR_ARCHITECTURE=x86
249 PROCESSOR_IDENTIFIER='x86 Family 15 Model 2 Stepping 7, GenuineIntel'
250 PROCESSOR_LEVEL=15
251 PROCESSOR_REVISION=0207
252 PROGRAMFILES='C:\Program Files'
253 PROMPT='$P$G'
254 PS1='\e[34m\]\w\[\e[0m\]$\040'
255 PS2='> '
256 PS4='+ '
257 PWD=/home/kern
258 SESSIONNAME=Console
259 SHELL=/bin/bash
260 SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
261 SHLVL=1
262 SYSTEMDRIVE=C:
263 SYSTEMROOT='C:\WINDOWS'
264 TEMP=/cygdrive/c/DOCUME~1/kern/LOCALS~1/Temp
265 TERM=xterm
266 TMP=/cygdrive/c/DOCUME~1/kern/LOCALS~1/Temp
267 UID=1007
268 USERDOMAIN=TIBS
269 USERNAME=kern
270 USERPROFILE='C:\Documents and Settings\kern'
271 WINDIR='C:\WINDOWS'
272 WINDOWID=168050736
273 WXWIN='c:\home\kern\bacula\depkgs-win32\wx'
274 _=set