blob: 7281e83ef5d2d77ec531a6a9b49eba9284bf721d [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4
5<chapter id='sdk-using-the-standard-sdk'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -06006 <title>Using the Standard SDK</title>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05007
8 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -06009 This chapter describes the standard SDK and how to install it.
10 Information includes unique installation and setup aspects for the
11 standard SDK.
12 <note>
13 For a side-by-side comparison of main features supported for a
14 standard SDK as compared to an extensible SDK, see the
15 "<link linkend='sdk-manual-intro'>Introduction</link>"
16 section.
17 </note>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050018 </para>
19
20 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060021 You can use a standard SDK to work on Makefile, Autotools, and
22 Eclipse-based projects.
23 See the
24 "<link linkend='sdk-working-projects'>Working with Different Types of Projects</link>"
25 chapter for more information.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026 </para>
27
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028 <section id='sdk-standard-sdk-intro'>
29 <title>Why use the Standard SDK and What is in It?</title>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030
Patrick Williamsc0f7c042017-02-23 20:41:17 -060031 <para>
32 The Standard SDK provides a cross-development toolchain and
33 libraries tailored to the contents of a specific image.
34 You would use the Standard SDK if you want a more traditional
35 toolchain experience as compared to the extensible SDK, which
36 provides an internal build system and the
37 <filename>devtool</filename> functionality.
38 </para>
39
40 <para>
41 The installed Standard SDK consists of several files and
42 directories.
43 Basically, it contains an SDK environment setup script, some
44 configuration files, and host and target root filesystems to
45 support usage.
46 You can see the directory structure in the
47 "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>"
48 section.
49 </para>
50 </section>
51
52 <section id='sdk-installing-the-sdk'>
53 <title>Installing the SDK</title>
54
55 <para>
56 The first thing you need to do is install the SDK on your host
57 development machine by running the <filename>*.sh</filename>
58 installation script.
59 </para>
60
61 <para>
62 You can download a tarball installer, which includes the
63 pre-built toolchain, the <filename>runqemu</filename>
64 script, and support files from the appropriate directory under
65 <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>.
66 Toolchains are available for 32-bit and 64-bit x86 development
67 systems from the <filename>i686</filename> and
68 <filename>x86_64</filename> directories, respectively.
69 The toolchains the Yocto Project provides are based off the
70 <filename>core-image-sato</filename> image and contain
71 libraries appropriate for developing against that image.
72 Each type of development system supports five or more target
73 architectures.
74 </para>
75
76 <para>
77 The names of the tarball installer scripts are such that a
78 string representing the host system appears first in the
79 filename and then is immediately followed by a string
80 representing the target architecture.
81 <literallayout class='monospaced'>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050082 poky-glibc-<replaceable>host_system</replaceable>-<replaceable>image_type</replaceable>-<replaceable>arch</replaceable>-toolchain-<replaceable>release_version</replaceable>.sh
83
84 Where:
85 <replaceable>host_system</replaceable> is a string representing your development system:
86
87 i686 or x86_64.
88
89 <replaceable>image_type</replaceable> is the image for which the SDK was built.
90
91 <replaceable>arch</replaceable> is a string representing the tuned target architecture:
92
93 i586, x86_64, powerpc, mips, armv7a or armv5te
94
95 <replaceable>release_version</replaceable> is a string representing the release number of the
96 Yocto Project:
97
98 &DISTRO;, &DISTRO;+snapshot
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050099 </literallayout>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600100 For example, the following SDK installer is for a 64-bit
101 development host system and a i586-tuned target architecture
102 based off the SDK for <filename>core-image-sato</filename> and
103 using the current &DISTRO; snapshot:
104 <literallayout class='monospaced'>
105 poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
106 </literallayout>
107 <note>
108 As an alternative to downloading an SDK, you can build the
109 SDK installer.
110 For information on building the installer, see the
111 "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
112 section.
113 Another helpful resource for building an installer is the
114 <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>Cookbook guide to Making an Eclipse Debug Capable Image</ulink>
115 wiki page.
116 This wiki page focuses on development when using the Eclipse
117 IDE.
118 </note>
119 </para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500120
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600121 <para>
122 The SDK and toolchains are self-contained and by default are
123 installed into <filename>/opt/poky</filename>.
124 However, when you run the SDK installer, you can choose an
125 installation directory.
126 <note>
127 You must change the permissions on the SDK
128 installer script so that it is executable:
129 <literallayout class='monospaced'>
130 $ chmod +x poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
131 </literallayout>
132 </note>
133 </para>
134
135 <para>
136 The following command shows how to run the installer given a
137 toolchain tarball for a 64-bit x86 development host system and
138 a 32-bit x86 target architecture.
139 The example assumes the SDK installer is located in
140 <filename>~/Downloads/</filename>.
141 <note>
142 If you do not have write permissions for the directory
143 into which you are installing the SDK, the installer
144 notifies you and exits.
145 Be sure you have write permissions in the directory and
146 run the installer again.
147 </note>
148 <literallayout class='monospaced'>
149 $ ./poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
150 Poky (Yocto Project Reference Distro) SDK installer version &DISTRO;
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500151 ===============================================================
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600152 Enter target directory for SDK (default: /opt/poky/&DISTRO;):
153 You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed[Y/n]? Y
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500154 Extracting SDK.......................................................................done
155 Setting it up...done
156 SDK has been successfully set up and is ready to be used.
157 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600158 $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500159 </literallayout>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500160 </para>
161
162 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600163 Again, reference the
164 "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>"
165 section for more details on the resulting directory structure of
166 the installed SDK.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500167 </para>
168 </section>
169
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600170 <section id='sdk-running-the-sdk-environment-setup-script'>
171 <title>Running the SDK Environment Setup Script</title>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500172
173 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600174 Once you have the SDK installed, you must run the SDK environment
175 setup script before you can actually use it.
176 This setup script resides in the directory you chose when you
177 installed the SDK.
178 For information on where this setup script can reside, see the
179 "<link linkend='sdk-appendix-obtain'>Obtaining the SDK</link>"
180 Appendix.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500181 </para>
182
183 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600184 Before running the script, be sure it is the one that matches the
185 architecture for which you are developing.
186 Environment setup scripts begin with the string
187 "<filename>environment-setup</filename>" and include as part of
188 their name the tuned target architecture.
189 For example, the command to source a setup script for an IA-based
190 target machine using i586 tuning and located in the default SDK
191 installation directory is as follows:
192 <literallayout class='monospaced'>
193 $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
194 </literallayout>
195 When you run the setup script, the same environment variables are
196 defined as are when you run the setup script for an extensible SDK.
197 See the
198 "<link linkend='sdk-running-the-extensible-sdk-environment-setup-script'>Running the Extensible SDK Environment Setup Script</link>"
199 section for more information.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500200 </para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500201 </section>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500202</chapter>
203<!--
204vim: expandtab tw=80 ts=4
205-->