# Using the Standard SDK

This chapter describes the standard SDK and how to install it. Information includes unique installation and setup aspects for the standard SDK.

For a side-by-side comparison of main features supported for a standard SDK as compared to an extensible SDK, see the "Introduction" section.

You can use a standard SDK to work on Makefile, Autotools, and Eclipse-based projects. See the "Working with Different Types of Projects" chapter for more information.

## Why use the Standard SDK and What is in It?

The Standard SDK provides a cross-development toolchain and libraries tailored to the contents of a specific image. You would use the Standard SDK if you want a more traditional toolchain experience as compared to the extensible SDK, which provides an internal build system and the `devtool` functionality.

The installed Standard SDK consists of several files and directories. Basically, it contains an SDK environment setup script, some configuration files, and host and target root filesystems to support usage. You can see the directory structure in the "Installed Standard SDK Directory Structure" section.

## Installing the SDK

The first thing you need to do is install the SDK on your host development machine by running the `*.sh` installation script.

You can download a tarball installer, which includes the pre-built toolchain, the `runqemu` script, and support files from the appropriate directory under . Toolchains are available for 32-bit and 64-bit x86 development systems from the `i686` and `x86_64` directories, respectively. The toolchains the Yocto Project provides are based off the `core-image-sato` image and contain libraries appropriate for developing against that image. Each type of development system supports five or more target architectures.

The names of the tarball installer scripts are such that a string representing the host system appears first in the filename and then is immediately followed by a string representing the target architecture.

         poky-glibc-host_system-image_type-arch-toolchain-release_version.sh

         Where:
             host_system is a string representing your development system:

                        i686 or x86_64.

             image_type is the image for which the SDK was built.

             arch is a string representing the tuned target architecture:

                        i586, x86_64, powerpc, mips, armv7a or armv5te

             release_version is a string representing the release number of the
                    Yocto Project:

                        &DISTRO;, &DISTRO;+snapshot

For example, the following SDK installer is for a 64-bit development host system and a i586-tuned target architecture based off the SDK for `core-image-sato` and using the current &DISTRO; snapshot:

         poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh

As an alternative to downloading an SDK, you can build the SDK installer. For information on building the installer, see the "Building an SDK Installer" section. Another helpful resource for building an installer is the Cookbook guide to Making an Eclipse Debug Capable Image wiki page. This wiki page focuses on development when using the Eclipse IDE.

The SDK and toolchains are self-contained and by default are installed into `/opt/poky`. However, when you run the SDK installer, you can choose an installation directory.

You must change the permissions on the SDK installer script so that it is executable:

         $ chmod +x poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh

The following command shows how to run the installer given a toolchain tarball for a 64-bit x86 development host system and a 32-bit x86 target architecture. The example assumes the SDK installer is located in `~/Downloads/`.

If you do not have write permissions for the directory into which you are installing the SDK, the installer notifies you and exits. Be sure you have write permissions in the directory and run the installer again.

         $ ./poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
         Poky (Yocto Project Reference Distro) SDK installer version &DISTRO;
         ===============================================================
         Enter target directory for SDK (default: /opt/poky/&DISTRO;):
         You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed[Y/n]? Y
         Extracting SDK.......................................................................done
         Setting it up...done
         SDK has been successfully set up and is ready to be used.
         Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
          $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux

Again, reference the "Installed Standard SDK Directory Structure" section for more details on the resulting directory structure of the installed SDK.

## Running the SDK Environment Setup Script

Once you have the SDK installed, you must run the SDK environment setup script before you can actually use it. This setup script resides in the directory you chose when you installed the SDK. For information on where this setup script can reside, see the "Obtaining the SDK" Appendix.

Before running the script, be sure it is the one that matches the architecture for which you are developing. Environment setup scripts begin with the string "`environment-setup`" and include as part of their name the tuned target architecture. For example, the command to source a setup script for an IA-based target machine using i586 tuning and located in the default SDK installation directory is as follows:

         $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux

When you run the setup script, the same environment variables are defined as are when you run the setup script for an extensible SDK. See the "Running the Extensible SDK Environment Setup Script" section for more information.