libc/glib: pass installation subdir to backend
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Nov 22 00:16:37 2011 +0100 (2011-11-22)
changeset 28235b2025372db7
parent 2822 09abd5f4295b
child 2824 53d0a288209d
libc/glib: pass installation subdir to backend

When building a multilib variant, install in a separate directory, to
avoid clutering the default or any other variant.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/build/libc/glibc-eglibc.sh-common
     1.1 --- a/scripts/build/libc/glibc-eglibc.sh-common	Tue Nov 22 00:11:51 2011 +0100
     1.2 +++ b/scripts/build/libc/glibc-eglibc.sh-common	Tue Nov 22 00:16:37 2011 +0100
     1.3 @@ -69,9 +69,11 @@
     1.4  #   Parameter           : Definition                            : Type      : Default
     1.5  #   libc_mode           : 'startfiles' or 'final'               : string    : (none)
     1.6  #   extra_flags         : Extra CFLAGS to use (for multilib)    : string    : (empty)
     1.7 +#   extra_dir           : Extra subdir for multilib             : string    : (empty)
     1.8  do_libc_backend() {
     1.9      local libc_mode
    1.10      local extra_flags
    1.11 +    local extra_dir
    1.12      local src_dir="${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}"
    1.13      local extra_cc_args
    1.14      local -a extra_config
    1.15 @@ -90,8 +92,8 @@
    1.16          final)      CT_DoStep INFO "Installing C library";;
    1.17          *)          CT_Abort "Unsupported (or unset) libc_mode='${libc_mode}'";;
    1.18      esac
    1.19 -    mkdir -p "${CT_BUILD_DIR}/build-libc-${libc_mode}"
    1.20 -    cd "${CT_BUILD_DIR}/build-libc-${libc_mode}"
    1.21 +    mkdir -p "${CT_BUILD_DIR}/build-libc-${libc_mode}${extra_dir//\//_}"
    1.22 +    cd "${CT_BUILD_DIR}/build-libc-${libc_mode}${extra_dir//\//_}"
    1.23  
    1.24      CT_DoLog EXTRA "Configuring C library"
    1.25  
    1.26 @@ -269,7 +271,7 @@
    1.27          # use the 'install-headers' makefile target to install the
    1.28          # headers
    1.29          CT_DoExecLog ALL make ${JOBSFLAGS}              \
    1.30 -                         install_root=${CT_SYSROOT_DIR} \
    1.31 +                         install_root=${CT_SYSROOT_DIR}${extra_dir} \
    1.32                           install-bootstrap-headers=yes  \
    1.33                           "${extra_make_args[@]}"        \
    1.34                           install-headers
    1.35 @@ -306,12 +308,12 @@
    1.36  
    1.37              # there are a few object files needed to link shared libraries,
    1.38              # which we build and install by hand
    1.39 -            CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/usr/lib"
    1.40 +            CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}${extra_dir}/usr/lib"
    1.41              CT_DoExecLog ALL make ${JOBSFLAGS}  \
    1.42                          "${extra_make_args[@]}" \
    1.43                          csu/subdir_lib
    1.44              CT_DoExecLog ALL cp csu/crt1.o csu/crti.o csu/crtn.o \
    1.45 -                                "${CT_SYSROOT_DIR}/usr/lib"
    1.46 +                                "${CT_SYSROOT_DIR}${extra_dir}/usr/lib"
    1.47  
    1.48              # Finally, 'libgcc_s.so' requires a 'libc.so' to link against.
    1.49              # However, since we will never actually execute its code,
    1.50 @@ -321,7 +323,7 @@
    1.51                                             -nostartfiles    \
    1.52                                             -shared          \
    1.53                                             -x c /dev/null   \
    1.54 -                                           -o "${CT_SYSROOT_DIR}/usr/lib/libc.so"
    1.55 +                                           -o "${CT_SYSROOT_DIR}${extra_dir}/usr/lib/libc.so"
    1.56          fi # threads == nptl
    1.57      else # libc_mode = final
    1.58          CT_DoLog EXTRA "Building C library"
    1.59 @@ -332,7 +334,7 @@
    1.60          CT_DoLog EXTRA "Installing C library"
    1.61          CT_DoExecLog ALL make ${JOBSFLAGS}                      \
    1.62                                "${extra_make_args[@]}"           \
    1.63 -                              install_root="${CT_SYSROOT_DIR}"  \
    1.64 +                              install_root="${CT_SYSROOT_DIR}${extra_dir}"  \
    1.65                                install
    1.66  
    1.67          if [ "${CT_BUILD_MANUALS}" = "y" ]; then