]> git.saurik.com Git - wxWidgets.git/blame - install/unix/INSTALL
General tidy-up (mainly typecasts) to allow the use of the SGI native
[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
c67daf87
UR
60 On SGI Irix we first look for sprocs, then pthreads and
61 use the last one found.
a1a2adef
RR
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
c67daf87
UR
98Using the SGI native compilers, it is recommended that you
99also set CFLAGS and CXXFLAGS before running configure. These
100should be set to :
101
102CFLAGS="-mips3 -n32"
103CXXFLAGS="-mips3 -n32"
104
105This is essential if you want to use the resultant binaries
106on any other machine than the one it was compiled on. If you
107have a 64bit machine (Octane) you should also do this to ensure
108you don't accidently build the libraries as 64bit (which is
109untested).
110
111The SGI native compiler support has only been tested on Irix 6.5.
112
a1a2adef
RR
113to see all the options please use:
114
115 ./configure --help
116
117The basic philosophy is that if you want to use different
118configurations, like a debug and a release version,
119or use the same source tree on different systems,
120you have only to change the environment variable OSTYPE.
121(Sadly this variable is not set by default on some systems
122in some shells - on SGI's for example). So you will have to
123set it there. This variable HAS to be set before starting
124configure, so that it knows which system it tries to
125configure for.
126
127Configure will complain if the system variable OSTYPE has
128not been defined. And Make in some circumstances as well...
129
c67daf87 130
a1a2adef
RR
131* General options
132-------------------
133
134Obviously, you have to choose a toolkit. You must do this by
135running configure with either of
136
137 --with-gtk Use the GIMP ToolKit (GTK)
138
139 --with-qt Use Qt from TrollTec
140
141 --with-motif Use either Motif or Lesstif
142 Configure will look for both.
143
144The following options handle the kind of library you want to build.
145
cd53f341
RR
146 --without-threads Compile without thread support.
147
a1a2adef
RR
148 --with-shared Create shared libraries.
149
150 --without-optimise Do not optimise the code.
151
ff7b1510
RR
152 --with-profile Add profiling info to the object
153 files. Currently broken, I think.
a1a2adef 154
ff7b1510
RR
155 --with-mem_tracing Add built-in memory tracing.
156 This doesn't work well with gcc.
a1a2adef 157
ff7b1510
RR
158 --with-dmalloc Use the dmalloc memory debugger.
159 Read more at www.letters.com/dmalloc/
160
161 --with-debug_info Add debug info to object files and
162 executables.
a1a2adef
RR
163
164 --with-debug_flag Define __DEBUG__ and __WXDEBUG__ when
165 compiling.
166
167* Feature Options
168-------------------
169
170When using the Windows version of wxWindows, it is possible
171to edit the file /include/wx/msw/setup.h in order to enable
172or disable some features of wxWindows so that the resulting
173binaries get smaller.
174
175As I don't yet care for binary size and target mainly at
176producing a shared library, wxWindows's configure system auto-
177matically enables all features, as long as they are already
178implemented.
179
180* Compiling
181-------------
182
183The following must be done in the base directory (e.g. ~/wxGTK
184or ~/wxWin)
185
186First you have to create all makefiles in all subdirectories:
187
188 make Makefiles
189
190Dependencies are generated automatically using
191
192 make depend
193
cd53f341 194(For some reason, this doesn't seem to work completely.)
a1a2adef
RR
195
196Now the makefiles are created you can compile everything is as simple
197as typing:
198
199 make
200
201make yourself some coffee, as it will try to compile
202ALL the files in this distribution.
203
204if you want to be more selective:
205
206 make src will build only the base libraries
207 make utils will build the utils
208 make samples will build the samples
209 make other will build the other samples
210 make user will build the files in the directory other
211
212Depending on the configuration of some files, the libraries
213and binaries will be placed in different directories.
214The "global" binaries and libraries will be placed in:
215
216 bin/$(OSTYPE) and
217 lib/$(OSTYPE) respectively
218
219"local" binaries and libraries will be placed in:
220
221 (basedir of that application)/$(OSTYPE).
222
223This is also the place where all the object-files will go.
224
225If you want to conserve disk space by removing unnecessary
226object-files:
227
228 make clean_obj
229
230will do the work for you.
231
232* Creating a new Project
233--------------------------
234
235I propose to put all contributed programs in the directory
236"~/wxWin/user", with a directory of its own.
237
238This directory then should include the following files:
239
240Makefile (You can copy this one from any application in samples
241 probably you will not need to edit this one. There is
242 only one case where you might be interested in changing
243 this file, but about that see later.)
244Makefile.in (This is the base application-Makefile template, from
245 which the actual Makefile for each system is created.
246 More about this later)
247
248put ALL your source code along with all the other stuff you need for
249your application in this directory (subdirectories are welcome).
250
251** Something about Makefiles
252------------------------------
253
254On general principle it should only contain ONE line, which is as follows:
255
256 include ../../src/unix/setup/general/makeapp
257
258this will include all the necessary definitions for creating the applications
259
260the only case where you might want to add another line is the following:
261this version of configure also supports creation of source archives of the
262application for easy distribution and updates to newer version of wxWindows.
263 For this purpose all files in the application-directory will be put into
264a gziped tar-file in the full notation user/<your application>/*
265if you want to include some other files that you want "more visible", like
266a README.<yourApp> or a shell script for easy
267compilation/installation/distribution, then you have to add a variable
268
269 DISTRIBUTE_ADDITIONAL=<your files>
270
271to the Makefile.
272So it would look like this:
273
274 DISTRIBUTE_ADDITIONAL=README.TheApp
275 include ../../src/unix/setup/general/makeapp
276
277As we have already talked about distribution the command to create a
278distribution is:
279
280 make distrib
281
282NOTE: If you are in the base directory of wxWindows it will create
283distribution packages for wxWindows as well as for all packages in the
284user directory.
285 So if you want to create only packages for the files in user,
286then go to the directory other and type:
287
288 make distrib
289
290or if you only want one application to be created then
291enter the specific directory and type there:
292make distrib
293
294All the distribution files will be put in the directory
295distrib at the base of the wxWindows-tree (where also configure
296and template.mak can be found).
297
298** Something about Makefile.in
299--------------------------------
300
301As you have already seen with Makefile, configure makes a lot of use
302if the include statement in make to keep the Makefiles as simple as
303possible.
304
305So basically there are only variables to define and then a include command.
306Exception to this rule is if you have special rules for some stuff...
307These rules should go AFTER the include statement!!!
308
309so the general header looks like this:
310
311 # wxWindows base directory
312 WXBASEDIR=@WXBASEDIR@
313 # set the OS type for compilation
314 OS=@OS@
315 # compile a library only
316 RULE=bin
317
318and the general footer will look like this:
319
320 # include the definitions now
321 include ../../../template.mak
322
323the key variable is RULE, which defines what make should create
324in this directory.
325
326here are some examples:
327
328 RULE description
329 ===========================================================================
330 bin creates a local binary (for a global binary prefix bin with g)
331 additional variables needed:
332 BIN_TARGET this gives the name of your application
333 BIN_OBJ this gives the object files needed to
334 link the application
335 optional variables are:
336 BIN_SRC this gives the list of c/c++ files for
337 which dependencies will be checked.
338 (This can be achieved with: make depend)
339 BIN_LINK this gives commands for additional
340 libraries needed to link the application
341 ---------------------------------------------------------------------------
342 bin2 creates two local binaries (for global binaries prefix bin2 with g)
343 in addition to the variables specified above you MUST also
344 provide the same variables with BIN2_ instead of BIN_
345 ---------------------------------------------------------------------------
346 lib creates a local library (for a global binary prefix bin with g)
347 additional variables needed:
348 LIB_TARGET this gives the name of your library
349 LIB_OBJ this gives the object files needed for
350 the library to be build.
351 optional variables are:
352 LIB_SRC this gives the list of c/c++ files for
353 which dependencies will be checked.
354 libbin and libgbin are also possible and will need in addition
355 the variables from bin
356 ---------------------------------------------------------------------------
357 gslib is similar to lib, but it creates a shared library if the system
358 supports it.
359 additional variables needed:
360 LIB_MAJOR major number of the shared library
361 LIB_MINOR minor number of the shared library
362 ---------------------------------------------------------------------------
363 other additional variables:
364
365 ADD_COMPILE define additional includes/defines that
366 are needed to compile the object files
367 (if you need to reference some directory
368 utils - like wxGrid -, then please
369 reference them with the variables defined
370 in template.mak - e.g.: $(SRCDIR),$(UTILS),
371 $(SAMPLES),$(OTHERS))
372
373 NEEDED_DEFINES lists all the defines that HAVE to be set in
374 /include/wx/setup.h to compile correctly.
375
376 SRC_DIR lists all directories that are needed to
377 compile. (i.e: lists all the directories,
378 where there are source-files.) But it is
379 also needed to clean an object and for
380 machines, for which make does not support
381 VPATH
382
383currently there are the following compiling rules provided:
384object files are created for the following file extensions:
385.c .cc .cpp
386
387Please have a closer look at the Makefiles in this distribution.
388
389* Platforms configure is working with
390---------------------------------------
391
392Please report build succes on any machine. Especially non-
393Linux operating systems (which I don't have).
394
395Original author of the autoconf system for wxxt-1.66 and for this INSTALL
396file:
397
398 Martin Sperl sperl@dsn.ast.univie.ac.at
399
400Ported to wxGTK 0.1:
401
402 Wolfram Gloger wmglo@dent.med.uni-muenchen.de
403
404Thanks alot to both of them.
405
406In the hope that it will be useful,
407
408 Robert Roebling roebling@sun2.ruf.uni-freiburg.de
409
410