2 This file documents the tools (scripts) we use for building
3 Bacula for Microsoft Windows using the cross-compiler tools on a
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
14 The basic directory structure you need to have is:
16 bacula-top top level directory -- any name
17 bacula top level Bacula source directory -- any name
19 win32 main directory where the Windows version is built.
21 depkgs-mingw32 3rd Party Dependencies
25 man | Created by script
26 nsis |-- ..../bacula/src/win32/build-depkgs-mingw32
32 inc A copy of the Windows VSS/inc directory
34 cross-tools Cross compilation tools (gcc, g++, mingw32, ...)
36 gcc-mingw32 | Created by script
37 mingw32 |-- ..../bacula/src/win32/build-win32-cross-tools
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.
47 Once the source is on your system, change to the win32 directory
48 cd ..../bacula/src/win32
50 Download and build the cross compiler tools
51 ./build-win32-cross-tools
53 Download and build the 3rd party dependencies
54 ./build-depkgs-mingw32
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:
60 http://www.microsoft.com/downloads/details.aspx?FamilyID=0b4f56e4-0ccc-4626-826a-ed2c4c95c871&DisplayLang=en
62 If that link doesn't work then go to http://www.microsoft.com and search for
64 "download volume shadow copy service sdk"
66 Normally the files will be installed in:
68 c:/Program Files/Microsoft/VSSSDK72
70 You only need to copy everything under the c:/Program Files/Microsoft/VSSSDK72/inc
71 directory into ..../depkgs-mingw32/vss/inc.
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
83 man2html (in man rpm on Fedora, not available on SuSE, must
84 manually build and install)
86 and possibly other packages.
91 Finally, to build the Microsoft Windows version of Bacula, do the following:
93 cd ..../bacula/src/win32
96 If all goes well, you will end with all the executables in the
97 ..../bacula/src/win32/release directory.
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:
108 Building the Installer
109 ======================
111 The installer is now build as part of the default rule when you
112 say "make" in the src/win32 directory.
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):
123 cd <bacula-source>/src/win32
124 ./build-depkgs-mingw32 -C openssl
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.
130 If you add a new subroutine 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.
138 Structure of the new Win32 build environment
139 ============================================
141 The basic strategy is each Makefile in the various subdirectories includes
142 Makefile.inc, defines variables and rules specific to what is being built,
143 then includes Makefile.rules which defines all the rules.
145 Makefile.inc defines the locations of all the dependencies and the compiler
146 and linker flags. It is automatically created from Makefile.inc.in. Any
147 changes must be made to Makefile.inc.in not Makefile.inc or they will be
148 overwritten the next time Makefile.inc.in is updated.
150 Makefile.rules defines a bunch of macros to simplify building. It also
151 includes all the basic rules for building objects, GUI and console
154 Makefile.template is a template for creating new Makefiles, if you are
155 creating a new directory, copy Makefile.template to Makefile in that
156 directory and edit to suit.