1
2BUILD SYSTEM: Ubuntu gutsy
3STATUS: Works
4
5REQUIRE:
6 - Bacula cross compilation tool (must be able to compile bacula-fd.exe)
7 - wine (apt-get install wine)
8 - qt mingw32 distribution
9
10ORIGINAL HOWTO (french):
11http://doc.qtfr.org/post/2007/04/10/Cross-Compilation-Native-dapplication-Qt-depuis-Linux
12
13Legend:
14# comment
15$ shell command
16* tips
17
18Directory setup
19---------------
20$ cd bacula/src/win32
21$ ./build-win32-cross-tools
22$ ./build-depkgs-mingw32
23
24It will result something like :
25
26./
27|-- depkgs-mingw32
28|-- cross-tools
29`-- bacula
30
31Linux bacula setup -- Note: I believe that this is *required* before trying
32                      to build the Win32 bat.
33------------
34$ cd bacula
35$ ./configure <your-options-for Linux>
36$ cd bacula/src/win32
37$ make
38
39Make sure that bacula/src/win32/release/bacula.dll is built
40
41QT4 setup
42----------
43
44Install QT for mingw
45
46Get the mingw installation from http://trolltech.com/developer/downloads/qt/windows
47(Try to get the same version than your linux installation)
48ftp://ftp.qtsoftware.com/qt/source
49
50
51$ wine qt-win-opensource-4.3.5-mingw.exe
52 * Install under c:\Qt (no space)
53 * no worry about mingw installation
54
55$ cp -r ~/.wine/drive_c/Qt/4.3.5/src/    depkgs-mingw32/include
56$ cp -r ~/.wine/drive_c/Qt/4.3.5/include depkgs-mingw32/include/qt
57$ cp -r ~/.wine/drive_c/Qt/4.3.5/lib     depkgs-mingw32/lib/qt
58# cp ~/.wine/drive_c/Qt/4.3.5/bin/QtCore4.dll src/win32/release32
59# cp ~/.wine/drive_c/Qt/4.3.5/bin/QtGui4.dll src/win32/release32
60
61MINGW setup
62-----------
63I think this only needs to be done once ...
64
65--- cross-tools/mingw32/mingw32/include/wchar.h.org     2008-07-13 15:18:52.000000000 +0200
66+++ cross-tools/mingw32/mingw32/include/wchar.h 2008-07-12 14:47:10.000000000 +0200
67@@ -394,7 +394,7 @@
68        time_t  st_ctime;       /* Creation time */
69 };
70
71-#ifndef _NO_OLDNAMES
72+#ifdef _NO_OLDNAMES_DISABLE
73 /* NOTE: Must be the same as _stat above. */
74 struct stat
75 {
76
77Compile bat
78-----------
79
80$ cd bacula/src/qt-console
81$ export DEPKGS="directory above cross-tools and depkgs"
82$ ./make-win32 clean
83$ ./make-win32
84
85Cleanup
86-------
87$ cd bacula/src/qt-console
88$ ./make-win32 clean
89
90The bat.exe will be in src/qt-console/debug/bat.exe
91
92
93
94Run Bat on Windows
95------------------
96
97You'll need
98   zlib1.dll
99   ssleay32.dll
100   libeay32.dll
101   QtCore4.dll
102   QtGui4.dll
103   bacula.dll
104   pthreadGCE.dll
105   mingwm10.dll
106   bat.conf
107
108You can find the Qt dlls in ~/.wine/drive_c/Qt/4.3.5/bin
109
110Run Bat with wine
111-----------------
112$ cd bacula/src/qt-console/debug
113
114# configure a bat.conf
115# copy all dlls to this directory
116
117$ wine bat
118
119
120That all, easy isn't it ?
121