config: add an option to name the sysroot directory
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jan 25 20:31:16 2011 +0100 (2011-01-25)
changeset 2279a559d9890c02
parent 2278 e86826b8621a
child 2280 3d480d12124e
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 <Alexey.KUZNETSOV@youtransactor.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/toolchain.in
docs/5 - Using the toolchain.txt
scripts/build/libc/glibc-eglibc.sh-common
scripts/crosstool-NG.sh.in
scripts/populate.in
     1.1 --- a/config/toolchain.in	Sat Jan 22 22:36:20 2011 +0100
     1.2 +++ b/config/toolchain.in	Tue Jan 25 20:31:16 2011 +0100
     1.3 @@ -8,10 +8,23 @@
     1.4      default y
     1.5      help
     1.6        Use the 'shinny new' sysroot feature of gcc: libraries split between
     1.7 -      prefix/target/sys-root/lib and prefix/target/sys-root/usr/lib
     1.8 +      prefix/target/sysroot/lib and prefix/target/sysroot/usr/lib
     1.9        
    1.10        You definitely want to say 'Y' here. Yes you do. I know you do. Say 'Y'.
    1.11  
    1.12 +config SYSROOT_NAME
    1.13 +    string
    1.14 +    prompt "sysroot directory name"
    1.15 +    depends on USE_SYSROOT
    1.16 +    default "sysroot"
    1.17 +    help
    1.18 +      Enter the base name of the sysroot directory. Usually, this simply
    1.19 +      is 'sysroot' (the default) or 'sys-root'.
    1.20 +      
    1.21 +      You are free to enter anything here, except for spaces, and '/'
    1.22 +      (see SYSROOT_DIR_PREFIX, below). If you leave this empy, then the
    1.23 +      default 'sysroot' is used.
    1.24 +
    1.25  config SYSROOT_DIR_PREFIX
    1.26      string
    1.27      prompt "sysroot prefix dir (READ HELP)" if ! BACKEND
    1.28 @@ -26,7 +39,7 @@
    1.29        to the sysroot path, just before the actual sysroot directory.
    1.30        
    1.31        In fact, the sysroot path is constructed as:
    1.32 -        ${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/sys-root
    1.33 +        ${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/${CT_SYSROOT_NAME}
    1.34  
    1.35  config STATIC_TOOLCHAIN
    1.36      bool
     2.1 --- a/docs/5 - Using the toolchain.txt	Sat Jan 22 22:36:20 2011 +0100
     2.2 +++ b/docs/5 - Using the toolchain.txt	Tue Jan 25 20:31:16 2011 +0100
     2.3 @@ -20,7 +20,7 @@
     2.4    make CROSS_COMPILE=your-target-tuple-
     2.5  and so on...
     2.6  
     2.7 -It is strongly advised not to use the toolchain sys-root directory as an
     2.8 +It is strongly advised not to use the toolchain sysroot directory as an
     2.9  install directory for your programs/packages. If you do so, you will not be
    2.10  able to use your toolchain for another project. It is even strongly advised
    2.11  that your toolchain is chmod-ed to read-only once successfully build, so that
     3.1 --- a/scripts/build/libc/glibc-eglibc.sh-common	Sat Jan 22 22:36:20 2011 +0100
     3.2 +++ b/scripts/build/libc/glibc-eglibc.sh-common	Tue Jan 25 20:31:16 2011 +0100
     3.3 @@ -276,7 +276,7 @@
     3.4                  # We can't rely on the kernel version from the configuration,
     3.5                  # because it might not be available if the user uses pre-installed
     3.6                  # headers. On the other hand, both method will have the kernel
     3.7 -                # version installed in "usr/include/linux/version.h" in the sys-root.
     3.8 +                # version installed in "usr/include/linux/version.h" in the sysroot.
     3.9                  # Parse that instead of having two code-paths.
    3.10                  version_code_file="${CT_SYSROOT_DIR}/usr/include/linux/version.h"
    3.11                  if [ ! -f "${version_code_file}" -o ! -r "${version_code_file}" ]; then
     4.1 --- a/scripts/crosstool-NG.sh.in	Sat Jan 22 22:36:20 2011 +0100
     4.2 +++ b/scripts/crosstool-NG.sh.in	Tue Jan 25 20:31:16 2011 +0100
     4.3 @@ -283,9 +283,16 @@
     4.4  
     4.5  # Setting up the rest of the environment only if not restarting
     4.6  if [ -z "${CT_RESTART}" ]; then
     4.7 -    # Arrange paths depending on wether we use sys-root or not.
     4.8 +    case "${CT_SYSROOT_NAME}" in
     4.9 +        "")     CT_SYSROOT_NAME="sysroot";;
    4.10 +        .)      CT_Abort "Sysroot name is set to '.' which is forbidden";;
    4.11 +        *' '*)  CT_Abort "Sysroot name contains forbidden space(s): '${CT_SYSROOT_NAME}'";;
    4.12 +        */*)    CT_Abort "Sysroot name contains forbidden slash(es): '${CT_SYSROOT_NAME}'";;
    4.13 +    esac
    4.14 +
    4.15 +    # Arrange paths depending on wether we use sysroot or not.
    4.16      if [ "${CT_USE_SYSROOT}" = "y" ]; then
    4.17 -        CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/sys-root"
    4.18 +        CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/${CT_SYSROOT_NAME}"
    4.19          CT_DEBUGROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/debug-root"
    4.20          CT_HEADERS_DIR="${CT_SYSROOT_DIR}/usr/include"
    4.21          BINUTILS_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
    4.22 @@ -325,8 +332,8 @@
    4.23      CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/usr/include"
    4.24  
    4.25      if [ "${CT_USE_SYSROOT}" = "y" ]; then
    4.26 -        # Prevent gcc from installing its libraries outside of the sys-root
    4.27 -        CT_DoExecLog ALL ln -sf "./${CT_SYSROOT_DIR_PREFIX}/sys-root/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib"
    4.28 +        # Prevent gcc from installing its libraries outside of the sysroot
    4.29 +        CT_DoExecLog ALL ln -sf "./${CT_SYSROOT_DIR_PREFIX}/${CT_SYSROOT_NAME}/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib"
    4.30      fi
    4.31  
    4.32      # Since we're *not* multilib on the target side, we want all the
     5.1 --- a/scripts/populate.in	Sat Jan 22 22:36:20 2011 +0100
     5.2 +++ b/scripts/populate.in	Tue Jan 25 20:31:16 2011 +0100
     5.3 @@ -57,9 +57,9 @@
     5.4  
     5.5      -l name1[:name2[...]]
     5.6          Always add the specified shared library/ies name1, name2... from the
     5.7 -        toolchain (in the sys-root). Actual library names are searched as
     5.8 +        toolchain (in the sysroot). Actual library names are searched as
     5.9          follows (where 'name' is replaced with the given name) in the
    5.10 -        sys-root directory:
    5.11 +        sysroot directory:
    5.12            - libname.so
    5.13            - name.so
    5.14            - name