From 93052c9900da497fd4caa7dc8d214797446bb93b Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Fri, 23 Jan 2015 08:44:17 -0800 Subject: adt-manual: Remaining mods to clarify xtoolchain env use Fixes [YOCTO #7133] Edits to add more clarification for use and role of the cross-toolchain environment variables established when a user runs the cross-toolchain environment setup script. (From yocto-docs rev: 2c3fa3a838a3a8970cd112935e903c96552ed06b) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/adt-manual/adt-command.xml | 38 +++++++++++++++++++------------- documentation/adt-manual/adt-package.xml | 2 +- documentation/adt-manual/adt-prepare.xml | 8 +++++-- 3 files changed, 30 insertions(+), 18 deletions(-) (limited to 'documentation/adt-manual') diff --git a/documentation/adt-manual/adt-command.xml b/documentation/adt-manual/adt-command.xml index 164b1efbff..0faa05fa6c 100644 --- a/documentation/adt-manual/adt-command.xml +++ b/documentation/adt-manual/adt-command.xml @@ -24,6 +24,10 @@ are also defined so that, for example, configure.sh can find pre-generated test results for tests that need target hardware on which to run. + You can see the + "Setting Up the Cross-Development Environment" + section for the list of cross-toolchain environment variables + established by the script. @@ -99,7 +103,7 @@ "poky-linux". Here is an example that sources a script from the default ADT installation directory that uses the - 32-bit Intel x86 Architecture and using the + 32-bit Intel x86 Architecture and the &DISTRO_NAME; Yocto Project release: $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux @@ -128,7 +132,11 @@ $ automake -a Cross-compile the project: - This command compiles the project using the cross-compiler: + This command compiles the project using the cross-compiler. + The + CONFIGURE_FLAGS + environment variable provides the minimal arguments for + GNU configure: $ ./configure ${CONFIGURE_FLAGS} @@ -174,16 +182,12 @@ is armv5te-poky-linux-gnueabi. You will notice that the name of the script is environment-setup-armv5te-poky-linux-gnueabi. - Thus, the following command works: + Thus, the following command works to update your project and + rebuild it using the appropriate cross-toolchain tools: $ ./configure --host=armv5te-poky-linux-gnueabi \ --with-libtool-sysroot=sysroot-dir - - - - This single command updates your project and rebuilds it using the appropriate - cross-toolchain tools. If the configure script results in problems recognizing the --with-libtool-sysroot=sysroot-dir option, @@ -206,14 +210,18 @@ Makefile-Based Projects - For a Makefile-based project, you use the cross-toolchain by making sure - the tools are used. - You can do this as follows: + For Makefile-based projects, you make sure your + Makefile has statements that ensure proper + use of the cross-toolchain. + For example, the following statements inside a + Makefile ensure the C compiler, linker, flags + passed to the C compiler, and flags passed to the C++ compiler are + specifically defined for the build: - CC=arm-poky-linux-gnueabi-gcc - LD=arm-poky-linux-gnueabi-ld - CFLAGS=”${CFLAGS} --sysroot=<sysroot-dir>” - CXXFLAGS=”${CXXFLAGS} --sysroot=<sysroot-dir>” + CC=arm-poky-linux-gnueabi-gcc + LD=arm-poky-linux-gnueabi-ld + CFLAGS=”${CFLAGS} --sysroot=<sysroot-dir>” + CXXFLAGS=”${CXXFLAGS} --sysroot=<sysroot-dir>” diff --git a/documentation/adt-manual/adt-package.xml b/documentation/adt-manual/adt-package.xml index ea82f6d7da..f3ffa06e4e 100644 --- a/documentation/adt-manual/adt-package.xml +++ b/documentation/adt-manual/adt-package.xml @@ -78,7 +78,7 @@ - Next, source the environment setup script found in the + Next, source the cross-toolchain environment setup script found in the Source Directory. Follow that by setting up the installation destination to point to your sysroot as sysroot_dir. diff --git a/documentation/adt-manual/adt-prepare.xml b/documentation/adt-manual/adt-prepare.xml index 995d589219..e75e9c95cd 100644 --- a/documentation/adt-manual/adt-prepare.xml +++ b/documentation/adt-manual/adt-prepare.xml @@ -580,7 +580,8 @@ To extract the root filesystem, first source - the cross-development environment setup script. + the cross-development environment setup script to establish + necessary environment variables. If you built the toolchain in the Build Directory, you will find the toolchain environment script in the tmp directory. @@ -657,7 +658,10 @@ hardware can be passed to gcc as a set of compiler options. Those options are set up by the environment script and - contained in variables like CC and LD. + contained in variables such as + CC + and + LD. This reduces the space needed for the tools. Understand, however, that a sysroot is still needed for every target since those binaries are target-specific. -- cgit v1.2.3-54-g00ecf