]> git.saurik.com Git - wxWidgets.git/blob - docs/motif2/install.txt
Compile fixes and typos corrected.
[wxWidgets.git] / docs / motif2 / 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: wxMotif 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-motif
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-motif --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 You get errors during compilation: The reason is that you probably have a broken
86 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
87 you have to disable optimsation as the compiler will give up with an internal
88 compiler error.
89
90 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
91
92 You get immediate segfault when starting any sample or application: This is either
93 due to having compiled the library with different flags or options than your program -
94 typically you might have the __WXDEBUG__ option set for the library but not for your
95 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
96
97 * The most simple program
98 -------------------------
99
100 Now create your super-application myfoo.app and compile anywhere with
101
102 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
103
104 * General
105 -----------------------
106
107 The Unix variants of wxWindows use GNU configure. If you have problems with your
108 make use GNU make instead.
109
110 If you have general problems with installation, read my homepage at
111
112 http://wesley.informatik.uni-freiburg.de/~wxxt
113
114 for newest information. If you still don't have any success, please send a bug
115 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
116 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
117 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
118
119 * GUI libraries
120 -----------------------
121
122 wxWindows/Motif requires the Motif library to be installed on your system. As
123 an alternative, you may also use the free library "lesstif" which implements
124 most of the Motif API without the licence restrictions of Motif.
125
126 You can get the newest version of the Lesstif from the lesstif homepage at:
127
128 http://www.lesstif.org
129
130 * Additional libraries
131 -----------------------
132
133 wxWindows/Motif requires a thread library and X libraries known to work with threads.
134 This is the case on all commercial Unix-Variants and all Linux-Versions that are
135 based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
136 this, these Linux distributions have correct glibc 2 support:
137
138 - RedHat 5.1
139 - Debian 2.0
140 - Stampede
141 - DLD 6.0
142 - SuSE 6.0
143
144 You can disable thread support by running
145
146 ./configure "--disable-threads"
147 make
148 su <type root password>
149 make install
150 ldconfig
151 exit
152
153 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
154 START-UP! Just always use egcs and be happy.
155
156 * Building wxMotif on SGI
157 --------------------------
158
159 Using the SGI native compilers, it is recommended that you
160 also set CFLAGS and CXXFLAGS before running configure. These
161 should be set to :
162
163 CFLAGS="-mips3 -n32"
164 CXXFLAGS="-mips3 -n32"
165
166 This is essential if you want to use the resultant binaries
167 on any other machine than the one it was compiled on. If you
168 have a 64bit machine (Octane) you should also do this to ensure
169 you don't accidently build the libraries as 64bit (which is
170 untested).
171
172 The SGI native compiler support has only been tested on Irix 6.5.
173
174 * Create your configuration
175 -----------------------------
176
177 Usage:
178 ./configure options
179
180 If you want to use system's C and C++ compiler,
181 set environment variables CC and CCC as
182
183 % setenv CC cc
184 % setenv CCC CC
185 % ./configure options
186
187 to see all the options please use:
188
189 ./configure --help
190
191 The basic philosophy is that if you want to use different
192 configurations, like a debug and a release version,
193 or use the same source tree on different systems,
194 you have only to change the environment variable OSTYPE.
195 (Sadly this variable is not set by default on some systems
196 in some shells - on SGI's for example). So you will have to
197 set it there. This variable HAS to be set before starting
198 configure, so that it knows which system it tries to
199 configure for.
200
201 Configure will complain if the system variable OSTYPE has
202 not been defined. And Make in some circumstances as well...
203
204
205 * General options
206 -------------------
207
208 Given below are the commands to change the default behaviour,
209 i.e. if it says "--disable-threads" it means that threads
210 are enabled by default.
211
212 Many of the confiugre options have been thoroughly tested
213 in wxWindows snapshot 6, but not yet all (ODBC not).
214
215 You have to add --with-motif on platforms, where Motif is
216 not the default (on Linux, configure will deafult to GTK).
217
218 --without-gtk Don't use the GIMP ToolKit (GTK)
219
220 --with-motif Use either Motif or Lesstif
221 Configure will look for both.
222
223 The following options handle the kind of library you want to build.
224
225 --disable-threads Compile without thread support. Threads
226 support is also required for the
227 socket code to work.
228
229 --disable-shared Do not create shared libraries.
230
231 --disable-optimise Do not optimise the code. Can
232 sometimes be useful for debugging
233 and is required on some architectures
234 such as Sun with gcc 2.8.X which
235 would otherwise produce segvs.
236
237 --enable-profile Add profiling info to the object
238 files. Currently broken, I think.
239
240 --enable-no_rtti Enable compilation without creation of
241 C++ RTTI information in object files.
242 This will speed-up compilation and reduce
243 binary size.
244
245 --enable-no_exceptions Enable compilation without creation of
246 C++ exception information in object files.
247 This will speed-up compilation and reduce
248 binary size. Also fewer crashes during the
249 actual compilation...
250
251 --enable-mem_tracing Add built-in memory tracing.
252
253 --enable-dmalloc Use the dmalloc memory debugger.
254 Read more at www.letters.com/dmalloc/
255
256 --enable-debug_info Add debug info to object files and
257 executables for use with debuggers
258 such as gdb (or its many frontends).
259
260 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
261 compiling. This enable wxWindows' very
262 useful internal debugging tricks (such
263 as automatically reporting illegal calls)
264 to work. Note that program and library
265 must be compiled with the same debug
266 options.
267
268 * Feature Options
269 -------------------
270
271 Many of the confiugre options have been thoroughly tested
272 in wxWindows snapshot 6, but not yet all (ODBC not).
273
274 When producing an executable that is linked statically with wxGTK
275 you'll be surprised at its immense size. This can sometimes be
276 drastically reduced by removing features from wxWindows that
277 are not used in your program. The most relevant such features
278 are
279
280 --without-libpng Disables PNG image format code.
281
282 --without-libjpeg Disables JPEG image format code.
283
284 { --without-odbc Disables ODBC code. Not yet. }
285
286 --disable-resources Disables the use of *.wxr type
287 resources.
288
289 --disable-threads Disables threads. Will also
290 disable sockets.
291
292 --disable-sockets Disables sockets.
293
294 --disable-dnd Disables Drag'n'Drop.
295
296 --disable-clipboard Disables Clipboard.
297
298 --disable-serial Disables object instance serialiasation.
299
300 --disable-streams Disables the wxStream classes.
301
302 --disable-file Disables the wxFile class.
303
304 --disable-textfile Disables the wxTextFile class.
305
306 --disable-intl Disables the internationalisation.
307
308 --disable-validators Disables validators.
309
310 --disable-accel Disables accel.
311
312 Apart from disabling certain features you can very often "strip"
313 the program of its debugging information resulting in a significant
314 reduction in size.
315
316 * Compiling
317 -------------
318
319 The following must be done in the base directory (e.g. ~/wxGTK
320 or ~/wxWin or whatever)
321
322 Now the makefiles are created (by configure) and you can compile
323 the library by typing:
324
325 make
326
327 make yourself some coffee, as it will take some time. On an old
328 386SX possibly two weeks. During compilation, you'll get a few
329 warning messages depending in your compiler.
330
331 If you want to be more selective, you can change into a specific
332 directiry and type "make" there.
333
334 Then you may install the library and it's header files under
335 /usr/local/include/wx and /usr/local/lib respectively. You
336 have to log in as root (i.e. run "su" and enter the root
337 password) and type
338
339 make install
340
341 You can remove any traces of wxWindows by typing
342
343 make uninstall
344
345 If you want to save disk space by removing unnecessary
346 object-files:
347
348 make clean
349
350 in the various directories will do the work for you.
351
352 * Creating a new Project
353 --------------------------
354
355 1) The first way uses the installed libraries and header files
356 automatically using wx-config
357
358 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
359
360 Using this way, a make file for the minimal sample would look
361 like this
362
363 CC = g++
364
365 minimal: minimal.o
366 $(CC) -o minimal minimal.o `wx-config --libs`
367
368 minimal.o: minimal.cpp mondrian.xpm
369 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
370
371 clean:
372 rm -f *.o minimal
373
374 This is certain to become the standard way unless we decide
375 to sitch to tmake.
376
377 2) The other way creates a project within the source code
378 directories of wxWindows. For this endeavour, you'll need
379 the usual number of GNU tools, at least
380
381 GNU automake version 1.4
382 GNU autoheader version 2.14
383 GNU autoconf version 2.14
384 GNU libtool version 1.2 (1.3 seems broken)
385
386 and quite possibly
387
388 GNU make
389 GNU C++
390
391 and if you have all this then you probably know enough to
392 go ahead yourself :-)
393
394 ----------------------
395
396 In the hope that it will be useful,
397
398 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>
399
400