summaryrefslogtreecommitdiffstats
path: root/documentation/adt-manual/adt-command.xml
blob: e57c15a983744391157acffbad1d3ab117937321 (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
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<chapter id='using-the-command-line'>
<title>Using the Command Line</title>
    <para>
        Recall that earlier we talked about how to use an existing toolchain 
        tarball that had been installed into <filename>/opt/poky</filename>, 
        which is outside of the Poky build environment 
        (see <xref linkend='using-an-existing-toolchain-tarball'>
        “Using an Existing Toolchain Tarball”)</xref>.  
        And, that sourcing your architecture-specific environment setup script 
        initializes a suitable development environment.  
        This setup occurs by adding the compiler, QEMU scripts, QEMU binary, 
        a special version of <filename>pkgconfig</filename> and other useful 
        utilities to the <filename>PATH</filename> variable.
        Variables to assist pkgconfig and autotools are also defined so that, 
        for example, <filename>configure.sh</filename> can find pre-generated 
        test results for tests that need target hardware on which to run.  
        These conditions allow you to easily use the toolchain outside of the 
        Poky build environment on both autotools-based projects and 
        makefile-based projects.
    </para>

<section id='autotools-based-projects'>
<title>Autotools-Based Projects</title>
    <para>
        For an autotools-based project you can use the cross-toolchain by just 
        passing the appropriate host option to <filename>configure.sh</filename>.
        The host option you use is derived from the name of the environment setup 
        script in <filename>/opt/poky</filename> resulting from unpacking the 
        cross-toolchain tarball.
        For example, the host option for an ARM-based target that uses the GNU EABI 
        is <filename>armv5te-poky-linux-gnueabi</filename>.
        Note that the name of the script is 
        <filename>environment-setup-armv5te-poky-linux-gnueabi</filename>.
        Thus, the following command works:
        <literallayout class='monospaced'>
     $ configure &dash;&dash;host-armv5te-poky-linux-gnueabi &dash;&dash;with-libtool-sysroot=&lt;sysroot-dir&gt;
        </literallayout>
    </para>
    <para>
        This single command updates your project and rebuilds it using the appropriate 
        cross-toolchain tools.
    </para>
</section>

<section id='makefile-based-projects'>
<title>Makefile-Based Projects</title>
    <para>
        For a makefile-based project you use the cross-toolchain by making sure 
        the tools are used.  
        You can do this as follows:
        <literallayout class='monospaced'>
     CC=arm-poky-linux-gnueabi-gcc
     LD=arm-poky-linux-gnueabi-ld
     CFLAGS=”${CFLAGS} &dash;&dash;sysroot=&lt;sysroot-dir&gt;”
     CXXFLAGS=”${CXXFLAGS} &dash;&dash;sysroot=&lt;sysroot-dir&gt;</literallayout>
    </para>
</section>

</chapter>
<!--
vim: expandtab tw=80 ts=4
-->