Building Qt for Symbian 3 Devices: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Building Qt for Symbian^3 devices=
[[Category:Developing_Qt::Symbian]]<br />[toc align_right=&quot;yes&amp;quot; depth=&quot;3&amp;quot;]
 
= Building Qt for Symbian^3 devices =


This guide provides information required to set up environment and build Qt libraries that can be installed on a Symbian^3 device. The produced libraries will not be binary compatible with any official Qt releases, so any applications you wish to run must be also built against these libraries.
This guide provides information required to set up environment and build Qt libraries that can be installed on a Symbian^3 device. The produced libraries will not be binary compatible with any official Qt releases, so any applications you wish to run must be also built against these libraries.


==Environment setup==
== Environment setup ==


===The following tools are needed for building a Qt package:===
=== The following tools are needed for building a Qt package: ===


* [http://www.symlab.org/wiki/index.php/Kits_Q&As#How_do_I_install_Perl_on_my_C.2B.2B_development_PC.3F ActiveState Perl 5.6.1 (build 638) or newer] ''[symlab.org]'' – Required by Qt and Symbian toolchains.
* &quot;ActiveState Perl 5.6.1 (build 638) or newer&amp;quot;:http://www.symlab.org/wiki/index.php/Kits_Q&amp;amp;As#How_do_I_install_Perl_on_my_C.2B.2B_development_PC.3F - Required by Qt and Symbian toolchains.
* [http://www.symlab.org/wiki/index.php/Kits_Q&As#How_do_I_install_Python_on_my_C.2B.2B_development_PC.3F ActiveState Python 2.6.x or newer] ''[symlab.org]'' – Required by Symbian toolchain.
* &quot;ActiveState Python 2.6.x or newer&amp;quot;:http://www.symlab.org/wiki/index.php/Kits_Q&amp;amp;As#How_do_I_install_Python_on_my_C.2B.2B_development_PC.3F - Required by Symbian toolchain.
* [http://www.symlab.org/wiki/index.php/Product_Development_Toolkit_Quick_Start <span class="caps">PDT</span> 1.7 or newer] ''[symlab.org]'' – Needed for Raptor (sbsv2) toolchain. Also includes Carbide <span class="caps">IDE</span> and other assorted tools.
* &quot;PDT 1.7 or newer&amp;quot;:http://www.symlab.org/wiki/index.php/Product_Development_Toolkit_Quick_Start - Needed for Raptor (sbsv2) toolchain. Also includes Carbide IDE and other assorted tools.
* [http://www.symlab.org/wiki/index.php/How_to_Download_a_PDK <span class="caps">PDK</span> 3.0.3 or newer] ''[symlab.org]'' – Symbian platform.
* &quot;PDK 3.0.3 or newer&amp;quot;:http://www.symlab.org/wiki/index.php/How_to_Download_a_PDK - Symbian platform.
** Note: Installing some parts of the <span class="caps">PDK</span> require “<span class="caps">SYMBIAN</span> <span class="caps">FOUNDATION</span> <span class="caps">RESEARCH</span> &amp; <span class="caps">DEVELOPMENT</span> <span class="caps">LICENSE</span>”, but those parts are not needed to build Qt so you don’t need to worry about missing them.
** Note: Installing some parts of the PDK require &quot;SYMBIAN FOUNDATION RESEARCH &amp; DEVELOPMENT LICENSE&amp;quot;, but those parts are not needed to build Qt so you don't need to worry about missing them.
* The recommended compiler for building Qt libraries is [http://www.symlab.org/wiki/index.php/ARM_Real_View_Compilation_Tools_(RVCT <span class="caps">RVCT</span> 2.2] ''[symlab.org]'')_Quick_Start – which is not available free of charge.
* The recommended compiler for building Qt libraries is &quot;RVCT 2.2 (build 686 or newer)&quot;:http://www.symlab.org/wiki/index.php/ARM_Real_View_Compilation_Tools_(RVCT)''Quick_Start - which is not available free of charge.<br />'''''' Alternatively, &quot;RVCT 4.0 (build 821 or newer)&quot;:http://www.symlab.org/wiki/index.php/ARM_Real_View_Compilation_Tools''(RVCT)_Quick_Start can be used. Unlike version 2.2, version 4.0 is available free of charge for small organizations.
** Alternatively, [http://www.symlab.org/wiki/index.php/ARM_Real_View_Compilation_Tools_(RVCT <span class="caps">RVCT</span> 4.0] ''[symlab.org]'')_Quick_Start can be used. Unlike version 2.2, version 4.0 is available free of charge for small organizations.
* The desired version of Qt source code - Available e.g. via &quot;Gitorius&amp;quot;:http://qt.gitorious.org/+qt-developers/qt/releases or &quot;ftp&amp;quot;:ftp://ftp.qt.nokia.com/qt/source/ (e.g. qt-everywhere-opensource-src-4.7.1.zip).
* The desired version of Qt source code Available e.g. via [http://qt.gitorious.org/+qt-developers/qt/releases Gitorius] ''[qt.gitorious.org]'' or [ftp://ftp.qt.nokia.com/qt/source/ ftp] ''[ftp.qt.nokia.com]'' (e.g. qt-everywhere-opensource-src-4.7.1.zip).


===Required environment variables:===
=== Required environment variables: ===


* <span class="caps">EPOCROOT</span> environment variable must point to <span class="caps">PDK</span> root. E.g. <code>set <span class="caps">EPOCROOT</span>=C:\\PDK\\3.0.3\\</code>
* EPOCROOT environment variable must point to PDK root. E.g. &lt;code&amp;gt;set EPOCROOT=C:PDK3.0.3&lt;/code&amp;gt;
* Depending on compiler you are using:
* Depending on compiler you are using:
** RVCT22BIN, RVCT22INC, and RVCT22LIB. These need to point to <code>bin</code>, <code>inc</code> (or <code>include</code>), and <code>lib</code> directories under your <span class="caps">RVCT</span> 2.2 installation. Normally these are set by <span class="caps">RVCT</span> 2.2 installer.
** RVCT22BIN, RVCT22INC, and RVCT22LIB. These need to point to &lt;code&amp;gt;bin&amp;lt;/code&amp;gt;, &lt;code&amp;gt;inc&amp;lt;/code&amp;gt; (or &lt;code&amp;gt;include&amp;lt;/code&amp;gt;), and &lt;code&amp;gt;lib&amp;lt;/code&amp;gt; directories under your RVCT 2.2 installation. Normally these are set by RVCT 2.2 installer.
** RVCT40BIN, RVCT40INC, and RVCT40LIB are the corresponding variables for <span class="caps">RVCT</span> 4.0.
** RVCT40BIN, RVCT40INC, and RVCT40LIB are the corresponding variables for RVCT 4.0.
* <span class="caps">PATH</span> environment variable must contain the following paths in the beginning to ensure correct tools are used.
* PATH environment variable must contain the following paths in the beginning to ensure correct tools are used.
** <code>\&lt;Qt source root\&gt;\\bin</code> for qmake and Qt tools.
** &lt;code&amp;gt;lt;Qt source rootgt;bin&amp;lt;/code&amp;gt; for qmake and Qt tools.
** <code>\&lt;<span class="caps">PDT</span> installation root\&gt;\\Raptor\\win32\\mingw\\bin</code> for Mingw make.
** &lt;code&amp;gt;lt;PDT installation rootgt;Raptorwin32mingwbin&amp;lt;/code&amp;gt; for Mingw make.
** <code>\&lt;<span class="caps">PDT</span> installation root\&gt;\\Raptor\\bin</code> for sbs tool.
** &lt;code&amp;gt;lt;PDT installation rootgt;Raptorbin&amp;lt;/code&amp;gt; for sbs tool.
** <code>%EPOCROOT%epoc32\\tools</code> for required Symbian tools.
** &lt;code&amp;gt;EPOCROOT%epoc32tools&amp;lt;/code&amp;gt; for required Symbian tools.
<br />Here are sample commands you can edit to match your environment and save as ''setenv.bat'' to set up your Qt building environment:


Here are sample commands you can edit to match your environment and save as ''setenv.bat'' to set up your Qt building environment:
<br />Change to your Qt source root directory:<br /><code> C:<br /> cd </code>
<br />Set up the environment variables:
<br /><code> SET EPOCROOT=C:.0.3 SET RVCT22BIN=C:_22\bin<br /> SET RVCT22INC=C:_22\inc<br /> SET RVCT22LIB=C:_22\lib<br /> SET PATH=&amp;#x25;CD&amp;amp;#x25;;C:_1.7\Raptor\win32\mingw\bin;C:_1.7\Raptor\bin;&amp;#x25;EPOCROOT&amp;amp;#x25;epoc32\tools;&amp;#x25;PATH&amp;amp;#x25;
<br /></code>


Change to your Qt source root directory:<br />


Set up the environment variables:
<br />h3. Signing certificate
<br />A signing certificate is needed if you are not satisfied with the default self-signable set of supported capabilities for Qt libraries (i.e. LocalServices, NetworkServices, ReadUserData, UserEnvironment, and WriteUserData). The capabilities Qt libraries require depends on the capabilities of the applications you plan on running against the Qt libraries you build; the Qt libraries need at least all of the capabilities the application has. The best certificate to use would be a manufacturer’s RnD certificate, but unless you are working for a device manufacturer, you probably won’t have access to such a certificate. The next best thing is a Symbian developer certificate. See &quot;here&amp;quot;:https://www.symbiansigned.com/app/page for details about acquiring a developer certificate.
<br />h2. Building Qt
<br />h3. Configure Qt
<br />Give the following command in your Qt source root directory to configure Qt:
<br /><code>configure -platform win32-g++ -xplatform symbian-sbsv2 -openvg -graphicssystem openvg -no-usedeffiles -nomake demos -nomake examples -qtlibinfix OfMyOwn -make make<br /></code>
<br />* '''Note:''' If you do not need Webkit, you can reduce the build time around 50 by adding “-no-webkit” parameter to configure.


===Signing certificate===
=== Build Qt &amp; QtWebkit ===


A signing certificate is needed if you are not satisfied with the default self-signable set of supported capabilities for Qt libraries (i.e. LocalServices, NetworkServices, ReadUserData, UserEnvironment, and WriteUserData). The capabilities Qt libraries require depends on the capabilities of the applications you plan on running against the Qt libraries you build; the Qt libraries need at least all of the capabilities the application has. The best certificate to use would be a manufacturer’s RnD certificate, but unless you are working for a device manufacturer, you probably won’t have access to such a certificate. The next best thing is a Symbian developer certificate. See [https://www.symbiansigned.com/app/page here] ''[symbiansigned.com]'' for details about acquiring a developer certificate.
Depending on your chosen compiler, select one of commands below to compile Qt and give it at the Qt source root directory:


==Building Qt==
<code>make release-armv6<br />make release-armv6-rvct4.0<br /></code>


===Configure Qt===
== Installing Qt libraries to device ==


Give the following command in your Qt source root directory to configure Qt:
By default Qt libraries are built with “All -Tcb” capabilities, which requires a certificate normally only available for device manufacturers to sign. Depending on what kind of certificate you have available, you might need to patch the capabilities of the Qt libraries. To create Qt installation packages, run the following commands:


* '''Note:''' If you do not need Webkit, you can reduce the build time around 50% by adding “-no-webkit” parameter to configure.
If you are content with default set of self-signable capabilities and do not have any extra certificate:


===Build Qt &amp; QtWebkit===
<code>cd src\s60installs<br />make sis QT_SIS_OPTIONS=-i


Depending on your chosen compiler, select one of commands below to compile Qt and give it at the Qt source root directory:
cd ..rdparty\webkit\WebCore<br />make sis QT_SIS_OPTIONS=-i<br /></code>


==Installing Qt libraries to device==
If you have a manufacturer RnD certificate and a RnD device:<br /><code><br />cd src\s60installs<br />make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=&lt;certificate file&amp;gt; QT_SIS_KEY=&lt;certificate key file&amp;gt;


By default Qt libraries are built with “All -Tcb” capabilities, which requires a certificate normally only available for device manufacturers to sign. Depending on what kind of certificate you have available, you might need to patch the capabilities of the Qt libraries. To create Qt installation packages, run the following commands:
cd ..rdparty\webkit\WebCore<br />make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=&lt;certificate file&amp;gt; QT_SIS_KEY=&lt;certificate key file&amp;gt;<br /></code>


If you are content with default set of self-signable capabilities and do not have any extra certificate:
If you are using developer certificate with maximum non-manufacturer capabilities:


If you have a manufacturer RnD certificate and a RnD device:<br />
<code>cd src\s60installs<br />patch_capabilities.pl QtOfMyOwn_template.pkg release-armv6 &quot;ALL -Tcb -AllFiles -DRM&amp;quot;<br />make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=&lt;certificate file&amp;gt; QT_SIS_KEY=&lt;certificate key file&amp;gt;


If you are using developer certificate with maximum non-manufacturer capabilities:
cd ..rdparty\webkit\WebCore<br />patch_capabilities.pl QtWebKitOfMyOwn_template.pkg release-armv6 &quot;ALL -Tcb -AllFiles -DRM&amp;quot;<br />make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=&lt;certificate file&amp;gt; QT_SIS_KEY=&lt;certificate key file&amp;gt;<br /></code>


* '''Note 1:''' <code>QT_SIS_OPTIONS=-i</code> is simply a convenience parameter that causes automatic installation to a connected device after package is created.
* '''Note 1:''' &lt;code&amp;gt;QT_SIS_OPTIONS=-i&amp;lt;/code&amp;gt; is simply a convenience parameter that causes automatic installation to a connected device after package is created.


* '''Note 2:''' Infixing Qml plugins is broken in Qt 4.7.0 and 4.7.1 releases, so if the device already has Qt 4.7.x pre-installed, you will need to edit the .pkg files and remove all lines with qmldir on them before creating the package or you won’t be able to install it due to same files already having been installed by existing package. You can also expect qml plugins not working properly with infixed Qt in these releases.
* '''Note 2:''' Infixing Qml plugins is broken in Qt 4.7.0 and 4.7.1 releases, so if the device already has Qt 4.7.x pre-installed, you will need to edit the .pkg files and remove all lines with qmldir on them before creating the package or you won’t be able to install it due to same files already having been installed by existing package. You can also expect qml plugins not working properly with infixed Qt in these releases.


==Building applications==
== Building applications ==
 
Build your own applications normally using the same make target that you used to build the Qt and use same “make sis” options. E.g. for <span class="caps">RVCT</span> 2.2 build using self-signed certificate, use the following commands:
 
* '''Note:''' Armv6 works fine out of the box for building Qt libraries and regular Qt applications against the <span class="caps">PDK</span>. However, Qt applications that do not include gui need little extra work in Qt releases prior to 4.7.2. To enable building non-gui applications with armv6 for such releases, copy <code>&lt;<span class="caps">PDK</span> root&gt;\epoc32\release\armv5\*\libcrt0*.lib</code> to the corresponding folders under <code>&lt;<span class="caps">PDK</span> root&gt;\epoc32\release\armv6</code>.


===Categories:===
Build your own applications normally using the same make target that you used to build the Qt and use same “make sis” options. E.g. for RVCT 2.2 build using self-signed certificate, use the following commands:


* [[:Category:Developing Qt|Developing_Qt]]
<code>cd &lt;your app dir&amp;gt;<br />qmake<br />make release-armv6<br />make sis QT_SIS_OPTIONS=-i<br /></code>
** [[:Category:Developing Qt::Symbian|Symbian]]

Revision as of 10:06, 24 February 2015


[toc align_right="yes&quot; depth="3&quot;]

Building Qt for Symbian^3 devices

This guide provides information required to set up environment and build Qt libraries that can be installed on a Symbian^3 device. The produced libraries will not be binary compatible with any official Qt releases, so any applications you wish to run must be also built against these libraries.

Environment setup

The following tools are needed for building a Qt package:

Required environment variables:

  • EPOCROOT environment variable must point to PDK root. E.g. <code&gt;set EPOCROOT=C:PDK3.0.3</code&gt;
  • Depending on compiler you are using:
    • RVCT22BIN, RVCT22INC, and RVCT22LIB. These need to point to <code&gt;bin&lt;/code&gt;, <code&gt;inc&lt;/code&gt; (or <code&gt;include&lt;/code&gt;), and <code&gt;lib&lt;/code&gt; directories under your RVCT 2.2 installation. Normally these are set by RVCT 2.2 installer.
    • RVCT40BIN, RVCT40INC, and RVCT40LIB are the corresponding variables for RVCT 4.0.
  • PATH environment variable must contain the following paths in the beginning to ensure correct tools are used.
    • <code&gt;lt;Qt source rootgt;bin&lt;/code&gt; for qmake and Qt tools.
    • <code&gt;lt;PDT installation rootgt;Raptorwin32mingwbin&lt;/code&gt; for Mingw make.
    • <code&gt;lt;PDT installation rootgt;Raptorbin&lt;/code&gt; for sbs tool.
    • <code&gt;EPOCROOT%epoc32tools&lt;/code&gt; for required Symbian tools.


Here are sample commands you can edit to match your environment and save as setenv.bat to set up your Qt building environment:


Change to your Qt source root directory:

 C:<br /> cd


Set up the environment variables:


 SET EPOCROOT=C:.0.3 SET RVCT22BIN=C:_22\bin<br /> SET RVCT22INC=C:_22\inc<br /> SET RVCT22LIB=C:_22\lib<br /> SET PATH=&amp;#x25;CD&amp;amp;#x25;;C:_1.7\Raptor\win32\mingw\bin;C:_1.7\Raptor\bin;&amp;#x25;EPOCROOT&amp;amp;#x25;epoc32\tools;&amp;#x25;PATH&amp;amp;#x25;
<br />



h3. Signing certificate
A signing certificate is needed if you are not satisfied with the default self-signable set of supported capabilities for Qt libraries (i.e. LocalServices, NetworkServices, ReadUserData, UserEnvironment, and WriteUserData). The capabilities Qt libraries require depends on the capabilities of the applications you plan on running against the Qt libraries you build; the Qt libraries need at least all of the capabilities the application has. The best certificate to use would be a manufacturer’s RnD certificate, but unless you are working for a device manufacturer, you probably won’t have access to such a certificate. The next best thing is a Symbian developer certificate. See "here&quot;:https://www.symbiansigned.com/app/page for details about acquiring a developer certificate.
h2. Building Qt
h3. Configure Qt
Give the following command in your Qt source root directory to configure Qt:


configure -platform win32-g++ -xplatform symbian-sbsv2 -openvg -graphicssystem openvg -no-usedeffiles -nomake demos -nomake examples -qtlibinfix OfMyOwn -make make<br />


* Note: If you do not need Webkit, you can reduce the build time around 50 by adding “-no-webkit” parameter to configure.

Build Qt & QtWebkit

Depending on your chosen compiler, select one of commands below to compile Qt and give it at the Qt source root directory:

make release-armv6<br />make release-armv6-rvct4.0<br />

Installing Qt libraries to device

By default Qt libraries are built with “All -Tcb” capabilities, which requires a certificate normally only available for device manufacturers to sign. Depending on what kind of certificate you have available, you might need to patch the capabilities of the Qt libraries. To create Qt installation packages, run the following commands:

If you are content with default set of self-signable capabilities and do not have any extra certificate:

cd src\s60installs<br />make sis QT_SIS_OPTIONS=-i

cd ..rdparty\webkit\WebCore<br />make sis QT_SIS_OPTIONS=-i<br />

If you have a manufacturer RnD certificate and a RnD device:

<br />cd src\s60installs<br />make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=&lt;certificate file&amp;gt; QT_SIS_KEY=&lt;certificate key file&amp;gt;

cd ..rdparty\webkit\WebCore<br />make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=&lt;certificate file&amp;gt; QT_SIS_KEY=&lt;certificate key file&amp;gt;<br />

If you are using developer certificate with maximum non-manufacturer capabilities:

cd src\s60installs<br />patch_capabilities.pl QtOfMyOwn_template.pkg release-armv6 &quot;ALL -Tcb -AllFiles -DRM&amp;quot;<br />make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=&lt;certificate file&amp;gt; QT_SIS_KEY=&lt;certificate key file&amp;gt;

cd ..rdparty\webkit\WebCore<br />patch_capabilities.pl QtWebKitOfMyOwn_template.pkg release-armv6 &quot;ALL -Tcb -AllFiles -DRM&amp;quot;<br />make sis QT_SIS_OPTIONS=-i QT_SIS_CERTIFICATE=&lt;certificate file&amp;gt; QT_SIS_KEY=&lt;certificate key file&amp;gt;<br />
  • Note 1: <code&gt;QT_SIS_OPTIONS=-i&lt;/code&gt; is simply a convenience parameter that causes automatic installation to a connected device after package is created.
  • Note 2: Infixing Qml plugins is broken in Qt 4.7.0 and 4.7.1 releases, so if the device already has Qt 4.7.x pre-installed, you will need to edit the .pkg files and remove all lines with qmldir on them before creating the package or you won’t be able to install it due to same files already having been installed by existing package. You can also expect qml plugins not working properly with infixed Qt in these releases.

Building applications

Build your own applications normally using the same make target that you used to build the Qt and use same “make sis” options. E.g. for RVCT 2.2 build using self-signed certificate, use the following commands:

cd &lt;your app dir&amp;gt;<br />qmake<br />make release-armv6<br />make sis QT_SIS_OPTIONS=-i<br />