scripts/build/libc_glibc.sh
changeset 523 010f6f4e4dd6
parent 496 f31cc6a00472
child 710 021546adce69
child 904 07a013bc98a4
     1.1 --- a/scripts/build/libc_glibc.sh	Sun May 11 12:53:37 2008 +0000
     1.2 +++ b/scripts/build/libc_glibc.sh	Tue May 20 21:32:39 2008 +0000
     1.3 @@ -5,7 +5,7 @@
     1.4  do_print_filename() {
     1.5      [ "${CT_LIBC}" = "glibc" ] || return 0
     1.6      echo "glibc-${CT_LIBC_VERSION}"
     1.7 -    for addon in `do_libc_add_ons_list " "`; do
     1.8 +    for addon in $(do_libc_add_ons_list " "); do
     1.9          # NPTL addon is not to be downloaded, in any case
    1.10          [ "${addon}" = "nptl" ] && continue || true
    1.11          echo "glibc-${addon}-${CT_LIBC_VERSION}"
    1.12 @@ -20,7 +20,7 @@
    1.13      CT_GetFile "${CT_LIBC_FILE}" {ftp,http}://ftp.gnu.org/gnu/glibc
    1.14  
    1.15      # C library addons
    1.16 -    for addon in `do_libc_add_ons_list " "`; do
    1.17 +    for addon in $(do_libc_add_ons_list " "); do
    1.18          # NPTL addon is not to be downloaded, in any case
    1.19          [ "${addon}" = "nptl" ] && continue || true
    1.20          CT_GetFile "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" {ftp,http}://ftp.gnu.org/gnu/glibc
    1.21 @@ -34,7 +34,7 @@
    1.22      CT_ExtractAndPatch "${CT_LIBC_FILE}"
    1.23  
    1.24      # C library addons
    1.25 -    for addon in `do_libc_add_ons_list " "`; do
    1.26 +    for addon in $(do_libc_add_ons_list " "); do
    1.27          # NPTL addon is not to be extracted, in any case
    1.28          [ "${addon}" = "nptl" ] && continue || true
    1.29          CT_ExtractAndPatch "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
    1.30 @@ -77,15 +77,15 @@
    1.31      # Override libc_cv_ppc_machine so glibc-cvs doesn't complain
    1.32      # 'a version of binutils that supports .machine "altivec" is needed'.
    1.33  
    1.34 -    addons_config="--enable-add-ons=`do_libc_add_ons_list ,`"
    1.35 +    addons_config="--enable-add-ons=$(do_libc_add_ons_list ,)"
    1.36      # We need to remove any threading addon when installing headers
    1.37      addons_config="${addons_config//nptl/}"
    1.38      addons_config="${addons_config//linuxthreads/}"
    1.39 -    addons_config=`echo "${addons_config}" |sed -r -e 's/^,+//; s/,+$//; s/,+/,/g;'`
    1.40 +    addons_config=$(echo "${addons_config}" |sed -r -e 's/^,+//; s/,+$//; s/,+/,/g;')
    1.41  
    1.42 -    cross_cc=`CT_Which "${CT_TARGET}-gcc"`
    1.43 -    CT_DoLog DEBUG "Using gcc for target: \"${cross_cc}\""
    1.44 -    CT_DoLog DEBUG "Extra config passed : \"${addons_config}\""
    1.45 +    cross_cc=$(CT_Which "${CT_TARGET}-gcc")
    1.46 +    CT_DoLog DEBUG "Using gcc for target: '${cross_cc}'"
    1.47 +    CT_DoLog DEBUG "Extra config passed : '${addons_config}'"
    1.48  
    1.49      libc_cv_ppc_machine=yes                     \
    1.50      CC=${cross_cc}                              \
    1.51 @@ -196,7 +196,7 @@
    1.52      extra_config=""
    1.53      case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
    1.54          *enable-kernel*) ;;
    1.55 -        *) extra_config="${extra_config} --enable-kernel=`echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;'`"
    1.56 +        *) extra_config="${extra_config} --enable-kernel=$(echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;')"
    1.57      esac
    1.58      case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
    1.59          *-tls*) ;;
    1.60 @@ -213,7 +213,7 @@
    1.61      # Obviously, we want threads, as we come here only for NPTL
    1.62      extra_config="${extra_config} --with-__thread"
    1.63  
    1.64 -    addons_config="--enable-add-ons=`do_libc_add_ons_list ,`"
    1.65 +    addons_config="--enable-add-ons=$(do_libc_add_ons_list ,)"
    1.66      extra_config="${extra_config} ${addons_config}"
    1.67  
    1.68      # Add some default CC args
    1.69 @@ -229,11 +229,11 @@
    1.70      fi
    1.71      extra_cc_args="${extra_cc_args} ${CT_ARCH_ENDIAN_OPT}"
    1.72  
    1.73 -    cross_cc=`CT_Which "${CT_TARGET}-gcc"`
    1.74 -    CT_DoLog DEBUG "Using gcc for target    : \"${cross_cc}\""
    1.75 -    CT_DoLog DEBUG "Configuring with addons : \"`do_libc_add_ons_list ,`\""
    1.76 -    CT_DoLog DEBUG "Extra config args passed: \"${extra_config}\""
    1.77 -    CT_DoLog DEBUG "Extra CC args passed    : \"${extra_cc_args}\""
    1.78 +    cross_cc=$(CT_Which "${CT_TARGET}-gcc")
    1.79 +    CT_DoLog DEBUG "Using gcc for target    : '${cross_cc}'"
    1.80 +    CT_DoLog DEBUG "Configuring with addons : '$(do_libc_add_ons_list ,)'"
    1.81 +    CT_DoLog DEBUG "Extra config args passed: '${extra_config}'"
    1.82 +    CT_DoLog DEBUG "Extra CC args passed    : '${extra_cc_args}'"
    1.83  
    1.84      # Super-H really needs to set configparms as of gcc-3.4/glibc-2.3.2
    1.85      # note: this is awkward, doesn't work well if you need more than one
    1.86 @@ -292,7 +292,7 @@
    1.87      # We don't need to be conditional on wether the user did set different
    1.88      # values, as they CT_LIBC_GLIBC_EXTRA_CONFIG is passed after extra_config
    1.89  
    1.90 -    extra_config="--enable-kernel=`echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;'`"
    1.91 +    extra_config="--enable-kernel=$(echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;')"
    1.92  
    1.93      case "${CT_THREADS}" in
    1.94          nptl)           extra_config="${extra_config} --with-__thread --with-tls";;
    1.95 @@ -315,9 +315,9 @@
    1.96          ,y) extra_config="${extra_config} --without-fp";;
    1.97      esac
    1.98  
    1.99 -    case "`do_libc_add_ons_list ,`" in
   1.100 +    case "$(do_libc_add_ons_list ,)" in
   1.101          "") ;;
   1.102 -        *)  extra_config="${extra_config} --enable-add-ons=`do_libc_add_ons_list ,`";;
   1.103 +        *)  extra_config="${extra_config} --enable-add-ons=$(do_libc_add_ons_list ,)";;
   1.104      esac
   1.105  
   1.106  
   1.107 @@ -334,11 +334,11 @@
   1.108      fi
   1.109      extra_cc_args="${extra_cc_args} ${CT_ARCH_ENDIAN_OPT}"
   1.110  
   1.111 -    cross_cc=`CT_Which "${CT_TARGET}-gcc"`
   1.112 -    CT_DoLog DEBUG "Using gcc for target    : \"${cross_cc}\""
   1.113 -    CT_DoLog DEBUG "Configuring with addons : \"`do_libc_add_ons_list ,`\""
   1.114 -    CT_DoLog DEBUG "Extra config args passed: \"${extra_config}\""
   1.115 -    CT_DoLog DEBUG "Extra CC args passed    : \"${extra_cc_args}\""
   1.116 +    cross_cc=$(CT_Which "${CT_TARGET}-gcc")
   1.117 +    CT_DoLog DEBUG "Using gcc for target    : '${cross_cc}'"
   1.118 +    CT_DoLog DEBUG "Configuring with addons : '$(do_libc_add_ons_list ,)'"
   1.119 +    CT_DoLog DEBUG "Extra config args passed: '${extra_config}'"
   1.120 +    CT_DoLog DEBUG "Extra CC args passed    : '${extra_cc_args}'"
   1.121  
   1.122      # sh3 and sh4 really need to set configparms as of gcc-3.4/glibc-2.3.2
   1.123      # note: this is awkward, doesn't work well if you need more than one line in configparms
   1.124 @@ -446,7 +446,7 @@
   1.125          for dir in lib lib64 usr/lib usr/lib64; do
   1.126              if [ -f "${CT_SYSROOT_DIR}/${dir}/${file}" -a ! -L ${CT_SYSROOT_DIR}/$lib/$file ]; then
   1.127                  cp "${CT_SYSROOT_DIR}/${dir}/${file}" "${CT_SYSROOT_DIR}/${dir}/${file}_orig"
   1.128 -                CT_DoLog DEBUG "Fixing \"${CT_SYS_ROOT_DIR}/${dir}/${file}\""
   1.129 +                CT_DoLog DEBUG "Fixing '${CT_SYS_ROOT_DIR}/${dir}/${file}'"
   1.130                  sed -i -r -e 's,/usr/lib/,,g;
   1.131                                s,/usr/lib64/,,g;
   1.132                                s,/lib/,,g;
   1.133 @@ -488,7 +488,7 @@
   1.134  # Build up the addons list, separated with $1
   1.135  do_libc_add_ons_list() {
   1.136      local sep="$1"
   1.137 -    local addons_list=`echo "${CT_LIBC_ADDONS_LIST//,/${sep}}" |tr -s ,`
   1.138 +    local addons_list=$(echo "${CT_LIBC_ADDONS_LIST//,/${sep}}" |tr -s ,)
   1.139      case "${CT_THREADS}" in
   1.140          none)   ;;
   1.141          *)      addons_list="${addons_list}${sep}${CT_THREADS}";;