sdk-using.xml 9.2 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. Eclipse-based projects.
  20. See the
  21. "<link linkend='sdk-working-projects'>Working with Different Types of Projects</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 host
  49. development machine by running the <filename>*.sh</filename>
  50. 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 directory under
  56. <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>.
  57. Toolchains are available for 32-bit and 64-bit x86 development
  58. systems from the <filename>i686</filename> and
  59. <filename>x86_64</filename> directories, respectively.
  60. The toolchains the Yocto Project provides are based off the
  61. <filename>core-image-sato</filename> image and contain
  62. libraries appropriate for developing against that image.
  63. Each type of development system supports five or more target
  64. architectures.
  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. <replaceable>arch</replaceable> is a string representing the tuned target architecture:
  78. i586, x86_64, powerpc, mips, armv7a or armv5te
  79. <replaceable>release_version</replaceable> is a string representing the release number of the
  80. 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 <filename>/opt/poky</filename>.
  106. However, when you run the SDK installer, you can choose an
  107. installation directory.
  108. <note>
  109. You must change the permissions on the SDK
  110. installer script so that it is executable:
  111. <literallayout class='monospaced'>
  112. $ chmod +x poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
  113. </literallayout>
  114. </note>
  115. </para>
  116. <para>
  117. The following command shows how to run the installer given a
  118. toolchain tarball for a 64-bit x86 development host system and
  119. a 32-bit x86 target architecture.
  120. The example assumes the SDK installer is located in
  121. <filename>~/Downloads/</filename>.
  122. <note>
  123. If you do not have write permissions for the directory
  124. into which you are installing the SDK, the installer
  125. notifies you and exits.
  126. Be sure you have write permissions in the directory and
  127. run the installer again.
  128. </note>
  129. <literallayout class='monospaced'>
  130. $ ./poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
  131. Poky (Yocto Project Reference Distro) SDK installer version &DISTRO;
  132. ===============================================================
  133. Enter target directory for SDK (default: /opt/poky/&DISTRO;):
  134. You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed[Y/n]? Y
  135. Extracting SDK.......................................................................done
  136. Setting it up...done
  137. SDK has been successfully set up and is ready to be used.
  138. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
  139. $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
  140. </literallayout>
  141. </para>
  142. <para>
  143. Again, reference the
  144. "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>"
  145. section for more details on the resulting directory structure of
  146. the installed SDK.
  147. </para>
  148. </section>
  149. <section id='sdk-running-the-sdk-environment-setup-script'>
  150. <title>Running the SDK Environment Setup Script</title>
  151. <para>
  152. Once you have the SDK installed, you must run the SDK environment
  153. setup script before you can actually use it.
  154. This setup script resides in the directory you chose when you
  155. installed the SDK.
  156. For information on where this setup script can reside, see the
  157. "<link linkend='sdk-appendix-obtain'>Obtaining the SDK</link>"
  158. Appendix.
  159. </para>
  160. <para>
  161. Before running the script, be sure it is the one that matches the
  162. architecture for which you are developing.
  163. Environment setup scripts begin with the string
  164. "<filename>environment-setup</filename>" and include as part of
  165. their name the tuned target architecture.
  166. For example, the command to source a setup script for an IA-based
  167. target machine using i586 tuning and located in the default SDK
  168. installation directory is as follows:
  169. <literallayout class='monospaced'>
  170. $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
  171. </literallayout>
  172. When you run the setup script, the same environment variables are
  173. defined as are when you run the setup script for an extensible SDK.
  174. See the
  175. "<link linkend='sdk-running-the-extensible-sdk-environment-setup-script'>Running the Extensible SDK Environment Setup Script</link>"
  176. section for more information.
  177. </para>
  178. </section>
  179. </chapter>
  180. <!--
  181. vim: expandtab tw=80 ts=4
  182. -->