]> git.saurik.com Git - wxWidgets.git/blob - docs/gtk/install.txt
make install, make uninstall and wx-coonfig work again.
[wxWidgets.git] / docs / gtk / 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: wxGTK 2.1 beta 6, egcs 1.1.1, Redhat 5.0 !!!
5
6 * The most simple case
7 -----------------------
8
9 If you compile wxWindows on Linux for the first time and don't like to read
10 install instructions just do (in the base dir):
11
12 > ./configure --with-gtk
13 > make
14 > su <type root password>
15 > make install
16 > ldconfig
17 > exit
18
19 On all variants of Unix except Linux (and maybe except *BSD), shared libraries
20 are not supportet out of the box due to the utter stupidity of libtool, so you'll
21 have to do this to get shared library support:
22
23 > ./configure --with-gtk --disable-static --enable-shared
24
25 Then you'll have to edit the wrongly created libtool script. There are two
26 important entries with respect to shared library creation, which are
27
28 archive_cmds="\$LD -shared ....
29 archive_expsym_cmds="\$LD -shared ....
30
31 which should be something like
32
33 archive_cmds="\$CC -shared ....
34 archive_expsym_cmds="\$CC -shared ....
35
36 Afterwards you can continue with
37
38 > make
39 > su <type root password>
40 > make install
41 > ldconfig
42 > exit
43
44 If you want to remove wxWindows on Unix you can do this:
45
46 > su <type root password>
47 > make uninstall
48 > ldconfig
49 > exit
50
51 * The expert case
52 -----------------
53
54 If you want to do some more serious cross-platform programming with wxWindows,
55 such as for GTK and Motif, you can now build two complete libraries and use
56 them concurretly. For this end, you have to create a directory for each build
57 of wxWindows - you may also want to create different versions of wxWindows
58 and test them concurrently. Most typically, this would be a version configured
59 with --enable-debug_flag and one without. Note, that only one build can currently
60 be installed, so you'd have to use local version of the library for that purpose.
61 For building three versions (one GTK, one Motif and a debug version of the GTK
62 source) you'd do this:
63
64 md buildmotif
65 cd buildmotif
66 ../configure --with-motif
67 make
68 cd ..
69
70 md buildgtk
71 cd buildgtk
72 ../configure --with-gtk
73 make
74 cd ..
75
76 md buildgtkd
77 cd buildgtkd
78 ../configure --with-gtk --enable-debug_flag
79 make
80 cd ..
81
82 * The most simple errors
83 ------------------------
84
85 configure reports, that you don't have GTK 1.X installed although you are
86 very sure you have. Well, you have installed it, but you also have another
87 version of the GTK installed, which you may need to remove including other
88 versions of glib (and its headers). Also, look for the PATH variable and check
89 if it includes the path to the correct gtk-config! The check your LDPATH if it
90 points to the correct library. There is no way to compile wxGTK if configure
91 doesn't pass this test as all this test does is compile and link a GTK program.
92
93 You get errors during compilation: The reason is that you probably have a broken
94 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
95 you have to disable optimsation as the compiler will give up with an internal
96 compiler error.
97
98 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
99
100 You get immediate segfault when starting any sample or application: This is either
101 due to having compiled the library with different flags or options than your program -
102 typically you might have the __WXDEBUG__ option set for the library but not for your
103 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
104
105 * The most simple program
106 -------------------------
107
108 Now create your super-application myfoo.app and compile anywhere with
109
110 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
111
112 * General
113 -----------------------
114
115 The Unix variants of wxWindows use GNU configure. If you have problems with your
116 make use GNU make instead.
117
118 If you have general problems with installation, read my homepage at
119
120 http://wesley.informatik.uni-freiburg.de/~wxxt
121
122 for newest information. If you still don't have any success, please send a bug
123 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
124 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
125 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
126
127 * GUI libraries
128 -----------------------
129
130 wxWindows/GTK requires the GTK+ library to be installed on your system. It has to
131 be a stable version, preferebly version 1.2.3. You can use GTK 1.0 in connection
132 with wxWindows, albeit without Drag'n'Drop. wxWindows does work with the 1.1.X
133 versions of the GTK+ library.
134
135 You can get the newest version of the GTK+ from the GTK homepage at:
136
137 http://www.gtk.org
138
139 We also mirror GTK+ 1.0.6 at my ftp site. You'll find information about downloading
140 at my homepage.
141
142 * Additional libraries
143 -----------------------
144
145 wxWindows/Gtk requires a thread library and X libraries known to work with threads.
146 This is the case on all commercial Unix-Variants and all Linux-Versions that are
147 based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
148 this, these Linux distributions have correct glibc 2 support:
149
150 - RedHat 5.1
151 - Debian 2.0
152 - Stampede
153 - DLD 6.0
154 - SuSE 6.0
155
156 You can disable thread support by running
157
158 ./configure "--disable-threads"
159 make
160 su <type root password>
161 make install
162 ldconfig
163 exit
164
165 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
166 START-UP! Just always use egcs and be happy.
167
168 * Building wxGTK on OS/2
169 --------------------------
170
171 Please send comments and question about the OS/2 installation
172 to Andrea Venturoli <a.ventu@flashnet.it> and patches to
173 make the installation work (better) to me (Robert Roebling).
174
175 You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3),
176 gtk+ (?), emx (0.9d fix 1), flex (2.5.4), yacc (1.8),
177 korn shell (5.2.13), Autoconf (?), GNU file utilities (3.6),
178 GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4),
179 sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
180
181 Open an OS/2 prompt and switch to the directory above.
182 First set some global environment variables we need:
183
184 SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
185 SET OSTYPE=OS2X
186 SET COMSPEC=sh
187
188 Notice you can choose whatever you want, if you don't like OS2X.
189
190 * Building wxGTK on SGI
191 --------------------------
192
193 Using the SGI native compilers, it is recommended that you
194 also set CFLAGS and CXXFLAGS before running configure. These
195 should be set to :
196
197 CFLAGS="-mips3 -n32"
198 CXXFLAGS="-mips3 -n32"
199
200 This is essential if you want to use the resultant binaries
201 on any other machine than the one it was compiled on. If you
202 have a 64bit machine (Octane) you should also do this to ensure
203 you don't accidently build the libraries as 64bit (which is
204 untested).
205
206 The SGI native compiler support has only been tested on Irix 6.5.
207
208 * Create your configuration
209 -----------------------------
210
211 Usage:
212 ./configure options
213
214 If you want to use system's C and C++ compiler,
215 set environment variables CC and CCC as
216
217 % setenv CC cc
218 % setenv CCC CC
219 % ./configure options
220
221 to see all the options please use:
222
223 ./configure --help
224
225 The basic philosophy is that if you want to use different
226 configurations, like a debug and a release version,
227 or use the same source tree on different systems,
228 you have only to change the environment variable OSTYPE.
229 (Sadly this variable is not set by default on some systems
230 in some shells - on SGI's for example). So you will have to
231 set it there. This variable HAS to be set before starting
232 configure, so that it knows which system it tries to
233 configure for.
234
235 Configure will complain if the system variable OSTYPE has
236 not been defined. And Make in some circumstances as well...
237
238
239 * General options
240 -------------------
241
242 Given below are the commands to change the default behaviour,
243 i.e. if it says "--disable-threads" it means that threads
244 are enabled by default.
245
246 Many of the confiugre options have been thoroughly tested
247 in wxWindows snapshot 6, but not yet all (ODBC not).
248
249 Normally, you won't have to choose a toolkit, because when
250 you download wxGTK, it will default to --with-gtk etc. But
251 if you use all of our CVS repository you have to choose a
252 toolkit. You must do this by running configure with either of:
253
254 --without-gtk Don't use the GIMP ToolKit (GTK)
255
256 --with-motif Use either Motif or Lesstif
257 Configure will look for both.
258
259 The following options handle the kind of library you want to build.
260
261 --disable-threads Compile without thread support. Threads
262 support is also required for the
263 socket code to work.
264
265 --disable-shared Do not create shared libraries.
266
267 --disable-optimise Do not optimise the code. Can
268 sometimes be useful for debugging
269 and is required on some architectures
270 such as Sun with gcc 2.8.X which
271 would otherwise produce segvs.
272
273 --enable-profile Add profiling info to the object
274 files. Currently broken, I think.
275
276 --enable-no_rtti Enable compilation without creation of
277 C++ RTTI information in object files.
278 This will speed-up compilation and reduce
279 binary size.
280
281 --enable-no_exceptions Enable compilation without creation of
282 C++ exception information in object files.
283 This will speed-up compilation and reduce
284 binary size. Also fewer crashes during the
285 actual compilation...
286
287 --enable-mem_tracing Add built-in memory tracing.
288
289 --enable-dmalloc Use the dmalloc memory debugger.
290 Read more at www.letters.com/dmalloc/
291
292 --enable-debug_info Add debug info to object files and
293 executables for use with debuggers
294 such as gdb (or its many frontends).
295
296 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
297 compiling. This enable wxWindows' very
298 useful internal debugging tricks (such
299 as automatically reporting illegal calls)
300 to work. Note that program and library
301 must be compiled with the same debug
302 options.
303
304 * Feature Options
305 -------------------
306
307 Many of the confiugre options have been thoroughly tested
308 in wxWindows snapshot 6, but not yet all (ODBC not).
309
310 When producing an executable that is linked statically with wxGTK
311 you'll be surprised at its immense size. This can sometimes be
312 drastically reduced by removing features from wxWindows that
313 are not used in your program. The most relevant such features
314 are
315
316 --without-libpng Disables PNG image format code.
317
318 --without-libjpeg Disables JPEG image format code.
319
320 { --without-odbc Disables ODBC code. Not yet. }
321
322 --disable-resources Disables the use of *.wxr type
323 resources.
324
325 --disable-threads Disables threads. Will also
326 disable sockets.
327
328 --disable-sockets Disables sockets.
329
330 --disable-dnd Disables Drag'n'Drop.
331
332 --disable-clipboard Disables Clipboard.
333
334 --disable-serial Disables object instance serialiasation.
335
336 --disable-streams Disables the wxStream classes.
337
338 --disable-file Disables the wxFile class.
339
340 --disable-textfile Disables the wxTextFile class.
341
342 --disable-intl Disables the internationalisation.
343
344 --disable-validators Disables validators.
345
346 --disable-accel Disables accel.
347
348 Apart from disabling certain features you can very often "strip"
349 the program of its debugging information resulting in a significant
350 reduction in size.
351
352 * Compiling
353 -------------
354
355 The following must be done in the base directory (e.g. ~/wxGTK
356 or ~/wxWin or whatever)
357
358 Now the makefiles are created (by configure) and you can compile
359 the library by typing:
360
361 make
362
363 make yourself some coffee, as it will take some time. On an old
364 386SX possibly two weeks. During compilation, you'll get a few
365 warning messages depending in your compiler.
366
367 If you want to be more selective, you can change into a specific
368 directiry and type "make" there.
369
370 Then you may install the library and it's header files under
371 /usr/local/include/wx and /usr/local/lib respectively. You
372 have to log in as root (i.e. run "su" and enter the root
373 password) and type
374
375 make install
376
377 You can remove any traces of wxWindows by typing
378
379 make uninstall
380
381 If you want to save disk space by removing unnecessary
382 object-files:
383
384 make clean
385
386 in the various directories will do the work for you.
387
388 * Creating a new Project
389 --------------------------
390
391 1) The first way uses the installed libraries and header files
392 automatically using wx-config
393
394 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
395
396 Using this way, a make file for the minimal sample would look
397 like this
398
399 CC = g++
400
401 minimal: minimal.o
402 $(CC) -o minimal minimal.o `wx-config --libs`
403
404 minimal.o: minimal.cpp mondrian.xpm
405 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
406
407 clean:
408 rm -f *.o minimal
409
410 This is certain to become the standard way unless we decide
411 to sitch to tmake.
412
413 2) The other way creates a project within the source code
414 directories of wxWindows. For this endeavour, you'll need
415 the usual number of GNU tools, at least
416
417 GNU automake version 1.4
418 GNU autoheader version 2.14
419 GNU autoconf version 2.14
420 GNU libtool version 1.3
421
422 and quite possibly
423
424 GNU make
425 GNU C++
426
427 and if you have all this then you probably know enough to
428 go ahead yourself :-)
429
430 ----------------------
431
432 In the hope that it will be useful,
433
434 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>
435
436