]> git.saurik.com Git - wxWidgets.git/blob - docs/wine/install.txt
Support for new native OS/2 tree control.
[wxWidgets.git] / docs / wine / install.txt
1
2 !!! When sending bug reports tell us what version of wxWindows you are
3 using (including the beta) and what compiler on what system. One
4 example: wxWINE 2.1 snapshot 6, egcs 1.1.1, Redhat 5.0 !!!
5
6 * Preparing WINE
7 ----------------
8
9 Most C++ compilers cannot compile the WINE sources yet (this includes
10 all versions of g++ and egcs) so you have to make a minimal change
11 and recompile all of WINE in order to get anywhere.
12
13 (Note: this information may be out of date now. See notes at
14 the bottom of this file.)
15
16 This change has do be applied to the /include/windef.h file, line 59
17 in the section "Calling convention definitions", where the sources
18 reads:
19
20 #if __i386__
21
22 which has to be changed into
23
24 #if 0
25
26 After this change, you'll have to recompile all of WINE without
27 forgetting to install it. The direct consequence of this change
28 is that the Win32 binary emulator won't work anymore, as the
29 change disables the Windows native calling convention.
30
31 * The most simple case
32 -----------------------
33
34 If you compile wxWindows on Linux for the first time and don't like to read
35 install instructions just do (in the base dir):
36
37 > ./configure --with-wine
38 > make
39 > su <type root password>
40 > make install
41 > ldconfig
42 > exit
43
44 On all variants of Unix except Linux (and maybe except *BSD), shared libraries
45 are not supported out of the box due to the utter stupidity of libtool, so you'll
46 have to do this to get shared library support:
47
48 > ./configure --with-wine --disable-static --enable-shared
49
50 Then you'll have to edit the wrongly created libtool script. There are two
51 important entries with respect to shared library creation, which are
52
53 archive_cmds="\$LD -shared ....
54 archive_expsym_cmds="\$LD -shared ....
55
56 which should be something like
57
58 archive_cmds="\$CC -shared ....
59 archive_expsym_cmds="\$CC -shared ....
60
61 Afterwards you can continue with
62
63 > make
64 > su <type root password>
65 > make install
66 > ldconfig
67 > exit
68
69 If you want to remove wxWindows on Unix you can do this:
70
71 > su <type root password>
72 > make uninstall
73 > ldconfig
74 > exit
75
76 * The expert case
77 -----------------
78
79 If you want to do some more serious cross-platform programming with wxWindows,
80 such as for GTK and Motif, you can now build two complete libraries and use
81 them concurrently. For this end, you have to create a directory for each build
82 of wxWindows - you may also want to create different versions of wxWindows
83 and test them concurrently. Most typically, this would be a version configured
84 with --enable-debug_flag and one without. Note, that only one build can currently
85 be installed, so you'd have to use local version of the library for that purpose.
86 For building three versions (one GTK, one WINE and a debug version of the WINE
87 source) you'd do this:
88
89 md buildmotif
90 cd buildmotif
91 ../configure --with-motif
92 make
93 cd ..
94
95 md buildwine
96 cd buildwine
97 ../configure --with-wine
98 make
99 cd ..
100
101 md buildwined
102 cd buildwined
103 ../configure --with-wine --enable-debug_flag
104 make
105 cd ..
106
107 * The most simple errors
108 ------------------------
109
110 wxWINE doesn't work yet as WINE isn't really up to the task yet.
111
112 You get errors during compilation: The reason is that you probably have a broken
113 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
114 you have to disable optimisation as the compiler will give up with an internal
115 compiler error.
116
117 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
118
119 You get immediate segfault when starting any sample or application: This is either
120 due to having compiled the library with different flags or options than your program -
121 typically you might have the __WXDEBUG__ option set for the library but not for your
122 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
123
124 * The most simple program
125 -------------------------
126
127 Now create your super-application myfoo.app and compile anywhere with
128
129 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
130
131 * General
132 -----------------------
133
134 The Unix variants of wxWindows use GNU configure. If you have problems with your
135 make use GNU make instead.
136
137 If you have general problems with installation, read my homepage at
138
139 http://wesley.informatik.uni-freiburg.de/~wxxt
140
141 for newest information. If you still don't have any success, please send a bug
142 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
143 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF WINE, WXWINE, WHAT DISTRIBUTION
144 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
145
146 * GUI libraries
147 -----------------------
148
149 wxWindows/WINE requires the WINE library to be installed on your system.
150
151 You can get the newest version of the WINE from the WINE homepage at:
152
153 http://www.winehq.com
154
155 * Create your configuration
156 -----------------------------
157
158 Usage:
159 ./configure options
160
161 If you want to use system's C and C++ compiler,
162 set environment variables CC and CCC as
163
164 % setenv CC cc
165 % setenv CCC CC
166 % ./configure options
167
168 to see all the options please use:
169
170 ./configure --help
171
172 The basic philosophy is that if you want to use different
173 configurations, like a debug and a release version,
174 or use the same source tree on different systems,
175 you have only to change the environment variable OSTYPE.
176 (Sadly this variable is not set by default on some systems
177 in some shells - on SGI's for example). So you will have to
178 set it there. This variable HAS to be set before starting
179 configure, so that it knows which system it tries to
180 configure for.
181
182 Configure will complain if the system variable OSTYPE has
183 not been defined. And Make in some circumstances as well...
184
185
186 * General options
187 -------------------
188
189 Given below are the commands to change the default behaviour,
190 i.e. if it says "--disable-threads" it means that threads
191 are enabled by default.
192
193 Many of the configure options have been thoroughly tested
194 in wxWindows snapshot 6, but not yet all (ODBC not).
195
196 You must do this by running configure with either of:
197
198 --with-wine Use the WINE library
199
200 The following options handle the kind of library you want to build.
201
202 --enable-threads Compile with thread support. Threads
203 support is also required for the
204 socket code to work.
205
206 --disable-shared Do not create shared libraries.
207
208 --disable-optimise Do not optimise the code. Can
209 sometimes be useful for debugging
210 and is required on some architectures
211 such as Sun with gcc 2.8.X which
212 would otherwise produce segvs.
213
214 --enable-profile Add profiling info to the object
215 files. Currently broken, I think.
216
217 --enable-no_rtti Enable compilation without creation of
218 C++ RTTI information in object files.
219 This will speed-up compilation and reduce
220 binary size.
221
222 --enable-no_exceptions Enable compilation without creation of
223 C++ exception information in object files.
224 This will speed-up compilation and reduce
225 binary size. Also fewer crashes during the
226 actual compilation...
227
228 --enable-mem_tracing Add built-in memory tracing.
229
230 --enable-dmalloc Use the dmalloc memory debugger.
231 Read more at www.letters.com/dmalloc/
232
233 --enable-debug_info Add debug info to object files and
234 executables for use with debuggers
235 such as gdb (or its many frontends).
236
237 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
238 compiling. This enable wxWindows' very
239 useful internal debugging tricks (such
240 as automatically reporting illegal calls)
241 to work. Note that program and library
242 must be compiled with the same debug
243 options.
244
245 * Feature Options
246 -------------------
247
248 Many of the configure options have been thoroughly tested
249 in wxWindows snapshot 6, but not yet all (ODBC not).
250
251 When producing an executable that is linked statically with wxGTK
252 you'll be surprised at its immense size. This can sometimes be
253 drastically reduced by removing features from wxWindows that
254 are not used in your program. The most relevant such features
255 are
256
257 --without-libpng Disables PNG image format code.
258
259 --without-libjpeg Disables JPEG image format code.
260
261 { --without-odbc Disables ODBC code. Not yet. }
262
263 --disable-resources Disables the use of *.wxr type
264 resources.
265
266 --disable-threads Disables threads. Will also
267 disable sockets.
268
269 --disable-sockets Disables sockets.
270
271 --disable-dnd Disables Drag'n'Drop.
272
273 --disable-clipboard Disables Clipboard.
274
275 --disable-serial Disables object instance serialisation.
276
277 --disable-streams Disables the wxStream classes.
278
279 --disable-file Disables the wxFile class.
280
281 --disable-textfile Disables the wxTextFile class.
282
283 --disable-intl Disables the internationalisation.
284
285 --disable-validators Disables validators.
286
287 --disable-accel Disables accel.
288
289 Apart from disabling certain features you can very often "strip"
290 the program of its debugging information resulting in a significant
291 reduction in size.
292
293 * Compiling
294 -------------
295
296 The following must be done in the base directory (e.g. ~/wxGTK
297 or ~/wxWin or whatever)
298
299 Now the makefiles are created (by configure) and you can compile
300 the library by typing:
301
302 make
303
304 make yourself some coffee, as it will take some time. On an old
305 386SX possibly two weeks. During compilation, you'll get a few
306 warning messages depending in your compiler.
307
308 If you want to be more selective, you can change into a specific
309 directory and type "make" there.
310
311 Then you may install the library and its header files under
312 /usr/local/include/wx and /usr/local/lib respectively. You
313 have to log in as root (i.e. run "su" and enter the root
314 password) and type
315
316 make install
317
318 You can remove any traces of wxWindows by typing
319
320 make uninstall
321
322 If you want to save disk space by removing unnecessary
323 object-files:
324
325 make clean
326
327 in the various directories will do the work for you.
328
329 * Creating a new Project
330 --------------------------
331
332 1) The first way uses the installed libraries and header files
333 automatically using wx-config
334
335 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
336
337 Using this way, a make file for the minimal sample would look
338 like this
339
340 CC = g++
341
342 minimal: minimal.o
343 $(CC) -o minimal minimal.o `wx-config --libs`
344
345 minimal.o: minimal.cpp mondrian.xpm
346 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
347
348 clean:
349 rm -f *.o minimal
350
351 This is certain to become the standard way unless we decide
352 to stick to tmake.
353
354 2) The other way creates a project within the source code
355 directories of wxWindows. For this endeavour, you'll need
356 the usual number of GNU tools, at least
357
358 GNU automake version 1.4
359 GNU autoheader version 2.14
360 GNU autoconf version 2.14
361 GNU libtool version 1.3
362
363 and quite possibly
364
365 GNU make
366 GNU C++
367
368 and if you have all this then you probably know enough to
369 go ahead yourself :-)
370
371 ----------------------
372
373 In the hope that it will be useful,
374
375 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>
376
377
378 Addition notes by Julian Smart, August 2002
379 ===========================================
380
381 I've fixed some compile errors, and got as far as
382 compiling wxWINE, but actually linking a sample will take
383 further work.
384
385 To compile wxWINE, export these variables:
386
387 export CPPFLAGS=-I/usr/local/include/wine
388 export LDFLAGS=-L/usr/local/lib/wine
389
390 and configure with:
391
392 configure --disable-static --enable-shared --enable-gui \
393 --with-wine --without-libpng --enable-debug_flag --enable-log \
394 --enable-debug_info --enable-ole --enable-clipboard --enable-dataobj \
395 --enable-debug --enable-threads --disable-sockets \
396 --with-libjpeg --enable-debug_cntxt
397
398 Compiling a sample won't work yet because 'winebuild' needs
399 to be called, and the resuling C file compiled and linked.
400 Plus, Windows DLLs need to be imported.
401
402 Note that the documentation on the WINE web site on using
403 winebuild is out of date (August 2002) -- the spec file no
404 longer supports import and type keywords. Instead look at
405 samples in the WINE 'programs' directory for inspiration
406 and compile options to use. It's probable that the
407 wxWINE library will need recompiling with different options.
408
409 Any progress on this front will be very welcome.
410