~ubuntu-branches/ubuntu/karmic/kdevelop/karmic

« back to all changes in this revision

Viewing changes to doc/kdevelop3_outdated/adv-build-management.docbook

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-08-22 15:48:51 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20090822154851-4dqyy2qn34aj8ed5
Tags: 4:3.9.95-0ubuntu1
* New upstream release:
  - Fixes LP: #407526
* Merge from Debian Experimental, remaining changes:
  - Conflict/replace on old -kde4 packages, this can go away in karmic+1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<chapter id="adv-build-management">
 
2
<title>Advanced Build Management</title>
 
3
<indexterm zone="adv-build-management"><primary>&automake;</primary></indexterm>
 
4
 
 
5
<sect1 id="buildconfigurations">
 
6
<title>Multiple Build Configurations</title>
 
7
<indexterm zone="buildconfigurations"><primary>build configurations</primary><secondary>multiple</secondary></indexterm>
 
8
 
 
9
<para>
 
10
(... to be written ...)
 
11
</para>
 
12
 
 
13
</sect1> <!-- buildconfigurations -->
 
14
 
 
15
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 
16
 
 
17
<sect1 id="crosscompiling">
 
18
<title>Cross-Compiling</title>
 
19
<indexterm zone="crosscompiling"><primary>cross compiling</primary></indexterm>
 
20
<indexterm zone="crosscompiling"><primary>compiling</primary><secondary>cross</secondary></indexterm>
 
21
<indexterm zone="crosscompiling"><primary><option>--host</option></primary></indexterm>
 
22
 
 
23
<para>
 
24
When you have suitable cross compilers available, you can cross compile your
 
25
programs for processors and operating systems different from the system where
 
26
&kdevelop; and the compiler is running. The &GNU; compiler collection &gcc; can
 
27
be configured and compiled as a cross compiler if you compile it yourself.
 
28
Consult the <ulink url="info://gcc/Cross-Compiler">GCC info pages</ulink> for
 
29
more information. Some &Linux; distributions also provide binary packages.
 
30
</para>
 
31
 
 
32
<para>
 
33
An <application>automake</application> based package can easily be
 
34
cross-compiled by specifying the <option>--host</option> option to the
 
35
configure script and setting the <envar>CC</envar> and <envar>CXX</envar>
 
36
environment variables to the respective cross compiler binaries. Often you
 
37
want to switch between a the cross-compiled version of your application and
 
38
one compiled for your development system. For this, it is advantageous to
 
39
use &kdevelop; capability of creating multiple build configurations, as
 
40
explained in <xref linkend="buildconfigurations"/>. Once you have created a
 
41
new build configuration for cross-compiling in the
 
42
<menuchoice><guimenu>Project</guimenu><guimenuitem>Project
 
43
Options...</guimenuitem></menuchoice> dialog, add the option
 
44
</para>
 
45
 
 
46
<screen><option>--host=</option><replaceable>platform</replaceable></screen>
 
47
 
 
48
<para>
 
49
to the configure options. The <replaceable>platform</replaceable> name
 
50
is a tuple of the form
 
51
</para>
 
52
 
 
53
<programlisting>cpu-vendor-os</programlisting>
 
54
<para>or</para>
 
55
<programlisting>cpu-vendor-kernel-os</programlisting>
 
56
 
 
57
<para>
 
58
For many combinations, you can use a short form, for instance
 
59
<wordasword>i386-linux</wordasword> or <wordasword>arm-elf</wordasword>.
 
60
</para>
 
61
 
 
62
</sect1> <!-- crosscompiling -->
 
63
 
 
64
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 
65
 
 
66
<sect1 id="qtembedded">
 
67
<title>Qt/Embedded</title>
 
68
<indexterm zone="qtembedded"><primary>embedded</primary><secondary>Qt</secondary></indexterm>
 
69
<indexterm zone="qtembedded"><primary>Qt/Embedded</primary></indexterm>
 
70
<indexterm zone="qtembedded"><primary>Qtopia</primary></indexterm>
 
71
<indexterm zone="qtembedded"><primary>framebuffer</primary></indexterm>
 
72
 
 
73
<para>
 
74
&qte; is a version of the &Qt; library that does not use the X window
 
75
system, but draws directly to the framebuffer on &Linux; systems. It is
 
76
therefore interesting for embedded systems which have tight restrictions
 
77
on the memory usage of the whole system. Its &API; is fully compatible with
 
78
the one of the X11 version.
 
79
</para>
 
80
 
 
81
<para>
 
82
Developing an application for &qte; with &kdevelop; is not very different
 
83
from developing a program for the X11 version of &Qt;. In fact, you can use the
 
84
same codebase for both versions. If you use the autoproject project
 
85
management, you switch to the embedded version by passing the argument
 
86
<option>--enable-embedded</option> to the configure script. You can set
 
87
this in the <menuchoice><guimenu>Project</guimenu>
 
88
<guimenuitem>Project Options...</guimenuitem></menuchoice> dialog under
 
89
<guilabel>Configure Options</guilabel>. With the option
 
90
<option>--with-qt-dir=DIR</option> you set the directory in which &qte;
 
91
is installed.
 
92
</para>
 
93
 
 
94
<para>
 
95
After configuring and compiling your application with these options, it will
 
96
link with the <filename>libqpe.so</filename> library. This version of your
 
97
application will not normally run when you use X11. In order to test it,
 
98
run it under the control of the program <application>qvfb</application>
 
99
(&Qt; Virtual Frame Buffer). This is done by starting
 
100
<application>qvfb</application> and then starting your application with
 
101
</para>
 
102
 
 
103
<screen><command>app <option>-qws</option> <option>-display QVFb:0</option></command></screen>
 
104
 
 
105
<para>
 
106
Naturally, when you have a working version of your application, you
 
107
will want to use it on the target processor. For this, it will probably
 
108
be convenient to create multiple build configurations, as explained above,
 
109
so that you can quickly switch between the version running on your development
 
110
system and the version running on the target system.
 
111
</para>
 
112
 
 
113
<para>
 
114
Applications for &qte; normally run as single applications on the
 
115
device they are designed for. Trolltech also supports Qtopia, which is a
 
116
collection of applications for PIM, web browsing and various other areas that
 
117
work together in a consistent manner. It is the standard environment for
 
118
instance on the Sharp Zaurus. You can write applications that integrate into
 
119
this environment by using the Qtopia SDK. This implies making your application
 
120
class a subclass of <classname>QPEApplication</classname> and linking to the
 
121
library <filename>libqpe.so</filename>. If you develop your application with
 
122
the autoproject project management, you have to add
 
123
<option>--enable-qtopia</option> to the configure options.
 
124
</para>
 
125
 
 
126
</sect1> <!-- qtembedded -->
 
127
 
 
128
</chapter> <!-- adv-build-management -->