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