mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-02-20 17:12:55 +00:00
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>
This commit is contained in:
parent
a150a97e44
commit
b343b0216b
@ -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
|
||||
|
@ -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}\$//;"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user