diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-01-22 22:35:18 +0100 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-01-22 22:35:18 +0100 |
commit | b343b0216b476129b1117f20d1f642b6d86e358f (patch) | |
tree | b235a680fd629d4187cddc56bec67567b0aa4699 | |
parent | a150a97e4468caf1ef6167ee3a61b8fbaaac35d8 (diff) | |
download | crosstool-ng-b343b0216b476129b1117f20d1f642b6d86e358f.tar.gz crosstool-ng-b343b0216b476129b1117f20d1f642b6d86e358f.tar.bz2 crosstool-ng-b343b0216b476129b1117f20d1f642b6d86e358f.zip |
libc/glibc: commonalise assembling the list of addons
glibc and eglibc each have two very similar ways of building this list.
This can, and should definitetly, be shared.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rw-r--r-- | scripts/build/libc/glibc-eglibc.sh-common | 8 | ||||
-rw-r--r-- | scripts/build/libc/glibc.sh | 13 |
2 files changed, 5 insertions, 16 deletions
diff --git a/scripts/build/libc/glibc-eglibc.sh-common b/scripts/build/libc/glibc-eglibc.sh-common index 75521ccd..50cd4505 100644 --- a/scripts/build/libc/glibc-eglibc.sh-common +++ b/scripts/build/libc/glibc-eglibc.sh-common @@ -243,14 +243,16 @@ do_libc_finish() { # Build up the addons list, separated with $1 do_libc_add_ons_list() { local sep="$1" - local addons_list=$(echo "${CT_LIBC_ADDONS_LIST//,/${sep}}" |tr -s ,) + local addons_list="$( echo "${CT_LIBC_ADDONS_LIST}" \ + |sed -r -e "s/[[:space:],]/${sep}/g;" \ + )" case "${CT_THREADS}" in none) ;; *) addons_list="${addons_list}${sep}${CT_THREADS}";; esac [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons_list="${addons_list}${sep}ports" - addons_list="${addons_list%%${sep}}" - echo "${addons_list##${sep}}" + # Remove duplicate, leading and trailing separators + echo "${addons_list}" |sed -r -e "s/${sep}+/${sep}/g; s/^${sep}//; s/${sep}\$//;" } # Compute up the minimum supported Linux kernel version diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index d06a9a19..b079e6f8 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -263,16 +263,3 @@ do_libc() { CT_EndStep } - -# Build up the addons list, separated with $1 -do_libc_add_ons_list() { - local sep="$1" - local addons_list=$(echo "${CT_LIBC_ADDONS_LIST}" |sed -r -e "s/[ ,]/${sep}/g;") - case "${CT_THREADS}" in - none) ;; - *) addons_list="${addons_list}${sep}${CT_THREADS}";; - esac - [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons_list="${addons_list}${sep}ports" - # Remove duplicate, leading and trailing separators - echo "${addons_list}" |sed -r -e "s/${sep}+/${sep}/g; s/^${sep}//; s/${sep}\$//;" -} |