]> git.saurik.com Git - wxWidgets.git/blame - docs/motif2/install.txt
wxMotif fixes and common fixes for socket compilation
[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
9If you compile wxWindows on Unix for the first time and don't like to read
10install instructions just do (in the base dir):
11
12./configure --with-motif
13make
14su <type root password>
15make install
16ldconfig
17exit
18
19If you want to remove wxWindows on Unix you can do this:
20
21su <type root password>
22make uninstall
23ldconfig
24exit
25
26* The expert case
27-----------------
28
29If you want to do some more serious cross-platform programming with wxWindows,
30such as for GTK and Motif, you can now build two complete libraries and use
31them concurretly. For this end, you have to create a directory for each build
32of wxWindows - you may also want to create different versions of wxWindows
33and test them concurrently. Most typically, this would be a version configured
34with --enable-debug_flag and one without. Note, that only one build can currently
35be installed, so you'd have to use local version of the library for that purpose.
36For building three versions (one GTK, one Motif and a debug version of the GTK
37source) you'd do this:
38
39md buildmotif
40cd buildmotif
41../configure --with-motif
42make
43cd ..
44
45md buildgtk
46cd buildgtk
47../configure --with-gtk
48make
49cd ..
50
51md buildgtkd
52cd buildgtkd
53../configure --with-gtk --enable-debug_flag
54make
55cd ..
56
57* The most simple errors
58------------------------
59
60You get errors during compilation: The reason is that you probably have a broken
61compiler, which includes almost everything that is called gcc. If you use gcc 2.8
62you have to disable optimsation as the compiler will give up with an internal
63compiler error.
64
65If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
66
67You get immediate segfault when starting any sample or application: This is either
68due to having compiled the library with different flags or options than your program -
69typically you might have the __WXDEBUG__ option set for the library but not for your
70program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
71
72* The most simple program
73-------------------------
74
75Now create your super-application myfoo.app and compile anywhere with
76
77g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
78
79* General
80-----------------------
81
82The Unix variants of wxWindows use GNU configure. If you have problems with your
83make use GNU make instead.
84
85If you have general problems with installation, read my homepage at
86
87 http://wesley.informatik.uni-freiburg.de/~wxxt
88
89for newest information. If you still don't have any success, please send a bug
90report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
91YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
92YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
93
94* GUI libraries
95-----------------------
96
97wxWindows/Motif requires the Motif library to be installed on your system. As
98an alternative, you may also use the free library "lesstif" which implements
99most of the Motif API without the licence restrictions of Motif.
100
101You 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
108wxWindows/Motif requires a thread library and X libraries known to work with threads.
109This is the case on all commercial Unix-Variants and all Linux-Versions that are
110based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
111this, 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
119You can disable thread support by running
120
121./configure "--disable-threads"
122make
123su <type root password>
124make install
125ldconfig
126exit
127
128NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
129START-UP! Just always use egcs and be happy.
130
131* Building wxMotif on SGI
132--------------------------
133
134Using the SGI native compilers, it is recommended that you
135also set CFLAGS and CXXFLAGS before running configure. These
136should be set to :
137
138CFLAGS="-mips3 -n32"
139CXXFLAGS="-mips3 -n32"
140
141This is essential if you want to use the resultant binaries
142on any other machine than the one it was compiled on. If you
143have a 64bit machine (Octane) you should also do this to ensure
144you don't accidently build the libraries as 64bit (which is
145untested).
146
147The SGI native compiler support has only been tested on Irix 6.5.
148
149* Create your configuration
150-----------------------------
151
152Usage:
153 ./configure options
154
155If you want to use system's C and C++ compiler,
156set environment variables CC and CCC as
157
158 % setenv CC cc
159 % setenv CCC CC
160 % ./configure options
161
162to see all the options please use:
163
164 ./configure --help
165
166The basic philosophy is that if you want to use different
167configurations, like a debug and a release version,
168or use the same source tree on different systems,
169you have only to change the environment variable OSTYPE.
170(Sadly this variable is not set by default on some systems
171in some shells - on SGI's for example). So you will have to
172set it there. This variable HAS to be set before starting
173configure, so that it knows which system it tries to
174configure for.
175
176Configure will complain if the system variable OSTYPE has
177not been defined. And Make in some circumstances as well...
178
179
180* General options
181-------------------
182
183Given below are the commands to change the default behaviour,
184i.e. if it says "--disable-threads" it means that threads
185are enabled by default.
186
187Many of the confiugre options have been thoroughly tested
188in wxWindows snapshot 6, but not yet all (ODBC not).
189
190You have to add --with-motif on platforms, where Motif is
191not 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
198The 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
246Many of the confiugre options have been thoroughly tested
247in wxWindows snapshot 6, but not yet all (ODBC not).
248
249When producing an executable that is linked statically with wxGTK
250you'll be surprised at its immense size. This can sometimes be
251drastically reduced by removing features from wxWindows that
252are not used in your program. The most relevant such features
253are
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
287Apart from disabling certain features you can very often "strip"
288the program of its debugging information resulting in a significant
289reduction in size.
290
291* Compiling
292-------------
293
294The following must be done in the base directory (e.g. ~/wxGTK
295or ~/wxWin or whatever)
296
297Now the makefiles are created (by configure) and you can compile
298the library by typing:
299
300 make
301
302make yourself some coffee, as it will take some time. On an old
303386SX possibly two weeks. During compilation, you'll get a few
304warning messages depending in your compiler.
305
306If you want to be more selective, you can change into a specific
307directiry and type "make" there.
308
309Then you may install the library and it's header files under
310/usr/local/include/wx and /usr/local/lib respectively. You
311have to log in as root (i.e. run "su" and enter the root
312password) and type
313
314 make install
315
316You can remove any traces of wxWindows by typing
317
318 make uninstall
319
320If you want to save disk space by removing unnecessary
321object-files:
322
323 make clean
324
325in the various directories will do the work for you.
326
327* Creating a new Project
328--------------------------
329
3301) The first way uses the installed libraries and header files
331automatically using wx-config
332
333g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
334
335Using this way, a make file for the minimal sample would look
336like this
337
338CC = g++
339
340minimal: minimal.o
341 $(CC) -o minimal minimal.o `wx-config --libs`
342
343minimal.o: minimal.cpp mondrian.xpm
344 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
345
346clean:
347 rm -f *.o minimal
348
349This is certain to become the standard way unless we decide
350to sitch to tmake.
351
3522) The other way creates a project within the source code
353directories of wxWindows. For this endeavour, you'll need
354the usual number of GNU tools, at least
355
356GNU automake version 1.4
357GNU autoheader version 2.14
358GNU autoconf version 2.14
359GNU libtool version 1.2 (1.3 seems broken)
360
361and quite possibly
362
363GNU make
364GNU C++
365
366and if you have all this then you probably know enough to
367go ahead yourself :-)
368
369----------------------
370
371In the hope that it will be useful,
372
373 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>
374
375