1 This file documents building Bacula for Microsoft Windows using the
2 cross-compiler tools on a Linux (or possibly another Unix) system.
4 The basic directory structure you need to have is:
6 bacula-top top level directory -- any name
7 bacula top level Bacula source directory -- any name
9 win32 main directory where the Windows version is built.
11 dekpgs-mingw32 3rd Party Dependencies
15 man | Created by script
16 nsis |-- ..../bacula/src/win32/build-dependencies
22 inc A copy of the Windows VSS/inc directory
24 cross-tools Cross compilation tools (gcc, g++, mingw, ...)
26 gcc-mingw32 | Created by script
27 mingw32 |-- ..../bacula/src/win32/build-win32-cross-tools
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.
37 Once the source is on your system, change to the win32 directory
38 cd ..../bacula/src/win32
40 Download and build the cross compiler tools
41 ./build-win32-cross-tools
43 Download and build the 3rd party dependencies
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:
50 http://www.microsoft.com/downloads/details.aspx?FamilyID=0b4f56e4-0ccc-4626-826a-ed2c4c95c871&DisplayLang=en
52 If that link doesn't work then go to http://www.microsoft.com and search for
54 "download volume shadow copy service sdk"
56 Normally the files will be installed in:
58 c:/Program Files/Microsoft/VSSSDK72
60 You only need to copy everything under the c:/Program Files/VSSSDK72/inc
61 directory into ..../depkgs-mingw32/vss/inc.
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
73 man2html (in man rpm on Fedora, not available on SuSE, must
74 manually build and install)
76 and possibly other packages.
81 Finally, to build the Microsoft Windows version of Bacula, do the following:
83 cd ..../bacula/src/win32
86 If all goes well, you will end with all the executables in the
87 ..../bacula/src/win32/release directory.
89 If you have an older build environment, you might do the following
90 to ensure that you pick up all the new Win32 changes:
98 Building the Installer
99 ======================
101 The installer isn't built as part of the default rule, you need to do a make
102 in the src/win32/installer directory or type:
107 This was done because building the installer takes a bit of time
108 and if you are working on the individual executables it's a pain to wait for
109 it. If you want to build everything in one step you can always type:
115 Updating the 3rd party package patches
116 ======================================
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):
125 rm -rf depkgs-mingw32/src/openssl-0.9.8b
126 cd <bacula-source>/src/win32
127 # Call script to reload/rebuild openssl
128 ./build-dependencies openssl
131 Structure of the new Win32 build environment:
133 The basic strategy is each Makefile in the various subdirectories includes
134 Makefile.inc, defines variables and rules specific to what is being built,
135 then includes Makefile.rules which defines all the rules.
137 Makefile.inc defines the locations of all the dependencies and the compiler
138 and linker flags. It is automatically created from Makefile.inc.in. Any
139 changes must be made to Makefile.inc.in not Makefile.inc or they will be
140 overwritten the next time Makefile.inc.in is updated.
142 Makefile.rules defines a bunch of macros to simplify building. It also
143 includes all the basic rules for building objects, GUI and console
146 Makefile.template is a template for creating new Makefiles, if you are
147 creating a new directory, copy Makefile.template to Makefile in that
148 directory and edit to suit.