Before you can develop using the cross-toolchain, you need to set up the
cross-development environment by sourcing the toolchain's environment setup script.
If you used the ADT Installer or hand-installed cross-toolchain,
then you can find this script in the directory you chose for installation.
For this release, the default installation directory is
/opt/poky/2.1
.
If you installed the toolchain in the
Build Directory,
you can find the environment setup
script for the toolchain in the Build Directory's tmp
directory.
Be sure to run the environment setup script 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 architecture.
For example, the toolchain environment setup script for a 64-bit
IA-based architecture installed in the default installation directory
would be the following:
/opt/poky/2.1/environment-setup-x86_64-poky-linux
When you run the setup script, many environment variables are defined:
SDKTARGETSYSROOT
- The path to the sysroot used for cross-compilationPKG_CONFIG_PATH
- The path to the target pkg-config filesCONFIG_SITE
- A GNU autoconf site file preconfigured for the targetCC
- The minimal command and arguments to run the C compilerCXX
- The minimal command and arguments to run the C++ compilerCPP
- The minimal command and arguments to run the C preprocessorAS
- The minimal command and arguments to run the assemblerLD
- The minimal command and arguments to run the linkerGDB
- The minimal command and arguments to run the GNU DebuggerSTRIP
- The minimal command and arguments to run 'strip', which strips symbolsRANLIB
- The minimal command and arguments to run 'ranlib'OBJCOPY
- The minimal command and arguments to run 'objcopy'OBJDUMP
- The minimal command and arguments to run 'objdump'AR
- The minimal command and arguments to run 'ar'NM
- The minimal command and arguments to run 'nm'TARGET_PREFIX
- The toolchain binary prefix for the target toolsCROSS_COMPILE
- The toolchain binary prefix for the target toolsCONFIGURE_FLAGS
- The minimal arguments for GNU configureCFLAGS
- Suggested C flagsCXXFLAGS
- Suggested C++ flagsLDFLAGS
- Suggested linker flags when you use CC to linkCPPFLAGS
- Suggested preprocessor flags