diff options
authorYann E. MORIN" <>2011-01-25 19:31:16 (GMT)
committerYann E. MORIN" <>2011-01-25 19:31:16 (GMT)
commit94be1f470c148afe1b7b2a7e43b886c4ddea2e15 (patch)
parent15a1cc24913bf6290caa16d6bb05505d1471f8d0 (diff)
config: add an option to name the sysroot directory
Depending on local policies, some users have expressed a need to have the sysroot be named differently than the hard-coded name. Add an option for that. Default to 'sysroot' to match the existing literature. While at it, replace 'sys-root' with 'sysroot' everywhere we reference the sysroot. Reported-by: Alexey Kuznetsov <> Signed-off-by: "Yann E. MORIN" <>
-rw-r--r--docs/5 - Using the toolchain.txt2
5 files changed, 30 insertions, 10 deletions
diff --git a/config/ b/config/
index 47f50f3..07110e4 100644
--- a/config/
+++ b/config/
@@ -8,10 +8,23 @@ config USE_SYSROOT
default y
Use the 'shinny new' sysroot feature of gcc: libraries split between
- prefix/target/sys-root/lib and prefix/target/sys-root/usr/lib
+ prefix/target/sysroot/lib and prefix/target/sysroot/usr/lib
You definitely want to say 'Y' here. Yes you do. I know you do. Say 'Y'.
+ string
+ prompt "sysroot directory name"
+ depends on USE_SYSROOT
+ default "sysroot"
+ help
+ Enter the base name of the sysroot directory. Usually, this simply
+ is 'sysroot' (the default) or 'sys-root'.
+ You are free to enter anything here, except for spaces, and '/'
+ (see SYSROOT_DIR_PREFIX, below). If you leave this empy, then the
+ default 'sysroot' is used.
prompt "sysroot prefix dir (READ HELP)" if ! BACKEND
@@ -26,7 +39,7 @@ config SYSROOT_DIR_PREFIX
to the sysroot path, just before the actual sysroot directory.
In fact, the sysroot path is constructed as:
diff --git a/docs/5 - Using the toolchain.txt b/docs/5 - Using the toolchain.txt
index 0c38da1..aebd1aa 100644
--- a/docs/5 - Using the toolchain.txt
+++ b/docs/5 - Using the toolchain.txt
@@ -20,7 +20,7 @@ or
make CROSS_COMPILE=your-target-tuple-
and so on...
-It is strongly advised not to use the toolchain sys-root directory as an
+It is strongly advised not to use the toolchain sysroot directory as an
install directory for your programs/packages. If you do so, you will not be
able to use your toolchain for another project. It is even strongly advised
that your toolchain is chmod-ed to read-only once successfully build, so that
diff --git a/scripts/build/libc/ b/scripts/build/libc/
index ad5024c..9919015 100644
--- a/scripts/build/libc/
+++ b/scripts/build/libc/
@@ -276,7 +276,7 @@ do_libc_min_kernel_config() {
# We can't rely on the kernel version from the configuration,
# because it might not be available if the user uses pre-installed
# headers. On the other hand, both method will have the kernel
- # version installed in "usr/include/linux/version.h" in the sys-root.
+ # version installed in "usr/include/linux/version.h" in the sysroot.
# Parse that instead of having two code-paths.
if [ ! -f "${version_code_file}" -o ! -r "${version_code_file}" ]; then
diff --git a/scripts/ b/scripts/
index df5048d..d7dba89 100644
--- a/scripts/
+++ b/scripts/
@@ -283,9 +283,16 @@ esac
# Setting up the rest of the environment only if not restarting
if [ -z "${CT_RESTART}" ]; then
- # Arrange paths depending on wether we use sys-root or not.
+ case "${CT_SYSROOT_NAME}" in
+ "") CT_SYSROOT_NAME="sysroot";;
+ .) CT_Abort "Sysroot name is set to '.' which is forbidden";;
+ *' '*) CT_Abort "Sysroot name contains forbidden space(s): '${CT_SYSROOT_NAME}'";;
+ */*) CT_Abort "Sysroot name contains forbidden slash(es): '${CT_SYSROOT_NAME}'";;
+ esac
+ # Arrange paths depending on wether we use sysroot or not.
if [ "${CT_USE_SYSROOT}" = "y" ]; then
@@ -325,8 +332,8 @@ if [ -z "${CT_RESTART}" ]; then
CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/usr/include"
if [ "${CT_USE_SYSROOT}" = "y" ]; then
- # Prevent gcc from installing its libraries outside of the sys-root
- CT_DoExecLog ALL ln -sf "./${CT_SYSROOT_DIR_PREFIX}/sys-root/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib"
+ # Prevent gcc from installing its libraries outside of the sysroot
# Since we're *not* multilib on the target side, we want all the
diff --git a/scripts/ b/scripts/
index 9b69afd..02b1797 100644
--- a/scripts/
+++ b/scripts/
@@ -57,9 +57,9 @@ OPTIONS
-l name1[:name2[...]]
Always add the specified shared library/ies name1, name2... from the
- toolchain (in the sys-root). Actual library names are searched as
+ toolchain (in the sysroot). Actual library names are searched as
follows (where 'name' is replaced with the given name) in the
- sys-root directory:
+ sysroot directory:
- name