mirror of https://github.com/cutefishos/appmotor
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
3.0 KiB
Plaintext
85 lines
3.0 KiB
Plaintext
/*! \page qtboost Using the Qt Booster
|
|
|
|
This section describes how to use the Qt booster. The booster provides
|
|
the application with the key libraries already present in the process,
|
|
but no other initializations are done in the booster.
|
|
|
|
\section intro Prerequisites
|
|
|
|
The launcher can start an application if the following pre-requisites are met:
|
|
|
|
\li The application is compiled and linked to a position independent binary
|
|
(executable or library)
|
|
|
|
\li The application is started with the \c invoker command instead of executing the executable file.
|
|
|
|
\section qtboostcompiling 1. Compiling and linking for launcher
|
|
|
|
Binaries intended to be run with \c applauncherd should be compiled
|
|
with \c -fPIC option to produce position independent code. They should
|
|
then be linked either as shared libraries, or better yet as position
|
|
independent executables, which can be executed both traditionally and
|
|
with the launcher. The \c -pie and \c -rdynamic linker flags
|
|
accomplish this.
|
|
|
|
To improve linking and loading times of shared object libraries it is
|
|
encouraged to hide any unnecessary symbols from the resulting binary
|
|
by using \c -fvisibility=hidden and \c -fvisibility-inlines-hidden
|
|
flags as well. However, \c applauncherd needs to find the entry point
|
|
for your application, so the symbol \c main needs to be explicitly made
|
|
visible. This can be done as follows:
|
|
|
|
\code
|
|
#include <QtCore/QtGlobal>
|
|
|
|
Q_DECL_EXPORT int main(int argc, char **argv)
|
|
{
|
|
...
|
|
}
|
|
\endcode
|
|
|
|
Normally you should not need to worry about the compiler and linker
|
|
flags, as the \c applauncherd-dev package provides configuration
|
|
options for \c QMake, \c cmake, and \c pkg-config. If you are building
|
|
a Debian package, make your package build-depend on \c
|
|
applauncherd-dev.
|
|
|
|
For details on how to get the compiler and linker flags, see
|
|
\subpage usingqmake "Using QMake", \subpage usingcmake "Using CMake", or
|
|
\subpage usingpkgconfig "Using pkg-config".
|
|
|
|
\section qtboostexit 2. Adapting application source code
|
|
|
|
No modifications are typically needed when the Qt booster is
|
|
used. However, if the application has explicit calls to \c exit(),
|
|
these should be changed to use \c _exit() instead. The brief
|
|
explanation is that this prevents cleanup actions related to shared
|
|
libraries to be performed multiple times. For more details see
|
|
\subpage limitations "Limitations and known issues".
|
|
|
|
|
|
\section qtboostinvoker 3. Launching the application
|
|
|
|
Check that applauncherd package is installed and applancherd daemon is
|
|
running. You can now run your application as usual as
|
|
/usr/bin/myApp, or use the qtboosted launching by running:
|
|
|
|
\code
|
|
invoker --type=q /usr/bin/myApp
|
|
\endcode
|
|
|
|
\section qtboostfinishingtouch 4. Finishing touches.
|
|
|
|
The invoker can also provide single instance behavior and a splash
|
|
screen for you application as follows. For more details, see
|
|
\subpage singleinstance "the single instance documentation" and
|
|
\subpage splash "the splash screen documentation."
|
|
|
|
\code
|
|
/usr/bin/invoker --single-instance --splash=/usr/share/myApp/splash.jpg --type=q /usr/bin/myApp
|
|
\endcode
|
|
|
|
*/
|
|
|
|
|