]>
Commit | Line | Data |
---|---|---|
c98f0421 RR |
1 | * The most simple case |
2 | ----------------------- | |
3 | ||
a802c3a1 RR |
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): | |
c98f0421 | 6 | |
8710cf5c | 7 | ./configure |
c98f0421 | 8 | make |
cf7a7e13 | 9 | make install |
cf7a7e13 | 10 | |
2a29700e RR |
11 | * The most simple errors |
12 | ------------------------ | |
13 | ||
14 | configure reports, that you don't have GTK 1.0.X installed | |
15 | although you are certainly sure you have. Well, you have | |
16 | installed it, but you also have another version of the | |
17 | GTK installed, which you may need to removed including | |
18 | other versions of glib (and its headers). | |
19 | ||
20 | * The most simple program | |
21 | ------------------------- | |
22 | ||
a802c3a1 RR |
23 | Now create your super-application myfoo.app and compile anywhere |
24 | with | |
cf7a7e13 | 25 | |
f3cb6592 | 26 | g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo |
c98f0421 RR |
27 | |
28 | * General | |
29 | ----------------------- | |
30 | ||
a802c3a1 RR |
31 | The Unix variants of wxWindows use GNU configure. If you have |
32 | problems with your make use GNU make instead. | |
c98f0421 | 33 | |
a802c3a1 RR |
34 | If you have general problems with installation, read my |
35 | homepage at | |
c98f0421 RR |
36 | |
37 | http://wesley.informatik.uni-freiburg.de/~wxxt | |
38 | ||
a802c3a1 RR |
39 | for newest information. If you still don't have any success, |
40 | please send a bug report to one of our mailing lists (see | |
41 | my homepage) INCLUDING A DESCRIPTION OF YOUR SYSTEM AND | |
42 | YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT | |
43 | DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. I know | |
44 | this has no effect, but I tried... | |
c98f0421 RR |
45 | |
46 | * GUI libraries | |
47 | ----------------------- | |
48 | ||
c67d8618 | 49 | wxWindows/GTK requires the GTK+ library to be installed on your system. |
58614078 | 50 | It has to be a stable version, preferebly version 1.0.6. When using |
6daa0637 RR |
51 | a version previous to 1.0.6 you'll get crashes here and there. |
52 | ||
53 | wxWindows/GTK does NOT work with the 1.1.X versions of the GTK+ library | |
54 | and we will wait until the 1.2 version comes out and has stabilized | |
55 | until we'll work with that library. | |
c98f0421 | 56 | |
c67d8618 | 57 | You can get the newest version of the GTK+ from the GTK homepage |
c98f0421 RR |
58 | at |
59 | http://www.gtk.org | |
60 | ||
8710cf5c | 61 | We also mirror GTK+ 1.0.6 at my ftp site. You'll find information |
58614078 RR |
62 | about downloading at my homepage. |
63 | ||
c98f0421 RR |
64 | * Additional libraries |
65 | ----------------------- | |
66 | ||
58614078 RR |
67 | wxWindows/Gtk requires a thread library and X libraries |
68 | known to work with threads. This is the case on all | |
69 | commercial Unix-Variants and all Linux-Versions that | |
70 | are based on glibc 2 except RedHat 5.0 which is broken | |
71 | in many aspects. As of writing this, these Linux | |
72 | distributions have correct glibc 2 support: | |
73 | ||
74 | - RedHat 5.1 | |
75 | - Debian 2.0 | |
76 | - Stampede | |
4f22cf8d | 77 | - DLD 6.0 |
cffee23b | 78 | - SuSE 6.0 |
58614078 | 79 | |
58614078 RR |
80 | On IRIX you can also use SGI threads if Posix-Threads |
81 | are not present. The SGI threads will be detected by | |
82 | configure automatically. | |
83 | ||
cffee23b | 84 | You can enable thread support by running |
58614078 | 85 | |
cffee23b | 86 | ./configure "--with-threads" |
58614078 RR |
87 | make clean |
88 | make | |
8710cf5c | 89 | make install |
c98f0421 | 90 | |
58614078 RR |
91 | NB: I included thread support in wxWindows/Gtk, as this |
92 | problem will disappear in the near future when all major | |
93 | Linux Variants have moved to glibc 2. Also, the Linux | |
2a29700e | 94 | Base Standard will include glibc 2 and Posix threads. |
58614078 | 95 | |
c98f0421 RR |
96 | * Create your configuration |
97 | ----------------------------- | |
98 | ||
99 | Usage: | |
100 | ./configure options | |
101 | ||
102 | If you want to use system's C and C++ compiler, | |
103 | set environment variables CC and CCC as | |
104 | ||
105 | % setenv CC cc | |
106 | % setenv CCC CC | |
107 | % ./configure options | |
108 | ||
109 | Using the SGI native compilers, it is recommended that you | |
110 | also set CFLAGS and CXXFLAGS before running configure. These | |
111 | should be set to : | |
112 | ||
113 | CFLAGS="-mips3 -n32" | |
114 | CXXFLAGS="-mips3 -n32" | |
115 | ||
116 | This is essential if you want to use the resultant binaries | |
117 | on any other machine than the one it was compiled on. If you | |
118 | have a 64bit machine (Octane) you should also do this to ensure | |
119 | you don't accidently build the libraries as 64bit (which is | |
120 | untested). | |
121 | ||
122 | The SGI native compiler support has only been tested on Irix 6.5. | |
123 | ||
124 | to see all the options please use: | |
125 | ||
126 | ./configure --help | |
127 | ||
128 | The basic philosophy is that if you want to use different | |
129 | configurations, like a debug and a release version, | |
130 | or use the same source tree on different systems, | |
131 | you have only to change the environment variable OSTYPE. | |
132 | (Sadly this variable is not set by default on some systems | |
133 | in some shells - on SGI's for example). So you will have to | |
134 | set it there. This variable HAS to be set before starting | |
135 | configure, so that it knows which system it tries to | |
136 | configure for. | |
137 | ||
138 | Configure will complain if the system variable OSTYPE has | |
139 | not been defined. And Make in some circumstances as well... | |
140 | ||
141 | ||
142 | * General options | |
143 | ------------------- | |
144 | ||
cf7a7e13 RR |
145 | Normally, you won't have to choose a toolkit, because when |
146 | you download wxGTK, it will default to --with-gtk etc. But | |
147 | if you use all of our CVS repository you have to choose a | |
148 | toolkit. You must do this by running configure with either of: | |
c98f0421 RR |
149 | |
150 | --with-gtk Use the GIMP ToolKit (GTK) | |
151 | ||
c98f0421 RR |
152 | --with-motif Use either Motif or Lesstif |
153 | Configure will look for both. | |
154 | ||
155 | The following options handle the kind of library you want to build. | |
156 | ||
8710cf5c | 157 | --with-threads Compile without thread support. |
c98f0421 | 158 | |
cf7a7e13 | 159 | --without-shared Do not create shared libraries. |
c98f0421 RR |
160 | |
161 | --without-optimise Do not optimise the code. | |
162 | ||
163 | --with-profile Add profiling info to the object | |
164 | files. Currently broken, I think. | |
165 | ||
166 | --with-mem_tracing Add built-in memory tracing. | |
c98f0421 RR |
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 | ||
c98f0421 RR |
180 | As I don't yet care for binary size and target mainly at |
181 | producing a shared library, wxWindows's configure system auto- | |
182 | matically enables all features, as long as they are already | |
c058d771 RR |
183 | implemented. It is currently NOT possible to disable these |
184 | options (in contrast to what configure tells you). | |
c98f0421 RR |
185 | |
186 | * Compiling | |
187 | ------------- | |
188 | ||
189 | The following must be done in the base directory (e.g. ~/wxGTK | |
cf7a7e13 | 190 | or ~/wxWin or whatever) |
c98f0421 | 191 | |
8710cf5c RR |
192 | Now the makefiles are created (by configure) and you can compile |
193 | the library by typing: | |
c98f0421 RR |
194 | |
195 | make | |
196 | ||
8710cf5c RR |
197 | make yourself some coffee, as it will take some time. On an old |
198 | 386SX possibly week. During compilation, you'll get a few | |
199 | warning messages. | |
c98f0421 RR |
200 | |
201 | if you want to be more selective: | |
202 | ||
203 | make src will build only the base libraries | |
c98f0421 | 204 | make samples will build the samples |
c67d8618 RR |
205 | make other will build everything in other |
206 | make user will build everything in user | |
c98f0421 | 207 | |
cf7a7e13 RR |
208 | Then you may install the library and it's header files under |
209 | /usr/local/include/wx and /usr/local/lib respectively. You | |
210 | have to log in as root (i.e. run "su" and enter the root | |
211 | password) and type | |
212 | ||
213 | make install | |
214 | ||
c98f0421 RR |
215 | Depending on the configuration of some files, the libraries |
216 | and binaries will be placed in different directories. | |
217 | The "global" binaries and libraries will be placed in: | |
218 | ||
219 | bin/$(OSTYPE) and | |
220 | lib/$(OSTYPE) respectively | |
221 | ||
222 | "local" binaries and libraries will be placed in: | |
223 | ||
224 | (basedir of that application)/$(OSTYPE). | |
225 | ||
226 | This is also the place where all the object-files will go. | |
8710cf5c | 227 | (Currently there arent any global binaries). |
c98f0421 RR |
228 | |
229 | If you want to conserve disk space by removing unnecessary | |
230 | object-files: | |
231 | ||
232 | make clean_obj | |
233 | ||
234 | will do the work for you. | |
235 | ||
236 | * Creating a new Project | |
237 | -------------------------- | |
238 | ||
f3cb6592 RR |
239 | There are two ways to create your own project: |
240 | ||
241 | 1) The first way uses the installed libraries and header files | |
242 | automatically using wx-config | |
243 | ||
244 | g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo | |
245 | ||
246 | Using this way, a make file for the minimal sample would look | |
247 | like this | |
248 | ||
249 | CC = g++ | |
250 | ||
251 | minimal: minimal.o | |
252 | $(CC) -o minimal minimal.o `wx-config --libs` | |
253 | ||
254 | minimal.o: minimal.cpp mondrian.xpm | |
255 | $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o | |
256 | ||
257 | clean: | |
258 | rm -f *.o minimal | |
259 | ||
260 | This is certain to become the standard way unless we decide | |
261 | to sitch to tmake. | |
262 | ||
263 | 2) The other way creates a project within the source code | |
264 | directories of wxWindows: In this case I propose to put | |
265 | all contributed programs in the directory "/user", with a | |
266 | directory of its own. | |
c98f0421 RR |
267 | |
268 | This directory then should include the following files: | |
269 | ||
270 | Makefile (You can copy this one from any application in samples | |
271 | probably you will not need to edit this one. There is | |
272 | only one case where you might be interested in changing | |
273 | this file, but about that see later.) | |
274 | Makefile.in (This is the base application-Makefile template, from | |
275 | which the actual Makefile for each system is created. | |
276 | More about this later) | |
277 | ||
278 | put ALL your source code along with all the other stuff you need for | |
279 | your application in this directory (subdirectories are welcome). | |
280 | ||
cf7a7e13 | 281 | |
c98f0421 RR |
282 | ** Something about Makefiles |
283 | ------------------------------ | |
284 | ||
285 | On general principle it should only contain ONE line, which is as follows: | |
286 | ||
287 | include ../../setup/general/makeapp | |
288 | ||
289 | this will include all the necessary definitions for creating the applications | |
290 | ||
291 | the only case where you might want to add another line is the following: | |
292 | this version of configure also supports creation of source archives of the | |
293 | application for easy distribution and updates to newer version of wxWindows. | |
294 | For this purpose all files in the application-directory will be put into | |
295 | a gziped tar-file in the full notation user/<your application>/* | |
296 | if you want to include some other files that you want "more visible", like | |
297 | a README.<yourApp> or a shell script for easy | |
298 | compilation/installation/distribution, then you have to add a variable | |
299 | ||
300 | DISTRIBUTE_ADDITIONAL=<your files> | |
301 | ||
302 | to the Makefile. | |
303 | So it would look like this: | |
304 | ||
305 | DISTRIBUTE_ADDITIONAL=README.TheApp | |
306 | include ../../setup/general/makeapp | |
307 | ||
308 | As we have already talked about distribution the command to create a | |
309 | distribution is: | |
310 | ||
311 | make distrib | |
312 | ||
313 | NOTE: If you are in the base directory of wxWindows it will create | |
314 | distribution packages for wxWindows as well as for all packages in the | |
315 | user directory. | |
316 | So if you want to create only packages for the files in user, | |
317 | then go to the directory other and type: | |
318 | ||
319 | make distrib | |
320 | ||
321 | or if you only want one application to be created then | |
322 | enter the specific directory and type there: | |
323 | make distrib | |
324 | ||
325 | All the distribution files will be put in the directory | |
326 | distrib at the base of the wxWindows-tree (where also configure | |
327 | and template.mak can be found). | |
328 | ||
329 | ** Something about Makefile.in | |
330 | -------------------------------- | |
331 | ||
332 | As you have already seen with Makefile, configure makes a lot of use | |
333 | if the include statement in make to keep the Makefiles as simple as | |
334 | possible. | |
335 | ||
336 | So basically there are only variables to define and then a include command. | |
337 | Exception to this rule is if you have special rules for some stuff... | |
338 | These rules should go AFTER the include statement!!! | |
339 | ||
340 | so the general header looks like this: | |
341 | ||
342 | # wxWindows base directory | |
343 | WXBASEDIR=@WXBASEDIR@ | |
344 | # set the OS type for compilation | |
345 | OS=@OS@ | |
346 | # compile a library only | |
347 | RULE=bin | |
348 | ||
349 | and the general footer will look like this: | |
350 | ||
351 | # include the definitions now | |
352 | include ../../../template.mak | |
353 | ||
354 | the key variable is RULE, which defines what make should create | |
355 | in this directory. | |
356 | ||
357 | here are some examples: | |
358 | ||
359 | RULE description | |
360 | =========================================================================== | |
361 | bin creates a local binary (for a global binary prefix bin with g) | |
362 | additional variables needed: | |
363 | BIN_TARGET this gives the name of your application | |
364 | BIN_OBJ this gives the object files needed to | |
365 | link the application | |
366 | optional variables are: | |
367 | BIN_SRC this gives the list of c/c++ files for | |
368 | which dependencies will be checked. | |
369 | (This can be achieved with: make depend) | |
370 | BIN_LINK this gives commands for additional | |
371 | libraries needed to link the application | |
372 | --------------------------------------------------------------------------- | |
373 | bin2 creates two local binaries (for global binaries prefix bin2 with g) | |
374 | in addition to the variables specified above you MUST also | |
375 | provide the same variables with BIN2_ instead of BIN_ | |
376 | --------------------------------------------------------------------------- | |
377 | lib creates a local library (for a global binary prefix bin with g) | |
378 | additional variables needed: | |
379 | LIB_TARGET this gives the name of your library | |
380 | LIB_OBJ this gives the object files needed for | |
381 | the library to be build. | |
382 | optional variables are: | |
383 | LIB_SRC this gives the list of c/c++ files for | |
384 | which dependencies will be checked. | |
385 | libbin and libgbin are also possible and will need in addition | |
386 | the variables from bin | |
387 | --------------------------------------------------------------------------- | |
388 | gslib is similar to lib, but it creates a shared library if the system | |
389 | supports it. | |
390 | additional variables needed: | |
391 | LIB_MAJOR major number of the shared library | |
392 | LIB_MINOR minor number of the shared library | |
393 | --------------------------------------------------------------------------- | |
394 | other additional variables: | |
395 | ||
396 | ADD_COMPILE define additional includes/defines that | |
397 | are needed to compile the object files | |
398 | (if you need to reference some directory | |
399 | utils - like wxGrid -, then please | |
400 | reference them with the variables defined | |
401 | in template.mak - e.g.: $(SRCDIR),$(UTILS), | |
402 | $(SAMPLES),$(OTHERS)) | |
403 | ||
404 | NEEDED_DEFINES lists all the defines that HAVE to be set in | |
405 | /include/wx/setup.h to compile correctly. | |
406 | ||
407 | SRC_DIR lists all directories that are needed to | |
408 | compile. (i.e: lists all the directories, | |
409 | where there are source-files.) But it is | |
410 | also needed to clean an object and for | |
411 | machines, for which make does not support | |
412 | VPATH | |
413 | ||
414 | currently there are the following compiling rules provided: | |
415 | object files are created for the following file extensions: | |
416 | .c .cc .cpp | |
417 | ||
418 | Please have a closer look at the Makefiles in this distribution. | |
419 | ||
420 | * Platforms configure is working with | |
421 | --------------------------------------- | |
422 | ||
423 | Please report build succes on any machine. Especially non- | |
424 | Linux operating systems (which I don't have). | |
425 | ||
426 | Original author of the autoconf system for wxxt-1.66 and for this INSTALL | |
427 | file: | |
428 | ||
429 | Martin Sperl sperl@dsn.ast.univie.ac.at | |
430 | ||
431 | Ported to wxGTK 0.1: | |
432 | ||
433 | Wolfram Gloger wmglo@dent.med.uni-muenchen.de | |
434 | ||
435 | Thanks alot to both of them. | |
436 | ||
437 | In the hope that it will be useful, | |
438 | ||
439 | Robert Roebling roebling@sun2.ruf.uni-freiburg.de | |
440 | ||
441 |