mirror of
https://git.yoctoproject.org/poky
synced 2026-02-07 01:06:37 +01:00
Changes throughout the manual that either eliminate or change many of the "Yocto Project" strings. The file structure for the meta data is now called "source directory." The build directory is referred as just that - "build directory." Any where the build system is referred to it is called the "OpenEmbedded build system." (From yocto-docs rev: 1210c19f90d4a52042fec12657212ae3e58e13d6) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
87 lines
3.6 KiB
XML
87 lines
3.6 KiB
XML
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
|
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
|
|
|
<chapter id='using-the-command-line'>
|
|
<title>Using the Command Line</title>
|
|
|
|
<para>
|
|
Recall that earlier the manual discussed how to use an existing toolchain
|
|
tarball that had been installed into <filename>/opt/poky</filename>,
|
|
which is outside of the build directory
|
|
(see the section "<link linkend='using-an-existing-toolchain-tarball'>Using an Existing
|
|
Toolchain Tarball)</link>".
|
|
And, that sourcing your architecture-specific environment setup script
|
|
initializes a suitable cross-toolchain development environment.
|
|
During the setup, locations for the compiler, QEMU scripts, QEMU binary,
|
|
a special version of <filename>pkgconfig</filename> and other useful
|
|
utilities are added to the <filename>PATH</filename> variable.
|
|
Variables to assist <filename>pkgconfig</filename> and <filename>autotools</filename>
|
|
are also defined so that,
|
|
for example, <filename>configure.sh</filename> can find pre-generated
|
|
test results for tests that need target hardware on which to run.
|
|
These conditions allow you to easily use the toolchain outside of the
|
|
OpenEmbedded build environment on both autotools-based projects and
|
|
Makefile-based projects.
|
|
</para>
|
|
|
|
<section id='autotools-based-projects'>
|
|
<title>Autotools-Based Projects</title>
|
|
|
|
<para>
|
|
For an Autotools-based project, you can use the cross-toolchain by just
|
|
passing the appropriate host option to <filename>configure.sh</filename>.
|
|
The host option you use is derived from the name of the environment setup
|
|
script in <filename>/opt/poky</filename> resulting from unpacking the
|
|
cross-toolchain tarball.
|
|
For example, the host option for an ARM-based target that uses the GNU EABI
|
|
is <filename>armv5te-poky-linux-gnueabi</filename>.
|
|
Note that the name of the script is
|
|
<filename>environment-setup-armv5te-poky-linux-gnueabi</filename>.
|
|
Thus, the following command works:
|
|
<literallayout class='monospaced'>
|
|
$ configure --host=armv5te-poky-linux-gnueabi \
|
|
--with-libtool-sysroot=<sysroot-dir>
|
|
</literallayout>
|
|
</para>
|
|
<para>
|
|
This single command updates your project and rebuilds it using the appropriate
|
|
cross-toolchain tools.
|
|
</para>
|
|
<note>
|
|
If <filename>configure</filename> script results in problems recognizing the
|
|
<filename>--with-libtool-sysroot=<sysroot-dir></filename> option,
|
|
regenerate the script to enable the support by doing the following and then
|
|
re-running the script:
|
|
<literallayout class='monospaced'>
|
|
$ libtoolize --automake
|
|
$ aclocal -I ${OECORE_NATIVE_SYSROOT}/usr/share/aclocal \
|
|
[-I <dir_containing_your_project-specific_m4_macros>]
|
|
$ autoconf
|
|
$ autoheader
|
|
$ automake -a
|
|
</literallayout>
|
|
</note>
|
|
</section>
|
|
|
|
<section id='makefile-based-projects'>
|
|
<title>Makefile-Based Projects</title>
|
|
|
|
<para>
|
|
For a Makefile-based project, you use the cross-toolchain by making sure
|
|
the tools are used.
|
|
You can do this as follows:
|
|
<literallayout class='monospaced'>
|
|
CC=arm-poky-linux-gnueabi-gcc
|
|
LD=arm-poky-linux-gnueabi-ld
|
|
CFLAGS=”${CFLAGS} --sysroot=<sysroot-dir>”
|
|
CXXFLAGS=”${CXXFLAGS} --sysroot=<sysroot-dir>”
|
|
</literallayout>
|
|
</para>
|
|
</section>
|
|
|
|
</chapter>
|
|
<!--
|
|
vim: expandtab tw=80 ts=4
|
|
-->
|