# HG changeset patch # User "Yann E. MORIN" # Date 1295983876 -3600 # Node ID a559d9890c020d0e6dc63234c82f0179f4cb7aa6 # Parent e86826b8621ad049a637c372f9e8adae5d0475d7 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 -r e86826b8621a -r a559d9890c02 config/toolchain.in --- a/config/toolchain.in Sat Jan 22 22:36:20 2011 +0100 +++ b/config/toolchain.in Tue Jan 25 20:31:16 2011 +0100 @@ -8,10 +8,23 @@ 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 @@ 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 -r e86826b8621a -r a559d9890c02 docs/5 - Using the toolchain.txt --- a/docs/5 - Using the toolchain.txt Sat Jan 22 22:36:20 2011 +0100 +++ b/docs/5 - Using the toolchain.txt Tue Jan 25 20:31:16 2011 +0100 @@ -20,7 +20,7 @@ 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 -r e86826b8621a -r a559d9890c02 scripts/build/libc/glibc-eglibc.sh-common --- a/scripts/build/libc/glibc-eglibc.sh-common Sat Jan 22 22:36:20 2011 +0100 +++ b/scripts/build/libc/glibc-eglibc.sh-common Tue Jan 25 20:31:16 2011 +0100 @@ -276,7 +276,7 @@ # 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 -r e86826b8621a -r a559d9890c02 scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Sat Jan 22 22:36:20 2011 +0100 +++ b/scripts/crosstool-NG.sh.in Tue Jan 25 20:31:16 2011 +0100 @@ -283,9 +283,16 @@ # 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 @@ 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 -r e86826b8621a -r a559d9890c02 scripts/populate.in --- a/scripts/populate.in Sat Jan 22 22:36:20 2011 +0100 +++ b/scripts/populate.in Tue Jan 25 20:31:16 2011 +0100 @@ -57,9 +57,9 @@ -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