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