]> git.saurik.com Git - wxWidgets.git/blame - docs/motif2/install.txt
More makefile and project fun
[wxWidgets.git] / docs / motif2 / install.txt
CommitLineData
a622c152
RR
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
9b61f868 9If you compile wxWindows on Linux for the first time and don't like to read
a622c152
RR
10install instructions just do (in the base dir):
11
9b61f868
RR
12> ./configure --with-motif
13> make
14> su <type root password>
15> make install
16> ldconfig
17> exit
18
9b61f868
RR
19Afterwards you can continue with
20
21> make
22> su <type root password>
23> make install
24> ldconfig
25> exit
4dcaf11a 26
a622c152
RR
27If you want to remove wxWindows on Unix you can do this:
28
9b61f868
RR
29> su <type root password>
30> make uninstall
31> ldconfig
32> exit
a622c152
RR
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
ea0dbf30
SN
139* Building wxGTK on OS/2
140--------------------------
141
142Please send comments and question about the OS/2 installation
143to Andrea Venturoli <a.ventu@flashnet.it> and patches to
144the wxWindows mailing list.
145
146You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3 or newer),
147Lesstif (0.89.1 or newer), emx (0.9d fix 1), flex (2.5.4),
148yacc (1.8), unix like shell, e.g. korn shell (5.2.13),
149Autoconf (2.13), GNU file utilities (3.6),
150GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4),
151sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
152
153Open an OS/2 prompt and switch to the directory above.
154First set some global environment variables we need:
155
156SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
157SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__
158SET OSTYPE=OS2X
159SET COMSPEC=sh
160
161Notice you can choose whatever you want, if you don't like OS2X.
162
163Now, run autoconf in the main directory and in the samples, demos
164and utils subdirectory. This will generate the OS/2 specific
165versions of the configure scripts. Now run
166 configure --with-motif
167as described above.
168
169To verify Lesstif installation, configure will try to compile a
170sample program that requires X headers/libraries to be either
171available via C_INCLUDE_PATH and LIBRARY_PATH or you need to
172explicitly set CFLAGS prior to running configure.
173
174If you have pthreads library installed, it will be autodetected
175and the library will be compiled with thread-support.
176
177Note that configure assumes your flex will generate files named
178"lexyy.c", not "lex.yy.c". If you have a version which does
179generate "lex.yy.c", you need to manually change the generated
180makefile.
181
a622c152
RR
182* Building wxMotif on SGI
183--------------------------
184
185Using the SGI native compilers, it is recommended that you
186also set CFLAGS and CXXFLAGS before running configure. These
187should be set to :
188
189CFLAGS="-mips3 -n32"
190CXXFLAGS="-mips3 -n32"
191
192This is essential if you want to use the resultant binaries
193on any other machine than the one it was compiled on. If you
194have a 64bit machine (Octane) you should also do this to ensure
195you don't accidently build the libraries as 64bit (which is
196untested).
197
198The SGI native compiler support has only been tested on Irix 6.5.
199
200* Create your configuration
201-----------------------------
202
203Usage:
204 ./configure options
205
206If you want to use system's C and C++ compiler,
207set environment variables CC and CCC as
208
209 % setenv CC cc
210 % setenv CCC CC
211 % ./configure options
212
213to see all the options please use:
214
215 ./configure --help
216
217The basic philosophy is that if you want to use different
218configurations, like a debug and a release version,
219or use the same source tree on different systems,
220you have only to change the environment variable OSTYPE.
221(Sadly this variable is not set by default on some systems
222in some shells - on SGI's for example). So you will have to
223set it there. This variable HAS to be set before starting
224configure, so that it knows which system it tries to
225configure for.
226
227Configure will complain if the system variable OSTYPE has
228not been defined. And Make in some circumstances as well...
229
230
231* General options
232-------------------
233
234Given below are the commands to change the default behaviour,
235i.e. if it says "--disable-threads" it means that threads
236are enabled by default.
237
238Many of the confiugre options have been thoroughly tested
239in wxWindows snapshot 6, but not yet all (ODBC not).
240
241You have to add --with-motif on platforms, where Motif is
242not the default (on Linux, configure will deafult to GTK).
243
244 --without-gtk Don't use the GIMP ToolKit (GTK)
245
246 --with-motif Use either Motif or Lesstif
247 Configure will look for both.
248
249The following options handle the kind of library you want to build.
250
251 --disable-threads Compile without thread support. Threads
252 support is also required for the
253 socket code to work.
254
255 --disable-shared Do not create shared libraries.
256
257 --disable-optimise Do not optimise the code. Can
258 sometimes be useful for debugging
259 and is required on some architectures
260 such as Sun with gcc 2.8.X which
261 would otherwise produce segvs.
262
263 --enable-profile Add profiling info to the object
264 files. Currently broken, I think.
265
266 --enable-no_rtti Enable compilation without creation of
267 C++ RTTI information in object files.
268 This will speed-up compilation and reduce
269 binary size.
270
271 --enable-no_exceptions Enable compilation without creation of
272 C++ exception information in object files.
273 This will speed-up compilation and reduce
274 binary size. Also fewer crashes during the
275 actual compilation...
276
5586805b
RR
277 --enable-no_deps Enable compilation without creation of
278 dependency information.
279
280 --enable-permissive Enable compilation without creation of
281 giving erros as soon as you compile with
282 Solaris ANSI-defying headers...
283
a622c152
RR
284 --enable-mem_tracing Add built-in memory tracing.
285
286 --enable-dmalloc Use the dmalloc memory debugger.
287 Read more at www.letters.com/dmalloc/
288
289 --enable-debug_info Add debug info to object files and
290 executables for use with debuggers
291 such as gdb (or its many frontends).
292
293 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
294 compiling. This enable wxWindows' very
295 useful internal debugging tricks (such
296 as automatically reporting illegal calls)
297 to work. Note that program and library
298 must be compiled with the same debug
299 options.
300
301* Feature Options
302-------------------
303
304Many of the confiugre options have been thoroughly tested
305in wxWindows snapshot 6, but not yet all (ODBC not).
306
307When producing an executable that is linked statically with wxGTK
308you'll be surprised at its immense size. This can sometimes be
309drastically reduced by removing features from wxWindows that
310are not used in your program. The most relevant such features
311are
312
313 --without-libpng Disables PNG image format code.
314
315 --without-libjpeg Disables JPEG image format code.
316
317{ --without-odbc Disables ODBC code. Not yet. }
318
319 --disable-resources Disables the use of *.wxr type
320 resources.
321
322 --disable-threads Disables threads. Will also
323 disable sockets.
324
325 --disable-sockets Disables sockets.
326
327 --disable-dnd Disables Drag'n'Drop.
328
329 --disable-clipboard Disables Clipboard.
330
331 --disable-serial Disables object instance serialiasation.
332
333 --disable-streams Disables the wxStream classes.
334
335 --disable-file Disables the wxFile class.
336
337 --disable-textfile Disables the wxTextFile class.
338
339 --disable-intl Disables the internationalisation.
340
341 --disable-validators Disables validators.
342
343 --disable-accel Disables accel.
344
345Apart from disabling certain features you can very often "strip"
346the program of its debugging information resulting in a significant
347reduction in size.
348
349* Compiling
350-------------
351
352The following must be done in the base directory (e.g. ~/wxGTK
353or ~/wxWin or whatever)
354
355Now the makefiles are created (by configure) and you can compile
356the library by typing:
357
358 make
359
360make yourself some coffee, as it will take some time. On an old
361386SX possibly two weeks. During compilation, you'll get a few
362warning messages depending in your compiler.
363
364If you want to be more selective, you can change into a specific
365directiry and type "make" there.
366
367Then you may install the library and it's header files under
368/usr/local/include/wx and /usr/local/lib respectively. You
369have to log in as root (i.e. run "su" and enter the root
370password) and type
371
372 make install
373
374You can remove any traces of wxWindows by typing
375
376 make uninstall
377
378If you want to save disk space by removing unnecessary
379object-files:
380
381 make clean
382
383in the various directories will do the work for you.
384
385* Creating a new Project
386--------------------------
387
3881) The first way uses the installed libraries and header files
389automatically using wx-config
390
391g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
392
393Using this way, a make file for the minimal sample would look
394like this
395
396CC = g++
397
398minimal: minimal.o
399 $(CC) -o minimal minimal.o `wx-config --libs`
400
401minimal.o: minimal.cpp mondrian.xpm
402 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
403
404clean:
405 rm -f *.o minimal
406
407This is certain to become the standard way unless we decide
408to sitch to tmake.
409
4102) The other way creates a project within the source code
411directories of wxWindows. For this endeavour, you'll need
79144b8a
RR
412GNU autoconf version 2.14 and add an entry to your Makefile.in
413to the bottom of the configure.in script and run autoconf
414and configure before you can type make.
a622c152 415
a622c152
RR
416
417----------------------
418
419In the hope that it will be useful,
420
421 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>
422
423