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