]> git.saurik.com Git - wxWidgets.git/blame - docs/motif/install.txt
compilation fix
[wxWidgets.git] / docs / motif / install.txt
CommitLineData
5de9c45c
JS
1wxWindows 2.0 for Motif installation
2------------------------------------
3
4417b343 4IMPORTANT NOTE: If you experience problems installing, please re-read this
8b9c0e20
VZ
5 instructions and other related files (todo.txt, bugs.txt and
6 osname.txt for your platform if it exists) carefully before
7 mailing wxwin-users or the author. Preferably, try to fix the
8 problem first and then send a patch to the author.
dbda9e86 9
44c4a334
JS
10- Prerequisites: Motif 1.2 or above, or Lesstif
11 (not yet tested). Motif 2.0 and above may also be suitable.
5de9c45c
JS
12
13- Download the files wx200gen.zip and wx200mot.zip, and
14 documentation in a preferred format, such as wx200htm.zip
15 or wx200pdf.zip.
16
17- Make a directory such as ~/wx and unzip the files into this
18 directory. Use the -a option if available to convert the ASCII
19 files to Unix format. Don't worry about files being
20 overwritten: they should be identical anyway.
21
98ffbab9
JS
22 (See http://www.cdrom.com/pub/infozip/ if you don't have zip/unzip
23 already installed. Zip isn't the same as gzip!)
24
acbd13a3
JS
25- It is recommended that you install bison and flex; using yacc
26 and lex may require tweaking of the makefiles. You also need
4417b343
VZ
27 libXpm (see comments in the Notes section below) if you want to have
28 XPM support in wxWindows (recommended).
acbd13a3 29
4417b343
VZ
30- You now have the option of using the configure-based system, or the simple
31 makefile system.
32
33 Using configure is the recommended way to build the library. If it doesn't
34 work for you for whatever reason, please report it (together with detailed
35 information about your platform and the (relevant part of) contents of
36 config.log file) to wxwin-developers@wx.dent.med.uni-muenchen.de.
acbd13a3 37
44c4a334 38COMPILING USING CONFIGURE
acbd13a3 39=========================
44c4a334
JS
40
41- You can use the wxGTK configure system to make wxMotif, or
42 you can follow the following steps to use the simpler (but
43 less automatic) makefile system. If using configure, the
44 following script should make the library and samples, when
8870c26e
JS
45 run from the top-level wxWindows directory (see also 'makewxmotif'
46 in this directory). Make this script executable with the command
47 chmod a+x makewxmotif.
48
49 -------:x-----Cut here-----:x-----
50 # makewxmotif
51 # Sets permissions (in case we extracted wxMotif from zip files)
52 # and makes wxMotif.
53 # Call from top-level wxWindows directory.
54 # Note that this uses standard (but commonly-used) configure options;
4417b343
VZ
55 # if you're feeling brave, you may wish to compile with threads:
56 # if they're not supported by the target platform, they will be disabled
57 # anyhow
8870c26e
JS
58 # -- Julian Smart
59 chmod a+x configure config.sub config.guess setup/general/* setup/shared/*
60 ./configure --with-shared --with-motif --without-gtk --with-debug_flag --with-debug_info --without-threads
44c4a334 61 make
8870c26e
JS
62 -------:x-----Cut here-----:x-----
63
64 This script will build wxMotif using shared libraries.
65
66- Change directory to a sample e.g. samples/minimal, and type make.
67 The binary will end up under the Linux (or other appropriate) subdirectory.
68
69- To build an application outside the wxWindows hierarchy, you can
70 use `wx-config --cflags` when compiling source files and `wx-config --libs`
71 when linking, where wx-config is in the wxWindows root directory.
72 These invocations return the appropriate flags for the compiler.
73
74- When compiling certain utilities such as Dialog Editor, you may find
75 that the makefile refers to wx-config as above. Unless you have used
76 "make install" to install wxWindows, wx-config won't be found, so
77 either edit the makefile to hard-wire the flags, or place wx-config
4417b343
VZ
78 where it will be found by the makefile, or add the directory where you have
79 installed wxWindows to your PATH.
44c4a334 80
f5ee2e5f
JS
81- If switching between wxMotif and wxGTK, you should remove the
82 config.cache file manually before running configure again.
83
44c4a334 84COMPILING USING MAKEFILES
acbd13a3 85=========================
44c4a334 86
4417b343
VZ
87- Copy the file include/wx/motif/setup0.h to include/wx/motif/setup.h and
88 edit it if you wish to enable/disable some library features
89
44c4a334
JS
90- Choose a .env file from src/makeenvs that matches your
91 environment, and copy it to src/make.env. These are the
92 settings read by wxWindows for Motif makefiles.
93
5de9c45c 94- Edit src/make.env to change options according to your local
ea57084d 95 environment. In particular, change WXDIR to where wxWindows is
5dcf05ae
JS
96 found on your system, or set the WXWIN environment variable
97 before compilation, e.g.:
98
99 export WXWIN=/home/jacs/wx2
100
5de9c45c
JS
101 Please feel free to contribute settings files for your environment.
102
103- Change directory to src/motif and type:
104
105 make -f makefile.unx motif
106
107 This should make the library libwx_motif.a in the lib
8870c26e
JS
108 directory. Note that this makefile system does not build shared
109 libraries, only static ones (that is, the wxWindows library will be
110 linked statically; to see remaining dependencies on shared libraries,
111 type e.g. ldd minimal_motif).
5de9c45c
JS
112
113- Make a sample, such as the minimal sample:
114
115 cd samples/minimal
116 make -f makefile.unx motif
117
118 and run the resulting minimal_motif binary.
119
750b78ba
JS
120Troubleshooting
121---------------
122
123- If you have trouble compiling the file y_tab.c, or have strange
124 linking errors, check whether you're using a C or C++ compiler for this file.
125 You should specify a C compiler in the CCLEX variable in src/make.env.
126 You could also try using bison and flex instead of yacc and
127 lex.
128
129- Solaris compilation with gcc: if the compiler has problems with the variable argument
4417b343
VZ
130 functions, try putting the gcc fixinclude file paths early in the include
131 path.
750b78ba 132
0492c5a0
JS
133- If you operator-related compile errors or strange memory problems
134 (for example in deletion of string arrays), set wxUSE_GLOBAL_MEMORY_OPERATORS
135 and wxUSE_MEMORY_TRACING to 0 in setup.h, and recompile.
cba2db0c 136
4417b343 137- If you get an internal compiler error in gcc, turn off optimisations.
ca5c8b2d 138
cba2db0c
JS
139- Problems with XtDestroyWidget crashing in ~wxWindow have been
140 reported on SGI IRIX 6.4. This has not yet been resolved, so
141 any advice here would be very welcome. See bugs.txt for a
0492c5a0
JS
142 possible temporary workaround (comment out the final
143 XtDestroyWidget from ~wxWindow in window.cpp).
cba2db0c 144
ad813b00
JS
145- If you use flex and bison instead of yacc and lex, you may need
146 to change the relevant part of src/motif/makefile.unx to read:
147
148 ../common/y_tab.c: ../common/parser.y
149 $(YACC) ../common/parser.y
150 mv ../common/parser.tab.c ../common/y_tab.c
151
152 (the 'mv' command needs to be changed)
153
154- Some compilers, such as Sun C++, may give a lot of warnings about
155 virtual functions being hidden. Please ignore these, it's correct C++ syntax.
156 If you find any incorrect instances, though, such as a
157 missing 'const' in an overridden function, please let us know.
158
750b78ba
JS
159Other Notes
160-----------
5de9c45c
JS
161
162- Better installation and makefile systems are
8870c26e 163 required. A revised configure system is in preparation.
5de9c45c 164
4417b343
VZ
165- Debugging mode is switched on by default in the makefiles, but using
166 configure will create a release build of the library by default: it's
167 recommended to use --with-debug_info and --with-debug_flag configure
168 switches while developing your application. To compile in non-debug
8870c26e
JS
169 mode, remove the -D__WXDEBUG__ switch in make.env (or if using the
170 configure system, change --with-debug_flag to --without_debug_flag
171 and --with-debug_info to --without-debug_info in the makewxmotif
172 script).
ea57084d 173
5de9c45c
JS
174- Some classes can be switched off in include/wx/motif/setup.h,
175 if you are having trouble with a particular file. However,
176 I'd prefer you to fix the problem and send the fix to me :-) or at
177 least let me know about it.
b412f9be
JS
178
179- Thread support is switched off by default in setup.h (wxUSE_THREADS)
180 because standard Unices often do not have the necessary thread library
181 installed. Please see ../docs/gtk/install.txt for more details on this.
4417b343
VZ
182 The systems for which thread support is known to work are Linux with libc6
183 (a.k.a. glibc2), Solaris 2.5 and 2.6 (provided that X libraries are thread
184 safe) and, to some extent, FreeBSD 2.8 and 3.1 (any feedback on thread
185 support under FreeBSD as well as the systems not mentioned here would be
186 appreciated).
5de9c45c 187
2243eed5
JS
188- If you run into problems with a missing X11/Xpm.h header, you
189 need to install the XPM package. It can be obtained from:
190
191 ftp://ftp.x.org/contrib/libraries/xpm-3.4k.tar.gz
44c4a334
JS
192 http://sunfreeware.com
193
194 You may need to modify make.env to add -I and -L options pointing to where Xpm
195 is installed and possibly change bitmap.cpp to
196 include <xpm.h> instead of <X11/xpm.h>
2243eed5 197
8b9c0e20 198 Alternatively, edit include/wx/motif/setup.h, set wxUSE_XPM
2243eed5
JS
199 to 0, and recompile. You will not be able to load any XPMs,
200 though (currently the only supported colour bitmap format).
201
750b78ba
JS
202Bug reports
203-----------
204
205Please send bug reports with a description of your environment,
4417b343 206compiler and the error message(s) to the wxwin-developers mailing list at:
5de9c45c 207
4417b343 208 wxwin-developers@wx.dent.med.uni-muenchen.de
5de9c45c 209
cba2db0c 210Julian Smart, February 1999.
ea57084d 211julian.smart@ukonline.co.uk