From 5c0b301635c81dfb4cb5dc6470a64d9e7673968d Mon Sep 17 00:00:00 2001
From: Jacob Godserv
-There are a few important variables that we will use throughout this section.
-
-You can either set this all by hand, but that obviously gets quite tedious very
+There are a few important variables that we will use throughout this section
+which we discussed earlier:
+You can set this all by hand, but that obviously gets quite tedious very
quickly. A better idea is to stick these into a shell script so you can avoid
-typing it out all the time.
+typing it out all the time. Having it all in a shell script also allows
+you to set autoconf test assumptions to skip ./configure tests that are
+troublesome for cross-compiling.
+
+Something like the following works well to start, and can be tweaked as
+desired:
+
-Cross-compiling a system generally involves two directory trees. The first is
-where all development files are normally installed. This is your sysroot. The
-other tree is where only your runtime files are installed. You emerge all of
-your fun packages into your sysroot (without trimming down any files), and then
-either install via binary packages or copying files by hand all the stuff you
-need in your runtime tree.
+Cross-compiling a system generally involves two directory trees. The differences
+between them can be difficult to understand, but they are important concepts
+to cross-compiling.
+
+The first tree to consider is sysroot. Please read the
+
+The second tree is real root. This one is much simpler to understand: it's
+where you're trying to create a bootable stage3-like installation of Gentoo
+that you can copy to your target device.
@@ -73,12 +86,25 @@ The common convention is to use your
+A less common convention, but common nonetheless, is to set
These are simple wrapper scripts that will setup the environment
variables to point to the right places for you to be able to cross
-compile using emerge. PORTAGE_CONFIGROOT and ROOT both point to the
-SYSROOT.
+compile using emerge.
+We can use these tools for installing into whichever directory
-We can use these tools for both installing into your development root
-(sysroot) and into your runtime root. For the latter, simply specify
-by using the
-
-
-
-
- Variable
- Meaning
-
-
-
-
-
-
-
-
-
+export CBUILD="powerpc-unknown-linux-gnu"
+export CHOST="sh4-unknown-linux-gnu"
+export CTARGET="$CHOST"
+export SYSROOT="/usr/$CHOST"
+export ROOT="/path/to/some/dir"
+export PORTAGE_CONFIGROOT="${SYSROOT}"
+
+echo " CBUILD: "$CBUILD
+echo " CTARGET: "$CTARGET
+echo " CHOST: "$CHOST
+echo " SYSROOT: "$SYSROOT
+echo " ROOT: "$ROOT
+echo " PORTAGE_CONFIGROOT: "$PORTAGE_CONFIGROOT
+
+
# echo sys-devel/crossdev-wrappers >> /etc/portage/package.keywords
# emerge crossdev-wrappers
+
@@ -124,7 +166,7 @@ dependencies from being pulled into the deptree.
-By default the wrappers will link to the generic embedded profile. This +By default crossdev will link to the generic embedded profile. This is done to simpilify things, but the user may wish to use a more advanced targeted profile. In order to do that we can update the profile symlink.
@@ -134,25 +176,28 @@ advanced targeted profile. In order to do that we can update the profile symlink
-And naturally to change settings for the target system like USE flags,
-FEATURES, and VIDEO_CARDS. We would edit the standard portage config files.
+To change additional portage settings like
-# $EDITOR ${SYSROOT}/etc/make.conf ++# $EDITOR ${PORTAGE_CONFIGROOT}/etc/make.conf-Sometimes there are some additional tests we need override for configure -scripts. To do this the wrappers export a few variables to force the test to get -the answer it should. This will help prevent bloat in packages which add local -functions to workaround issues it assumes your system has because it could not -run the test. From time to time you may find you need to add additional -variables to these files in
@@ -163,9 +208,10 @@ times of doing it./usr/share/crossdev/include/site/ to -get a package to compile. To figure out the variable you need to add, it's often -as simple as greping the configure script for the autoconf variable and adding -it to the appropriate target file. This becomes obvious after the first few -times of doing it. +Sometimes there are some additional, cross-compile-incomplatible tests we +need override for configure scripts. To do this crossdev exports a few variables +to force the test to get the answer it should. This will help prevent bloat +in packages which add local functions to workaround issues it assumes your +target system has because it could not run the test while cross-compiling +(because, of course, it's not running on the target system). From time to +time you may find you need to add additional variables to these files in +/usr/share/crossdev/include/site/ to get a package to compile. +To figure out the variable you need to add, it's often as simple as greping +the configure script for the autoconf variable (which often begins with "ac_") +and adding it to the appropriate target file. This becomes easy once you +know what you're looking for.-If you want to uninstall and delete your work, then you can safely remove the -sysroot tree without affecting any native packages. See also the section in -the
diff --git a/xml/htdocs/proj/en/base/embedded/handbook/intro.xml b/xml/htdocs/proj/en/base/embedded/handbook/intro.xml index 89dbc3e..ea01a16 100644 --- a/xml/htdocs/proj/en/base/embedded/handbook/intro.xml +++ b/xml/htdocs/proj/en/base/embedded/handbook/intro.xml @@ -174,7 +174,13 @@ PDA we wanted to develop for, the above table would look like:crossdev guide about uninstalling. +You can safely remove the sysroot tree at any time without affecting any +native packages. See the section in the +crossdev guide about uninstalling for +more information.