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