mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-02-21 17:26:41 +00:00
Revert "glibc: Remove support for downloading and extracting add-ons"
This reverts commit 39273e0843cc5f7f91d50651b299a0472f59f472.
This commit is contained in:
parent
e2110b21c8
commit
f6ef2be9f3
@ -5,6 +5,9 @@
|
|||||||
do_libc_get() {
|
do_libc_get() {
|
||||||
local date
|
local date
|
||||||
local version
|
local version
|
||||||
|
local -a addons_list
|
||||||
|
|
||||||
|
addons_list=($(do_libc_add_ons_list " "))
|
||||||
|
|
||||||
# Main source
|
# Main source
|
||||||
if [ "${CT_LIBC_GLIBC_CUSTOM}" = "y" ]; then
|
if [ "${CT_LIBC_GLIBC_CUSTOM}" = "y" ]; then
|
||||||
@ -23,16 +26,80 @@ do_libc_get() {
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# C library addons
|
||||||
|
for addon in "${addons_list[@]}"; do
|
||||||
|
# Never ever try to download these add-ons,
|
||||||
|
# they've always been internal
|
||||||
|
case "${addon}" in
|
||||||
|
nptl) continue;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "${addon}:${CT_LIBC_GLIBC_PORTS_EXTERNAL}" in
|
||||||
|
ports:y) ;;
|
||||||
|
ports:*) continue;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if ! CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \
|
||||||
|
http://mirrors.kernel.org/sourceware/glibc \
|
||||||
|
{http,ftp,https}://ftp.gnu.org/gnu/glibc \
|
||||||
|
ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots}
|
||||||
|
then
|
||||||
|
# Some add-ons are bundled with glibc, others are
|
||||||
|
# bundled in their own tarball. Eg. NPTL is internal,
|
||||||
|
# while LinuxThreads was external. Also, for old
|
||||||
|
# versions of glibc, the libidn add-on was external,
|
||||||
|
# but with version >=2.10, it is internal.
|
||||||
|
CT_DoLog DEBUG "Addon '${addon}' could not be downloaded."
|
||||||
|
CT_DoLog DEBUG "We'll see later if we can find it in the source tree"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
do_libc_extract() {
|
do_libc_extract() {
|
||||||
|
local addon
|
||||||
|
|
||||||
CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}"
|
CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}"
|
||||||
CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}"
|
CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}"
|
||||||
# Custom glibc won't get patched, because CT_GetCustom
|
# Custom glibc won't get patched, because CT_GetCustom
|
||||||
# marks custom glibc as patched.
|
# marks custom glibc as patched.
|
||||||
CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}"
|
CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}"
|
||||||
|
|
||||||
|
# Extract the add-opns if => 2.17
|
||||||
|
if [ "${CT_LIBC_GLIBC_2_17_or_later}" != "y" ]; then
|
||||||
|
for addon in $(do_libc_add_ons_list " "); do
|
||||||
|
# If the addon was bundled with the main archive, we do not
|
||||||
|
# need to extract it. Worse, if we were to try to extract
|
||||||
|
# it, we'd get an error.
|
||||||
|
if [ -d "${addon}" ]; then
|
||||||
|
CT_DoLog DEBUG "Add-on '${addon}' already present, skipping extraction"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
CT_Extract nochdir "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
|
||||||
|
|
||||||
|
CT_TestAndAbort "Error in add-on '${addon}': both short and long names in tarball" \
|
||||||
|
-d "${addon}" -a -d "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
|
||||||
|
|
||||||
|
# Some addons have the 'long' name, while others have the
|
||||||
|
# 'short' name, but patches are non-uniformly built with
|
||||||
|
# either the 'long' or 'short' name, whatever the addons name
|
||||||
|
# but we prefer the 'short' name and avoid duplicates.
|
||||||
|
if [ -d "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" ]; then
|
||||||
|
CT_DoExecLog FILE mv "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" "${addon}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CT_DoExecLog FILE ln -s "${addon}" "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
|
||||||
|
|
||||||
|
CT_Patch nochdir "${CT_LIBC}" "${addon}-${CT_LIBC_VERSION}"
|
||||||
|
|
||||||
|
# Remove the long name since it can confuse configure scripts to run
|
||||||
|
# the same source twice.
|
||||||
|
rm "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# The configure files may be older than the configure.in files
|
# The configure files may be older than the configure.in files
|
||||||
# if using a snapshot (or even some tarballs). Fake them being
|
# if using a snapshot (or even some tarballs). Fake them being
|
||||||
# up to date.
|
# up to date.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user