]> git.saurik.com Git - wxWidgets.git/blame - install/unix/INSTALL
Added IRIX compile fixes
[wxWidgets.git] / install / unix / INSTALL
CommitLineData
a1a2adef
RR
1* General
2----------
3
4The Unix variants of wxWindows use GNU configure. If you have problems
5with your make use GNU make instead.
6
cd53f341
RR
7Read my homepage at
8
9 http://www.freiburg.linux.de/~wxxt
10
11for newest information.
12
a1a2adef
RR
13* GUI libraries
14-----------------------
15
16wxWindows requires a GUI toolkit to be installed. Does that make
17sense? So far only the GTK is supported, but we hope to provide
18the choice between GTK, Qt, Motif/Lesstif in the not so distant
19future.
20
21You can get the newest version of the GTK from the GTK homepage
22at
23 http://www.gtk.org
24
25The newest versin of Qt can be downloaded for free from the Trolltec's
26site at
27 http://www.troll.no
28
29Lesstif can be downloaded from their site
30at
31 http://www.lesstif.org
32
33If you want to develop using Motif, you need to buy it, unless it comes
34with your operating system such as all commercial Unices, as well as
35RedHat's, SuSe's and probably other's Linux Motif editions.
36
37* Additional libraries
38-----------------------
39
40There will be a few more features of wxWindows, which will
41require further libraries (on some platforms). These
42features will be optional. I hope to teach configure
43to check that out automatically.
44
45Thread support:
46
47 Requires pthreads under Linux with glibc 2. pthreads are
48 always present on such systems, so just compile, unless
49 you have RedHat 5.0, which has a broken combination of
50 glibc 2 and X. In this case, you have to run configure
51 with "--without-threads".
52
53 Requires PCthreads under Linux with libc 5. If you
54 haven't installed pcthreads, there will be no thread
55 support in wxWindows, but the library will compile.
56
57 Requires Posix threads on commercial Unix system,
58 which are always present. Just compile.
59
60 Requires SGI threads on IRIX, which are always present.
61 Just compile.
62
63Python scripting language support:
64
65 Requires Python. Soon to come.
66
67* Other things to do
68-----------------------------
69
70wxGTK and wxMotif/wxLesstif require the built-in
71ImLib/GdkImlib to be configured. For that purpose
72copy the two files from /misc/imlib to your
cd53f341
RR
73home directory and rename "imrc" -> ".imrc".
74You may also edit imrc by hand as you like.
75The palette file is required when using
a1a2adef
RR
76wxWindows in 256-colour mode.
77
78If you want to use wxWindows's ODBC support, you'll have
79to create a .odbc.ini file. The readme file in
80~/src/iodbc tells you what to do.
81
82
83* Create your configuration
84-----------------------------
85
86This must be done in /install/unix
87
88Usage:
89 ./configure options
90
91If you want to use system's C and C++ compiler,
92set environment variables CC and CCC as
93
94 % setenv CC cc
95 % setenv CCC CC
96 % ./configure options
97
98to see all the options please use:
99
100 ./configure --help
101
102The basic philosophy is that if you want to use different
103configurations, like a debug and a release version,
104or use the same source tree on different systems,
105you have only to change the environment variable OSTYPE.
106(Sadly this variable is not set by default on some systems
107in some shells - on SGI's for example). So you will have to
108set it there. This variable HAS to be set before starting
109configure, so that it knows which system it tries to
110configure for.
111
112Configure will complain if the system variable OSTYPE has
113not been defined. And Make in some circumstances as well...
114
115* General options
116-------------------
117
118Obviously, you have to choose a toolkit. You must do this by
119running configure with either of
120
121 --with-gtk Use the GIMP ToolKit (GTK)
122
123 --with-qt Use Qt from TrollTec
124
125 --with-motif Use either Motif or Lesstif
126 Configure will look for both.
127
128The following options handle the kind of library you want to build.
129
cd53f341
RR
130 --without-threads Compile without thread support.
131
a1a2adef
RR
132 --with-shared Create shared libraries.
133
134 --without-optimise Do not optimise the code.
135
ff7b1510
RR
136 --with-profile Add profiling info to the object
137 files. Currently broken, I think.
a1a2adef 138
ff7b1510
RR
139 --with-mem_tracing Add built-in memory tracing.
140 This doesn't work well with gcc.
a1a2adef 141
ff7b1510
RR
142 --with-dmalloc Use the dmalloc memory debugger.
143 Read more at www.letters.com/dmalloc/
144
145 --with-debug_info Add debug info to object files and
146 executables.
a1a2adef
RR
147
148 --with-debug_flag Define __DEBUG__ and __WXDEBUG__ when
149 compiling.
150
151* Feature Options
152-------------------
153
154When using the Windows version of wxWindows, it is possible
155to edit the file /include/wx/msw/setup.h in order to enable
156or disable some features of wxWindows so that the resulting
157binaries get smaller.
158
159As I don't yet care for binary size and target mainly at
160producing a shared library, wxWindows's configure system auto-
161matically enables all features, as long as they are already
162implemented.
163
164* Compiling
165-------------
166
167The following must be done in the base directory (e.g. ~/wxGTK
168or ~/wxWin)
169
170First you have to create all makefiles in all subdirectories:
171
172 make Makefiles
173
174Dependencies are generated automatically using
175
176 make depend
177
cd53f341 178(For some reason, this doesn't seem to work completely.)
a1a2adef
RR
179
180Now the makefiles are created you can compile everything is as simple
181as typing:
182
183 make
184
185make yourself some coffee, as it will try to compile
186ALL the files in this distribution.
187
188if you want to be more selective:
189
190 make src will build only the base libraries
191 make utils will build the utils
192 make samples will build the samples
193 make other will build the other samples
194 make user will build the files in the directory other
195
196Depending on the configuration of some files, the libraries
197and binaries will be placed in different directories.
198The "global" binaries and libraries will be placed in:
199
200 bin/$(OSTYPE) and
201 lib/$(OSTYPE) respectively
202
203"local" binaries and libraries will be placed in:
204
205 (basedir of that application)/$(OSTYPE).
206
207This is also the place where all the object-files will go.
208
209If you want to conserve disk space by removing unnecessary
210object-files:
211
212 make clean_obj
213
214will do the work for you.
215
216* Creating a new Project
217--------------------------
218
219I propose to put all contributed programs in the directory
220"~/wxWin/user", with a directory of its own.
221
222This directory then should include the following files:
223
224Makefile (You can copy this one from any application in samples
225 probably you will not need to edit this one. There is
226 only one case where you might be interested in changing
227 this file, but about that see later.)
228Makefile.in (This is the base application-Makefile template, from
229 which the actual Makefile for each system is created.
230 More about this later)
231
232put ALL your source code along with all the other stuff you need for
233your application in this directory (subdirectories are welcome).
234
235** Something about Makefiles
236------------------------------
237
238On general principle it should only contain ONE line, which is as follows:
239
240 include ../../src/unix/setup/general/makeapp
241
242this will include all the necessary definitions for creating the applications
243
244the only case where you might want to add another line is the following:
245this version of configure also supports creation of source archives of the
246application for easy distribution and updates to newer version of wxWindows.
247 For this purpose all files in the application-directory will be put into
248a gziped tar-file in the full notation user/<your application>/*
249if you want to include some other files that you want "more visible", like
250a README.<yourApp> or a shell script for easy
251compilation/installation/distribution, then you have to add a variable
252
253 DISTRIBUTE_ADDITIONAL=<your files>
254
255to the Makefile.
256So it would look like this:
257
258 DISTRIBUTE_ADDITIONAL=README.TheApp
259 include ../../src/unix/setup/general/makeapp
260
261As we have already talked about distribution the command to create a
262distribution is:
263
264 make distrib
265
266NOTE: If you are in the base directory of wxWindows it will create
267distribution packages for wxWindows as well as for all packages in the
268user directory.
269 So if you want to create only packages for the files in user,
270then go to the directory other and type:
271
272 make distrib
273
274or if you only want one application to be created then
275enter the specific directory and type there:
276make distrib
277
278All the distribution files will be put in the directory
279distrib at the base of the wxWindows-tree (where also configure
280and template.mak can be found).
281
282** Something about Makefile.in
283--------------------------------
284
285As you have already seen with Makefile, configure makes a lot of use
286if the include statement in make to keep the Makefiles as simple as
287possible.
288
289So basically there are only variables to define and then a include command.
290Exception to this rule is if you have special rules for some stuff...
291These rules should go AFTER the include statement!!!
292
293so the general header looks like this:
294
295 # wxWindows base directory
296 WXBASEDIR=@WXBASEDIR@
297 # set the OS type for compilation
298 OS=@OS@
299 # compile a library only
300 RULE=bin
301
302and the general footer will look like this:
303
304 # include the definitions now
305 include ../../../template.mak
306
307the key variable is RULE, which defines what make should create
308in this directory.
309
310here are some examples:
311
312 RULE description
313 ===========================================================================
314 bin creates a local binary (for a global binary prefix bin with g)
315 additional variables needed:
316 BIN_TARGET this gives the name of your application
317 BIN_OBJ this gives the object files needed to
318 link the application
319 optional variables are:
320 BIN_SRC this gives the list of c/c++ files for
321 which dependencies will be checked.
322 (This can be achieved with: make depend)
323 BIN_LINK this gives commands for additional
324 libraries needed to link the application
325 ---------------------------------------------------------------------------
326 bin2 creates two local binaries (for global binaries prefix bin2 with g)
327 in addition to the variables specified above you MUST also
328 provide the same variables with BIN2_ instead of BIN_
329 ---------------------------------------------------------------------------
330 lib creates a local library (for a global binary prefix bin with g)
331 additional variables needed:
332 LIB_TARGET this gives the name of your library
333 LIB_OBJ this gives the object files needed for
334 the library to be build.
335 optional variables are:
336 LIB_SRC this gives the list of c/c++ files for
337 which dependencies will be checked.
338 libbin and libgbin are also possible and will need in addition
339 the variables from bin
340 ---------------------------------------------------------------------------
341 gslib is similar to lib, but it creates a shared library if the system
342 supports it.
343 additional variables needed:
344 LIB_MAJOR major number of the shared library
345 LIB_MINOR minor number of the shared library
346 ---------------------------------------------------------------------------
347 other additional variables:
348
349 ADD_COMPILE define additional includes/defines that
350 are needed to compile the object files
351 (if you need to reference some directory
352 utils - like wxGrid -, then please
353 reference them with the variables defined
354 in template.mak - e.g.: $(SRCDIR),$(UTILS),
355 $(SAMPLES),$(OTHERS))
356
357 NEEDED_DEFINES lists all the defines that HAVE to be set in
358 /include/wx/setup.h to compile correctly.
359
360 SRC_DIR lists all directories that are needed to
361 compile. (i.e: lists all the directories,
362 where there are source-files.) But it is
363 also needed to clean an object and for
364 machines, for which make does not support
365 VPATH
366
367currently there are the following compiling rules provided:
368object files are created for the following file extensions:
369.c .cc .cpp
370
371Please have a closer look at the Makefiles in this distribution.
372
373* Platforms configure is working with
374---------------------------------------
375
376Please report build succes on any machine. Especially non-
377Linux operating systems (which I don't have).
378
379Original author of the autoconf system for wxxt-1.66 and for this INSTALL
380file:
381
382 Martin Sperl sperl@dsn.ast.univie.ac.at
383
384Ported to wxGTK 0.1:
385
386 Wolfram Gloger wmglo@dent.med.uni-muenchen.de
387
388Thanks alot to both of them.
389
390In the hope that it will be useful,
391
392 Robert Roebling roebling@sun2.ruf.uni-freiburg.de
393
394