From 94be1f470c148afe1b7b2a7e43b886c4ddea2e15 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Tue, 25 Jan 2011 20:31:16 +0100 Subject: 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" diff --git a/config/toolchain.in b/config/toolchain.in index 47f50f3..07110e4 100644 --- a/config/toolchain.in +++ b/config/toolchain.in @@ -8,10 +8,23 @@ config USE_SYSROOT default y help 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'. +config SYSROOT_NAME + 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. + config SYSROOT_DIR_PREFIX string 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: - ${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/sys-root + ${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/${CT_SYSROOT_NAME} config STATIC_TOOLCHAIN bool 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/glibc-eglibc.sh-common b/scripts/build/libc/glibc-eglibc.sh-common index ad5024c..9919015 100644 --- a/scripts/build/libc/glibc-eglibc.sh-common +++ b/scripts/build/libc/glibc-eglibc.sh-common @@ -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. version_code_file="${CT_SYSROOT_DIR}/usr/include/linux/version.h" if [ ! -f "${version_code_file}" -o ! -r "${version_code_file}" ]; then diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index df5048d..d7dba89 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -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 - CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/sys-root" + CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/${CT_SYSROOT_NAME}" CT_DEBUGROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/debug-root" CT_HEADERS_DIR="${CT_SYSROOT_DIR}/usr/include" BINUTILS_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}" @@ -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 + CT_DoExecLog ALL ln -sf "./${CT_SYSROOT_DIR_PREFIX}/${CT_SYSROOT_NAME}/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib" fi # Since we're *not* multilib on the target side, we want all the diff --git a/scripts/populate.in b/scripts/populate.in index 9b69afd..02b1797 100644 --- a/scripts/populate.in +++ b/scripts/populate.in @@ -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: - libname.so - name.so - name -- cgit v0.10.2-6-g49f6