1 # This file adds functions to build glibc
2 # Copyright 2007 Yann E. MORIN
3 # Licensed under the GPL v2. See COPYING in the root of this package
5 # Add the definitions common to glibc and eglibc
10 # do_libc_min_kernel_config
11 . "${CT_LIB_DIR}/scripts/build/libc/glibc-eglibc.sh-common"
19 addons_list=($(do_libc_add_ons_list " "))
22 CT_GetFile "glibc-${CT_LIBC_VERSION}" \
23 {ftp,http}://ftp.gnu.org/gnu/glibc \
24 ftp://gcc.gnu.org/pub/glibc/releases \
25 ftp://gcc.gnu.org/pub/glibc/snapshots
28 for addon in "${addons_list[@]}"; do
29 # NPTL addon is not to be downloaded, in any case
30 [ "${addon}" = "nptl" ] && continue || true
31 CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \
32 {ftp,http}://ftp.gnu.org/gnu/glibc \
33 ftp://gcc.gnu.org/pub/glibc/releases \
34 ftp://gcc.gnu.org/pub/glibc/snapshots
44 addons_list=($(do_libc_add_ons_list " "))
46 CT_Extract "glibc-${CT_LIBC_VERSION}"
48 CT_Pushd "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}"
49 CT_Patch nochdir "glibc" "${CT_LIBC_VERSION}"
52 for addon in "${addons_list[@]}"; do
53 # NPTL addon is not to be extracted, in any case
54 [ "${addon}" = "nptl" ] && continue || true
55 CT_Extract nochdir "glibc-${addon}-${CT_LIBC_VERSION}"
57 CT_TestAndAbort "Error in add-on '${addon}': both short and long names in tarball" \
58 -d "${addon}" -a -d "glibc-${addon}-${CT_LIBC_VERSION}"
60 # Some addons have the 'long' name, while others have the
61 # 'short' name, but patches are non-uniformly built with
62 # either the 'long' or 'short' name, whatever the addons name
63 # but we prefer the 'short' name and avoid duplicates.
64 if [ -d "glibc-${addon}-${CT_LIBC_VERSION}" ]; then
65 mv "glibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
68 ln -s "${addon}" "glibc-${addon}-${CT_LIBC_VERSION}"
70 CT_Patch nochdir "glibc" "${addon}-${CT_LIBC_VERSION}"
72 # Remove the long name since it can confuse configure scripts to run
73 # the same source twice.
74 rm "glibc-${addon}-${CT_LIBC_VERSION}"
77 # The configure files may be older than the configure.in files
78 # if using a snapshot (or even some tarballs). Fake them being
81 find . -type f -name configure -exec touch {} \; 2>&1 |CT_DoLog ALL
88 # There is nothing to do for glibc check config
89 do_libc_check_config() {