Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | <!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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 6 | <title>Using the Standard SDK</title> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 7 | |
| 8 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 9 | 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 18 | </para> |
| 19 | |
| 20 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 21 | You can use a standard SDK to work on Makefile, Autotools, and |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 22 | <trademark class='trade'>Eclipse</trademark>-based projects. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 23 | See the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 24 | "<link linkend='sdk-working-projects'>Using the SDK Toolchain Directly</link>" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 25 | chapter for more information. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 26 | </para> |
| 27 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 28 | <section id='sdk-standard-sdk-intro'> |
| 29 | <title>Why use the Standard SDK and What is in It?</title> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 30 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 31 | <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> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 56 | The first thing you need to do is install the SDK on your |
| 57 | <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>Build Host</ulink> |
| 58 | by running the <filename>*.sh</filename> installation script. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 59 | </para> |
| 60 | |
| 61 | <para> |
| 62 | You can download a tarball installer, which includes the |
| 63 | pre-built toolchain, the <filename>runqemu</filename> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 64 | script, and support files from the appropriate |
| 65 | <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchain</ulink> |
| 66 | directory within the Index of Releases. |
| 67 | Toolchains are available for several 32-bit and 64-bit |
| 68 | architectures with the <filename>x86_64</filename> directories, |
| 69 | respectively. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 70 | The toolchains the Yocto Project provides are based off the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 71 | <filename>core-image-sato</filename> and |
| 72 | <filename>core-image-minimal</filename> images and contain |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 73 | libraries appropriate for developing against that image. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 82 | 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 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 89 | <replaceable>image_type</replaceable> is the image for which the SDK was built: |
| 90 | |
| 91 | core-image-minimal or core-image-sato. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 92 | |
| 93 | <replaceable>arch</replaceable> is a string representing the tuned target architecture: |
| 94 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 95 | aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 96 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 97 | <replaceable>release_version</replaceable> is a string representing the release number of the Yocto Project: |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 98 | |
| 99 | &DISTRO;, &DISTRO;+snapshot |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 100 | </literallayout> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 101 | For example, the following SDK installer is for a 64-bit |
| 102 | development host system and a i586-tuned target architecture |
| 103 | based off the SDK for <filename>core-image-sato</filename> and |
| 104 | using the current &DISTRO; snapshot: |
| 105 | <literallayout class='monospaced'> |
| 106 | poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh |
| 107 | </literallayout> |
| 108 | <note> |
| 109 | As an alternative to downloading an SDK, you can build the |
| 110 | SDK installer. |
| 111 | For information on building the installer, see the |
| 112 | "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>" |
| 113 | section. |
| 114 | Another helpful resource for building an installer is the |
| 115 | <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>Cookbook guide to Making an Eclipse Debug Capable Image</ulink> |
| 116 | wiki page. |
| 117 | This wiki page focuses on development when using the Eclipse |
| 118 | IDE. |
| 119 | </note> |
| 120 | </para> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 121 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 122 | <para> |
| 123 | The SDK and toolchains are self-contained and by default are |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 124 | installed into the <filename>poky_sdk</filename> folder in your |
| 125 | home directory. |
| 126 | You can choose to install the extensible SDK in any location when |
| 127 | you run the installer. |
| 128 | However, because files need to be written under that directory |
| 129 | during the normal course of operation, the location you choose |
| 130 | for installation must be writable for whichever |
| 131 | users need to use the SDK. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 132 | </para> |
| 133 | |
| 134 | <para> |
| 135 | The following command shows how to run the installer given a |
| 136 | toolchain tarball for a 64-bit x86 development host system and |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 137 | a 64-bit x86 target architecture. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 138 | The example assumes the SDK installer is located in |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 139 | <filename>~/Downloads/</filename> and has execution rights. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 140 | <note> |
| 141 | If you do not have write permissions for the directory |
| 142 | into which you are installing the SDK, the installer |
| 143 | notifies you and exits. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 144 | For that case, set up the proper permissions in the directory |
| 145 | and run the installer again. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 146 | </note> |
| 147 | <literallayout class='monospaced'> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 148 | $ ./Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 149 | Poky (Yocto Project Reference Distro) SDK installer version &DISTRO; |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 150 | =============================================================== |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 151 | Enter target directory for SDK (default: /opt/poky/&DISTRO;): |
| 152 | You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed[Y/n]? Y |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 153 | Extracting SDK........................................ ..............................done |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 154 | Setting it up...done |
| 155 | SDK has been successfully set up and is ready to be used. |
| 156 | Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 157 | $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 158 | </literallayout> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 159 | </para> |
| 160 | |
| 161 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 162 | Again, reference the |
| 163 | "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>" |
| 164 | section for more details on the resulting directory structure of |
| 165 | the installed SDK. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 166 | </para> |
| 167 | </section> |
| 168 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 169 | <section id='sdk-running-the-sdk-environment-setup-script'> |
| 170 | <title>Running the SDK Environment Setup Script</title> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 171 | |
| 172 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 173 | Once you have the SDK installed, you must run the SDK environment |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 174 | setup script before you can actually use the SDK. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 175 | This setup script resides in the directory you chose when you |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 176 | installed the SDK, which is either the default |
| 177 | <filename>/opt/poky/&DISTRO;</filename> directory or the directory |
| 178 | you chose during installation. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 179 | </para> |
| 180 | |
| 181 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 182 | Before running the script, be sure it is the one that matches the |
| 183 | architecture for which you are developing. |
| 184 | Environment setup scripts begin with the string |
| 185 | "<filename>environment-setup</filename>" and include as part of |
| 186 | their name the tuned target architecture. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 187 | As an example, the following commands set the working directory |
| 188 | to where the SDK was installed and then source the environment |
| 189 | setup script. |
| 190 | In this example, the setup script is for an IA-based |
| 191 | target machine using i586 tuning: |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 200 | </para> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 201 | </section> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 202 | </chapter> |
| 203 | <!-- |
| 204 | vim: expandtab tw=80 ts=4 |
| 205 | --> |