summaryrefslogtreecommitdiffstats
path: root/doc/kdevelop/adv-build-management.docbook
blob: e589a00761e4492fce55102c030e5a771ddb3038 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<chapter id="adv-build-management">
<title>Advanced Build Management</title>
<indexterm zone="adv-build-management"><primary>&automake;</primary></indexterm>

<sect1 id="buildconfigurations">
<title>Multiple Build Configurations</title>
<indexterm zone="buildconfigurations"><primary>build configurations</primary><secondary>multiple</secondary></indexterm>

<para>
(... to be written ...)
</para>

</sect1> <!-- buildconfigurations -->

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<sect1 id="crosscompiling">
<title>Cross-Compiling</title>
<indexterm zone="crosscompiling"><primary>cross compiling</primary></indexterm>
<indexterm zone="crosscompiling"><primary>compiling</primary><secondary>cross</secondary></indexterm>
<indexterm zone="crosscompiling"><primary><option>--host</option></primary></indexterm>

<para>
When you have suitable cross compilers available, you can cross compile your
programs for processors and operating systems different from the system where
&kdevelop; and the compiler is running. The &GNU; compiler collection &gcc; can
be configured and compiled as a cross compiler if you compile it yourself.
Consult the <ulink url="info://gcc/Cross-Compiler">GCC info pages</ulink> for
more information. Some &Linux; distributions also provide binary packages.
</para>

<para>
An <application>automake</application> based package can easily be
cross-compiled by specifying the <option>--host</option> option to the
configure script and setting the <envar>CC</envar> and <envar>CXX</envar>
environment variables to the respective cross compiler binaries. Often you
want to switch between a the cross-compiled version of your application and
one compiled for your development system. For this, it is advantageous to
use &kdevelop; capability of creating multiple build configurations, as
explained in <xref linkend="buildconfigurations"/>. Once you have created a
new build configuration for cross-compiling in the
<menuchoice><guimenu>Project</guimenu><guimenuitem>Project
Options...</guimenuitem></menuchoice> dialog, add the option
</para>

<screen><option>--host=</option><replaceable>platform</replaceable></screen>

<para>
to the configure options. The <replaceable>platform</replaceable> name
is a tuple of the form
</para>

<programlisting>cpu-vendor-os</programlisting>
<para>or</para>
<programlisting>cpu-vendor-kernel-os</programlisting>

<para>
For many combinations, you can use a short form, for instance
<wordasword>i386-linux</wordasword> or <wordasword>arm-elf</wordasword>.
</para>

</sect1> <!-- crosscompiling -->

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<sect1 id="qtembedded">
<title>Qt/Embedded</title>
<indexterm zone="qtembedded"><primary>embedded</primary><secondary>Qt</secondary></indexterm>
<indexterm zone="qtembedded"><primary>Qt/Embedded</primary></indexterm>
<indexterm zone="qtembedded"><primary>Qtopia</primary></indexterm>
<indexterm zone="qtembedded"><primary>framebuffer</primary></indexterm>

<para>
&qte; is a version of the &Qt; library that does not use the X window
system, but draws directly to the framebuffer on &Linux; systems. It is
therefore interesting for embedded systems which have tight restrictions
on the memory usage of the whole system. Its &API; is fully compatible with
the one of the X11 version.
</para>

<para>
Developing an application for &qte; with &kdevelop; is not very different
from developing a program for the X11 version of &Qt;. In fact, you can use the
same codebase for both versions. If you use the autoproject project
management, you switch to the embedded version by passing the argument
<option>--enable-embedded</option> to the configure script. You can set
this in the <menuchoice><guimenu>Project</guimenu>
<guimenuitem>Project Options...</guimenuitem></menuchoice> dialog under
<guilabel>Configure Options</guilabel>. With the option
<option>--with-qt-dir=DIR</option> you set the directory in which &qte;
is installed.
</para>

<para>
After configuring and compiling your application with these options, it will
link with the <filename>libqpe.so</filename> library. This version of your
application will not normally run when you use X11. In order to test it,
run it under the control of the program <application>qvfb</application>
(&Qt; Virtual Frame Buffer). This is done by starting
<application>qvfb</application> and then starting your application with
</para>

<screen><command>app <option>-qws</option> <option>-display QVFb:0</option></command></screen>

<para>
Naturally, when you have a working version of your application, you
will want to use it on the target processor. For this, it will probably
be convenient to create multiple build configurations, as explained above,
so that you can quickly switch between the version running on your development
system and the version running on the target system.
</para>

<para>
Applications for &qte; normally run as single applications on the
device they are designed for. Trolltech also supports Qtopia, which is a
collection of applications for PIM, web browsing and various other areas that
work together in a consistent manner. It is the standard environment for
instance on the Sharp Zaurus. You can write applications that integrate into
this environment by using the Qtopia SDK. This implies making your application
class a subclass of <classname>QPEApplication</classname> and linking to the
library <filename>libqpe.so</filename>. If you develop your application with
the autoproject project management, you have to add
<option>--enable-qtopia</option> to the configure options.
</para>

</sect1> <!-- qtembedded -->

</chapter> <!-- adv-build-management -->