]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/README.mingw32
Update README.mingw32 with Robert's notes
[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 possibly another Unix) system.
3
4 The basic directory structure you need to have is:
5
6   bacula-top                 top level directory -- any name 
7     bacula                   top level Bacula source directory -- any name
8       src
9         win32                main directory where the Windows version is built.
10
11     dekpgs-mingw32           3rd Party Dependencies
12       bin              --
13       include            |
14       lib                |
15       man                |   Created by script
16       nsis               |-- ..../bacula/src/win32/build-dependencies
17       scons              |   
18       share              |
19       src                |
20       ssl              --
21       vss
22         inc                  A copy of the Windows VSS/inc directory
23
24     cross-tools              Cross compilation tools (gcc, g++, mingw, ...)
25       binutils-mingw32 --
26       gcc-mingw32        |   Created by script
27       mingw32            |-- ..../bacula/src/win32/build-win32-cross-tools
28       mingw-utils        | 
29       source           --
30
31 One-time Setup
32 ==============
33
34 If you're reading this file you've probably already enlisted in the CVS tree or
35 extracted the contents of the source tar.  If not you need to do that first.
36
37 Once the source is on your system, change to the win32 directory
38         cd ..../bacula/src/win32
39
40 Download and build the cross compiler tools
41         ./build-win32-cross-tools
42
43 Download and build the 3rd party dependencies
44         ./build-dependencies
45
46 You need the header files from the Microsoft VSS SDK.  Unfortunately the SDK
47 can only be downloaded and installed on a Windows system.  You can find it on
48 Microsoft's web-site at:
49
50 http://www.microsoft.com/downloads/details.aspx?FamilyID=0b4f56e4-0ccc-4626-826a-ed2c4c95c871&DisplayLang=en
51
52 If that link doesn't work then go to http://www.microsoft.com and search for
53
54         "download volume shadow copy service sdk"
55
56 Normally the files will be installed in:
57
58         c:/Program Files/VSSSDK72
59
60 You only need to copy everything under the c:/Program Files/VSSSDK72/inc
61 directory into ..../depkgs-mingw32/vss/inc.
62
63 The above only needs to be done once unless we change the cross-tools 
64 or the dependencies versions.  In general, you can run the script multiple
65 times with no problem.  For it to work, you must have at a minimum the
66 following:
67
68         gcc
69         g++
70         wget
71         texinfo
72         bison
73         man2html
74
75 and possibly other packages.
76
77 Building
78 ========
79
80 Finally, to build the Microsoft Windows version of Bacula, do the following:
81
82      cd ..../bacula/src/win32
83      make
84
85 If all goes well, you will end with all the executables in the
86 ..../bacula/src/win32/release directory.
87
88 If you have an older build environment, you might do the following
89 to ensure that you pick up all the new Win32 changes:
90
91      cd <bacula>
92      make clean
93      cd src/win32
94      make clean
95      cd ../..
96      cvs update
97      cd src/win32
98      make
99
100 If one of the patches change in src/win32/patches, you shouldn't
101 need to update the cross-tools or dependencies for it to build.
102 You can new patches by doing the following (we assume the patch
103 in question is for openssl):
104
105      cd <top-level>
106      # delete openssl
107      rm -rf depkgs-mingw32/src/openssl-0.9.8b
108      cd <bacula-source>/src/win32
109      # Call script to reload/rebuild openssl
110      ./build-dependencies openssl
111
112                                      
113 Structure of the new Win32 build environment (from Robert):
114
115 I've redesigned the minw32 build somewhat, much thanks to Kern and Howard
116 for the initial work.
117  
118 For doing a build it is very simple, type make in src/win32 or whichever
119 subdirectory you are working on.  For those maintaining it, its a little
120 more complicated :-)
121  
122 Here is some documentation for the maintainers.
123  
124 The basic strategy is each makefile in the various subdirectories includes
125 Makefile.inc, defines variables and rules specific to what is being built,
126 then includes Makefile.rules which defines all the rules.
127  
128 Makefile.inc defines the locations of all the dependencies and the compiler
129 and linker flags.  It is automatically created from Makefile.inc.cross.  Any
130 changes must be made to Makefile.inc.cross not Makefile.inc or they will be
131 overwritten the next time Makefile.inc.cross is updated.  There is also a
132 file called Makefile.inc.native.  This file is used for MinGW32 running on
133 Windows.  However at this time it probably isn't useful to anyone but me
134 since the locations aren't updated automatically.
135  
136 Makefile.rules defines a bunch of macros to simplify building.  It also
137 includes all the basic rules for building objects, GUI and console
138 executables, etc.
139  
140 Makefile.template is a template for creating new Makefiles, if you are
141 creating a new directory, copy Makefile.template to Makefile in that
142 directory and edit to suit.