![]() Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference |
![]() |
Qtopia can be compiled in a number of ways. The two most common ways are:
There are a number of benefits to single-exec as follows:
The main idea behind single-exec is to make it possible to statically link the libraries to the programs. Normally if you did this, the size would be massive, each application having a copy of all the libraries. But by compiling all the application code in to a single binary, this is not a problem. Normally if one did this, you might just have one process, and in that process create new top level widgets of the different applications within that process, but this is not a very stable model, a single application fault brings down the whole system. Therefore it is necessary to run the applications as separate processes.
When an application is started in single-exec, we fork the server process, and execute the same binary again, but with an argv list that will inform the newly created process what application it should be. This model is very similar to that used by a UNIX tool called busybox which morphs in to different programs based on argv[0].
The size benefit of single-exec comes from static linking. When the linker combines together the code, it performs various size optimizations such as:
One important thing to be aware of when building single-exec with additional 3rd party components is that the symbols must not clash with those from other applications, use of C++ namespaces would be a very good idea to avoid potential problems caused by this.
To build Qtopia as a single-exec binary:
Copyright © 2005 Trolltech | Trademarks | Qtopia version 2.2.0
|