Building Qt 4 for BlackBerry: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:BlackBerry]] | [[Category:BlackBerry]] | ||
[[Category:HowTo]] | |||
= Building Qt4 for BlackBerry = | = Building Qt4 for BlackBerry = | ||
Line 13: | Line 14: | ||
<code>source /opt/bbndk-2.1.0/bbndk-env.sh <code> | <code>source /opt/bbndk-2.1.0/bbndk-env.sh <code> | ||
All the commands below should be ran in the same terminal window. | All the commands below should be ran in the same terminal window. | ||
If you close it between steps ''you need to run the bbndk-env.sh again''. | |||
=== Getting the source === | === Getting the source === | ||
Line 23: | Line 25: | ||
On the '''Playbook''', the last officially supported version is 4.8.3. The recommended version is 4.8.3. To switch to 4.8.3, do: | On the '''Playbook''', the last officially supported version is 4.8.3. The recommended version is 4.8.3. To switch to 4.8.3, do: | ||
<code> | <code> | ||
cd qt | |||
git checkout v4.8.3 | |||
</code> | |||
Those who would like to use a more recent version of Qt 4.8 for the Playbook will need to use the ''blackberry-playbook-armv7le-qcc'' mkspec instead of the usual ''blackberry-armv7le-qcc''. Please be advised that versions later than 4.8.3 are not officially supported and are not guaranteed to work. Use it at your own risk. | Those who would like to use a more recent version of Qt 4.8 for the Playbook will need to use the ''blackberry-playbook-armv7le-qcc'' mkspec instead of the usual ''blackberry-armv7le-qcc''. Please be advised that versions later than 4.8.3 are not officially supported and are not guaranteed to work. Use it at your own risk. | ||
Line 31: | Line 36: | ||
==== Building Qt 4.8 for ARM (BlackBerry 10 and PlaybookOS) ==== | ==== Building Qt 4.8 for ARM (BlackBerry 10 and PlaybookOS) ==== | ||
<code> | <code> | ||
cd qt | |||
./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-armv7le-qcc | |||
-little-endian -arch arm -largefile -nomake examples -xmlpatterns -no-webkit -no-rpath -opengl es2 -reduce-exports -system-sqlite -prefix <prefix> | |||
make | |||
make install | |||
</code> | |||
When compiling for the '''Playbook''', you also need the '''-no-neon''' option, as NEON support on the Playbook is known to be flaky. This is only required for Qt 4.8.3 or later. | When compiling for the '''Playbook''', you also need the '''-no-neon''' option, as NEON support on the Playbook is known to be flaky. This is only required for Qt 4.8.3 or later. | ||
Line 37: | Line 48: | ||
==== Building Qt 4.8 for x86 (Simulator) ==== | ==== Building Qt 4.8 for x86 (Simulator) ==== | ||
<code> | <code> | ||
cd qt | |||
./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-x86-qcc | |||
-little-endian -arch i386 -largefile -nomake examples -nomake demos -xmlpatterns -no-webkit -no-rpath -opengl es2 -reduce-exports -system-sqlite -prefix <prefix> | |||
make | |||
make install | |||
</code> | |||
Qt will be installed at $PWD/stage. Alternatively, you can then use ''-prefix-install'' and pass a directory to the ''-prefix'' option to change the installation directory. | Qt will be installed at $PWD/stage. Alternatively, you can then use ''-prefix-install'' and pass a directory to the ''-prefix'' option to change the installation directory. | ||
<code> | |||
./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-x86-qcc | |||
-little-endian -arch i386 -largefile -nomake examples* -nomake demos -xmlpatterns -no-webkit -no-rpath -opengl es2 -reduce-exports -system-sqlite* -prefix-install -prefix ~/build/ | |||
</code> | |||
=== Building on a Windows host === | === Building on a Windows host === | ||
In order to build Qt 4.8 for BlackBerry on a Windows host, you will need to rebuild the | In order to build Qt 4.8 for BlackBerry on a Windows host, you will need to rebuild the <code>configure.exe</code> utility first: | ||
# Clone <code>git://gitorious.org/qt/qt.git</code> to a separated directory; | |||
'''''For Playbook users only''': You need to checkout tag v4.8.3 and cherry-pick c14694621aab2e7df13830f80621fb5680b432e4 before you can continue.'' | '''''For Playbook users only''': You need to checkout tag v4.8.3 and cherry-pick c14694621aab2e7df13830f80621fb5680b432e4 before you can continue.'' | ||
# Configure Qt with | # Configure Qt with <code>configure.exe -opensource -confirm-license</code> | ||
# | # <code>cd</code> into <code>tools/configure</code> | ||
# Rebuild with | # Rebuild with <code>..</code> and then <code>mingw32-make</code> | ||
# The new | # The new <code>configure.exe</code> binary will be place on <code>$QTSRC/configure.exe</code> | ||
# You can now use it to replace the | # You can now use it to replace the <code>configure.exe</code> on the Qt source tree you will use to build for BlackBerry. | ||
==== Building Qt 4.8 for ARM (Playbook and phone devices) ==== | ==== Building Qt 4.8 for ARM (Playbook and phone devices) ==== | ||
<code> | <code> | ||
C:> cd qt | |||
C:>configure.exe -opensource -confirm-license -release -xplatform blackberry-armv7le-qcc -arch arm -nomake examples -nomake demos -no-webkit -opengl es2 -inotify -prefix c:stall | |||
C:> mingw32-make -j | |||
C:> mingw32-make -j install | |||
</code> | |||
When compiling for the '''Playbook''', also supply the '''-no-neon''' option (see above for the reasons). | When compiling for the '''Playbook''', also supply the '''-no-neon''' option (see above for the reasons). | ||
Line 61: | Line 88: | ||
==== Building Qt 4.8 for x86 (Simulator) ==== | ==== Building Qt 4.8 for x86 (Simulator) ==== | ||
<code> | <code> | ||
C:> cd qt | |||
C:> configure.exe -opensource -confirm-license -release -xplatform blackberry-x86-qcc -arch i386 -nomake examples -nomake demos -no-webkit -opengl es2 -inotify -prefix c:stall | |||
C:> mingw32-make -j | |||
C:> mingw32-make -j install | |||
</code> | |||
Qt will be installed at C:stall. Alternatively, you can then use | Qt will be installed at C:stall. Alternatively, you can then use <code>-prefix-install</code> and pass a directory to the <code>-prefix</code> option to change the installation directory. | ||
=== Building QtMobility === | === Building QtMobility === | ||
"QtMobility":http://doc.trolltech.com/qtmobility-1.2/ is an addon module to Qt that provides various modules for mobile device functions. For BlackBerry devices, the sensor and multimedia backends are implemented, providing access to the device's sensors such as the accelerometer or the light sensor, and providing the ability to playback audio and video. | |||
For various reasons, such as that there will be no more official releases of QtMobility for Qt4, the repository of QtMobility is a "fork":https://gitorious.org/+kdab-developers/qt-mobility/qnx-qt-mobility of the upstream one (unlike the Qt5 version, in which the BlackBerry backends are all upstream). | |||
==== Building on a Linux host ==== | ==== Building on a Linux host ==== | ||
To build QtMobility on a Linux host, first make sure that the qmake of the cross-compiled Qt from above is first in ''$PATH''. ''$QTDIR'' needs to be set to the path of the Qt installation from above. Otherwise, the environment should be the same as when Qt itself was built. | To build QtMobility on a Linux host, first make sure that the qmake of the cross-compiled Qt from above is first in ''$PATH''. ''$QTDIR'' needs to be set to the path of the Qt installation from above. Otherwise, the environment should be the same as when Qt itself was built. | ||
<code> | |||
$ git clone git://gitorious.org/+kdab-developers/qt-mobility/qnx-qt-mobility.git | |||
$ cd qnx-qt-mobility | |||
$ ./configure -prefix $QTDIR | |||
$ make | |||
$ make install | |||
</code> | |||
Now QtMobility is installed into the Qt installation and is ready to be used. | |||
=== See also === | === See also === |
Revision as of 10:19, 25 February 2015
Building Qt4 for BlackBerry
This page provides instructions on how to build Q4 for BlackBerry10 and PlayBook OS. These instructions are addressed to those who need to build a custom version of Qt for their application to work on BlackBerry10 products, or would like to develop applications for PlaybookOS . Developers looking to create applications which do not have unusual needs should rather use QtCreator 3.0 and Qt provided in the BlackBerry 10 NDK, see [[Qt-Creator-with-BlackBerry-10] | this page]] for more details.
Setting up the environment
See Blackberry for the introduction and further instructions.
Open a terminal window and load the Blackberry NDK enviroment variables with:
source /opt/bbndk-2.1.0/bbndk-env.sh <code>
All the commands below should be ran in the same terminal window.
If you close it between steps ''you need to run the bbndk-env.sh again''.
=== Getting the source ===
git clone git://gitorious.org/qt/qt.git
NOTE: we suggest to start with a clean source tree before building for different architectures (ARM/x86).
On the Playbook, the last officially supported version is 4.8.3. The recommended version is 4.8.3. To switch to 4.8.3, do:
cd qt
git checkout v4.8.3
Those who would like to use a more recent version of Qt 4.8 for the Playbook will need to use the blackberry-playbook-armv7le-qcc mkspec instead of the usual blackberry-armv7le-qcc. Please be advised that versions later than 4.8.3 are not officially supported and are not guaranteed to work. Use it at your own risk.
Building on a Linux/OS X host.
Building Qt 4.8 for ARM (BlackBerry 10 and PlaybookOS)
cd qt
./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-armv7le-qcc
-little-endian -arch arm -largefile -nomake examples -xmlpatterns -no-webkit -no-rpath -opengl es2 -reduce-exports -system-sqlite -prefix <prefix>
make
make install
When compiling for the Playbook, you also need the -no-neon option, as NEON support on the Playbook is known to be flaky. This is only required for Qt 4.8.3 or later.
Building Qt 4.8 for x86 (Simulator)
cd qt
./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-x86-qcc
-little-endian -arch i386 -largefile -nomake examples -nomake demos -xmlpatterns -no-webkit -no-rpath -opengl es2 -reduce-exports -system-sqlite -prefix <prefix>
make
make install
Qt will be installed at $PWD/stage. Alternatively, you can then use -prefix-install and pass a directory to the -prefix option to change the installation directory.
./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-x86-qcc
-little-endian -arch i386 -largefile -nomake examples* -nomake demos -xmlpatterns -no-webkit -no-rpath -opengl es2 -reduce-exports -system-sqlite* -prefix-install -prefix ~/build/
Building on a Windows host
In order to build Qt 4.8 for BlackBerry on a Windows host, you will need to rebuild the
configure.exe
utility first:
- Clone to a separated directory;
git://gitorious.org/qt/qt.git
For Playbook users only: You need to checkout tag v4.8.3 and cherry-pick c14694621aab2e7df13830f80621fb5680b432e4 before you can continue.
- Configure Qt with
configure.exe -opensource -confirm-license
- into
cd
tools/configure
- Rebuild with and then
..
mingw32-make
- The new binary will be place on
configure.exe
$QTSRC/configure.exe
- You can now use it to replace the on the Qt source tree you will use to build for BlackBerry.
configure.exe
Building Qt 4.8 for ARM (Playbook and phone devices)
C:> cd qt
C:>configure.exe -opensource -confirm-license -release -xplatform blackberry-armv7le-qcc -arch arm -nomake examples -nomake demos -no-webkit -opengl es2 -inotify -prefix c:stall
C:> mingw32-make -j
C:> mingw32-make -j install
When compiling for the Playbook, also supply the -no-neon option (see above for the reasons).
Building Qt 4.8 for x86 (Simulator)
C:> cd qt
C:> configure.exe -opensource -confirm-license -release -xplatform blackberry-x86-qcc -arch i386 -nomake examples -nomake demos -no-webkit -opengl es2 -inotify -prefix c:stall
C:> mingw32-make -j
C:> mingw32-make -j install
Qt will be installed at C:stall. Alternatively, you can then use
-prefix-install
and pass a directory to the
-prefix
option to change the installation directory.
Building QtMobility
"QtMobility":http://doc.trolltech.com/qtmobility-1.2/ is an addon module to Qt that provides various modules for mobile device functions. For BlackBerry devices, the sensor and multimedia backends are implemented, providing access to the device's sensors such as the accelerometer or the light sensor, and providing the ability to playback audio and video. For various reasons, such as that there will be no more official releases of QtMobility for Qt4, the repository of QtMobility is a "fork":https://gitorious.org/+kdab-developers/qt-mobility/qnx-qt-mobility of the upstream one (unlike the Qt5 version, in which the BlackBerry backends are all upstream).
Building on a Linux host
To build QtMobility on a Linux host, first make sure that the qmake of the cross-compiled Qt from above is first in $PATH. $QTDIR needs to be set to the path of the Qt installation from above. Otherwise, the environment should be the same as when Qt itself was built.
$ git clone git://gitorious.org/+kdab-developers/qt-mobility/qnx-qt-mobility.git
$ cd qnx-qt-mobility
$ ./configure -prefix $QTDIR
$ make
$ make install
Now QtMobility is installed into the Qt installation and is ready to be used.