]> git.saurik.com Git - wxWidgets.git/blame - docs/motif/install.txt
removed wxYield from wxHtmlWindow (seems to work w/o it and yielding caused reentranc...
[wxWidgets.git] / docs / motif / install.txt
CommitLineData
fb1bd1bd 1wxWindows 2.3 for Motif installation
5de9c45c
JS
2------------------------------------
3
af111fc3
JS
4IMPORTANT NOTE:
5
6 If you experience problems installing, please re-read these
7 instructions and other related files (todo.txt, bugs.txt and
8 osname.txt for your platform if it exists) carefully before
9 mailing wxwin-users or the author. Preferably, try to fix the
10 problem first and then send a patch to the author.
11
12 When sending bug reports tell us what version of wxWindows you are
13 using (including the beta) and what compiler on what system. One
fb1bd1bd 14 example: wxMotif 2.3.0, egcs 1.1.1, Redhat 5.0
af111fc3
JS
15
16First steps
17-----------
dbda9e86 18
44c4a334
JS
19- Prerequisites: Motif 1.2 or above, or Lesstif
20 (not yet tested). Motif 2.0 and above may also be suitable.
5de9c45c 21
f6bcfd97
BP
22- Download wxMotif-x.y.z.tgz, where x.y.z is the version number.
23 Download documentation in a preferred format, such as
24 wxWindows-HTML.zip or wxWindows-PDF.zip.
5de9c45c 25
af111fc3 26- Make a directory such as ~/wx and unarchive the files into this
f6bcfd97 27 directory.
98ffbab9 28
acbd13a3
JS
29- It is recommended that you install bison and flex; using yacc
30 and lex may require tweaking of the makefiles. You also need
4417b343
VZ
31 libXpm (see comments in the Notes section below) if you want to have
32 XPM support in wxWindows (recommended).
acbd13a3 33
4417b343
VZ
34- You now have the option of using the configure-based system, or the simple
35 makefile system.
36
37 Using configure is the recommended way to build the library. If it doesn't
38 work for you for whatever reason, please report it (together with detailed
39 information about your platform and the (relevant part of) contents of
40 config.log file) to wxwin-developers@wx.dent.med.uni-muenchen.de.
acbd13a3 41
44c4a334 42COMPILING USING CONFIGURE
acbd13a3 43=========================
44c4a334 44
af111fc3
JS
45* The most simple case
46-----------------------
47
48If you compile wxWindows on Linux for the first time and don't like to read
49install instructions just do (in the base dir):
50
51> ./configure --with-motif
52> make
53> su <type root password>
54> make install
55> ldconfig
56> exit
57
58Afterwards you can continue with
59
60> make
61> su <type root password>
62> make install
63> ldconfig
64> exit
65
66If you want to remove wxWindows on Unix you can do this:
67
68> su <type root password>
69> make uninstall
70> ldconfig
71> exit
72
73* The expert case
74-----------------
75
76If you want to do some more serious cross-platform programming with wxWindows,
77such as for GTK and Motif, you can now build two complete libraries and use
78them concurretly. For this end, you have to create a directory for each build
79of wxWindows - you may also want to create different versions of wxWindows
80and test them concurrently. Most typically, this would be a version configured
81with --enable-debug_flag and one without. Note, that only one build can currently
82be installed, so you'd have to use local version of the library for that purpose.
83For building three versions (one GTK, one Motif and a debug version of the GTK
84source) you'd do this:
85
86md buildmotif
87cd buildmotif
88../configure --with-motif
89make
90cd ..
91
92md buildgtk
93cd buildgtk
94../configure --with-gtk
95make
96cd ..
97
98md buildgtkd
99cd buildgtkd
100../configure --with-gtk --enable-debug_flag
101make
102cd ..
103
104* The most simple errors
105------------------------
106
107You get errors during compilation: The reason is that you probably have a broken
108compiler, which includes almost everything that is called gcc. If you use gcc 2.8
109you have to disable optimsation as the compiler will give up with an internal
110compiler error.
111
112If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
113
114You get immediate segfault when starting any sample or application: This is either
115due to having compiled the library with different flags or options than your program -
116typically you might have the __WXDEBUG__ option set for the library but not for your
117program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
118
119* The most simple program
120-------------------------
121
122Now create your super-application myfoo.app and compile anywhere with
123
124g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
125
126* General
127-----------------------
128
129The Unix variants of wxWindows use GNU configure. If you have problems with your
130make use GNU make instead.
131
132If you have general problems with installation, read my homepage at
133
134 http://wesley.informatik.uni-freiburg.de/~wxxt
135
136for newest information. If you still don't have any success, please send a bug
137report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
138YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
139YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
140
141* GUI libraries
142-----------------------
143
144wxWindows/Motif requires the Motif library to be installed on your system. As
145an alternative, you may also use the free library "lesstif" which implements
146most of the Motif API without the licence restrictions of Motif.
147
148You can get the newest version of the Lesstif from the lesstif homepage at:
149
150 http://www.lesstif.org
151
152* Additional libraries
153-----------------------
154
155wxWindows/Motif requires a thread library and X libraries known to work with threads.
156This is the case on all commercial Unix-Variants and all Linux-Versions that are
157based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
158this, these Linux distributions have correct glibc 2 support:
159
160 - RedHat 5.1
161 - Debian 2.0
162 - Stampede
163 - DLD 6.0
164 - SuSE 6.0
165
166You can disable thread support by running
167
168./configure "--disable-threads"
169make
170su <type root password>
171make install
172ldconfig
173exit
174
ee1aaf99
JS
175NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL
176CRASH UPON START-UP! Just always use egcs and be happy.
af111fc3 177
9bb3479c
JS
178* Building wxGTK on OS/2
179--------------------------
180
181Please send comments and question about the OS/2 installation
182to Andrea Venturoli <a.ventu@flashnet.it> and patches to
183the wxWindows mailing list.
184
185You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3 or newer),
186Lesstif (0.89.1 or newer), emx (0.9d fix 1), flex (2.5.4),
187yacc (1.8), unix like shell, e.g. korn shell (5.2.13),
188Autoconf (2.13), GNU file utilities (3.6),
189GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4),
190sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
191
192Open an OS/2 prompt and switch to the directory above.
193First set some global environment variables we need:
194
195SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
196SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__
197SET OSTYPE=OS2X
198SET COMSPEC=sh
199
200Notice you can choose whatever you want, if you don't like OS2X.
201
202Now, run autoconf in the main directory and in the samples, demos
203and utils subdirectory. This will generate the OS/2 specific
204versions of the configure scripts. Now run
205 configure --with-motif
206as described above.
207
208To verify Lesstif installation, configure will try to compile a
209sample program that requires X headers/libraries to be either
210available via C_INCLUDE_PATH and LIBRARY_PATH or you need to
211explicitly set CFLAGS prior to running configure.
212
213If you have pthreads library installed, it will be autodetected
214and the library will be compiled with thread-support.
215
216Note that configure assumes your flex will generate files named
217"lexyy.c", not "lex.yy.c". If you have a version which does
218generate "lex.yy.c", you need to manually change the generated
219makefile.
220
af111fc3
JS
221* Building wxMotif on SGI
222--------------------------
223
224Using the SGI native compilers, it is recommended that you
225also set CFLAGS and CXXFLAGS before running configure. These
226should be set to :
227
228CFLAGS="-mips3 -n32"
229CXXFLAGS="-mips3 -n32"
230
231This is essential if you want to use the resultant binaries
232on any other machine than the one it was compiled on. If you
233have a 64bit machine (Octane) you should also do this to ensure
234you don't accidently build the libraries as 64bit (which is
235untested).
236
237The SGI native compiler support has only been tested on Irix 6.5.
238
239* Create your configuration
240-----------------------------
241
242Usage:
243 ./configure options
ee1aaf99 244
af111fc3 245If you want to use system's C and C++ compiler,
3a922bb4 246set environment variables CXX and CC as
af111fc3
JS
247
248 % setenv CC cc
3a922bb4 249 % setenv CXX CC
af111fc3
JS
250 % ./configure options
251
252to see all the options please use:
253
254 ./configure --help
255
256The basic philosophy is that if you want to use different
257configurations, like a debug and a release version,
258or use the same source tree on different systems,
259you have only to change the environment variable OSTYPE.
260(Sadly this variable is not set by default on some systems
261in some shells - on SGI's for example). So you will have to
262set it there. This variable HAS to be set before starting
263configure, so that it knows which system it tries to
264configure for.
265
266Configure will complain if the system variable OSTYPE has
267not been defined. And Make in some circumstances as well...
268
269
270* General options
271-------------------
272
273Given below are the commands to change the default behaviour,
274i.e. if it says "--disable-threads" it means that threads
275are enabled by default.
276
277Many of the confiugre options have been thoroughly tested
278in wxWindows snapshot 6, but not yet all (ODBC not).
279
280You have to add --with-motif on platforms, where Motif is
281not the default (on Linux, configure will deafult to GTK).
282
283 --without-gtk Don't use the GIMP ToolKit (GTK)
284
285 --with-motif Use either Motif or Lesstif
286 Configure will look for both.
287
288The following options handle the kind of library you want to build.
289
290 --disable-threads Compile without thread support. Threads
291 support is also required for the
292 socket code to work.
293
294 --disable-shared Do not create shared libraries.
295
296 --disable-optimise Do not optimise the code. Can
297 sometimes be useful for debugging
298 and is required on some architectures
299 such as Sun with gcc 2.8.X which
300 would otherwise produce segvs.
301
302 --enable-profile Add profiling info to the object
303 files. Currently broken, I think.
304
305 --enable-no_rtti Enable compilation without creation of
306 C++ RTTI information in object files.
307 This will speed-up compilation and reduce
308 binary size.
309
310 --enable-no_exceptions Enable compilation without creation of
311 C++ exception information in object files.
312 This will speed-up compilation and reduce
313 binary size. Also fewer crashes during the
314 actual compilation...
315
316 --enable-no_deps Enable compilation without creation of
317 dependency information.
318
319 --enable-permissive Enable compilation without creation of
320 giving erros as soon as you compile with
321 Solaris ANSI-defying headers...
322
323 --enable-mem_tracing Add built-in memory tracing.
324
325 --enable-dmalloc Use the dmalloc memory debugger.
326 Read more at www.letters.com/dmalloc/
327
328 --enable-debug_info Add debug info to object files and
329 executables for use with debuggers
330 such as gdb (or its many frontends).
331
332 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
333 compiling. This enable wxWindows' very
334 useful internal debugging tricks (such
335 as automatically reporting illegal calls)
336 to work. Note that program and library
337 must be compiled with the same debug
338 options.
339
340* Feature Options
341-------------------
342
343Many of the confiugre options have been thoroughly tested
344in wxWindows snapshot 6, but not yet all (ODBC not).
345
346When producing an executable that is linked statically with wxGTK
347you'll be surprised at its immense size. This can sometimes be
348drastically reduced by removing features from wxWindows that
349are not used in your program. The most relevant such features
350are
351
352 --without-libpng Disables PNG image format code.
353
354 --without-libjpeg Disables JPEG image format code.
355
9bb3479c 356{ --without-odbc Disables ODBC code. Not yet. }
af111fc3
JS
357
358 --disable-resources Disables the use of *.wxr type
359 resources.
360
361 --disable-threads Disables threads. Will also
362 disable sockets.
363
364 --disable-sockets Disables sockets.
365
366 --disable-dnd Disables Drag'n'Drop.
367
368 --disable-clipboard Disables Clipboard.
369
370 --disable-serial Disables object instance serialiasation.
371
372 --disable-streams Disables the wxStream classes.
373
374 --disable-file Disables the wxFile class.
375
376 --disable-textfile Disables the wxTextFile class.
377
378 --disable-intl Disables the internationalisation.
379
380 --disable-validators Disables validators.
381
382 --disable-accel Disables accel.
383
384Apart from disabling certain features you can very often "strip"
385the program of its debugging information resulting in a significant
386reduction in size.
387
388* Compiling
389-------------
390
391The following must be done in the base directory (e.g. ~/wxGTK
392or ~/wxWin or whatever)
393
394Now the makefiles are created (by configure) and you can compile
395the library by typing:
396
397 make
398
399make yourself some coffee, as it will take some time. On an old
400386SX possibly two weeks. During compilation, you'll get a few
401warning messages depending in your compiler.
402
403If you want to be more selective, you can change into a specific
404directiry and type "make" there.
405
406Then you may install the library and it's header files under
407/usr/local/include/wx and /usr/local/lib respectively. You
408have to log in as root (i.e. run "su" and enter the root
409password) and type
410
411 make install
412
413You can remove any traces of wxWindows by typing
414
415 make uninstall
416
417If you want to save disk space by removing unnecessary
418object-files:
419
420 make clean
421
422in the various directories will do the work for you.
423
424* Creating a new Project
425--------------------------
426
4271) The first way uses the installed libraries and header files
428automatically using wx-config
429
430g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
431
432Using this way, a make file for the minimal sample would look
433like this
434
3a922bb4 435CXX = g++
af111fc3
JS
436
437minimal: minimal.o
3a922bb4 438 $(CXX) -o minimal minimal.o `wx-config --libs`
af111fc3
JS
439
440minimal.o: minimal.cpp mondrian.xpm
3a922bb4 441 $(CXX) `wx-config --cflags` -c minimal.cpp -o minimal.o
af111fc3
JS
442
443clean:
444 rm -f *.o minimal
445
446This is certain to become the standard way unless we decide
447to sitch to tmake.
448
4492) The other way creates a project within the source code
450directories of wxWindows. For this endeavour, you'll need
451GNU autoconf version 2.14 and add an entry to your Makefile.in
452to the bottom of the configure.in script and run autoconf
453and configure before you can type make.
454
455* Further notes by Julian Smart
456---------------------------------
457
ee1aaf99
JS
458- You may find the following script useful for compiling wxMotif,
459 especially if installing from zips (which don't preserve file
460 permissions). Make this script executable with the command
8870c26e
JS
461 chmod a+x makewxmotif.
462
463 -------:x-----Cut here-----:x-----
464 # makewxmotif
465 # Sets permissions (in case we extracted wxMotif from zip files)
466 # and makes wxMotif.
467 # Call from top-level wxWindows directory.
468 # Note that this uses standard (but commonly-used) configure options;
4417b343
VZ
469 # if you're feeling brave, you may wish to compile with threads:
470 # if they're not supported by the target platform, they will be disabled
471 # anyhow
8870c26e 472 # -- Julian Smart
af111fc3
JS
473 chmod a+x configure config.sub config.guess
474 ./configure --with-shared --with-motif --without-gtk --with-debug_flag --with-debug_info --enable-debug --without-threads --without-sockets --without-odbc
44c4a334 475 make
8870c26e
JS
476 -------:x-----Cut here-----:x-----
477
af111fc3
JS
478 This script will build wxMotif using shared libraries. If you want to build
479 a static wxWindows library, use --disable-shared.
f5ee2e5f 480
44c4a334 481COMPILING USING MAKEFILES
acbd13a3 482=========================
44c4a334 483
4417b343
VZ
484- Copy the file include/wx/motif/setup0.h to include/wx/motif/setup.h and
485 edit it if you wish to enable/disable some library features
486
44c4a334
JS
487- Choose a .env file from src/makeenvs that matches your
488 environment, and copy it to src/make.env. These are the
489 settings read by wxWindows for Motif makefiles.
490
5de9c45c 491- Edit src/make.env to change options according to your local
ea57084d 492 environment. In particular, change WXDIR to where wxWindows is
5dcf05ae
JS
493 found on your system, or set the WXWIN environment variable
494 before compilation, e.g.:
495
496 export WXWIN=/home/jacs/wx2
497
5de9c45c
JS
498 Please feel free to contribute settings files for your environment.
499
500- Change directory to src/motif and type:
501
502 make -f makefile.unx motif
503
504 This should make the library libwx_motif.a in the lib
8870c26e
JS
505 directory. Note that this makefile system does not build shared
506 libraries, only static ones (that is, the wxWindows library will be
507 linked statically; to see remaining dependencies on shared libraries,
508 type e.g. ldd minimal_motif).
5de9c45c
JS
509
510- Make a sample, such as the minimal sample:
511
512 cd samples/minimal
513 make -f makefile.unx motif
514
515 and run the resulting minimal_motif binary.
516
750b78ba
JS
517Troubleshooting
518---------------
519
520- If you have trouble compiling the file y_tab.c, or have strange
521 linking errors, check whether you're using a C or C++ compiler for this file.
522 You should specify a C compiler in the CCLEX variable in src/make.env.
523 You could also try using bison and flex instead of yacc and
524 lex.
525
526- Solaris compilation with gcc: if the compiler has problems with the variable argument
4417b343
VZ
527 functions, try putting the gcc fixinclude file paths early in the include
528 path.
750b78ba 529
0492c5a0
JS
530- If you operator-related compile errors or strange memory problems
531 (for example in deletion of string arrays), set wxUSE_GLOBAL_MEMORY_OPERATORS
532 and wxUSE_MEMORY_TRACING to 0 in setup.h, and recompile.
cba2db0c 533
4417b343 534- If you get an internal compiler error in gcc, turn off optimisations.
ca5c8b2d 535
cba2db0c
JS
536- Problems with XtDestroyWidget crashing in ~wxWindow have been
537 reported on SGI IRIX 6.4. This has not yet been resolved, so
538 any advice here would be very welcome. See bugs.txt for a
0492c5a0
JS
539 possible temporary workaround (comment out the final
540 XtDestroyWidget from ~wxWindow in window.cpp).
cba2db0c 541
ad813b00
JS
542- If you use flex and bison instead of yacc and lex, you may need
543 to change the relevant part of src/motif/makefile.unx to read:
544
545 ../common/y_tab.c: ../common/parser.y
546 $(YACC) ../common/parser.y
547 mv ../common/parser.tab.c ../common/y_tab.c
548
549 (the 'mv' command needs to be changed)
550
551- Some compilers, such as Sun C++, may give a lot of warnings about
552 virtual functions being hidden. Please ignore these, it's correct C++ syntax.
553 If you find any incorrect instances, though, such as a
554 missing 'const' in an overridden function, please let us know.
555
750b78ba
JS
556Other Notes
557-----------
5de9c45c 558
4417b343
VZ
559- Debugging mode is switched on by default in the makefiles, but using
560 configure will create a release build of the library by default: it's
561 recommended to use --with-debug_info and --with-debug_flag configure
562 switches while developing your application. To compile in non-debug
8870c26e
JS
563 mode, remove the -D__WXDEBUG__ switch in make.env (or if using the
564 configure system, change --with-debug_flag to --without_debug_flag
565 and --with-debug_info to --without-debug_info in the makewxmotif
566 script).
ea57084d 567
5de9c45c
JS
568- Some classes can be switched off in include/wx/motif/setup.h,
569 if you are having trouble with a particular file. However,
570 I'd prefer you to fix the problem and send the fix to me :-) or at
571 least let me know about it.
b412f9be
JS
572
573- Thread support is switched off by default in setup.h (wxUSE_THREADS)
574 because standard Unices often do not have the necessary thread library
575 installed. Please see ../docs/gtk/install.txt for more details on this.
4417b343
VZ
576 The systems for which thread support is known to work are Linux with libc6
577 (a.k.a. glibc2), Solaris 2.5 and 2.6 (provided that X libraries are thread
578 safe) and, to some extent, FreeBSD 2.8 and 3.1 (any feedback on thread
579 support under FreeBSD as well as the systems not mentioned here would be
580 appreciated).
5de9c45c 581
2243eed5
JS
582- If you run into problems with a missing X11/Xpm.h header, you
583 need to install the XPM package. It can be obtained from:
584
585 ftp://ftp.x.org/contrib/libraries/xpm-3.4k.tar.gz
44c4a334
JS
586 http://sunfreeware.com
587
588 You may need to modify make.env to add -I and -L options pointing to where Xpm
589 is installed and possibly change bitmap.cpp to
590 include <xpm.h> instead of <X11/xpm.h>
2243eed5 591
8b9c0e20 592 Alternatively, edit include/wx/motif/setup.h, set wxUSE_XPM
2243eed5
JS
593 to 0, and recompile. You will not be able to load any XPMs,
594 though (currently the only supported colour bitmap format).
595
750b78ba
JS
596Bug reports
597-----------
598
599Please send bug reports with a description of your environment,
4417b343 600compiler and the error message(s) to the wxwin-developers mailing list at:
5de9c45c 601
4417b343 602 wxwin-developers@wx.dent.med.uni-muenchen.de
5de9c45c 603
ee1aaf99
JS
604Julian Smart, Robert Roebling and Vadim Zeitlin, November 1999.
605