diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2009-08-19 19:52:04 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2009-08-19 19:52:04 +0200 |
commit | 4de6139e7ed8927c1d7c3f72f5efae697a3bd7ca (patch) | |
tree | 9bd09638b85d7ad2d3aaaf4b8d4f308b0f3433cf /scripts/build/libc/eglibc.sh | |
parent | 9d1cbf2b4145a6ff0ac4834be3459320b35ee7a0 (diff) | |
parent | 83a48e12f08e375bddd42ca27eab4896234a42b8 (diff) | |
download | crosstool-ng-4de6139e7ed8927c1d7c3f72f5efae697a3bd7ca.tar.gz crosstool-ng-4de6139e7ed8927c1d7c3f72f5efae697a3bd7ca.tar.bz2 crosstool-ng-4de6139e7ed8927c1d7c3f72f5efae697a3bd7ca.zip |
Merge the bash_array branch.
For every components where it makes sense, use bash arrays (instead
of a string with space-separated values) to store the options pased
to ./configure.
Diffstat (limited to 'scripts/build/libc/eglibc.sh')
-rw-r--r-- | scripts/build/libc/eglibc.sh | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh index 18fac761..245cda86 100644 --- a/scripts/build/libc/eglibc.sh +++ b/scripts/build/libc/eglibc.sh @@ -41,19 +41,21 @@ do_libc_get() { eglibc_ports="${CT_LIBC}-ports-${CT_LIBC_VERSION}.tar.bz2" # Check if every tarballs are already present - if [ -a "${CT_TARBALLS_DIR}/${eglibc}" ] && \ - [ -a "${CT_TARBALLS_DIR}/${eglibc_linuxthreads}" ] && \ - [ -a "${CT_TARBALLS_DIR}/${eglibc_localedef}" ] && \ - [ -a "${CT_TARBALLS_DIR}/${eglibc_ports}" ]; then + if [ -f "${CT_TARBALLS_DIR}/${eglibc}" \ + -a -f "${CT_TARBALLS_DIR}/${eglibc_linuxthreads}" \ + -a -f "${CT_TARBALLS_DIR}/${eglibc_localedef}" \ + -a -f "${CT_TARBALLS_DIR}/${eglibc_ports}" \ + ]; then CT_DoLog DEBUG "Already have 'eglibc-${CT_LIBC_VERSION}'" return 0 fi - if [ -a "${CT_LOCAL_TARBALLS_DIR}/${eglibc}" ] && \ - [ -a "${CT_LOCAL_TARBALLS_DIR}/${eglibc_linuxthreads}" ] && \ - [ -a "${CT_LOCAL_TARBALLS_DIR}/${eglibc_localedef}" ] && \ - [ -a "${CT_LOCAL_TARBALLS_DIR}/${eglibc_ports}" ] && \ - [ "${CT_FORCE_DOWNLOAD}" != "y" ]; then + if [ -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc}" \ + -a -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_linuxthreads}" \ + -a -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_localedef}" \ + -a -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_ports}" \ + "${CT_FORCE_DOWNLOAD}" != "y" \ + ]; then CT_DoLog DEBUG "Got 'eglibc-${CT_LIBC_VERSION}' from local storage" for file in ${eglibc} ${eglibc_linuxthreads} ${eglibc_localedef} ${eglibc_ports}; do CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${file}" "${CT_TARBALLS_DIR}/${file}" @@ -199,6 +201,8 @@ do_libc_start_files() { # This function builds and install the full glibc do_libc() { + local -a extra_config + CT_DoStep INFO "Installing C library" mkdir -p "${CT_BUILD_DIR}/build-libc" @@ -210,32 +214,32 @@ do_libc() { # We don't need to be conditional on wether the user did set different # values, as they CT_LIBC_GLIBC_EXTRA_CONFIG is passed after extra_config - extra_config="--enable-kernel=$(echo ${CT_LIBC_GLIBC_MIN_KERNEL} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;')" + extra_config+=("--enable-kernel=$(echo ${CT_LIBC_GLIBC_MIN_KERNEL} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;')") case "${CT_THREADS}" in - nptl) extra_config="${extra_config} --with-__thread --with-tls";; - linuxthreads) extra_config="${extra_config} --with-__thread --without-tls --without-nptl";; - none) extra_config="${extra_config} --without-__thread --without-nptl" + nptl) extra_config+=("--with-__thread" "--with-tls");; + linuxthreads) extra_config+=("--with-__thread" "--without-tls" "--without-nptl");; + none) extra_config+=("--without-__thread" "--without-nptl") case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in *-tls*) ;; - *) extra_config="${extra_config} --without-tls";; + *) extra_config+=("--without-tls");; esac ;; esac case "${CT_SHARED_LIBS}" in - y) extra_config="${extra_config} --enable-shared";; - *) extra_config="${extra_config} --disable-shared";; + y) extra_config+=("--enable-shared");; + *) extra_config+=("--disable-shared");; esac case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in - y,) extra_config="${extra_config} --with-fp";; - ,y) extra_config="${extra_config} --without-fp";; + y,) extra_config+=("--with-fp");; + ,y) extra_config+=("--without-fp");; esac case "$(do_libc_add_ons_list ,)" in "") ;; - *) extra_config="${extra_config} --enable-add-ons=$(do_libc_add_ons_list ,)";; + *) extra_config+=("--enable-add-ons=$(do_libc_add_ons_list ,)");; esac extra_cc_args="${extra_cc_args} ${CT_ARCH_ENDIAN_OPT}" @@ -244,7 +248,7 @@ do_libc() { CT_DoLog DEBUG "Using gcc for target: '${cross_cc}'" CT_DoLog DEBUG "Configuring with addons : '$(do_libc_add_ons_list ,)'" - CT_DoLog DEBUG "Extra config args passed: '${extra_config}'" + CT_DoLog DEBUG "Extra config args passed: '${extra_config[*]}'" CT_DoLog DEBUG "Extra CC args passed : '${extra_cc_args}'" BUILD_CC="${CT_BUILD}-gcc" \ @@ -261,7 +265,7 @@ do_libc() { --disable-profile \ --without-gd \ --without-cvs \ - ${extra_config} \ + "${extra_config[@]}" \ ${CT_LIBC_GLIBC_EXTRA_CONFIG} CT_DoLog EXTRA "Building C library" |