]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/README.mingw32
kes Add Media.Enabled flag to client backups for dotcmds.c
[bacula/bacula] / bacula / src / win32 / README.mingw32
1 This file documents building Bacula for Microsoft Windows using the
2 cross-compiler tools on a Linux or FreeBSD system (other Unix systems 
3 remain to be tested).
4
5 The basic directory structure you need to have is:
6
7   bacula-top                 top level directory -- any name 
8     bacula                   top level Bacula source directory -- any name
9       src
10         win32                main directory where the Windows version is built.
11
12     depkgs-mingw32           3rd Party Dependencies
13       bin              --
14       include            |
15       lib                |
16       man                |   Created by script
17       nsis               |-- ..../bacula/src/win32/build-depkgs-mingw32
18       scons              |   
19       share              |
20       src                |
21       ssl              --
22       vss
23         inc                  A copy of the Windows VSS/inc directory
24
25     cross-tools              Cross compilation tools (gcc, g++, mingw32, ...)
26       binutils-mingw32 --
27       gcc-mingw32        |   Created by script
28       mingw32            |-- ..../bacula/src/win32/build-win32-cross-tools
29       mingw-utils        | 
30       source           --
31
32 One-time Setup
33 ==============
34
35 If you're reading this file you've probably already enlisted in the CVS tree or
36 extracted the contents of the source tar.  If not you need to do that first.
37
38 Once the source is on your system, change to the win32 directory
39         cd ..../bacula/src/win32
40
41 Download and build the cross compiler tools
42         ./build-win32-cross-tools
43
44 Download and build the 3rd party dependencies
45         ./build-depkgs-mingw32
46
47 You need the header files from the Microsoft VSS SDK.  Unfortunately the SDK
48 can only be downloaded and installed on a Windows system.  You can find it on
49 Microsoft's web-site at:
50
51 http://www.microsoft.com/downloads/details.aspx?FamilyID=0b4f56e4-0ccc-4626-826a-ed2c4c95c871&DisplayLang=en
52
53 If that link doesn't work then go to http://www.microsoft.com and search for
54
55         "download volume shadow copy service sdk"
56
57 Normally the files will be installed in:
58
59         c:/Program Files/Microsoft/VSSSDK72
60
61 You only need to copy everything under the c:/Program Files/Microsoft/VSSSDK72/inc
62 directory into ..../depkgs-mingw32/vss/inc.
63
64 The above only needs to be done once unless we change the cross-tools 
65 or the dependencies versions.  In general, you can run the script multiple
66 times with no problem.  For it to work, you must have at a minimum the
67 following:
68
69         gcc
70         g++
71         wget
72         texinfo
73         bison
74         man2html (in man rpm on Fedora, not available on SuSE, must
75                   manually build and install)
76
77 and possibly other packages.
78
79 Building
80 ========
81
82 Finally, to build the Microsoft Windows version of Bacula, do the following:
83
84      cd ..../bacula/src/win32
85      make
86
87 If all goes well, you will end with all the executables in the
88 ..../bacula/src/win32/release directory.
89
90 If you have an older build environment, you might do the following
91 to ensure that you pick up all the new Win32 changes:
92
93      cd <bacula>
94      make clean
95      cvs update
96      cd src/win32
97      make
98
99 Building the Installer
100 ======================
101
102 The installer isn't built as part of the default rule, you need to do a make
103 in the src/win32/installer directory or type:
104
105      cd src/win32
106      make installer
107
108 This was done because building the installer takes a bit of time
109 and if you are working on the individual executables it's a pain to wait for
110 it.  If you want to build everything in one step you can always type:
111
112      cd src/win32
113      make all installer
114
115
116 Updating the 3rd party package patches
117 ====================================== 
118
119 If one of the patches change in src/win32/patches, you shouldn't
120 need to update the cross-tools or dependencies for it to build.
121 You can install new patches by doing the following (we assume the patch
122 in question is for openssl):
123
124      cd <bacula-source>/src/win32
125      ./build-depkgs-mingw32 -C openssl
126
127 NOTE: The -C means clobber.  Any local changes to the source code in 
128 the depkgs-mingw32/src directory will be lost.  The source will be 
129 reextracted from the archive and the current patches will be applied.
130
131 If you add a new subroutine or global symbol in the CATS library 
132 ================================================================= 
133 Edit src/win32/cats/bacula_cats.def and update it appropriately. 
134 The output of a link will tell you the C++ mangled subroutine name 
135 to add, and for global symbols, it is rather easy.  See the file.
136            
137
138                                      
139 Structure of the new Win32 build environment
140 ============================================
141
142 The basic strategy is each Makefile in the various subdirectories includes
143 Makefile.inc, defines variables and rules specific to what is being built,
144 then includes Makefile.rules which defines all the rules.
145  
146 Makefile.inc defines the locations of all the dependencies and the compiler
147 and linker flags.  It is automatically created from Makefile.inc.in.  Any
148 changes must be made to Makefile.inc.in not Makefile.inc or they will be
149 overwritten the next time Makefile.inc.in is updated.
150  
151 Makefile.rules defines a bunch of macros to simplify building.  It also
152 includes all the basic rules for building objects, GUI and console
153 executables, etc.
154  
155 Makefile.template is a template for creating new Makefiles, if you are
156 creating a new directory, copy Makefile.template to Makefile in that
157 directory and edit to suit.