Building Qt 4 for BlackBerry: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Building Qt4 for BlackBerry=
[[Category:BlackBerry]]<br />[[Category:HowTo]]


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 <span class="caps">NDK</span>, see [[Qt-Creator-with-BlackBerry-10|this page]] for more details.
= Building Qt4 for BlackBerry =


===Setting up the environment===
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.


See [[BlackBerry]] for the introduction and further instructions.
=== Setting up the environment ===


Open a terminal window and load the Blackberry <span class="caps">NDK</span> enviroment variables with:
See [[Blackberry]] for the introduction and further instructions.


All the commands below should be ran in the same terminal window.<br /> If you close it between steps ''you need to run the bbndk-env.sh again''.
Open a terminal window and load the Blackberry NDK enviroment variables with:


===Getting the source===
<code>source /opt/bbndk-2.1.0/bbndk-env.sh <code>


'''<span class="caps">NOTE</span>:''' we suggest to start with a clean source tree before building for different architectures (<span class="caps">ARM</span>/x86).
All the commands below should be ran in the same terminal window.<br />If you close it between steps ''you need to run the bbndk-env.sh again''.
 
=== Getting the source ===
 
</code> git clone git://gitorious.org/qt/qt.git </code>
 
'''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:
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><br /> cd qt<br /> git checkout v4.8.3<br /></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.


===Building on a Linux/OS X host.===
=== Building on a Linux/OS X host. ===


====Building Qt 4.8 for <span class="caps">ARM</span> (BlackBerry 10 and PlaybookOS)====
==== Building Qt 4.8 for ARM (BlackBerry 10 and PlaybookOS) ====


When compiling for the '''Playbook''', you also need the '''-no-neon''' option, as <span class="caps">NEON</span> support on the Playbook is known to be flaky. This is only required for Qt 4.8.3 or later.
<code><br /> cd qt<br /> ./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-armv7le-qcc <br /> -little-endian -arch arm -largefile -nomake examples -xmlpatterns -no-webkit -no-rpath  -opengl es2 -reduce-exports -system-sqlite -prefix &lt;prefix&amp;gt;<br /> make<br /> make install<br /></code>


====Building Qt 4.8 for x86 (Simulator)====
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.


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.<br />
==== Building Qt 4.8 for x86 (Simulator) ====


===Building on a Windows host===
<code><br /> cd qt<br /> ./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-x86-qcc <br /> -little-endian -arch i386 -largefile -nomake examples -nomake demos -xmlpatterns -no-webkit  -no-rpath -opengl es2 -reduce-exports -system-sqlite -prefix &lt;prefix&amp;gt;<br /> make<br /> make install<br /></code>


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:
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.<br /><code><br /> ./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-x86-qcc <br /> -little-endian -arch i386 -largefile -nomake examples* -nomake demos -xmlpatterns -no-webkit  -no-rpath -opengl es2 -reduce-exports -system-sqlite* -prefix-install -prefix ~/build/<br /></code>


# Clone <code>git://gitorious.org/qt/qt.git</code> to a separated directory;
=== Building on a Windows host ===
 
In order to build Qt 4.8 for BlackBerry on a Windows host, you will need to rebuild the &lt;code&amp;gt;configure.exe&amp;lt;/code&amp;gt; utility first:<br /># Clone &lt;code&amp;gt;git://gitorious.org/qt/qt.git&amp;lt;/code&amp;gt; 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 <code>configure.exe -opensource -confirm-license</code>
# Configure Qt with &lt;code&amp;gt;configure.exe -opensource -confirm-license&amp;lt;/code&amp;gt;
# <code>cd</code> into <code>tools/configure</code>
# &lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into &lt;code&amp;gt;tools/configure&amp;lt;/code&amp;gt;
# Rebuild with <code>..\..\bin\qmake</code> and then <code>mingw32-make</code>
# Rebuild with &lt;code&amp;gt;..&lt;/code&amp;gt; and then &lt;code&amp;gt;mingw32-make&amp;lt;/code&amp;gt;
# The new <code>configure.exe</code> binary will be place on <code>$QTSRC/configure.exe</code>
# The new &lt;code&amp;gt;configure.exe&amp;lt;/code&amp;gt; binary will be place on &lt;code&amp;gt;$QTSRC/configure.exe&amp;lt;/code&amp;gt;
# You can now use it to replace the <code>configure.exe</code> on the Qt source tree you will use to build for BlackBerry.
# You can now use it to replace the &lt;code&amp;gt;configure.exe&amp;lt;/code&amp;gt; on the Qt source tree you will use to build for BlackBerry.


====Building Qt 4.8 for <span class="caps">ARM</span> (Playbook and phone devices)====
==== Building Qt 4.8 for ARM (Playbook and phone devices) ====
 
<code><br />C:&gt; cd qt<br />C:&gt;configure.exe -opensource -confirm-license -release -xplatform blackberry-armv7le-qcc -arch arm -nomake examples -nomake demos -no-webkit -opengl es2 -inotify -prefix c:stall<br />C:&gt; mingw32-make -j<br />C:&gt; mingw32-make -j install<br /></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).


====Building Qt 4.8 for x86 (Simulator)====
==== Building Qt 4.8 for x86 (Simulator) ====
 
Qt will be installed at C:\dev\qt4install. 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===
<code><br />C:&gt; cd qt<br />C:&gt; configure.exe -opensource -confirm-license -release -xplatform blackberry-x86-qcc -arch i386 -nomake examples -nomake demos -no-webkit -opengl es2 -inotify -prefix c:stall<br />C:&gt; mingw32-make -j<br />C:&gt; mingw32-make -j install<br /></code>


[http://doc.trolltech.com/qtmobility-1.2/ QtMobility] ''[doc.trolltech.com]'' 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.<br /> For various reasons, such as that there will be no more official releases of QtMobility for Qt4, the repository of QtMobility is a [https://gitorious.org/+kdab-developers/qt-mobility/qnx-qt-mobility fork] ''[gitorious.org]'' of the upstream one (unlike the Qt5 version, in which the BlackBerry backends are all upstream).
Qt will be installed at C:stall. Alternatively, you can then use &lt;code&amp;gt;-prefix-install&amp;lt;/code&amp;gt; and pass a directory to the &lt;code&amp;gt;-prefix&amp;lt;/code&amp;gt; option to change the installation directory.


====Building on a Linux host====
=== Building QtMobility ===


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.<br /> Now QtMobility is installed into the Qt installation and is ready to be used.
&quot;QtMobility&amp;quot;: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.<br />For various reasons, such as that there will be no more official releases of QtMobility for Qt4, the repository of QtMobility is a &quot;fork&amp;quot;: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).


===See also===
==== Building on a Linux host ====


* [[Building-Qt5-for-Blackberry|Building Qt5 for Blackberry]]
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.<br /><code><br />$ git clone git://gitorious.org/+kdab-developers/qt-mobility/qnx-qt-mobility.git<br />$ cd qnx-qt-mobility<br />$ ./configure -prefix $QTDIR<br />$ make<br />$ make install<br /></code><br />Now QtMobility is installed into the Qt installation and is ready to be used.
* [[A-HelloWorld-using-the-Blackberry-NDK-CLI-tools|A HelloWorld using the Blackberry <span class="caps">NDK</span> <span class="caps">CLI</span> tools]]
* [[Building and Deploying Qt Applications to the Playbook|Building_and_Deploying_Qt_Applications_to_the_Playbook]]
* [[Deploying Qt to a central place on Blackberry devices|Deploying_Qt_to_a_central_place_on_Blackberry_devices]]


===Categories:===
=== See also ===


* [[:Category:BlackBerry|BlackBerry]]
* [[Building Qt5 for Blackberry]]
* [[:Category:HowTo|HowTo]]
* [[A HelloWorld using the Blackberry NDK CLI tools]]
* [[Building_and_Deploying_Qt_Applications_to_the_Playbook]]

Revision as of 09:59, 24 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.<br />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:

<br /> cd qt<br /> git checkout v4.8.3<br />

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)

<br /> cd qt<br /> ./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-armv7le-qcc <br /> -little-endian -arch arm -largefile -nomake examples -xmlpatterns -no-webkit -no-rpath  -opengl es2 -reduce-exports -system-sqlite -prefix &lt;prefix&amp;gt;<br /> make<br /> make install<br />

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)

<br /> cd qt<br /> ./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-x86-qcc <br /> -little-endian -arch i386 -largefile -nomake examples -nomake demos -xmlpatterns -no-webkit  -no-rpath -opengl es2 -reduce-exports -system-sqlite -prefix &lt;prefix&amp;gt;<br /> make<br /> make install<br />

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.

<br /> ./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-x86-qcc <br /> -little-endian -arch i386 -largefile -nomake examples* -nomake demos -xmlpatterns -no-webkit  -no-rpath -opengl es2 -reduce-exports -system-sqlite* -prefix-install -prefix ~/build/<br />

Building on a Windows host

In order to build Qt 4.8 for BlackBerry on a Windows host, you will need to rebuild the <code&gt;configure.exe&lt;/code&gt; utility first:
# Clone <code&gt;git://gitorious.org/qt/qt.git&lt;/code&gt; to a separated directory;

For Playbook users only: You need to checkout tag v4.8.3 and cherry-pick c14694621aab2e7df13830f80621fb5680b432e4 before you can continue.

  1. Configure Qt with <code&gt;configure.exe -opensource -confirm-license&lt;/code&gt;
  2. <code&gt;cd&lt;/code&gt; into <code&gt;tools/configure&lt;/code&gt;
  3. Rebuild with <code&gt;..</code&gt; and then <code&gt;mingw32-make&lt;/code&gt;
  4. The new <code&gt;configure.exe&lt;/code&gt; binary will be place on <code&gt;$QTSRC/configure.exe&lt;/code&gt;
  5. You can now use it to replace the <code&gt;configure.exe&lt;/code&gt; on the Qt source tree you will use to build for BlackBerry.

Building Qt 4.8 for ARM (Playbook and phone devices)

<br />C:&gt; cd qt<br />C:&gt;configure.exe -opensource -confirm-license -release -xplatform blackberry-armv7le-qcc -arch arm -nomake examples -nomake demos -no-webkit -opengl es2 -inotify -prefix c:stall<br />C:&gt; mingw32-make -j<br />C:&gt; mingw32-make -j install<br />

When compiling for the Playbook, also supply the -no-neon option (see above for the reasons).

Building Qt 4.8 for x86 (Simulator)

<br />C:&gt; cd qt<br />C:&gt; configure.exe -opensource -confirm-license -release -xplatform blackberry-x86-qcc -arch i386 -nomake examples -nomake demos -no-webkit -opengl es2 -inotify -prefix c:stall<br />C:&gt; mingw32-make -j<br />C:&gt; mingw32-make -j install<br />

Qt will be installed at C:stall. Alternatively, you can then use <code&gt;-prefix-install&lt;/code&gt; and pass a directory to the <code&gt;-prefix&lt;/code&gt; option to change the installation directory.

Building QtMobility

"QtMobility&quot;: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&quot;: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.

<br />$ git clone git://gitorious.org/+kdab-developers/qt-mobility/qnx-qt-mobility.git<br />$ cd qnx-qt-mobility<br />$ ./configure -prefix $QTDIR<br />$ make<br />$ make install<br />


Now QtMobility is installed into the Qt installation and is ready to be used.

See also