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