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