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