]>
Commit | Line | Data |
---|---|---|
f53561f1 | 1 | |
f53561f1 RR |
2 | * The most simple case |
3 | ----------------------- | |
4 | ||
fc2171bd | 5 | If you compile wxWidgets on Linux for the first time and don't like to read |
f53561f1 RR |
6 | install 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 | ||
15 | On all variants of Unix except Linux (and maybe except *BSD), shared libraries | |
2edb0bde | 16 | are not supported out of the box due to the utter stupidity of libtool, so you'll |
9b61f868 RR |
17 | have to do this to get shared library support: |
18 | ||
9eb6cc3d | 19 | > ./configure --with-wine --disable-unicode --disable-static --enable-shared |
9b61f868 RR |
20 | |
21 | Then you'll have to edit the wrongly created libtool script. There are two | |
22 | important entries with respect to shared library creation, which are | |
23 | ||
24 | archive_cmds="\$LD -shared .... | |
25 | archive_expsym_cmds="\$LD -shared .... | |
26 | ||
27 | which should be something like | |
28 | ||
29 | archive_cmds="\$CC -shared .... | |
30 | archive_expsym_cmds="\$CC -shared .... | |
31 | ||
32 | Afterwards you can continue with | |
33 | ||
34 | > make | |
35 | > su <type root password> | |
36 | > make install | |
37 | > ldconfig | |
38 | > exit | |
f53561f1 | 39 | |
fc2171bd | 40 | If 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 | 50 | If you want to do some more serious cross-platform programming with wxWidgets, |
f53561f1 | 51 | such as for GTK and Motif, you can now build two complete libraries and use |
2edb0bde | 52 | them concurrently. For this end, you have to create a directory for each build |
fc2171bd | 53 | of wxWidgets - you may also want to create different versions of wxWidgets |
f53561f1 RR |
54 | and test them concurrently. Most typically, this would be a version configured |
55 | with --enable-debug_flag and one without. Note, that only one build can currently | |
56 | be installed, so you'd have to use local version of the library for that purpose. | |
57 | For building three versions (one GTK, one WINE and a debug version of the WINE | |
58 | source) you'd do this: | |
59 | ||
60 | md buildmotif | |
61 | cd buildmotif | |
62 | ../configure --with-motif | |
63 | make | |
64 | cd .. | |
65 | ||
66 | md buildwine | |
67 | cd buildwine | |
68 | ../configure --with-wine | |
69 | make | |
70 | cd .. | |
71 | ||
72 | md buildwined | |
73 | cd buildwined | |
74 | ../configure --with-wine --enable-debug_flag | |
75 | make | |
76 | cd .. | |
77 | ||
78 | * The most simple errors | |
79 | ------------------------ | |
80 | ||
81 | wxWINE doesn't work yet as WINE isn't really up to the task yet. | |
82 | ||
83 | You get errors during compilation: The reason is that you probably have a broken | |
84 | compiler, which includes almost everything that is called gcc. If you use gcc 2.8 | |
2edb0bde | 85 | you have to disable optimisation as the compiler will give up with an internal |
f53561f1 RR |
86 | compiler error. |
87 | ||
88 | If there is just any way for you to use egcs, use egcs. We cannot fix gcc. | |
89 | ||
90 | You get immediate segfault when starting any sample or application: This is either | |
91 | due to having compiled the library with different flags or options than your program - | |
92 | typically you might have the __WXDEBUG__ option set for the library but not for your | |
93 | program - or due to using a broken compiler (and its optimisation) such as GCC 2.8. | |
94 | ||
95 | * The most simple program | |
96 | ------------------------- | |
97 | ||
98 | Now create your super-application myfoo.app and compile anywhere with | |
99 | ||
100 | g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo | |
101 | ||
102 | * General | |
103 | ----------------------- | |
104 | ||
fc2171bd | 105 | The Unix variants of wxWidgets use GNU configure. If you have problems with your |
f53561f1 RR |
106 | make use GNU make instead. |
107 | ||
108 | If you have general problems with installation, read my homepage at | |
109 | ||
110 | http://wesley.informatik.uni-freiburg.de/~wxxt | |
111 | ||
112 | for newest information. If you still don't have any success, please send a bug | |
113 | report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF | |
114 | YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF WINE, WXWINE, WHAT DISTRIBUTION | |
115 | YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried... | |
116 | ||
117 | * GUI libraries | |
118 | ----------------------- | |
119 | ||
fc2171bd | 120 | wxWidgets/WINE requires the WINE library to be installed on your system. |
f53561f1 RR |
121 | |
122 | You 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 | ||
129 | Usage: | |
70373b5a | 130 | ./configure options |
f53561f1 RR |
131 | |
132 | If you want to use system's C and C++ compiler, | |
133 | set environment variables CC and CCC as | |
134 | ||
70373b5a JS |
135 | % setenv CC cc |
136 | % setenv CCC CC | |
137 | % ./configure options | |
f53561f1 RR |
138 | |
139 | to see all the options please use: | |
140 | ||
70373b5a | 141 | ./configure --help |
f53561f1 RR |
142 | |
143 | The basic philosophy is that if you want to use different | |
144 | configurations, like a debug and a release version, | |
145 | or use the same source tree on different systems, | |
146 | you have only to change the environment variable OSTYPE. | |
147 | (Sadly this variable is not set by default on some systems | |
148 | in some shells - on SGI's for example). So you will have to | |
149 | set it there. This variable HAS to be set before starting | |
150 | configure, so that it knows which system it tries to | |
151 | configure for. | |
152 | ||
153 | Configure will complain if the system variable OSTYPE has | |
154 | not been defined. And Make in some circumstances as well... | |
155 | ||
156 | ||
157 | * General options | |
158 | ------------------- | |
159 | ||
160 | Given below are the commands to change the default behaviour, | |
161 | i.e. if it says "--disable-threads" it means that threads | |
162 | are enabled by default. | |
163 | ||
2edb0bde | 164 | Many of the configure options have been thoroughly tested |
fc2171bd | 165 | in wxWidgets snapshot 6, but not yet all (ODBC not). |
f53561f1 RR |
166 | |
167 | You must do this by running configure with either of: | |
168 | ||
70373b5a JS |
169 | --with-wine Use the WINE library |
170 | ||
f53561f1 RR |
171 | The 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 | 219 | Many of the configure options have been thoroughly tested |
fc2171bd | 220 | in wxWidgets snapshot 6, but not yet all (ODBC not). |
f53561f1 RR |
221 | |
222 | When producing an executable that is linked statically with wxGTK | |
223 | you'll be surprised at its immense size. This can sometimes be | |
fc2171bd | 224 | drastically reduced by removing features from wxWidgets that |
f53561f1 RR |
225 | are not used in your program. The most relevant such features |
226 | are | |
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 |
260 | Apart from disabling certain features you can very often "strip" |
261 | the program of its debugging information resulting in a significant | |
262 | reduction in size. | |
263 | ||
264 | * Compiling | |
265 | ------------- | |
266 | ||
267 | The following must be done in the base directory (e.g. ~/wxGTK | |
268 | or ~/wxWin or whatever) | |
269 | ||
270 | Now the makefiles are created (by configure) and you can compile | |
271 | the library by typing: | |
272 | ||
70373b5a | 273 | make |
f53561f1 RR |
274 | |
275 | make yourself some coffee, as it will take some time. On an old | |
276 | 386SX possibly two weeks. During compilation, you'll get a few | |
277 | warning messages depending in your compiler. | |
278 | ||
279 | If you want to be more selective, you can change into a specific | |
2edb0bde | 280 | directory and type "make" there. |
f53561f1 | 281 | |
2edb0bde | 282 | Then you may install the library and its header files under |
f53561f1 RR |
283 | /usr/local/include/wx and /usr/local/lib respectively. You |
284 | have to log in as root (i.e. run "su" and enter the root | |
285 | password) and type | |
286 | ||
70373b5a | 287 | make install |
f53561f1 | 288 | |
fc2171bd | 289 | You can remove any traces of wxWidgets by typing |
f53561f1 RR |
290 | |
291 | make uninstall | |
70373b5a | 292 | |
f53561f1 RR |
293 | If you want to save disk space by removing unnecessary |
294 | object-files: | |
295 | ||
70373b5a | 296 | make clean |
f53561f1 RR |
297 | |
298 | in the various directories will do the work for you. | |
299 | ||
300 | * Creating a new Project | |
301 | -------------------------- | |
302 | ||
303 | 1) The first way uses the installed libraries and header files | |
304 | automatically using wx-config | |
305 | ||
306 | g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo | |
307 | ||
308 | Using this way, a make file for the minimal sample would look | |
309 | like this | |
310 | ||
3cb332c1 | 311 | CXX = g++ |
f53561f1 RR |
312 | |
313 | minimal: minimal.o | |
3cb332c1 | 314 | $(CXX) -o minimal minimal.o `wx-config --libs` |
f53561f1 | 315 | |
3cb332c1 VZ |
316 | minimal.o: minimal.cpp |
317 | $(CXX) `wx-config --cflags` -c minimal.cpp -o minimal.o | |
f53561f1 RR |
318 | |
319 | clean: | |
70373b5a | 320 | rm -f *.o minimal |
f53561f1 RR |
321 | |
322 | This is certain to become the standard way unless we decide | |
2edb0bde | 323 | to stick to tmake. |
f53561f1 RR |
324 | |
325 | 2) The other way creates a project within the source code | |
fc2171bd | 326 | directories of wxWidgets. For this endeavour, you'll need |
f53561f1 RR |
327 | the usual number of GNU tools, at least |
328 | ||
329 | GNU automake version 1.4 | |
330 | GNU autoheader version 2.14 | |
331 | GNU autoconf version 2.14 | |
332 | GNU libtool version 1.3 | |
333 | ||
334 | and quite possibly | |
335 | ||
336 | GNU make | |
337 | GNU C++ | |
338 | ||
339 | and if you have all this then you probably know enough to | |
340 | go ahead yourself :-) | |
341 | ||
342 | ---------------------- | |
343 | ||
344 | In the hope that it will be useful, | |
345 | ||
346 | Robert Roebling <roebling@sun2.ruf.uni-freiburg.de> | |
70373b5a JS |
347 | |
348 | ||
349 | Addition notes by Julian Smart, August 2002 | |
350 | =========================================== | |
351 | ||
352 | I've fixed some compile errors, and got as far as | |
353 | compiling wxWINE, but actually linking a sample will take | |
354 | further work. | |
355 | ||
356 | To compile wxWINE, export these variables: | |
357 | ||
358 | export CPPFLAGS=-I/usr/local/include/wine | |
359 | export LDFLAGS=-L/usr/local/lib/wine | |
360 | ||
361 | and configure with: | |
362 | ||
363 | configure --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 | ||
369 | Compiling a sample won't work yet because 'winebuild' needs | |
370 | to be called, and the resuling C file compiled and linked. | |
371 | Plus, Windows DLLs need to be imported. | |
372 | ||
373 | Note that the documentation on the WINE web site on using | |
374 | winebuild is out of date (August 2002) -- the spec file no | |
375 | longer supports import and type keywords. Instead look at | |
376 | samples in the WINE 'programs' directory for inspiration | |
377 | and compile options to use. It's probable that the | |
378 | wxWINE library will need recompiling with different options. | |
379 | ||
380 | Any progress on this front will be very welcome. | |
381 | ||
9eb6cc3d | 382 | Note that while wxWINE builds with --enable-unicode, samples |
471a67a7 | 383 | don't run. Some samples will run when built with |
9eb6cc3d JS |
384 | --disable-unicode, and others (such as auidemo) fail. |
385 |