2 -----------------------
4 If you compile wxWindows on Unix for the first time and don't
5 like to read install instructions just do (in the base dir):
11 Now create your super-application myfoo.app and compile anywhere
14 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
17 -----------------------
19 The Unix variants of wxWindows use GNU configure. If you have
20 problems with your make use GNU make instead.
22 If you have general problems with installation, read my
25 http://wesley.informatik.uni-freiburg.de/~wxxt
27 for newest information. If you still don't have any success,
28 please send a bug report to one of our mailing lists (see
29 my homepage) INCLUDING A DESCRIPTION OF YOUR SYSTEM AND
30 YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT
31 DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. I know
32 this has no effect, but I tried...
35 -----------------------
37 wxWindows/GTK requires the GTK+ library to be installed on your system.
38 It has to be a stable version, preferebly version 1.0.6. When using
39 a version previous to 1.0.6 you'll get crashes here and there.
41 wxWindows/GTK does NOT work with the 1.1.X versions of the GTK+ library
42 and we will wait until the 1.2 version comes out and has stabilized
43 until we'll work with that library.
45 You can get the newest version of the GTK+ from the GTK homepage
49 We also mirror GTK+ 1.0.6 at my ftp site. You'll find information
50 about downloading at my homepage.
52 * Additional libraries
53 -----------------------
55 wxWindows/Gtk requires a thread library and X libraries
56 known to work with threads. This is the case on all
57 commercial Unix-Variants and all Linux-Versions that
58 are based on glibc 2 except RedHat 5.0 which is broken
59 in many aspects. As of writing this, these Linux
60 distributions have correct glibc 2 support:
68 On IRIX you can also use SGI threads if Posix-Threads
69 are not present. The SGI threads will be detected by
70 configure automatically.
72 You can enable thread support by running
74 ./configure "--with-threads"
79 NB: I included thread support in wxWindows/Gtk, as this
80 problem will disappear in the near future when all major
81 Linux Variants have moved to glibc 2. Also, the Linux
82 Base Standard will include glibc 2 and Posic threads.
84 * Create your configuration
85 -----------------------------
90 If you want to use system's C and C++ compiler,
91 set environment variables CC and CCC as
97 Using the SGI native compilers, it is recommended that you
98 also set CFLAGS and CXXFLAGS before running configure. These
102 CXXFLAGS="-mips3 -n32"
104 This is essential if you want to use the resultant binaries
105 on any other machine than the one it was compiled on. If you
106 have a 64bit machine (Octane) you should also do this to ensure
107 you don't accidently build the libraries as 64bit (which is
110 The SGI native compiler support has only been tested on Irix 6.5.
112 to see all the options please use:
116 The basic philosophy is that if you want to use different
117 configurations, like a debug and a release version,
118 or use the same source tree on different systems,
119 you have only to change the environment variable OSTYPE.
120 (Sadly this variable is not set by default on some systems
121 in some shells - on SGI's for example). So you will have to
122 set it there. This variable HAS to be set before starting
123 configure, so that it knows which system it tries to
126 Configure will complain if the system variable OSTYPE has
127 not been defined. And Make in some circumstances as well...
133 Normally, you won't have to choose a toolkit, because when
134 you download wxGTK, it will default to --with-gtk etc. But
135 if you use all of our CVS repository you have to choose a
136 toolkit. You must do this by running configure with either of:
138 --with-gtk Use the GIMP ToolKit (GTK)
140 --with-motif Use either Motif or Lesstif
141 Configure will look for both.
143 The following options handle the kind of library you want to build.
145 --with-threads Compile without thread support.
147 --without-shared Do not create shared libraries.
149 --without-optimise Do not optimise the code.
151 --with-profile Add profiling info to the object
152 files. Currently broken, I think.
154 --with-mem_tracing Add built-in memory tracing.
156 --with-dmalloc Use the dmalloc memory debugger.
157 Read more at www.letters.com/dmalloc/
159 --with-debug_info Add debug info to object files and
162 --with-debug_flag Define __DEBUG__ and __WXDEBUG__ when
168 As I don't yet care for binary size and target mainly at
169 producing a shared library, wxWindows's configure system auto-
170 matically enables all features, as long as they are already
171 implemented. It is currently NOT possible to disable these
172 options (in contrast to what configure tells you).
177 The following must be done in the base directory (e.g. ~/wxGTK
178 or ~/wxWin or whatever)
180 Now the makefiles are created (by configure) and you can compile
181 the library by typing:
185 make yourself some coffee, as it will take some time. On an old
186 386SX possibly week. During compilation, you'll get a few
189 if you want to be more selective:
191 make src will build only the base libraries
192 make samples will build the samples
193 make other will build everything in other
194 make user will build everything in user
196 Then you may install the library and it's header files under
197 /usr/local/include/wx and /usr/local/lib respectively. You
198 have to log in as root (i.e. run "su" and enter the root
203 Depending on the configuration of some files, the libraries
204 and binaries will be placed in different directories.
205 The "global" binaries and libraries will be placed in:
208 lib/$(OSTYPE) respectively
210 "local" binaries and libraries will be placed in:
212 (basedir of that application)/$(OSTYPE).
214 This is also the place where all the object-files will go.
215 (Currently there arent any global binaries).
217 If you want to conserve disk space by removing unnecessary
222 will do the work for you.
224 * Creating a new Project
225 --------------------------
227 There are two ways to create your own project:
229 1) The first way uses the installed libraries and header files
230 automatically using wx-config
232 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
234 Using this way, a make file for the minimal sample would look
240 $(CC) -o minimal minimal.o `wx-config --libs`
242 minimal.o: minimal.cpp mondrian.xpm
243 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
248 This is certain to become the standard way unless we decide
251 2) The other way creates a project within the source code
252 directories of wxWindows: In this case I propose to put
253 all contributed programs in the directory "/user", with a
254 directory of its own.
256 This directory then should include the following files:
258 Makefile (You can copy this one from any application in samples
259 probably you will not need to edit this one. There is
260 only one case where you might be interested in changing
261 this file, but about that see later.)
262 Makefile.in (This is the base application-Makefile template, from
263 which the actual Makefile for each system is created.
264 More about this later)
266 put ALL your source code along with all the other stuff you need for
267 your application in this directory (subdirectories are welcome).
270 ** Something about Makefiles
271 ------------------------------
273 On general principle it should only contain ONE line, which is as follows:
275 include ../../setup/general/makeapp
277 this will include all the necessary definitions for creating the applications
279 the only case where you might want to add another line is the following:
280 this version of configure also supports creation of source archives of the
281 application for easy distribution and updates to newer version of wxWindows.
282 For this purpose all files in the application-directory will be put into
283 a gziped tar-file in the full notation user/<your application>/*
284 if you want to include some other files that you want "more visible", like
285 a README.<yourApp> or a shell script for easy
286 compilation/installation/distribution, then you have to add a variable
288 DISTRIBUTE_ADDITIONAL=<your files>
291 So it would look like this:
293 DISTRIBUTE_ADDITIONAL=README.TheApp
294 include ../../setup/general/makeapp
296 As we have already talked about distribution the command to create a
301 NOTE: If you are in the base directory of wxWindows it will create
302 distribution packages for wxWindows as well as for all packages in the
304 So if you want to create only packages for the files in user,
305 then go to the directory other and type:
309 or if you only want one application to be created then
310 enter the specific directory and type there:
313 All the distribution files will be put in the directory
314 distrib at the base of the wxWindows-tree (where also configure
315 and template.mak can be found).
317 ** Something about Makefile.in
318 --------------------------------
320 As you have already seen with Makefile, configure makes a lot of use
321 if the include statement in make to keep the Makefiles as simple as
324 So basically there are only variables to define and then a include command.
325 Exception to this rule is if you have special rules for some stuff...
326 These rules should go AFTER the include statement!!!
328 so the general header looks like this:
330 # wxWindows base directory
331 WXBASEDIR=@WXBASEDIR@
332 # set the OS type for compilation
334 # compile a library only
337 and the general footer will look like this:
339 # include the definitions now
340 include ../../../template.mak
342 the key variable is RULE, which defines what make should create
345 here are some examples:
348 ===========================================================================
349 bin creates a local binary (for a global binary prefix bin with g)
350 additional variables needed:
351 BIN_TARGET this gives the name of your application
352 BIN_OBJ this gives the object files needed to
354 optional variables are:
355 BIN_SRC this gives the list of c/c++ files for
356 which dependencies will be checked.
357 (This can be achieved with: make depend)
358 BIN_LINK this gives commands for additional
359 libraries needed to link the application
360 ---------------------------------------------------------------------------
361 bin2 creates two local binaries (for global binaries prefix bin2 with g)
362 in addition to the variables specified above you MUST also
363 provide the same variables with BIN2_ instead of BIN_
364 ---------------------------------------------------------------------------
365 lib creates a local library (for a global binary prefix bin with g)
366 additional variables needed:
367 LIB_TARGET this gives the name of your library
368 LIB_OBJ this gives the object files needed for
369 the library to be build.
370 optional variables are:
371 LIB_SRC this gives the list of c/c++ files for
372 which dependencies will be checked.
373 libbin and libgbin are also possible and will need in addition
374 the variables from bin
375 ---------------------------------------------------------------------------
376 gslib is similar to lib, but it creates a shared library if the system
378 additional variables needed:
379 LIB_MAJOR major number of the shared library
380 LIB_MINOR minor number of the shared library
381 ---------------------------------------------------------------------------
382 other additional variables:
384 ADD_COMPILE define additional includes/defines that
385 are needed to compile the object files
386 (if you need to reference some directory
387 utils - like wxGrid -, then please
388 reference them with the variables defined
389 in template.mak - e.g.: $(SRCDIR),$(UTILS),
390 $(SAMPLES),$(OTHERS))
392 NEEDED_DEFINES lists all the defines that HAVE to be set in
393 /include/wx/setup.h to compile correctly.
395 SRC_DIR lists all directories that are needed to
396 compile. (i.e: lists all the directories,
397 where there are source-files.) But it is
398 also needed to clean an object and for
399 machines, for which make does not support
402 currently there are the following compiling rules provided:
403 object files are created for the following file extensions:
406 Please have a closer look at the Makefiles in this distribution.
408 * Platforms configure is working with
409 ---------------------------------------
411 Please report build succes on any machine. Especially non-
412 Linux operating systems (which I don't have).
414 Original author of the autoconf system for wxxt-1.66 and for this INSTALL
417 Martin Sperl sperl@dsn.ast.univie.ac.at
421 Wolfram Gloger wmglo@dent.med.uni-muenchen.de
423 Thanks alot to both of them.
425 In the hope that it will be useful,
427 Robert Roebling roebling@sun2.ruf.uni-freiburg.de