sdk-using.xml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. <chapter id='sdk-using-the-standard-sdk'>
  5. <title>Using the Standard SDK</title>
  6. <para>
  7. This chapter describes the standard SDK and how to install it.
  8. Information includes unique installation and setup aspects for the
  9. standard SDK.
  10. <note>
  11. For a side-by-side comparison of main features supported for a
  12. standard SDK as compared to an extensible SDK, see the
  13. "<link linkend='sdk-manual-intro'>Introduction</link>"
  14. section.
  15. </note>
  16. </para>
  17. <para>
  18. You can use a standard SDK to work on Makefile, Autotools, and
  19. <trademark class='trade'>Eclipse</trademark>-based projects.
  20. See the
  21. "<link linkend='sdk-working-projects'>Using the SDK Toolchain Directly</link>"
  22. chapter for more information.
  23. </para>
  24. <section id='sdk-standard-sdk-intro'>
  25. <title>Why use the Standard SDK and What is in It?</title>
  26. <para>
  27. The Standard SDK provides a cross-development toolchain and
  28. libraries tailored to the contents of a specific image.
  29. You would use the Standard SDK if you want a more traditional
  30. toolchain experience as compared to the extensible SDK, which
  31. provides an internal build system and the
  32. <filename>devtool</filename> functionality.
  33. </para>
  34. <para>
  35. The installed Standard SDK consists of several files and
  36. directories.
  37. Basically, it contains an SDK environment setup script, some
  38. configuration files, and host and target root filesystems to
  39. support usage.
  40. You can see the directory structure in the
  41. "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>"
  42. section.
  43. </para>
  44. </section>
  45. <section id='sdk-installing-the-sdk'>
  46. <title>Installing the SDK</title>
  47. <para>
  48. The first thing you need to do is install the SDK on your
  49. <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>Build Host</ulink>
  50. by running the <filename>*.sh</filename> installation script.
  51. </para>
  52. <para>
  53. You can download a tarball installer, which includes the
  54. pre-built toolchain, the <filename>runqemu</filename>
  55. script, and support files from the appropriate
  56. <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchain</ulink>
  57. directory within the Index of Releases.
  58. Toolchains are available for several 32-bit and 64-bit
  59. architectures with the <filename>x86_64</filename> directories,
  60. respectively.
  61. The toolchains the Yocto Project provides are based off the
  62. <filename>core-image-sato</filename> and
  63. <filename>core-image-minimal</filename> images and contain
  64. libraries appropriate for developing against that image.
  65. </para>
  66. <para>
  67. The names of the tarball installer scripts are such that a
  68. string representing the host system appears first in the
  69. filename and then is immediately followed by a string
  70. representing the target architecture.
  71. <literallayout class='monospaced'>
  72. poky-glibc-<replaceable>host_system</replaceable>-<replaceable>image_type</replaceable>-<replaceable>arch</replaceable>-toolchain-<replaceable>release_version</replaceable>.sh
  73. Where:
  74. <replaceable>host_system</replaceable> is a string representing your development system:
  75. i686 or x86_64.
  76. <replaceable>image_type</replaceable> is the image for which the SDK was built:
  77. core-image-minimal or core-image-sato.
  78. <replaceable>arch</replaceable> is a string representing the tuned target architecture:
  79. aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon.
  80. <replaceable>release_version</replaceable> is a string representing the release number of the Yocto Project:
  81. &DISTRO;, &DISTRO;+snapshot
  82. </literallayout>
  83. For example, the following SDK installer is for a 64-bit
  84. development host system and a i586-tuned target architecture
  85. based off the SDK for <filename>core-image-sato</filename> and
  86. using the current &DISTRO; snapshot:
  87. <literallayout class='monospaced'>
  88. poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
  89. </literallayout>
  90. <note>
  91. As an alternative to downloading an SDK, you can build the
  92. SDK installer.
  93. For information on building the installer, see the
  94. "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
  95. section.
  96. Another helpful resource for building an installer is the
  97. <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>Cookbook guide to Making an Eclipse Debug Capable Image</ulink>
  98. wiki page.
  99. This wiki page focuses on development when using the Eclipse
  100. IDE.
  101. </note>
  102. </para>
  103. <para>
  104. The SDK and toolchains are self-contained and by default are
  105. installed into the <filename>poky_sdk</filename> folder in your
  106. home directory.
  107. You can choose to install the extensible SDK in any location when
  108. you run the installer.
  109. However, because files need to be written under that directory
  110. during the normal course of operation, the location you choose
  111. for installation must be writable for whichever
  112. users need to use the SDK.
  113. </para>
  114. <para>
  115. The following command shows how to run the installer given a
  116. toolchain tarball for a 64-bit x86 development host system and
  117. a 64-bit x86 target architecture.
  118. The example assumes the SDK installer is located in
  119. <filename>~/Downloads/</filename> and has execution rights.
  120. <note>
  121. If you do not have write permissions for the directory
  122. into which you are installing the SDK, the installer
  123. notifies you and exits.
  124. For that case, set up the proper permissions in the directory
  125. and run the installer again.
  126. </note>
  127. <literallayout class='monospaced'>
  128. $ ./Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
  129. Poky (Yocto Project Reference Distro) SDK installer version &DISTRO;
  130. ===============================================================
  131. Enter target directory for SDK (default: /opt/poky/&DISTRO;):
  132. You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed[Y/n]? Y
  133. Extracting SDK........................................ ..............................done
  134. Setting it up...done
  135. SDK has been successfully set up and is ready to be used.
  136. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
  137. $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
  138. </literallayout>
  139. </para>
  140. <para>
  141. Again, reference the
  142. "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>"
  143. section for more details on the resulting directory structure of
  144. the installed SDK.
  145. </para>
  146. </section>
  147. <section id='sdk-running-the-sdk-environment-setup-script'>
  148. <title>Running the SDK Environment Setup Script</title>
  149. <para>
  150. Once you have the SDK installed, you must run the SDK environment
  151. setup script before you can actually use the SDK.
  152. This setup script resides in the directory you chose when you
  153. installed the SDK, which is either the default
  154. <filename>/opt/poky/&DISTRO;</filename> directory or the directory
  155. you chose during installation.
  156. </para>
  157. <para>
  158. Before running the script, be sure it is the one that matches the
  159. architecture for which you are developing.
  160. Environment setup scripts begin with the string
  161. "<filename>environment-setup</filename>" and include as part of
  162. their name the tuned target architecture.
  163. As an example, the following commands set the working directory
  164. to where the SDK was installed and then source the environment
  165. setup script.
  166. In this example, the setup script is for an IA-based
  167. target machine using i586 tuning:
  168. <literallayout class='monospaced'>
  169. $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
  170. </literallayout>
  171. When you run the setup script, the same environment variables are
  172. defined as are when you run the setup script for an extensible SDK.
  173. See the
  174. "<link linkend='sdk-running-the-extensible-sdk-environment-setup-script'>Running the Extensible SDK Environment Setup Script</link>"
  175. section for more information.
  176. </para>
  177. </section>
  178. </chapter>
  179. <!--
  180. vim: expandtab tw=80 ts=4
  181. -->